punycode: update to use WPACKET instead of using custom range checking
authorPauli <pauli@openssl.org>
Thu, 3 Nov 2022 00:55:13 +0000 (11:55 +1100)
committerPauli <pauli@openssl.org>
Thu, 10 Nov 2022 21:14:47 +0000 (08:14 +1100)
commit905ba924398f474e647de70345b4ae4089fedba7
tree3293d5ab6af18a5c5ca27e33b0b595a8d6b1b9f6
parent373d90128042cb0409e347827d80b50a99d3965a
punycode: update to use WPACKET instead of using custom range checking

Add test for `.' overflows, remove the output size argument from
ossl_a2ulabel() since it was never used and greatly complicated the code.
Convert ossl_a2ulabel() to use WPACKET for building the output string.
Update the documentation to match the new definition of ossl_a2ulabel().

x509: let punycode handle the '\0' string termination.  Saves a memset(3)
and some size fiddling.  Also update to deal with the modified parameters.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/19591)
crypto/punycode.c
crypto/x509/v3_ncons.c
doc/internal/man3/ossl_punycode_decode.pod
include/crypto/punycode.h
test/punycode_test.c