summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2023-09-18 15:26:46 +0000
committerschwarze <>2023-09-18 15:26:46 +0000
commitb60447c1e40728ad5a2fa989b4805ab4abf5b29f (patch)
tree1fdba13826378f03d71a3f0f80b448d419f3bb86 /src
parent00e4137864cefcf6444cf38e75c42732dcda1684 (diff)
downloadopenbsd-b60447c1e40728ad5a2fa989b4805ab4abf5b29f.tar.gz
openbsd-b60447c1e40728ad5a2fa989b4805ab4abf5b29f.tar.bz2
openbsd-b60447c1e40728ad5a2fa989b4805ab4abf5b29f.zip
PEM_def_callback(3) does not truncate its argument but merely the copy,
plus a few wording improvements
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/PEM_read.336
1 files changed, 21 insertions, 15 deletions
diff --git a/src/lib/libcrypto/man/PEM_read.3 b/src/lib/libcrypto/man/PEM_read.3
index 48418b9f4e..1493d54fc4 100644
--- a/src/lib/libcrypto/man/PEM_read.3
+++ b/src/lib/libcrypto/man/PEM_read.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: PEM_read.3,v 1.14 2022/01/15 23:38:50 jsg Exp $ 1.\" $OpenBSD: PEM_read.3,v 1.15 2023/09/18 15:26:46 schwarze Exp $
2.\" full merge up to: OpenSSL 83cf7abf May 29 13:07:08 2018 +0100 2.\" full merge up to: OpenSSL 83cf7abf May 29 13:07:08 2018 +0100
3.\" 3.\"
4.\" This file is a derived work. 4.\" This file is a derived work.
@@ -66,7 +66,7 @@
66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
67.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
68.\" 68.\"
69.Dd $Mdocdate: January 15 2022 $ 69.Dd $Mdocdate: September 18 2023 $
70.Dt PEM_READ 3 70.Dt PEM_READ 3
71.Os 71.Os
72.Sh NAME 72.Sh NAME
@@ -124,21 +124,21 @@
124.Fa "unsigned char *data" 124.Fa "unsigned char *data"
125.Fa "long *len" 125.Fa "long *len"
126.Fa "pem_password_cb *cb" 126.Fa "pem_password_cb *cb"
127.Fa "void *u" 127.Fa "void *userdata"
128.Fc 128.Fc
129.Ft int 129.Ft int
130.Fo PEM_def_callback 130.Fo PEM_def_callback
131.Fa "char *password" 131.Fa "char *password"
132.Fa "int size" 132.Fa "int size"
133.Fa "int verify" 133.Fa "int verify"
134.Fa "void *u" 134.Fa "void *userdata"
135.Fc 135.Fc
136.Ft typedef int 136.Ft typedef int
137.Fo pem_password_cb 137.Fo pem_password_cb
138.Fa "char *password" 138.Fa "char *password"
139.Fa "int size" 139.Fa "int size"
140.Fa "int verify" 140.Fa "int verify"
141.Fa "void *u" 141.Fa "void *userdata"
142.Fc 142.Fc
143.Sh DESCRIPTION 143.Sh DESCRIPTION
144These functions read and write PEM-encoded objects, using the PEM type 144These functions read and write PEM-encoded objects, using the PEM type
@@ -289,16 +289,22 @@ The
289buffer needs to be at least 289buffer needs to be at least
290.Fa size 290.Fa size
291bytes long. 291bytes long.
292Unless
293.Fa userdata
294is
295.Dv NULL ,
292.Fn PEM_def_callback 296.Fn PEM_def_callback
293silently truncates the NUL-terminated byte string 297ignores the
294.Fa u 298.Fa verify
295to at most 299argument and copies the NUL-terminated byte string
296.Fa num 300.Fa userdata
297bytes and copies it into 301to
298.Fa password 302.Fa password
299without a terminating NUL byte. 303without a terminating NUL byte, silently truncating the copy to at most
304.Fa size
305bytes.
300If 306If
301.Fa u 307.Fa userdata
302is 308is
303.Dv NULL , 309.Dv NULL ,
304.Fn PEM_def_callback 310.Fn PEM_def_callback
@@ -317,7 +323,7 @@ bytes are accepted from the user and copied into the byte string buffer
317A callback function 323A callback function
318.Fa cb 324.Fa cb
319supplied by the application may use 325supplied by the application may use
320.Fa u 326.Fa userdata
321for a different purpose than 327for a different purpose than
322.Fn PEM_def_callback 328.Fn PEM_def_callback
323does, e.g., as auxiliary data to use while acquiring the password. 329does, e.g., as auxiliary data to use while acquiring the password.
@@ -328,7 +334,7 @@ flag is non-zero, the user is prompted twice for the password to
328make typos less likely and it is checked that both inputs agree. 334make typos less likely and it is checked that both inputs agree.
329This flag is not set by 335This flag is not set by
330.Fn PEM_do_header 336.Fn PEM_do_header
331nor by other read functions. 337nor by other read functions, but it is typically set by write functions.
332.Pp 338.Pp
333If the data is a priori known to not be encrypted, then neither 339If the data is a priori known to not be encrypted, then neither
334.Fn PEM_get_EVP_CIPHER_INFO 340.Fn PEM_get_EVP_CIPHER_INFO
@@ -366,7 +372,7 @@ or a negative value on failure, and
366.Fa cb 372.Fa cb
367is expected to behave in the same way. 373is expected to behave in the same way.
368If 374If
369.Fa u 375.Fa userdata
370is 376is
371.Dv NULL , 377.Dv NULL ,
372.Fn PEM_def_callback 378.Fn PEM_def_callback