1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-10-15 11:26:40 +03:00

* Basic constraint/key usage v3 extensions now supported

* Test harness must now be run without built-in default cert

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@274 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich
2016-12-30 21:59:50 +00:00
committed by Ivan Grokhotkov
parent a2c7c7e40a
commit acab61d0e0
49 changed files with 1080 additions and 148 deletions

View File

@@ -223,7 +223,7 @@ end_bool:
}
/**
* Convert an ASN.1 bit string into a 32 bit integer
* Convert an ASN.1 bit string into a 32 bit integer. Used for key usage
*/
int asn1_get_bit_string_as_int(const uint8_t *buf, int *offset, uint32_t *val)
{
@@ -241,16 +241,20 @@ int asn1_get_bit_string_as_int(const uint8_t *buf, int *offset, uint32_t *val)
ignore_bits = buf[(*offset)++];
len--;
*val = 0;
for (i = 0; i < len; i++)
/* not sure why key usage doesn't used proper DER spec version */
for (i = len-1; i >= 0; --i)
{
*val <<= 8;
*val |= buf[(*offset)++];
*val |= buf[(*offset) + i];
}
for (i = 0; i < ignore_bits; i++)
*offset += len;
/*for (i = 0; i < ignore_bits; i++)
{
*val >>= 1;
}
}*/
end_bit_string_as_int:
return res;