1 =pod 2 3 =head1 NAME 4 5 OSSL_CMP_PKIBODY_IR, 6 OSSL_CMP_PKIBODY_IP, 7 OSSL_CMP_PKIBODY_CR, 8 OSSL_CMP_PKIBODY_CP, 9 OSSL_CMP_PKIBODY_P10CR, 10 OSSL_CMP_PKIBODY_POPDECC, 11 OSSL_CMP_PKIBODY_POPDECR, 12 OSSL_CMP_PKIBODY_KUR, 13 OSSL_CMP_PKIBODY_KUP, 14 OSSL_CMP_PKIBODY_KRR, 15 OSSL_CMP_PKIBODY_KRP, 16 OSSL_CMP_PKIBODY_RR, 17 OSSL_CMP_PKIBODY_RP, 18 OSSL_CMP_PKIBODY_CCR, 19 OSSL_CMP_PKIBODY_CCP, 20 OSSL_CMP_PKIBODY_CKUANN, 21 OSSL_CMP_PKIBODY_CANN, 22 OSSL_CMP_PKIBODY_RANN, 23 OSSL_CMP_PKIBODY_CRLANN, 24 OSSL_CMP_PKIBODY_PKICONF, 25 OSSL_CMP_PKIBODY_NESTED, 26 OSSL_CMP_PKIBODY_GENM, 27 OSSL_CMP_PKIBODY_GENP, 28 OSSL_CMP_PKIBODY_ERROR, 29 OSSL_CMP_PKIBODY_CERTCONF, 30 OSSL_CMP_PKIBODY_POLLREQ, 31 OSSL_CMP_PKIBODY_POLLREP, 32 ossl_cmp_bodytype_to_string, 33 ossl_cmp_msg_get_bodytype, 34 ossl_cmp_msg_set_bodytype, 35 ossl_cmp_msg_create, 36 ossl_cmp_msg_gen_ITAV_push0, 37 ossl_cmp_msg_gen_ITAVs_push1 38 - functions handling CMP messages 39 40 =head1 SYNOPSIS 41 42 #include "cmp_local.h" 43 44 #define OSSL_CMP_PKIBODY_IR 0 45 #define OSSL_CMP_PKIBODY_IP 1 46 #define OSSL_CMP_PKIBODY_CR 2 47 #define OSSL_CMP_PKIBODY_CP 3 48 #define OSSL_CMP_PKIBODY_P10CR 4 49 #define OSSL_CMP_PKIBODY_POPDECC 5 50 #define OSSL_CMP_PKIBODY_POPDECR 6 51 #define OSSL_CMP_PKIBODY_KUR 7 52 #define OSSL_CMP_PKIBODY_KUP 8 53 #define OSSL_CMP_PKIBODY_KRR 9 54 #define OSSL_CMP_PKIBODY_KRP 10 55 #define OSSL_CMP_PKIBODY_RR 11 56 #define OSSL_CMP_PKIBODY_RP 12 57 #define OSSL_CMP_PKIBODY_CCR 13 58 #define OSSL_CMP_PKIBODY_CCP 14 59 #define OSSL_CMP_PKIBODY_CKUANN 15 60 #define OSSL_CMP_PKIBODY_CANN 16 61 #define OSSL_CMP_PKIBODY_RANN 17 62 #define OSSL_CMP_PKIBODY_CRLANN 18 63 #define OSSL_CMP_PKIBODY_PKICONF 19 64 #define OSSL_CMP_PKIBODY_NESTED 20 65 #define OSSL_CMP_PKIBODY_GENM 21 66 #define OSSL_CMP_PKIBODY_GENP 22 67 #define OSSL_CMP_PKIBODY_ERROR 23 68 #define OSSL_CMP_PKIBODY_CERTCONF 24 69 #define OSSL_CMP_PKIBODY_POLLREQ 25 70 #define OSSL_CMP_PKIBODY_POLLREP 26 71 72 const char *ossl_cmp_bodytype_to_string(int type); 73 int ossl_cmp_msg_get_bodytype(const OSSL_CMP_MSG *msg); 74 int ossl_cmp_msg_set_bodytype( OSSL_CMP_MSG *msg, int type); 75 OSSL_CMP_MSG *ossl_cmp_msg_create(OSSL_CMP_CTX *ctx, int bodytype); 76 int ossl_cmp_msg_gen_ITAV_push0(OSSL_CMP_MSG *msg, OSSL_CMP_ITAV *itav); 77 int ossl_cmp_msg_gen_ITAVs_push1(OSSL_CMP_MSG *msg, 78 STACK_OF(OSSL_CMP_ITAV) *itavs); 79 80 =head1 DESCRIPTION 81 82 ossl_cmp_bodytype_to_string() returns the name of the given body type as string, 83 or "illegal body type" on error. 84 85 ossl_cmp_msg_get_bodytype() returns the body type of the given PKIMessage, 86 or -1 on error. 87 88 ossl_cmp_msg_set_bodytype() sets the type of the message contained in 89 the PKIMessage body field. 90 Returns 1 on success, 0 on error. 91 92 ossl_cmp_msg_create() creates and initializes an B<OSSL_CMP_MSG> structure, 93 using fields of B<ctx> for the header and B<bodytype> for the body. 94 If the current B<transactionID> field in I<ctx> indicates that there is no 95 current transaction, it creates and stores a random one with 128 bits length. 96 Thus, the I<ctx> may be modified by this and related ossl_cmp_*_new() functions. 97 Returns pointer to created B<OSSL_CMP_MSG> on success, NULL on error. 98 99 ossl_cmp_msg_gen_ITAV_push0() pushes the B<itav> to the body of the 100 PKIMessage B<msg> of GenMsg or GenRep type. Consumes the B<itavs> pointer. 101 Returns 1 on success, 0 on error. 102 103 ossl_cmp_msg_gen_ITAVs_push1() adds a copy of the B<itavs> stack to the body 104 of the PKIMessage B<msg> of GenMsg or GenRep type. 105 Does not consume the B<itavs> pointer nor its elements. 106 Returns 1 on success, 0 on error. 107 108 =head1 NOTES 109 110 CMP is defined in RFC 9810. 111 112 =head1 RETURN VALUES 113 114 See the individual functions above. 115 116 =head1 SEE ALSO 117 118 L<ossl_cmp_hdr_init(3)>, 119 L<OSSL_CMP_CTX_new(3)>, L<OSSL_CMP_exec_certreq(3)> 120 121 =head1 HISTORY 122 123 The OpenSSL CMP support was added in OpenSSL 3.0. 124 125 =head1 COPYRIGHT 126 127 Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved. 128 129 Licensed under the Apache License 2.0 (the "License"). You may not use 130 this file except in compliance with the License. You can obtain a copy 131 in the file LICENSE in the source distribution or at 132 L<https://www.openssl.org/source/license.html>. 133 134 =cut 135