Latest update (add quic)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
ossl_cmp_hdr_set_pvno,
|
||||
ossl_cmp_hdr_get_pvno,
|
||||
ossl_cmp_hdr_get_protection_nid,
|
||||
ossl_cmp_hdr_get0_sendernonce,
|
||||
ossl_cmp_general_name_is_NULL_DN,
|
||||
ossl_cmp_hdr_set1_sender,
|
||||
@@ -25,6 +26,7 @@ ossl_cmp_hdr_init
|
||||
|
||||
int ossl_cmp_hdr_set_pvno(OSSL_CMP_PKIHEADER *hdr, int pvno);
|
||||
int ossl_cmp_hdr_get_pvno(const OSSL_CMP_PKIHEADER *hdr);
|
||||
int ossl_cmp_hdr_get_protection_nid(const OSSL_CMP_PKIHEADER *hdr);
|
||||
ASN1_OCTET_STRING
|
||||
*ossl_cmp_hdr_get0_sendernonce(const OSSL_CMP_PKIHEADER *hdr);
|
||||
int ossl_cmp_general_name_is_NULL_DN(GENERAL_NAME *name);
|
||||
@@ -52,6 +54,9 @@ ossl_cmp_hdr_set_pvno() sets hdr->pvno to the given B<pvno>.
|
||||
|
||||
ossl_cmp_hdr_get_pvno() returns the pvno of the given B<hdr> or -1 on error.
|
||||
|
||||
ossl_cmp_hdr_get_protection_nid returns the NID of the protection algorithm
|
||||
in B<hdr> or NID_undef on error.
|
||||
|
||||
ossl_cmp_hdr_get0_sendernonce() returns the sender nonce of the given PKIHeader.
|
||||
|
||||
ossl_cmp_general_name_is_NULL_DN() determines if the given GENERAL_NAME
|
||||
@@ -110,7 +115,9 @@ CMP is defined in RFC 4210 (and CRMF in RFC 4211).
|
||||
|
||||
ossl_cmp_hdr_get_pvno() returns the pvno of the given B<hdr> or -1 on error.
|
||||
|
||||
ossl_cmp_hdr_get0_sendernonce() returns the respective nonce.
|
||||
ossl_cmp_hdr_get_protection_nid returns the respective NID, NID_undef on error.
|
||||
|
||||
ossl_cmp_hdr_get0_sendernonce() returns the respective nonce, or NULL.
|
||||
|
||||
ossl_cmp_general_name_is_NULL_DN() returns 1 given a NULL-DN, else 0.
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ossl_cmp_allow_unprotected_cb_t,
|
||||
ossl_cmp_msg_check_received
|
||||
- does all checks on a received CMP message that can be done generically
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include "cmp_local.h"
|
||||
|
||||
typedef int (*ossl_cmp_allow_unprotected_cb_t)(const OSSL_CMP_CTX *ctx,
|
||||
const OSSL_CMP_MSG *msg,
|
||||
int invalid_protection, int arg);
|
||||
|
||||
int ossl_cmp_msg_check_received(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg,
|
||||
ossl_cmp_allow_unprotected_cb_t cb, int cb_arg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
ossl_cmp_msg_check_received() checks the given message B<msg>,
|
||||
which may be a server response or a request by some client.
|
||||
|
||||
It is ensured for the B<msg> that
|
||||
|
||||
=over 4
|
||||
|
||||
=item it has a valid body type,
|
||||
|
||||
=item its protection is present and valid (or a callback function B<cb>
|
||||
is present and indicates that a missing or invalid protection is acceptable),
|
||||
|
||||
=item its recipNonce matches any previous senderNonce stored in B<ctx>, and
|
||||
|
||||
=item its transaction ID matches any previous transaction ID stored in B<ctx>.
|
||||
|
||||
=back
|
||||
|
||||
In case no protection is present and B<cb> is not NULL then this callback
|
||||
function is called with its B<invalid_protection> parameter being 0, while in
|
||||
case an invalid protection is present the B<invalid_protection> parameter is 1.
|
||||
The callback is passed also the arguments B<ctx>, B<msg>, and <cb_arg>
|
||||
(which typically contains the expected message type).
|
||||
The callback should return 1 on acceptance, 0 on rejection, or -1 on error.
|
||||
It should not put and error on the error stack since this could be misleading.
|
||||
|
||||
If all checks pass then ossl_cmp_msg_check_received()
|
||||
|
||||
=over 4
|
||||
|
||||
=item learns the senderNonce from the received message,
|
||||
|
||||
=item learns the transaction ID if it is not yet in B<ctx>, and
|
||||
|
||||
=item adds any extraCerts contained in the <msg> to the list of untrusted
|
||||
certificates in B<ctx> for future use, such that
|
||||
they are available already to the certificate confirmation callback and the
|
||||
peer does not need to send them again (at least not in the same transaction).
|
||||
For efficiency, the extraCerts are prepended to the list so they get used first.
|
||||
|
||||
=back
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
ossl_cmp_msg_check_received() returns the message body type (which is >= 0)
|
||||
on success, -1 on error.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<OSSL_CMP_validate_msg(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,95 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ossl_cmp_allow_unprotected_cb_t,
|
||||
ossl_cmp_msg_check_update
|
||||
- generic checks on a received CMP message, updating the context
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include "cmp_local.h"
|
||||
|
||||
typedef int (*ossl_cmp_allow_unprotected_cb_t)(const OSSL_CMP_CTX *ctx,
|
||||
const OSSL_CMP_MSG *msg,
|
||||
int invalid_protection, int arg);
|
||||
|
||||
int ossl_cmp_msg_check_update(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg,
|
||||
ossl_cmp_allow_unprotected_cb_t cb, int cb_arg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
ossl_cmp_msg_check_update() does all generic checks on the given message B<msg>,
|
||||
which may be a server response or a request by some client,
|
||||
and updates the B<ctx> accordingly.
|
||||
|
||||
The B<msg> is checked for the following:
|
||||
|
||||
=over 4
|
||||
|
||||
=item its sender is of appropriate type (currently only B<X509_NAME>)
|
||||
and matches any expected sender or srvCert subject given in B<ctx>,
|
||||
|
||||
=item its protection is present and valid (or a callback function B<cb>
|
||||
is present and indicates that a missing or invalid protection is acceptable),
|
||||
|
||||
=item its CMP protocol version is acceptable, namely B<OSSL_CMP_PVNO>,
|
||||
|
||||
=item its body type is valid,
|
||||
|
||||
=item its transaction ID matches any transaction ID given in B<ctx>, and
|
||||
|
||||
=item its recipNonce matches any senderNonce given in B<ctx>.
|
||||
|
||||
=back
|
||||
|
||||
In case no protection is present and B<cb> is not NULL then this callback
|
||||
function is called with its B<invalid_protection> parameter being 0, while in
|
||||
case an invalid protection is present the B<invalid_protection> parameter is 1.
|
||||
The callback is passed also the arguments B<ctx>, B<msg>, and <cb_arg>
|
||||
(which typically contains the expected message type).
|
||||
The callback should return 1 on acceptance, 0 on rejection, or -1 on error.
|
||||
It should not put an error on the error stack since this could be misleading.
|
||||
|
||||
ossl_cmp_msg_check_update() adds all extraCerts contained in the <msg> to
|
||||
the list of untrusted certificates in B<ctx> such that they are already usable
|
||||
for OSSL_CMP_validate_msg(), which is called internally, and for future use.
|
||||
Thus they are available also to the certificate confirmation callback, and the
|
||||
peer does not need to send them again (at least not in the same transaction).
|
||||
Note that it does not help validating the message before storing the extraCerts
|
||||
because they are not part of the protected portion of the message anyway.
|
||||
For efficiency, the extraCerts are prepended to the list so they get used first.
|
||||
|
||||
If all checks pass then ossl_cmp_msg_check_update()
|
||||
records in B<ctx> the senderNonce of the received message as the new recipNonce
|
||||
and learns the transaction ID if none is currently present in B<ctx>.
|
||||
|
||||
Moreover, according to RFC 4210 section 5.3.2, if the message protection is
|
||||
PBM-based then any certificates in the caPubs field are added to the list of
|
||||
trusted certificates (if set via L<OSSL_CMP_CTX_set0_trustedStore(3)>).
|
||||
This way these certs are available for validating subsequent messages in the
|
||||
same context and could apply to any Polling Response (pollRep), error, or PKI
|
||||
Confirmation (PKIConf) messages following in the same or future transactions.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
ossl_cmp_msg_check_update() returns 1 on success, -1 on error.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<OSSL_CMP_validate_msg(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
|
||||
@@ -13,7 +13,8 @@ ossl_provider_name, ossl_provider_dso,
|
||||
ossl_provider_module_name, ossl_provider_module_path,
|
||||
ossl_provider_library_context,
|
||||
ossl_provider_teardown, ossl_provider_gettable_params,
|
||||
ossl_provider_get_params, ossl_provider_query_operation
|
||||
ossl_provider_get_params, ossl_provider_query_operation,
|
||||
ossl_provider_set_operation_bit, ossl_provider_test_operation_bit
|
||||
- internal provider routines
|
||||
|
||||
=head1 SYNOPSIS
|
||||
@@ -63,6 +64,10 @@ ossl_provider_get_params, ossl_provider_query_operation
|
||||
int operation_id,
|
||||
int *no_cache);
|
||||
|
||||
int ossl_provider_set_operation_bit(OSSL_PROVIDER *provider, size_t bitnum);
|
||||
int ossl_provider_test_operation_bit(OSSL_PROVIDER *provider, size_t bitnum,
|
||||
int *result);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
I<OSSL_PROVIDER> is a type that holds all the necessary information
|
||||
@@ -208,6 +213,13 @@ I<query_operation> function, if the provider has one.
|
||||
It should return an array of I<OSSL_ALGORITHM> for the given
|
||||
I<operation_id>.
|
||||
|
||||
ossl_provider_set_operation_bit() registers a 1 for operation I<bitnum>
|
||||
in a bitstring that's internal to I<provider>.
|
||||
|
||||
ossl_provider_tests_operation_bit() checks if the bit operation I<bitnum>
|
||||
is set (1) or not (0) in the internal I<provider> bitstring, and sets
|
||||
I<*result> to 1 or 0 accorddingly.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
Locating a provider module happens as follows:
|
||||
@@ -270,6 +282,9 @@ otherwise NULL.
|
||||
ossl_provider_get_params() returns 1 on success, or 0 on error.
|
||||
If this function isn't available in the provider, 0 is returned.
|
||||
|
||||
ossl_provider_set_operation_bit() and ossl_provider_test_operation_bit()
|
||||
return 1 on success, or 0 on error.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<OSSL_PROVIDER(3)>, L<provider(7)>, L<openssl(1)>
|
||||
@@ -280,7 +295,7 @@ The functions described here were all added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2019-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
|
||||
|
||||
Reference in New Issue
Block a user