Latest update.
This commit is contained in:
@@ -412,7 +412,9 @@ The following I<ctrl>s are supported in CCM mode.
|
||||
This call is made to set the expected B<CCM> tag value when decrypting or
|
||||
the length of the tag (with the C<tag> parameter set to NULL) when encrypting.
|
||||
The tag length is often referred to as B<M>. If not set a default value is
|
||||
used (12 for AES).
|
||||
used (12 for AES). When decrypting, the tag needs to be set before passing
|
||||
in data to be decrypted, but as in GCM and OCB mode, it can be set after
|
||||
passing additional authenticated data (see L<AEAD Interface>).
|
||||
|
||||
=item EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_L, ivlen, NULL)
|
||||
|
||||
|
||||
+61
-16
@@ -2,17 +2,21 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_KDF_CTX, EVP_KDF_CTX_new_id, EVP_KDF_CTX_free, EVP_KDF_reset,
|
||||
EVP_KDF_ctrl, EVP_KDF_vctrl, EVP_KDF_ctrl_str, EVP_KDF_size,
|
||||
EVP_KDF_derive - EVP KDF routines
|
||||
EVP_KDF, EVP_KDF_CTX, EVP_KDF_CTX_new, EVP_KDF_CTX_new_id, EVP_KDF_CTX_free,
|
||||
EVP_KDF_CTX_kdf, EVP_KDF_reset, EVP_KDF_ctrl, EVP_KDF_vctrl, EVP_KDF_ctrl_str,
|
||||
EVP_KDF_size, EVP_KDF_derive, EVP_KDF_nid, EVP_KDF_name,
|
||||
EVP_get_kdfbyname, EVP_get_kdfbynid, EVP_get_kdfbyobj - EVP KDF routines
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/kdf.h>
|
||||
|
||||
typedef struct evp_kdf_st EVP_KDF;
|
||||
typedef struct evp_kdf_ctx_st EVP_KDF_CTX;
|
||||
|
||||
EVP_KDF_CTX *EVP_KDF_CTX_new_id(int id);
|
||||
EVP_KDF_CTX *EVP_KDF_CTX_new(const EVP_KDF *kdf);
|
||||
EVP_KDF_CTX *EVP_KDF_CTX_new_id(int nid);
|
||||
const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx);
|
||||
void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx);
|
||||
void EVP_KDF_reset(EVP_KDF_CTX *ctx);
|
||||
int EVP_KDF_ctrl(EVP_KDF_CTX *ctx, int cmd, ...);
|
||||
@@ -20,29 +24,40 @@ EVP_KDF_derive - EVP KDF routines
|
||||
int EVP_KDF_ctrl_str(EVP_KDF_CTX *ctx, const char *type, const char *value);
|
||||
size_t EVP_KDF_size(EVP_KDF_CTX *ctx);
|
||||
int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen);
|
||||
int EVP_KDF_nid(const EVP_KDF *kdf);
|
||||
const char *EVP_KDF_name(const EVP_KDF *kdf);
|
||||
const EVP_KDF *EVP_get_kdfbyname(const char *name);
|
||||
const EVP_KDF *EVP_get_kdfbynid(int nid);
|
||||
const EVP_KDF *EVP_get_kdfbyobj(const ASN1_OBJECT *o);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The EVP KDF routines are a high level interface to Key Derivation Function
|
||||
algorithms and should be used instead of algorithm-specific functions.
|
||||
|
||||
After creating a C<EVP_KDF_CTX> for the required algorithm using
|
||||
EVP_KDF_CTX_new_id(), inputs to the algorithm are supplied using calls to
|
||||
EVP_KDF_ctrl(), EVP_KDF_vctrl() or EVP_KDF_ctrl_str() before calling
|
||||
EVP_KDF_derive() to derive the key.
|
||||
After creating a C<EVP_KDF_CTX> for the required algorithm using either
|
||||
EVP_KDF_CTX_new() or EVP_KDF_CTX_new_id(), inputs to the algorithm are supplied
|
||||
using calls to EVP_KDF_ctrl(), EVP_KDF_vctrl() or EVP_KDF_ctrl_str() before
|
||||
calling EVP_KDF_derive() to derive the key.
|
||||
|
||||
=head2 Types
|
||||
|
||||
B<EVP_KDF> is a type that holds the implementation of a KDF.
|
||||
|
||||
B<EVP_KDF_CTX> is a context type that holds the algorithm inputs.
|
||||
|
||||
=head2 Context manipulation functions
|
||||
|
||||
EVP_KDF_CTX_new_id() creates a KDF context for the algorithm identified by the
|
||||
specified NID.
|
||||
EVP_KDF_CTX_new() creates a new context for the KDF type C<kdf>.
|
||||
|
||||
EVP_KDF_CTX_new_id() creates a new context for the numerical KDF identity C<nid>.
|
||||
|
||||
EVP_KDF_CTX_free() frees up the context C<ctx>. If C<ctx> is C<NULL>, nothing
|
||||
is done.
|
||||
|
||||
EVP_KDF_CTX_kdf() returns the B<EVP_KDF> associated with the context
|
||||
C<ctx>.
|
||||
|
||||
=head2 Computing functions
|
||||
|
||||
EVP_KDF_reset() resets the context to the default state as if the context
|
||||
@@ -61,15 +76,32 @@ EVP_KDF_ctrl_str() allows an application to send an algorithm specific control
|
||||
operation to a context C<ctx> in string form. This is intended to be used for
|
||||
options specified on the command line or in text files.
|
||||
|
||||
EVP_KDF_derive() derives C<keylen> bytes of key material and places it in the
|
||||
C<key> buffer. If the algorithm produces a fixed amount of output then an
|
||||
error will occur unless the C<keylen> parameter is equal to that output size,
|
||||
as returned by EVP_KDF_size().
|
||||
|
||||
=head2 Information functions
|
||||
|
||||
EVP_KDF_size() returns the output size if the algorithm produces a fixed amount
|
||||
of output and C<SIZE_MAX> otherwise. If an error occurs then 0 is returned.
|
||||
For some algorithms an error may result if input parameters necessary to
|
||||
calculate a fixed output size have not yet been supplied.
|
||||
|
||||
EVP_KDF_derive() derives C<keylen> bytes of key material and places it in the
|
||||
C<key> buffer. If the algorithm produces a fixed amount of output then an
|
||||
error will occur unless the C<keylen> parameter is equal to that output size,
|
||||
as returned by EVP_KDF_size().
|
||||
EVP_KDF_nid() returns the numeric identity of the given KDF implementation.
|
||||
|
||||
EVP_KDF_name() returns the name of the given KDF implementation.
|
||||
|
||||
=head2 Object database functions
|
||||
|
||||
EVP_get_kdfbyname() fetches a KDF implementation from the object
|
||||
database by name.
|
||||
|
||||
EVP_get_kdfbynid() fetches a KDF implementation from the object
|
||||
database by numeric identity.
|
||||
|
||||
EVP_get_kdfbyobj() fetches a KDF implementation from the object
|
||||
database by ASN.1 OBJECT (i.e. an encoded OID).
|
||||
|
||||
=head1 CONTROLS
|
||||
|
||||
@@ -213,14 +245,26 @@ The value string is expected to be a decimal number.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
EVP_KDF_CTX_new_id() returns either the newly allocated C<EVP_KDF_CTX>
|
||||
structure or C<NULL> if an error occurred.
|
||||
EVP_KDF_CTX_new() and EVP_KDF_CTX_new_id() return either the newly allocated
|
||||
C<EVP_KDF_CTX> structure or C<NULL> if an error occurred.
|
||||
|
||||
EVP_KDF_CTX_free() and EVP_KDF_reset() do not return a value.
|
||||
|
||||
EVP_KDF_size() returns the output size. C<SIZE_MAX> is returned to indicate
|
||||
that the algorithm produces a variable amount of output; 0 to indicate failure.
|
||||
|
||||
EVP_KDF_nid() returns the numeric identity for the given C<kdf>.
|
||||
|
||||
EVP_KDF_name() returns the name for the given C<kdf>, if it has been
|
||||
added to the object database.
|
||||
|
||||
EVP_add_kdf() returns 1 if the given C<kdf> was successfully added to
|
||||
the object database, otherwise 0.
|
||||
|
||||
EVP_get_kdfbyname(), EVP_get_kdfbynid() and EVP_get_kdfbyobj() return
|
||||
the requested KDF implementation, if it exists in the object database,
|
||||
otherwise B<NULL>.
|
||||
|
||||
The remaining functions return 1 for success and 0 or a negative value for
|
||||
failure. In particular, a return value of -2 indicates the operation is not
|
||||
supported by the KDF algorithm.
|
||||
@@ -233,6 +277,7 @@ L<EVP_KDF_PBKDF2(7)>
|
||||
L<EVP_KDF_HKDF(7)>
|
||||
L<EVP_KDF_SS(7)>
|
||||
L<EVP_KDF_SSHKDF(7)>
|
||||
L<EVP_KDF_X963(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ L<EVP_PKEY_verify_recover_init(3)> and L<EVP_PKEY_verify_recover(3)>.
|
||||
|
||||
The signctx_init() and signctx() methods are used to sign a digest present by
|
||||
a B<EVP_MD_CTX> object. They are called by the EVP_DigestSign functions. See
|
||||
L<EVP_DigestSignInit(3)> for detail.
|
||||
L<EVP_DigestSignInit(3)> for details.
|
||||
|
||||
int (*verifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
|
||||
int (*verifyctx) (EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen,
|
||||
@@ -294,7 +294,7 @@ L<EVP_DigestSignInit(3)> for detail.
|
||||
|
||||
The verifyctx_init() and verifyctx() methods are used to verify a signature
|
||||
against the data in a B<EVP_MD_CTX> object. They are called by the various
|
||||
EVP_DigestVerify functions. See L<EVP_DigestVerifyInit(3)> for detail.
|
||||
EVP_DigestVerify functions. See L<EVP_DigestVerifyInit(3)> for details.
|
||||
|
||||
int (*encrypt_init) (EVP_PKEY_CTX *ctx);
|
||||
int (*encrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
|
||||
@@ -321,7 +321,7 @@ L<EVP_PKEY_derive_init(3)> and L<EVP_PKEY_derive(3)>.
|
||||
int (*ctrl_str) (EVP_PKEY_CTX *ctx, const char *type, const char *value);
|
||||
|
||||
The ctrl() and ctrl_str() methods are used to adjust algorithm-specific
|
||||
settings. See L<EVP_PKEY_CTX_ctrl(3)> and related functions for detail.
|
||||
settings. See L<EVP_PKEY_CTX_ctrl(3)> and related functions for details.
|
||||
|
||||
int (*digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
|
||||
const unsigned char *tbs, size_t tbslen);
|
||||
@@ -330,7 +330,7 @@ settings. See L<EVP_PKEY_CTX_ctrl(3)> and related functions for detail.
|
||||
size_t tbslen);
|
||||
|
||||
The digestsign() and digestverify() methods are used to generate or verify
|
||||
a signature in a one-shot mode. They could be called by L<EVP_DigetSign(3)>
|
||||
a signature in a one-shot mode. They could be called by L<EVP_DigestSign(3)>
|
||||
and L<EVP_DigestVerify(3)>.
|
||||
|
||||
int (*check) (EVP_PKEY *pkey);
|
||||
|
||||
@@ -250,7 +250,8 @@ All other functions return B<1> on success and B<0> on failure.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
Integral types will be widened and sign extended as required.
|
||||
Native types will be converted as required only if the value is exactly
|
||||
representable by the target type or parameter.
|
||||
Apart from that, the functions must be used appropriately for the
|
||||
expected type of the parameter.
|
||||
|
||||
|
||||
@@ -55,6 +55,11 @@ The content of B<buf> cannot be recovered from subsequent random generator outpu
|
||||
Applications that intend to save and restore random state in an external file
|
||||
should consider using L<RAND_load_file(3)> instead.
|
||||
|
||||
NOTE: In FIPS mode, random data provided by the application is not considered to
|
||||
be a trusted entropy source. It is mixed into the internal state of the RNG as
|
||||
additional data only and this does not count as a full reseed.
|
||||
For more details, see L<RAND_DRBG(7)>.
|
||||
|
||||
RAND_seed() is equivalent to RAND_add() with B<randomness> set to B<num>.
|
||||
|
||||
RAND_keep_random_devices_open() is used to control file descriptor
|
||||
@@ -86,6 +91,7 @@ L<RAND_bytes(3)>,
|
||||
L<RAND_egd(3)>,
|
||||
L<RAND_load_file(3)>,
|
||||
L<RAND(7)>
|
||||
L<RAND_DRBG(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ SSL_session_reused - query whether a reused session was negotiated during handsh
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
int SSL_session_reused(SSL *ssl);
|
||||
int SSL_session_reused(const SSL *ssl);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
|
||||
+29
-2
@@ -2,12 +2,13 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SSL_write_ex, SSL_write - write bytes to a TLS/SSL connection
|
||||
SSL_write_ex, SSL_write, SSL_sendfile - write bytes to a TLS/SSL connection
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
ossl_ssize_t SSL_sendfile(SSL *s, int fd, off_t offset, size_t size, int flags);
|
||||
int SSL_write_ex(SSL *s, const void *buf, size_t num, size_t *written);
|
||||
int SSL_write(SSL *ssl, const void *buf, int num);
|
||||
|
||||
@@ -17,6 +18,14 @@ SSL_write_ex() and SSL_write() write B<num> bytes from the buffer B<buf> into
|
||||
the specified B<ssl> connection. On success SSL_write_ex() will store the number
|
||||
of bytes written in B<*written>.
|
||||
|
||||
SSL_sendfile() writes B<size> bytes from offset B<offset> in the file
|
||||
descriptor B<fd> to the specified SSL connection B<s>. This function provides
|
||||
efficient zero-copy semantics. SSL_sendfile() is available only when
|
||||
Kernel TLS is enabled, which can be checked by calling BIO_get_ktls_send().
|
||||
It is provided here to allow users to maintain the same interface.
|
||||
The meaning of B<flags> is platform dependent.
|
||||
Currently, under Linux it is ignored.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
In the paragraphs below a "write function" is defined as one of either
|
||||
@@ -104,17 +113,35 @@ You should instead call SSL_get_error() to find out if it's retryable.
|
||||
|
||||
=back
|
||||
|
||||
For SSL_sendfile(), the following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item Z<>>= 0
|
||||
|
||||
The write operation was successful, the return value is the number
|
||||
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.
|
||||
Call SSL_get_error() with the return value to find out the reason.
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<SSL_get_error(3)>, L<SSL_read_ex(3)>, L<SSL_read(3)>
|
||||
L<SSL_CTX_set_mode(3)>, L<SSL_CTX_new(3)>,
|
||||
L<SSL_connect(3)>, L<SSL_accept(3)>
|
||||
L<SSL_set_connect_state(3)>,
|
||||
L<SSL_set_connect_state(3)>, L<BIO_ctrl(3)>,
|
||||
L<ssl(7)>, L<bio(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The SSL_write_ex() function was added in OpenSSL 1.1.1.
|
||||
The SSL_sendfile() function was added in OpenSSL 3.0.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user