BlueECC icon indicating copy to clipboard operation
BlueECC copied to clipboard

Conversion from Data to ASN1 crashes

Open brabanod opened this issue 4 years ago • 1 comments

Description: When initializing ECSignature with wrong data, the conversion in ASN1.toASN1Element crashes for at

default: // octet string
    let (length, lengthOfLength) = readLength(data: data.advanced(by: 1))

Reproduce:

let signed = try ECSignature(asn1: Data(base64Encoded: "abcd")!)

Expected: ECSignature throws an error.

Actual: Program crashes with the following message: Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

brabanod avatar Mar 14 '20 12:03 brabanod

Same here with ECPublicKey

cheungbo-mong avatar Apr 28 '22 06:04 cheungbo-mong