aboutsummaryrefslogtreecommitdiffstats
path: root/sm/encrypt.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2009-06-02 15:46:59 +0000
committerWerner Koch <[email protected]>2009-06-02 15:46:59 +0000
commit323cca8041a6cef395cbb2a0c225e2e1cb9d3b30 (patch)
treea094bc29089094746bbc3913ef7cb92517de9d64 /sm/encrypt.c
parentFix bug#1069. (diff)
downloadgnupg-323cca8041a6cef395cbb2a0c225e2e1cb9d3b30.tar.gz
gnupg-323cca8041a6cef395cbb2a0c225e2e1cb9d3b30.zip
Fix for bug#1066.
A couple of minor changes.
Diffstat (limited to 'sm/encrypt.c')
-rw-r--r--sm/encrypt.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sm/encrypt.c b/sm/encrypt.c
index 016e98fd5..a526a649e 100644
--- a/sm/encrypt.c
+++ b/sm/encrypt.c
@@ -207,22 +207,10 @@ encrypt_dek (const DEK dek, ksba_cert_t cert, unsigned char **encval)
gcry_sexp_release (s_data);
gcry_sexp_release (s_pkey);
- /* reformat it */
- len = gcry_sexp_sprint (s_ciph, GCRYSEXP_FMT_CANON, NULL, 0);
- assert (len);
- buf = xtrymalloc (len);
- if (!buf)
- {
- gpg_error_t tmperr = out_of_core ();
- gcry_sexp_release (s_ciph);
- return tmperr;
- }
- len = gcry_sexp_sprint (s_ciph, GCRYSEXP_FMT_CANON, (char*)buf, len);
- assert (len);
+ /* Reformat it. */
+ rc = make_canon_sexp (s_ciph, encval, NULL);
gcry_sexp_release (s_ciph);
-
- *encval = buf;
- return 0;
+ return rc;
}