initialize 'flags' etc. to invalid values before trying to decode #298
No reviewers
Labels
No labels
bug
duplicate
enhancement
feature
help wanted
improve API
invalid
needs documentation
not-planned
rtfm
stale
support
wishlist
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libtom/libtomcrypt!298
Loading…
Reference in a new issue
No description provided.
Delete branch "strict_der_decoding"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm not sure if that's really required, but I'm just putting this here to get your opinion.
@ -71,2 +71,4 @@}}else {err = CRYPT_INVALID_PACKET;Although unrelated to the main idea of this PR I think that it would be better to:
instead of:
👍 just consider my comment on
dh_import.c@ -71,2 +71,4 @@}}else {err = CRYPT_INVALID_PACKET;uhm, why?
@ -71,2 +71,4 @@}}else {err = CRYPT_INVALID_PACKET;It might got a bit tricky as we use
*_multifunctions where we use NULL as an end of args marker. Like indh_free:which means that setting
key->xto NULL is fine but only till somebody will add an extra stuff like..., &key->x, &key->extra, NULL);(which can easily happen as there is no comment indh_freethatkey->xmust be the last arg ofmp_cleanup_multi).We do not use this approach anywhere else and I am not sure if it is so useful.
@ -71,2 +71,4 @@}}else {err = CRYPT_INVALID_PACKET;makes sense
@ -71,2 +71,4 @@}}else {err = CRYPT_INVALID_PACKET;I decided to apply the change directly on the release branch, but didn't merge this PR as I'm doubting its usefulness...
When I was looking at the changes in this PR the only scenario that come to my mind was a case when something deep in the ASN.1 stuff returns
CRYPT_PK_INVALID_SIZEwhich we will falsely consider as OK/expected (like in case when there are extra input data at the end of parsing ASN.1 sequence).But it can be handled for example by a new error code like
CRYPT_SEQ_DATA_TOO_LONGwhich will be guaranteed just for the case "extra input data at the end of parsing ASN.1 sequence".The name
CRYPT_INPUT_TOO_LONGsounds good 👍I just want to confirm that I approve also the latest version of this PR.
@sjaeckel merge this depending on your plan of the next steps in the release process. IMO if there is a RC5 than I am for merging this into it. But it could also wait for the
next.