-/* p12_attr.c */
/*
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
* 1999.
*/
#include <stdio.h>
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
#include <openssl/pkcs12.h>
+#include "p12_lcl.h"
/* Add a local keyid to a safebag */
char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag)
{
ASN1_TYPE *atype;
- if (!(atype = PKCS12_get_attr(bag, NID_friendlyName)))
+
+ if ((atype = PKCS12_get_attr(bag, NID_friendlyName)) == NULL)
return NULL;
if (atype->type != V_ASN1_BMPSTRING)
return NULL;
return OPENSSL_uni2asc(atype->value.bmpstring->data,
atype->value.bmpstring->length);
}
+
+STACK_OF(X509_ATTRIBUTE) *PKCS12_SAFEBAG_get0_attrs(PKCS12_SAFEBAG *bag)
+{
+ return bag->attrib;
+}