Make GnuTLS parse_pkcs12() return extra certificates from the PKCS#12 too
authorDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 31 May 2012 15:20:14 +0000 (16:20 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 31 May 2012 20:38:02 +0000 (21:38 +0100)
commit923bc36dd2e3f1b677242285cb06a07b3dab883b
treed9bb8814496737f64d120635dde99d571e452b83
parent886a95fb74930421db7c72de68c7e4de744f9025
Make GnuTLS parse_pkcs12() return extra certificates from the PKCS#12 too

Create a separate list, return them for the caller to do with as it sees fit.

This also cleans up the error handling a little. When this was a purely
internal GnuTLS function, it was fine to leave things (like *key) allocated
and return an error. If my intention is to make this exportable, then it
ought to clean up after itself when returning an error.

I think this actually fixes a potential memory leak for the GnuTLS internal
caller of this function, too.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
gnutls.c
gnutls_pkcs12.c