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