Latest update.
This commit is contained in:
@@ -2,12 +2,16 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS enveloped data structure
|
||||
CMS_add1_recipient, CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS enveloped data structure
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/cms.h>
|
||||
|
||||
CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip,
|
||||
EVP_PKEY *originatorPrivKey,
|
||||
X509 *originator, unsigned int flags);
|
||||
|
||||
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
|
||||
X509 *recip, unsigned int flags);
|
||||
|
||||
@@ -20,6 +24,11 @@ CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS envelo
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
CMS_add1_recipient() adds recipient B<recip> and provides the originator pkey
|
||||
B<originatorPrivKey> and originator certificate B<originator> to CMS_ContentInfo.
|
||||
The originator-related fields are relevant only in case when the keyAgreement
|
||||
method of providing of the shared key is in use.
|
||||
|
||||
CMS_add1_recipient_cert() adds recipient B<recip> to CMS_ContentInfo enveloped
|
||||
data structure B<cms> as a KeyTransRecipientInfo structure.
|
||||
|
||||
@@ -60,9 +69,14 @@ occurs.
|
||||
L<ERR_get_error(3)>, L<CMS_decrypt(3)>,
|
||||
L<CMS_final(3)>,
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
B<CMS_add1_recipient_cert> and B<CMS_add0_recipient_key> were added in
|
||||
OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2008-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
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
CMS_decrypt - decrypt content from a CMS envelopedData structure
|
||||
CMS_decrypt, CMS_decrypt_set1_pkey_and_peer, CMS_decrypt_set1_pkey - decrypt
|
||||
content from a CMS envelopedData structure
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -10,6 +11,9 @@ CMS_decrypt - decrypt content from a CMS envelopedData structure
|
||||
|
||||
int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
|
||||
BIO *dcont, BIO *out, unsigned int flags);
|
||||
int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms,
|
||||
EVP_PKEY *pk, X509 *cert, X509 *peer);
|
||||
int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@@ -21,6 +25,13 @@ B<flags> is an optional set of flags.
|
||||
The B<dcont> parameter is used in the rare case where the encrypted content
|
||||
is detached. It will normally be set to NULL.
|
||||
|
||||
CMS_decrypt_set1_pkey_and_peer() associates the private key B<pkey>, the
|
||||
corresponding certificate B<cert> and the originator certificate B<peer> with
|
||||
the CMS_ContentInfo structure B<cms>.
|
||||
|
||||
CMS_decrypt_set1_pkey() associates the private key B<pkey>, corresponding
|
||||
certificate B<cert> with the CMS_ContentInfo structure B<cms>.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
Although the recipients certificate is not needed to decrypt the data it is
|
||||
@@ -70,9 +81,13 @@ mentioned in CMS_verify() also applies to CMS_decrypt().
|
||||
|
||||
L<ERR_get_error(3)>, L<CMS_encrypt(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
B<CMS_decrypt_set1_pkey_and_peer> was added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2008-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
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
CMS_get0_RecipientInfos, CMS_RecipientInfo_type,
|
||||
CMS_RecipientInfo_ktri_get0_signer_id, CMS_RecipientInfo_ktri_cert_cmp,
|
||||
CMS_RecipientInfo_set0_pkey, CMS_RecipientInfo_kekri_get0_id,
|
||||
CMS_RecipientInfo_kari_set0_pkey_and_peer,
|
||||
CMS_RecipientInfo_kari_set0_pkey,
|
||||
CMS_RecipientInfo_kekri_id_cmp, CMS_RecipientInfo_set0_key,
|
||||
CMS_RecipientInfo_decrypt, CMS_RecipientInfo_encrypt
|
||||
- CMS envelopedData RecipientInfo routines
|
||||
@@ -22,7 +24,9 @@ CMS_RecipientInfo_decrypt, CMS_RecipientInfo_encrypt
|
||||
ASN1_INTEGER **sno);
|
||||
int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
|
||||
int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
|
||||
|
||||
int CMS_RecipientInfo_kari_set0_pkey_and_peer(CMS_RecipientInfo *ri,
|
||||
EVP_PKEY *pk, X509 *peer);
|
||||
int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
|
||||
int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, X509_ALGOR **palg,
|
||||
ASN1_OCTET_STRING **pid,
|
||||
ASN1_GENERALIZEDTIME **pdate,
|
||||
@@ -58,6 +62,13 @@ CMS_RecipientInfo_set0_pkey() associates the private key B<pkey> with
|
||||
the CMS_RecipientInfo structure B<ri>, which must be of type
|
||||
CMS_RECIPINFO_TRANS.
|
||||
|
||||
CMS_RecipientInfo_kari_set0_pkey_and_peer() associates the private key B<pkey>
|
||||
and peer certificate B<peer> with the CMS_RecipientInfo structure B<ri>, which
|
||||
must be of type CMS_RECIPINFO_AGREE.
|
||||
|
||||
CMS_RecipientInfo_kari_set0_pkey() associates the private key B<pkey> with the
|
||||
CMS_RecipientInfo structure B<ri>, which must be of type CMS_RECIPINFO_AGREE.
|
||||
|
||||
CMS_RecipientInfo_kekri_get0_id() retrieves the key information from the
|
||||
CMS_RecipientInfo structure B<ri> which must be of type CMS_RECIPINFO_KEK. Any
|
||||
of the remaining parameters can be NULL if the application is not interested in
|
||||
@@ -127,9 +138,14 @@ Any error can be obtained from L<ERR_get_error(3)>.
|
||||
|
||||
L<ERR_get_error(3)>, L<CMS_decrypt(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
B<CMS_RecipientInfo_kari_set0_pkey_and_peer> and B<CMS_RecipientInfo_kari_set0_pkey>
|
||||
were added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2008-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
|
||||
|
||||
+23
-16
@@ -37,31 +37,38 @@ L<openssl_user_macros(7)>:
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A DH object contains the parameters B<p>, B<q> and B<g>. Note that the B<q>
|
||||
parameter is optional. It also contains a public key (B<pub_key>) and
|
||||
(optionally) a private key (B<priv_key>).
|
||||
A DH object contains the parameters I<p>, I<q> and I<g>. Note that the I<q>
|
||||
parameter is optional. It also contains a public key (I<pub_key>) and
|
||||
(optionally) a private key (I<priv_key>).
|
||||
|
||||
The B<p>, B<q> and B<g> parameters can be obtained by calling DH_get0_pqg().
|
||||
If the parameters have not yet been set then B<*p>, B<*q> and B<*g> will be set
|
||||
The I<p>, I<q> and I<g> parameters can be obtained by calling DH_get0_pqg().
|
||||
If the parameters have not yet been set then I<*p>, I<*q> and I<*g> will be set
|
||||
to NULL. Otherwise they are set to pointers to their respective values. These
|
||||
point directly to the internal representations of the values and therefore
|
||||
should not be freed directly.
|
||||
Any of the out parameters B<p>, B<q>, and B<g> can be NULL, in which case no
|
||||
Any of the out parameters I<p>, I<q>, and I<g> can be NULL, in which case no
|
||||
value will be returned for that parameter.
|
||||
|
||||
The B<p>, B<q> and B<g> values can be set by calling DH_set0_pqg() and passing
|
||||
the new values for B<p>, B<q> and B<g> as parameters to the function. Calling
|
||||
The I<p>, I<q> and I<g> values can be set by calling DH_set0_pqg() and passing
|
||||
the new values for I<p>, I<q> and I<g> as parameters to the function. Calling
|
||||
this function transfers the memory management of the values to the DH object,
|
||||
and therefore the values that have been passed in should not be freed directly
|
||||
after this function has been called. The B<q> parameter may be NULL.
|
||||
after this function has been called. The I<q> parameter may be NULL.
|
||||
DH_set0_pqg() also checks if the parameters associated with I<p> and I<g> and
|
||||
optionally I<q> are associated with known safe prime groups. If it is a safe
|
||||
prime group then the value of I<q> will be set to q = (p - 1) / 2 if I<q> is NULL.
|
||||
For safe prime groups the optional length parameter I<length> is set to twice
|
||||
the value of the maximum_target_security_strength(BN_num_bits(I<p>)) as listed in
|
||||
SP800-56Ar3 Table(s) 25 & 26. If it is not a safe prime group then the optional
|
||||
length parameter will be set if I<q> is not NULL to BN_num_bits(I<q>).
|
||||
|
||||
To get the public and private key values use the DH_get0_key() function. A
|
||||
pointer to the public key will be stored in B<*pub_key>, and a pointer to the
|
||||
private key will be stored in B<*priv_key>. Either may be NULL if they have not
|
||||
pointer to the public key will be stored in I<*pub_key>, and a pointer to the
|
||||
private key will be stored in I<*priv_key>. Either may be NULL if they have not
|
||||
been set yet, although if the private key has been set then the public key must
|
||||
be. The values point to the internal representation of the public key and
|
||||
private key values. This memory should not be freed directly.
|
||||
Any of the out parameters B<pub_key> and B<priv_key> can be NULL, in which case
|
||||
Any of the out parameters I<pub_key> and I<priv_key> can be NULL, in which case
|
||||
no value will be returned for that parameter.
|
||||
|
||||
The public and private key values can be set using DH_set0_key(). Either
|
||||
@@ -70,14 +77,14 @@ untouched. As with DH_set0_pqg() this function transfers the memory management
|
||||
of the key values to the DH object, and therefore they should not be freed
|
||||
directly after this function has been called.
|
||||
|
||||
Any of the values B<p>, B<q>, B<g>, B<priv_key>, and B<pub_key> can also be
|
||||
Any of the values I<p>, I<q>, I<g>, I<priv_key>, and I<pub_key> can also be
|
||||
retrieved separately by the corresponding function DH_get0_p(), DH_get0_q(),
|
||||
DH_get0_g(), DH_get0_priv_key(), and DH_get0_pub_key(), respectively.
|
||||
|
||||
DH_set_flags() sets the flags in the B<flags> parameter on the DH object.
|
||||
DH_set_flags() sets the flags in the I<flags> parameter on the DH object.
|
||||
Multiple flags can be passed in one go (bitwise ORed together). Any flags that
|
||||
are already set are left set. DH_test_flags() tests to see whether the flags
|
||||
passed in the B<flags> parameter are currently set in the DH object. Multiple
|
||||
passed in the I<flags> parameter are currently set in the DH object. Multiple
|
||||
flags can be tested in one go. All flags that are currently set are returned, or
|
||||
zero if none of the flags are set. DH_clear_flags() clears the specified flags
|
||||
within the DH object.
|
||||
@@ -87,7 +94,7 @@ object, or NULL if no such ENGINE has been set. This function is deprecated.
|
||||
|
||||
The DH_get_length() and DH_set_length() functions get and set the optional
|
||||
length parameter associated with this DH object. If the length is nonzero then
|
||||
it is used, otherwise it is ignored. The B<length> parameter indicates the
|
||||
it is used, otherwise it is ignored. The I<length> parameter indicates the
|
||||
length of the secret exponent (private key) in bits. These functions are
|
||||
deprecated.
|
||||
|
||||
|
||||
@@ -24,15 +24,22 @@ B<NID_modp_1536>, B<NID_modp_2048>, B<NID_modp_3072>,
|
||||
B<NID_modp_4096>, B<NID_modp_6144> or B<NID_modp_8192>.
|
||||
|
||||
DH_get_nid() determines if the parameters contained in B<dh> match
|
||||
any named set. It returns the NID corresponding to the matching parameters or
|
||||
B<NID_undef> if there is no match. This function is deprecated.
|
||||
any named safe prime group. It returns the NID corresponding to the matching
|
||||
parameters or B<NID_undef> if there is no match.
|
||||
Internally it caches the nid, so that any subsequent calls can fetch the
|
||||
cached value.
|
||||
If a matching p and g are not found and the value of parameter q is not set,
|
||||
then it is set to q = (p - 1) / 2.
|
||||
If parameter q is already set then it must also match the expected q otherwise
|
||||
no match will be found.
|
||||
This function is deprecated.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
DH_new_by_nid() returns a set of DH parameters or B<NULL> if an error occurred.
|
||||
|
||||
DH_get_nid() returns the NID of the matching set of parameters or
|
||||
B<NID_undef> if there is no match.
|
||||
DH_get_nid() returns the NID of the matching set of parameters for p and g
|
||||
and optionally q, otherwise it returns B<NID_undef> if there is no match.
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
+16
-13
@@ -72,21 +72,24 @@ EVP_PKEY_new_mac_key() works in the same way as EVP_PKEY_new_raw_private_key().
|
||||
New applications should use EVP_PKEY_new_raw_private_key() instead.
|
||||
|
||||
EVP_PKEY_get_raw_private_key() fills the buffer provided by B<priv> with raw
|
||||
private key data. The number of bytes written is populated in B<*len>. If the
|
||||
buffer B<priv> is NULL then B<*len> is populated with the number of bytes
|
||||
required to hold the key. The calling application is responsible for ensuring
|
||||
that the buffer is large enough to receive the private key data. This function
|
||||
only works for algorithms that support raw private keys. Currently this is:
|
||||
B<EVP_PKEY_HMAC>, B<EVP_PKEY_POLY1305>, B<EVP_PKEY_SIPHASH>, B<EVP_PKEY_X25519>,
|
||||
B<EVP_PKEY_ED25519>, B<EVP_PKEY_X448> or B<EVP_PKEY_ED448>.
|
||||
private key data. The size of the B<priv> buffer should be in B<*len> on entry
|
||||
to the function, and on exit B<*len> is updated with the number of bytes
|
||||
actually written. If the buffer B<priv> is NULL then B<*len> is populated with
|
||||
the number of bytes required to hold the key. The calling application is
|
||||
responsible for ensuring that the buffer is large enough to receive the private
|
||||
key data. This function only works for algorithms that support raw private keys.
|
||||
Currently this is: B<EVP_PKEY_HMAC>, B<EVP_PKEY_POLY1305>, B<EVP_PKEY_SIPHASH>,
|
||||
B<EVP_PKEY_X25519>, B<EVP_PKEY_ED25519>, B<EVP_PKEY_X448> or B<EVP_PKEY_ED448>.
|
||||
|
||||
EVP_PKEY_get_raw_public_key() fills the buffer provided by B<pub> with raw
|
||||
public key data. The number of bytes written is populated in B<*len>. If the
|
||||
buffer B<pub> is NULL then B<*len> is populated with the number of bytes
|
||||
required to hold the key. The calling application is responsible for ensuring
|
||||
that the buffer is large enough to receive the public key data. This function
|
||||
only works for algorithms that support raw public keys. Currently this is:
|
||||
B<EVP_PKEY_X25519>, B<EVP_PKEY_ED25519>, B<EVP_PKEY_X448> or B<EVP_PKEY_ED448>.
|
||||
public key data. The size of the B<pub> buffer should be in B<*len> on entry
|
||||
to the function, and on exit B<*len> is updated with the number of bytes
|
||||
actually written. If the buffer B<pub> is NULL then B<*len> is populated with
|
||||
the number of bytes required to hold the key. The calling application is
|
||||
responsible for ensuring that the buffer is large enough to receive the public
|
||||
key data. This function only works for algorithms that support raw public keys.
|
||||
Currently this is: B<EVP_PKEY_X25519>, B<EVP_PKEY_ED25519>, B<EVP_PKEY_X448> or
|
||||
B<EVP_PKEY_ED448>.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_PROVIDER_set_default_search_path,
|
||||
OSSL_PROVIDER, OSSL_PROVIDER_load, OSSL_PROVIDER_unload,
|
||||
OSSL_PROVIDER_available,
|
||||
OSSL_PROVIDER_gettable_params, OSSL_PROVIDER_get_params,
|
||||
@@ -13,6 +14,9 @@ OSSL_PROVIDER_add_builtin, OSSL_PROVIDER_name - provider routines
|
||||
|
||||
typedef struct ossl_provider_st OSSL_PROVIDER;
|
||||
|
||||
void OSSL_PROVIDER_set_default_search_path(OPENSSL_CTX *libctx,
|
||||
const char *path);
|
||||
|
||||
OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *libctx, const char *name);
|
||||
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
|
||||
int OSSL_PROVIDER_available(OPENSSL_CTX *libctx, const char *name);
|
||||
@@ -39,6 +43,11 @@ L<OPENSSL_CTX(3)> for further details.
|
||||
|
||||
=head2 Functions
|
||||
|
||||
OSSL_PROVIDER_set_default_search_path() specifies the default search B<path>
|
||||
that is to be used for looking for providers in the specified B<libctx>.
|
||||
If left unspecified, an environment variable and a fall back default value will
|
||||
be used instead.
|
||||
|
||||
OSSL_PROVIDER_add_builtin() is used to add a built in provider to
|
||||
B<OSSL_PROVIDER> store in the given library context, by associating a
|
||||
provider name with a provider initialization function.
|
||||
|
||||
Reference in New Issue
Block a user