diff --git a/mozilla/security/nss/cmd/lib/SSLerrs.h b/mozilla/security/nss/cmd/lib/SSLerrs.h index 3ee7bc1a259..9435e2e937c 100644 --- a/mozilla/security/nss/cmd/lib/SSLerrs.h +++ b/mozilla/security/nss/cmd/lib/SSLerrs.h @@ -402,3 +402,6 @@ ER3(SSL_ERROR_UNSAFE_NEGOTIATION, (SSL_ERROR_BASE + 113), ER3(SSL_ERROR_RX_UNEXPECTED_UNCOMPRESSED_RECORD, (SSL_ERROR_BASE + 114), "SSL received an unexpected uncompressed record.") + +ER3(SSL_ERROR_WEAK_SERVER_KEY, (SSL_ERROR_BASE + 115), +"SSL received a weak key in Server Key Exchange handshake message.") diff --git a/mozilla/security/nss/lib/ssl/ssl3con.c b/mozilla/security/nss/lib/ssl/ssl3con.c index b368911b956..874d11ef445 100644 --- a/mozilla/security/nss/lib/ssl/ssl3con.c +++ b/mozilla/security/nss/lib/ssl/ssl3con.c @@ -39,7 +39,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -/* $Id: ssl3con.c,v 1.142.2.1 2010-07-31 04:33:52 wtc%google.com Exp $ */ +/* $Id: ssl3con.c,v 1.142.2.2 2010-08-16 18:21:19 wtc%google.com Exp $ */ #include "cert.h" #include "ssl.h" @@ -5302,8 +5302,10 @@ ssl3_HandleServerKeyExchange(sslSocket *ss, SSL3Opaque *b, PRUint32 length) if (rv != SECSuccess) { goto loser; /* malformed. */ } - if (dh_p.len < 512/8) + if (dh_p.len < 512/8) { + errCode = SSL_ERROR_WEAK_SERVER_KEY; goto alert_loser; + } rv = ssl3_ConsumeHandshakeVariable(ss, &dh_g, 2, &b, &length); if (rv != SECSuccess) { goto loser; /* malformed. */ diff --git a/mozilla/security/nss/lib/ssl/sslerr.h b/mozilla/security/nss/lib/ssl/sslerr.h index af2e5e0c99d..da2359c6f71 100644 --- a/mozilla/security/nss/lib/ssl/sslerr.h +++ b/mozilla/security/nss/lib/ssl/sslerr.h @@ -36,7 +36,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -/* $Id: sslerr.h,v 1.11 2010-06-24 09:24:18 nelson%bolyard.com Exp $ */ +/* $Id: sslerr.h,v 1.11.2.1 2010-08-16 18:21:19 wtc%google.com Exp $ */ #ifndef __SSL_ERR_H_ #define __SSL_ERR_H_ @@ -201,6 +201,8 @@ SSL_ERROR_UNSAFE_NEGOTIATION = (SSL_ERROR_BASE + 113), SSL_ERROR_RX_UNEXPECTED_UNCOMPRESSED_RECORD = (SSL_ERROR_BASE + 114), +SSL_ERROR_WEAK_SERVER_KEY = (SSL_ERROR_BASE + 115), + SSL_ERROR_END_OF_LIST /* let the c compiler determine the value of this. */ } SSLErrorCodes; #endif /* NO_SECURITY_ERROR_ENUM */