aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_alerts.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-12-28 16:08:42 +0000
committerlloyd <[email protected]>2011-12-28 16:08:42 +0000
commit5ee3046bc9b8517bb6de5eda34f03ee907f9ff16 (patch)
tree1ce7355bd7198ea195eb26078fe14891d975c4f8 /src/tls/tls_alerts.h
parent19b985eae73839fdd7547f48b999377c4d1ff47e (diff)
Working though hacking client verify (server side only). Only supports
TLS 1.0/1.1, SSLv3 uses a different hash format. Only RSA certs tested so far.
Diffstat (limited to 'src/tls/tls_alerts.h')
-rw-r--r--src/tls/tls_alerts.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/tls/tls_alerts.h b/src/tls/tls_alerts.h
index 241599aa8..c74361930 100644
--- a/src/tls/tls_alerts.h
+++ b/src/tls/tls_alerts.h
@@ -1,6 +1,6 @@
/*
* Alert Message
-* (C) 2004-2006 Jack Lloyd
+* (C) 2004-2006,2011 Jack Lloyd
*
* Released under the terms of the Botan license
*/
@@ -40,9 +40,14 @@ class Alert
if(buf[0] == 1) fatal = false;
else if(buf[0] == 2) fatal = true;
else
- throw Decoding_Error("Alert: Bad type code for alert level");
+ throw Decoding_Error("Alert: Bad code for alert level");
- type_code = static_cast<Alert_Type>(buf[1]);
+ const byte dc = buf[1];
+
+ if(dc == 255)
+ throw Decoding_Error("Alert: description code 255, rejecting");
+
+ type_code = static_cast<Alert_Type>(dc);
}
private:
bool fatal;