mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Fix sig->tag update in mbedtls_x509_get_sig()
This commit is contained in:
parent
c49b808ae4
commit
4bdbe09f90
2 changed files with 6 additions and 1 deletions
|
|
@ -559,16 +559,18 @@ int mbedtls_x509_get_sig( unsigned char **p, const unsigned char *end, mbedtls_x
|
|||
{
|
||||
int ret;
|
||||
size_t len;
|
||||
int tag_type;
|
||||
|
||||
if( ( end - *p ) < 1 )
|
||||
return( MBEDTLS_ERR_X509_INVALID_SIGNATURE +
|
||||
MBEDTLS_ERR_ASN1_OUT_OF_DATA );
|
||||
|
||||
sig->tag = **p;
|
||||
tag_type = **p;
|
||||
|
||||
if( ( ret = mbedtls_asn1_get_bitstring_null( p, end, &len ) ) != 0 )
|
||||
return( MBEDTLS_ERR_X509_INVALID_SIGNATURE + ret );
|
||||
|
||||
sig->tag = tag_type;
|
||||
sig->len = len;
|
||||
sig->p = *p;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue