summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_sign.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-03-07 12:05:45 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-03-07 12:05:45 +0000
commita5667732b9ce91352c8b0e71fc93df58f0286a2f (patch)
treead424579d1d11398b39a75dc6c95a47daee599e0 /crypto/asn1/a_sign.c
parent17084562205108d08d562065b0fcbf5722a03186 (diff)
update ASN1 sign/verify to use EVP_DigestSign and EVP_DigestVerify
Diffstat (limited to 'crypto/asn1/a_sign.c')
-rw-r--r--crypto/asn1/a_sign.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/asn1/a_sign.c b/crypto/asn1/a_sign.c
index d96a622d83..018edaead7 100644
--- a/crypto/asn1/a_sign.c
+++ b/crypto/asn1/a_sign.c
@@ -219,7 +219,7 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
{
EVP_MD_CTX ctx;
unsigned char *buf_in=NULL,*buf_out=NULL;
- int inl=0,outl=0,outll=0;
+ size_t inl=0,outl=0,outll=0;
int signid, paramtype;
if (type == NULL)
@@ -270,10 +270,9 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
goto err;
}
- if (!EVP_SignInit_ex(&ctx,type, NULL)
- || !EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl)
- || !EVP_SignFinal(&ctx,(unsigned char *)buf_out,
- (unsigned int *)&outl,pkey))
+ if (!EVP_DigestVerifyInit(&ctx, NULL, type, NULL, pkey)
+ || !EVP_DigestSignUpdate(&ctx, buf_in, inl)
+ || !EVP_DigestSignFinal(&ctx, buf_out, &outl))
{
outl=0;
ASN1err(ASN1_F_ASN1_ITEM_SIGN,ERR_R_EVP_LIB);