Merge pull request #320 from Inikup/fix-issue-318

Fix boolean values according to DER specs
This commit is contained in:
Manuel Pégourié-Gonnard 2015-11-02 05:52:42 +09:00
commit 0a543a8bc5
2 changed files with 8 additions and 8 deletions

View file

@ -191,7 +191,7 @@ int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start, int boolea
if( *p - start < 1 )
return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL );
*--(*p) = (boolean) ? 1 : 0;
*--(*p) = (boolean) ? 255 : 0;
len++;
MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) );