Codebase list openssl / c2969ff
Fix Typos CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/9288) Antoine Cœur authored 4 years ago Dr. Matthias St. Pierre committed 4 years ago
69 changed file(s) with 89 addition(s) and 89 deletion(s). Raw diff Collapse all Expand all
3838 EVP_KDF_CTRL_SET_PBKDF2_PKCS5_MODE.
3939 [Shane Lontis]
4040
41 *) Default cipher lists/suites are now avaialble via a function, the
41 *) Default cipher lists/suites are now available via a function, the
4242 #defines are deprecated.
4343 [Todd Short]
4444
461461 SSL_set_ciphersuites()
462462 [Matt Caswell]
463463
464 *) Memory allocation failures consistenly add an error to the error
464 *) Memory allocation failures consistently add an error to the error
465465 stack.
466466 [Rich Salz]
467467
00 #### iPhoneOS/iOS
11 #
2 # It takes recent enough XCode to use following two targets. It shouldn't
2 # It takes recent enough Xcode to use following two targets. It shouldn't
33 # be a problem by now, but if they don't work, original targets below
44 # that depend on manual definition of environment variables should still
55 # work...
00 # Windows OneCore targets.
11 #
2 # OneCore is new API stability "contract" that transends Desktop, IoT and
2 # OneCore is new API stability "contract" that transcends Desktop, IoT and
33 # Mobile[?] Windows editions. It's a set up "umbrella" libraries that
44 # export subset of Win32 API that are common to all Windows 10 devices.
55 #
2121 our @generated =
2222 sort ( ( grep { defined $unified_info{generate}->{$_} }
2323 sort keys %generatables ),
24 # Scripts are assumed to be generated, so add thhem too
24 # Scripts are assumed to be generated, so add them too
2525 ( grep { defined $unified_info{sources}->{$_} }
2626 @{$unified_info{scripts}} ) );
2727
837837 goto done;
838838 }
839839 BIO_printf(bio_err, ", Salt length: %d, Cost(N): %ld, "
840 "Block size(r): %ld, Paralelizm(p): %ld",
840 "Block size(r): %ld, Parallelism(p): %ld",
841841 ASN1_STRING_length(kdf->salt),
842842 ASN1_INTEGER_get(kdf->costParameter),
843843 ASN1_INTEGER_get(kdf->blockSize),
18751875 }
18761876
18771877 buflen = lengths[size_num - 1];
1878 if (buflen < 36) /* size of random vector in RSA bencmark */
1878 if (buflen < 36) /* size of random vector in RSA benchmark */
18791879 buflen = 36;
18801880 buflen += MAX_MISALIGNMENT + 1;
18811881 loopargs[i].buf_malloc = app_malloc(buflen, "input buffer");
124124 }
125125 /*
126126 * If expected wasn't set at this point, it means the map
127 * isn't syncronised with the possible options leading here.
127 * isn't synchronised with the possible options leading here.
128128 */
129129 OPENSSL_assert(expected != 0);
130130 }
4242 An empty tree is represented by a NULL root pointer. Inserting a value at
4343 index 0 results in the allocation of a top level node full of null pointers
4444 except for the single pointer to the user's data (N = SA_BLOCK_MAX for
45 breviety):
45 brevity):
4646
4747 +----+
4848 |Root|
3737 # Implement AES_set_[en|de]crypt_key. Key schedule setup is avoided
3838 # for 128-bit keys, if hardware support is detected.
3939
40 # Januray 2009.
40 # January 2009.
4141 #
4242 # Add support for hardware AES192/256 and reschedule instructions to
4343 # minimize/avoid Address Generation Interlock hazard and to favour
4444 # dual-issue z10 pipeline. This gave ~25% improvement on z10 and
4545 # almost 50% on z9. The gain is smaller on z10, because being dual-
4646 # issue z10 makes it impossible to eliminate the interlock condition:
47 # critial path is not long enough. Yet it spends ~24 cycles per byte
47 # critical path is not long enough. Yet it spends ~24 cycles per byte
4848 # processed with 128-bit key.
4949 #
5050 # Unlike previous version hardware support detection takes place only
6666 }
6767 c = y / 100;
6868 y %= 100;
69 /* Zeller's congruance */
69 /* Zeller's congruence */
7070 tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7;
7171 }
7272
783783 * reasons. When BIO_CTRL_DGRAM_SET_PEEK_MODE was first defined its value
784784 * was incorrectly clashing with BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE. The
785785 * value has been updated to a non-clashing value. However to preserve
786 * binary compatiblity we now respond to both the old value and the new one
786 * binary compatibility we now respond to both the old value and the new one
787787 */
788788 case BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE:
789789 case BIO_CTRL_DGRAM_SET_PEEK_MODE:
799799 #if 0
800800 /*
801801 * The bn_div_3_words entry point is re-used for constant-time interface.
802 * Implementation is retained as hystorical reference.
802 * Implementation is retained as historical reference.
803803 */
804804 .align 5
805805 .globl bn_div_3_words
257257 *
258258 * - availability of constant-time bn_div_3_words;
259259 * - dividend is at least as "wide" as divisor, limb-wise, zero-padded
260 * if so requied, which shouldn't be a privacy problem, because
260 * if so required, which shouldn't be a privacy problem, because
261261 * divisor's length is considered public;
262262 */
263263 int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
294294 (b) > 23 ? 3 : 1)
295295
296296 /*
297 * BN_mod_exp_mont_conttime is based on the assumption that the L1 data cache
297 * BN_mod_exp_mont_consttime is based on the assumption that the L1 data cache
298298 * line width of the target processor is at least the following value.
299299 */
300300 # define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH ( 64 )
247247 * one bit longer than the modulus.
248248 *
249249 * There are some concerns about the efficacy of doing this. More
250 * specificly refer to the discussion starting with:
250 * specifically refer to the discussion starting with:
251251 * https://github.com/openssl/openssl/pull/7486#discussion_r228323705
252252 * The fix is to rework BN so these gymnastics aren't required.
253253 */
13001300
13011301 ################################# reduction
13021302 mulx 8*0+128(%r14), $t0, $t1
1303 adcx $t0, $acc3 # guranteed to be zero
1303 adcx $t0, $acc3 # guaranteed to be zero
13041304 adox $t1, $acc4
13051305
13061306 mulx 8*1+128(%r14), $t0, $t1
450450 and $t0,$t0,$t1
451451 sldi $a3,$a3,1
452452 add $t0,$t0,$t1 # compare to modulus in the same go
453 srdi $a3,$a3,1 # most signifcant bit cleared
453 srdi $a3,$a3,1 # most significant bit cleared
454454
455455 addc $a0,$a0,$t0
456456 addze $a1,$a1
461461 sradi $t0,$a3,63 # most significant bit -> mask
462462 sldi $a3,$a3,1
463463 andc $t0,$t1,$t0
464 srdi $a3,$a3,1 # most signifcant bit cleared
464 srdi $a3,$a3,1 # most significant bit cleared
465465
466466 subi $rp,$rp,1
467467 subfc $a0,$t0,$a0
153153 int (*field_div) (const EC_GROUP *, BIGNUM *r, const BIGNUM *a,
154154 const BIGNUM *b, BN_CTX *);
155155 /*-
156 * 'field_inv' computes the multipicative inverse of a in the field,
156 * 'field_inv' computes the multiplicative inverse of a in the field,
157157 * storing the result in r.
158158 *
159159 * If 'a' is zero (or equivalent), you'll get an EC_R_CANNOT_INVERT error.
12681268 * ffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb
12691269 * 71e913863f7, in that case the penultimate intermediate is -9G and
12701270 * the final digit is also -9G. Since this only happens for a single
1271 * scalar, the timing leak is irrelevent. (Any attacker who wanted to
1271 * scalar, the timing leak is irrelevant. (Any attacker who wanted to
12721272 * check whether a secret scalar was that exact value, can already do
12731273 * so.)
12741274 */
531531 X509_ALGOR_set0(alg1, OBJ_nid2obj(NID_ED25519), V_ASN1_UNDEF, NULL);
532532 if (alg2)
533533 X509_ALGOR_set0(alg2, OBJ_nid2obj(NID_ED25519), V_ASN1_UNDEF, NULL);
534 /* Algorithm idetifiers set: carry on as normal */
534 /* Algorithm identifiers set: carry on as normal */
535535 return 3;
536536 }
537537
24382438 EVP_R_ONLY_ONESHOT_SUPPORTED:177:only oneshot supported
24392439 EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE:150:\
24402440 operation not supported for this keytype
2441 EVP_R_OPERATON_NOT_INITIALIZED:151:operaton not initialized
2441 EVP_R_OPERATON_NOT_INITIALIZED:151:operation not initialized
24422442 EVP_R_PARAMETER_TOO_LARGE:187:parameter too large
24432443 EVP_R_PARTIALLY_OVERLAPPING:162:partially overlapping buffers
24442444 EVP_R_PBKDF2_ERROR:181:pbkdf2 error
283283 {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),
284284 "operation not supported for this keytype"},
285285 {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OPERATON_NOT_INITIALIZED),
286 "operaton not initialized"},
286 "operation not initialized"},
287287 {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PARAMETER_TOO_LARGE),
288288 "parameter too large"},
289289 {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PARTIALLY_OVERLAPPING),
138138 * destructor for threads terminating before libcrypto is initialized or
139139 * after it's de-initialized. Access to the key doesn't have to be
140140 * serialized for the said threads, because they didn't use libcrypto
141 * and it doesn't matter if they pick "impossible" or derefernce real
141 * and it doesn't matter if they pick "impossible" or dereference real
142142 * key value and pull NULL past initialization in the first thread that
143143 * intends to use libcrypto.
144144 */
1818
1919 /*
2020 * A hashing implementation that appears to be based on the linear hashing
21 * alogrithm:
21 * algorithm:
2222 * https://en.wikipedia.org/wiki/Linear_hashing
2323 *
2424 * Litwin, Witold (1980), "Linear hashing: A new tool for file and table
2525 * addressing", Proc. 6th Conference on Very Large Databases: 212-223
26 * http://hackthology.com/pdfs/Litwin-1980-Linear_Hashing.pdf
26 * https://hackthology.com/pdfs/Litwin-1980-Linear_Hashing.pdf
2727 *
28 * From the wikipedia article "Linear hashing is used in the BDB Berkeley
28 * From the Wikipedia article "Linear hashing is used in the BDB Berkeley
2929 * database system, which in turn is used by many software systems such as
3030 * OpenLDAP, using a C implementation derived from the CACM article and first
3131 * published on the Usenet in 1988 by Esmond Pitt."
968968 addi $t1,$ctx,`48+(12^$BIG_ENDIAN)`
969969 bl __poly1305_splat
970970
971 bl __poly1305_mul # caclulate r^2
971 bl __poly1305_mul # calculate r^2
972972 addi $t1,$ctx,`48+(4^$BIG_ENDIAN)`
973973 bl __poly1305_splat
974974
975 bl __poly1305_mul # caclulate r^3
975 bl __poly1305_mul # calculate r^3
976976 addi $t1,$ctx,`48+(8^$BIG_ENDIAN)`
977977 bl __poly1305_splat
978978
979 bl __poly1305_mul # caclulate r^4
979 bl __poly1305_mul # calculate r^4
980980 addi $t1,$ctx,`48+(0^$BIG_ENDIAN)`
981981 bl __poly1305_splat
982982
545545 /*
546546 * NIST SP800-90Ar1 section 9.1 says you can combine getting the entropy
547547 * and nonce in 1 call by increasing the entropy with 50% and increasing
548 * the minimum length to accomadate the length of the nonce.
548 * the minimum length to accommodate the length of the nonce.
549549 * We do this in case a nonce is require and get_nonce is NULL.
550550 */
551551 if (drbg->min_noncelen > 0 && drbg->get_nonce == NULL) {
291291
292292 /* TODO(3.0): Do we need to handle this somehow in the FIPS module? */
293293 /*
294 * RAND_close_seed_files() ensures that any seed file decriptors are
294 * RAND_close_seed_files() ensures that any seed file descriptors are
295295 * closed after use.
296296 */
297297 void RAND_keep_random_devices_open(int keep)
255255 *
256256 * This strategy has the following goals:
257257 *
258 * 1. 1024-bit factors are effcient when using 3072 and 4096-bit key
258 * 1. 1024-bit factors are efficient when using 3072 and 4096-bit key
259259 * 2. stay the same logic with normal 2-prime key
260260 */
261261 bitse -= bitsr[i];
2626 # over 2x than 32-bit code. X[16] resides on stack, but access to it
2727 # is scheduled for L2 latency and staged through 32 least significant
2828 # bits of %l0-%l7. The latter is done to achieve 32-/64-bit ABI
29 # duality. Nevetheless it's ~40% faster than SHA256, which is pretty
29 # duality. Nevertheless it's ~40% faster than SHA256, which is pretty
3030 # good [optimal coefficient is 50%].
3131 #
3232 # SHA512 on UltraSPARC T1.
312312
313313 /*
314314 * B1: verify whether r' in [1,n-1], verification failed if not
315 * B2: vefify whether s' in [1,n-1], verification failed if not
315 * B2: verify whether s' in [1,n-1], verification failed if not
316316 * B3: set M'~=ZA || M'
317317 * B4: calculate e'=Hv(M'~)
318318 * B5: calculate t = (r' + s') modn, verification failed if t=0
319319 * B6: calculate the point (x1', y1')=[s']G + [t]PA
320 * B7: calculate R=(e'+x1') modn, verfication pass if yes, otherwise failed
320 * B7: calculate R=(e'+x1') modn, verification pass if yes, otherwise failed
321321 */
322322
323323 ECDSA_SIG_get0(sig, &r, &s);
1212 #include "internal/sparse_array.h"
1313
1414 /*
15 * How many bits are used to index each level in the tree structre?
15 * How many bits are used to index each level in the tree structure?
1616 * This setting determines the number of pointers stored in each node of the
1717 * tree used to represent the sparse array. Having more pointers reduces the
1818 * depth of the tree but potentially wastes more memory. That is, this is a
171171 typedef int (*file_eof_fn)(void *handler_ctx);
172172 /*
173173 * The destroy_ctx function is used to destroy the handler_ctx that was
174 * intiated by a repeatable try_decode fuction. This is only used when
174 * initiated by a repeatable try_decode function. This is only used when
175175 * the handler is marked repeatable.
176176 */
177177 typedef void (*file_destroy_ctx_fn)(void **handler_ctx);
469469 };
470470
471471 /*
472 * Public key decoder. Only supports SubjectPublicKeyInfo formated keys.
472 * Public key decoder. Only supports SubjectPublicKeyInfo formatted keys.
473473 */
474474 static OSSL_STORE_INFO *try_decode_PUBKEY(const char *pem_name,
475475 const char *pem_header,
3636 server-cmod.exe : server-cmod.obj
3737 server-conf.exe : server-conf.obj
3838
39 # Stoopid MMS doesn't infer this automatically...
39 # MMS doesn't infer this automatically...
4040 client-arg.obj : client-arg.c
4141 client-conf.obj : client-conf.c
4242 saccept.obj : saccept.c
8383 EVP_CIPHER_CTX *ctx;
8484 int outlen, tmplen, rv;
8585 unsigned char outbuf[1024];
86 printf("AES GCM Derypt:\n");
86 printf("AES GCM Decrypt:\n");
8787 printf("Ciphertext:\n");
8888 BIO_dump_fp(stdout, gcm_ct, sizeof(gcm_ct));
8989 ctx = EVP_CIPHER_CTX_new();
2828 library to be added and removed dynamically.
2929 Each such data item must have a corresponding CRYPTO_EX_DATA index
3030 associated with it. Unlike normal CRYPTO_EX_DATA objects we use static indexes
31 to identify data items. These are mapped transparetnly to CRYPTO_EX_DATA dynamic
31 to identify data items. These are mapped transparently to CRYPTO_EX_DATA dynamic
3232 indexes internally to the implementation.
3333 See the example further down to see how that's done.
3434
134134
135135 This function is expected to set the method's reference count to 1.
136136
137 =item desctruct()
137 =item destruct()
138138
139139 Decrement the I<method>'s reference count, and destruct it when
140140 the reference count reaches zero.
140140
141141 =item *
142142
143 If no intialization function was given with ossl_provider_new(), a
143 If no initialization function was given with ossl_provider_new(), a
144144 loadable module with the I<name> that was given to ossl_provider_new()
145145 will be located and loaded, then the symbol B<OSSL_provider_init> will
146146 be located in that module, and called.
7575
7676 =item B<cipher:string>
7777
78 Used by CMAC and GMAC to specifiy the cipher algorithm.
78 Used by CMAC and GMAC to specify the cipher algorithm.
7979 For CMAC it must be one of AES-128-CBC, AES-192-CBC, AES-256-CBC or
8080 DES-EDE3-CBC.
8181 For GMAC it should be a GCM mode cipher e.g. AES-128-GCM.
129129 functions free any existing value and set the pointer to the specified value.
130130
131131 The B<ADMISSION> type has an authority name, authority object, and a
132 stack of B<PROFSSION_INFO> items.
132 stack of B<PROFESSION_INFO> items.
133133 The ADMISSIONS_get0_admissionAuthority(), ADMISSIONS_get0_namingAuthority(),
134134 and ADMISSIONS_get0_professionInfos()
135135 functions return pointers to those values within the object.
108108 flag set can have unexpected outcome when the reads and writes to the
109109 BIO are intertwined. As documented above the BIO will be reset to the
110110 state after the last completed write operation. The effects of reads
111 preceeding that write operation cannot be undone.
111 preceding that write operation cannot be undone.
112112
113113 Calling BIO_get_mem_ptr() prior to a BIO_reset() call with
114114 BIO_FLAGS_NONCLEAR_RST set has the same effect as a write operation.
3434
3535 The digest B<type> may be NULL if the signing algorithm supports it.
3636
37 No B<EVP_PKEY_CTX> will be created by EVP_DigsetSignInit() if the passed B<ctx>
37 No B<EVP_PKEY_CTX> will be created by EVP_DigestSignInit() if the passed B<ctx>
3838 has already been assigned one via L<EVP_MD_CTX_set_ctx(3)>. See also L<SM2(7)>.
3939
4040 Only EVP_PKEY types that support signing can be used with these functions. This
3131 inside EVP_DigestVerifyInit() and it will be freed automatically when the
3232 EVP_MD_CTX is freed).
3333
34 No B<EVP_PKEY_CTX> will be created by EVP_DigsetSignInit() if the passed B<ctx>
34 No B<EVP_PKEY_CTX> will be created by EVP_DigestSignInit() if the passed B<ctx>
3535 has already been assigned one via L<EVP_MD_CTX_set_ctx(3)>. See also L<SM2(7)>.
3636
3737 EVP_DigestVerifyUpdate() hashes B<cnt> bytes of data at B<d> into the
139139
140140 Where an application that previously used implicit fetch is converted to use
141141 explicit fetch care should be taken with the L<EVP_MD_CTX_md(3)> function.
142 Specifically, this function returns the EVP_MD object orginally passed to
142 Specifically, this function returns the EVP_MD object originally passed to
143143 EVP_DigestInit_ex() (or other similar function). With implicit fetch the
144144 returned EVP_MD object is guaranteed to be available throughout the application
145145 lifetime. However, with explicit fetch EVP_MD objects are reference counted.
198198 EVP_MD_meth_free(md);
199199
200200 Note that in the above example the property string "legacy=yes" is optional
201 since, assuming no other providers have been loaded, the only implmentation of
201 since, assuming no other providers have been loaded, the only implementation of
202202 the "whirlpool" algorithm is in the "legacy" provider. Also note that the
203203 default provider should be explicitly loaded if it is required in addition to
204204 other providers:
2828
2929 =item EVP_md5_sha1()
3030
31 A hash algorithm of SSL v3 that combines MD5 with SHA-1 as decirbed in RFC
31 A hash algorithm of SSL v3 that combines MD5 with SHA-1 as described in RFC
3232 6101.
3333
3434 WARNING: this algorithm is not intended for non-SSL usage.
2121
2222 OSSL_CRMF_pbm_new() generates a PBM (Password-Based MAC) based on given PBM
2323 parameters B<pbmp>, message B<msg>, and secret B<sec>, along with the respective
24 lengths B<msglen> and B<seclen>. On success writes the adddress of the newly
24 lengths B<msglen> and B<seclen>. On success writes the address of the newly
2525 allocated MAC via the B<mac> reference parameter and writes the length via the
2626 B<maclen> reference parameter unless it its NULL.
2727
185185 The value is copied to the address B<val>.
186186 Type coercion takes place as discussed in the NOTES section.
187187
188 OSSL_PARAM_set_TYPE() stores a value B<val> of type B<TYPE> into the paramter
188 OSSL_PARAM_set_TYPE() stores a value B<val> of type B<TYPE> into the parameter
189189 B<p>.
190190 Type coercion takes place as discussed in the NOTES section.
191191
193193 The BIGNUM referenced by B<val> is updated and is allocated if B<*val> is
194194 B<NULL>.
195195
196 OSSL_PARAM_set_BN() stores the BIGNUM B<val> into the paramater B<p>.
196 OSSL_PARAM_set_BN() stores the BIGNUM B<val> into the parameter B<p>.
197197
198198 OSSL_PARAM_get_utf8_string() retrieves a UTF8 string from the parameter
199199 pointed to by B<p>.
9494 takes a B<UI_METHOD> and associated data, to be used any time
9595 something needs to be prompted for.
9696 Furthermore, this function is expected to initialize what needs to be
97 initialized, to create a privata data store (B<OSSL_STORE_LOADER_CTX>, see
97 initialized, to create a private data store (B<OSSL_STORE_LOADER_CTX>, see
9898 above), and to return it.
9999 If something goes wrong, this function is expected to return NULL.
100100
3131
3232 OSSL_STORE_supports_search() checks if the loader of the given OSSL_STORE
3333 context supports the given search type.
34 See L<OSSL_STORE_SEARCH/SUPPORED CRITERION TYPES> for information on the
34 See L<OSSL_STORE_SEARCH/SUPPORTED CRITERION TYPES> for information on the
3535 supported search criterion types.
3636
3737 OSSL_STORE_expect() and OSSL_STORE_find I<must> be called before the first
110110 The derivation function is disabled during initialization by calling the
111111 RAND_DRBG_set() function with the RAND_DRBG_FLAG_CTR_NO_DF flag.
112112 For more information on the derivation function and when it can be omitted,
113 see [NIST SP 800-90A Rev. 1]. Roughly speeking it can be omitted if the random
113 see [NIST SP 800-90A Rev. 1]. Roughly speaking it can be omitted if the random
114114 source has "full entropy", i.e., contains 8 bits of entropy per byte.
115115
116116 Even if a nonce is required, the B<get_nonce>() and B<cleanup_nonce>()
3535
3636 SSL_CTX_set_ciphersuites() is used to configure the available TLSv1.3
3737 ciphersuites for B<ctx>. This is a simple colon (":") separated list of TLSv1.3
38 ciphersuite names in order of perference. Valid TLSv1.3 ciphersuite names are:
38 ciphersuite names in order of preference. Valid TLSv1.3 ciphersuite names are:
3939
4040 =over 4
4141
110110
111111 The SSL_set_srp_server_param_pw() function sets all SRP parameters for the
112112 connection B<s> by generating a random salt and a password verifier.
113 B<user> is the username, B<pass> the password and B<grp> the SRP group paramters
113 B<user> is the username, B<pass> the password and B<grp> the SRP group parameters
114114 identifier for L<SRP_get_default_gN(3)>.
115115
116116 The SSL_get_srp_g() function returns the SRP group generator for B<s>, or from
55 SSL_SESSION_set1_hostname,
66 SSL_SESSION_get0_alpn_selected,
77 SSL_SESSION_set1_alpn_selected
8 - get and set SNI and ALPN data ssociated with a session
8 - get and set SNI and ALPN data associated with a session
99
1010 =head1 SYNOPSIS
1111
124124 =item E<lt> 0
125125
126126 The write operation was not successful, because either the connection was
127 closed, an error occured or action must be taken by the calling process.
127 closed, an error occurred or action must be taken by the calling process.
128128 Call SSL_get_error() with the return value to find out the reason.
129129
130130 =back
1010 during the execution of a key establishment scheme) and fixedinfo.
1111 SSKDF is also informally referred to as 'Concat KDF'.
1212
13 =head2 Auxilary function
13 =head2 Auxiliary function
1414
1515 The implementation uses a selectable auxiliary function H, which can be one of:
1616
6767
6868 =over 4
6969
70 =item EVP_KDF_SSHKDF_TYPE_ININITAL_IV_CLI_TO_SRV
70 =item EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV
7171
7272 The Initial IV from client to server.
7373 A single char of value 65 (ASCII char 'A').
7474
75 =item EVP_KDF_SSHKDF_TYPE_ININITAL_IV_SRV_TO_CLI
75 =item EVP_KDF_SSHKDF_TYPE_INITIAL_IV_SRV_TO_CLI
7676
7777 The Initial IV from server to client
7878 A single char of value 66 (ASCII char 'B').
102102 EVP_KDF_ctrl_str() type string: "type"
103103
104104 The value is a string of length one character. The only valid values
105 are the numerical values of the ASCII caracters: "A" (65) to "F" (70).
105 are the numerical values of the ASCII characters: "A" (65) to "F" (70).
106106
107107 =back
108108
141141 if (EVP_KDF_CTX_set1_sshkdf_session_id(kctx, session_id, 32) <= 0)
142142 /* Error */
143143 if (EVP_KDF_CTX_set_sshkdf_type(kctx,
144 EVP_KDF_SSHKDF_TYPE_ININITAL_IV_CLI_TO_SRV) <= 0)
144 EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV) <= 0)
145145 /* Error */
146146 if (EVP_KDF_derive(kctx, out, &outlen) <= 0)
147147 /* Error */
7070
7171 =head1 NOTES
7272
73 X963KDF is very similar to the SSKDF that uses a digest as the auxilary function,
73 X963KDF is very similar to the SSKDF that uses a digest as the auxiliary function,
7474 X963KDF appends the counter to the secret, whereas SSKDF prepends the counter.
7575
7676 A context for X963KDF can be obtained by calling:
6767 match counts in favor of the algorithm.
6868 More details about that in the B<Lookups> section.
6969 A I<property query> is a sequence of comma separated property query clauses.
70 The full syntax for property queries appears below, but the available syntatic
70 The full syntax for property queries appears below, but the available syntactic
7171 features are:
7272
7373 =over 4
128128 the local clause overrides the context clause.
129129
130130 It is possible for a local property query to remove a clause in the context
131 property query by preceeding the property name with a '-'.
131 property query by preceding the property name with a '-'.
132132 For example, a context property query that contains "fips=yes" would normally
133133 result in implementations that have "fips=yes".
134134
5858
5959 enum devcrypto_accelerated_t {
6060 DEVCRYPTO_NOT_ACCELERATED = -1, /* software implemented */
61 DEVCRYPTO_ACCELERATION_UNKNOWN = 0, /* acceleration support unkown */
61 DEVCRYPTO_ACCELERATION_UNKNOWN = 0, /* acceleration support unknown */
6262 DEVCRYPTO_ACCELERATED = 1 /* hardware accelerated */
6363 } accelerated;
6464
2727 int ossl_method_store_set_global_properties(OSSL_METHOD_STORE *store,
2828 const char *prop_query);
2929
30 /* proeprty query cache functions */
30 /* property query cache functions */
3131 int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, int nid,
3232 const char *prop_query, void **result);
3333 int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, int nid,
7171 * function defined via DEFINE_ONCE_STATIC where both functions use the same
7272 * CRYPTO_ONCE object to synchronise. Where an alternative initialiser function
7373 * is used only one of the primary or the alternative initialiser function will
74 * ever be called - and that function will be called exactly once. Definitition
74 * ever be called - and that function will be called exactly once. Definition
7575 * of an alternative initialiser function MUST occur AFTER the definition of the
76 * primiary initialiser function.
76 * primary initialiser function.
7777 *
7878 * Typical usage might be:
7979 *
1717 * if (var == NOT_YET_INITIALIZED)
1818 * var = function_returning_same_value();
1919 *
20 * This does work provided that loads and stores are single-instuction
20 * This does work provided that loads and stores are single-instruction
2121 * operations (and integer ones are on *all* supported platforms), but
2222 * it upsets Thread Sanitizer. Suggested solution is
2323 *
2323 int expected_type; /* expected type after set/set_string_gmt */
2424 int check_result; /* check result */
2525 time_t t; /* expected time_t*/
26 int cmp_result; /* compariston to baseline result */
27 int convert_result; /* convertion result */
26 int cmp_result; /* comparison to baseline result */
27 int convert_result; /* conversion result */
2828 };
2929
3030 static struct testdata tbl_testdata_pos[] = {
331331 * Personalisation string tests
332332 */
333333
334 /* Test detection of too large personlisation string */
334 /* Test detection of too large personalisation string */
335335 if (!init(drbg, td, &t)
336336 || RAND_DRBG_instantiate(drbg, td->pers, drbg->max_perslen + 1) > 0)
337337 goto err;
9595
9696 /*
9797 * Create the connection. We use "create_bare_ssl_connection" here so that
98 * we can force the connection to not do "SSL_read" once partly conencted.
98 * we can force the connection to not do "SSL_read" once partly connected.
9999 * We don't want to accidentally read the dummy records we injected because
100100 * they will fail to decrypt.
101101 */
11771177 md = NULL;
11781178
11791179 /*
1180 * Explicitly asking for the default implementation should succeeed except
1180 * Explicitly asking for the default implementation should succeed except
11811181 * in test 4 where the default provider is not loaded.
11821182 */
11831183 md = EVP_MD_fetch(ctx, "SHA256", "default=yes");
4545 double p2;
4646 /*
4747 * Documented as an arbitrarly large unsigned integer.
48 * The data size must be large enough to accomodate.
48 * The data size must be large enough to accommodate.
4949 * Assumed data type OSSL_PARAM_UNSIGNED_INTEGER
5050 */
5151 BIGNUM *p3;
5252 /*
5353 * Documented as a C string.
54 * The data size must be large enough to accomodate.
54 * The data size must be large enough to accommodate.
5555 * Assumed data type OSSL_PARAM_UTF8_STRING
5656 */
5757 char *p4;
292292
293293 /* In all our tests, these are variables that get manipulated as parameters
294294 *
295 * These arrays consistenly do nothing with the "p2" parameter, and
295 * These arrays consistently do nothing with the "p2" parameter, and
296296 * always include a "foo" parameter. This is to check that the
297297 * set_params and get_params calls ignore the lack of parameters that
298298 * the application isn't interested in, as well as ignore parameters
10351035 /*
10361036 * We attempt to read some data on the client side which we expect to fail.
10371037 * This will ensure we have received the NewSessionTicket in TLSv1.3 where
1038 * appropriate. We do this twice because there are 2 NewSesionTickets.
1038 * appropriate. We do this twice because there are 2 NewSessionTickets.
10391039 */
10401040 for (i = 0; i < 2; i++) {
10411041 if (SSL_read_ex(clientssl, &buf, sizeof(buf), &readbytes) > 0) {
1616 #define KEYLEN 16
1717
1818 /*
19 * Based on the test vectors availble in:
19 * Based on the test vectors available in:
2020 * https://tools.ietf.org/html/draft-ietf-tls-tls13-vectors-06
2121 */
2222
164164
165165 =item B<create =E<gt> 0|1>
166166
167 When set to 1 (or any value that perl preceives as true), the subdirectory
167 When set to 1 (or any value that perl perceives as true), the subdirectory
168168 will be created if it doesn't already exist. This happens before BLOCK
169169 is executed.
170170
171171 =item B<cleanup =E<gt> 0|1>
172172
173 When set to 1 (or any value that perl preceives as true), the subdirectory
173 When set to 1 (or any value that perl perceives as true), the subdirectory
174174 will be cleaned out and removed. This happens both before and after BLOCK
175175 is executed.
176176