1*b077aed3SPierre Pronchery=pod 2*b077aed3SPierre Pronchery 3*b077aed3SPierre Pronchery=head1 NAME 4*b077aed3SPierre Pronchery 5*b077aed3SPierre Proncheryprovider-kdf - The KDF library E<lt>-E<gt> provider functions 6*b077aed3SPierre Pronchery 7*b077aed3SPierre Pronchery=head1 SYNOPSIS 8*b077aed3SPierre Pronchery 9*b077aed3SPierre Pronchery=for openssl multiple includes 10*b077aed3SPierre Pronchery 11*b077aed3SPierre Pronchery #include <openssl/core_dispatch.h> 12*b077aed3SPierre Pronchery #include <openssl/core_names.h> 13*b077aed3SPierre Pronchery 14*b077aed3SPierre Pronchery /* 15*b077aed3SPierre Pronchery * None of these are actual functions, but are displayed like this for 16*b077aed3SPierre Pronchery * the function signatures for functions that are offered as function 17*b077aed3SPierre Pronchery * pointers in OSSL_DISPATCH arrays. 18*b077aed3SPierre Pronchery */ 19*b077aed3SPierre Pronchery 20*b077aed3SPierre Pronchery /* Context management */ 21*b077aed3SPierre Pronchery void *OSSL_FUNC_kdf_newctx(void *provctx); 22*b077aed3SPierre Pronchery void OSSL_FUNC_kdf_freectx(void *kctx); 23*b077aed3SPierre Pronchery void *OSSL_FUNC_kdf_dupctx(void *src); 24*b077aed3SPierre Pronchery 25*b077aed3SPierre Pronchery /* Encryption/decryption */ 26*b077aed3SPierre Pronchery int OSSL_FUNC_kdf_reset(void *kctx); 27*b077aed3SPierre Pronchery int OSSL_FUNC_kdf_derive(void *kctx, unsigned char *key, size_t keylen, 28*b077aed3SPierre Pronchery const OSSL_PARAM params[]); 29*b077aed3SPierre Pronchery 30*b077aed3SPierre Pronchery /* KDF parameter descriptors */ 31*b077aed3SPierre Pronchery const OSSL_PARAM *OSSL_FUNC_kdf_gettable_params(void *provctx); 32*b077aed3SPierre Pronchery const OSSL_PARAM *OSSL_FUNC_kdf_gettable_ctx_params(void *kcxt, void *provctx); 33*b077aed3SPierre Pronchery const OSSL_PARAM *OSSL_FUNC_kdf_settable_ctx_params(void *kcxt, void *provctx); 34*b077aed3SPierre Pronchery 35*b077aed3SPierre Pronchery /* KDF parameters */ 36*b077aed3SPierre Pronchery int OSSL_FUNC_kdf_get_params(OSSL_PARAM params[]); 37*b077aed3SPierre Pronchery int OSSL_FUNC_kdf_get_ctx_params(void *kctx, OSSL_PARAM params[]); 38*b077aed3SPierre Pronchery int OSSL_FUNC_kdf_set_ctx_params(void *kctx, const OSSL_PARAM params[]); 39*b077aed3SPierre Pronchery 40*b077aed3SPierre Pronchery=head1 DESCRIPTION 41*b077aed3SPierre Pronchery 42*b077aed3SPierre ProncheryThis documentation is primarily aimed at provider authors. See L<provider(7)> 43*b077aed3SPierre Proncheryfor further information. 44*b077aed3SPierre Pronchery 45*b077aed3SPierre ProncheryThe KDF operation enables providers to implement KDF algorithms and make 46*b077aed3SPierre Proncherythem available to applications via the API functions L<EVP_KDF_CTX_reset(3)>, 47*b077aed3SPierre Proncheryand L<EVP_KDF_derive(3)>. 48*b077aed3SPierre Pronchery 49*b077aed3SPierre ProncheryAll "functions" mentioned here are passed as function pointers between 50*b077aed3SPierre ProncheryF<libcrypto> and the provider in L<OSSL_DISPATCH(3)> arrays via 51*b077aed3SPierre ProncheryL<OSSL_ALGORITHM(3)> arrays that are returned by the provider's 52*b077aed3SPierre Proncheryprovider_query_operation() function 53*b077aed3SPierre Pronchery(see L<provider-base(7)/Provider Functions>). 54*b077aed3SPierre Pronchery 55*b077aed3SPierre ProncheryAll these "functions" have a corresponding function type definition 56*b077aed3SPierre Proncherynamed B<OSSL_FUNC_{name}_fn>, and a helper function to retrieve the 57*b077aed3SPierre Proncheryfunction pointer from an L<OSSL_DISPATCH(3)> element named 58*b077aed3SPierre ProncheryB<OSSL_FUNC_{name}>. 59*b077aed3SPierre ProncheryFor example, the "function" OSSL_FUNC_kdf_newctx() has these: 60*b077aed3SPierre Pronchery 61*b077aed3SPierre Pronchery typedef void *(OSSL_FUNC_kdf_newctx_fn)(void *provctx); 62*b077aed3SPierre Pronchery static ossl_inline OSSL_FUNC_kdf_newctx_fn 63*b077aed3SPierre Pronchery OSSL_FUNC_kdf_newctx(const OSSL_DISPATCH *opf); 64*b077aed3SPierre Pronchery 65*b077aed3SPierre ProncheryL<OSSL_DISPATCH(3)> array entries are identified by numbers that are provided as 66*b077aed3SPierre Proncherymacros in L<openssl-core_dispatch.h(7)>, as follows: 67*b077aed3SPierre Pronchery 68*b077aed3SPierre Pronchery OSSL_FUNC_kdf_newctx OSSL_FUNC_KDF_NEWCTX 69*b077aed3SPierre Pronchery OSSL_FUNC_kdf_freectx OSSL_FUNC_KDF_FREECTX 70*b077aed3SPierre Pronchery OSSL_FUNC_kdf_dupctx OSSL_FUNC_KDF_DUPCTX 71*b077aed3SPierre Pronchery 72*b077aed3SPierre Pronchery OSSL_FUNC_kdf_reset OSSL_FUNC_KDF_RESET 73*b077aed3SPierre Pronchery OSSL_FUNC_kdf_derive OSSL_FUNC_KDF_DERIVE 74*b077aed3SPierre Pronchery 75*b077aed3SPierre Pronchery OSSL_FUNC_kdf_get_params OSSL_FUNC_KDF_GET_PARAMS 76*b077aed3SPierre Pronchery OSSL_FUNC_kdf_get_ctx_params OSSL_FUNC_KDF_GET_CTX_PARAMS 77*b077aed3SPierre Pronchery OSSL_FUNC_kdf_set_ctx_params OSSL_FUNC_KDF_SET_CTX_PARAMS 78*b077aed3SPierre Pronchery 79*b077aed3SPierre Pronchery OSSL_FUNC_kdf_gettable_params OSSL_FUNC_KDF_GETTABLE_PARAMS 80*b077aed3SPierre Pronchery OSSL_FUNC_kdf_gettable_ctx_params OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS 81*b077aed3SPierre Pronchery OSSL_FUNC_kdf_settable_ctx_params OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS 82*b077aed3SPierre Pronchery 83*b077aed3SPierre ProncheryA KDF algorithm implementation may not implement all of these functions. 84*b077aed3SPierre ProncheryIn order to be a consistent set of functions, at least the following functions 85*b077aed3SPierre Proncherymust be implemented: OSSL_FUNC_kdf_newctx(), OSSL_FUNC_kdf_freectx(), 86*b077aed3SPierre ProncheryOSSL_FUNC_kdf_set_ctx_params(), OSSL_FUNC_kdf_derive(). 87*b077aed3SPierre ProncheryAll other functions are optional. 88*b077aed3SPierre Pronchery 89*b077aed3SPierre Pronchery=head2 Context Management Functions 90*b077aed3SPierre Pronchery 91*b077aed3SPierre ProncheryOSSL_FUNC_kdf_newctx() should create and return a pointer to a provider side 92*b077aed3SPierre Proncherystructure for holding context information during a KDF operation. 93*b077aed3SPierre ProncheryA pointer to this context will be passed back in a number of the other KDF 94*b077aed3SPierre Proncheryoperation function calls. 95*b077aed3SPierre ProncheryThe parameter I<provctx> is the provider context generated during provider 96*b077aed3SPierre Proncheryinitialisation (see L<provider(7)>). 97*b077aed3SPierre Pronchery 98*b077aed3SPierre ProncheryOSSL_FUNC_kdf_freectx() is passed a pointer to the provider side KDF context in 99*b077aed3SPierre Proncherythe I<kctx> parameter. 100*b077aed3SPierre ProncheryIf it receives NULL as I<kctx> value, it should not do anything other than 101*b077aed3SPierre Proncheryreturn. 102*b077aed3SPierre ProncheryThis function should free any resources associated with that context. 103*b077aed3SPierre Pronchery 104*b077aed3SPierre ProncheryOSSL_FUNC_kdf_dupctx() should duplicate the provider side KDF context in the 105*b077aed3SPierre ProncheryI<kctx> parameter and return the duplicate copy. 106*b077aed3SPierre Pronchery 107*b077aed3SPierre Pronchery=head2 Encryption/Decryption Functions 108*b077aed3SPierre Pronchery 109*b077aed3SPierre ProncheryOSSL_FUNC_kdf_reset() initialises a KDF operation given a provider 110*b077aed3SPierre Proncheryside KDF context in the I<kctx> parameter. 111*b077aed3SPierre Pronchery 112*b077aed3SPierre ProncheryOSSL_FUNC_kdf_derive() performs the KDF operation after processing the 113*b077aed3SPierre ProncheryI<params> as per OSSL_FUNC_kdf_set_ctx_params(). 114*b077aed3SPierre ProncheryThe I<kctx> parameter contains a pointer to the provider side context. 115*b077aed3SPierre ProncheryThe resulting key of the desired I<keylen> should be written to I<key>. 116*b077aed3SPierre ProncheryIf the algorithm does not support the requested I<keylen> the function must 117*b077aed3SPierre Proncheryreturn error. 118*b077aed3SPierre Pronchery 119*b077aed3SPierre Pronchery=head2 KDF Parameters 120*b077aed3SPierre Pronchery 121*b077aed3SPierre ProncherySee L<OSSL_PARAM(3)> for further details on the parameters structure used by 122*b077aed3SPierre Proncherythese functions. 123*b077aed3SPierre Pronchery 124*b077aed3SPierre ProncheryOSSL_FUNC_kdf_get_params() gets details of parameter values associated with the 125*b077aed3SPierre Proncheryprovider algorithm and stores them in I<params>. 126*b077aed3SPierre Pronchery 127*b077aed3SPierre ProncheryOSSL_FUNC_kdf_set_ctx_params() sets KDF parameters associated with the given 128*b077aed3SPierre Proncheryprovider side KDF context I<kctx> to I<params>. 129*b077aed3SPierre ProncheryAny parameter settings are additional to any that were previously set. 130*b077aed3SPierre ProncheryPassing NULL for I<params> should return true. 131*b077aed3SPierre Pronchery 132*b077aed3SPierre ProncheryOSSL_FUNC_kdf_get_ctx_params() retrieves gettable parameter values associated 133*b077aed3SPierre Proncherywith the given provider side KDF context I<kctx> and stores them in I<params>. 134*b077aed3SPierre ProncheryPassing NULL for I<params> should return true. 135*b077aed3SPierre Pronchery 136*b077aed3SPierre ProncheryOSSL_FUNC_kdf_gettable_params(), OSSL_FUNC_kdf_gettable_ctx_params(), 137*b077aed3SPierre Proncheryand OSSL_FUNC_kdf_settable_ctx_params() all return constant L<OSSL_PARAM(3)> 138*b077aed3SPierre Proncheryarrays as descriptors of the parameters that OSSL_FUNC_kdf_get_params(), 139*b077aed3SPierre ProncheryOSSL_FUNC_kdf_get_ctx_params(), and OSSL_FUNC_kdf_set_ctx_params() 140*b077aed3SPierre Proncherycan handle, respectively. OSSL_FUNC_kdf_gettable_ctx_params() and 141*b077aed3SPierre ProncheryOSSL_FUNC_kdf_settable_ctx_params() will return the parameters associated 142*b077aed3SPierre Proncherywith the provider side context I<kctx> in its current state if it is 143*b077aed3SPierre Proncherynot NULL. Otherwise, they return the parameters associated with the 144*b077aed3SPierre Proncheryprovider side algorithm I<provctx>. 145*b077aed3SPierre Pronchery 146*b077aed3SPierre Pronchery 147*b077aed3SPierre ProncheryParameters currently recognised by built-in KDFs are as follows. Not all 148*b077aed3SPierre Proncheryparameters are relevant to, or are understood by all KDFs: 149*b077aed3SPierre Pronchery 150*b077aed3SPierre Pronchery=over 4 151*b077aed3SPierre Pronchery 152*b077aed3SPierre Pronchery=item "size" (B<OSSL_KDF_PARAM_SIZE>) <unsigned integer> 153*b077aed3SPierre Pronchery 154*b077aed3SPierre ProncheryGets the output size from the associated KDF ctx. 155*b077aed3SPierre ProncheryIf the algorithm produces a variable amount of output, SIZE_MAX should be 156*b077aed3SPierre Proncheryreturned. 157*b077aed3SPierre ProncheryIf the input parameters required to calculate the fixed output size have not yet 158*b077aed3SPierre Proncherybeen supplied, 0 should be returned indicating an error. 159*b077aed3SPierre Pronchery 160*b077aed3SPierre Pronchery=item "key" (B<OSSL_KDF_PARAM_KEY>) <octet string> 161*b077aed3SPierre Pronchery 162*b077aed3SPierre ProncherySets the key in the associated KDF ctx. 163*b077aed3SPierre Pronchery 164*b077aed3SPierre Pronchery=item "secret" (B<OSSL_KDF_PARAM_SECRET>) <octet string> 165*b077aed3SPierre Pronchery 166*b077aed3SPierre ProncherySets the secret in the associated KDF ctx. 167*b077aed3SPierre Pronchery 168*b077aed3SPierre Pronchery=item "pass" (B<OSSL_KDF_PARAM_PASSWORD>) <octet string> 169*b077aed3SPierre Pronchery 170*b077aed3SPierre ProncherySets the password in the associated KDF ctx. 171*b077aed3SPierre Pronchery 172*b077aed3SPierre Pronchery=item "cipher" (B<OSSL_KDF_PARAM_CIPHER>) <UTF8 string> 173*b077aed3SPierre Pronchery 174*b077aed3SPierre Pronchery=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string> 175*b077aed3SPierre Pronchery 176*b077aed3SPierre Pronchery=item "mac" (B<OSSL_KDF_PARAM_MAC>) <UTF8 string> 177*b077aed3SPierre Pronchery 178*b077aed3SPierre ProncherySets the name of the underlying cipher, digest or MAC to be used. 179*b077aed3SPierre ProncheryIt must name a suitable algorithm for the KDF that's being used. 180*b077aed3SPierre Pronchery 181*b077aed3SPierre Pronchery=item "maclen" (B<OSSL_KDF_PARAM_MAC_SIZE>) <octet string> 182*b077aed3SPierre Pronchery 183*b077aed3SPierre ProncherySets the length of the MAC in the associated KDF ctx. 184*b077aed3SPierre Pronchery 185*b077aed3SPierre Pronchery=item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string> 186*b077aed3SPierre Pronchery 187*b077aed3SPierre ProncherySets the properties to be queried when trying to fetch the underlying algorithm. 188*b077aed3SPierre ProncheryThis must be given together with the algorithm naming parameter to be 189*b077aed3SPierre Proncheryconsidered valid. 190*b077aed3SPierre Pronchery 191*b077aed3SPierre Pronchery=item "iter" (B<OSSL_KDF_PARAM_ITER>) <unsigned integer> 192*b077aed3SPierre Pronchery 193*b077aed3SPierre ProncherySets the number of iterations in the associated KDF ctx. 194*b077aed3SPierre Pronchery 195*b077aed3SPierre Pronchery=item "mode" (B<OSSL_KDF_PARAM_MODE>) <UTF8 string> 196*b077aed3SPierre Pronchery 197*b077aed3SPierre ProncherySets the mode in the associated KDF ctx. 198*b077aed3SPierre Pronchery 199*b077aed3SPierre Pronchery=item "pkcs5" (B<OSSL_KDF_PARAM_PKCS5>) <integer> 200*b077aed3SPierre Pronchery 201*b077aed3SPierre ProncheryEnables or diables the SP800-132 compliance checks. 202*b077aed3SPierre ProncheryA mode of 0 enables the compliance checks. 203*b077aed3SPierre Pronchery 204*b077aed3SPierre ProncheryThe checks performed are: 205*b077aed3SPierre Pronchery 206*b077aed3SPierre Pronchery=over 4 207*b077aed3SPierre Pronchery 208*b077aed3SPierre Pronchery=item - the iteration count is at least 1000. 209*b077aed3SPierre Pronchery 210*b077aed3SPierre Pronchery=item - the salt length is at least 128 bits. 211*b077aed3SPierre Pronchery 212*b077aed3SPierre Pronchery=item - the derived key length is at least 112 bits. 213*b077aed3SPierre Pronchery 214*b077aed3SPierre Pronchery=back 215*b077aed3SPierre Pronchery 216*b077aed3SPierre Pronchery=item "ukm" (B<OSSL_KDF_PARAM_UKM>) <octet string> 217*b077aed3SPierre Pronchery 218*b077aed3SPierre ProncherySets an optional random string that is provided by the sender called 219*b077aed3SPierre Pronchery"partyAInfo". In CMS this is the user keying material. 220*b077aed3SPierre Pronchery 221*b077aed3SPierre Pronchery 222*b077aed3SPierre Pronchery=item "cekalg" (B<OSSL_KDF_PARAM_CEK_ALG>) <UTF8 string> 223*b077aed3SPierre Pronchery 224*b077aed3SPierre ProncherySets the CEK wrapping algorithm name in the associated KDF ctx. 225*b077aed3SPierre Pronchery 226*b077aed3SPierre Pronchery=item "n" (B<OSSL_KDF_PARAM_SCRYPT_N>) <unsigned integer> 227*b077aed3SPierre Pronchery 228*b077aed3SPierre ProncherySets the scrypt work factor parameter N in the associated KDF ctx. 229*b077aed3SPierre Pronchery 230*b077aed3SPierre Pronchery=item "r" (B<OSSL_KDF_PARAM_SCRYPT_R>) <unsigned integer> 231*b077aed3SPierre Pronchery 232*b077aed3SPierre ProncherySets the scrypt work factor parameter r in the associated KDF ctx. 233*b077aed3SPierre Pronchery 234*b077aed3SPierre Pronchery=item "p" (B<OSSL_KDF_PARAM_SCRYPT_P>) <unsigned integer> 235*b077aed3SPierre Pronchery 236*b077aed3SPierre ProncherySets the scrypt work factor parameter p in the associated KDF ctx. 237*b077aed3SPierre Pronchery 238*b077aed3SPierre Pronchery=item "maxmem_bytes" (B<OSSL_KDF_PARAM_SCRYPT_MAXMEM>) <unsigned integer> 239*b077aed3SPierre Pronchery 240*b077aed3SPierre ProncherySets the scrypt work factor parameter maxmem in the associated KDF ctx. 241*b077aed3SPierre Pronchery 242*b077aed3SPierre Pronchery=item "prefix" (B<OSSL_KDF_PARAM_PREFIX>) <octet string> 243*b077aed3SPierre Pronchery 244*b077aed3SPierre ProncherySets the prefix string using by the TLS 1.3 version of HKDF in the 245*b077aed3SPierre Proncheryassociated KDF ctx. 246*b077aed3SPierre Pronchery 247*b077aed3SPierre Pronchery=item "label" (B<OSSL_KDF_PARAM_LABEL>) <octet string> 248*b077aed3SPierre Pronchery 249*b077aed3SPierre ProncherySets the label string using by the TLS 1.3 version of HKDF in the 250*b077aed3SPierre Proncheryassociated KDF ctx. 251*b077aed3SPierre Pronchery 252*b077aed3SPierre Pronchery=item "data" (B<OSSL_KDF_PARAM_DATA>) <octet string> 253*b077aed3SPierre Pronchery 254*b077aed3SPierre ProncherySets the context string using by the TLS 1.3 version of HKDF in the 255*b077aed3SPierre Proncheryassociated KDF ctx. 256*b077aed3SPierre Pronchery 257*b077aed3SPierre Pronchery=item "info" (B<OSSL_KDF_PARAM_INFO>) <octet string> 258*b077aed3SPierre Pronchery 259*b077aed3SPierre ProncherySets the optional shared info in the associated KDF ctx. 260*b077aed3SPierre Pronchery 261*b077aed3SPierre Pronchery=item "seed" (B<OSSL_KDF_PARAM_SEED>) <octet string> 262*b077aed3SPierre Pronchery 263*b077aed3SPierre ProncherySets the IV in the associated KDF ctx. 264*b077aed3SPierre Pronchery 265*b077aed3SPierre Pronchery=item "xcghash" (B<OSSL_KDF_PARAM_SSHKDF_XCGHASH>) <octet string> 266*b077aed3SPierre Pronchery 267*b077aed3SPierre ProncherySets the xcghash in the associated KDF ctx. 268*b077aed3SPierre Pronchery 269*b077aed3SPierre Pronchery=item "session_id" (B<OSSL_KDF_PARAM_SSHKDF_SESSION_ID>) <octet string> 270*b077aed3SPierre Pronchery 271*b077aed3SPierre ProncherySets the session ID in the associated KDF ctx. 272*b077aed3SPierre Pronchery 273*b077aed3SPierre Pronchery=item "type" (B<OSSL_KDF_PARAM_SSHKDF_TYPE>) <UTF8 string> 274*b077aed3SPierre Pronchery 275*b077aed3SPierre ProncherySets the SSH KDF type parameter in the associated KDF ctx. 276*b077aed3SPierre ProncheryThere are six supported types: 277*b077aed3SPierre Pronchery 278*b077aed3SPierre Pronchery=over 4 279*b077aed3SPierre Pronchery 280*b077aed3SPierre Pronchery=item EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV 281*b077aed3SPierre Pronchery 282*b077aed3SPierre ProncheryThe Initial IV from client to server. 283*b077aed3SPierre ProncheryA single char of value 65 (ASCII char 'A'). 284*b077aed3SPierre Pronchery 285*b077aed3SPierre Pronchery=item EVP_KDF_SSHKDF_TYPE_INITIAL_IV_SRV_TO_CLI 286*b077aed3SPierre Pronchery 287*b077aed3SPierre ProncheryThe Initial IV from server to client 288*b077aed3SPierre ProncheryA single char of value 66 (ASCII char 'B'). 289*b077aed3SPierre Pronchery 290*b077aed3SPierre Pronchery=item EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_CLI_TO_SRV 291*b077aed3SPierre Pronchery 292*b077aed3SPierre ProncheryThe Encryption Key from client to server 293*b077aed3SPierre ProncheryA single char of value 67 (ASCII char 'C'). 294*b077aed3SPierre Pronchery 295*b077aed3SPierre Pronchery=item EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_SRV_TO_CLI 296*b077aed3SPierre Pronchery 297*b077aed3SPierre ProncheryThe Encryption Key from server to client 298*b077aed3SPierre ProncheryA single char of value 68 (ASCII char 'D'). 299*b077aed3SPierre Pronchery 300*b077aed3SPierre Pronchery=item EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_CLI_TO_SRV 301*b077aed3SPierre Pronchery 302*b077aed3SPierre ProncheryThe Integrity Key from client to server 303*b077aed3SPierre ProncheryA single char of value 69 (ASCII char 'E'). 304*b077aed3SPierre Pronchery 305*b077aed3SPierre Pronchery=item EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_SRV_TO_CLI 306*b077aed3SPierre Pronchery 307*b077aed3SPierre ProncheryThe Integrity Key from client to server 308*b077aed3SPierre ProncheryA single char of value 70 (ASCII char 'F'). 309*b077aed3SPierre Pronchery 310*b077aed3SPierre Pronchery=back 311*b077aed3SPierre Pronchery 312*b077aed3SPierre Pronchery=item "constant" (B<OSSL_KDF_PARAM_CONSTANT>) <octet string> 313*b077aed3SPierre Pronchery 314*b077aed3SPierre ProncherySets the constant value in the associated KDF ctx. 315*b077aed3SPierre Pronchery 316*b077aed3SPierre Pronchery=item "id" (B<OSSL_KDF_PARAM_PKCS12_ID>) <integer> 317*b077aed3SPierre Pronchery 318*b077aed3SPierre ProncherySets the intended usage of the output bits in the associated KDF ctx. 319*b077aed3SPierre ProncheryIt is defined as per RFC 7292 section B.3. 320*b077aed3SPierre Pronchery 321*b077aed3SPierre Pronchery=back 322*b077aed3SPierre Pronchery 323*b077aed3SPierre Pronchery=head1 RETURN VALUES 324*b077aed3SPierre Pronchery 325*b077aed3SPierre ProncheryOSSL_FUNC_kdf_newctx() and OSSL_FUNC_kdf_dupctx() should return the newly created 326*b077aed3SPierre Proncheryprovider side KDF context, or NULL on failure. 327*b077aed3SPierre Pronchery 328*b077aed3SPierre ProncheryOSSL_FUNC_kdf_derive(), OSSL_FUNC_kdf_get_params(), 329*b077aed3SPierre ProncheryOSSL_FUNC_kdf_get_ctx_params() and OSSL_FUNC_kdf_set_ctx_params() should return 1 for 330*b077aed3SPierre Proncherysuccess or 0 on error. 331*b077aed3SPierre Pronchery 332*b077aed3SPierre ProncheryOSSL_FUNC_kdf_gettable_params(), OSSL_FUNC_kdf_gettable_ctx_params() and 333*b077aed3SPierre ProncheryOSSL_FUNC_kdf_settable_ctx_params() should return a constant L<OSSL_PARAM(3)> 334*b077aed3SPierre Proncheryarray, or NULL if none is offered. 335*b077aed3SPierre Pronchery 336*b077aed3SPierre Pronchery=head1 NOTES 337*b077aed3SPierre Pronchery 338*b077aed3SPierre ProncheryThe KDF life-cycle is described in L<life_cycle-kdf(7)>. Providers should 339*b077aed3SPierre Proncheryensure that the various transitions listed there are supported. At some point 340*b077aed3SPierre Proncherythe EVP layer will begin enforcing the listed transitions. 341*b077aed3SPierre Pronchery 342*b077aed3SPierre Pronchery=head1 SEE ALSO 343*b077aed3SPierre Pronchery 344*b077aed3SPierre ProncheryL<provider(7)>, L<life_cycle-kdf(7)>, L<EVP_KDF(3)>. 345*b077aed3SPierre Pronchery 346*b077aed3SPierre Pronchery=head1 HISTORY 347*b077aed3SPierre Pronchery 348*b077aed3SPierre ProncheryThe provider KDF interface was introduced in OpenSSL 3.0. 349*b077aed3SPierre Pronchery 350*b077aed3SPierre Pronchery=head1 COPYRIGHT 351*b077aed3SPierre Pronchery 352*b077aed3SPierre ProncheryCopyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved. 353*b077aed3SPierre Pronchery 354*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 355*b077aed3SPierre Proncherythis file except in compliance with the License. You can obtain a copy 356*b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at 357*b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>. 358*b077aed3SPierre Pronchery 359*b077aed3SPierre Pronchery=cut 360