aboutsummaryrefslogtreecommitdiffstats
path: root/sm/encrypt.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2001-12-18 17:37:48 +0000
committerWerner Koch <[email protected]>2001-12-18 17:37:48 +0000
commit56172ce393437be1434d5af11f775c85ed72c1b0 (patch)
tree73821dd5f67e3f6c7a911d75676aea7041bd6e7a /sm/encrypt.c
parent* gpgsm.c (main): Renamed the default key database to "keyring.kbx". (diff)
downloadgnupg-56172ce393437be1434d5af11f775c85ed72c1b0.tar.gz
gnupg-56172ce393437be1434d5af11f775c85ed72c1b0.zip
Changes to be used with the new libksba interface.
libgcrypt-1.1.5 is required (cvs or tarball)
Diffstat (limited to 'sm/encrypt.c')
-rw-r--r--sm/encrypt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sm/encrypt.c b/sm/encrypt.c
index b8981508a..be2a346ae 100644
--- a/sm/encrypt.c
+++ b/sm/encrypt.c
@@ -247,7 +247,7 @@ encrypt_dek (const DEK dek, KsbaCert cert, char **encval)
{
GCRY_SEXP s_ciph, s_data, s_pkey;
int rc;
- char *buf;
+ KsbaSexp buf;
size_t len;
*encval = NULL;
@@ -259,7 +259,13 @@ encrypt_dek (const DEK dek, KsbaCert cert, char **encval)
log_error ("no public key for recipient\n");
return GNUPG_No_Public_Key;
}
- rc = gcry_sexp_sscan (&s_pkey, NULL, buf, strlen(buf));
+ len = gcry_sexp_canon_len (buf, 0, NULL, NULL);
+ if (!len)
+ {
+ log_error ("libksba did not return a proper S-Exp\n");
+ return GNUPG_Bug;
+ }
+ rc = gcry_sexp_sscan (&s_pkey, NULL, buf, len);
xfree (buf); buf = NULL;
if (rc)
{