Skip to content
This repository was archived by the owner on Aug 24, 2025. It is now read-only.

Commit df73fcd

Browse files
dwmw2levitte
authored andcommitted
Document that PKCS#12 functions assume UTF-8 for passwords
Part of issue openssl#3531 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from openssl#3535) (cherry picked from commit cff85f3)
1 parent b024891 commit df73fcd

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

doc/crypto/PKCS12_newpass.pod

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ PKCS12_newpass() changes the password of a PKCS12 structure.
1717
B<p12> is a pointer to a PKCS12 structure. B<oldpass> is the existing password
1818
and B<newpass> is the new password.
1919

20+
=head1 NOTES
21+
22+
Each of B<oldpass> and B<newpass> is independently interpreted as a string in
23+
the UTF-8 encoding. If it is not valid UTF-8, it is assumed to be ISO8859-1
24+
instead.
25+
26+
In particular, this means that passwords in the locale character set
27+
(or code page on Windows) must potentially be converted to UTF-8 before
28+
use. This may include passwords from local text files, or input from
29+
the terminal or command line. Refer to the documentation of
30+
L<UI_OpenSSL(3)>, for example.
31+
2032
=head1 RETURN VALUES
2133

2234
PKCS12_newpass() returns 1 on success or 0 on failure. Applications can

doc/crypto/PKCS12_parse.pod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ The B<friendlyName> and B<localKeyID> attributes (if present) on each
2929
certificate will be stored in the B<alias> and B<keyid> attributes of the
3030
B<X509> structure.
3131

32+
The parameter B<pass> is interpreted as a string in the UTF-8 encoding. If it
33+
is not valid UTF-8, then it is assumed to be ISO8859-1 instead.
34+
35+
In particular, this means that passwords in the locale character set
36+
(or code page on Windows) must potentially be converted to UTF-8 before
37+
use. This may include passwords from local text files, or input from
38+
the terminal or command line. Refer to the documentation of
39+
L<UI_OpenSSL(3)>, for example.
40+
3241
=head1 RETURN VALUES
3342

3443
PKCS12_parse() returns 1 for success and zero if an error occurred.

0 commit comments

Comments
 (0)