]> git.lizzy.rs Git - plan9front.git/commitdiff
devtls: ignore UnrecogniedName (112) alert message (for SNI)
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sun, 31 May 2015 23:32:57 +0000 (01:32 +0200)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sun, 31 May 2015 23:32:57 +0000 (01:32 +0200)
sys/src/9/port/devtls.c

index d0550a7aa16ad46ec6a0ebdda692780c97b8ccd9..4cb30b371aee620fc89008c46caec9a780635845 100644 (file)
@@ -73,6 +73,7 @@ enum {
        EInternalError                  = 80,
        EUserCanceled                   = 90,
        ENoRenegotiation                = 100,
+       EUnrecognizedName               = 112,
 
        EMAX = 256
 };
@@ -850,18 +851,25 @@ if(tr->debug) pdump(unpad_len, p, "decrypted:");
                /*
                 * propagate non-fatal alerts to handshaker
                 */
-               if(p[1] == ECloseNotify) {
+               switch(p[1]){
+               case ECloseNotify:
                        tlsclosed(tr, SRClose);
                        if(tr->opened)
                                error("tls hungup");
                        error("close notify");
-               }
-               if(p[1] == ENoRenegotiation)
+                       break;
+               case ENoRenegotiation:
                        alertHand(tr, "no renegotiation");
-               else if(p[1] == EUserCanceled)
+                       break;
+               case EUserCanceled:
                        alertHand(tr, "handshake canceled by user");
-               else
+                       break;
+               case EUnrecognizedName:
+                       /* happens in response to SNI, can be ignored. */
+                       break;
+               default:
                        rcvError(tr, EIllegalParameter, "invalid alert code");
+               }
                break;
        case RHandshake:
                /*