From 6427b34dec143af38afbf302cf6c8307894d4ffe Mon Sep 17 00:00:00 2001 From: Nick Child Date: Fri, 25 Feb 2022 11:43:31 -0600 Subject: [PATCH] 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 --- library/pkcs7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/pkcs7.c b/library/pkcs7.c index 1c73709de3..5fa02e3114 100644 --- a/library/pkcs7.c +++ b/library/pkcs7.c @@ -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 );