diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-06-01 01:32:57 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-06-01 01:32:57 +0200 |
commit | 5c6357de8bda7c5fe0a7fa4ab31b365a9ae8e6fb (patch) | |
tree | f094f350198ff5a6bd3eb943b5ae93ca3f5dbc92 | |
parent | 0ca9977075a51dd9c098641f99d1abfdaf8c892f (diff) | |
download | plan9front-5c6357de8bda7c5fe0a7fa4ab31b365a9ae8e6fb.tar.xz |
devtls: ignore UnrecogniedName (112) alert message (for SNI)
-rw-r--r-- | sys/src/9/port/devtls.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/src/9/port/devtls.c b/sys/src/9/port/devtls.c index d0550a7aa..4cb30b371 100644 --- a/sys/src/9/port/devtls.c +++ b/sys/src/9/port/devtls.c @@ -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: /* |