Forbid repeated X.509 extensions

This commit is contained in:
Manuel Pégourié-Gonnard 2014-11-12 17:47:28 +01:00
parent d681443f69
commit 8a5e3d4a40
3 changed files with 9 additions and 0 deletions

View file

@ -481,6 +481,10 @@ static int x509_get_crt_ext( unsigned char **p,
continue;
}
/* Forbid repeated extensions */
if( ( crt->ext_types & ext_type ) != 0 )
return( POLARSSL_ERR_X509_INVALID_EXTENSIONS );
crt->ext_types |= ext_type;
switch( ext_type )