File tree Expand file tree Collapse file tree 2 files changed +57
-1
lines changed Expand file tree Collapse file tree 2 files changed +57
-1
lines changed Original file line number Diff line number Diff line change @@ -396,6 +396,26 @@ TlsSetVerify (
396
396
IN UINT32 VerifyMode
397
397
);
398
398
399
+ /**
400
+ Set the specified host name to be verified.
401
+
402
+ @param[in] Tls Pointer to the TLS object.
403
+ @param[in] Flags The setting flags during the validation.
404
+ @param[in] HostName The specified host name to be verified.
405
+
406
+ @retval EFI_SUCCESS The HostName setting was set successfully.
407
+ @retval EFI_INVALID_PARAMETER The parameter is invalid.
408
+ @retval EFI_ABORTED Invalid HostName setting.
409
+
410
+ **/
411
+ EFI_STATUS
412
+ EFIAPI
413
+ TlsSetVerifyHost (
414
+ IN VOID * Tls ,
415
+ IN UINT32 Flags ,
416
+ IN CHAR8 * HostName
417
+ );
418
+
399
419
/**
400
420
Sets a TLS/SSL session ID to be used during TLS/SSL connect.
401
421
Original file line number Diff line number Diff line change 1
1
/** @file
2
2
SSL/TLS Configuration Library Wrapper Implementation over OpenSSL.
3
3
4
- Copyright (c) 2016 - 2017 , Intel Corporation. All rights reserved.<BR>
4
+ Copyright (c) 2016 - 2018 , Intel Corporation. All rights reserved.<BR>
5
5
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
6
6
SPDX-License-Identifier: BSD-2-Clause-Patent
7
7
@@ -497,6 +497,42 @@ TlsSetVerify (
497
497
SSL_set_verify (TlsConn -> Ssl , VerifyMode , NULL );
498
498
}
499
499
500
+ /**
501
+ Set the specified host name to be verified.
502
+
503
+ @param[in] Tls Pointer to the TLS object.
504
+ @param[in] Flags The setting flags during the validation.
505
+ @param[in] HostName The specified host name to be verified.
506
+
507
+ @retval EFI_SUCCESS The HostName setting was set successfully.
508
+ @retval EFI_INVALID_PARAMETER The parameter is invalid.
509
+ @retval EFI_ABORTED Invalid HostName setting.
510
+
511
+ **/
512
+ EFI_STATUS
513
+ EFIAPI
514
+ TlsSetVerifyHost (
515
+ IN VOID * Tls ,
516
+ IN UINT32 Flags ,
517
+ IN CHAR8 * HostName
518
+ )
519
+ {
520
+ TLS_CONNECTION * TlsConn ;
521
+
522
+ TlsConn = (TLS_CONNECTION * ) Tls ;
523
+ if (TlsConn == NULL || TlsConn -> Ssl == NULL || HostName == NULL ) {
524
+ return EFI_INVALID_PARAMETER ;
525
+ }
526
+
527
+ SSL_set_hostflags (TlsConn -> Ssl , Flags );
528
+
529
+ if (SSL_set1_host (TlsConn -> Ssl , HostName ) == 0 ) {
530
+ return EFI_ABORTED ;
531
+ }
532
+
533
+ return EFI_SUCCESS ;
534
+ }
535
+
500
536
/**
501
537
Sets a TLS/SSL session ID to be used during TLS/SSL connect.
502
538
You can’t perform that action at this time.
0 commit comments