Latest update.

This commit is contained in:
2020-01-21 10:59:59 +09:00
parent 0f7abb4eb6
commit f2d048b604
94 changed files with 989 additions and 10719 deletions
@@ -0,0 +1,58 @@
=pod
=head1 NAME
evp_pkey_make_provided - internal EVP_PKEY support functions for providers
=head1 SYNOPSIS
/* Only for EVP source */
#include "evp_local.h"
void *evp_pkey_make_provided(EVP_PKEY *pk, OPENSSL_CTX *libctx,
EVP_KEYMGMT **keymgmt, const char *propquery,
int domainparams);
=head1 DESCRIPTION
evp_pkey_make_provided() ensures that the B<EVP_PKEY> I<pk> is provided within
the library context I<libctx> (NULL means the default context). I<keymgmt>
may point at a reference to a B<EVP_KEYMGMT>, and works as an input/output
parameter.
As input to this function, it can be used to specify a B<EVP_KEYMGMT> to be
used for exporting. If not (I<*keymgmt> is NULL), then this function will
fetch an B<EVP_KEYMGMT> implicitly, using I<propquery> as property query string.
As output from this function, I<*keymgmt> will be assigned the B<EVP_KEYMGMT>
that was used, if the export was successful, otherwise it will be assigned NULL.
I<domainparams> decides if I<pk> should be considered domain parameters or the
actual key.
=head1 RETURN VALUES
evp_pkey_make_provided() returns the provider key data that was exported if
I<pk> was successfully provided. Otherwise, NULL is returned.
=head1 NOTES
Some functions calling evp_pkey_make_provided() may have received a const
key, and may therefore have to cast the key to non-const form to call this
function. Since B<EVP_PKEY> is always dynamically allocated, this is OK.
=head1 SEE ALSO
L<OPENSSL_CTX(3)>, L<EVP_KEYMGMT(3)>
=head1 HISTORY
The functions described here were all added in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2020 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
+14 -3
View File
@@ -8,9 +8,9 @@ ossl_param_bld_push_long, ossl_param_bld_push_ulong,
ossl_param_bld_push_int32, ossl_param_bld_push_uint32,
ossl_param_bld_push_int64, ossl_param_bld_push_uint64,
ossl_param_bld_push_size_t, ossl_param_bld_push_double,
ossl_param_bld_push_BN, ossl_param_bld_push_utf8_string,
ossl_param_bld_push_utf8_ptr, ossl_param_bld_push_octet_string,
ossl_param_bld_push_octet_ptr
ossl_param_bld_push_BN, ossl_param_bld_push_BN_pad,
ossl_param_bld_push_utf8_string, ossl_param_bld_push_utf8_ptr,
ossl_param_bld_push_octet_string, ossl_param_bld_push_octet_ptr
- functions to assist in the creation of OSSL_PARAM arrays
=head1 SYNOPSIS
@@ -34,6 +34,8 @@ ossl_param_bld_push_octet_ptr
int ossl_param_bld_push_BN(OSSL_PARAM_BLD *bld, const char *key,
const BIGNUM *bn);
int ossl_param_bld_push_BN_pad(OSSL_PARAM_BLD *bld, const char *key,
const BIGNUM *bn, size_t sz);
int ossl_param_bld_push_utf8_string(OSSL_PARAM_BLD *bld, const char *key,
const char *buf, size_t bsize);
@@ -90,6 +92,15 @@ will also be securely allocated.
The I<bn> argument is stored by reference and the underlying BIGNUM object
must exist until after ossl_param_bld_to_param() has been called.
ossl_param_bld_push_BN_pad() is a function that will create an OSSL_PARAM object
that holds the specified BIGNUM I<bn>.
The object will be padded to occupy exactly I<sz> bytes, if insufficient space
is specified an error results.
If I<bn> is marked as being securely allocated, it's OSSL_PARAM representation
will also be securely allocated.
The I<bn> argument is stored by reference and the underlying BIGNUM object
must exist until after ossl_param_bld_to_param() has been called.
ossl_param_bld_push_utf8_string() is a function that will create an OSSL_PARAM
object that references the UTF8 string specified by I<buf>.
If the length of the string, I<bsize>, is zero then it will be calculated.
-41
View File
@@ -1,41 +0,0 @@
=pod
=head1 NAME
rand_bytes_ex, rand_priv_bytes_ex
- internal random number routines
=head1 SYNOPSIS
#include "crypto/rand.h"
int rand_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
int rand_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
=head1 DESCRIPTION
rand_bytes_ex() and rand_priv_bytes_ex() are the equivalent of RAND_bytes() and
RAND_priv_bytes() in the public API except that they both take an additional
I<ctx> parameter.
The DRBG used for the operation is the public or private DRBG associated with
the specified I<ctx>. The parameter can be NULL, in which case
the default library ctx is used.
If the default RAND_METHOD has been changed then for compatibility reasons the
RAND_METHOD will be used in preference and the DRBG of the library context
ignored.
=head1 RETURN VALUES
rand_bytes_ex() and rand_bytes_priv_ex() return 0 or less on error or 1 on
success.
=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
+4
View File
@@ -35,6 +35,10 @@ L<openssl_user_macros(7)>:
#include <openssl/md5.h>
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
B<OPENSSL_API_COMPAT> with a suitable version value, see
L<openssl_user_macros(7)>:
unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md);
int MD5_Init(MD5_CTX *c);
+18 -1
View File
@@ -2,7 +2,8 @@
=head1 NAME
RAND_bytes, RAND_priv_bytes, RAND_pseudo_bytes - generate random data
RAND_bytes, RAND_priv_bytes, RAND_bytes_ex, RAND_priv_bytes_ex,
RAND_pseudo_bytes - generate random data
=head1 SYNOPSIS
@@ -11,6 +12,9 @@ RAND_bytes, RAND_priv_bytes, RAND_pseudo_bytes - generate random data
int RAND_bytes(unsigned char *buf, int num);
int RAND_priv_bytes(unsigned char *buf, int num);
int RAND_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
int RAND_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
Deprecated since OpenSSL 1.1.0, can be hidden entirely by defining
B<OPENSSL_API_COMPAT> with a suitable version value, see
L<openssl_user_macros(7)>:
@@ -29,6 +33,15 @@ instance so that a compromise of the "public" PRNG instance will not
affect the secrecy of these private values, as described in L<RAND(7)>
and L<RAND_DRBG(7)>.
RAND_bytes_ex() and RAND_priv_bytes_ex() are the same as RAND_bytes() and
RAND_priv_bytes() except that they both take an additional I<ctx> parameter.
The DRBG used for the operation is the public or private DRBG associated with
the specified I<ctx>. The parameter can be NULL, in which case
the default library context is used (see L<OPENSSL_CTX(3)>.
If the default RAND_METHOD has been changed then for compatibility reasons the
RAND_METHOD will be used in preference and the DRBG of the library context
ignored.
=head1 NOTES
Always check the error return value of RAND_bytes() and
@@ -64,6 +77,10 @@ RAND_pseudo_bytes() was deprecated in OpenSSL 1.1.0; use RAND_bytes() instead.
The RAND_priv_bytes() function was added in OpenSSL 1.1.1.
=item *
The RAND_bytes_ex() and RAND_priv_bytes_ex() functions were added in OpenSSL 3.0
=back
=head1 COPYRIGHT
+11 -3
View File
@@ -11,6 +11,10 @@ SHA512_Final - Secure Hash Algorithm
#include <openssl/sha.h>
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
B<OPENSSL_API_COMPAT> with a suitable version value, see
L<openssl_user_macros(7)>:
int SHA1_Init(SHA_CTX *c);
int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
int SHA1_Final(unsigned char *md, SHA_CTX *c);
@@ -43,9 +47,9 @@ SHA512_Final - Secure Hash Algorithm
=head1 DESCRIPTION
Applications should use the higher level functions
L<EVP_DigestInit(3)> etc. instead of calling the hash
functions directly.
All of the functions described on this page are deprecated.
Applications should instead use L<EVP_DigestInit_ex(3)>, L<EVP_DigestUpdate(3)>
and L<EVP_DigestFinal_ex(3)>.
SHA-1 (Secure Hash Algorithm) is a cryptographic hash function with a
160 bit output.
@@ -96,6 +100,10 @@ ANSI X9.30
L<EVP_DigestInit(3)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.