Open brabanod opened 4 years ago
Description: When initializing ECSignature with wrong data, the conversion in ASN1.toASN1Element crashes for at
ECSignature
ASN1.toASN1Element
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)
Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
Same here with ECPublicKey
Description: When initializing
ECSignature
with wrong data, the conversion inASN1.toASN1Element
crashes for atReproduce:
Expected:
ECSignature
throws an error.Actual: Program crashes with the following message:
Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)