public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Re: [staging/HTTPS-TLS][PATCH 2/2] NetworkPkg: Continue the session even no local cert found
       [not found] ` <1467873537-32344-3-git-send-email-jiaxin.wu@intel.com>
@ 2016-07-29 22:32   ` Palmer, Thomas
  0 siblings, 0 replies; only message in thread
From: Palmer, Thomas @ 2016-07-29 22:32 UTC (permalink / raw)
  To: Jiaxin Wu, edk2-devel@lists.01.org
  Cc: Samer El-Haj-Mahmoud, Long Qin, Ye Ting, Fu Siyuan

Reviewed by Thomas Palmer <thomas.palmer@hpe.com>

-----Original Message-----
From: Jiaxin Wu [mailto:jiaxin.wu@intel.com] 
Sent: Thursday, July 7, 2016 1:39 AM
To: edk2-devel@lists.01.org
Cc: Palmer, Thomas <thomas.palmer@hpe.com>; Samer El-Haj-Mahmoud <Smahmoud@lenovo.com>; Long Qin <qin.long@intel.com>; Ye Ting <ting.ye@intel.com>; Fu Siyuan <siyuan.fu@intel.com>
Subject: [staging/HTTPS-TLS][PATCH 2/2] NetworkPkg: Continue the session even no local cert found

This patch did following updates:
* To support "Live Certificate" case, allow to continue the session even no local cert found.
* Fix potential assert issue when connection failed.

Cc: Palmer Thomas <thomas.palmer@hpe.com>
Cc: Samer El-Haj-Mahmoud <Smahmoud@lenovo.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
---
 NetworkPkg/HttpDxe/HttpsSupport.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSupport.c
index 36f658c..969225d 100644
--- a/NetworkPkg/HttpDxe/HttpsSupport.c
+++ b/NetworkPkg/HttpDxe/HttpsSupport.c
@@ -531,14 +531,14 @@ TlsConfigureSession (
   if (EFI_ERROR (Status)) {
     goto ERROR;
   }
   
   //
-  // Tls Config Certificate
+  // Tls Config Certificate if 'TlsCaCertificate' variable existed. 
   //
   Status = TlsConfigCertificate (HttpInstance);
-  if (EFI_ERROR (Status)) {
+  if (EFI_ERROR (Status) && Status != EFI_NOT_FOUND) {
     DEBUG ((EFI_D_ERROR, "TLS Certificate Config Error!\n"));
     goto ERROR;
   }
   
   //
@@ -1184,11 +1184,13 @@ TlsConnectSession (
     if(HttpInstance->TlsSessionState == EfiTlsSessionError) {  
       return EFI_ABORTED;    
     }
   }
 
-  ASSERT(HttpInstance->TlsSessionState == EfiTlsSessionDataTransferring);
+  if (HttpInstance->TlsSessionState != EfiTlsSessionDataTransferring) {
+    Status = EFI_ABORTED;
+  }
 
   return Status;
 }
 
 /**
--
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-29 22:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1467873537-32344-1-git-send-email-jiaxin.wu@intel.com>
     [not found] ` <1467873537-32344-3-git-send-email-jiaxin.wu@intel.com>
2016-07-29 22:32   ` [staging/HTTPS-TLS][PATCH 2/2] NetworkPkg: Continue the session even no local cert found Palmer, Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox