Latest update.
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ossl_cmp_log_parse_metadata,
|
||||
ossl_cmp_add_error_txt,
|
||||
ossl_cmp_add_error_data,
|
||||
ossl_cmp_add_error_line,
|
||||
ossl_cmp_asn1_octet_string_set1,
|
||||
ossl_cmp_asn1_octet_string_set1_bytes,
|
||||
ossl_cmp_build_cert_chain
|
||||
@@ -15,14 +11,6 @@ ossl_cmp_build_cert_chain
|
||||
|
||||
#include "cmp_local.h"
|
||||
|
||||
const char *ossl_cmp_log_parse_metadata(const char *buf,
|
||||
OSSL_CMP_severity *level, char **func,
|
||||
char **file, int *line);
|
||||
|
||||
void ossl_cmp_add_error_txt(const char *separator, const char *txt);
|
||||
#define ossl_cmp_add_error_data(txt)
|
||||
#define ossl_cmp_add_error_line(txt)
|
||||
|
||||
int ossl_cmp_asn1_octet_string_set1(ASN1_OCTET_STRING **tgt,
|
||||
const ASN1_OCTET_STRING *src);
|
||||
int ossl_cmp_asn1_octet_string_set1_bytes(ASN1_OCTET_STRING **tgt,
|
||||
@@ -32,27 +20,6 @@ ossl_cmp_build_cert_chain
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
ossl_cmp_log_parse_metadata() parses the given message buffer I<buf> populated
|
||||
by L<OSSL_CMP_log(3)> etc.
|
||||
according to the pattern OSSL_CMP_LOG_START#level ": %s\n", filling in
|
||||
the variable pointed to by I<level> with the severity level or -1,
|
||||
the variable pointed to by I<func> with the function name string or NULL,
|
||||
the variable pointed to by I<file> with the filename string or NULL, and
|
||||
the variable pointed to by I<line> with the line number or -1.
|
||||
Any string returned via I<*func> and I<*file> must be freeed by the caller.
|
||||
|
||||
ossl_cmp_add_error_txt() appends text to the extra data field of the last
|
||||
error message in the OpenSSL error queue, after adding the optional separator
|
||||
unless data has been empty so far. The text can be of arbitrary length,
|
||||
which is not possible when using L<ERR_add_error_data(3)> in conjunction with
|
||||
L<ERR_print_errors_cb(3)>.
|
||||
|
||||
ossl_cmp_add_error_data() is a macro calling
|
||||
ossl_cmp_add_error_txt() with the separator being ":".
|
||||
|
||||
ossl_cmp_add_error_line() is a macro calling
|
||||
ossl_cmp_add_error_txt() with the separator being "\n".
|
||||
|
||||
ossl_cmp_asn1_octet_string_set1() frees any previous value of the variable
|
||||
referenced via the I<tgt> argument and assigns either a copy of
|
||||
the ASN1_OCTET_STRING given as the I<src> argument or NULL.
|
||||
@@ -68,15 +35,6 @@ certificates and optionally the (possible) trust anchor(s).
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
ossl_cmp_log_parse_metadata() returns the pointer to the actual message text
|
||||
after the OSSL_CMP_LOG_PREFIX and level and ':' if found in the buffer,
|
||||
else the beginning of the buffer.
|
||||
|
||||
ossl_cmp_add_error_txt()
|
||||
ossl_cmp_add_error_data(), and
|
||||
ossl_cmp_add_error_line()
|
||||
do not return anything.
|
||||
|
||||
ossl_cmp_build_cert_chain()
|
||||
returns NULL on error, else a pointer to a stack of (up_ref'ed) certificates
|
||||
containing the EE certificate given in the function arguments (cert)
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ossl_cmp_certReq_new,
|
||||
ossl_cmp_certRep_new,
|
||||
ossl_cmp_rr_new,
|
||||
ossl_cmp_rp_new,
|
||||
ossl_cmp_certConf_new,
|
||||
ossl_cmp_pkiconf_new,
|
||||
ossl_cmp_pollReq_new,
|
||||
ossl_cmp_pollRep_new,
|
||||
ossl_cmp_genm_new,
|
||||
ossl_cmp_genp_new,
|
||||
ossl_cmp_error_new
|
||||
- functions for generating CMP messages
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/cmp.h>
|
||||
|
||||
# define OSSL_CMP_PKIBODY_IR 0
|
||||
# define OSSL_CMP_PKIBODY_IP 1
|
||||
# define OSSL_CMP_PKIBODY_CR 2
|
||||
# define OSSL_CMP_PKIBODY_CP 3
|
||||
# define OSSL_CMP_PKIBODY_P10CR 4
|
||||
# define OSSL_CMP_PKIBODY_POPDECC 5
|
||||
# define OSSL_CMP_PKIBODY_POPDECR 6
|
||||
# define OSSL_CMP_PKIBODY_KUR 7
|
||||
# define OSSL_CMP_PKIBODY_KUP 8
|
||||
# define OSSL_CMP_PKIBODY_KRR 9
|
||||
# define OSSL_CMP_PKIBODY_KRP 10
|
||||
# define OSSL_CMP_PKIBODY_RR 11
|
||||
# define OSSL_CMP_PKIBODY_RP 12
|
||||
# define OSSL_CMP_PKIBODY_CCR 13
|
||||
# define OSSL_CMP_PKIBODY_CCP 14
|
||||
# define OSSL_CMP_PKIBODY_CKUANN 15
|
||||
# define OSSL_CMP_PKIBODY_CANN 16
|
||||
# define OSSL_CMP_PKIBODY_RANN 17
|
||||
# define OSSL_CMP_PKIBODY_CRLANN 18
|
||||
# define OSSL_CMP_PKIBODY_PKICONF 19
|
||||
# define OSSL_CMP_PKIBODY_NESTED 20
|
||||
# define OSSL_CMP_PKIBODY_GENM 21
|
||||
# define OSSL_CMP_PKIBODY_GENP 22
|
||||
# define OSSL_CMP_PKIBODY_ERROR 23
|
||||
# define OSSL_CMP_PKIBODY_CERTCONF 24
|
||||
# define OSSL_CMP_PKIBODY_POLLREQ 25
|
||||
# define OSSL_CMP_PKIBODY_POLLREP 26
|
||||
|
||||
OSSL_ossl_cmp_MSG *ossl_cmp_certReq_new(OSSL_CMP_CTX *ctx, int bodytype,
|
||||
int err_code);
|
||||
OSSL_CMP_MSG *ossl_cmp_certRep_new(OSSL_CMP_CTX *ctx, int bodytype,
|
||||
int certReqId, OSSL_CMP_PKISI *si,
|
||||
X509 *cert, STACK_OF(X509) *chain,
|
||||
STACK_OF(X509) *caPubs,
|
||||
int encrypted, int unprotectedErrors);
|
||||
OSSL_CMP_MSG *ossl_cmp_rr_new(OSSL_CMP_CTX *ctx);
|
||||
OSSL_CMP_MSG *ossl_cmp_rp_new(OSSL_CMP_CTX *ctx, OSSL_CMP_PKISI *si,
|
||||
OSSL_CRMF_CERTID *cid, int unprot_err);
|
||||
OSSL_CMP_MSG *ossl_cmp_certConf_new(OSSL_CMP_CTX *ctx, int fail_info,
|
||||
const char *text);
|
||||
OSSL_CMP_MSG *ossl_cmp_pkiconf_new(OSSL_CMP_CTX *ctx);
|
||||
OSSL_CMP_MSG *ossl_cmp_pollReq_new(OSSL_CMP_CTX *ctx, int crid);
|
||||
OSSL_CMP_MSG *ossl_cmp_pollRep_new(OSSL_CMP_CTX *ctx, int crid, int poll_after)
|
||||
OSSL_CMP_MSG *ossl_cmp_genm_new(OSSL_CMP_CTX *ctx);
|
||||
OSSL_CMP_MSG *ossl_cmp_genp_new(OSSL_CMP_CTX *ctx);
|
||||
OSSL_CMP_MSG *ossl_cmp_error_new(OSSL_CMP_CTX *ctx, OSSL_CMP_PKISI *si,
|
||||
int errorCode,
|
||||
OSSL_CMP_PKIFREETEXT *errorDetails,
|
||||
int unprotected)
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This is the API for creating various CMP PKIMESSAGES. The
|
||||
functions allocate a new message, fill it with the relevant data derived from
|
||||
the given OSSL_CMP_CTX, and create the applicable protection.
|
||||
|
||||
ossl_cmp_certReq_new() creates a PKIMessage for requesting a certificate,
|
||||
which can be either of IR/CR/KUR/P10CR, depending on the given B<bodytype>.
|
||||
The OpenSSL error reason code defined in err.h to use on error is given as
|
||||
B<err_code>.
|
||||
|
||||
Available CMP certificate request PKIMessage B<bodytype>s are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item * B<OSSL_CMP_PKIBODY_IR> - Initialization Request
|
||||
|
||||
=item * B<OSSL_CMP_PKIBODY_CR> - Certification Request
|
||||
|
||||
=item * B<OSSL_CMP_PKIBODY_P10CR> - PKCS#10 Certification Request
|
||||
|
||||
=item * B<OSSL_CMP_PKIBODY_KUR> - Key Update Request
|
||||
|
||||
=back
|
||||
|
||||
ossl_cmp_certrep_new() creates a PKIMessage for certificate response, which can
|
||||
be either of IP/CP/KUP, depending on the given B<bodytype>.
|
||||
|
||||
Available CMP certificate response PKIMessage B<bodytype>s are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item * B<OSSL_CMP_PKIBODY_IP> - Initialization Response
|
||||
|
||||
=item * B<OSSL_CMP_PKIBODY_CP> - Certification Response
|
||||
|
||||
=item * B<OSSL_CMP_PKIBODY_KUP> - Key Update Response
|
||||
|
||||
=back
|
||||
|
||||
The list of all CMP PKIMessage B<bodytype>s is:
|
||||
|
||||
#define OSSL_CMP_PKIBODY_IR 0
|
||||
#define OSSL_CMP_PKIBODY_IP 1
|
||||
#define OSSL_CMP_PKIBODY_CR 2
|
||||
#define OSSL_CMP_PKIBODY_CP 3
|
||||
#define OSSL_CMP_PKIBODY_P10CR 4
|
||||
#define OSSL_CMP_PKIBODY_POPDECC 5
|
||||
#define OSSL_CMP_PKIBODY_POPDECR 6
|
||||
#define OSSL_CMP_PKIBODY_KRR 9
|
||||
#define OSSL_CMP_PKIBODY_KRP 10
|
||||
#define OSSL_CMP_PKIBODY_RR 11
|
||||
#define OSSL_CMP_PKIBODY_RP 12
|
||||
#define OSSL_CMP_PKIBODY_CCR 13
|
||||
#define OSSL_CMP_PKIBODY_CCP 14
|
||||
#define OSSL_CMP_PKIBODY_CKUANN 15
|
||||
#define OSSL_CMP_PKIBODY_CANN 16
|
||||
#define OSSL_CMP_PKIBODY_RANN 17
|
||||
#define OSSL_CMP_PKIBODY_CRLANN 18
|
||||
#define OSSL_CMP_PKIBODY_PKICONF 19
|
||||
#define OSSL_CMP_PKIBODY_NESTED 20
|
||||
#define OSSL_CMP_PKIBODY_GENM 21
|
||||
#define OSSL_CMP_PKIBODY_GENP 22
|
||||
#define OSSL_CMP_PKIBODY_ERROR 23
|
||||
#define OSSL_CMP_PKIBODY_CERTCONF 24
|
||||
#define OSSL_CMP_PKIBODY_POLLREQ 25
|
||||
#define OSSL_CMP_PKIBODY_POLLREP 26
|
||||
|
||||
ossl_cmp_rr_new() creates a Revocation Request message from the
|
||||
information set via OSSL_CMP_CTX_set1_oldClCert().
|
||||
|
||||
ossl_cmp_rp_new() creates a Revocation Response message with status set to
|
||||
B<si> and CertID set to B<cid>. Consumes B<cid>.
|
||||
Accepts unprotected errors if B<uprot_err> != 0.
|
||||
|
||||
ossl_cmp_certConf_new() creates a Certificate Confirmation message for the last
|
||||
received certificate. PKIStatus defaults to B<accepted> if the B<fail_info> bit
|
||||
field is 0. Else it is taken as the failInfo of the PKIStatusInfo, PKIStatus is
|
||||
set to B<rejected>, and B<text> is copied to statusString unless it is NULL.
|
||||
|
||||
ossl_cmp_pkiconf_new() creates a PKI Confirmation message.
|
||||
|
||||
ossl_cmp_pollReq_new() creates a Polling Request message with certReqId set to
|
||||
B<crid>.
|
||||
|
||||
ossl_cmp_pollRep_new() creates a Polling Response message with certReqId set to
|
||||
B<crid> and pollAfter to B<poll_after>.
|
||||
|
||||
ossl_cmp_genm_new() creates a new General Message with an empty ITAV stack.
|
||||
|
||||
ossl_cmp_genp_new() creates a new General Response with an empty ITAV stack.
|
||||
|
||||
ossl_cmp_error_new() creates a new Error Message with the given contents,
|
||||
copying B<si> and B<errorDetails>.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
CMP is specified in RFC 4210 (and CRMF in RFC 4211).
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
All of the functions return a new OSSL_CMP_MSG structure containing
|
||||
the generated message on success, or NULL on error.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<OSSL_CMP_CTX_new(3)>, L<ERR_load_strings(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The OpenSSL CMP support was added in OpenSSL 3.0.
|
||||
|
||||
=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
|
||||
@@ -0,0 +1,81 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ossl_cmp_bodytype_to_string,
|
||||
ossl_cmp_msg_get_bodytype,
|
||||
ossl_cmp_msg_set_bodytype,
|
||||
ossl_cmp_msg_create,
|
||||
ossl_cmp_msg_load,
|
||||
ossl_cmp_msg_gen_ITAV_push0,
|
||||
ossl_cmp_msg_gen_ITAVs_push1
|
||||
- functions manipulating CMP messages
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include "cmp_int.h"
|
||||
|
||||
const char *ossl_cmp_bodytype_to_string(int type);
|
||||
int ossl_cmp_msg_get_bodytype(const OSSL_CMP_MSG *msg);
|
||||
int ossl_cmp_msg_set_bodytype( OSSL_CMP_MSG *msg, int type);
|
||||
OSSL_CMP_MSG *ossl_cmp_msg_create(OSSL_CMP_CTX *ctx, int bodytype);
|
||||
OSSL_CMP_MSG *ossl_cmp_msg_load(const char *file);
|
||||
int ossl_cmp_msg_gen_ITAV_push0(OSSL_CMP_MSG *msg, OSSL_CMP_ITAV *itav);
|
||||
int ossl_cmp_msg_gen_ITAVs_push1(OSSL_CMP_MSG *msg,
|
||||
STACK_OF(OSSL_CMP_ITAV) *itavs);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
ossl_cmp_bodytype_to_string() returns the name of the given body type as string,
|
||||
or "illegal body type" on error.
|
||||
|
||||
ossl_cmp_msg_get_bodytype() returns the body type of the given PKIMessage,
|
||||
or -1 on error.
|
||||
|
||||
ossl_cmp_msg_set_bodytype() sets the type of the message contained in
|
||||
the PKIMessage body field.
|
||||
Returns 1 on success, 0 on error.
|
||||
|
||||
ossl_cmp_msg_create() creates and initializes a OSSL_CMP_MSG structure,
|
||||
using B<ctx> for the header and B<bodytype> for the body.
|
||||
Returns pointer to created OSSL_CMP_MSG on success, NULL on error.
|
||||
|
||||
OSSL_CMP_MSG *ossl_cmp_msg_load() loads a OSSL_CMP_MSG from a B<file>.
|
||||
Returns pointer to created OSSL_CMP_MSG on success, NULL on error.
|
||||
|
||||
ossl_cmp_msg_gen_ITAV_push0() pushes the B<itav> to the body of the
|
||||
PKIMessage B<msg> of GenMsg or GenRep type. Consumes the B<itavs> pointer.
|
||||
Returns 1 on success, 0 on error.
|
||||
|
||||
ossl_cmp_msg_gen_ITAVs_push1() adds a copy of the B<itavs> stack to the body
|
||||
of the PKIMessage B<msg> of GenMsg or GenRep type.
|
||||
Does not consume the B<itavs> pointer nor its elements.
|
||||
Returns 1 on success, 0 on error.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
CMP is defined in RFC 4210 (and CRMF in RFC 4211).
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
See the individual functions above.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<OSSL_CMP_CTX_new(3)>, L<OSSL_CMP_exec_IR_ses(3)>,
|
||||
L<OSSL_CMP_MSG_http_perform(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The OpenSSL CMP support was added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2007-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
|
||||
@@ -0,0 +1,53 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ossl_cmp_msg_protect,
|
||||
ossl_cmp_msg_add_extraCerts
|
||||
- functions for producing CMP message protection
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include "cmp_int.h"
|
||||
|
||||
int ossl_cmp_msg_protect(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
|
||||
int ossl_cmp_msg_add_extraCerts(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
ossl_cmp_msg_protect() protects the given message B<msg> using an algorithm
|
||||
depending on the available context information given in the B<ctx>.
|
||||
If there is a secretValue it selects PBMAC. Else if there is a clCert
|
||||
it selects Signature and uses B<ossl_cmp_msg_add_extraCerts()>.
|
||||
It also sets the protectionAlg field in the message header accordingly.
|
||||
|
||||
ossl_cmp_msg_add_extraCerts() adds elements to the extraCerts field in the given
|
||||
message B<msg>. It tries to build the certificate chain of the client cert in
|
||||
the B<ctx> if present by using certificates in ctx->untrusted_certs;
|
||||
if no untrusted certs are set, it will at least add the client certificate.
|
||||
In any case all the certificates explicitly specified to be sent out (i.e.,
|
||||
B<ctx->extraCertsOut>) are added. Note that it will NOT add the root certificate
|
||||
of the chain, i.e, the trust anchor (unless it is part of extraCertsOut).
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
CMP is defined in RFC 4210 (and CRMF in RFC 4211).
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
All functions return 1 on success, 0 on error.
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The OpenSSL CMP support was added in OpenSSL 3.0.
|
||||
|
||||
=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
|
||||
@@ -0,0 +1,108 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ossl_cmp_print_log,
|
||||
ossl_cmp_alert,
|
||||
ossl_cmp_err,
|
||||
ossl_cmp_warn,
|
||||
ossl_cmp_info,
|
||||
ossl_cmp_debug,
|
||||
ossl_cmp_log,
|
||||
ossl_cmp_log1,
|
||||
ossl_cmp_log2,
|
||||
ossl_cmp_log3,
|
||||
ossl_cmp_log4,
|
||||
ossl_cmp_log_parse_metadata,
|
||||
ossl_cmp_add_error_data,
|
||||
ossl_cmp_add_error_line
|
||||
- logging and error reporting support for CMP
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include "cmp_local.h"
|
||||
|
||||
int ossl_cmp_print_log(OSSL_CMP_severity level, const OSSL_CMP_CTX *ctx,
|
||||
const char *func, const char *file, int line,
|
||||
const char *level_str, const char *format, ...);
|
||||
#define ossl_cmp_alert(ctx, msg)
|
||||
#define ossl_cmp_err(ctx, msg)
|
||||
#define ossl_cmp_warn(ctx, msg)
|
||||
#define ossl_cmp_info(ctx, msg)
|
||||
#define ossl_cmp_debug(ctx, (msg)
|
||||
#define ossl_cmp_log(level, ctx, msg)
|
||||
#define ossl_cmp_log1(level, ctx, fmt, arg1)
|
||||
#define ossl_cmp_log2(level, ctx, fmt, arg1, arg2)
|
||||
#define ossl_cmp_log3(level, ctx, fmt, arg1, arg2, arg3)
|
||||
#define ossl_cmp_log4(level, ctx, fmt, arg1, arg2, arg3, arg4)
|
||||
const char *ossl_cmp_log_parse_metadata(const char *buf,
|
||||
OSSL_CMP_severity *level, char **func,
|
||||
char **file, int *line);
|
||||
|
||||
#define ossl_cmp_add_error_data(txt)
|
||||
#define ossl_cmp_add_error_line(txt)
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
ossl_cmp_print_log() prints CMP log messages (i.e., diagnostic info) via the
|
||||
log callback of the B<ctx> if present and the severity level is sufficient.
|
||||
If the trace API if enabled the function uses it, prepending the function name,
|
||||
filename, line number, and severity information to the message being output.
|
||||
In any case the B<level>, B<func>, B<file>, and B<line> parameters
|
||||
and the message constructed using the given B<format> and variable further
|
||||
argument list are passed to the log callback function (unless it is NULL).
|
||||
The B<ctx>, B<func>, B<file>, and B<level_str> arguments may be NULL.
|
||||
|
||||
ossl_cmp_alert(), ossl_cmp_err(), ossl_cmp_warn(), ossl_cmp_info(), and
|
||||
ossl_cmp_debug() output a simple alert/error/warning/info/debug message
|
||||
via ossl_cmp_print_log().
|
||||
|
||||
ossl_cmp_log(), ossl_cmp_log1(), ossl_cmp_log2(), ossl_cmp_log3(), and
|
||||
ossl_cmp_log4() output a log message with the given severity,
|
||||
constructing the message text from the given format and arguments.
|
||||
|
||||
ossl_cmp_log_parse_metadata() parses the given message buffer I<buf> populated
|
||||
by ossl_cmp_log() etc.
|
||||
according to the pattern OSSL_CMP_LOG_START#level ": %s\n", filling in
|
||||
the variable pointed to by I<level> with the severity level or -1,
|
||||
the variable pointed to by I<func> with the function name string or NULL,
|
||||
the variable pointed to by I<file> with the filename string or NULL, and
|
||||
the variable pointed to by I<line> with the line number or -1.
|
||||
Any string returned via I<*func> and I<*file> must be freeed by the caller.
|
||||
|
||||
ossl_cmp_add_error_data() is a macro calling
|
||||
L<ERR_add_error_txt(3)> with the separator being ":".
|
||||
|
||||
ossl_cmp_add_error_line() is a macro calling
|
||||
L<ERR_add_error_txt(3)> with the separator being "\n".
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
ossl_cmp_log_parse_metadata() returns the pointer to the actual message text
|
||||
after the OSSL_CMP_LOG_PREFIX and level and ':' if found in the buffer,
|
||||
else the beginning of the buffer.
|
||||
|
||||
ossl_cmp_add_error_data() and
|
||||
ossl_cmp_add_error_line()
|
||||
do not return anything.
|
||||
|
||||
All other functions return 1 on success, 0 on error.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ERR_add_error_txt(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The OpenSSL CMP support was added in OpenSSL 3.0.
|
||||
|
||||
=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
|
||||
@@ -15,9 +15,9 @@ ossl_cmp_X509_STORE_get1_certs
|
||||
int ossl_cmp_sk_X509_add1_cert(STACK_OF(X509) *sk, X509 *cert,
|
||||
int no_dup, int prepend);
|
||||
int ossl_cmp_sk_X509_add1_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs,
|
||||
int no_self_signed, int no_dups, int prepend);
|
||||
int no_self_issued, int no_dups, int prepend);
|
||||
int ossl_cmp_X509_STORE_add1_certs(X509_STORE *store, STACK_OF(X509) *certs,
|
||||
int only_self_signed);
|
||||
int only_self_issued);
|
||||
STACK_OF(X509) *ossl_cmp_X509_STORE_get1_certs(X509_STORE *store);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
@@ -29,10 +29,10 @@ On success the reference count of the certificate is increased.
|
||||
|
||||
ossl_cmp_sk_X509_add1_certs() appends or prepends (depending on the I<prepend>
|
||||
argument) a list of certificates to the given list,
|
||||
optionally only if not self-signed and optionally only if not already contained.
|
||||
optionally only if not self-issued and optionally only if not already contained.
|
||||
The reference counts of those certificates appended successfully are increased.
|
||||
|
||||
ossl_cmp_X509_STORE_add1_certs() adds all or only self-signed certificates from
|
||||
ossl_cmp_X509_STORE_add1_certs() adds all or only self-issued certificates from
|
||||
the given stack to given store. The I<certs> parameter may be NULL.
|
||||
|
||||
ossl_cmp_X509_STORE_get1_certs() retrieves a copy of all certificates in the
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ossl_param_bld_init, ossl_param_bld_to_param, ossl_param_bld_to_param_ex,
|
||||
ossl_param_bld_init, ossl_param_bld_to_param,
|
||||
ossl_param_bld_free, ossl_param_bld_push_int, ossl_param_bld_push_uint,
|
||||
ossl_param_bld_push_long, ossl_param_bld_push_ulong,
|
||||
ossl_param_bld_push_int32, ossl_param_bld_push_uint32,
|
||||
@@ -24,10 +24,6 @@ ossl_param_bld_push_octet_string, ossl_param_bld_push_octet_ptr
|
||||
|
||||
void ossl_param_bld_init(OSSL_PARAM_BLD *bld);
|
||||
OSSL_PARAM *ossl_param_bld_to_param(OSSL_PARAM_BLD *bld);
|
||||
OSSL_PARAM *ossl_param_bld_to_param_ex(OSSL_PARAM_BLD *bld,
|
||||
OSSL_PARAM *params, size_t param_n,
|
||||
void *data, size_t data_n,
|
||||
void *secure, size_t secure_n);
|
||||
void ossl_param_bld_free(OSSL_PARAM *params);
|
||||
|
||||
int ossl_param_bld_push_TYPE(OSSL_PARAM_BLD *bld, const char *key, TYPE val);
|
||||
@@ -64,14 +60,6 @@ ossl_param_bld_free() with the functions return value.
|
||||
ossl_param_bld_free() deallocates the memory allocated by
|
||||
ossl_param_bld_to_param().
|
||||
|
||||
ossl_param_bld_to_param_ex() behaves like ossl_param_bld_to_param(), except that
|
||||
no additional memory is allocated.
|
||||
An OSSL_PARAM array of at least I<param_n> elements is passed in as I<params>.
|
||||
The auxiliary storage for the parameters is a block of memory pointed to
|
||||
by I<data> of at least I<data_n> bytes in size.
|
||||
If required, secure memory for private BIGNUMs should be pointed to by
|
||||
I<secure> of at least I<secure_n> bytes in size.
|
||||
|
||||
=begin comment
|
||||
|
||||
POD is pretty good at recognising function names and making them appropriately
|
||||
@@ -125,8 +113,8 @@ scope until the OSSL_PARAM array is freed.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
ossl_param_bld_to_param() and ossl_param_bld_to_param_ex() return the
|
||||
allocated OSSL_PARAM array, or NULL on error.
|
||||
ossl_param_bld_to_param() returns the allocated OSSL_PARAM array, or NULL
|
||||
on error.
|
||||
|
||||
All of the ossl_param_bld_push_TYPE functions return 1 on success and 0
|
||||
on error.
|
||||
|
||||
@@ -29,6 +29,9 @@ B<openssl dhparam>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This command has been deprecated.
|
||||
The L<openssl-pkeyparam(1)> command should be used instead.
|
||||
|
||||
This command is used to manipulate DH parameter files.
|
||||
|
||||
=head1 OPTIONS
|
||||
@@ -125,8 +128,13 @@ There should be a way to generate and manipulate DH keys.
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<openssl(1)>,
|
||||
L<openssl-pkeyparam(1)>,
|
||||
L<openssl-dsaparam(1)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
This command was deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -42,6 +42,9 @@ B<openssl> B<dsa>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This command has been deprecated.
|
||||
The L<openssl-pkey(1)> command should be used instead.
|
||||
|
||||
This command processes DSA keys. They can be converted between various
|
||||
forms and their components printed out. B<Note> This command uses the
|
||||
traditional SSLeay compatible format for private key encryption: newer
|
||||
@@ -147,11 +150,16 @@ To just output the public part of a private key:
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<openssl(1)>,
|
||||
L<openssl-pkey(1)>,
|
||||
L<openssl-dsaparam(1)>,
|
||||
L<openssl-gendsa(1)>,
|
||||
L<openssl-rsa(1)>,
|
||||
L<openssl-genrsa(1)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
This command was deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -24,6 +24,9 @@ B<openssl dsaparam>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This command has been deprecated.
|
||||
The L<openssl-pkeyparam(1)> command should be used instead.
|
||||
|
||||
This command is used to manipulate or generate DSA parameter files.
|
||||
|
||||
DSA parameter generation can be a slow process and as a result the same set of
|
||||
@@ -95,11 +98,16 @@ the input file (if any) is ignored.
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<openssl(1)>,
|
||||
L<openssl-pkeyparam(1)>,
|
||||
L<openssl-gendsa(1)>,
|
||||
L<openssl-dsa(1)>,
|
||||
L<openssl-genrsa(1)>,
|
||||
L<openssl-rsa(1)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
This command was deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -32,6 +32,9 @@ B<openssl> B<gendsa>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This command has been deprecated.
|
||||
The L<openssl-genpkey(1)> command should be used instead.
|
||||
|
||||
This command generates a DSA private key from a DSA parameter file
|
||||
(which will be typically generated by the L<openssl-dsaparam(1)> command).
|
||||
|
||||
@@ -83,11 +86,16 @@ much quicker that RSA key generation for example.
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<openssl(1)>,
|
||||
L<openssl-genpkey(1)>,
|
||||
L<openssl-dsaparam(1)>,
|
||||
L<openssl-dsa(1)>,
|
||||
L<openssl-genrsa(1)>,
|
||||
L<openssl-rsa(1)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
This command was deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -45,7 +45,7 @@ B<openssl> B<x509>
|
||||
[B<-setalias> I<arg>]
|
||||
[B<-days> I<arg>]
|
||||
[B<-set_serial> I<n>]
|
||||
[B<-signkey> I<filename>]
|
||||
[B<-signkey> I<arg>]
|
||||
[B<-badsig>]
|
||||
[B<-passin> I<arg>]
|
||||
[B<-x509toreq>]
|
||||
@@ -348,10 +348,11 @@ can thus behave like a "mini CA".
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<-signkey> I<filename>
|
||||
=item B<-signkey> I<arg>
|
||||
|
||||
This option causes the input file to be self signed using the supplied
|
||||
private key.
|
||||
private key or engine. The private key's format is specified with the
|
||||
B<-keyform> option.
|
||||
|
||||
It sets the issuer name to the subject name (i.e., makes it self-issued)
|
||||
and changes the public key to the supplied value (unless overridden by
|
||||
|
||||
@@ -49,10 +49,20 @@ is expanded.
|
||||
|
||||
These functions, other than BIO_f_buffer(), are implemented as macros.
|
||||
|
||||
Buffering BIOs implement BIO_gets() by using BIO_read_ex() operations on the
|
||||
next BIO in the chain. By prepending a buffering BIO to a chain it is therefore
|
||||
possible to provide BIO_gets() functionality if the following BIOs do not
|
||||
support it (for example SSL BIOs).
|
||||
Buffering BIOs implement BIO_read_ex() and BIO_gets() by using
|
||||
BIO_read_ex() operations on the next BIO in the chain and storing the
|
||||
result in an internal buffer, from which bytes are given back to the
|
||||
caller as appropriate for the call; a BIO_gets() is guaranteed to give
|
||||
the caller a whole line, and BIO_read_ex() is guaranteed to give the
|
||||
caller the number of bytes it asks for, unless there's an error or end
|
||||
of communication is reached in the next BIO. By prepending a
|
||||
buffering BIO to a chain it is therefore possible to provide
|
||||
BIO_gets() or exact size BIO_read_ex() functionality if the following
|
||||
BIOs do not support it.
|
||||
|
||||
Do not add more than one BIO_f_buffer() to a BIO chain. The result of
|
||||
doing so will force a full read of the size of the internal buffer of
|
||||
the top BIO_f_buffer(), which is 4 KiB at a minimum.
|
||||
|
||||
Data is only written to the next BIO in the chain when the write buffer fills
|
||||
or when BIO_flush() is called. It is therefore important to call BIO_flush()
|
||||
|
||||
@@ -16,6 +16,10 @@ DSA_meth_set_keygen - Routines to build up DSA methods
|
||||
|
||||
#include <openssl/dsa.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)>:
|
||||
|
||||
DSA_METHOD *DSA_meth_new(const char *name, int flags);
|
||||
|
||||
void DSA_meth_free(DSA_METHOD *dsam);
|
||||
@@ -86,6 +90,10 @@ DSA_meth_set_keygen - Routines to build up DSA methods
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
All of the functions described on this page are deprecated.
|
||||
Applications and extension implementations should instead use the
|
||||
OSSL_PROVIDER APIs.
|
||||
|
||||
The B<DSA_METHOD> type is a structure used for the provision of custom DSA
|
||||
implementations. It provides a set of functions used by OpenSSL for the
|
||||
implementation of the various DSA capabilities.
|
||||
@@ -200,11 +208,13 @@ L<DSA_sign(3)>, L<DSA_size(3)>, L<DSA_get0_pqg(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The functions described here were deprecated in OpenSSL 3.0.
|
||||
|
||||
The functions described here were added in OpenSSL 1.1.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2016-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
|
||||
|
||||
@@ -8,12 +8,20 @@ DSA_size, DSA_bits, DSA_security_bits - get DSA signature size, key bits or secu
|
||||
|
||||
#include <openssl/dsa.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 DSA_size(const DSA *dsa);
|
||||
int DSA_bits(const DSA *dsa);
|
||||
int DSA_security_bits(const DSA *dsa);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
All of the functions described on this page are deprecated.
|
||||
Applications should instead use L<EVP_PKEY_bits(3)>,
|
||||
L<EVP_PKEY_security_bits(3)> and L<EVP_PKEY_size(3)>.
|
||||
|
||||
DSA_size() returns the maximum size of an ASN.1 encoded DSA signature
|
||||
for key B<dsa> in bytes. It can be used to determine how much memory must
|
||||
be allocated for a DSA signature.
|
||||
@@ -34,8 +42,15 @@ DSA_bits() returns the number of bits in the key.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_PKEY_bits(3)>,
|
||||
L<EVP_PKEY_security_bits(3)>,
|
||||
L<EVP_PKEY_size(3)>,
|
||||
L<DSA_new(3)>, L<DSA_sign(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
All of these functions were deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
=head1 NAME
|
||||
|
||||
ERR_raise, ERR_raise_data,
|
||||
ERR_put_error, ERR_add_error_data, ERR_add_error_vdata
|
||||
ERR_put_error, ERR_add_error_data, ERR_add_error_vdata,
|
||||
ERR_add_error_txt, ERR_add_error_mem_bio
|
||||
- record an error
|
||||
|
||||
=head1 SYNOPSIS
|
||||
@@ -15,6 +16,8 @@ ERR_put_error, ERR_add_error_data, ERR_add_error_vdata
|
||||
|
||||
void ERR_add_error_data(int num, ...);
|
||||
void ERR_add_error_vdata(int num, va_list arg);
|
||||
void ERR_add_error_txt(const char *sep, const char *txt);
|
||||
void ERR_add_error_mem_bio(const char *sep, BIO *bio);
|
||||
|
||||
Deprecated since OpenSSL 3.0:
|
||||
|
||||
@@ -38,9 +41,23 @@ B<func> of library B<lib>, in line number B<line> of B<file>.
|
||||
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.
|
||||
arguments as additional data 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.
|
||||
The total length of the string data per error is limited to 4096 characters.
|
||||
|
||||
ERR_add_error_txt() appends the given text string as additional data to the
|
||||
last error queue entry, after inserting the optional separator string if it is
|
||||
not NULL and the top error entry does not yet have additional data.
|
||||
In case the separator is at the end of the text it is not appended to the data.
|
||||
The B<sep> argument may be for instance "\n" to insert a line break when needed.
|
||||
If the associated data would become more than 4096 characters long
|
||||
(which is the limit given above)
|
||||
it is split over sufficiently many new copies of the last error queue entry.
|
||||
|
||||
ERR_add_error_mem_bio() is the same as ERR_add_error_txt() except that
|
||||
the text string is taken from the given memory BIO.
|
||||
It appends '\0' to the BIO contents if not already NUL-terminated.
|
||||
|
||||
L<ERR_load_strings(3)> can be used to register
|
||||
error strings so that the application can a generate human-readable
|
||||
@@ -76,8 +93,10 @@ the ASN1err() macro.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
ERR_raise(), ERR_put_error(), ERR_add_error_data() and
|
||||
ERR_add_error_vdata() return no values.
|
||||
ERR_raise(), ERR_put_error(),
|
||||
ERR_add_error_data(), ERR_add_error_vdata()
|
||||
ERR_add_error_txt(), and ERR_add_error_mem_bio()
|
||||
return no values.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
@@ -87,6 +106,10 @@ ERR_raise() and ERR_put_error() are implemented as macros.
|
||||
|
||||
L<ERR_load_strings(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
B<ERR_add_error_txt> and B<ERR_add_error_mem_bio> were added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -4,16 +4,6 @@
|
||||
|
||||
OSSL_CMP_log_open,
|
||||
OSSL_CMP_log_close,
|
||||
OSSL_CMP_alert,
|
||||
OSSL_CMP_err,
|
||||
OSSL_CMP_warn,
|
||||
OSSL_CMP_info,
|
||||
OSSL_CMP_debug,
|
||||
OSSL_CMP_log,
|
||||
OSSL_CMP_log1,
|
||||
OSSL_CMP_log2,
|
||||
OSSL_CMP_log3,
|
||||
OSSL_CMP_log4,
|
||||
OSSL_CMP_severity,
|
||||
OSSL_CMP_LOG_EMERG,
|
||||
OSSL_CMP_LOG_ALERT,
|
||||
@@ -24,6 +14,7 @@ OSSL_CMP_LOG_NOTICE,
|
||||
OSSL_CMP_LOG_INFO,
|
||||
OSSL_CMP_LOG_DEBUG,
|
||||
OSSL_cmp_log_cb_t,
|
||||
OSSL_CMP_print_to_bio,
|
||||
OSSL_CMP_print_errors_cb
|
||||
- functions for logging and error reporting
|
||||
|
||||
@@ -33,16 +24,6 @@ OSSL_CMP_print_errors_cb
|
||||
|
||||
int OSSL_CMP_log_open(void);
|
||||
void OSSL_CMP_log_close(void);
|
||||
#define OSSL_CMP_alert(msg)
|
||||
#define OSSL_CMP_err(msg)
|
||||
#define OSSL_CMP_warn(msg)
|
||||
#define OSSL_CMP_info(msg)
|
||||
#define OSSL_CMP_debug(msg)
|
||||
#define OSSL_CMP_log(level, msg)
|
||||
#define OSSL_CMP_log1(level, fmt, arg1)
|
||||
#define OSSL_CMP_log2(level, fmt, arg1, arg2)
|
||||
#define OSSL_CMP_log3(level, fmt, arg1, arg2, arg3)
|
||||
#define OSSL_CMP_log4(level, fmt, arg1, arg2, arg3, arg4)
|
||||
|
||||
/* severity level declarations resemble those from syslog.h */
|
||||
typedef int OSSL_CMP_severity;
|
||||
@@ -54,16 +35,18 @@ OSSL_CMP_print_errors_cb
|
||||
#define OSSL_CMP_LOG_NOTICE 5
|
||||
#define OSSL_CMP_LOG_INFO 6
|
||||
#define OSSL_CMP_LOG_DEBUG 7
|
||||
|
||||
typedef int (*OSSL_cmp_log_cb_t)(const char *component,
|
||||
const char *file, int line,
|
||||
OSSL_CMP_severity level, const char *msg);
|
||||
|
||||
int OSSL_CMP_print_to_bio(BIO *bio, const char *component, const char *file,
|
||||
int line, OSSL_CMP_severity level, const char *msg);
|
||||
void OSSL_CMP_print_errors_cb(OSSL_cmp_log_cb_t log_fn);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The logging and error reporting facility described here contains
|
||||
convenience functions for CMP-specific logging via the trace API,
|
||||
convenience functions for CMP-specific logging,
|
||||
including a string prefix mirroring the severity levels of syslog.h,
|
||||
and enhancements of the error queue mechanism needed for large diagnostic
|
||||
messages produced by the CMP library in case of certificate validation failures.
|
||||
@@ -73,12 +56,12 @@ should be provided for user information, debugging, and auditing purposes.
|
||||
A CMP application can obtain this information by providing a callback function
|
||||
with the following type:
|
||||
|
||||
typedef void (*OSSL_cmp_log_cb_t)(const char *component,
|
||||
const char *file, int line,
|
||||
OSSL_CMP_severity level, const char *msg);
|
||||
typedef int (*OSSL_cmp_log_cb_t)(const char *component,
|
||||
const char *file, int line,
|
||||
OSSL_CMP_severity level, const char *msg);
|
||||
|
||||
The parameters may provide
|
||||
a component identifier (which may be a library name or function name) or NULL,
|
||||
some component info (which may be a module name and/or function name) or NULL,
|
||||
a file pathname or NULL,
|
||||
a line number or 0 indicating the source code location,
|
||||
a severity level, and
|
||||
@@ -105,19 +88,15 @@ OSSL_CMP_log_close() may be called when all activities are finished to flush
|
||||
any pending CMP-specific log output and deallocate related resources.
|
||||
It may be called multiple times. It does get called at OpenSSL stutdown.
|
||||
|
||||
OSSL_CMP_alert() outputs a simple alert message via the trace API.
|
||||
OSSL_CMP_err() outputs a simple error message via the trace API.
|
||||
OSSL_CMP_warn() outputs a simple warning message via the trace API.
|
||||
OSSL_CMP_info() outputs a simple info message via the trace API.
|
||||
OSSL_CMP_debug() outputs a simple debug message via the trace API.
|
||||
|
||||
Note that due to the design of the trace API used, the log functions have no
|
||||
effect unless the B<enable-trace> option is used during build configuration.
|
||||
OSSL_CMP_print_to_bio() prints the given component info, filename, line number,
|
||||
severity level, and log message or error queue message to the given B<bio>.
|
||||
B<component> usually is a function or module name.
|
||||
If it is NULL, empty, or "(unknown function)" then "CMP" is used as fallback.
|
||||
|
||||
OSSL_CMP_print_errors_cb() outputs any entries in the OpenSSL error queue.
|
||||
It is similar to B<ERR_print_errors_cb()> but uses the CMP log callback function
|
||||
C<log_fn> for uniformity with CMP logging if not B<NULL>. Otherwise it uses
|
||||
B<ERR_print_errors(3)> to print to STDERR (unless OPENSSL_NO_STDIO is defined).
|
||||
C<log_fn> for uniformity with CMP logging if not B<NULL>. Otherwise it prints to
|
||||
STDERR using B<OSSL_CMP_print_to_bio(3)> (unless OPENSSL_NO_STDIO is defined).
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_CMP_validate_msg,
|
||||
OSSL_CMP_validate_cert_path
|
||||
- functions for verifying CMP message protection
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/cmp.h>
|
||||
int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
|
||||
int OSSL_CMP_validate_cert_path(const OSSL_CMP_CTX *ctx,
|
||||
X509_STORE *trusted_store, X509 *cert);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This is the API for validating the protection of CMP messages,
|
||||
which includes validating CMP message sender certificates and their paths
|
||||
while optionally checking the revocation status of the certificates(s).
|
||||
|
||||
OSSL_CMP_validate_msg() validates the protection of the given C<msg>
|
||||
using either password-based mac (PBM) or a signature algorithm.
|
||||
|
||||
In case of signature algorithm, the certificate to use for the signature check
|
||||
is preferably the one provided by a call to L<OSSL_CMP_CTX_set1_srvCert(3)>.
|
||||
If no such sender cert has been pinned then candidate sender certificates are
|
||||
taken from the list of certificates received in the C<msg> extraCerts, then any
|
||||
certificates provided before via L<OSSL_CMP_CTX_set1_untrusted_certs(3)>, and
|
||||
then all trusted certificates provided via L<OSSL_CMP_CTX_set0_trustedStore(3)>,
|
||||
where a candidate is acceptable only if has not expired, its subject DN matches
|
||||
the C<msg> sender DN (as far as present), and its subject key identifier
|
||||
is present and matches the senderKID (as far as the latter present).
|
||||
Each acceptable cert is tried in the given order to see if the message
|
||||
signature check succeeds and the cert and its path can be verified
|
||||
using any trust store set via L<OSSL_CMP_CTX_set0_trustedStore(3)>.
|
||||
|
||||
If the option OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR was set by calling
|
||||
L<OSSL_CMP_CTX_set_option(3)>, for an Initialization Response (IP) message
|
||||
any self-issued certificate from the C<msg> extraCerts field may also be used
|
||||
as trust anchor for the path verification of an acceptable cert if it can be
|
||||
used also to validate the issued certificate returned in the IP message. This is
|
||||
according to TS 33.310 [Network Domain Security (NDS); Authentication Framework
|
||||
(AF)] document specified by the The 3rd Generation Partnership Project (3GPP).
|
||||
|
||||
Any cert that has been found as described above is cached and tried first when
|
||||
validating the signatures of subsequent messages in the same transaction.
|
||||
|
||||
After successful validation of PBM-based protection of a certificate response
|
||||
the certificates in the caPubs field (if any) are added to the trusted
|
||||
certificates provided via L<OSSL_CMP_CTX_set0_trustedStore(3)>, such that
|
||||
they are available for validating subsequent messages in the same context.
|
||||
Those could apply to any Polling Response (pollRep), error, or PKI Confirmation
|
||||
(PKIConf) messages following in the same or future transactions.
|
||||
|
||||
OSSL_CMP_validate_cert_path() attempts to validate the given certificate and its
|
||||
path using the given store of trusted certs (possibly including CRLs and a cert
|
||||
verification callback) and non-trusted intermediate certs from the B<ctx>.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
CMP is defined in RFC 4210 (and CRMF in RFC 4211).
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OSSL_CMP_validate_msg() and OSSL_CMP_validate_cert_path()
|
||||
return 1 on success, 0 on error or validation failed.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<OSSL_CMP_CTX_new(3)>, L<OSSL_CMP_exec_IR_ses(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The OpenSSL CMP support was added in OpenSSL 3.0.
|
||||
|
||||
=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
|
||||
+3
-12
@@ -2,18 +2,13 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_PARAM_construct_from_text, OSSL_PARAM_allocate_from_text
|
||||
OSSL_PARAM_allocate_from_text
|
||||
- OSSL_PARAM construction utilities
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/params.h>
|
||||
|
||||
int OSSL_PARAM_construct_from_text(OSSL_PARAM *to,
|
||||
const OSSL_PARAM *paramdefs,
|
||||
const char *key, const char *value,
|
||||
size_t value_n,
|
||||
void *buf, size_t *buf_n)
|
||||
int OSSL_PARAM_allocate_from_text(OSSL_PARAM *to,
|
||||
const OSSL_PARAM *paramdefs,
|
||||
const char *key, const char *value,
|
||||
@@ -30,7 +25,7 @@ OpenSSL 3.0 introduces a new mechanism to do the same thing with an
|
||||
array of parameters that contain name, value, value type and value
|
||||
size (see L<OSSL_PARAM(3)> for more information).
|
||||
|
||||
OSSL_PARAM_construct_from_text() takes a control I<key>, I<value> and
|
||||
OSSL_PARAM_allocate_from_text() takes a control I<key>, I<value> and
|
||||
value size I<value_n>, and given a parameter descriptor array
|
||||
I<paramdefs>, it converts the value to something suitable for
|
||||
L<OSSL_PARAM(3)> and stores that in the buffer I<buf>, and modifies
|
||||
@@ -42,9 +37,6 @@ left untouched, allowing a caller to find out how large the buffer
|
||||
should be.
|
||||
I<buf> needs to be correctly aligned for the type of the B<OSSL_PARAM>
|
||||
I<key>.
|
||||
|
||||
OSSL_PARAM_allocate_from_text() works like OSSL_PARAM_construct_from_text(),
|
||||
except it allocates the buffer internally.
|
||||
The caller must remember to free the data of I<to> when it's not
|
||||
useful any more.
|
||||
|
||||
@@ -57,8 +49,7 @@ as parameter value.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OSSL_PARAM_construct_from_text() and OSSL_PARAM_allocate_from_text()
|
||||
returns 1 on success, and 0 on error.
|
||||
OSSL_PARAM_allocate_from_text() returns 1 on success, and 0 on error.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
@@ -10,6 +10,9 @@ OSSL_SERIALIZER_CTX_set_passphrase_ui,
|
||||
OSSL_SERIALIZER_PUBKEY_TO_PEM_PQ,
|
||||
OSSL_SERIALIZER_PrivateKey_TO_PEM_PQ,
|
||||
OSSL_SERIALIZER_Parameters_TO_PEM_PQ,
|
||||
OSSL_SERIALIZER_PUBKEY_TO_DER_PQ,
|
||||
OSSL_SERIALIZER_PrivateKey_TO_DER_PQ,
|
||||
OSSL_SERIALIZER_Parameters_TO_DER_PQ,
|
||||
OSSL_SERIALIZER_PUBKEY_TO_TEXT_PQ,
|
||||
OSSL_SERIALIZER_PrivateKey_TO_TEXT_PQ,
|
||||
OSSL_SERIALIZER_Parameters_TO_TEXT_PQ
|
||||
@@ -38,6 +41,10 @@ OSSL_SERIALIZER_Parameters_TO_TEXT_PQ
|
||||
#define OSSL_SERIALIZER_PrivateKey_TO_PEM_PQ "format=pem,type=private"
|
||||
#define OSSL_SERIALIZER_Parameters_TO_PEM_PQ "format=pem,type=parameters"
|
||||
|
||||
#define OSSL_SERIALIZER_PUBKEY_TO_DER_PQ "format=der,type=public"
|
||||
#define OSSL_SERIALIZER_PrivateKey_TO_DER_PQ "format=der,type=private"
|
||||
#define OSSL_SERIALIZER_Parameters_TO_DER_PQ "format=der,type=parameters"
|
||||
|
||||
#define OSSL_SERIALIZER_PUBKEY_TO_TEXT_PQ "format=text,type=public"
|
||||
#define OSSL_SERIALIZER_PrivateKey_TO_TEXT_PQ "format=text,type=private"
|
||||
#define OSSL_SERIALIZER_Parameters_TO_TEXT_PQ "format=text,type=parameters"
|
||||
@@ -84,11 +91,14 @@ through an internal B<OSSL_PASSPHRASE_CALLBACK> function.
|
||||
The macros B<OSSL_SERIALIZER_PUBKEY_TO_PEM_PQ>,
|
||||
B<OSSL_SERIALIZER_PrivateKey_TO_PEM_PQ>,
|
||||
B<OSSL_SERIALIZER_Parameters_TO_PEM_PQ>,
|
||||
B<OSSL_SERIALIZER_PUBKEY_TO_DER_PQ>,
|
||||
B<OSSL_SERIALIZER_PrivateKey_TO_DER_PQ>,
|
||||
B<OSSL_SERIALIZER_Parameters_TO_DER_PQ>,
|
||||
B<OSSL_SERIALIZER_PUBKEY_TO_TEXT_PQ>,
|
||||
B<OSSL_SERIALIZER_PrivateKey_TO_TEXT_PQ>,
|
||||
B<OSSL_SERIALIZER_Parameters_TO_TEXT_PQ> are convenience macros with
|
||||
property queries to serialize the B<EVP_PKEY> as a public key, private
|
||||
key or parameters to B<PEM>, or to text.
|
||||
key or parameters to B<PEM>, to B<DER>, or to text.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
|
||||
+23
-1
@@ -10,11 +10,19 @@ DHparams_print, DHparams_print_fp - print cryptographic parameters
|
||||
|
||||
#include <openssl/rsa.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 RSA_print(BIO *bp, RSA *x, int offset);
|
||||
int RSA_print_fp(FILE *fp, RSA *x, int offset);
|
||||
|
||||
#include <openssl/dsa.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 DSAparams_print(BIO *bp, DSA *x);
|
||||
int DSAparams_print_fp(FILE *fp, DSA *x);
|
||||
int DSA_print(BIO *bp, DSA *x, int offset);
|
||||
@@ -22,11 +30,19 @@ DHparams_print, DHparams_print_fp - print cryptographic parameters
|
||||
|
||||
#include <openssl/dh.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 DHparams_print(BIO *bp, DH *x);
|
||||
int DHparams_print_fp(FILE *fp, DH *x);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
All of the functions described on this page are deprecated.
|
||||
Applications should instead use L<EVP_PKEY_print_params(3)> and
|
||||
L<EVP_PKEY_print_private(3)>.
|
||||
|
||||
A human-readable hexadecimal output of the components of the RSA
|
||||
key, DSA parameters or key or DH parameters is printed to B<bp> or B<fp>.
|
||||
|
||||
@@ -38,7 +54,13 @@ These functions return 1 on success, 0 on error.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<BN_bn2bin(3)>
|
||||
L<EVP_PKEY_print_params(3)>,
|
||||
L<EVP_PKEY_print_private(3)>,
|
||||
L<BN_bn2bin(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
All of these functions were deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
|
||||
@@ -14,14 +14,16 @@ X509_STORE_CTX_get_check_issued,
|
||||
X509_STORE_CTX_get_get_issuer,
|
||||
X509_STORE_CTX_get_verify_cb,
|
||||
X509_STORE_CTX_set_verify_cb,
|
||||
X509_STORE_CTX_verify_cb
|
||||
- get and set verification callback
|
||||
X509_STORE_CTX_verify_cb,
|
||||
X509_STORE_CTX_print_verify_cb
|
||||
- get and set X509_STORE_CTX components such as verification callback
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/x509_vfy.h>
|
||||
|
||||
typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *);
|
||||
int X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx);
|
||||
|
||||
X509_STORE_CTX_verify_cb X509_STORE_CTX_get_verify_cb(X509_STORE_CTX *ctx);
|
||||
|
||||
@@ -63,6 +65,12 @@ structure and receive additional information about the error, for example
|
||||
by calling X509_STORE_CTX_get_current_cert(). Additional application data can
|
||||
be passed to the callback via the B<ex_data> mechanism.
|
||||
|
||||
X509_STORE_CTX_print_verify_cb() is a verification callback function that,
|
||||
when a certificate verification has failed, adds an entry to the error queue
|
||||
with code B<X509_R_CERTIFICATE_VERIFICATION_FAILED> and with diagnostic details,
|
||||
including the most relevant fields of the target certificate that failed to
|
||||
verify and, if appropriate, of the available untrusted and trusted certificates.
|
||||
|
||||
X509_STORE_CTX_get_verify_cb() returns the value of the current callback
|
||||
for the specific B<ctx>.
|
||||
|
||||
@@ -200,6 +208,8 @@ X509_STORE_CTX_get_cert_crl(), X509_STORE_CTX_get_check_policy(),
|
||||
X509_STORE_CTX_get_lookup_certs(), X509_STORE_CTX_get_lookup_crls()
|
||||
and X509_STORE_CTX_get_cleanup() functions were added in OpenSSL 1.1.0.
|
||||
|
||||
X509_STORE_CTX_print_verify_cb() was added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2009-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
=head1 NAME
|
||||
|
||||
X509_STORE_get0_param, X509_STORE_set1_param,
|
||||
X509_STORE_get0_objects - X509_STORE setter and getter functions
|
||||
X509_STORE_get0_objects, X509_STORE_get1_all_certs
|
||||
- X509_STORE setter and getter functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -12,6 +13,7 @@ X509_STORE_get0_objects - X509_STORE setter and getter functions
|
||||
X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx);
|
||||
int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm);
|
||||
STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *ctx);
|
||||
STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *st);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@@ -22,10 +24,12 @@ X509_STORE_get0_param() retrieves an internal pointer to the verification
|
||||
parameters for B<ctx>. The returned pointer must not be freed by the
|
||||
calling application
|
||||
|
||||
X509_STORE_get0_objects() retrieve an internal pointer to the store's
|
||||
X509_STORE_get0_objects() retrieves an internal pointer to the store's
|
||||
X509 object cache. The cache contains B<X509> and B<X509_CRL> objects. The
|
||||
returned pointer must not be freed by the calling application.
|
||||
|
||||
X509_STORE_get1_all_certs() returns a list of all certificates in the store.
|
||||
The caller is responsible for freeing the returned list.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
@@ -36,6 +40,9 @@ X509_STORE_set1_param() returns 1 for success and 0 for failure.
|
||||
|
||||
X509_STORE_get0_objects() returns a pointer to a stack of B<X509_OBJECT>.
|
||||
|
||||
X509_STORE_get1_all_certs() returns a pointer to a stack of the retrieved
|
||||
certificates on success, else NULL.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<X509_STORE_new(3)>
|
||||
@@ -44,6 +51,7 @@ L<X509_STORE_new(3)>
|
||||
|
||||
B<X509_STORE_get0_param> and B<X509_STORE_get0_objects> were added in
|
||||
OpenSSL 1.1.0.
|
||||
B<X509_STORE_get1_certs> was added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user