diff options
author | Petr Gotthard <petr.gotthard@centrum.cz> | 2021-02-06 21:47:20 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-02-09 11:15:55 +0100 |
commit | 604b86d8d360e36fc2fc0d1611d05bf38699d297 (patch) | |
tree | 5969f02f05293556906af2a19a4a3066b331f8ad /doc/man3 | |
parent | e60a748a13a244e8b13bacca18bad9bb3505aa90 (diff) |
Enhanced integer parsing in OSSL_PARAM_allocate_from_text
Fixes #14041 and additional bugs discovered by the newly created
tests.
This patch:
- Introduces support for 0x prefixed integers
- Fixes parsing of negative integers (negative numbers were
shifted by -2)
- Fixes ability to parse maximal unsigned numbers ("too small
buffer" error used to be reported incorrectly)
- Fixes a memory leak when OSSL_PARAM_allocate_from_text fails
leaving a temporary BN allocated
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14093)
Diffstat (limited to 'doc/man3')
-rw-r--r-- | doc/man3/OSSL_PARAM_allocate_from_text.pod | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/man3/OSSL_PARAM_allocate_from_text.pod b/doc/man3/OSSL_PARAM_allocate_from_text.pod index ef68f0e10c..80ba555a8f 100644 --- a/doc/man3/OSSL_PARAM_allocate_from_text.pod +++ b/doc/man3/OSSL_PARAM_allocate_from_text.pod @@ -55,15 +55,16 @@ depending on that item's I<data_type>, as follows: =item B<OSSL_PARAM_INTEGER> and B<OSSL_PARAM_UNSIGNED_INTEGER> -If I<key> started with "hex", I<value> is assumed to contain -I<value_n> hexadecimal characters, which are decoded, and the -resulting bytes become the number stored in the I<< to->data >> -storage. - If I<key> didn't start with "hex", I<value> is assumed to contain I<value_n> decimal characters, which are decoded, and the resulting bytes become the number stored in the I<< to->data >> storage. +If I<value> starts with "0x", it is assumed to contain I<value_n> +hexadecimal characters. + +If I<key> started with "hex", I<value> is assumed to contain +I<value_n> hexadecimal characters without the "0x" prefix. + If I<value> contains characters that couldn't be decoded as hexadecimal or decimal characters, OSSL_PARAM_allocate_from_text() considers that an error. |