Skip to content

Fix i2d_ASN1_TYPE() error check#1012

Open
ndossche wants to merge 1 commit intoruby:masterfrom
ndossche:clesss-3
Open

Fix i2d_ASN1_TYPE() error check#1012
ndossche wants to merge 1 commit intoruby:masterfrom
ndossche:clesss-3

Conversation

@ndossche
Copy link

The OpenSSL docs / LibreSSL docs are slightly misleading wrt the error return values. 0 is also an error value.
This can be proven by looking at the call chain:
i2d_ASN1_TYPE -> ASN1_item_i2d -> asn1_item_flags_i2d -> ASN1_item_ex_i2d and noticing that ASN1_item_ex_i2d can return 0 on error.

This was found by a hybrid static-dynamic analyser that looks for inconsistent handling of error checks in bindings.

The OpenSSL docs / LibreSSL docs are slightly misleading wrt the error
return values. 0 is also an error value.
This can be proven by looking at the call chain:
`i2d_ASN1_TYPE -> ASN1_item_i2d -> asn1_item_flags_i2d -> ASN1_item_ex_i2d`
and noticing that ASN1_item_ex_i2d can return 0 on error.
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

Successfully merging this pull request may close these issues.

1 participant