pem_password_cb: Clarify the documentation on passphrases
authorTomas Mraz <tomas@openssl.org>
Tue, 21 Dec 2021 14:58:44 +0000 (15:58 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 3 Jan 2022 09:35:36 +0000 (10:35 +0100)
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/17320)

doc/man3/PEM_read_bio_PrivateKey.pod

index a71907b1701694eaae2e45ea296492ff22723098..27e7849ef7e098843ca3c9f74fea95fe5047e989 100644 (file)
@@ -335,7 +335,7 @@ I<klen> bytes at I<kstr> are used as the passphrase and I<cb> is
 ignored.
 
 If the I<cb> parameters is set to NULL and the I<u> parameter is not
-NULL then the I<u> parameter is interpreted as a null terminated string
+NULL then the I<u> parameter is interpreted as a NUL terminated string
 to use as the passphrase. If both I<cb> and I<u> are NULL then the
 default callback routine is used which will typically prompt for the
 passphrase on the current terminal with echoing turned off.
@@ -355,7 +355,8 @@ value as the I<u> parameter passed to the PEM routine. It allows
 arbitrary data to be passed to the callback by the application
 (for example a window handle in a GUI application). The callback
 I<must> return the number of characters in the passphrase or -1 if
-an error occurred.
+an error occurred. The passphrase can be arbitrary data; in the case where it
+is a string, it is not NUL terminated. See the L</EXAMPLES> section below.
 
 Some implementations may need to use cryptographic algorithms during their
 operation. If this is the case and I<libctx> and I<propq> parameters have been