diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2015-12-15 04:38:25 +0100 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2015-12-15 04:38:25 +0100 |
commit | 4ee881bff4c8fdfa4b3b7a4b7afab611471e97f1 (patch) | |
tree | 3698923794fd83d06195306dc5e631a1bc239fad /sm/encrypt.c | |
parent | common: Change license of isascii.c to all-premissive, (diff) | |
download | gnupg2-4ee881bff4c8fdfa4b3b7a4b7afab611471e97f1.tar.xz gnupg2-4ee881bff4c8fdfa4b3b7a4b7afab611471e97f1.zip |
sm: Handle gcry_pk_encrypt return value.
* sm/encrypt.c (encrypt_dek): Don't ignore failure of gcry_pk_encrypt.
--
Thanks to Sami Farin.
GnuPG-bug-id: 2154
Diffstat (limited to 'sm/encrypt.c')
-rw-r--r-- | sm/encrypt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sm/encrypt.c b/sm/encrypt.c index 54a8bd1e9..c677a429d 100644 --- a/sm/encrypt.c +++ b/sm/encrypt.c @@ -212,8 +212,11 @@ encrypt_dek (const DEK dek, ksba_cert_t cert, unsigned char **encval) gcry_sexp_release (s_pkey); /* Reformat it. */ - rc = make_canon_sexp (s_ciph, encval, NULL); - gcry_sexp_release (s_ciph); + if (!rc) + { + rc = make_canon_sexp (s_ciph, encval, NULL); + gcry_sexp_release (s_ciph); + } return rc; } |