diff --git a/mozilla/security/nss/lib/ssl/manifest.mn b/mozilla/security/nss/lib/ssl/manifest.mn index 46c9fe31dee..3bb28a2f080 100644 --- a/mozilla/security/nss/lib/ssl/manifest.mn +++ b/mozilla/security/nss/lib/ssl/manifest.mn @@ -42,7 +42,6 @@ CSRCS = \ sslver.c \ authcert.c \ cmpcert.c \ - nsskea.c \ sslinfo.c \ ssl3ecc.c \ $(NULL) diff --git a/mozilla/security/nss/lib/ssl/nsskea.c b/mozilla/security/nss/lib/ssl/nsskea.c deleted file mode 100644 index 590ff250370..00000000000 --- a/mozilla/security/nss/lib/ssl/nsskea.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Return SSLKEAType derived from cert's Public Key algorithm info. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* $Id: nsskea.c,v 1.8 2012-04-25 14:50:12 gerv%gerv.net Exp $ */ - -#include "cert.h" -#include "ssl.h" /* for SSLKEAType */ -#include "secoid.h" - -SSLKEAType -NSS_FindCertKEAType(CERTCertificate * cert) -{ - SSLKEAType keaType = kt_null; - int tag; - - if (!cert) goto loser; - - tag = SECOID_GetAlgorithmTag(&(cert->subjectPublicKeyInfo.algorithm)); - - switch (tag) { - case SEC_OID_X500_RSA_ENCRYPTION: - case SEC_OID_PKCS1_RSA_ENCRYPTION: - keaType = kt_rsa; - break; - case SEC_OID_X942_DIFFIE_HELMAN_KEY: - keaType = kt_dh; - break; -#ifdef NSS_ENABLE_ECC - case SEC_OID_ANSIX962_EC_PUBLIC_KEY: - keaType = kt_ecdh; - break; -#endif /* NSS_ENABLE_ECC */ - default: - keaType = kt_null; - } - - loser: - - return keaType; - -} - diff --git a/mozilla/security/nss/lib/ssl/sslimpl.h b/mozilla/security/nss/lib/ssl/sslimpl.h index d0fbaeb9780..00b8e9bf621 100644 --- a/mozilla/security/nss/lib/ssl/sslimpl.h +++ b/mozilla/security/nss/lib/ssl/sslimpl.h @@ -5,7 +5,7 @@ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* $Id: sslimpl.h,v 1.103 2012-05-08 23:08:32 wtc%google.com Exp $ */ +/* $Id: sslimpl.h,v 1.104 2012-05-24 20:34:51 wtc%google.com Exp $ */ #ifndef __sslimpl_h_ #define __sslimpl_h_ @@ -1640,8 +1640,6 @@ extern PRInt32 ssl3_SendServerNameXtn(sslSocket *ss, PRBool append, extern SECStatus ssl_ConfigSecureServer(sslSocket *ss, CERTCertificate *cert, const CERTCertificateList *certChain, ssl3KeyPair *keyPair, SSLKEAType kea); -/* Return key type for the cert */ -extern SSLKEAType ssl_FindCertKEAType(CERTCertificate * cert); #ifdef NSS_ENABLE_ECC extern PRInt32 ssl3_SendSupportedCurvesXtn(sslSocket *ss, diff --git a/mozilla/security/nss/lib/ssl/sslsecur.c b/mozilla/security/nss/lib/ssl/sslsecur.c index 0bb480aaee3..7a140d948ba 100644 --- a/mozilla/security/nss/lib/ssl/sslsecur.c +++ b/mozilla/security/nss/lib/ssl/sslsecur.c @@ -4,7 +4,7 @@ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* $Id: sslsecur.c,v 1.60 2012-04-25 14:50:12 gerv%gerv.net Exp $ */ +/* $Id: sslsecur.c,v 1.61 2012-05-24 20:34:51 wtc%google.com Exp $ */ #include "cert.h" #include "secitem.h" #include "keyhi.h" @@ -596,8 +596,11 @@ done: /************************************************************************/ +/* +** Return SSLKEAType derived from cert's Public Key algorithm info. +*/ SSLKEAType -ssl_FindCertKEAType(CERTCertificate * cert) +NSS_FindCertKEAType(CERTCertificate * cert) { SSLKEAType keaType = kt_null; int tag; @@ -611,7 +614,6 @@ ssl_FindCertKEAType(CERTCertificate * cert) case SEC_OID_PKCS1_RSA_ENCRYPTION: keaType = kt_rsa; break; - case SEC_OID_X942_DIFFIE_HELMAN_KEY: keaType = kt_dh; break; @@ -627,7 +629,6 @@ ssl_FindCertKEAType(CERTCertificate * cert) loser: return keaType; - } static const PRCallOnceType pristineCallOnce; @@ -769,7 +770,7 @@ SSL_ConfigSecureServerWithCertChain(PRFileDesc *fd, CERTCertificate *cert, return SECFailure; } - if (kea != ssl_FindCertKEAType(cert)) { + if (kea != NSS_FindCertKEAType(cert)) { PORT_SetError(SSL_ERROR_CERT_KEA_MISMATCH); return SECFailure; }