[gnutls-devel] libtasn1 | Draft: asn1_decode_simple_der: accept empty OCTET STRING (!95)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Feb 9 10:28:17 CET 2024



Daiki Ueno created a merge request: https://gitlab.com/gnutls/libtasn1/-/merge_requests/95

Project:Branches: dueno/libtasn1:wip/dueno/empty-octet-string to gnutls/libtasn1:master
Author:   Daiki Ueno




When the input was an empty OCTET STRING (i.e., 0x04 0x00 in DER),
asn1_decode_simple_der previously returned ASN1_DER_ERROR.

With this patch, the function properly returns zero as the length,
while the output pointer is set to the start of the input, to satisfy
the invariant that it is a valid pointer inside the input.

Fixes: #48

## Checklist
 * [ ] Code modified for feature
 * [ ] Test suite updated with functionality tests
 * [ ] Test suite updated with negative tests
 * [ ] Documentation updated

## Reviewer's checklist:
 * [ ] There is a test suite reasonably covering new functionality or modifications
 * [ ] Function naming, parameters, return values, types, etc., are consistent with other code
 * [ ] This feature/change has adequate documentation added
 * [ ] No obvious mistakes in the code

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/libtasn1/-/merge_requests/95
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20240209/6739cd5b/attachment-0001.html>


More information about the Gnutls-devel mailing list