From: David Woodhouse Date: Wed, 24 May 2017 11:18:14 +0000 (+0100) Subject: Document that PKCS#12 functions assume UTF-8 for passwords X-Git-Tag: OpenSSL_1_1_1-pre1~1447 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cff85f39e438830cb5bc8bf7cb2ed6458670c5be;p=thirdparty%2Fopenssl.git Document that PKCS#12 functions assume UTF-8 for passwords Part of issue #3531 Reviewed-by: Rich Salz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/3535) --- diff --git a/doc/man3/PKCS12_newpass.pod b/doc/man3/PKCS12_newpass.pod index b91051195f9..6b22fd72804 100644 --- a/doc/man3/PKCS12_newpass.pod +++ b/doc/man3/PKCS12_newpass.pod @@ -17,6 +17,18 @@ PKCS12_newpass() changes the password of a PKCS12 structure. B is a pointer to a PKCS12 structure. B is the existing password and B is the new password. +=head1 NOTES + +Each of B and B is independently interpreted as a string in +the UTF-8 encoding. If it is not valid UTF-8, it is assumed to be ISO8859-1 +instead. + +In particular, this means that passwords in the locale character set +(or code page on Windows) must potentially be converted to UTF-8 before +use. This may include passwords from local text files, or input from +the terminal or command line. Refer to the documentation of +L, for example. + =head1 RETURN VALUES PKCS12_newpass() returns 1 on success or 0 on failure. Applications can diff --git a/doc/man3/PKCS12_parse.pod b/doc/man3/PKCS12_parse.pod index 2dfa7e259b1..c03c371a6e8 100644 --- a/doc/man3/PKCS12_parse.pod +++ b/doc/man3/PKCS12_parse.pod @@ -29,6 +29,15 @@ The B and B attributes (if present) on each certificate will be stored in the B and B attributes of the B structure. +The parameter B is interpreted as a string in the UTF-8 encoding. If it +is not valid UTF-8, then it is assumed to be ISO8859-1 instead. + +In particular, this means that passwords in the locale character set +(or code page on Windows) must potentially be converted to UTF-8 before +use. This may include passwords from local text files, or input from +the terminal or command line. Refer to the documentation of +L, for example. + =head1 RETURN VALUES PKCS12_parse() returns 1 for success and zero if an error occurred.