diff options
author | Dr. Stephen Henson <steve@openssl.org> | 1999-05-09 16:39:11 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 1999-05-09 16:39:11 +0000 |
commit | c8b41850793faed7fccf4fe4403f774266412f22 (patch) | |
tree | 13fb852b77834ea483e7d194453cee1d0dda5678 /crypto/pkcs7 | |
parent | 1c10afc32a40d9bf27848790d84ec19ecc4c9768 (diff) |
Kill evil casts, fix PKCS#7 and add new X509V3 Function.
Diffstat (limited to 'crypto/pkcs7')
-rw-r--r-- | crypto/pkcs7/pk7_doit.c | 12 | ||||
-rw-r--r-- | crypto/pkcs7/pk7_lib.c | 5 | ||||
-rw-r--r-- | crypto/pkcs7/pkcs7.h | 4 |
3 files changed, 10 insertions, 11 deletions
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index 67085e3956..1536aa8c1d 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -62,7 +62,7 @@ #include <openssl/objects.h> #include <openssl/x509.h> -static int add_attribute(STACK **sk, int nid, int atrtype, char *value); +static int add_attribute(STACK **sk, int nid, int atrtype, void *value); static ASN1_TYPE *get_attribute(STACK *sk, int nid); #if 1 @@ -567,7 +567,7 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) sign_time=X509_gmtime_adj(NULL,0); PKCS7_add_signed_attribute(si, NID_pkcs9_signingTime, - V_ASN1_UTCTIME,(char *)sign_time); + V_ASN1_UTCTIME,sign_time); /* Add digest */ md_tmp=EVP_MD_CTX_type(&ctx_tmp); @@ -575,7 +575,7 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) digest=ASN1_OCTET_STRING_new(); ASN1_OCTET_STRING_set(digest,md_data,md_len); PKCS7_add_signed_attribute(si,NID_pkcs9_messageDigest, - V_ASN1_OCTET_STRING,(char *)digest); + V_ASN1_OCTET_STRING,digest); /* Now sign the mess */ EVP_SignInit(&ctx_tmp,md_tmp); @@ -874,18 +874,18 @@ int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si, STACK *sk) } int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, - char *value) + void *value) { return(add_attribute(&(p7si->auth_attr),nid,atrtype,value)); } int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, - char *value) + void *value) { return(add_attribute(&(p7si->unauth_attr),nid,atrtype,value)); } -static int add_attribute(STACK **sk, int nid, int atrtype, char *value) +static int add_attribute(STACK **sk, int nid, int atrtype, void *value) { X509_ATTRIBUTE *attr=NULL; diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c index e8c279dc93..7bba23e3d4 100644 --- a/crypto/pkcs7/pk7_lib.c +++ b/crypto/pkcs7/pk7_lib.c @@ -309,15 +309,14 @@ int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, p7i->digest_alg->algorithm=OBJ_nid2obj(NID_sha1); else p7i->digest_alg->algorithm=OBJ_nid2obj(EVP_MD_type(dgst)); - p7i->digest_enc_alg->algorithm=OBJ_nid2obj(EVP_MD_pkey_type(dgst)); -#if 1 + p7i->digest_enc_alg->algorithm=OBJ_nid2obj(EVP_PKEY_type(pkey->type)); + if (p7i->digest_enc_alg->parameter != NULL) ASN1_TYPE_free(p7i->digest_enc_alg->parameter); if ((p7i->digest_enc_alg->parameter=ASN1_TYPE_new()) == NULL) goto err; p7i->digest_enc_alg->parameter->type=V_ASN1_NULL; -#endif return(1); err: diff --git a/crypto/pkcs7/pkcs7.h b/crypto/pkcs7/pkcs7.h index 8541fdc89d..4afde8274b 100644 --- a/crypto/pkcs7/pkcs7.h +++ b/crypto/pkcs7/pkcs7.h @@ -340,9 +340,9 @@ int PKCS7_set_cipher(PKCS7 *p7, EVP_CIPHER *cipher); PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK *sk); int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si,int nid,int type, - char *data); + void *data); int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, - char *value); + void *value); ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, STACK *sk); |