@@ -430,29 +430,7 @@ CxPlatTlsSecConfigCreate(
430
430
431
431
QUIC_STATUS Status = QUIC_STATUS_SUCCESS ;
432
432
433
- if (CredConfig -> Flags & QUIC_CREDENTIAL_FLAG_CLIENT ) {
434
-
435
- if (CredConfig -> TicketKey != NULL &&
436
- !FFI_mitls_set_sealing_key ("AES256-GCM" , (uint8_t * )CredConfig -> TicketKey , 44 )) {
437
- QuicTraceEvent (
438
- LibraryError ,
439
- "[ lib] ERROR, %s." ,
440
- "FFI_mitls_set_sealing_key failed" );
441
- Status = QUIC_STATUS_INVALID_STATE ;
442
- goto Error ;
443
- }
444
-
445
- } else {
446
-
447
- if (CredConfig -> TicketKey != NULL &&
448
- !FFI_mitls_set_ticket_key ("AES256-GCM" , (uint8_t * )CredConfig -> TicketKey , 44 )) {
449
- QuicTraceEvent (
450
- LibraryError ,
451
- "[ lib] ERROR, %s." ,
452
- "FFI_mitls_set_ticket_key failed" );
453
- Status = QUIC_STATUS_INVALID_STATE ;
454
- goto Error ;
455
- }
433
+ if (!(CredConfig -> Flags & QUIC_CREDENTIAL_FLAG_CLIENT )) {
456
434
457
435
Status = CxPlatCertCreate (CredConfig , & SecurityConfig -> Certificate );
458
436
if (QUIC_FAILED (Status )) {
@@ -512,6 +490,45 @@ CxPlatTlsSecConfigDelete(
512
490
CXPLAT_FREE (SecurityConfig , QUIC_POOL_TLS_SECCONF );
513
491
}
514
492
493
+ const uint8_t miTlsTicketKeyLength = 44 ;
494
+
495
+ _IRQL_requires_max_ (PASSIVE_LEVEL )
496
+ QUIC_STATUS
497
+ CxPlatTlsSecConfigSetTicketKeys (
498
+ _In_ CXPLAT_SEC_CONFIG * SecurityConfig ,
499
+ _In_reads_ (KeyCount ) QUIC_TICKET_KEY_CONFIG * KeyConfig ,
500
+ _In_ uint8_t KeyCount
501
+ )
502
+ {
503
+ CXPLAT_DBG_ASSERT (KeyCount >= 1 );
504
+ UNREFERENCED_PARAMETER (KeyCount );
505
+
506
+ if (KeyConfig -> MaterialLength < miTlsTicketKeyLength ) {
507
+ return QUIC_STATUS_INVALID_PARAMETER ;
508
+ }
509
+
510
+ if (SecurityConfig -> Flags & QUIC_CREDENTIAL_FLAG_CLIENT ) {
511
+ if (!FFI_mitls_set_sealing_key ("AES256-GCM" , KeyConfig -> Material , miTlsTicketKeyLength )) {
512
+ QuicTraceEvent (
513
+ LibraryError ,
514
+ "[ lib] ERROR, %s." ,
515
+ "FFI_mitls_set_sealing_key failed" );
516
+ return QUIC_STATUS_INVALID_STATE ;
517
+ }
518
+
519
+ } else {
520
+ if (!FFI_mitls_set_ticket_key ("AES256-GCM" , KeyConfig -> Material , miTlsTicketKeyLength )) {
521
+ QuicTraceEvent (
522
+ LibraryError ,
523
+ "[ lib] ERROR, %s." ,
524
+ "FFI_mitls_set_ticket_key failed" );
525
+ return QUIC_STATUS_INVALID_STATE ;
526
+ }
527
+ }
528
+
529
+ return QUIC_STATUS_SUCCESS ;
530
+ }
531
+
515
532
_IRQL_requires_max_ (PASSIVE_LEVEL )
516
533
QUIC_STATUS
517
534
CxPlatTlsInitialize (
0 commit comments