Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornmittler <nathanmittler@google.com>2016-05-19 18:49:59 +0300
committerDavid Benjamin <davidben@google.com>2016-05-19 23:30:50 +0300
commitf0322b2abce91458f62db44dc6b777fc5e0323d9 (patch)
treec08da438a21003619cf4dd187fd5d2196a386fc3 /tool/pkcs12.cc
parente09e579603bf7d05b5160bb9bd53eacea6cff47d (diff)
Use non-deprecated methods on windows.
Use of strdup, close, lseek, read, and write prevent linking statically againt libcmt.lib. Change-Id: I04f7876ec0f03f29f000bbcc6b2ccdec844452d2 Reviewed-on: https://boringssl-review.googlesource.com/8010 Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'tool/pkcs12.cc')
-rw-r--r--tool/pkcs12.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/tool/pkcs12.cc b/tool/pkcs12.cc
index fe830d66..15e32d3d 100644
--- a/tool/pkcs12.cc
+++ b/tool/pkcs12.cc
@@ -64,7 +64,7 @@ bool DoPKCS12(const std::vector<std::string> &args) {
return false;
}
- int fd = open(args_map["-dump"].c_str(), O_RDONLY);
+ int fd = BORINGSSL_OPEN(args_map["-dump"].c_str(), O_RDONLY);
if (fd < 0) {
perror("open");
return false;
@@ -73,7 +73,7 @@ bool DoPKCS12(const std::vector<std::string> &args) {
struct stat st;
if (fstat(fd, &st)) {
perror("fstat");
- close(fd);
+ BORINGSSL_CLOSE(fd);
return false;
}
const size_t size = st.st_size;
@@ -82,7 +82,7 @@ bool DoPKCS12(const std::vector<std::string> &args) {
read_result_t n;
size_t off = 0;
do {
- n = read(fd, &contents[off], size - off);
+ n = BORINGSSL_READ(fd, &contents[off], size - off);
if (n >= 0) {
off += static_cast<size_t>(n);
}
@@ -90,11 +90,11 @@ bool DoPKCS12(const std::vector<std::string> &args) {
if (off != size) {
perror("read");
- close(fd);
+ BORINGSSL_CLOSE(fd);
return false;
}
- close(fd);
+ BORINGSSL_CLOSE(fd);
printf("Enter password: ");
fflush(stdout);
@@ -102,7 +102,7 @@ bool DoPKCS12(const std::vector<std::string> &args) {
char password[256];
off = 0;
do {
- n = read(0, &password[off], sizeof(password) - 1 - off);
+ n = BORINGSSL_READ(0, &password[off], sizeof(password) - 1 - off);
if (n >= 0) {
off += static_cast<size_t>(n);
}