Commit 4d29312c authored by Ben Laurie's avatar Ben Laurie
Browse files

Yet more typesafety.

parent c129544f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ typedef struct evp_pkey_st
#endif
		} pkey;
	int save_parameters;
	STACK /*X509_ATTRIBUTE*/ *attributes; /* [ 0 ] */
	STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
	} EVP_PKEY;

#define EVP_PKEY_MO_SIGN	0x0001
+6 −4
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <openssl/asn1.h>
#include <openssl/pem.h>
#include <openssl/pkcs7.h>
#include <openssl/x509.h>
#include <openssl/err.h>

int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, STACK_OF(X509_ALGOR) *cap)
@@ -42,16 +43,17 @@ int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, STACK_OF(X509_ALGOR) *cap)
							V_ASN1_SEQUENCE, seq);
}

STACK *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si)
STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si)
{
	ASN1_TYPE *cap;
	unsigned char *p;
	cap = PKCS7_get_signed_attribute(si, NID_SMIMECapabilities);
	if (!cap) return NULL;
	p = cap->value.sequence->data;
	return d2i_ASN1_SET (NULL, &p, cap->value.sequence->length, 
		(char *(*)())d2i_X509_ALGOR, X509_ALGOR_free, V_ASN1_SEQUENCE,
							 V_ASN1_UNIVERSAL);
	return d2i_ASN1_SET_OF_X509_ALGOR(NULL, &p,
					  cap->value.sequence->length,
					  d2i_X509_ALGOR, X509_ALGOR_free,
					  V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL);
}

/* Basic smime-capabilities OID and optional integer arg */
+1 −1
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags);

int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
			      STACK_OF(X509_ALGOR) *cap);
STACK *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);

int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);