fixed crash in openssl signature verification if sizeof(size_t) != sizeof(int) (64bit)

This commit is contained in:
Martin Willi
2008-10-31 17:05:40 +00:00
parent b74bc4384c
commit a13862be61
@@ -77,6 +77,7 @@ static bool build_emsa_pkcs1_signature(private_openssl_rsa_private_key_t *this,
int type, chunk_t data, chunk_t *signature) int type, chunk_t data, chunk_t *signature)
{ {
bool success = FALSE; bool success = FALSE;
u_int len;
const EVP_MD *hasher = EVP_get_digestbynid(type); const EVP_MD *hasher = EVP_get_digestbynid(type);
if (!hasher) if (!hasher)
{ {
@@ -107,10 +108,11 @@ static bool build_emsa_pkcs1_signature(private_openssl_rsa_private_key_t *this,
*signature = chunk_alloc(RSA_size(this->rsa)); *signature = chunk_alloc(RSA_size(this->rsa));
if (!EVP_SignFinal(ctx, signature->ptr, &signature->len, key)) if (!EVP_SignFinal(ctx, signature->ptr, &len, key))
{ {
goto error; goto error;
} }
signature->len = len;
success = TRUE; success = TRUE;