resolved: dnssec - fix off-by-one in RSA key parsing
If the first byte of the key is zero, the key-length is stored in the second and third byte (not first and second).
This commit is contained in:
parent
5809f340fd
commit
ac04adbeb9
|
@ -238,8 +238,8 @@ static int dnssec_rsa_verify(
|
||||||
|
|
||||||
exponent = (uint8_t*) dnskey->dnskey.key + 3;
|
exponent = (uint8_t*) dnskey->dnskey.key + 3;
|
||||||
exponent_size =
|
exponent_size =
|
||||||
((size_t) (((uint8_t*) dnskey->dnskey.key)[0]) << 8) |
|
((size_t) (((uint8_t*) dnskey->dnskey.key)[1]) << 8) |
|
||||||
((size_t) ((uint8_t*) dnskey->dnskey.key)[1]);
|
((size_t) ((uint8_t*) dnskey->dnskey.key)[2]);
|
||||||
|
|
||||||
if (exponent_size < 256)
|
if (exponent_size < 256)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Reference in New Issue