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/self.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/self.c')
-rw-r--r-- | src/pki/commands/self.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pki/commands/self.c b/src/pki/commands/self.c index 6bf0b1353..c28c9c291 100644 --- a/src/pki/commands/self.c +++ b/src/pki/commands/self.c @@ -14,6 +14,7 @@ */ #include <time.h> +#include <errno.h> #include "pki.h" @@ -273,7 +274,12 @@ static int self() { chunk_t chunk; - chunk = chunk_from_fd(0); + if (!chunk_from_fd(0, &chunk)) + { + fprintf(stderr, "%s: ", strerror(errno)); + error = "reading private key failed"; + goto end; + } private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, type, BUILD_BLOB, chunk, BUILD_END); free(chunk.ptr); |