pkcs7.c: Use pkcs7_get_version for signerInfo

The function pkcs7_get_version can be used again
when parsing the version of the signerInfo. Both
require that the version be equal to 1. The
pkcs7_get_version function will return error
if the found value is not the expected version
as opposed to mbedtls_asn1_get_int which does not.

Signed-off-by: Nick Child <nick.child@ibm.com>
This commit is contained in:
Nick Child 2022-02-25 11:43:31 -06:00
parent 6671841d91
commit 6427b34dec

View File

@ -289,7 +289,7 @@ static int pkcs7_get_signers_info_set( unsigned char **p, unsigned char *end,
end_set = end_set_signer;
ret = mbedtls_asn1_get_int( p, end_set, &signers_set->version );
ret = pkcs7_get_version( p, end_set, &signers_set->version );
if( ret != 0 )
return( MBEDTLS_ERR_PKCS7_INVALID_SIGNER_INFO );