Lines Matching refs:hdr

23 int ossl_cmp_hdr_set_pvno(OSSL_CMP_PKIHEADER *hdr, int pvno)  in ossl_cmp_hdr_set_pvno()  argument
25 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_set_pvno()
27 return ASN1_INTEGER_set(hdr->pvno, pvno); in ossl_cmp_hdr_set_pvno()
30 int ossl_cmp_hdr_get_pvno(const OSSL_CMP_PKIHEADER *hdr) in ossl_cmp_hdr_get_pvno() argument
34 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_get_pvno()
36 if (!ASN1_INTEGER_get_int64(&pvno, hdr->pvno) || pvno < 0 || pvno > INT_MAX) in ossl_cmp_hdr_get_pvno()
41 int ossl_cmp_hdr_get_protection_nid(const OSSL_CMP_PKIHEADER *hdr) in ossl_cmp_hdr_get_protection_nid() argument
43 if (!ossl_assert(hdr != NULL) in ossl_cmp_hdr_get_protection_nid()
44 || hdr->protectionAlg == NULL) in ossl_cmp_hdr_get_protection_nid()
46 return OBJ_obj2nid(hdr->protectionAlg->algorithm); in ossl_cmp_hdr_get_protection_nid()
50 OSSL_CMP_PKIHEADER *hdr) in OSSL_CMP_HDR_get0_transactionID() argument
52 if (hdr == NULL) { in OSSL_CMP_HDR_get0_transactionID()
56 return hdr->transactionID; in OSSL_CMP_HDR_get0_transactionID()
59 ASN1_OCTET_STRING *ossl_cmp_hdr_get0_senderNonce(const OSSL_CMP_PKIHEADER *hdr) in ossl_cmp_hdr_get0_senderNonce() argument
61 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_get0_senderNonce()
63 return hdr->senderNonce; in ossl_cmp_hdr_get0_senderNonce()
66 ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_recipNonce(const OSSL_CMP_PKIHEADER *hdr) in OSSL_CMP_HDR_get0_recipNonce() argument
68 if (hdr == NULL) { in OSSL_CMP_HDR_get0_recipNonce()
72 return hdr->recipNonce; in OSSL_CMP_HDR_get0_recipNonce()
76 *OSSL_CMP_HDR_get0_geninfo_ITAVs(const OSSL_CMP_PKIHEADER *hdr) in STACK_OF()
78 if (hdr == NULL) { in STACK_OF()
82 return hdr->generalInfo; in STACK_OF()
97 int ossl_cmp_hdr_set1_sender(OSSL_CMP_PKIHEADER *hdr, const X509_NAME *nm) in ossl_cmp_hdr_set1_sender() argument
99 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_set1_sender()
101 return GENERAL_NAME_set1_X509_NAME(&hdr->sender, nm); in ossl_cmp_hdr_set1_sender()
104 int ossl_cmp_hdr_set1_recipient(OSSL_CMP_PKIHEADER *hdr, const X509_NAME *nm) in ossl_cmp_hdr_set1_recipient() argument
106 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_set1_recipient()
108 return GENERAL_NAME_set1_X509_NAME(&hdr->recipient, nm); in ossl_cmp_hdr_set1_recipient()
111 int ossl_cmp_hdr_update_messageTime(OSSL_CMP_PKIHEADER *hdr) in ossl_cmp_hdr_update_messageTime() argument
113 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_update_messageTime()
115 if (hdr->messageTime == NULL in ossl_cmp_hdr_update_messageTime()
116 && (hdr->messageTime = ASN1_GENERALIZEDTIME_new()) == NULL) in ossl_cmp_hdr_update_messageTime()
118 return ASN1_GENERALIZEDTIME_set(hdr->messageTime, time(NULL)) != NULL; in ossl_cmp_hdr_update_messageTime()
135 int ossl_cmp_hdr_set1_senderKID(OSSL_CMP_PKIHEADER *hdr, in ossl_cmp_hdr_set1_senderKID() argument
138 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_set1_senderKID()
140 return ossl_cmp_asn1_octet_string_set1(&hdr->senderKID, senderKID); in ossl_cmp_hdr_set1_senderKID()
144 int ossl_cmp_hdr_push0_freeText(OSSL_CMP_PKIHEADER *hdr, ASN1_UTF8STRING *text) in ossl_cmp_hdr_push0_freeText() argument
146 if (!ossl_assert(hdr != NULL && text != NULL)) in ossl_cmp_hdr_push0_freeText()
149 if (hdr->freeText == NULL in ossl_cmp_hdr_push0_freeText()
150 && (hdr->freeText = sk_ASN1_UTF8STRING_new_null()) == NULL) in ossl_cmp_hdr_push0_freeText()
153 return sk_ASN1_UTF8STRING_push(hdr->freeText, text); in ossl_cmp_hdr_push0_freeText()
156 int ossl_cmp_hdr_push1_freeText(OSSL_CMP_PKIHEADER *hdr, ASN1_UTF8STRING *text) in ossl_cmp_hdr_push1_freeText() argument
158 if (!ossl_assert(hdr != NULL && text != NULL)) in ossl_cmp_hdr_push1_freeText()
161 if (hdr->freeText == NULL in ossl_cmp_hdr_push1_freeText()
162 && (hdr->freeText = sk_ASN1_UTF8STRING_new_null()) == NULL) in ossl_cmp_hdr_push1_freeText()
166 ossl_cmp_sk_ASN1_UTF8STRING_push_str(hdr->freeText, (char *)text->data, in ossl_cmp_hdr_push1_freeText()
170 int ossl_cmp_hdr_generalInfo_push0_item(OSSL_CMP_PKIHEADER *hdr, in ossl_cmp_hdr_generalInfo_push0_item() argument
173 if (!ossl_assert(hdr != NULL && itav != NULL)) in ossl_cmp_hdr_generalInfo_push0_item()
175 return OSSL_CMP_ITAV_push0_stack_item(&hdr->generalInfo, itav); in ossl_cmp_hdr_generalInfo_push0_item()
178 int ossl_cmp_hdr_generalInfo_push1_items(OSSL_CMP_PKIHEADER *hdr, in ossl_cmp_hdr_generalInfo_push1_items() argument
184 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_generalInfo_push1_items()
192 if (!ossl_cmp_hdr_generalInfo_push0_item(hdr, itav)) { in ossl_cmp_hdr_generalInfo_push1_items()
200 int ossl_cmp_hdr_set_implicitConfirm(OSSL_CMP_PKIHEADER *hdr) in ossl_cmp_hdr_set_implicitConfirm() argument
205 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_set_implicitConfirm()
213 if (!ossl_cmp_hdr_generalInfo_push0_item(hdr, itav)) in ossl_cmp_hdr_set_implicitConfirm()
224 int ossl_cmp_hdr_has_implicitConfirm(const OSSL_CMP_PKIHEADER *hdr) in ossl_cmp_hdr_has_implicitConfirm() argument
230 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_has_implicitConfirm()
233 itavCount = sk_OSSL_CMP_ITAV_num(hdr->generalInfo); in ossl_cmp_hdr_has_implicitConfirm()
235 itav = sk_OSSL_CMP_ITAV_value(hdr->generalInfo, i); in ossl_cmp_hdr_has_implicitConfirm()
253 int ossl_cmp_hdr_set_transactionID(OSSL_CMP_CTX *ctx, OSSL_CMP_PKIHEADER *hdr) in ossl_cmp_hdr_set_transactionID() argument
268 return ossl_cmp_asn1_octet_string_set1(&hdr->transactionID, in ossl_cmp_hdr_set_transactionID()
273 int ossl_cmp_hdr_init(OSSL_CMP_CTX *ctx, OSSL_CMP_PKIHEADER *hdr) in ossl_cmp_hdr_init() argument
278 if (!ossl_assert(ctx != NULL && hdr != NULL)) in ossl_cmp_hdr_init()
282 if (!ossl_cmp_hdr_set_pvno(hdr, OSSL_CMP_PVNO)) in ossl_cmp_hdr_init()
293 if (!ossl_cmp_hdr_set1_sender(hdr, sender)) in ossl_cmp_hdr_init()
307 if (!ossl_cmp_hdr_set1_recipient(hdr, rcp)) in ossl_cmp_hdr_init()
311 if (!ossl_cmp_hdr_update_messageTime(hdr)) in ossl_cmp_hdr_init()
315 && !ossl_cmp_asn1_octet_string_set1(&hdr->recipNonce, in ossl_cmp_hdr_init()
319 if (!ossl_cmp_hdr_set_transactionID(ctx, hdr)) in ossl_cmp_hdr_init()
334 if (!set_random(&hdr->senderNonce, ctx, OSSL_CMP_SENDERNONCE_LENGTH)) in ossl_cmp_hdr_init()
338 if (!OSSL_CMP_CTX_set1_senderNonce(ctx, hdr->senderNonce)) in ossl_cmp_hdr_init()
347 && !ossl_cmp_hdr_push1_freeText(hdr, ctx->freeText)) in ossl_cmp_hdr_init()