pki: Switch to binary mode on Windows when reading/writing DER to FDs

This commit is contained in:
Martin Willi
2014-06-04 15:53:11 +02:00
parent f1e7b9b0d7
commit 13298719e3
13 changed files with 49 additions and 1 deletions
+2
View File
@@ -292,6 +292,7 @@ static int self()
{
chunk_t chunk;
set_file_mode(stdin, CERT_ASN1_DER);
if (!chunk_from_fd(0, &chunk))
{
fprintf(stderr, "%s: ", strerror(errno));
@@ -360,6 +361,7 @@ static int self()
error = "encoding certificate failed";
goto end;
}
set_file_mode(stdout, form);
if (fwrite(encoding.ptr, encoding.len, 1, stdout) != 1)
{
error = "writing certificate key failed";