Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion from Data to ASN1 crashes #22

Open
brabanod opened this issue Mar 14, 2020 · 1 comment
Open

Conversion from Data to ASN1 crashes #22

brabanod opened this issue Mar 14, 2020 · 1 comment

Comments

@brabanod
Copy link

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)

@cheungbo-mong
Copy link

Same here with ECPublicKey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants