7 ossl_cmp_hdr_get_protection_nid,
8 ossl_cmp_hdr_get0_sendernonce,
9 ossl_cmp_general_name_is_NULL_DN,
10 ossl_cmp_hdr_set1_sender,
11 ossl_cmp_hdr_set1_recipient,
12 ossl_cmp_hdr_update_messagetime,
13 ossl_cmp_hdr_set1_senderKID,
14 ossl_cmp_hdr_push0_freeText,
15 ossl_cmp_hdr_push1_freeText,
16 ossl_cmp_hdr_generalinfo_item_push0,
17 ossl_cmp_hdr_generalinfo_items_push1,
18 ossl_cmp_hdr_set_implicitConfirm,
19 ossl_cmp_hdr_has_implicitConfirm,
21 - functions manipulating CMP message headers
25 #include "cmp_local.h"
27 int ossl_cmp_hdr_set_pvno(OSSL_CMP_PKIHEADER *hdr, int pvno);
28 int ossl_cmp_hdr_get_pvno(const OSSL_CMP_PKIHEADER *hdr);
29 int ossl_cmp_hdr_get_protection_nid(const OSSL_CMP_PKIHEADER *hdr);
31 *ossl_cmp_hdr_get0_sendernonce(const OSSL_CMP_PKIHEADER *hdr);
32 int ossl_cmp_general_name_is_NULL_DN(GENERAL_NAME *name);
34 int ossl_cmp_hdr_set1_sender(OSSL_CMP_PKIHEADER *hdr, const X509_NAME *nm);
35 int ossl_cmp_hdr_set1_recipient(OSSL_CMP_PKIHEADER *hdr, const X509_NAME *nm);
36 int ossl_cmp_hdr_update_messagetime(OSSL_CMP_PKIHEADER *hdr);
37 int ossl_cmp_hdr_set1_senderKID(OSSL_CMP_PKIHEADER *hdr,
38 const ASN1_OCTET_STRING *senderKID);
39 int ossl_cmp_hdr_generalinfo_item_push0(OSSL_CMP_PKIHEADER *hdr,
41 int ossl_cmp_hdr_generalinfo_items_push1(OSSL_CMP_PKIHEADER *hdr,
42 STACK_OF(OSSL_CMP_ITAV) *itavs);
43 int ossl_cmp_hdr_push0_freeText(OSSL_CMP_PKIHEADER *hdr,
44 ASN1_UTF8STRING *text);
45 int ossl_cmp_hdr_push1_freeText(OSSL_CMP_PKIHEADER *hdr,
46 ASN1_UTF8STRING *text);
47 int ossl_cmp_hdr_set_implicitConfirm(OSSL_CMP_PKIHEADER *hdr);
48 int ossl_cmp_hdr_has_implicitConfirm(OSSL_CMP_PKIHEADER *hdr);
49 int ossl_cmp_hdr_init(OSSL_CMP_CTX *ctx, OSSL_CMP_PKIHEADER *hdr);
53 ossl_cmp_hdr_set_pvno() sets hdr->pvno to the given B<pvno>.
55 ossl_cmp_hdr_get_pvno() returns the pvno of the given B<hdr> or -1 on error.
57 ossl_cmp_hdr_get_protection_nid returns the NID of the protection algorithm
58 in B<hdr> or NID_undef on error.
60 ossl_cmp_hdr_get0_sendernonce() returns the sender nonce of the given PKIHeader.
62 ossl_cmp_general_name_is_NULL_DN() determines if the given GENERAL_NAME
65 ossl_cmp_hdr_set1_sender() sets the sender field in the given PKIHeader
66 to the given X509 Name value, without consuming the pointer.
68 ossl_cmp_hdr_set1_recipient() sets the recipient field in the given
69 PKIHeader to the given X509 Name value, without consuming the pointer.
70 If B<nm> is NULL, recipient is set to the NULL DN (the empty list of strings).
72 ossl_cmp_hdr_update_messagetime() (re-)sets the messageTime to the current
73 system time. As written in RFC 4210, section 5.1.1:
74 The messageTime field contains the time at which the sender created the message.
75 This may be useful to allow end entities to correct/check their local time for
76 consistency with the time on a central system.
78 ossl_cmp_hdr_set1_senderKID() Sets hdr->senderKID to the given string.
79 In an PBMAC-protected IR this usually is a reference number issued by the CA,
80 else the subject key ID of the sender's protecting certificate.
82 ossl_cmp_hdr_push0_freeText() pushes an ASN1_UTF8STRING to
83 hdr->freeText and consumes the given pointer.
85 ossl_cmp_hdr_push1_freeText() pushes an ASN1_UTF8STRING to
86 hdr->freeText and does not consume the pointer.
88 ossl_cmp_hdr_generalinfo_item_push0() adds the given InfoTypeAndValue
89 item to the hdr->generalInfo stack. Consumes the B<itav> pointer.
91 ossl_cmp_hdr_generalinfo_items_push1() adds a copy of the B<itavs> stack to
92 the generalInfo field of PKIheader of the B<hdr>. Does not consume the B<itavs>
95 ossl_cmp_hdr_set_implicitConfirm() sets implicitConfirm in the generalInfo field
96 of the PKIMessage header.
98 ossl_cmp_hdr_has_implicitConfirm() returns 1 if implicitConfirm is
99 set int generalInfo field of the given PKIMessage header, 0 if not.
101 ossl_cmp_hdr_init() initializes a PKIHeader structure based on the
102 values in the given OSSL_CMP_CTX structure.
103 This starts a new transaction in case ctx->transactionID is NULL.
104 The sender name is copied from the subject of the client cert, if any,
105 or else from the subject name provided for certification requests.
106 As required by RFC 4210 section 5.1.1., if the sender name is not known
107 to the client it set to the NULL-DN. In this case for identification at least
108 the senderKID must be set, which we take from any referenceValue provided.
112 CMP is defined in RFC 4210 (and CRMF in RFC 4211).
116 ossl_cmp_hdr_get_pvno() returns the pvno of the given B<hdr> or -1 on error.
118 ossl_cmp_hdr_get_protection_nid returns the respective NID, NID_undef on error.
120 ossl_cmp_hdr_get0_sendernonce() returns the respective nonce, or NULL.
122 ossl_cmp_general_name_is_NULL_DN() returns 1 given a NULL-DN, else 0.
124 All other functions return 1 on success, 0 on error.
126 See the individual functions above.
130 The OpenSSL CMP support was added in OpenSSL 3.0.
134 Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
136 Licensed under the Apache License 2.0 (the "License"). You may not use
137 this file except in compliance with the License. You can obtain a copy
138 in the file LICENSE in the source distribution or at
139 L<https://www.openssl.org/source/license.html>.