diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2009-06-08 01:28:43 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-06-09 11:03:35 +0200 |
commit | 290b2359c296cc25bd3b9cdc234dcfc5b79e6ad1 (patch) | |
tree | b3c15e00582a5317bb73a84c9bc6c13d5e8bd0c0 /src | |
parent | 23d7e76788f018b24921549e6d38948873ec6059 (diff) | |
download | strongswan-290b2359c296cc25bd3b9cdc234dcfc5b79e6ad1.tar.bz2 strongswan-290b2359c296cc25bd3b9cdc234dcfc5b79e6ad1.tar.xz |
some fixes in pkcs7.c
Diffstat (limited to 'src')
-rw-r--r-- | src/pluto/pkcs7.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pluto/pkcs7.c b/src/pluto/pkcs7.c index 34cc4b21e..7248b042f 100644 --- a/src/pluto/pkcs7.c +++ b/src/pluto/pkcs7.c @@ -601,6 +601,7 @@ chunk_t pkcs7_messageDigest_attribute(chunk_t content, int digest_alg) hash_alg = hasher_algorithm_from_oid(digest_alg); hasher = lib->crypto->create_hasher(lib->crypto, hash_alg); hasher->allocate_hash(hasher, content, &digest); + hasher->destroy(hasher); return asn1_wrap(ASN1_SEQUENCE, "cm", ASN1_messageDigest_oid, @@ -659,7 +660,7 @@ chunk_t pkcs7_build_issuerAndSerialNumber(const x509cert_t *cert) { return asn1_wrap(ASN1_SEQUENCE, "cm" , cert->issuer - , asn1_simple_object(ASN1_INTEGER, cert->serialNumber)); + , asn1_integer("c", cert->serialNumber)); } /** @@ -773,8 +774,6 @@ chunk_t pkcs7_build_envelopedData(chunk_t data, const x509cert_t *cert, int enc_ crypter->encrypt(crypter, in, iv, &out); crypter->destroy(crypter); DBG3("encrypted data %B", &out); - free(in.ptr); - free(iv.ptr); cert->public_key->encrypt(cert->public_key, symmetricKey, &protectedKey); @@ -813,6 +812,8 @@ chunk_t pkcs7_build_envelopedData(chunk_t data, const x509cert_t *cert, int enc_ free(envelopedData.content.ptr); free(symmetricKey.ptr); + free(in.ptr); + free(iv.ptr); return cInfo; } } |