summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2023-08-26 15:12:04 +0000
committerschwarze <>2023-08-26 15:12:04 +0000
commit5b9ff46888fc65f97ed8ad4af3dcf1e1486ba265 (patch)
tree19010d03955f900b9ddced5d62782161b8d1bbe3 /src
parent12a67cd6bb8433b887c58c9683aa26e6e40824ff (diff)
downloadopenbsd-5b9ff46888fc65f97ed8ad4af3dcf1e1486ba265.tar.gz
openbsd-5b9ff46888fc65f97ed8ad4af3dcf1e1486ba265.tar.bz2
openbsd-5b9ff46888fc65f97ed8ad4af3dcf1e1486ba265.zip
Write documentation for EVP_CIPHER_CTX_buf_noconst(3) from scratch.
Put it here rather than into EVP_EncryptInit(3) because similar to EVP_CIPHER_CTX_get_cipher_data(3), application software should not use it. These functions will likely not be needed except by people implementing custom encryption algorithms.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.347
1 files changed, 42 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 b/src/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3
index e60e1fb30e..4f75c8b008 100644
--- a/src/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3
+++ b/src/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3
@@ -1,7 +1,24 @@
1.\" $OpenBSD: EVP_CIPHER_CTX_get_cipher_data.3,v 1.2 2023/08/26 06:19:09 jsg Exp $ 1.\" $OpenBSD: EVP_CIPHER_CTX_get_cipher_data.3,v 1.3 2023/08/26 15:12:04 schwarze Exp $
2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" 3.\"
4.\" This file was written by Matt Caswell <matt@openssl.org> 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Matt Caswell <matt@openssl.org>.
5.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved. 22.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved.
6.\" 23.\"
7.\" Redistribution and use in source and binary forms, with or without 24.\" Redistribution and use in source and binary forms, with or without
@@ -53,7 +70,8 @@
53.Os 70.Os
54.Sh NAME 71.Sh NAME
55.Nm EVP_CIPHER_CTX_get_cipher_data , 72.Nm EVP_CIPHER_CTX_get_cipher_data ,
56.Nm EVP_CIPHER_CTX_set_cipher_data 73.Nm EVP_CIPHER_CTX_set_cipher_data ,
74.Nm EVP_CIPHER_CTX_buf_noconst
57.Nd inspect and modify EVP_CIPHER_CTX objects 75.Nd inspect and modify EVP_CIPHER_CTX objects
58.Sh SYNOPSIS 76.Sh SYNOPSIS
59.In openssl/evp.h 77.In openssl/evp.h
@@ -66,6 +84,10 @@
66.Fa "EVP_CIPHER_CTX *ctx" 84.Fa "EVP_CIPHER_CTX *ctx"
67.Fa "void *cipher_data" 85.Fa "void *cipher_data"
68.Fc 86.Fc
87.Ft unsigned char *
88.Fo EVP_CIPHER_CTX_buf_noconst
89.Fa "EVP_CIPHER_CTX *ctx"
90.Fc
69.Sh DESCRIPTION 91.Sh DESCRIPTION
70.Fn EVP_CIPHER_CTX_get_cipher_data 92.Fn EVP_CIPHER_CTX_get_cipher_data
71returns a pointer to the cipher data of 93returns a pointer to the cipher data of
@@ -89,6 +111,15 @@ A pointer to any existing cipher data is returned from this function.
89If the old data is no longer required, 111If the old data is no longer required,
90it should be freed through a call to 112it should be freed through a call to
91.Xr free 3 . 113.Xr free 3 .
114.Pp
115.Fn EVP_CIPHER_CTX_buf_noconst
116provides engines and custom cipher implementations
117with access to the internal buffer that
118.Xr EVP_EncryptUpdate 3
119copies input data into before encrypting it.
120This function can for example be used
121inside callback functions installed with
122.Xr EVP_CIPHER_meth_set_do_cipher 3 .
92.Sh RETURN VALUES 123.Sh RETURN VALUES
93.Fn EVP_CIPHER_CTX_get_cipher_data 124.Fn EVP_CIPHER_CTX_get_cipher_data
94returns an internal pointer owned by 125returns an internal pointer owned by
@@ -98,12 +129,18 @@ returns an internal pointer owned by
98returns a pointer to the old cipher data of 129returns a pointer to the old cipher data of
99.Fa ctx 130.Fa ctx
100and transfers ownership to the caller. 131and transfers ownership to the caller.
132.Pp
133.Fn EVP_CIPHER_CTX_buf_noconst
134returns a pointer to an internal buffer owned by
135.Fa ctx .
101.Sh SEE ALSO 136.Sh SEE ALSO
102.Xr evp 3 , 137.Xr evp 3 ,
138.Xr EVP_CIPHER_meth_new 3 ,
103.Xr EVP_EncryptInit 3 139.Xr EVP_EncryptInit 3
104.Sh HISTORY 140.Sh HISTORY
105.Fn EVP_CIPHER_CTX_get_cipher_data 141.Fn EVP_CIPHER_CTX_get_cipher_data ,
142.Fn EVP_CIPHER_CTX_set_cipher_data ,
106and 143and
107.Fn EVP_CIPHER_CTX_set_cipher_data 144.Fn EVP_CIPHER_CTX_buf_noconst
108first appeared in OpenSSL 1.1.0 and have been available since 145first appeared in OpenSSL 1.1.0 and have been available since
109.Ox 7.1 . 146.Ox 7.1 .