sync code with last improvements from OpenBSD
This commit is contained in:
parent
0ed6f4de41
commit
4ee2459da1
16 changed files with 382 additions and 157 deletions
|
@ -1,7 +1,24 @@
|
|||
.\" $OpenBSD: EVP_CIPHER_CTX_get_cipher_data.3,v 1.2 2023/08/26 06:19:09 jsg Exp $
|
||||
.\" $OpenBSD: EVP_CIPHER_CTX_get_cipher_data.3,v 1.3 2023/08/26 15:12:04 schwarze Exp $
|
||||
.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
|
||||
.\"
|
||||
.\" This file was written by Matt Caswell <matt@openssl.org>
|
||||
.\" This file is a derived work.
|
||||
.\" The changes are covered by the following Copyright and license:
|
||||
.\"
|
||||
.\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this software for any
|
||||
.\" purpose with or without fee is hereby granted, provided that the above
|
||||
.\" copyright notice and this permission notice appear in all copies.
|
||||
.\"
|
||||
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.\" The original file was written by Matt Caswell <matt@openssl.org>.
|
||||
.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
|
@ -53,7 +70,8 @@
|
|||
.Os
|
||||
.Sh NAME
|
||||
.Nm EVP_CIPHER_CTX_get_cipher_data ,
|
||||
.Nm EVP_CIPHER_CTX_set_cipher_data
|
||||
.Nm EVP_CIPHER_CTX_set_cipher_data ,
|
||||
.Nm EVP_CIPHER_CTX_buf_noconst
|
||||
.Nd inspect and modify EVP_CIPHER_CTX objects
|
||||
.Sh SYNOPSIS
|
||||
.In openssl/evp.h
|
||||
|
@ -66,6 +84,10 @@
|
|||
.Fa "EVP_CIPHER_CTX *ctx"
|
||||
.Fa "void *cipher_data"
|
||||
.Fc
|
||||
.Ft unsigned char *
|
||||
.Fo EVP_CIPHER_CTX_buf_noconst
|
||||
.Fa "EVP_CIPHER_CTX *ctx"
|
||||
.Fc
|
||||
.Sh DESCRIPTION
|
||||
.Fn EVP_CIPHER_CTX_get_cipher_data
|
||||
returns a pointer to the cipher data of
|
||||
|
@ -89,6 +111,15 @@ A pointer to any existing cipher data is returned from this function.
|
|||
If the old data is no longer required,
|
||||
it should be freed through a call to
|
||||
.Xr free 3 .
|
||||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_buf_noconst
|
||||
provides engines and custom cipher implementations
|
||||
with access to the internal buffer that
|
||||
.Xr EVP_EncryptUpdate 3
|
||||
copies input data into before encrypting it.
|
||||
This function can for example be used
|
||||
inside callback functions installed with
|
||||
.Xr EVP_CIPHER_meth_set_do_cipher 3 .
|
||||
.Sh RETURN VALUES
|
||||
.Fn EVP_CIPHER_CTX_get_cipher_data
|
||||
returns an internal pointer owned by
|
||||
|
@ -98,12 +129,18 @@ returns an internal pointer owned by
|
|||
returns a pointer to the old cipher data of
|
||||
.Fa ctx
|
||||
and transfers ownership to the caller.
|
||||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_buf_noconst
|
||||
returns a pointer to an internal buffer owned by
|
||||
.Fa ctx .
|
||||
.Sh SEE ALSO
|
||||
.Xr evp 3 ,
|
||||
.Xr EVP_CIPHER_meth_new 3 ,
|
||||
.Xr EVP_EncryptInit 3
|
||||
.Sh HISTORY
|
||||
.Fn EVP_CIPHER_CTX_get_cipher_data
|
||||
.Fn EVP_CIPHER_CTX_get_cipher_data ,
|
||||
.Fn EVP_CIPHER_CTX_set_cipher_data ,
|
||||
and
|
||||
.Fn EVP_CIPHER_CTX_set_cipher_data
|
||||
.Fn EVP_CIPHER_CTX_buf_noconst
|
||||
first appeared in OpenSSL 1.1.0 and have been available since
|
||||
.Ox 7.1 .
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $OpenBSD: EVP_CIPHER_meth_new.3,v 1.1 2023/03/16 15:05:23 tb Exp $
|
||||
.\" $OpenBSD: EVP_CIPHER_meth_new.3,v 1.2 2023/08/26 15:14:28 schwarze Exp $
|
||||
.\" selective merge up to: OpenSSL b0edda11 Mar 20 13:00:17 2018 +0000
|
||||
.\"
|
||||
.\" The original file was written by Richard Levitte <levitte@openssl.org>
|
||||
|
@ -49,7 +49,7 @@
|
|||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: March 16 2023 $
|
||||
.Dd $Mdocdate: August 26 2023 $
|
||||
.Dt EVP_CIPHER_METH_NEW 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
@ -179,7 +179,10 @@ At most one of the following cipher modes can be set:
|
|||
.Dv EVP_CIPH_XTS_MODE ,
|
||||
and
|
||||
.Dv EVP_CIPH_WRAP_MODE .
|
||||
The available flags are:
|
||||
.Pp
|
||||
Zero or more of the following flags can be OR'ed into the
|
||||
.Fa flags
|
||||
argument:
|
||||
.Bl -tag -width Ds
|
||||
.It EVP_CIPH_VARIABLE_LENGTH
|
||||
This cipher is of variable length.
|
||||
|
@ -329,6 +332,7 @@ All
|
|||
.Fn EVP_CIPHER_meth_set_*
|
||||
functions return 1.
|
||||
.Sh SEE ALSO
|
||||
.Xr evp 3 .
|
||||
.Xr EVP_EncryptInit 3
|
||||
.Sh HISTORY
|
||||
These functions first appeared in OpenSSL 1.1.0 and have been available since
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $OpenBSD: EVP_DigestInit.3,v 1.28 2023/08/14 14:22:32 schwarze Exp $
|
||||
.\" $OpenBSD: EVP_DigestInit.3,v 1.29 2023/08/27 15:33:08 schwarze Exp $
|
||||
.\" full merge up to: OpenSSL 7f572e95 Dec 2 13:57:04 2015 +0000
|
||||
.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
|
||||
.\"
|
||||
|
@ -70,7 +70,7 @@
|
|||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: August 14 2023 $
|
||||
.Dd $Mdocdate: August 27 2023 $
|
||||
.Dt EVP_DIGESTINIT 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
@ -107,9 +107,6 @@
|
|||
.Nm EVP_MD_CTX_pkey_ctx ,
|
||||
.Nm EVP_MD_CTX_set_pkey_ctx ,
|
||||
.Nm EVP_md_null ,
|
||||
.Nm EVP_md5 ,
|
||||
.Nm EVP_md5_sha1 ,
|
||||
.Nm EVP_sha1 ,
|
||||
.Nm EVP_sha224 ,
|
||||
.Nm EVP_sha256 ,
|
||||
.Nm EVP_sha384 ,
|
||||
|
@ -270,12 +267,6 @@
|
|||
.Ft const EVP_MD *
|
||||
.Fn EVP_md_null void
|
||||
.Ft const EVP_MD *
|
||||
.Fn EVP_md5 void
|
||||
.Ft const EVP_MD *
|
||||
.Fn EVP_md5_sha1 void
|
||||
.Ft const EVP_MD *
|
||||
.Fn EVP_sha1 void
|
||||
.Ft const EVP_MD *
|
||||
.Fn EVP_sha224 void
|
||||
.Ft const EVP_MD *
|
||||
.Fn EVP_sha256 void
|
||||
|
@ -413,7 +404,7 @@ from
|
|||
The
|
||||
.Fa type
|
||||
will typically be supplied by a function such as
|
||||
.Fn EVP_sha1 .
|
||||
.Fn EVP_sha512 .
|
||||
If
|
||||
.Fa impl
|
||||
is
|
||||
|
@ -537,9 +528,9 @@ and
|
|||
.Fn EVP_MD_CTX_type
|
||||
return the NID of the OBJECT IDENTIFIER representing the message digest.
|
||||
For example
|
||||
.Fn EVP_MD_type EVP_sha1()
|
||||
.Fn EVP_MD_type EVP_sha512()
|
||||
returns
|
||||
.Dv NID_sha1 .
|
||||
.Dv NID_sha512 .
|
||||
These functions are normally used when setting ASN.1 OIDs.
|
||||
.Pp
|
||||
.Fn EVP_MD_CTX_md_data
|
||||
|
@ -563,9 +554,9 @@ for more information.
|
|||
returns the NID of the public key signing algorithm associated with this
|
||||
digest.
|
||||
For example
|
||||
.Fn EVP_sha1
|
||||
.Fn EVP_sha512
|
||||
is associated with RSA so this will return
|
||||
.Dv NID_sha1WithRSAEncryption .
|
||||
.Dv NID_sha512WithRSAEncryption .
|
||||
Since digests and signature algorithms are no longer linked, this
|
||||
function is only retained for compatibility reasons.
|
||||
.Pp
|
||||
|
@ -619,8 +610,6 @@ is dissociated from it as described above, but no new
|
|||
.Vt EVP_PKEY_CTX
|
||||
is assigned.
|
||||
.Pp
|
||||
.Fn EVP_md5 ,
|
||||
.Fn EVP_sha1 ,
|
||||
.Fn EVP_sha224 ,
|
||||
.Fn EVP_sha256 ,
|
||||
.Fn EVP_sha384 ,
|
||||
|
@ -629,7 +618,7 @@ and
|
|||
.Fn EVP_ripemd160
|
||||
return
|
||||
.Vt EVP_MD
|
||||
structures for the MD5, SHA1, SHA224, SHA256, SHA384, SHA512 and
|
||||
structures for the SHA224, SHA256, SHA384, SHA512 and
|
||||
RIPEMD160 digest algorithms respectively.
|
||||
.Pp
|
||||
.Fn EVP_sha512_224
|
||||
|
@ -640,11 +629,6 @@ return an
|
|||
structure that provides the truncated SHA512 variants SHA512/224 and SHA512/256,
|
||||
respectively.
|
||||
.Pp
|
||||
.Fn EVP_md5_sha1
|
||||
returns an
|
||||
.Vt EVP_MD
|
||||
structure that provides concatenated MD5 and SHA1 message digests.
|
||||
.Pp
|
||||
.Fn EVP_md_null
|
||||
is a "null" message digest that does nothing:
|
||||
i.e. the hash it returns is of zero length.
|
||||
|
@ -671,9 +655,6 @@ in preference to the low-level interfaces.
|
|||
This is because the code then becomes transparent to the digest used and
|
||||
much more flexible.
|
||||
.Pp
|
||||
New applications should use the SHA2 digest algorithms such as SHA256.
|
||||
The other digest algorithms are still in common use.
|
||||
.Pp
|
||||
For most applications the
|
||||
.Fa impl
|
||||
parameter to
|
||||
|
@ -757,10 +738,7 @@ if
|
|||
is
|
||||
.Dv NULL .
|
||||
.Pp
|
||||
.Fn EVP_md_null ,
|
||||
.Fn EVP_md5 ,
|
||||
.Fn EVP_md5_sha1 ,
|
||||
.Fn EVP_sha1 ,
|
||||
.Fn EVP_md_null
|
||||
and
|
||||
.Fn EVP_ripemd160
|
||||
return pointers to the corresponding
|
||||
|
@ -830,6 +808,7 @@ main(int argc, char *argv[])
|
|||
.Xr EVP_MD_meth_new 3 ,
|
||||
.Xr EVP_PKEY_CTX_set_signature_md 3 ,
|
||||
.Xr EVP_PKEY_meth_set_signctx 3 ,
|
||||
.Xr EVP_sha1 3 ,
|
||||
.Xr EVP_sha3_224 3 ,
|
||||
.Xr EVP_SignInit 3 ,
|
||||
.Xr EVP_sm3 3 ,
|
||||
|
@ -847,10 +826,8 @@ main(int argc, char *argv[])
|
|||
.Fn EVP_DigestInit ,
|
||||
.Fn EVP_DigestUpdate ,
|
||||
.Fn EVP_DigestFinal ,
|
||||
.Dv EVP_MAX_MD_SIZE ,
|
||||
.Fn EVP_md5 ,
|
||||
and
|
||||
.Fn EVP_sha1
|
||||
.Dv EVP_MAX_MD_SIZE
|
||||
first appeared in SSLeay 0.5.1.
|
||||
.Fn EVP_MD_size
|
||||
first appeared in SSLeay 0.6.6.
|
||||
|
@ -869,8 +846,6 @@ first appeared in SSLeay 0.8.1.
|
|||
.Fn EVP_MD_block_size ,
|
||||
.Fn EVP_MD_CTX_size ,
|
||||
.Fn EVP_MD_CTX_block_size ,
|
||||
.Fn EVP_rc4_40 ,
|
||||
.Fn EVP_rc2_40_cbc ,
|
||||
and
|
||||
.Fn EVP_ripemd160
|
||||
first appeared in SSLeay 0.9.0.
|
||||
|
@ -920,9 +895,8 @@ first appeared in OpenSSL 1.1.0 and has been available since
|
|||
.Pp
|
||||
.Fn EVP_MD_CTX_new ,
|
||||
.Fn EVP_MD_CTX_reset ,
|
||||
.Fn EVP_MD_CTX_free ,
|
||||
and
|
||||
.Fn EVP_md5_sha1
|
||||
.Fn EVP_MD_CTX_free
|
||||
first appeared in OpenSSL 1.1.0 and have been available since
|
||||
.Ox 6.3 .
|
||||
.Pp
|
||||
|
@ -940,8 +914,3 @@ and
|
|||
.Fn EVP_sha512_256
|
||||
first appeared in OpenSSL 1.1.1 and have been available since
|
||||
.Ox 7.4 .
|
||||
.Pp
|
||||
The link between digests and signing algorithms was fixed in OpenSSL 1.0
|
||||
and later, so now
|
||||
.Fn EVP_sha1
|
||||
can be used with RSA and DSA.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $OpenBSD: EVP_EncryptInit.3,v 1.46 2023/08/16 13:50:05 schwarze Exp $
|
||||
.\" $OpenBSD: EVP_EncryptInit.3,v 1.47 2023/08/26 15:01:56 schwarze Exp $
|
||||
.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800
|
||||
.\" EVP_bf_cbc.pod EVP_cast5_cbc.pod EVP_idea_cbc.pod EVP_rc2_cbc.pod
|
||||
.\" 7c6d372a Nov 20 13:20:01 2018 +0000
|
||||
|
@ -6,7 +6,7 @@
|
|||
.\" This file is a derived work.
|
||||
.\" The changes are covered by the following Copyright and license:
|
||||
.\"
|
||||
.\" Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\" Copyright (c) 2019, 2023 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this software for any
|
||||
.\" purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -69,7 +69,7 @@
|
|||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: August 16 2023 $
|
||||
.Dd $Mdocdate: August 26 2023 $
|
||||
.Dt EVP_ENCRYPTINIT 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
@ -78,6 +78,7 @@
|
|||
.Nm EVP_CIPHER_CTX_cleanup ,
|
||||
.Nm EVP_CIPHER_CTX_init ,
|
||||
.Nm EVP_CIPHER_CTX_free ,
|
||||
.Nm EVP_CIPHER_CTX_copy ,
|
||||
.Nm EVP_EncryptInit_ex ,
|
||||
.Nm EVP_EncryptUpdate ,
|
||||
.Nm EVP_EncryptFinal_ex ,
|
||||
|
@ -94,6 +95,7 @@
|
|||
.Nm EVP_CipherInit ,
|
||||
.Nm EVP_CipherFinal ,
|
||||
.Nm EVP_Cipher ,
|
||||
.Nm EVP_CIPHER_CTX_encrypting ,
|
||||
.Nm EVP_CIPHER_CTX_set_flags ,
|
||||
.Nm EVP_CIPHER_CTX_clear_flags ,
|
||||
.Nm EVP_CIPHER_CTX_test_flags ,
|
||||
|
@ -170,6 +172,11 @@
|
|||
.Fa "EVP_CIPHER_CTX *ctx"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo EVP_CIPHER_CTX_copy
|
||||
.Fa "EVP_CIPHER_CTX *out"
|
||||
.Fa "const EVP_CIPHER_CTX *in"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo EVP_EncryptInit_ex
|
||||
.Fa "EVP_CIPHER_CTX *ctx"
|
||||
.Fa "const EVP_CIPHER *type"
|
||||
|
@ -283,6 +290,10 @@
|
|||
.Fa "const unsigned char *in"
|
||||
.Fa "unsigned int inl"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo EVP_CIPHER_CTX_encrypting
|
||||
.Fa "const EVP_CIPHER_CTX *ctx"
|
||||
.Fc
|
||||
.Ft void
|
||||
.Fo EVP_CIPHER_CTX_set_flags
|
||||
.Fa "EVP_CIPHER_CTX *ctx"
|
||||
|
@ -465,6 +476,55 @@ is a
|
|||
.Dv NULL
|
||||
pointer, no action occurs.
|
||||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_copy
|
||||
calls
|
||||
.Fn EVP_CIPHER_CTX_reset
|
||||
on
|
||||
.Fa out
|
||||
and copies all the data from
|
||||
.Fa in
|
||||
to
|
||||
.Fa out ,
|
||||
except that the
|
||||
.Vt EVP_CIPHER
|
||||
and
|
||||
.Vt ENGINE
|
||||
objects used by
|
||||
.Fa in
|
||||
and any application specific data set with
|
||||
.Fn EVP_CIPHER_CTX_set_app_data
|
||||
are not copied and
|
||||
.Fa out
|
||||
will point to the same three objects.
|
||||
The algorithm- and implementation-specific cipher data described in
|
||||
.Xr EVP_CIPHER_CTX_get_cipher_data 3
|
||||
is copied with
|
||||
.Xr malloc 3
|
||||
and
|
||||
.Xr memcpy 3 ,
|
||||
i.e. assuming that it does not contain pointers to any sub-objects.
|
||||
If the bit
|
||||
.Dv EVP_CIPH_CUSTOM_COPY
|
||||
has been set with
|
||||
.Xr EVP_CIPHER_meth_set_flags 3 ,
|
||||
.Fn EVP_CIPHER_CTX_ctrl
|
||||
is called at the end with arguments
|
||||
.Fa in ,
|
||||
.Dv EVP_CTRL_COPY ,
|
||||
.No 0 ,
|
||||
and
|
||||
.Fa out
|
||||
such that the cipher implementation can perform further algorithm-
|
||||
and implementation-specific initializations after the algorithm-
|
||||
and implementation-specific cipher data has been copied.
|
||||
Among the cipher algorithms built into the library,
|
||||
.Dv EVP_CIPH_CUSTOM_COPY
|
||||
and
|
||||
.Dv EVP_CTRL_COPY
|
||||
are used by some of the ciphers documented in the
|
||||
.Xr EVP_aes_256_gcm 3
|
||||
manual page.
|
||||
.Pp
|
||||
.Fn EVP_EncryptInit_ex
|
||||
sets up the cipher context
|
||||
.Fa ctx
|
||||
|
@ -877,6 +937,7 @@ for failure.
|
|||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_reset ,
|
||||
.Fn EVP_CIPHER_CTX_cleanup ,
|
||||
.Fn EVP_CIPHER_CTX_copy ,
|
||||
.Fn EVP_CIPHER_CTX_get_iv ,
|
||||
.Fn EVP_CIPHER_CTX_set_iv ,
|
||||
.Fn EVP_EncryptInit_ex ,
|
||||
|
@ -900,6 +961,12 @@ and
|
|||
.Fn EVP_CIPHER_CTX_rand_key
|
||||
return 1 for success or 0 for failure.
|
||||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_encrypting
|
||||
returns 1 if
|
||||
.Fa ctx
|
||||
is initialized for encryption or 0 otherwise, in which case
|
||||
it may be uninitialized or initialized for decryption.
|
||||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_set_padding
|
||||
always returns 1.
|
||||
.Pp
|
||||
|
@ -1243,6 +1310,7 @@ do_crypt(FILE *in, FILE *out, int do_encrypt)
|
|||
.Xr EVP_aes_128_cbc 3 ,
|
||||
.Xr EVP_camellia_128_cbc 3 ,
|
||||
.Xr EVP_chacha20 3 ,
|
||||
.Xr EVP_CIPHER_CTX_get_cipher_data 3 ,
|
||||
.Xr EVP_des_cbc 3 ,
|
||||
.Xr EVP_OpenInit 3 ,
|
||||
.Xr EVP_rc4 3 ,
|
||||
|
@ -1355,14 +1423,23 @@ first appeared in OpenSSL 0.9.8b.
|
|||
These functions have been available since
|
||||
.Ox 4.5 .
|
||||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_copy
|
||||
first appeared in OpenSSL 1.0.0
|
||||
and has been available since
|
||||
.Ox 4.9 .
|
||||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_reset
|
||||
first appeared in OpenSSL 1.1.0 and has been available since
|
||||
.Ox 6.3 .
|
||||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_encrypting
|
||||
first appeared in OpenSSL 1.1.0 and has been available since
|
||||
.Ox 6.4 .
|
||||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_get_iv
|
||||
and
|
||||
.Fn EVP_CIPHER_CTX_set_iv
|
||||
first appeared in LibreSSL 2.8.1 and has been available since
|
||||
first appeared in LibreSSL 2.8.1 and have been available since
|
||||
.Ox 6.4 .
|
||||
.Sh BUGS
|
||||
.Dv EVP_MAX_KEY_LENGTH
|
||||
|
@ -1378,3 +1455,8 @@ bytes.
|
|||
The ASN.1 code is incomplete (and sometimes inaccurate).
|
||||
It has only been tested for certain common S/MIME ciphers
|
||||
(RC2, DES, triple DES) in CBC mode.
|
||||
.Pp
|
||||
.Fn EVP_CIPHER_CTX_copy
|
||||
may already have cleared the data in
|
||||
.Fa out
|
||||
and copied some new data into it even if it fails and returns 0.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
.\" $OpenBSD: EVP_PKEY_asn1_get_count.3,v 1.5 2020/06/24 19:55:54 schwarze Exp $
|
||||
.\" $OpenBSD: EVP_PKEY_asn1_get_count.3,v 1.6 2023/08/27 13:23:12 schwarze Exp $
|
||||
.\" full merge up to: OpenSSL 72a7a702 Feb 26 14:05:09 2019 +0000
|
||||
.\"
|
||||
.\" This file is a derived work.
|
||||
.\" The changes are covered by the following Copyright and license:
|
||||
.\"
|
||||
.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\" Copyright (c) 2020, 2023 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this software for any
|
||||
.\" purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -65,7 +65,7 @@
|
|||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: June 24 2020 $
|
||||
.Dd $Mdocdate: August 27 2023 $
|
||||
.Dt EVP_PKEY_ASN1_GET_COUNT 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
@ -141,8 +141,17 @@ If one is found,
|
|||
is set to that engine and the method from that engine is returned instead.
|
||||
.Pp
|
||||
.Fn EVP_PKEY_asn1_find_str
|
||||
looks up the method with PEM type string
|
||||
looks up the method with the PEM type string given by the first
|
||||
.Fa len
|
||||
bytes of
|
||||
.Fa str .
|
||||
If
|
||||
.Fa len
|
||||
is \-1, the
|
||||
.Xr strlen 3
|
||||
of
|
||||
.Fa str
|
||||
is used instead.
|
||||
The PEM type strings supported by default are listed in the
|
||||
.Xr EVP_PKEY_base_id 3
|
||||
manual page.
|
||||
|
@ -190,6 +199,13 @@ is out of range.
|
|||
returns the public key method used by
|
||||
.Fa pkey .
|
||||
.Pp
|
||||
.Fn EVP_PKEY_asn1_find
|
||||
and
|
||||
.Fn EVP_PKEY_asn1_find_str
|
||||
return a matching public key method or
|
||||
.Dv NULL
|
||||
if no match is found.
|
||||
.Pp
|
||||
.Fn EVP_PKEY_asn1_get0_info
|
||||
returns 1 on success or 0 on failure.
|
||||
.Sh SEE ALSO
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $OpenBSD: EVP_PKEY_asn1_new.3,v 1.8 2022/07/13 19:10:40 schwarze Exp $
|
||||
.\" $OpenBSD: EVP_PKEY_asn1_new.3,v 1.9 2023/08/27 13:15:29 schwarze Exp $
|
||||
.\" selective merge up to:
|
||||
.\" OpenSSL man3/EVP_PKEY_ASN1_METHOD b0004708 Nov 1 00:45:24 2017 +0800
|
||||
.\"
|
||||
|
@ -50,7 +50,7 @@
|
|||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: July 13 2022 $
|
||||
.Dd $Mdocdate: August 27 2023 $
|
||||
.Dt EVP_PKEY_ASN1_NEW 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
@ -332,7 +332,7 @@ Free the internals of
|
|||
This method is called by
|
||||
.Xr EVP_PKEY_free 3 ,
|
||||
.Xr EVP_PKEY_set_type 3 ,
|
||||
.Fn EVP_PKEY_set_type_str ,
|
||||
.Xr EVP_PKEY_set_type_str 3 ,
|
||||
and
|
||||
.Xr EVP_PKEY_assign 3 .
|
||||
.Bd -filled
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.19 2022/09/11 04:39:46 jsg Exp $
|
||||
.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.20 2023/08/27 13:08:15 schwarze Exp $
|
||||
.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
|
||||
.\"
|
||||
.\" This file is a derived work.
|
||||
.\" The changes are covered by the following Copyright and license:
|
||||
.\"
|
||||
.\" Copyright (c) 2019, 2020 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\" Copyright (c) 2019, 2020, 2023 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this software for any
|
||||
.\" purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -65,7 +65,7 @@
|
|||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: September 11 2022 $
|
||||
.Dd $Mdocdate: August 27 2023 $
|
||||
.Dt EVP_PKEY_SET1_RSA 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
@ -92,7 +92,8 @@
|
|||
.Nm EVP_PKEY_base_id ,
|
||||
.Nm EVP_PKEY_id ,
|
||||
.Nm EVP_PKEY_type ,
|
||||
.Nm EVP_PKEY_set_type
|
||||
.Nm EVP_PKEY_set_type ,
|
||||
.Nm EVP_PKEY_set_type_str
|
||||
.\" The function X509_certificate_type(3) is intentionally undocumented
|
||||
.\" and scheduled for deletion from the library. BoringSSL already
|
||||
.\" deleted it and OpenSSL deprecates it in version 3.0.
|
||||
|
@ -208,6 +209,12 @@
|
|||
.Fa "EVP_PKEY *pkey"
|
||||
.Fa "int type"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo EVP_PKEY_set_type_str
|
||||
.Fa "EVP_PKEY *pkey"
|
||||
.Fa "const char *str"
|
||||
.Fa "int len"
|
||||
.Fc
|
||||
.Sh DESCRIPTION
|
||||
.Fn EVP_PKEY_set1_RSA ,
|
||||
.Fn EVP_PKEY_set1_DSA ,
|
||||
|
@ -361,6 +368,36 @@ and
|
|||
.Fn EVP_PKEY_id
|
||||
can be passed.
|
||||
.Pp
|
||||
.Fn EVP_PKEY_set_type_str
|
||||
frees the key referenced in
|
||||
.Fa pkey ,
|
||||
if any, and sets the key type of
|
||||
.Fa pkey
|
||||
according to the PEM type string given by the first
|
||||
.Fa len
|
||||
bytes of
|
||||
.Fa str .
|
||||
If
|
||||
.Fa len
|
||||
is \-1, the
|
||||
.Xr strlen 3
|
||||
of
|
||||
.Fa str
|
||||
is used instead.
|
||||
The PEM type strings supported by default are listed in the table above.
|
||||
This function does not reference a new key from
|
||||
.Fa pkey .
|
||||
.Pp
|
||||
If
|
||||
.Fa pkey
|
||||
is a
|
||||
.Dv NULL
|
||||
pointer,
|
||||
.Fn EVP_PKEY_set_type
|
||||
and
|
||||
.Fn EVP_PKEY_set_type_str
|
||||
check that a matching key type exists but do not change any object.
|
||||
.Pp
|
||||
In accordance with the OpenSSL naming convention, the key obtained from
|
||||
or assigned to
|
||||
.Fa pkey
|
||||
|
@ -379,8 +416,9 @@ functions must be freed as well as
|
|||
.Fn EVP_PKEY_assign_EC_KEY ,
|
||||
.Fn EVP_PKEY_assign_GOST ,
|
||||
.Fn EVP_PKEY_assign ,
|
||||
.Fn EVP_PKEY_set_type ,
|
||||
and
|
||||
.Fn EVP_PKEY_set_type
|
||||
.Fn EVP_PKEY_set_type_str
|
||||
return 1 for success or 0 for failure.
|
||||
.Pp
|
||||
.Fn EVP_PKEY_get1_RSA ,
|
||||
|
@ -454,10 +492,11 @@ first appeared in OpenSSL 0.9.8 and have been available since
|
|||
.Ox 4.5 .
|
||||
.Pp
|
||||
.Fn EVP_PKEY_get0 ,
|
||||
.Fn EVP_PKEY_set_type ,
|
||||
.Fn EVP_PKEY_base_id ,
|
||||
.Fn EVP_PKEY_id ,
|
||||
.Fn EVP_PKEY_set_type ,
|
||||
and
|
||||
.Fn EVP_PKEY_id
|
||||
.Fn EVP_PKEY_set_type_str
|
||||
first appeared in OpenSSL 1.0.0 and have been available since
|
||||
.Ox 4.9 .
|
||||
.Pp
|
||||
|
|
121
lib/libcrypto/man/EVP_sha1.3
Normal file
121
lib/libcrypto/man/EVP_sha1.3
Normal file
|
@ -0,0 +1,121 @@
|
|||
.\" $OpenBSD: EVP_sha1.3,v 1.1 2023/08/27 15:33:08 schwarze Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this software for any
|
||||
.\" purpose with or without fee is hereby granted, provided that the above
|
||||
.\" copyright notice and this permission notice appear in all copies.
|
||||
.\"
|
||||
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate: August 27 2023 $
|
||||
.Dt EVP_SHA1 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm EVP_sha1 ,
|
||||
.Nm EVP_md5 ,
|
||||
.Nm EVP_md5_sha1 ,
|
||||
.Nm EVP_md4
|
||||
.Nd legacy message digest algorithms
|
||||
.Sh SYNOPSIS
|
||||
.In openssl/evp.h
|
||||
.Ft const EVP_MD *
|
||||
.Fn EVP_sha1 void
|
||||
.Ft const EVP_MD *
|
||||
.Fn EVP_md5 void
|
||||
.Ft const EVP_MD *
|
||||
.Fn EVP_md5_sha1 void
|
||||
.Ft const EVP_MD *
|
||||
.Fn EVP_md4 void
|
||||
.Sh DESCRIPTION
|
||||
The following message digest algorithms are cryptographically broken.
|
||||
None of them should be used in new code unless there is no way around it.
|
||||
.Pp
|
||||
.Fn EVP_sha1
|
||||
implements the SHA-1 algorithm and produces 160 bits of output
|
||||
from a given input.
|
||||
Examples of protocols and software still requiring it
|
||||
include OCSP, DNS, and the
|
||||
.Sy git
|
||||
version control system.
|
||||
.Pp
|
||||
.Fn EVP_md5
|
||||
implements the MD5 algorithm and produces 128 bits of output
|
||||
from a given input.
|
||||
It is still occasionally used when no security is required
|
||||
but a fast hash algorithm is beneficial.
|
||||
.Pp
|
||||
.Fn EVP_md5_sha1
|
||||
produces concatenated MD5 and SHA-1 message digests.
|
||||
Do not use this except where it is required for the historic SSLv3 protocol.
|
||||
.Pp
|
||||
.Fn EVP_md4
|
||||
implements the MD4 algorithm and produces 128 bits of output
|
||||
from a given input.
|
||||
It has been marked as
|
||||
.Dq historic
|
||||
by the Internet Engineering Task Force since 2011.
|
||||
.Sh RETURN VALUES
|
||||
These functions return pointers to static
|
||||
.Vt EVP_MD
|
||||
objects implementing the hash functions.
|
||||
.Sh SEE ALSO
|
||||
.Xr evp 3 ,
|
||||
.Xr EVP_DigestInit 3 ,
|
||||
.Xr EVP_MD_meth_new 3
|
||||
.Sh STANDARDS
|
||||
.Rs
|
||||
.%A T. Polk
|
||||
.%A L. Chen
|
||||
.%A S. Turner
|
||||
.%A P. Hoffman
|
||||
.%T Security Considerations for the SHA-0 and SHA-1 Message-Digest Algorithms
|
||||
.%R RFC 6194
|
||||
.%D March 2011
|
||||
.Re
|
||||
.Pp
|
||||
.Rs
|
||||
.%A S. Turner
|
||||
.%A L. Chen
|
||||
.%T Updated Security Considerations for the MD5 Message-Digest\
|
||||
and the HMAC-MD5 Algorithms
|
||||
.%R RFC 6151
|
||||
.%D March 2011
|
||||
.Re
|
||||
.Pp
|
||||
.Rs
|
||||
.%A S. Turner
|
||||
.%A L. Chen
|
||||
.%T MD4 to Historic Status
|
||||
.%R RFC 6150
|
||||
.%D March 2011
|
||||
.Re
|
||||
.Pp
|
||||
.Rs
|
||||
.%A P. Kocher
|
||||
.%A P. Karlton
|
||||
.%A A. Freier
|
||||
.%T The Secure Sockets Layer (SSL) Protocol Version 3.0
|
||||
.%R RFC 6101
|
||||
.%D August 2011
|
||||
.Re
|
||||
.Sh HISTORY
|
||||
.Fn EVP_sha1
|
||||
and
|
||||
.Fn EVP_md5
|
||||
first appeared in SSLeay 0.5.1 and have been available since
|
||||
.Ox 2.4 .
|
||||
.Pp
|
||||
.Fn EVP_md4
|
||||
first appeared in OpenSSL 0.9.6 and has been available since
|
||||
.Ox 2.9 .
|
||||
.Pp
|
||||
.Fn EVP_md5_sha1
|
||||
first appeared in OpenSSL 1.1.0 and has been available since
|
||||
.Ox 6.3 .
|
|
@ -1,4 +1,4 @@
|
|||
# $OpenBSD: Makefile,v 1.263 2023/08/25 18:22:41 schwarze Exp $
|
||||
# $OpenBSD: Makefile,v 1.264 2023/08/27 15:33:08 schwarze Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
|
@ -205,6 +205,7 @@ MAN= \
|
|||
EVP_chacha20.3 \
|
||||
EVP_des_cbc.3 \
|
||||
EVP_rc4.3 \
|
||||
EVP_sha1.3 \
|
||||
EVP_sha3_224.3 \
|
||||
EVP_sm3.3 \
|
||||
EVP_sm4_cbc.3 \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $OpenBSD: evp.3,v 1.19 2023/08/25 18:22:41 schwarze Exp $
|
||||
.\" $OpenBSD: evp.3,v 1.20 2023/08/27 15:33:08 schwarze Exp $
|
||||
.\" full merge up to: OpenSSL man7/evp 24a535ea Sep 22 13:14:20 2020 +0100
|
||||
.\"
|
||||
.\" This file was written by Ulf Moeller <ulf@openssl.org>,
|
||||
|
@ -51,7 +51,7 @@
|
|||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: August 25 2023 $
|
||||
.Dd $Mdocdate: August 27 2023 $
|
||||
.Dt EVP 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
@ -234,6 +234,7 @@ operations are more efficient using the high-level interfaces.
|
|||
.Xr EVP_PKEY_verify_recover 3 ,
|
||||
.Xr EVP_rc4 3 ,
|
||||
.Xr EVP_SealInit 3 ,
|
||||
.Xr EVP_sha1 3 ,
|
||||
.Xr EVP_sha3_224 3 ,
|
||||
.Xr EVP_SignInit 3 ,
|
||||
.Xr EVP_sm3 3 ,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue