diff --git a/src/libstrongswan/crypto/pkcs7.c b/src/libstrongswan/crypto/pkcs7.c index 5c9550af4..7fbc1e36f 100644 --- a/src/libstrongswan/crypto/pkcs7.c +++ b/src/libstrongswan/crypto/pkcs7.c @@ -610,6 +610,14 @@ failed: return FALSE; } +/** + * Implements pkcs7_t.get_data + */ +static chunk_t get_data(private_pkcs7_t *this) +{ + return this->data; +} + /** * Implements pkcs7_t.destroy */ @@ -681,6 +689,7 @@ pkcs7_t *pkcs7_create_from_chunk(chunk_t chunk, u_int level) this->public.parse_data = (bool (*) (pkcs7_t*))parse_data; this->public.parse_signedData = (bool (*) (pkcs7_t*,x509_t*))parse_signedData; this->public.parse_envelopedData = (bool (*) (pkcs7_t*,chunk_t,rsa_private_key_t*))parse_envelopedData; + this->public.get_data = (chunk_t (*) (pkcs7_t*))get_data; this->public.destroy = (void (*) (pkcs7_t*))destroy; if (!parse_contentInfo(chunk, level, this)) diff --git a/src/libstrongswan/crypto/pkcs7.h b/src/libstrongswan/crypto/pkcs7.h index 705e8e3fe..c8473c529 100644 --- a/src/libstrongswan/crypto/pkcs7.h +++ b/src/libstrongswan/crypto/pkcs7.h @@ -96,9 +96,17 @@ struct pkcs7_t { */ bool (*parse_envelopedData) (pkcs7_t *this, chunk_t serialNumber, rsa_private_key_t *key); + /** + * @brief Returns the parsed data object + * + * @param this calling object + * @return chunk containing the data object + */ + chunk_t (*get_data) (pkcs7_t *this); + /** * @brief Destroys the contentInfo object. - * + * * @param this PKCS#7 contentInfo object to destroy */ void (*destroy) (pkcs7_t *this);