Inform Java BigInteger that the input bytes are positive
The COSE spec requires exact sizes for signatures, so any leading zeros
(which indicate a positive integer) are removed. This causes BigInteger
to assume the input is negative if the leading byte is 0xff, and it strips
that byte off. This breaks conversion from COSE -> DER signatures.
Explicitly tell BigInteger the input is always positive (per the COSE
spec) so that it leaves leading 0xff alone.
Test: identity-credential-util-tests
Fixes: 201574298
Change-Id: Ib2e587964125ea15fedd8a6e3ddb2bc422c211e3
1 file changed