diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2014-03-11 20:48:48 +0100 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2014-03-11 20:48:48 +0100 |
commit | b96bc2fcc06cc6c1762dc193a5117ebcb956e220 (patch) | |
tree | 4915ecb47936524433c6578526cc5d25a0d2913c /src/pki/commands/req.c | |
parent | 4a7efb286aaf809849d56841b59c2d733e8dff49 (diff) | |
parent | 15fb7904f4431a6e7c305fd08732458f7f885e7e (diff) | |
download | vyos-strongswan-b96bc2fcc06cc6c1762dc193a5117ebcb956e220.tar.gz vyos-strongswan-b96bc2fcc06cc6c1762dc193a5117ebcb956e220.zip |
Merge tag 'upstream/5.1.2'
Upstream version 5.1.2
Diffstat (limited to 'src/pki/commands/req.c')
-rw-r--r-- | src/pki/commands/req.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pki/commands/req.c b/src/pki/commands/req.c index 628463e7b..5b2c128b7 100644 --- a/src/pki/commands/req.c +++ b/src/pki/commands/req.c @@ -16,6 +16,7 @@ */ #include <time.h> +#include <errno.h> #include "pki.h" @@ -118,7 +119,12 @@ static int req() { chunk_t chunk; - chunk = chunk_from_fd(0); + if (!chunk_from_fd(0, &chunk)) + { + fprintf(stderr, "reading private key failed: %s\n", strerror(errno)); + error = ""; + goto end; + } private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, type, BUILD_BLOB, chunk, BUILD_END); free(chunk.ptr); |