Latest update

This commit is contained in:
2019-07-13 19:13:22 +09:00
parent 9a23f88dc2
commit 2e57f602ae
542 changed files with 17287 additions and 6184 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ ADMISSION_SYNTAX_set0_contentsOfAdmissions()
functions free any existing value and set the pointer to the specified value.
The B<ADMISSION> type has an authority name, authority object, and a
stack of B<PROFSSION_INFO> items.
stack of B<PROFESSION_INFO> items.
The ADMISSIONS_get0_admissionAuthority(), ADMISSIONS_get0_namingAuthority(),
and ADMISSIONS_get0_professionInfos()
functions return pointers to those values within the object.
+1 -1
View File
@@ -24,7 +24,7 @@ but is present for future use.
BIO_bind() binds the source address and service to a socket and
may be useful before calling BIO_connect(). The options may include
B<BIO_SOCK_REUSADDR>, which is described in L</FLAGS> below.
B<BIO_SOCK_REUSEADDR>, which is described in L</FLAGS> below.
BIO_connect() connects B<sock> to the address and service given by
B<addr>. Connection B<options> may be zero or any combination of
+18 -8
View File
@@ -41,9 +41,10 @@ If the BIO_CLOSE flag is set when a memory BIO is freed then the underlying
BUF_MEM structure is also freed.
Calling BIO_reset() on a read write memory BIO clears any data in it if the
flag BIO_FLAGS_NONCLEAR_RST is not set. On a read only BIO or if the flag
BIO_FLAGS_NONCLEAR_RST is set it restores the BIO to its original state and
the data can be read again.
flag BIO_FLAGS_NONCLEAR_RST is not set, otherwise it just restores the read
pointer to the state it was just after the last write was performed and the
data can be read again. On a read only BIO it similarly restores the BIO to
its original state and the read only data can be read again.
BIO_eof() is true if no data is in the BIO.
@@ -79,11 +80,11 @@ first, so the supplied area of memory must be unchanged until the BIO is freed.
Writes to memory BIOs will always succeed if memory is available: that is
their size can grow indefinitely.
Every read from a read write memory BIO will remove the data just read with
an internal copy operation, if a BIO contains a lot of data and it is
read in small chunks the operation can be very slow. The use of a read only
memory BIO avoids this problem. If the BIO must be read write then adding
a buffering BIO to the chain will speed up the process.
Every write after partial read (not all data in the memory buffer was read)
to a read write memory BIO will have to move the unread data with an internal
copy operation, if a BIO contains a lot of data and it is read in small
chunks intertwined with writes the operation can be very slow. Adding
a buffering BIO to the chain can speed up the process.
Calling BIO_set_mem_buf() on a BIO created with BIO_new_secmem() will
give undefined results, including perhaps a program crash.
@@ -104,6 +105,15 @@ BIO is set to BIO_NOCLOSE, before freeing the BUF_MEM the data pointer
in it must be set to NULL as the data pointer does not point to an
allocated memory.
Calling BIO_reset() on a read write memory BIO with BIO_FLAGS_NONCLEAR_RST
flag set can have unexpected outcome when the reads and writes to the
BIO are intertwined. As documented above the BIO will be reset to the
state after the last completed write operation. The effects of reads
preceding that write operation cannot be undone.
Calling BIO_get_mem_ptr() prior to a BIO_reset() call with
BIO_FLAGS_NONCLEAR_RST set has the same effect as a write operation.
=head1 BUGS
There should be an option to set the maximum size of a memory BIO.
+14 -4
View File
@@ -2,14 +2,17 @@
=head1 NAME
BN_CTX_new, BN_CTX_secure_new, BN_CTX_free - allocate and free BN_CTX structures
BN_CTX_new_ex, BN_CTX_new, BN_CTX_secure_new_ex, BN_CTX_secure_new, BN_CTX_free
- allocate and free BN_CTX structures
=head1 SYNOPSIS
#include <openssl/bn.h>
BN_CTX *BN_CTX_new_ex(OPENSSL_CTX *ctx);
BN_CTX *BN_CTX_new(void);
BN_CTX *BN_CTX_secure_new_ex(OPENSSL_CTX *ctx);
BN_CTX *BN_CTX_secure_new(void);
void BN_CTX_free(BN_CTX *c);
@@ -21,10 +24,17 @@ library functions. Since dynamic memory allocation to create B<BIGNUM>s
is rather expensive when used in conjunction with repeated subroutine
calls, the B<BN_CTX> structure is used.
BN_CTX_new() allocates and initializes a B<BN_CTX> structure.
BN_CTX_secure_new() allocates and initializes a B<BN_CTX> structure
BN_CTX_new_ex() allocates and initializes a B<BN_CTX> structure for the given
library context B<ctx>. The <ctx> value may be NULL in which case the default
library context will be used. BN_CTX_new() is the same as BN_CTX_new_ex() except
that the default library context is always used.
BN_CTX_secure_new_ex() allocates and initializes a B<BN_CTX> structure
but uses the secure heap (see L<CRYPTO_secure_malloc(3)>) to hold the
B<BIGNUM>s.
B<BIGNUM>s for the given library context B<ctx>. The <ctx> value may be NULL in
which case the default library context will be used. BN_CTX_secure_new() is the
same as BN_CTX_secure_new_ex() except that the default library context is always
used.
BN_CTX_free() frees the components of the B<BN_CTX> and the structure itself.
Since BN_CTX_start() is required in order to obtain B<BIGNUM>s from the
+8 -4
View File
@@ -51,7 +51,9 @@ L<openssl_user_macros(7)>:
=head1 DESCRIPTION
BN_generate_prime_ex() generates a pseudo-random prime number of
at least bit length B<bits>.
at least bit length B<bits>. The returned number is probably prime
with a negligible error.
If B<ret> is not B<NULL>, it will be used to store the number.
If B<cb> is not B<NULL>, it is used as follows:
@@ -89,8 +91,9 @@ generator.
If B<safe> is true, it will be a safe prime (i.e. a prime p so
that (p-1)/2 is also prime).
The PRNG must be seeded prior to calling BN_generate_prime_ex().
The prime number generation has a negligible error probability.
The random generator must be seeded prior to calling BN_generate_prime_ex().
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
BN_is_prime_ex() and BN_is_prime_fasttest_ex() test if the number B<p> is
prime. The following tests are performed until one of them shows that
@@ -193,7 +196,8 @@ Instead applications should create a BN_GENCB structure using BN_GENCB_new:
=head1 SEE ALSO
L<DH_generate_parameters(3)>, L<DSA_generate_parameters(3)>,
L<RSA_generate_key(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>
L<RSA_generate_key(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>,
L<RAND(7)>
=head1 HISTORY
+29 -8
View File
@@ -2,30 +2,37 @@
=head1 NAME
BN_rand, BN_priv_rand, BN_pseudo_rand,
BN_rand_range, BN_priv_rand_range, BN_pseudo_rand_range
BN_rand_ex, BN_rand, BN_priv_rand_ex, BN_priv_rand, BN_pseudo_rand,
BN_rand_range_ex, BN_rand_range, BN_priv_rand_range_ex, BN_priv_rand_range,
BN_pseudo_rand_range
- generate pseudo-random number
=head1 SYNOPSIS
#include <openssl/bn.h>
int BN_rand_ex(BIGNUM *rnd, int bits, int top, int bottom, BN_CTX *ctx);
int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
int BN_priv_rand_ex(BIGNUM *rnd, int bits, int top, int bottom, BN_CTX *ctx);
int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom);
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
int BN_rand_range_ex(BIGNUM *rnd, BIGNUM *range, BN_CTX *ctx);
int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
int BN_priv_rand_range_ex(BIGNUM *rnd, BIGNUM *range, BN_CTX *ctx);
int BN_priv_rand_range(BIGNUM *rnd, BIGNUM *range);
int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
=head1 DESCRIPTION
BN_rand() generates a cryptographically strong pseudo-random number of
B<bits> in length and stores it in B<rnd>.
BN_rand_ex() generate a cryptographically strong pseudo-random
number of B<bits> in length and stores it in B<rnd> using the random number
generator for the library context associated with B<ctx>. The parameter B<ctx>
may be NULL in which case the default library context is used.
If B<bits> is less than zero, or too small to
accommodate the requirements specified by the B<top> and B<bottom>
parameters, an error is returned.
@@ -40,11 +47,20 @@ If B<bottom> is B<BN_RAND_BOTTOM_ODD>, the number will be odd; if it
is B<BN_RAND_BOTTOM_ANY> it can be odd or even.
If B<bits> is 1 then B<top> cannot also be B<BN_RAND_FLG_TOPTWO>.
BN_rand_range() generates a cryptographically strong pseudo-random
number B<rnd> in the range 0 E<lt>= B<rnd> E<lt> B<range>.
BN_rand() is the same as BN_rand_ex() except that the default library context
is always used.
BN_priv_rand() and BN_priv_rand_range() have the same semantics as
BN_rand() and BN_rand_range() respectively. They are intended to be
BN_rand_range_ex() generates a cryptographically strong pseudo-random
number B<rnd> in the range 0 E<lt>= B<rnd> E<lt> B<range> using the random number
generator for the library context associated with B<ctx>. The parameter B<ctx>
may be NULL in which case the default library context is used.
BN_rand_range() is the same as BN_rand_range_ex() except that the default
library context is always used.
BN_priv_rand_ex(), BN_priv_rand(), BN_priv_rand_rand_ex() and
BN_priv_rand_range() have the same semantics as BN_rand_ex(), BN_rand(),
BN_rand_range_ex() and BN_rand_range() respectively. They are intended to be
used for generating values that should remain private, and mirror the
same difference between L<RAND_bytes(3)> and L<RAND_priv_bytes(3)>.
@@ -85,6 +101,11 @@ a future release.
The
BN_priv_rand() and BN_priv_rand_range() functions were added in OpenSSL 1.1.1.
=item *
The BN_rand_ex(), BN_priv_rand_ex(), BN_rand_range_ex() and
BN_priv_rand_range_ex() functions were added in OpenSSL 3.0.
=back
=head1 COPYRIGHT
+1 -1
View File
@@ -12,7 +12,7 @@ CMS_final - finalise a CMS_ContentInfo structure
=head1 DESCRIPTION
CMS_final() finalises the structure B<cms>. It's purpose is to perform any
CMS_final() finalises the structure B<cms>. Its purpose is to perform any
operations necessary on B<cms> (digest computation for example) and set the
appropriate fields. The parameter B<data> contains the content to be
processed. The B<dcont> parameter contains a BIO to write content to after
+39
View File
@@ -0,0 +1,39 @@
=pod
=head1 NAME
CRYPTO_memcmp - Constant time memory comparison
=head1 SYNOPSIS
#include <openssl/crypto.h>
int CRYPTO_memcmp(const void *a, const void *b, size_t len);
=head1 DESCRIPTION
The CRYPTO_memcmp function compares the B<len> bytes pointed to by B<a> and B<b>
for equality.
It takes an amount of time dependent on B<len>, but independent of the
contents of the memory regions pointed to by B<a> and B<b>.
=head1 RETURN VALUES
CRYPTO_memcmp() returns 0 if the memory regions are equal and non-zero
otherwise.
=head1 NOTES
Unlike memcmp(2), this function cannot be used to order the two memory regions
as the return value when they differ is undefined, other than being non-zero.
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
+7 -8
View File
@@ -104,9 +104,11 @@ consists of 8 bytes with odd parity. The least significant bit in
each byte is the parity bit. The key schedule is an expanded form of
the key; it is used to speed the encryption process.
DES_random_key() generates a random key. The PRNG must be seeded
prior to using this function (see L<RAND_bytes(3)>). If the PRNG
could not generate a secure key, 0 is returned.
DES_random_key() generates a random key. The random generator must be
seeded when calling this function.
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
If the function fails, 0 is returned.
Before a DES key can be used, it must be converted into the
architecture dependent I<DES_key_schedule> via the
@@ -117,11 +119,8 @@ and is not a weak or semi-weak key. If the parity is wrong, then -1
is returned. If the key is a weak key, then -2 is returned. If an
error is returned, the key schedule is not generated.
DES_set_key() works like
DES_set_key_checked() if the I<DES_check_key> flag is non-zero,
otherwise like DES_set_key_unchecked(). These functions are available
for compatibility; it is recommended to use a function that does not
depend on a global variable.
DES_set_key() works like DES_set_key_checked() and remains for
backward compatibility.
DES_set_odd_parity() sets the parity of the passed I<key> to odd.
+3 -1
View File
@@ -15,7 +15,9 @@ DSA_generate_key - generate DSA key pair
DSA_generate_key() expects B<a> to contain DSA parameters. It generates
a new key pair and stores it in B<a-E<gt>pub_key> and B<a-E<gt>priv_key>.
The PRNG must be seeded prior to calling DSA_generate_key().
The random generator must be seeded prior to calling DSA_generate_key().
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
=head1 RETURN VALUES
+5 -2
View File
@@ -36,8 +36,10 @@ B<dsa> is the signer's public key.
The B<type> parameter is ignored.
The PRNG must be seeded before DSA_sign() (or DSA_sign_setup())
The random generator must be seeded when DSA_sign() (or DSA_sign_setup())
is called.
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
=head1 RETURN VALUES
@@ -54,7 +56,8 @@ Standard, DSS), ANSI X9.30
=head1 SEE ALSO
L<DSA_new(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>,
L<DSA_do_sign(3)>
L<DSA_do_sign(3)>,
L<RAND(7)>
=head1 COPYRIGHT
+1
View File
@@ -23,6 +23,7 @@ This function is usually called by a macro.
ERR_add_error_data() associates the concatenation of its B<num> string
arguments with the error code added last.
ERR_add_error_vdata() is similar except the argument is a B<va_list>.
Multiple calls to these functions append to the current top of the error queue.
L<ERR_load_strings(3)> can be used to register
error strings so that the application can a generate human-readable
+8 -1
View File
@@ -10,7 +10,8 @@ EVP_CIPHER_meth_set_set_asn1_params, EVP_CIPHER_meth_set_get_asn1_params,
EVP_CIPHER_meth_set_ctrl, EVP_CIPHER_meth_get_init,
EVP_CIPHER_meth_get_do_cipher, EVP_CIPHER_meth_get_cleanup,
EVP_CIPHER_meth_get_set_asn1_params, EVP_CIPHER_meth_get_get_asn1_params,
EVP_CIPHER_meth_get_ctrl - Routines to build up EVP_CIPHER methods
EVP_CIPHER_meth_get_ctrl, EVP_CIPHER_up_ref
- Routines to build up EVP_CIPHER methods
=head1 SYNOPSIS
@@ -62,6 +63,8 @@ EVP_CIPHER_meth_get_ctrl - Routines to build up EVP_CIPHER methods
int type, int arg,
void *ptr);
int EVP_CIPHER_up_ref(EVP_CIPHER *cipher);
=head1 DESCRIPTION
The B<EVP_CIPHER> type is a structure for symmetric cipher method
@@ -223,6 +226,8 @@ EVP_CIPHER_meth_get_get_asn1_params() and EVP_CIPHER_meth_get_ctrl()
are all used to retrieve the method data given with the
EVP_CIPHER_meth_set_*() functions above.
EVP_CIPHER_up_ref() increments the reference count for an EVP_CIPHER structure.
=head1 RETURN VALUES
EVP_CIPHER_meth_new() and EVP_CIPHER_meth_dup() return a pointer to a
@@ -231,6 +236,8 @@ All EVP_CIPHER_meth_set_*() functions return 1.
All EVP_CIPHER_meth_get_*() functions return pointers to their
respective B<cipher> function.
EVP_CIPHER_up_ref() returns 1 for success or 0 otherwise.
=head1 SEE ALSO
L<EVP_EncryptInit>
+61 -4
View File
@@ -3,8 +3,8 @@
=head1 NAME
EVP_MD_CTX_new, EVP_MD_CTX_reset, EVP_MD_CTX_free, EVP_MD_CTX_copy,
EVP_MD_CTX_copy_ex, EVP_MD_CTX_ctrl, EVP_MD_CTX_set_flags,
EVP_MD_CTX_clear_flags, EVP_MD_CTX_test_flags,
EVP_MD_CTX_copy_ex, EVP_MD_CTX_ctrl, EVP_MD_CTX_set_params, EVP_MD_CTX_get_params,
EVP_MD_CTX_set_flags, EVP_MD_CTX_clear_flags, EVP_MD_CTX_test_flags,
EVP_Digest, EVP_DigestInit_ex, EVP_DigestInit, EVP_DigestUpdate,
EVP_DigestFinal_ex, EVP_DigestFinalXOF, EVP_DigestFinal,
EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, EVP_MD_block_size, EVP_MD_flags,
@@ -22,6 +22,8 @@ EVP_MD_CTX_pkey_ctx, EVP_MD_CTX_set_pkey_ctx - EVP digest routines
int EVP_MD_CTX_reset(EVP_MD_CTX *ctx);
void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
void EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void* p2);
int EVP_MD_CTX_get_params(EVP_MD_CTX *ctx, OSSL_PARAM params[]);
int EVP_MD_CTX_set_params(EVP_MD_CTX *ctx, const OSSL_PARAM params[]);
void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags);
int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags);
@@ -88,12 +90,25 @@ Cleans up digest context B<ctx> and frees up the space allocated to it.
=item EVP_MD_CTX_ctrl()
This is a legacy method. EVP_MD_CTX_set_params() and EVP_MD_CTX_get_params()
is the mechanism that should be used to set and get parameters that are used by
providers.
Performs digest-specific control actions on context B<ctx>. The control command
is indicated in B<cmd> and any additional arguments in B<p1> and B<p2>.
EVP_MD_CTX_ctrl() must be called after EVP_DigestInit_ex(). Other restrictions
may apply depending on the control type and digest implementation.
See L</CONTROLS> below for more information.
=item EVP_MD_CTX_get_params
Retrieves the requested list of B<params> from a MD context B<ctx>.
See L</PARAMS> below for more information.
=item EVP_MD_CTX_set_params
Sets the list of <params> into a MD context B<ctx>.
See L</PARAMS> below for more information.
=item EVP_MD_CTX_set_flags(), EVP_MD_CTX_clear_flags(), EVP_MD_CTX_test_flags()
Sets, clears and tests B<ctx> flags. See L</FLAGS> below for more information.
@@ -239,6 +254,38 @@ depends on how the B<EVP_PKEY_CTX> is created.
=back
=head1 PARAMS
See L<OSSL_PARAM(3)> for information about passing parameters.
EVP_MD_CTX_set_params() can be used with the following OSSL_PARAM keys:
=over 4
=item OSSL_PARAM_DIGEST_KEY_XOFLEN <size_t>
Sets the digest length for extendable output functions.
It is used by the SHAKE algorithm.
=item OSSL_PARAM_DIGEST_KEY_PAD_TYPE <int>
Sets the pad type.
It is used by the MDC2 algorithm.
=back
EVP_MD_CTX_get_params() can be used with the following OSSL_PARAM keys:
=over 4
=item OSSL_PARAM_DIGEST_KEY_MICALG <utf8string>.
Gets the digest Message Integrity Check algorithm string. This is used when
creating S/MIME multipart/signed messages, as specified in RFC 3851.
It may be used by external engines or providers.
=back
=head1 CONTROLS
EVP_MD_CTX_ctrl() can be used to send the following standard controls:
@@ -307,6 +354,11 @@ success and 0 for failure.
Returns 1 if successful or 0 for failure.
=item EVP_MD_CTX_set_params(),
EVP_MD_CTX_get_params()
Returns 1 if successful or 0 for failure.
=item EVP_MD_CTX_copy_ex()
Returns 1 if successful or 0 for failure.
@@ -418,7 +470,9 @@ digest name passed on the command line.
L<EVP_MD_meth_new(3)>,
L<dgst(1)>,
L<evp(7)>
L<evp(7)>,
L<OSSL_PROVIDER(3)>,
L<OSSL_PARAM(3)>
The full list of digest algorithms are provided below.
@@ -446,9 +500,12 @@ The EVP_dss1() function was removed in OpenSSL 1.1.0.
The EVP_MD_CTX_set_pkey_ctx() function was added in 1.1.1.
The EVP_MD_CTX_set_params() and EVP_MD_CTX_get_params() functions were
added in 3.0.
=head1 COPYRIGHT
Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+6 -4
View File
@@ -35,7 +35,7 @@ EVP_MD_CTX is freed).
The digest B<type> may be NULL if the signing algorithm supports it.
No B<EVP_PKEY_CTX> will be created by EVP_DigsetSignInit() if the passed B<ctx>
No B<EVP_PKEY_CTX> will be created by EVP_DigestSignInit() if the passed B<ctx>
has already been assigned one via L<EVP_MD_CTX_set_ctx(3)>. See also L<SM2(7)>.
Only EVP_PKEY types that support signing can be used with these functions. This
@@ -125,8 +125,9 @@ and public key algorithms. This meant that "clone" digests such as EVP_dss1()
needed to be used to sign using SHA1 and DSA. This is no longer necessary and
the use of clone digest is now discouraged.
For some key types and parameters the random number generator must be seeded
or the operation will fail.
For some key types and parameters the random number generator must be seeded.
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
The call to EVP_DigestSignFinal() internally finalizes a copy of the digest
context. This means that calls to EVP_DigestSignUpdate() and
@@ -147,7 +148,8 @@ L<EVP_DigestVerifyInit(3)>,
L<EVP_DigestInit(3)>,
L<evp(7)>, L<HMAC(3)>, L<MD2(3)>,
L<MD5(3)>, L<MDC2(3)>, L<RIPEMD160(3)>,
L<SHA1(3)>, L<dgst(1)>
L<SHA1(3)>, L<dgst(1)>,
L<RAND(7)>
=head1 HISTORY
+6 -4
View File
@@ -32,7 +32,7 @@ being passed to EVP_DigestVerifyInit() (which means the EVP_PKEY_CTX is created
inside EVP_DigestVerifyInit() and it will be freed automatically when the
EVP_MD_CTX is freed).
No B<EVP_PKEY_CTX> will be created by EVP_DigsetSignInit() if the passed B<ctx>
No B<EVP_PKEY_CTX> will be created by EVP_DigestSignInit() if the passed B<ctx>
has already been assigned one via L<EVP_MD_CTX_set_ctx(3)>. See also L<SM2(7)>.
EVP_DigestVerifyUpdate() hashes B<cnt> bytes of data at B<d> into the
@@ -76,8 +76,9 @@ and public key algorithms. This meant that "clone" digests such as EVP_dss1()
needed to be used to sign using SHA1 and DSA. This is no longer necessary and
the use of clone digest is now discouraged.
For some key types and parameters the random number generator must be seeded
or the operation will fail.
For some key types and parameters the random number generator must be seeded.
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
The call to EVP_DigestVerifyFinal() internally finalizes a copy of the digest
context. This means that EVP_VerifyUpdate() and EVP_VerifyFinal() can
@@ -93,7 +94,8 @@ L<EVP_DigestSignInit(3)>,
L<EVP_DigestInit(3)>,
L<evp(7)>, L<HMAC(3)>, L<MD2(3)>,
L<MD5(3)>, L<MDC2(3)>, L<RIPEMD160(3)>,
L<SHA1(3)>, L<dgst(1)>
L<SHA1(3)>, L<dgst(1)>,
L<RAND(7)>
=head1 HISTORY
+1
View File
@@ -278,6 +278,7 @@ L<EVP_KDF_HKDF(7)>
L<EVP_KDF_SS(7)>
L<EVP_KDF_SSHKDF(7)>
L<EVP_KDF_X963(7)>
L<EVP_KDF_X942KDF(7)>
=head1 HISTORY
+11 -10
View File
@@ -3,7 +3,7 @@
=head1 NAME
EVP_MAC, EVP_MAC_CTX, EVP_MAC_CTX_new, EVP_MAC_CTX_new_id, EVP_MAC_CTX_free,
EVP_MAC_CTX_copy, EVP_MAC_CTX_mac, EVP_MAC_size, EVP_MAC_init, EVP_MAC_update,
EVP_MAC_CTX_dup, EVP_MAC_CTX_mac, EVP_MAC_size, EVP_MAC_init, EVP_MAC_update,
EVP_MAC_final, EVP_MAC_ctrl, EVP_MAC_vctrl, EVP_MAC_ctrl_str,
EVP_MAC_str2ctrl, EVP_MAC_hex2ctrl, EVP_MAC_nid, EVP_MAC_name,
EVP_get_macbyname, EVP_get_macbynid, EVP_get_macbyobj - EVP MAC routines
@@ -18,7 +18,7 @@ EVP_get_macbyname, EVP_get_macbynid, EVP_get_macbyobj - EVP MAC routines
EVP_MAC_CTX *EVP_MAC_CTX_new(const EVP_MAC *mac);
EVP_MAC_CTX *EVP_MAC_CTX_new_id(int nid);
void EVP_MAC_CTX_free(EVP_MAC_CTX *ctx);
int EVP_MAC_CTX_copy(EVP_MAC_CTX *dest, EVP_MAC_CTX *src);
EVP_MAC_CTX *EVP_MAC_CTX_dup(const EVP_MAC_CTX *src);
const EVP_MAC *EVP_MAC_CTX_mac(EVP_MAC_CTX *ctx);
size_t EVP_MAC_size(EVP_MAC_CTX *ctx);
int EVP_MAC_init(EVP_MAC_CTX *ctx);
@@ -72,10 +72,8 @@ EVP_MAC_CTX_free() frees the contents of the context, including an
underlying context if there is one, as well as the context itself.
B<NULL> is a valid parameter, for which this function is a no-op.
EVP_MAC_CTX_copy() makes a deep copy of the C<src> context to the
C<dest> context.
The C<dest> context I<must> have been created before calling this
function.
EVP_MAC_CTX_dup() duplicates the C<src> context and returns a newly allocated
context.
EVP_MAC_CTX_mac() returns the B<EVP_MAC> associated with the context
C<ctx>.
@@ -231,13 +229,12 @@ implemented as a macro.
=head1 RETURN VALUES
EVP_MAC_CTX_new() and EVP_MAC_CTX_new_id() return a pointer to a newly
created EVP_MAC_CTX, or NULL if allocation failed.
EVP_MAC_CTX_new(), EVP_MAC_CTX_new_id() and EVP_MAC_CTX_dup() return a pointer
to a newly created EVP_MAC_CTX, or NULL if allocation failed.
EVP_MAC_CTX_free() returns nothing at all.
EVP_MAC_CTX_copy(), EVP_MAC_init(), EVP_MAC_update(),
and EVP_MAC_final() return 1 on success, 0 on error.
EVP_MAC_init(), EVP_MAC_update(), and EVP_MAC_final() return 1 on success, 0 on error.
EVP_MAC_ctrl(), EVP_MAC_ctrl_str(), EVP_MAC_str2ctrl() and
EVP_MAC_hex2ctrl() return 1 on success and 0 or a negative value on
@@ -359,6 +356,10 @@ L<EVP_MAC_KMAC(7)>,
L<EVP_MAC_SIPHASH(7)>,
L<EVP_MAC_POLY1305(7)>
=head1 HISTORY
These functions were added in OpenSSL 3.0.0.
=head1 COPYRIGHT
Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
+96 -36
View File
@@ -2,7 +2,7 @@
=head1 NAME
EVP_MD_fetch
EVP_MD_fetch, EVP_CIPHER_fetch
- Functions to explicitly fetch algorithm implementations
=head1 SYNOPSIS
@@ -11,60 +11,106 @@ EVP_MD_fetch
EVP_MD *EVP_MD_fetch(OPENSSL_CTX *ctx, const char *algorithm,
const char *properties);
EVP_CIPHER *EVP_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
const char *properties);
=head1 DESCRIPTION
The B<EVP_MD> object is used for representing a digest method implementation.
Cryptographic algorithms are represented by different OpenSSL objects depending
on what type of algorithm it is. The following cryptographic algorithm types are
supported.
Having obtained a digest implementation as an B<EVP_MD> type it can be used to
calculate the digest of input data using functions such as
L<EVP_DigestInit_ex(3)>, L<EVP_DigestUpdate(3)> and L<EVP_DigestFinal_ex(3)>.
=over 4
Digest implementations may be obtained in one of three ways, i.e. implicit
fetch, explicit fetch or user defined.
=item B<EVP_MD>
Represents a digest algorithm.
=item B<EVP_CIPHER>
Represents a symmetric cipher algorithm.
=item B<EVP_MAC>
Represents a Message Authentication Code algorithm.
=item B<EVP_KDF>
Represents a Key Derivation Function algorithm.
=back
The algorithm objects may or may not have an associated algorithm
implementation.
Cryptographic algorithms are implemented by providers.
Any algorithm may be supported by zero or more providers.
In order to use an algorithm an implementation must first be obtained.
This can happen in one of three ways, i.e. implicit fetch, explicit fetch or
user defined.
=over 4
=item Implicit Fetch
With implicit fetch an application can use functions such as L<EVP_sha256(3)>,
L<EVP_sha512(3)> or L<EVP_blake2b512(3)> to obtain an B<EVP_MD> object. When
used in a function like L<EVP_DigestInit_ex(3)> the actual implementation to
be used will be fetched implicitly using default search criteria. Typically,
(unless the default search criteria have been changed and/or different providers
have been loaded), this will return an implementation of the appropriate
algorithm from the default provider.
L<EVP_blake2b512(3)> or L<EVP_aes_128_cbc(3)> to obtain an algorithm object with
no associated implementation.
When used in a function like L<EVP_DigestInit_ex(3)> or L<EVP_CipherInit_ex(3)>
the actual implementation to be used will be fetched implicitly using default
search criteria.
Typically, this will return an implementation of the appropriate algorithm from
the default provider unless the default search criteria have been changed and/or
different providers have been loaded.
=item Explicit Fetch
With explicit fetch an application uses the EVP_MD_fetch() function to obtain
an algorithm implementation. An implementation with the given name and
satisfying the search criteria specified in the B<properties> parameter
combined with the default search criteria will be looked for within the
available providers and returned.
With explicit fetch an application uses one of the "fetch" functions to obtain
an algorithm object with an associated implementation.
An implementation with the given name that satisfies the search criteria
specified in the B<properties> parameter combined with the default search
criteria will be looked for within the available providers and returned.
See L<EVP_set_default_properties(3)> for information on default search criteria
and L<OSSL_PROVIDER(3)> for information about providers.
=item User defined
Using the user defined approach an application constructs its own EVP_MD object.
See L<EVP_MD_meth_new(3)> for details.
Using the user defined approach an application constructs its own algorithm
object.
See L<EVP_MD_meth_new(3)> and L<EVP_CIPHER_meth_new(3)> for details.
=back
The EVP_MD_fetch() function will look for an algorithm within the providers that
have been loaded into the B<OPENSSL_CTX> given in the B<ctx> parameter. This
parameter may be NULL in which case the default B<OPENSSL_CTX> will be used. See
L<OPENSSL_CTX_new(3)> and L<OSSL_PROVIDER_load(3)> for further details.
Having obtained an algorithm implementation as an algorithm object it can then
be used to perform cryptographic operations.
For example to calculate the digest of input data with an B<EVP_MD> algorithm
object you can use functions such as L<EVP_DigestInit_ex(3)>,
L<EVP_DigestUpdate(3)> and L<EVP_DigestFinal_ex(3)>.
The fetch functions will look for an algorithm within the providers that
have been loaded into the B<OPENSSL_CTX> given in the B<ctx> parameter.
This parameter may be NULL in which case the default B<OPENSSL_CTX> will be
used.
See L<OPENSSL_CTX_new(3)> and L<OSSL_PROVIDER_load(3)> for further details.
The B<algorithm> parameter gives the name of the algorithm to be looked up.
Different algorithms can be made available by loading different providers. The
built-in default provider algorithm implementation names are: SHA1, SHA224,
SHA256, SHA384, SHA512, SHA512-224, SHA512-256,SHA3-224, SHA3-256, SHA3-384,
SHA3-512, SHAKE128, SHAKE256, SM3, BLAKE2b512, BLAKE2s256 and MD5-SHA1.
Different algorithms can be made available by loading different providers.
The built-in default provider digest algorithm implementation names are: SHA1,
SHA224, SHA256, SHA384, SHA512, SHA512-224, SHA512-256, SHA3-224, SHA3-256,
SHA3-384, SHA3-512, SHAKE128, SHAKE256, SM3, BLAKE2b512, BLAKE2s256 and
MD5-SHA1.
The built-in default provider cipher algorithm implementation names are:
AES-256-ECB, AES-192-ECB, AES-128-ECB, AES-256-CBC, AES-192-CBC, AES-128-CBC,
AES-256-OFB, AES-192-OFB, AES-128-OFB, AES-256-CFB, AES-192-CFB, AES-128-CFB,
AES-256-CFB1, AES-192-CFB1, AES-128-CFB1, AES-256-CFB8, AES-192-CFB8,
AES-128-CFB8, AES-256-CTR, AES-192-CTR, AES-128-CTR, id-aes256-GCM,
id-aes192-GCM and id-aes128-GCM.
Additional algorithm implementations may be obtained by loading the "legacy"
provider. The names of these algorithms are: RIPEMD160, MD2, MD4, MD5, MDC2 and
provider.
The legacy provider digest algorithms are: RIPEMD160, MD2, MD4, MD5, MDC2 and
whirlpool.
The B<properties> parameter specifies the search criteria that will be used to
@@ -82,14 +128,19 @@ NULL in which case any implementation from the available providers with the
given algorithm name will be returned.
The return value from a call to EVP_MD_fetch() must be freed by the caller using
L<EVP_MD_meth_free(3)>. Note that EVP_MD objects are reference counted. See
L<EVP_MD_upref(3)>.
L<EVP_MD_meth_free(3)>.
Note that EVP_MD objects are reference counted. See L<EVP_MD_up_ref(3)>.
The return value from a call to EVP_CIPHER_fetch() must be freed by the caller
using L<EVP_CIPHER_meth_free(3)>.
Note that EVP_CIPHER objects are reference counted.
See L<EVP_CIPHER_up_ref(3)>.
=head1 NOTES
Where an application that previously used implicit fetch is converted to use
explicit fetch care should be taken with the L<EVP_MD_CTX_md(3)> function.
Specifically, this function returns the EVP_MD object orginally passed to
Specifically, this function returns the EVP_MD object originally passed to
EVP_DigestInit_ex() (or other similar function). With implicit fetch the
returned EVP_MD object is guaranteed to be available throughout the application
lifetime. However, with explicit fetch EVP_MD objects are reference counted.
@@ -107,6 +158,14 @@ an EVP_MD object, or NULL on error.
Fetch any available implementation of SHA256 in the default context:
EVP_MD *md = EVP_MD_fetch(NULL, "SHA256", NULL);
...
EVP_MD_meth_free(md);
Fetch any available implementation of AES-128-CBC in the default context:
EVP_CIPHER *cipher = EVP_CIPHER_fetch(NULL, "AES-128-CBC", NULL);
...
EVP_CIPHER_meth_free(cipher);
Fetch an implementation of SHA256 from the default provider in the default
context:
@@ -140,7 +199,7 @@ implementation of whirlpool from it:
EVP_MD_meth_free(md);
Note that in the above example the property string "legacy=yes" is optional
since, assuming no other providers have been loaded, the only implmentation of
since, assuming no other providers have been loaded, the only implementation of
the "whirlpool" algorithm is in the "legacy" provider. Also note that the
default provider should be explicitly loaded if it is required in addition to
other providers:
@@ -157,9 +216,10 @@ other providers:
=head1 SEE ALSO
L<EVP_DigestInit(3)>, L<EVP_MD_meth_new(3)>, L<EVP_MD_meth_free(3)>,
L<EVP_MD_upref(3)>, L<OSSL_PROVIDER_load(3)>, L<OPENSSL_CTX(3)>,
L<EVP_set_default_properties(3)>
L<EVP_DigestInit_ex(3)>, L<EVP_EncryptInit_ex(3)>, L<EVP_MD_meth_new(3)>,
L<EVP_MD_meth_free(3)>, L<EVP_CIPHER_meth_new(3)>, L<EVP_CIPHER_meth_free(3)>,
L<EVP_MD_up_ref(3)>, L<EVP_CIPHER_up_ref(3)>, L<OSSL_PROVIDER_load(3)>,
L<OPENSSL_CTX(3)>, L<EVP_set_default_properties(3)>
=head1 HISTORY
+5 -5
View File
@@ -11,7 +11,7 @@ EVP_MD_meth_set_ctrl, EVP_MD_meth_get_input_blocksize,
EVP_MD_meth_get_result_size, EVP_MD_meth_get_app_datasize,
EVP_MD_meth_get_flags, EVP_MD_meth_get_init, EVP_MD_meth_get_update,
EVP_MD_meth_get_final, EVP_MD_meth_get_copy, EVP_MD_meth_get_cleanup,
EVP_MD_meth_get_ctrl, EVP_MD_upref
EVP_MD_meth_get_ctrl, EVP_MD_up_ref
- Routines to build up EVP_MD methods
=head1 SYNOPSIS
@@ -54,7 +54,7 @@ EVP_MD_meth_get_ctrl, EVP_MD_upref
int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd,
int p1, void *p2);
int EVP_MD_upref(EVP_MD *md);
int EVP_MD_up_ref(EVP_MD *md);
=head1 DESCRIPTION
@@ -162,7 +162,7 @@ EVP_MD_meth_get_cleanup() and EVP_MD_meth_get_ctrl() are all used
to retrieve the method data given with the EVP_MD_meth_set_*()
functions above.
EVP_MD_upref() increments the reference count for an EVP_MD structure.
EVP_MD_up_ref() increments the reference count for an EVP_MD structure.
=head1 RETURN VALUES
@@ -175,7 +175,7 @@ indicated sizes or flags.
All other EVP_CIPHER_meth_get_*() functions return pointers to their
respective B<md> function.
EVP_MD_upref() returns 1 for success or 0 otherwise.
EVP_MD_up_ref() returns 1 for success or 0 otherwise.
=head1 SEE ALSO
@@ -184,7 +184,7 @@ L<EVP_DigestInit(3)>, L<EVP_SignInit(3)>, L<EVP_VerifyInit(3)>
=head1 HISTORY
The B<EVP_MD> structure was openly available in OpenSSL before version
1.1. EVP_MD_upref() was added in OpenSSL 3.0. All other functions described
1.1. EVP_MD_up_ref() was added in OpenSSL 3.0. All other functions described
here were added in OpenSSL 1.1.
=head1 COPYRIGHT
+5 -2
View File
@@ -55,7 +55,9 @@ failure.
=head1 NOTES
Because a random secret key is generated the random number generator
must be seeded before calling EVP_SealInit().
must be seeded when EVP_SealInit() is called.
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
The public key must be RSA because it is the only OpenSSL public key
algorithm that supports key transport.
@@ -75,7 +77,8 @@ with B<type> set to NULL.
L<evp(7)>, L<RAND_bytes(3)>,
L<EVP_EncryptInit(3)>,
L<EVP_OpenInit(3)>
L<EVP_OpenInit(3)>,
L<RAND(7)>
=head1 COPYRIGHT
+4 -3
View File
@@ -66,9 +66,10 @@ The B<EVP> interface to digital signatures should almost always be used in
preference to the low level interfaces. This is because the code then becomes
transparent to the algorithm used and much more flexible.
When signing with DSA private keys the random number generator must be seeded
or the operation will fail. The random number generator does not need to be
seeded for RSA signatures.
When signing with DSA private keys the random number generator must be seeded.
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
This requirement does not hold for RSA signatures.
The call to EVP_SignFinal() internally finalizes a copy of the digest context.
This means that calls to EVP_SignUpdate() and EVP_SignFinal() can be called
+1 -1
View File
@@ -72,7 +72,7 @@ data have been passed through EVP_SignUpdate().
It is not possible to change the signing parameters using these function.
The previous two bugs are fixed in the newer EVP_VerifyDigest*() function.
The previous two bugs are fixed in the newer EVP_DigestVerify*() function.
=head1 SEE ALSO
+2 -2
View File
@@ -32,7 +32,7 @@ EVP_aria_256_ccm,
EVP_aria_128_gcm,
EVP_aria_192_gcm,
EVP_aria_256_gcm,
- EVP AES cipher
- EVP ARIA cipher
=head1 SYNOPSIS
@@ -106,7 +106,7 @@ L<EVP_CIPHER_meth_new(3)>
=head1 COPYRIGHT
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+1 -1
View File
@@ -29,7 +29,7 @@ The MD5 algorithm which produces a 128-bit output from a given input.
=item EVP_md5_sha1()
A hash algorithm of SSL v3 that combines MD5 with SHA-1 as decirbed in RFC
A hash algorithm of SSL v3 that combines MD5 with SHA-1 as described in RFC
6101.
WARNING: this algorithm is not intended for non-SSL usage.
+20 -5
View File
@@ -33,7 +33,26 @@ EVP_rc5_32_12_16_ofb()
RC5 encryption algorithm in CBC, CFB, ECB and OFB modes respectively. This is a
variable key length cipher with an additional "number of rounds" parameter. By
default the key length is set to 128 bits and 12 rounds.
default the key length is set to 128 bits and 12 rounds. Alternative key lengths
can be set using L<EVP_CIPHER_CTX_set_key_length(3)>. The maximum key length is
2040 bits.
The following rc5 specific I<ctrl>s are supported (see
L<EVP_CIPHER_CTX_ctrl(3)>).
=over 4
=item EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, rounds, NULL)
Sets the number of rounds to B<rounds>. This must be one of RC5_8_ROUNDS,
RC5_12_ROUNDS or RC5_16_ROUNDS.
=item EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC5_ROUNDS, 0, &rounds)
Stores the number of rounds currently configured in B<*rounds> where B<*rounds>
is an int.
=back
=back
@@ -43,10 +62,6 @@ These functions return an B<EVP_CIPHER> structure that contains the
implementation of the symmetric cipher. See L<EVP_CIPHER_meth_new(3)> for
details of the B<EVP_CIPHER> structure.
=head1 BUGS
Currently the number of rounds in RC5 can only be set to 8, 12 or 16.
This is a limitation of the current RC5 code rather than the EVP interface.
=head1 SEE ALSO
+4
View File
@@ -21,6 +21,10 @@ the internal default context with functions that take a C<OPENSSL_CTX>
argument.
OPENSSL_CTX_new() creates a new OpenSSL library context.
When a non default library context is in use care should be taken with
multi-threaded applications to properly clean up thread local resources before
the OPENSSL_CTX is freed.
See L<OPENSSL_thread_stop_ex(3)> for more information.
OPENSSL_CTX_free() frees the given C<ctx>.
+2 -2
View File
@@ -24,7 +24,7 @@ The OPENSSL_fork_prepare(), OPENSSL_fork_parent(), and OPENSSL_fork_child()
functions are used to reset this internal state.
Platforms without fork(2) will probably not need to use these functions.
Platforms with fork(2) but without pthreads_atfork(3) will probably need
Platforms with fork(2) but without pthread_atfork(3) will probably need
to call them manually, as described in the following paragraph. Platforms
such as Linux that have both functions will normally not need to call these
functions as the OpenSSL library will do so automatically.
@@ -32,7 +32,7 @@ functions as the OpenSSL library will do so automatically.
L<OPENSSL_init_crypto(3)> will register these functions with the appropriate
handler, when the B<OPENSSL_INIT_ATFORK> flag is used. For other
applications, these functions can be called directly. They should be used
according to the calling sequence described by the pthreads_atfork(3)
according to the calling sequence described by the pthread_atfork(3)
documentation, which is summarized here. OPENSSL_fork_prepare() should
be called before a fork() is done. After the fork() returns, the parent
process should call OPENSSL_fork_parent() and the child process should
+21 -6
View File
@@ -5,7 +5,7 @@
OPENSSL_INIT_new, OPENSSL_INIT_set_config_filename,
OPENSSL_INIT_set_config_appname, OPENSSL_INIT_set_config_file_flags,
OPENSSL_INIT_free, OPENSSL_init_crypto, OPENSSL_cleanup, OPENSSL_atexit,
OPENSSL_thread_stop - OpenSSL initialisation
OPENSSL_thread_stop_ex, OPENSSL_thread_stop - OpenSSL initialisation
and deinitialisation functions
=head1 SYNOPSIS
@@ -15,6 +15,7 @@ and deinitialisation functions
void OPENSSL_cleanup(void);
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
int OPENSSL_atexit(void (*handler)(void));
void OPENSSL_thread_stop_ex(OPENSSL_CTX *ctx);
void OPENSSL_thread_stop(void);
OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void);
@@ -202,11 +203,25 @@ called after deinitialisation of resources local to a thread, but before other
process wide resources are freed. In the event that multiple stop handlers are
registered, no guarantees are made about the order of execution.
The OPENSSL_thread_stop() function deallocates resources associated
with the current thread. Typically this function will be called automatically by
the library when the thread exits. This should only be called directly if
resources should be freed at an earlier time, or under the circumstances
described in the NOTES section below.
The OPENSSL_thread_stop_ex() function deallocates resources associated
with the current thread for the given OPENSSL_CTX B<ctx>. The B<ctx> parameter
can be NULL in which case the default OPENSSL_CTX is used.
Typically, this function will be called automatically by the library when
the thread exits as long as the OPENSSL_CTX has not been freed before the thread
exits. If OPENSSL_CTX_free() is called OPENSSL_thread_stop_ex will be called
automatically for the current thread (but not any other threads that may have
used this OPENSSL_CTX).
OPENSSL_thread_stop_ex should be called on all threads that will exit after the
OPENSSL_CTX is freed.
Typically this is not necessary for the default OPENSSL_CTX (because all
resources are cleaned up on library exit) except if thread local resources
should be freed before library exit, or under the circumstances described in
the NOTES section below.
OPENSSL_thread_stop() is the same as OPENSSL_thread_stop_ex() except that the
default OPENSSL_CTX is always used.
The B<OPENSSL_INIT_LOAD_CONFIG> flag will load a configuration file, as with
L<CONF_modules_load_file(3)> with NULL filename and application name and the
+18 -3
View File
@@ -34,14 +34,14 @@ There are three types of tokens:
The name of a processor generation. A bit in the environment variable's
mask is set to one if and only if the specified processor generation
implements the corresponding instruction set extension. Possible values
are z900, z990, z9, z10, z196, zEC12, z13 and z14.
are z900, z990, z9, z10, z196, zEC12, z13, z14 and z15.
=item <string>:<mask>:<mask>
The name of an instruction followed by two 64-bit masks. The part of the
environment variable's mask corresponding to the specified instruction is
set to the specified 128-bit mask. Possible values are kimd, klmd, km, kmc,
kmac, kmctr, kmo, kmf, prno and kma.
kmac, kmctr, kmo, kmf, prno, kma, pcc and kdsa.
=item stfle:<mask>:<mask>:<mask>
@@ -139,6 +139,21 @@ the numbering is continuous across 64-bit mask boundaries.
# 20 1<<43 KMA-GCM-AES-256
:
pcc :
:
# 64 1<<63 PCC-Scalar-Multiply-P256
# 65 1<<62 PCC-Scalar-Multiply-P384
# 66 1<<61 PCC-Scalar-Multiply-P521
kdsa :
# 1 1<<62 KDSA-ECDSA-Verify-P256
# 2 1<<61 KDSA-ECDSA-Verify-P384
# 3 1<<60 KDSA-ECDSA-Verify-P521
# 9 1<<54 KDSA-ECDSA-Sign-P256
# 10 1<<53 KDSA-ECDSA-Sign-P384
# 11 1<<52 KDSA-ECDSA-Sign-P521
:
=head1 RETURN VALUES
Not available.
@@ -159,7 +174,7 @@ Disables the KM-XTS-AES and and the KIMD-SHAKE function codes:
=head1 SEE ALSO
[1] z/Architecture Principles of Operation, SA22-7832-11
[1] z/Architecture Principles of Operation, SA22-7832-12
=head1 COPYRIGHT
+105
View File
@@ -0,0 +1,105 @@
=pod
=head1 NAME
OSSL_CMP_ITAV_create,
OSSL_CMP_ITAV_set0,
OSSL_CMP_ITAV_get0_type,
OSSL_CMP_ITAV_get0_value,
OSSL_CMP_ITAV_push0_stack_item
- OSSL_CMP_ITAV utility functions
=head1 SYNOPSIS
#include <openssl/cmp.h>
OSSL_CMP_ITAV *OSSL_CMP_ITAV_create(ASN1_OBJECT *type, ASN1_TYPE *value);
void OSSL_CMP_ITAV_set0(OSSL_CMP_ITAV *itav, ASN1_OBJECT *type,
ASN1_TYPE *value);
ASN1_OBJECT *OSSL_CMP_ITAV_get0_type(const OSSL_CMP_ITAV *itav);
ASN1_TYPE *OSSL_CMP_ITAV_get0_value(const OSSL_CMP_ITAV *itav);
int OSSL_CMP_ITAV_push0_stack_item(STACK_OF(OSSL_CMP_ITAV) **itav_sk_p,
OSSL_CMP_ITAV *itav);
=head1 DESCRIPTION
ITAV is short for InfoTypeAndValue. This type is defined in RFC 4210
section 5.3.19 and Appendix F. It is used at various places in CMP messages,
e.g., in the generalInfo PKIHeader field, to hold a key-value pair.
OSSL_CMP_ITAV_create() creates a new OSSL_CMP_ITAV structure and fills it in.
It combines B<OSSL_CMP_ITAV_new()> and B<OSSL_CMP_ITAV_set0>.
OSSL_CMP_ITAV_set0() sets the B<itav> with an infoType of B<type> and an
infoValue of B<value>. This function uses the pointers B<type> and B<value>
internally, so they must B<not> be freed up after the call.
OSSL_CMP_ITAV_get0_type() returns a direct pointer to the infoType in the
B<itav>.
OSSL_CMP_ITAV_get0_value() returns a direct pointer to the infoValue in
the B<itav> as generic ASN1_TYPE*.
OSSL_CMP_ITAV_push0_stack_item() pushes B<itav> to the stack pointed to
by B<*itav_sk_p>. It creates a new stack if B<*itav_sk_p> points to NULL.
=head1 NOTES
CMP is defined in RFC 4210 (and CRMF in RFC 4211).
=head1 RETURN VALUES
OSSL_CMP_ITAV_create() returns a pointer to the ITAV structure on success,
or NULL on error.
OSSL_CMP_ITAV_set0() does not return a value.
OSSL_CMP_ITAV_get0_type() and OSSL_CMP_ITAV_get0_value()
return the respective pointer or NULL if their input is NULL.
OSSL_CMP_ITAV_push0_stack_item() returns 1 on success, 0 on error.
=head1 EXAMPLE
The following code creates and sets a structure representing a generic
InfoTypeAndValue sequence, using an OID created from text as type, and an
integer as value. Afterwards, it is pushed to the OSSL_CMP_CTX to be later
included in the requests' PKIHeader's genInfo field.
ASN1_OBJECT *type = OBJ_txt2obj("1.2.3.4.5", 1);
if (type == NULL) ...
ASN1_INTEGER *asn1int = ASN1_INTEGER_new();
if (asn1int == NULL || !ASN1_INTEGER_set(asn1int, 12345)) ...
ASN1_TYPE *val = ASN1_TYPE_new();
if (val == NULL) ...
ASN1_TYPE_set(val, V_ASN1_INTEGER, asn1int);
OSSL_CMP_ITAV *itav = OSSL_CMP_ITAV_create(type, val);
if (itav == NULL) ...
OSSL_CMP_CTX *ctx = OSSL_CMP_CTX_new();
if (ctx == NULL || !OSSL_CMP_CTX_geninfo_push0_ITAV(ctx, itav)) {
OSSL_CMP_ITAV_free(itav); /* also frees type and val */
goto err;
}
...
OSSL_CMP_CTX_free(ctx); /* also frees itav */
=head1 SEE ALSO
L<OSSL_CMP_CTX_new(3)>, L<OSSL_CMP_CTX_free(3)>, L<ASN1_TYPE_set(3)>
=head1 COPYRIGHT
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
+1 -1
View File
@@ -56,7 +56,7 @@ B<RFC 4211>
=head1 COPYRIGHT
Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
@@ -96,7 +96,7 @@ RFC 4211
=head1 COPYRIGHT
Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
@@ -39,7 +39,7 @@ RFC 4211
=head1 COPYRIGHT
Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+1 -1
View File
@@ -95,7 +95,7 @@ RFC 4211
=head1 COPYRIGHT
Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -22,7 +22,7 @@ OSSL_CRMF_pbmp_new
OSSL_CRMF_pbm_new() generates a PBM (Password-Based MAC) based on given PBM
parameters B<pbmp>, message B<msg>, and secret B<sec>, along with the respective
lengths B<msglen> and B<seclen>. On success writes the adddress of the newly
lengths B<msglen> and B<seclen>. On success writes the address of the newly
allocated MAC via the B<mac> reference parameter and writes the length via the
B<maclen> reference parameter unless it its NULL.
@@ -68,7 +68,7 @@ RFC 4211 section 4.4
=head1 COPYRIGHT
Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+18 -17
View File
@@ -14,7 +14,7 @@ OSSL_PARAM - a structure to pass or request object parameters
unsigned char data_type; /* declare what kind of content is in data */
void *data; /* value being passed in or out */
size_t data_size; /* data size */
size_t *return_size; /* OPTIONAL: address to content size */
size_t return_size; /* returned size */
};
=head1 DESCRIPTION
@@ -143,7 +143,7 @@ C<data_size> must be set to the size of the data, not the size of the
pointer to the data.
If this is used in a parameter request,
C<data_size> is not relevant. However, the I<responder> will set
C<*return_size> to the size of the data.
C<return_size> to the size of the data.
Note that the use of this type is B<fragile> and can only be safely
used for data that remains constant and in a constant location for a
@@ -166,7 +166,7 @@ C<data_size> must be set to the size of the data, not the size of the
pointer to the data.
If this is used in a parameter request,
C<data_size> is not relevant. However, the I<responder> will set
C<*return_size> to the size of the data.
C<return_size> to the size of the data.
Note that the use of this type is B<fragile> and can only be safely
used for data that remains constant and in a constant location for a
@@ -196,9 +196,10 @@ enough set of data, that call should succeed.
=item *
A I<responder> must never change the fields of an C<OSSL_PARAM>, it
may only change the contents of the memory that C<data> and
C<return_size> point at.
Apart from the C<return_size>, a I<responder> must never change the fields
of an C<OSSL_PARAM>.
To return a value, it should change the contents of the memory that
C<data> points at.
=item *
@@ -214,7 +215,7 @@ C<OSSL_PARAM_OCTET_STRING>), but this is in no way mandatory.
=item *
If a I<responder> finds that some data sizes are too small for the
requested data, it must set C<*return_size> for each such
requested data, it must set C<return_size> for each such
C<OSSL_PARAM> item to the required size, and eventually return an
error.
@@ -244,9 +245,9 @@ This example is for setting parameters on some object:
const char *foo = "some string";
size_t foo_l = strlen(foo) + 1;
const char bar[] = "some other string";
const OSSL_PARAM set[] = {
{ "foo", OSSL_PARAM_UTF8_STRING_PTR, &foo, foo_l, NULL },
{ "bar", OSSL_PARAM_UTF8_STRING, &bar, sizeof(bar), NULL },
OSSL_PARAM set[] = {
{ "foo", OSSL_PARAM_UTF8_STRING_PTR, &foo, foo_l, 0 },
{ "bar", OSSL_PARAM_UTF8_STRING, &bar, sizeof(bar), 0 },
{ NULL, 0, NULL, 0, NULL }
};
@@ -258,26 +259,26 @@ This example is for requesting parameters on some object:
size_t foo_l;
char bar[1024];
size_t bar_l;
const OSSL_PARAM request[] = {
{ "foo", OSSL_PARAM_UTF8_STRING_PTR, &foo, 0 /*irrelevant*/, &foo_l },
{ "bar", OSSL_PARAM_UTF8_STRING, &bar, sizeof(bar), &bar_l },
OSSL_PARAM request[] = {
{ "foo", OSSL_PARAM_UTF8_STRING_PTR, &foo, 0 /*irrelevant*/, 0 },
{ "bar", OSSL_PARAM_UTF8_STRING, &bar, sizeof(bar), 0 },
{ NULL, 0, NULL, 0, NULL }
};
A I<responder> that receives this array (as C<params> in this example)
could fill in the parameters like this:
/* const OSSL_PARAM *params */
/* OSSL_PARAM *params */
int i;
for (i = 0; params[i].key != NULL; i++) {
if (strcmp(params[i].key, "foo") == 0) {
*(char **)params[i].data = "foo value";
*params[i].return_size = 10; /* size of "foo value" */
params[i].return_size = 10; /* size of "foo value" */
} else if (strcmp(params[i].key, "bar") == 0) {
memcpy(params[1].data, "bar value", 10);
*params[1].return_size = 10; /* size of "bar value" */
memcpy(params[i].data, "bar value", 10);
params[i].return_size = 10; /* size of "bar value" */
}
/* Ignore stuff we don't know */
}
@@ -2,18 +2,27 @@
=head1 NAME
OSSL_PARAM_TYPE, OSSL_PARAM_utf8_string, OSSL_PARAM_octet_string,
OSSL_PARAM_utf8_ptr, OSSL_PARAM_octet_ptr, OSSL_PARAM_SIZED_TYPE,
OSSL_PARAM_SIZED_BN, OSSL_PARAM_SIZED_utf8_string,
OSSL_PARAM_SIZED_octet_string, OSSL_PARAM_SIZED_utf8_ptr,
OSSL_PARAM_SIZED_octet_ptr, OSSL_PARAM_END, OSSL_PARAM_construct_TYPE,
OSSL_PARAM_END,
OSSL_PARAM_construct_BN, OSSL_PARAM_construct_utf8_string,
OSSL_PARAM_construct_utf8_ptr, OSSL_PARAM_construct_octet_string,
OSSL_PARAM_construct_octet_ptr, OSSL_PARAM_construct_end,
OSSL_PARAM_locate, OSSL_PARAM_get_TYPE,
OSSL_PARAM_set_TYPE, OSSL_PARAM_get_BN, OSSL_PARAM_set_BN,
OSSL_PARAM_get_utf8_string, OSSL_PARAM_set_utf8_string,
OSSL_PARAM_double, OSSL_PARAM_int, OSSL_PARAM_int32, OSSL_PARAM_int64,
OSSL_PARAM_long, OSSL_PARAM_size_t, OSSL_PARAM_uint, OSSL_PARAM_uint32,
OSSL_PARAM_uint64, OSSL_PARAM_ulong, OSSL_PARAM_BN, OSSL_PARAM_utf8_string,
OSSL_PARAM_octet_string, OSSL_PARAM_utf8_ptr, OSSL_PARAM_octet_ptr,
OSSL_PARAM_END, OSSL_PARAM_construct_BN, OSSL_PARAM_construct_double,
OSSL_PARAM_construct_int, OSSL_PARAM_construct_int32,
OSSL_PARAM_construct_int64, OSSL_PARAM_construct_long,
OSSL_PARAM_construct_size_t, OSSL_PARAM_construct_uint,
OSSL_PARAM_construct_uint32, OSSL_PARAM_construct_uint64,
OSSL_PARAM_construct_ulong, OSSL_PARAM_END, OSSL_PARAM_construct_BN,
OSSL_PARAM_construct_utf8_string, OSSL_PARAM_construct_utf8_ptr,
OSSL_PARAM_construct_octet_string, OSSL_PARAM_construct_octet_ptr,
OSSL_PARAM_construct_end, OSSL_PARAM_locate, OSSL_PARAM_locate_const,
OSSL_PARAM_get_double, OSSL_PARAM_get_int, OSSL_PARAM_get_int32,
OSSL_PARAM_get_int64, OSSL_PARAM_get_long, OSSL_PARAM_get_size_t,
OSSL_PARAM_get_uint, OSSL_PARAM_get_uint32, OSSL_PARAM_get_uint64,
OSSL_PARAM_get_ulong, OSSL_PARAM_set_double, OSSL_PARAM_set_int,
OSSL_PARAM_set_int32, OSSL_PARAM_set_int64, OSSL_PARAM_set_long,
OSSL_PARAM_set_size_t, OSSL_PARAM_set_uint, OSSL_PARAM_set_uint32,
OSSL_PARAM_set_uint64, OSSL_PARAM_set_ulong, OSSL_PARAM_get_BN,
OSSL_PARAM_set_BN, OSSL_PARAM_get_utf8_string, OSSL_PARAM_set_utf8_string,
OSSL_PARAM_get_octet_string, OSSL_PARAM_set_octet_string,
OSSL_PARAM_get_utf8_ptr, OSSL_PARAM_set_utf8_ptr, OSSL_PARAM_get_octet_ptr,
OSSL_PARAM_set_octet_ptr
@@ -21,6 +30,8 @@ OSSL_PARAM_set_octet_ptr
=head1 SYNOPSIS
=for comment generic
#include <openssl/params.h>
#define OSSL_PARAM_TYPE(key, address)
@@ -28,50 +39,46 @@ OSSL_PARAM_set_octet_ptr
#define OSSL_PARAM_octet_string(key, address, size)
#define OSSL_PARAM_utf8_ptr(key, address, size)
#define OSSL_PARAM_octet_ptr(key, address, size)
#define OSSL_PARAM_SIZED_TYPE(key, address, return_size)
#define OSSL_PARAM_SIZED_BN(key, address, size, return_size)
#define OSSL_PARAM_SIZED_utf8_string(key, address, size, return_size)
#define OSSL_PARAM_SIZED_octet_string(key, address, size, return_size)
#define OSSL_PARAM_SIZED_utf8_ptr(key, address, size, return_size)
#define OSSL_PARAM_SIZED_octet_ptr(key, address, size, return_size)
#define OSSL_PARAM_BN(key, address, size)
#define OSSL_PARAM_END
OSSL_PARAM OSSL_PARAM_construct_TYPE(const char *key, TYPE *buf, size_t *ret);
OSSL_PARAM OSSL_PARAM_construct_BN(const char *key, unsigned char *buf,
size_t bsize, size_t *rsize);
size_t bsize);
OSSL_PARAM OSSL_PARAM_construct_utf8_string(const char *key, char *buf,
size_t bsize, size_t *rsize);
size_t bsize);
OSSL_PARAM OSSL_PARAM_construct_octet_string(const char *key, void *buf,
size_t bsize, size_t *rsize);
size_t bsize);
OSSL_PARAM OSSL_PARAM_construct_utf8_ptr(const char *key, char **buf,
size_t bsize, size_t *rsize);
size_t bsize);
OSSL_PARAM OSSL_PARAM_construct_octet_ptr(const char *key, void **buf,
size_t bsize, size_t *rsize);
size_t bsize);
OSSL_PARAM OSSL_PARAM_construct_end(void);
OSSL_PARAM *OSSL_PARAM_locate(OSSL_PARAM *array, const char *key);
const OSSL_PARAM *OSSL_PARAM_locate_const(const OSSL_PARAM *array,
const char *key);
int OSSL_PARAM_get_TYPE(const OSSL_PARAM *p, const char *key, TYPE *val);
int OSSL_PARAM_set_TYPE(const OSSL_PARAM *p, const char *key, TYPE val);
int OSSL_PARAM_set_TYPE(OSSL_PARAM *p, const char *key, TYPE val);
int OSSL_PARAM_get_BN(const OSSL_PARAM *p, const char *key, BIGNUM **val);
int OSSL_PARAM_set_BN(const OSSL_PARAM *p, const char *key, const BIGNUM *val);
int OSSL_PARAM_set_BN(OSSL_PARAM *p, const char *key, const BIGNUM *val);
int OSSL_PARAM_get_utf8_string(const OSSL_PARAM *p, char **val,
size_t max_len);
int OSSL_PARAM_set_utf8_string(const OSSL_PARAM *p, const char *val);
int OSSL_PARAM_set_utf8_string(OSSL_PARAM *p, const char *val);
int OSSL_PARAM_get_octet_string(const OSSL_PARAM *p, void **val,
size_t max_len, size_t *used_len);
int OSSL_PARAM_set_octet_string(const OSSL_PARAM *p, const void *val,
size_t len);
int OSSL_PARAM_set_octet_string(OSSL_PARAM *p, const void *val, size_t len);
int OSSL_PARAM_get_utf8_ptr(const OSSL_PARAM *p, char **val);
int OSSL_PARAM_set_utf8_ptr(const OSSL_PARAM *p, char *val);
int OSSL_PARAM_set_utf8_ptr(OSSL_PARAM *p, char *val);
int OSSL_PARAM_get_octet_ptr(const OSSL_PARAM *p, void **val,
size_t *used_len);
int OSSL_PARAM_set_octet_ptr(const OSSL_PARAM *p, void *val, size_t used_len);
int OSSL_PARAM_set_octet_ptr(OSSL_PARAM *p, void *val, size_t used_len);
=head1 DESCRIPTION
@@ -128,26 +135,11 @@ Each of these macros defines a parameter of the specified B<TYPE> with the
provided B<key> and parameter variable B<address>.
OSSL_PARAM_utf8_string(), OSSL_PARAM_octet_string(), OSSL_PARAM_utf8_ptr(),
OSSL_PARAM_octet_ptr() are macros that provide support for defining UTF8
strings and OCTET strings.
OSSL_PARAM_octet_ptr(), OSSL_PARAM_BN() are macros that provide support
for defining UTF8 strings, OCTET strings and big numbers.
A parameter with name B<key> is defined.
The storage for this parameter is at B<address> and is of B<size> bytes.
OSSL_PARAM_SIZED_TYPE() are a second series of macros designed to assist with
the initialisation of OSSL_PARAM structures.
They are similar to the OSSL_PARAM_TYPE() macros but also include a
B<return_size> argument which contains the address of a size_t variable which
will be populated with the actual size of the parameter upon return from a
OSSL_PARAM_set_TYPE() call.
OSSL_PARAM_SIZED_BN(), OSSL_PARAM_SIZED_utf8_string(),
OSSL_PARAM_SIZED_octet_string(), OSSL_PARAM_SIZED_utf8_ptr(),
OSSL_PARAM_SIZED_octet_ptr() are macros that provide support for defining large
integers, UTF8 string and OCTET strings in an OSSL_PARAM array.
A parameter with name B<key> is defined.
The storage for this parameter is at B<address> and is of B<size> bytes.
The size used by the parameter value, in bytes, is written to B<return_size>.
OSSL_PARAM_END provides an end of parameter list marker.
This should terminate all OSSL_PARAM arrays.
@@ -187,11 +179,14 @@ OSSL_PARAM structure.
OSSL_PARAM_locate() is a function that searches an B<array> of parameters for
the one matching the B<key> name.
OSSL_PARAM_locate_const() behaves exactly like OSSL_PARAM_locate() except for
the presence of I<const> for the B<array> argument and its return value.
OSSL_PARAM_get_TYPE() retrieves a value of type B<TYPE> from the parameter B<p>.
The value is copied to the address B<val>.
Type coercion takes place as discussed in the NOTES section.
OSSL_PARAM_set_TYPE() stores a value B<val> of type B<TYPE> into the paramter
OSSL_PARAM_set_TYPE() stores a value B<val> of type B<TYPE> into the parameter
B<p>.
Type coercion takes place as discussed in the NOTES section.
@@ -199,7 +194,7 @@ OSSL_PARAM_get_BN() retrieves a BIGNUM from the parameter pointed to by B<p>.
The BIGNUM referenced by B<val> is updated and is allocated if B<*val> is
B<NULL>.
OSSL_PARAM_set_BN() stores the BIGNUM B<val> into the paramater B<p>.
OSSL_PARAM_set_BN() stores the BIGNUM B<val> into the parameter B<p>.
OSSL_PARAM_get_utf8_string() retrieves a UTF8 string from the parameter
pointed to by B<p>.
@@ -242,9 +237,9 @@ OSSL_PARAM_construct_utf8_string(), OSSL_PARAM_construct_octet_string(),
OSSL_PARAM_construct_utf8_ptr() and OSSL_PARAM_construct_octet_ptr()
return a populated OSSL_PARAM structure.
OSSL_PARAM_locate() returns a pointer to the matching OSSL_PARAM object.
It returns B<NULL> on error or when no object matching B<key> exists in
the B<array>.
OSSL_PARAM_locate() and OSSL_PARAM_locate_const() return a pointer to
the matching OSSL_PARAM object. They return B<NULL> on error or when
no object matching B<key> exists in the B<array>.
All other functions return B<1> on success and B<0> on failure.
@@ -290,21 +285,19 @@ demonstrates that the requestor isn't obligated to request all
available parameters:
const char *foo = NULL;
size_t foo_l;
char bar[1024];
size_t bar_l;
const OSSL_PARAM request[] = {
OSSL_PARAM_UTF8_PTR("foo", foo, 0, foo_l),
OSSL_PARAM_UTF8_STRING("bar", bar, sizeof(bar), bar_l),
OSSL_PARAM request[] = {
OSSL_PARAM_utf8_ptr("foo", foo, 0),
OSSL_PARAM_utf8_string("bar", bar, sizeof(bar)),
OSSL_PARAM_END
};
A I<responder> that receives this array (as C<params> in this example)
could fill in the parameters like this:
/* const OSSL_PARAM *params */
/* OSSL_PARAM *params */
const OSSL_PARAM *p;
OSSL_PARAM *p;
if ((p = OSSL_PARAM_locate(params, "foo")) == NULL)
OSSL_PARAM_set_utf8_ptr(p, "foo value");
+2 -2
View File
@@ -16,7 +16,7 @@ OSSL_PROVIDER_add_builtin - provider routines
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
const OSSL_ITEM *OSSL_PROVIDER_get_param_types(OSSL_PROVIDER *prov);
int OSSL_PROVIDER_get_params(OSSL_PROVIDER *prov, const OSSL_PARAM params[]);
int OSSL_PROVIDER_get_params(OSSL_PROVIDER *prov, OSSL_PARAM params[]);
int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *, const char *name,
ossl_provider_init_fn *init_fn);
@@ -81,7 +81,7 @@ its build number.
OSSL_PROVIDER *prov = NULL;
const char *build = NULL;
size_t built_l = 0;
const OSSL_PARAM request[] = {
OSSL_PARAM request[] = {
{ "build", OSSL_PARAM_UTF8_STRING_PTR, &build, 0, &build_l },
{ NULL, 0, NULL, 0, NULL }
};
+1 -1
View File
@@ -95,7 +95,7 @@ manner possible according to the scheme the loader implements, it also
takes a B<UI_METHOD> and associated data, to be used any time
something needs to be prompted for.
Furthermore, this function is expected to initialize what needs to be
initialized, to create a privata data store (B<OSSL_STORE_LOADER_CTX>, see
initialized, to create a private data store (B<OSSL_STORE_LOADER_CTX>, see
above), and to return it.
If something goes wrong, this function is expected to return NULL.
+1 -1
View File
@@ -32,7 +32,7 @@ grained search of objects.
OSSL_STORE_supports_search() checks if the loader of the given OSSL_STORE
context supports the given search type.
See L<OSSL_STORE_SEARCH/SUPPORED CRITERION TYPES> for information on the
See L<OSSL_STORE_SEARCH/SUPPORTED CRITERION TYPES> for information on the
supported search criterion types.
OSSL_STORE_expect() and OSSL_STORE_find I<must> be called before the first
+79 -18
View File
@@ -3,11 +3,17 @@
=head1 NAME
OSSL_trace_enabled, OSSL_trace_begin, OSSL_trace_end,
OSSL_TRACE_BEGIN, OSSL_TRACE_END, OSSL_TRACE1, OSSL_TRACE2, OSSL_TRACE9
OSSL_TRACE_BEGIN, OSSL_TRACE_END, OSSL_TRACE_CANCEL,
OSSL_TRACE, OSSL_TRACE1, OSSL_TRACE2, OSSL_TRACE3, OSSL_TRACE4,
OSSL_TRACE5, OSSL_TRACE6, OSSL_TRACE7, OSSL_TRACE8, OSSL_TRACE9,
OSSL_TRACEV,
OSSL_TRACE_ENABLED
- OpenSSL Tracing API
=head1 SYNOPSIS
=for comment generic
#include <openssl/trace.h>
int OSSL_trace_enabled(int category);
@@ -17,7 +23,13 @@ OSSL_TRACE_BEGIN, OSSL_TRACE_END, OSSL_TRACE1, OSSL_TRACE2, OSSL_TRACE9
/* trace group macros */
OSSL_TRACE_BEGIN(category) {
...
...
if (some_error) {
/* Leave trace group prematurely in case of an error */
OSSL_TRACE_CANCEL(category);
goto err;
}
...
} OSSL_TRACE_END(category);
/* one-shot trace macros */
@@ -26,6 +38,10 @@ OSSL_TRACE_BEGIN, OSSL_TRACE_END, OSSL_TRACE1, OSSL_TRACE2, OSSL_TRACE9
...
OSSL_TRACE9(category, format, arg1, ..., arg9)
/* check whether a trace category is enabled */
if (OSSL_TRACE_ENABLED(category)) {
...
}
=head1 DESCRIPTION
@@ -113,7 +129,7 @@ jumping out of a trace section:
OSSL_TRACE_BEGIN(TLS) {
if (condition) {
if (some_error) {
OSSL_TRACE_CANCEL(TLS);
goto err;
}
@@ -126,7 +142,7 @@ This will normally expand to:
do {
BIO *trc_out = OSSL_trace_begin(OSSL_TRACE_CATEGORY_TLS);
if (trc_out != NULL) {
if (condition) {
if (some_error) {
OSSL_trace_end(OSSL_TRACE_CATEGORY_TLS, trc_out);
goto err;
}
@@ -136,26 +152,71 @@ This will normally expand to:
} while (0);
C<OSSL_TRACE1()>, ... C<OSSL_TRACE9()> are one-shot macros which essentially wrap
a single BIO_printf() into a tracing group.
C<OSSL_TRACE()> and C<OSSL_TRACE1()>, C<OSSL_TRACE2()>, ... C<OSSL_TRACE9()> are
so-called one-shot macros:
The call OSSL_TRACEn(category, format, arg1, ..., argN) expands to:
The macro call C<OSSL_TRACE(category, text)>, produces literal text trace output.
OSSL_TRACE_BEGIN(category) {
BIO_printf(trc_out, format, arg1, ..., argN)
} OSSL_TRACE_END(category)
The macro call C<OSSL_TRACEn(category, format, arg1, ..., argn)> produces
printf-style trace output with n format field arguments (n=1,...,9).
It expands to:
OSSL_TRACE_BEGIN(category) {
BIO_printf(trc_out, format, arg1, ..., argN)
} OSSL_TRACE_END(category)
Internally, all one-shot macros are implemented using a generic C<OSSL_TRACEV()>
macro, since C90 does not support variadic macros. This helper macro has a rather
weird synopsis and should not be used directly.
The C<OSSL_TRACE_ENABLED(category)> macro can be used to conditionally execute
some code only if a specific trace category is enabled.
In some situations this is simpler than entering a trace section using
C<OSSL_TRACE_BEGIN(category)> and C<OSSL_TRACE_END(category)>.
For example, the code
if (OSSL_TRACE_ENABLED(TLS)) {
...
}
expands to
if (OSSL_trace_enabled(OSSL_TRACE_CATEGORY_TLS) {
...
}
=head1 NOTES
It is advisable to always check that a trace type is enabled with
OSSL_trace_enabled() before generating any output, for example:
If producing the trace output requires carrying out auxiliary calculations,
this auxiliary code should be placed inside a conditional block which is
executed only if the trace category is enabled.
if (OSSL_trace_enabled(OSSL_TRACE_CATEGORY_TLS)) {
BIO *trace = OSSL_trace_begin(OSSL_TRACE_CATEGORY_TLS);
BIO_printf(trace, "FOO %d\n", somevalue);
BIO_dump(trace, somememory, somememory_l);
OSSL_trace_end(OSSL_TRACE_CATEGORY_TLS, trace);
}
The most natural way to do this is to place the code inside the trace section
itself because it already introduces such a conditional block.
OSSL_TRACE_BEGIN(TLS) {
int var = do_some_auxiliary_calculation();
BIO_printf(trc_out, "var = %d\n", var);
} OSSL_TRACE_END(TLS);
In some cases it is more advantageous to use a simple conditional group instead
of a trace section. This is the case if calculations and tracing happen in
different locations of the code, or if the calculations are so time consuming
that placing them inside a (critical) trace section would create too much
contention.
if (OSSL_TRACE_ENABLED(TLS)) {
int var = do_some_auxiliary_calculation();
OSSL_TRACE1("var = %d\n", var);
}
Note however that premature optimization of tracing code is in general futile
and it's better to keep the tracing code as simple as possible.
Because most often the limiting factor for the application's speed is the time
it takes to print the trace output, not to calculate it.
=head2 Configure Tracing
+26 -8
View File
@@ -2,6 +2,9 @@
=head1 NAME
OPENSSL_CTX_get0_master_drbg,
OPENSSL_CTX_get0_public_drbg,
OPENSSL_CTX_get0_private_drbg,
RAND_DRBG_get0_master,
RAND_DRBG_get0_public,
RAND_DRBG_get0_private
@@ -11,6 +14,9 @@ RAND_DRBG_get0_private
#include <openssl/rand_drbg.h>
RAND_DRBG *OPENSSL_CTX_get0_master_drbg(OPENSSL_CTX *ctx);
RAND_DRBG *OPENSSL_CTX_get0_public_drbg(OPENSSL_CTX *ctx);
RAND_DRBG *OPENSSL_CTX_get0_private_drbg(OPENSSL_CTX *ctx);
RAND_DRBG *RAND_DRBG_get0_master(void);
RAND_DRBG *RAND_DRBG_get0_public(void);
RAND_DRBG *RAND_DRBG_get0_private(void);
@@ -21,26 +27,35 @@ RAND_DRBG_get0_private
The default RAND API implementation (RAND_OpenSSL()) utilizes three
shared DRBG instances which are accessed via the RAND API:
The <public> and <private> DRBG are thread-local instances, which are used
The I<public> and I<private> DRBG are thread-local instances, which are used
by RAND_bytes() and RAND_priv_bytes(), respectively.
The <master> DRBG is a global instance, which is not intended to be used
The I<master> DRBG is a global instance, which is not intended to be used
directly, but is used internally to reseed the other two instances.
These functions here provide access to the shared DRBG instances.
=head1 RETURN VALUES
RAND_DRBG_get0_master() returns a pointer to the <master> DRBG instance.
OPENSSL_CTX_get0_master_drbg() returns a pointer to the I<master> DRBG instance
for the given OPENSSL_CTX B<ctx>.
RAND_DRBG_get0_public() returns a pointer to the <public> DRBG instance.
OPENSSL_CTX_get0_public_drbg() returns a pointer to the I<public> DRBG instance
for the given OPENSSL_CTX B<ctx>.
RAND_DRBG_get0_private() returns a pointer to the <private> DRBG instance.
OPENSSL_CTX_get0_private_drbg() returns a pointer to the I<private> DRBG instance
for the given OPENSSL_CTX B<ctx>.
In all the above cases the B<ctx> parameter can
be NULL in which case the default OPENSSL_CTX is used. RAND_DRBG_get0_master(),
RAND_DRBG_get0_public() and RAND_DRBG_get0_private() are the same as
OPENSSL_CTX_get0_master_drbg(), OPENSSL_CTX_get0_public_drbg() and
OPENSSL_CTX_get0_private_drbg() respectively except that the default OPENSSL_CTX
is always used.
=head1 NOTES
It is not thread-safe to access the <master> DRBG instance.
The <public> and <private> DRBG instance can be accessed safely, because
It is not thread-safe to access the I<master> DRBG instance.
The I<public> and I<private> DRBG instance can be accessed safely, because
they are thread-local. Note however, that changes to these two instances
apply only to the current thread.
@@ -65,7 +80,10 @@ L<RAND_DRBG(7)>
=head1 HISTORY
The RAND_DRBG functions were added in OpenSSL 1.1.1.
The OPENSSL_CTX_get0_master_drbg(), OPENSSL_CTX_get0_public_drbg() and
OPENSSL_CTX_get0_private_drbg() functions were added in OpenSSL 3.0.
All other RAND_DRBG functions were added in OpenSSL 1.1.1.
=head1 COPYRIGHT
+20 -5
View File
@@ -2,7 +2,9 @@
=head1 NAME
RAND_DRBG_new_ex,
RAND_DRBG_new,
RAND_DRBG_secure_new_ex,
RAND_DRBG_secure_new,
RAND_DRBG_set,
RAND_DRBG_set_defaults,
@@ -15,11 +17,20 @@ RAND_DRBG_free
#include <openssl/rand_drbg.h>
RAND_DRBG *RAND_DRBG_new_ex(OPENSSL_CTX *ctx,
int type,
unsigned int flags,
RAND_DRBG *parent);
RAND_DRBG *RAND_DRBG_new(int type,
unsigned int flags,
RAND_DRBG *parent);
RAND_DRBG *RAND_DRBG_secure_new_ex(OPENSSL_CTX *ctx,
int type,
unsigned int flags,
RAND_DRBG *parent);
RAND_DRBG *RAND_DRBG_secure_new(int type,
unsigned int flags,
RAND_DRBG *parent);
@@ -39,10 +50,13 @@ RAND_DRBG_free
=head1 DESCRIPTION
RAND_DRBG_new() and RAND_DRBG_secure_new()
RAND_DRBG_new_ex() and RAND_DRBG_secure_new_ex()
create a new DRBG instance of the given B<type>, allocated from the heap resp.
the secure heap
(using OPENSSL_zalloc() resp. OPENSSL_secure_zalloc()).
the secure heap, for the given OPENSSL_CTX <ctx>
(using OPENSSL_zalloc() resp. OPENSSL_secure_zalloc()). The <ctx> parameter can
be NULL in which case the default OPENSSL_CTX is used. RAND_DRBG_new() and
RAND_DRBG_secure_new() are the same as RAND_DRBG_new_ex() and
RAND_DRBG_secure_new_ex() except that the default OPENSSL_CTX is always used.
RAND_DRBG_set() initializes the B<drbg> with the given B<type> and B<flags>.
@@ -108,8 +122,9 @@ uninstantiated state.
=head1 RETURN VALUES
RAND_DRBG_new() and RAND_DRBG_secure_new() return a pointer to a DRBG
instance allocated on the heap, resp. secure heap.
RAND_DRBG_new_ex(), RAND_DRBG_new(), RAND_DRBG_secure_new_ex() and
RAND_DRBG_secure_new() return a pointer to a DRBG instance allocated on the
heap, resp. secure heap.
RAND_DRBG_set(),
RAND_DRBG_instantiate(), and
+1 -1
View File
@@ -111,7 +111,7 @@ and is being used.
The derivation function is disabled during initialization by calling the
RAND_DRBG_set() function with the RAND_DRBG_FLAG_CTR_NO_DF flag.
For more information on the derivation function and when it can be omitted,
see [NIST SP 800-90A Rev. 1]. Roughly speeking it can be omitted if the random
see [NIST SP 800-90A Rev. 1]. Roughly speaking it can be omitted if the random
source has "full entropy", i.e., contains 8 bits of entropy per byte.
Even if a nonce is required, the B<get_nonce>() and B<cleanup_nonce>()
+1 -2
View File
@@ -20,8 +20,7 @@ must be used to protect the RSA operation from that attack.
RSA_blinding_on() turns blinding on for key B<rsa> and generates a
random blinding factor. B<ctx> is B<NULL> or a pre-allocated and
initialized B<BN_CTX>. The random number generator must be seeded
prior to calling RSA_blinding_on().
initialized B<BN_CTX>.
RSA_blinding_off() turns blinding off and frees the memory used for
the blinding factor.
+8 -5
View File
@@ -16,7 +16,7 @@ Deprecated since OpenSSL 0.9.8, can be hidden entirely by defining
B<OPENSSL_API_COMPAT> with a suitable version value, see
L<openssl_user_macros(7)>:
RSA *RSA_generate_key(int num, unsigned long e,
RSA *RSA_generate_key(int bits, unsigned long e,
void (*callback)(int, int, void *), void *cb_arg);
=head1 DESCRIPTION
@@ -27,8 +27,10 @@ be seeded prior to calling RSA_generate_key_ex().
RSA_generate_multi_prime_key() generates a multi-prime RSA key pair and stores
it in the B<RSA> structure provided in B<rsa>. The number of primes is given by
the B<primes> parameter. The pseudo-random number generator must be seeded prior
to calling RSA_generate_multi_prime_key().
the B<primes> parameter. The random number generator must be seeded when
calling RSA_generate_multi_prime_key().
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
The modulus size will be of length B<bits>, the number of primes to form the
modulus will be B<primes>, and the public exponent will be B<e>. Key sizes
@@ -47,7 +49,7 @@ progress of the key generation. If B<cb> is not B<NULL>, it
will be called as follows using the BN_GENCB_call() function
described on the L<BN_generate_prime(3)> page.
RSA_generate_prime() is similar to RSA_generate_prime_ex() but
RSA_generate_key() is similar to RSA_generate_key_ex() but
expects an old-style callback function; see
L<BN_generate_prime(3)> for information on the old-style callback.
@@ -88,7 +90,8 @@ B<BN_GENCB_call(cb, 2, x)> is used with two different meanings.
=head1 SEE ALSO
L<ERR_get_error(3)>, L<RAND_bytes(3)>, L<BN_generate_prime(3)>
L<ERR_get_error(3)>, L<RAND_bytes(3)>, L<BN_generate_prime(3)>,
L<RAND(7)>
=head1 HISTORY
+4 -1
View File
@@ -100,6 +100,8 @@ simply copy the data
The random number generator must be seeded prior to calling
RSA_padding_add_xxx().
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
RSA_padding_check_xxx() verifies that the B<fl> bytes at B<f> contain
a valid encoding for a B<rsa_len> byte RSA key in the respective
@@ -143,7 +145,8 @@ including PKCS1_OAEP.
L<RSA_public_encrypt(3)>,
L<RSA_private_decrypt(3)>,
L<RSA_sign(3)>, L<RSA_verify(3)>
L<RSA_sign(3)>, L<RSA_verify(3)>,
L<RAND(7)>
=head1 COPYRIGHT
+6 -2
View File
@@ -26,7 +26,10 @@ memory.
B<dummy> is ignored.
The random number generator must be seeded prior to calling RSA_sign_ASN1_OCTET_STRING().
The random number generator must be seeded when calling
RSA_sign_ASN1_OCTET_STRING().
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
RSA_verify_ASN1_OCTET_STRING() verifies that the signature B<sigbuf>
of size B<siglen> is the DER representation of a given octet string
@@ -49,7 +52,8 @@ These functions serve no recognizable purpose.
L<ERR_get_error(3)>,
L<RAND_bytes(3)>, L<RSA_sign(3)>,
L<RSA_verify(3)>
L<RSA_verify(3)>,
L<RAND(7)>
=head1 COPYRIGHT
+14 -6
View File
@@ -79,9 +79,13 @@ B<ClientHello>.
The B<value> argument is a colon separated list of groups. The group can be
either the B<NIST> name (e.g. B<P-256>), some other commonly used name where
applicable (e.g. B<X25519>) or an OpenSSL OID name (e.g B<prime256v1>). Group
names are case sensitive. The list should be in order of preference with the
most preferred group first.
applicable (e.g. B<X25519>, B<ffdhe2048>) or an OpenSSL OID name
(e.g B<prime256v1>). Group names are case sensitive. The list should be in
order of preference with the most preferred group first.
Currently supported groups for B<TLSv1.3> are B<P-256>, B<P-384>, B<P-521>,
B<X25519>, B<X448>, B<ffdhe2048>, B<ffdhe3072>, B<ffdhe4096>, B<ffdhe6144>,
B<ffdhe8192>.
=item B<-curves>
@@ -356,9 +360,13 @@ B<ClientHello>.
The B<value> argument is a colon separated list of groups. The group can be
either the B<NIST> name (e.g. B<P-256>), some other commonly used name where
applicable (e.g. B<X25519>) or an OpenSSL OID name (e.g B<prime256v1>). Group
names are case sensitive. The list should be in order of preference with the
most preferred group first.
applicable (e.g. B<X25519>, B<ffdhe2048>) or an OpenSSL OID name
(e.g B<prime256v1>). Group names are case sensitive. The list should be in
order of preference with the most preferred group first.
Currently supported groups for B<TLSv1.3> are B<P-256>, B<P-384>, B<P-521>,
B<X25519>, B<X448>, B<ffdhe2048>, B<ffdhe3072>, B<ffdhe4096>, B<ffdhe6144>,
B<ffdhe8192>.
=item B<Curves>
+12 -7
View File
@@ -94,28 +94,31 @@ The actual protocol version used will be negotiated to the highest version
mutually supported by the client and the server.
The supported protocols are SSLv3, TLSv1, TLSv1.1, TLSv1.2 and TLSv1.3.
Applications should use these methods, and avoid the version-specific
methods described below.
methods described below, which are deprecated.
=item SSLv23_method(), SSLv23_server_method(), SSLv23_client_method()
Use of these functions is deprecated. They have been replaced with the above
TLS_method(), TLS_server_method() and TLS_client_method() respectively. New
code should use those functions instead.
These functions do not exist anymore, they have been renamed to
TLS_method(), TLS_server_method() and TLS_client_method() respectively.
Currently, the old function calls are renamed to the corresponding new
ones by preprocessor macros, to ensure that existing code which uses the
old function names still compiles. However, using the old function names
is deprecated and new code should call the new functions instead.
=item TLSv1_2_method(), TLSv1_2_server_method(), TLSv1_2_client_method()
A TLS/SSL connection established with these methods will only understand the
TLSv1.2 protocol.
TLSv1.2 protocol. These methods are deprecated.
=item TLSv1_1_method(), TLSv1_1_server_method(), TLSv1_1_client_method()
A TLS/SSL connection established with these methods will only understand the
TLSv1.1 protocol.
TLSv1.1 protocol. These methods are deprecated.
=item TLSv1_method(), TLSv1_server_method(), TLSv1_client_method()
A TLS/SSL connection established with these methods will only understand the
TLSv1 protocol.
TLSv1 protocol. These methods are deprecated.
=item SSLv3_method(), SSLv3_server_method(), SSLv3_client_method()
@@ -131,10 +134,12 @@ Currently supported protocols are DTLS 1.0 and DTLS 1.2.
=item DTLSv1_2_method(), DTLSv1_2_server_method(), DTLSv1_2_client_method()
These are the version-specific methods for DTLSv1.2.
These methods are deprecated.
=item DTLSv1_method(), DTLSv1_server_method(), DTLSv1_client_method()
These are the version-specific methods for DTLSv1.
These methods are deprecated.
=back
+7 -2
View File
@@ -39,11 +39,16 @@ SSL_CTX_set1_groups() sets the supported groups for B<ctx> to B<glistlen>
groups in the array B<glist>. The array consist of all NIDs of groups in
preference order. For a TLS client the groups are used directly in the
supported groups extension. For a TLS server the groups are used to
determine the set of shared groups.
determine the set of shared groups. Currently supported groups for
B<TLSv1.3> are B<NID_X9_62_prime256v1>, B<NID_secp384r1>, B<NID_secp521r1>,
B<NID_X25519>, B<NID_X448>, B<NID_ffdhe2048>, B<NID_ffdhe3072>,
B<NID_ffdhe4096>, B<NID_ffdhe6144> and B<NID_ffdhe8192>.
SSL_CTX_set1_groups_list() sets the supported groups for B<ctx> to
string B<list>. The string is a colon separated list of group NIDs or
names, for example "P-521:P-384:P-256".
names, for example "P-521:P-384:P-256:X25519:ffdhe2048". Currently supported
groups for B<TLSv1.3> are B<P-256>, B<P-384>, B<P-521>, B<X25519>, B<X448>,
B<ffdhe2048>, B<ffdhe3072>, B<ffdhe4096>, B<ffdhe6144>, B<ffdhe8192>.
SSL_set1_groups() and SSL_set1_groups_list() are similar except they set
supported groups for the SSL structure B<ssl>.
+19 -2
View File
@@ -5,7 +5,9 @@
SSL_CTX_set_cipher_list,
SSL_set_cipher_list,
SSL_CTX_set_ciphersuites,
SSL_set_ciphersuites
SSL_set_ciphersuites,
OSSL_default_cipher_list,
OSSL_default_ciphersuites
- choose list of available SSL_CIPHERs
=head1 SYNOPSIS
@@ -18,6 +20,9 @@ SSL_set_ciphersuites
int SSL_CTX_set_ciphersuites(SSL_CTX *ctx, const char *str);
int SSL_set_ciphersuites(SSL *s, const char *str);
const char *OSSL_default_cipher_list(void);
const char *OSSL_default_ciphersuites(void);
=head1 DESCRIPTION
SSL_CTX_set_cipher_list() sets the list of available ciphers (TLSv1.2 and below)
@@ -31,7 +36,7 @@ B<ssl>.
SSL_CTX_set_ciphersuites() is used to configure the available TLSv1.3
ciphersuites for B<ctx>. This is a simple colon (":") separated list of TLSv1.3
ciphersuite names in order of perference. Valid TLSv1.3 ciphersuite names are:
ciphersuite names in order of preference. Valid TLSv1.3 ciphersuite names are:
=over 4
@@ -54,6 +59,10 @@ An empty list is permissible. The default value for the this setting is:
SSL_set_ciphersuites() is the same as SSL_CTX_set_ciphersuites() except it
configures the ciphersuites for B<ssl>.
OSSL_default_cipher_list() returns the default cipher string for TLSv1.2
(and earlier) ciphers. OSSL_default_ciphersuites() returns the default
cipher string for TLSv1.3 ciphersuites.
=head1 NOTES
The control string B<str> for SSL_CTX_set_cipher_list() and
@@ -85,6 +94,10 @@ of 512 bits and the server is not configured to use temporary RSA
keys), the "no shared cipher" (SSL_R_NO_SHARED_CIPHER) error is generated
and the handshake will fail.
OSSL_default_cipher_list() and OSSL_default_ciphersuites() replace
SSL_DEFAULT_CIPHER_LIST and TLS_DEFAULT_CIPHERSUITES, respectively. The
cipher list defines are deprecated as of 3.0.0.
=head1 RETURN VALUES
SSL_CTX_set_cipher_list() and SSL_set_cipher_list() return 1 if any cipher
@@ -100,6 +113,10 @@ L<SSL_CTX_use_certificate(3)>,
L<SSL_CTX_set_tmp_dh_callback(3)>,
L<ciphers(1)>
=head1 HISTORY
OSSL_default_cipher_list() and OSSL_default_ciphersites() are new in 3.0.0.
=head1 COPYRIGHT
Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
+2 -2
View File
@@ -10,7 +10,7 @@ SSL_has_matching_session_id, GEN_SESSION_CB
#include <openssl/ssl.h>
typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id,
typedef int (*GEN_SESSION_CB)(SSL *ssl, unsigned char *id,
unsigned int *id_len);
int SSL_CTX_set_generate_session_id(SSL_CTX *ctx, GEN_SESSION_CB cb);
@@ -98,7 +98,7 @@ server id given, and will fill the rest with pseudo random bytes:
const char session_id_prefix = "www-18";
#define MAX_SESSION_ID_ATTEMPTS 10
static int generate_session_id(const SSL *ssl, unsigned char *id,
static int generate_session_id(SSL *ssl, unsigned char *id,
unsigned int *id_len)
{
unsigned int count = 0;
+1 -1
View File
@@ -111,7 +111,7 @@ user salt, B<v> the password verifier and B<info> is the optional user info.
The SSL_set_srp_server_param_pw() function sets all SRP parameters for the
connection B<s> by generating a random salt and a password verifier.
B<user> is the username, B<pass> the password and B<grp> the SRP group paramters
B<user> is the username, B<pass> the password and B<grp> the SRP group parameters
identifier for L<SRP_get_default_gN(3)>.
The SSL_get_srp_g() function returns the SRP group generator for B<s>, or from
+5 -5
View File
@@ -102,7 +102,7 @@ B<Server mode:> if the client did not return a certificate, the TLS/SSL
handshake is immediately terminated with a "handshake failure" alert.
This flag must be used together with SSL_VERIFY_PEER.
B<Client mode:> ignored
B<Client mode:> ignored (see BUGS)
=item SSL_VERIFY_CLIENT_ONCE
@@ -112,7 +112,7 @@ renegotiation or post-authentication if a certificate was requested
during the initial handshake. This flag must be used together with
SSL_VERIFY_PEER.
B<Client mode:> ignored
B<Client mode:> ignored (see BUGS)
=item SSL_VERIFY_POST_HANDSHAKE
@@ -123,7 +123,7 @@ to be configured for post-handshake peer verification before the
handshake occurs. This flag must be used together with
SSL_VERIFY_PEER. TLSv1.3 only; no effect on pre-TLSv1.3 connections.
B<Client mode:> ignored
B<Client mode:> ignored (see BUGS)
=back
@@ -203,8 +203,8 @@ message is sent to the client.
=head1 BUGS
In client mode, it is not checked whether the SSL_VERIFY_PEER flag
is set, but whether any flags are set. This can lead to
unexpected behaviour if SSL_VERIFY_PEER and other flags are not used as
is set, but whether any flags other than SSL_VERIFY_NONE are set. This can
lead to unexpected behaviour if SSL_VERIFY_PEER and other flags are not used as
required.
=head1 RETURN VALUES
+1 -1
View File
@@ -6,7 +6,7 @@ SSL_SESSION_get0_hostname,
SSL_SESSION_set1_hostname,
SSL_SESSION_get0_alpn_selected,
SSL_SESSION_set1_alpn_selected
- get and set SNI and ALPN data ssociated with a session
- get and set SNI and ALPN data associated with a session
=head1 SYNOPSIS
+3 -3
View File
@@ -14,9 +14,9 @@ SSL_get_error - obtain result code for TLS/SSL I/O operation
SSL_get_error() returns a result code (suitable for the C "switch"
statement) for a preceding call to SSL_connect(), SSL_accept(), SSL_do_handshake(),
SSL_read_ex(), SSL_read(), SSL_peek_ex(), SSL_peek(), SSL_write_ex() or
SSL_write() on B<ssl>. The value returned by that TLS/SSL I/O function must be
passed to SSL_get_error() in parameter B<ret>.
SSL_read_ex(), SSL_read(), SSL_peek_ex(), SSL_peek(), SSL_shutdown(),
SSL_write_ex() or SSL_write() on B<ssl>. The value returned by that TLS/SSL I/O
function must be passed to SSL_get_error() in parameter B<ret>.
In addition to B<ssl> and B<ret>, SSL_get_error() inspects the
current thread's OpenSSL error queue. Thus, SSL_get_error() must be
+1 -1
View File
@@ -125,7 +125,7 @@ of bytes of the file written to the TLS/SSL connection.
=item E<lt> 0
The write operation was not successful, because either the connection was
closed, an error occured or action must be taken by the calling process.
closed, an error occurred or action must be taken by the calling process.
Call SSL_get_error() with the return value to find out the reason.
=back
+1 -1
View File
@@ -23,7 +23,7 @@ X509_STORE_up_ref() increments the reference count associated with the
X509_STORE object.
X509_STORE_lock() locks the store from modification by other threads,
X509_STORE_unlock() locks it.
X509_STORE_unlock() unlocks it.
X509_STORE_free() frees up a single X509_STORE object.
+80
View File
@@ -0,0 +1,80 @@
=pod
=head1 NAME
X509_cmp, X509_NAME_cmp,
X509_issuer_and_serial_cmp, X509_issuer_name_cmp, X509_subject_name_cmp,
X509_CRL_cmp, X509_CRL_match
- compare X509 certificates and related values
=head1 SYNOPSIS
#include <openssl/x509.h>
int X509_cmp(const X509 *a, const X509 *b);
int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
int X509_issuer_name_cmp(const X509 *a, const X509 *b);
int X509_subject_name_cmp(const X509 *a, const X509 *b);
int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
int X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
=head1 DESCRIPTION
This set of functions are used to compare X509 objects, including X509
certificates, X509 CRL objects and various values in an X509 certificate.
The X509_cmp() function compares two B<X509> objects indicated by parameters
B<a> and B<b>. The comparison is based on the B<memcmp> result of the hash
values of two B<X509> objects and the canonical (DER) encoding values.
The X509_NAME_cmp() function compares two B<X509_NAME> objects indicated by
parameters B<a> and B<b>. The comparison is based on the B<memcmp> result of
the canonical (DER) encoding values of the two objects. L<i2d_X509_NAME(3)>
has a more detailed description of the DER encoding of the B<X509_NAME> structure.
The X509_issuer_and_serial_cmp() function compares the serial number and issuer
values in the given B<X509> objects B<a> and B<b>.
The X509_issuer_name_cmp(), X509_subject_name_cmp() and X509_CRL_cmp() functions
are effectively wrappers of the X509_NAME_cmp() function. These functions compare
issuer names and subject names of the X<509> objects, or issuers of B<X509_CRL>
objects, respectively.
The X509_CRL_match() function compares two B<X509_CRL> objects. Unlike the
X509_CRL_cmp() function, this function compares the whole CRL content instead
of just the issuer name.
=head1 RETURN VALUES
Like common memory comparison functions, the B<X509> comparison functions return
an integer less than, equal to, or greater than zero if object B<a> is found to
be less than, to match, or be greater than object B<b>, respectively.
X509_NAME_cmp(), X509_issuer_and_serial_cmp(), X509_issuer_name_cmp(),
X509_subject_name_cmp() and X509_CRL_cmp() may return B<-2> to indicate an error.
=head1 NOTES
These functions in fact utilize the underlying B<memcmp> of the C library to do
the comparison job. Data to be compared varies from DER encoding data, hash
value or B<ASN1_STRING>. The sign of the comparison can be used to order the
objects but it does not have a special meaning in some cases.
X509_NAME_cmp() and wrappers utilize the value B<-2> to indicate errors in some
circumstances, which could cause confusion for the applications.
=head1 SEE ALSO
L<i2d_X509_NAME(3)>, L<i2d_X509(3)>
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
+21 -2
View File
@@ -116,20 +116,39 @@ OCSP_SIGNATURE_free,
OCSP_SIGNATURE_new,
OCSP_SINGLERESP_free,
OCSP_SINGLERESP_new,
OSSL_CMP_ITAV_free,
OSSL_CMP_MSG_dup,
OSSL_CMP_MSG_it,
OSSL_CMP_MSG_free,
OSSL_CMP_PKIHEADER_free,
OSSL_CMP_PKIHEADER_it,
OSSL_CMP_PKIHEADER_new,
OSSL_CMP_PKISI_free,
OSSL_CMP_PKISTATUS_it,
OSSL_CRMF_CERTID_free,
OSSL_CRMF_CERTID_it,
OSSL_CRMF_CERTID_new,
OSSL_CRMF_CERTTEMPLATE_free,
OSSL_CRMF_CERTTEMPLATE_it,
OSSL_CRMF_CERTTEMPLATE_new,
OSSL_CRMF_ENCRYPTEDVALUE_free,
OSSL_CRMF_ENCRYPTEDVALUE_it,
OSSL_CRMF_ENCRYPTEDVALUE_new,
OSSL_CRMF_MSGS_free,
OSSL_CRMF_MSGS_it,
OSSL_CRMF_MSGS_new,
OSSL_CRMF_MSG_free,
OSSL_CRMF_MSG_it,
OSSL_CRMF_MSG_new,
OSSL_CRMF_PBMPARAMETER_free,
OSSL_CRMF_PBMPARAMETER_it,
OSSL_CRMF_PBMPARAMETER_new,
OSSL_CRMF_PKIPUBLICATIONINFO_free,
OSSL_CRMF_PKIPUBLICATIONINFO_it,
OSSL_CRMF_PKIPUBLICATIONINFO_new,
OSSL_CRMF_MSGS_free,
OSSL_CRMF_MSGS_new,
OSSL_CRMF_SINGLEPUBINFO_free,
OSSL_CRMF_SINGLEPUBINFO_it,
OSSL_CRMF_SINGLEPUBINFO_new,
OTHERNAME_free,
OTHERNAME_new,
PBE2PARAM_free,
+10 -2
View File
@@ -2,7 +2,9 @@
=head1 NAME
X509_get0_sm2_id, X509_set0_sm2_id - get or set SM2 ID for certificate operations
X509_get0_sm2_id, X509_set0_sm2_id,
X509_REQ_get0_sm2_id, X509_REQ_set0_sm2_id
- get or set SM2 ID for certificate operations
=head1 SYNOPSIS
@@ -10,6 +12,8 @@ X509_get0_sm2_id, X509_set0_sm2_id - get or set SM2 ID for certificate operation
ASN1_OCTET_STRING *X509_get0_sm2_id(X509 *x);
void X509_set0_sm2_id(X509 *x, ASN1_OCTET_STRING *sm2_id);
ASN1_OCTET_STRING *X509_REQ_get0_sm2_id(X509_REQ *x);
void X509_REQ_set0_sm2_id(X509_REQ *x, ASN1_OCTET_STRING *sm2_id);
=head1 DESCRIPTION
@@ -21,6 +25,10 @@ this function transfers the memory management of the value to the X509 object,
and therefore the value that has been passed in should not be freed by the
caller after this function has been called.
X509_REQ_get0_sm2_id() and X509_REQ_set0_sm2_id() have the same functionality
as X509_get0_sm2_id() and X509_set0_sm2_id() except that they deal with
B<X509_REQ> objects instead of B<X509>.
=head1 NOTES
SM2 signature algorithm requires an ID value when generating and verifying a
@@ -29,7 +37,7 @@ ability to set and retrieve the SM2 ID value.
=head1 RETURN VALUES
X509_set0_sm2_id() does not return a value.
X509_set0_sm2_id() and X509_REQ_set0_sm2_id() do not return a value.
=head1 SEE ALSO
+29 -6
View File
@@ -93,6 +93,16 @@ d2i_OCSP_REVOKEDINFO,
d2i_OCSP_SERVICELOC,
d2i_OCSP_SIGNATURE,
d2i_OCSP_SINGLERESP,
d2i_OSSL_CMP_MSG,
d2i_OSSL_CMP_PKIHEADER,
d2i_OSSL_CRMF_CERTID,
d2i_OSSL_CRMF_CERTTEMPLATE,
d2i_OSSL_CRMF_ENCRYPTEDVALUE,
d2i_OSSL_CRMF_MSG,
d2i_OSSL_CRMF_MSGS,
d2i_OSSL_CRMF_PBMPARAMETER,
d2i_OSSL_CRMF_PKIPUBLICATIONINFO,
d2i_OSSL_CRMF_SINGLEPUBINFO,
d2i_OTHERNAME,
d2i_PBE2PARAM,
d2i_PBEPARAM,
@@ -269,6 +279,16 @@ i2d_OCSP_REVOKEDINFO,
i2d_OCSP_SERVICELOC,
i2d_OCSP_SIGNATURE,
i2d_OCSP_SINGLERESP,
i2d_OSSL_CMP_MSG,
i2d_OSSL_CMP_PKIHEADER,
i2d_OSSL_CRMF_CERTID,
i2d_OSSL_CRMF_CERTTEMPLATE,
i2d_OSSL_CRMF_ENCRYPTEDVALUE,
i2d_OSSL_CRMF_MSG,
i2d_OSSL_CRMF_MSGS,
i2d_OSSL_CRMF_PBMPARAMETER,
i2d_OSSL_CRMF_PKIPUBLICATIONINFO,
i2d_OSSL_CRMF_SINGLEPUBINFO,
i2d_OTHERNAME,
i2d_PBE2PARAM,
i2d_PBEPARAM,
@@ -305,7 +325,6 @@ i2d_POLICYQUALINFO,
i2d_PROFESSION_INFO,
i2d_PROXY_CERT_INFO_EXTENSION,
i2d_PROXY_POLICY,
i2d_PublicKey,
i2d_RSAPrivateKey,
i2d_RSAPrivateKey_bio,
i2d_RSAPrivateKey_fp,
@@ -503,8 +522,8 @@ Represents the B<DigestInfo> structure defined in PKCS#1 and PKCS#7.
d2i_TYPE(), d2i_TYPE_bio() and d2i_TYPE_fp() return a valid B<TYPE> structure
or B<NULL> if an error occurs. If the "reuse" capability has been used with
a valid structure being passed in via B<a>, then the object is not freed in
the event of error but may be in a potentially invalid or inconsistent state.
a valid structure being passed in via B<a>, then the object is freed in
the event of error and B<*a> is set to NULL.
i2d_TYPE() returns the number of bytes successfully encoded or a negative
value if an error occurs.
@@ -585,9 +604,13 @@ happen.
=head1 BUGS
In some versions of OpenSSL the "reuse" behaviour of d2i_TYPE() when
B<*px> is valid is broken and some parts of the reused structure may
persist if they are not present in the new one. As a result the use
of this "reuse" behaviour is strongly discouraged.
B<*a> is valid is broken and some parts of the reused structure may
persist if they are not present in the new one. Additionally, in versions of
OpenSSL prior to 1.1.0, when the "reuse" behaviour is used and an error occurs
the behaviour is inconsistent. Some functions behaved as described here, while
some did not free B<*a> on error and did not set B<*a> to NULL.
As a result of the above issues the "reuse" behaviour is strongly discouraged.
i2d_TYPE() will not return an error in many versions of OpenSSL,
if mandatory fields are not initialized due to a programming error