diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-05-30 17:07:18 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-05-30 17:07:18 +0000 |
commit | 94299a36a6ec2fe2155d94a75c9d4a1c191fe4e2 (patch) | |
tree | 6f934084f1a0a19d623abce5b34a36b84e4a38c1 /engines/e_capi.c | |
parent | 3aaeb5c1e505cca00bf88dc68a86ad9b945fa680 (diff) |
Update error codes.
Diffstat (limited to 'engines/e_capi.c')
-rw-r--r-- | engines/e_capi.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/e_capi.c b/engines/e_capi.c index a30a12b2a6..445ec91af0 100644 --- a/engines/e_capi.c +++ b/engines/e_capi.c @@ -827,35 +827,36 @@ static DSA_SIG *capi_dsa_do_sign(const unsigned char *digest, int dlen, if (!capi_key) { - CAPIerr(CAPI_F_CAPI_RSA_SIGN, CAPI_R_CANT_GET_KEY); + CAPIerr(CAPI_F_CAPI_DSA_DO_SIGN, CAPI_R_CANT_GET_KEY); return NULL; } if (dlen != 20) { - /* Invalid signature length */ + CAPIerr(CAPI_F_CAPI_DSA_DO_SIGN, CAPI_R_INVALID_DIGEST_LENGTH); + return NULL; } /* Create the hash object */ if(!CryptCreateHash(capi_key->hprov, CALG_SHA1, 0, 0, &hash)) { - CAPIerr(CAPI_F_CAPI_RSA_SIGN, CAPI_R_CANT_CREATE_HASH_OBJECT); + CAPIerr(CAPI_F_CAPI_DSA_DO_SIGN, CAPI_R_CANT_CREATE_HASH_OBJECT); capi_addlasterror(); return NULL; } /* Set the hash value to the value passed */ if(!CryptSetHashParam(hash, HP_HASHVAL, (unsigned char *)digest, 0)) { - CAPIerr(CAPI_F_CAPI_RSA_SIGN, CAPI_R_CANT_SET_HASH_VALUE); + CAPIerr(CAPI_F_CAPI_DSA_DO_SIGN, CAPI_R_CANT_SET_HASH_VALUE); capi_addlasterror(); goto err; } /* Finally sign it */ - slen = 40; + slen = sizeof(csigbuf); if(!CryptSignHash(hash, AT_SIGNATURE, NULL, 0, csigbuf, &slen)) { - CAPIerr(CAPI_F_CAPI_RSA_SIGN, CAPI_R_ERROR_SIGNING_HASH); + CAPIerr(CAPI_F_CAPI_DSA_DO_SIGN, CAPI_R_ERROR_SIGNING_HASH); capi_addlasterror(); goto err; } |