Bug 751793: NSS_FindCertKEAType and ssl_FindCertKEAType are the same.

Remove nsskea.c and rename the ssl_FindCertKEAType function in sslsecur.c
to NSS_FindCertKEAType.  r=emaldona.
Modified Files:
	manifest.mn sslimpl.h sslsecur.c
Removed Files:
	nsskea.c


git-svn-id: svn://10.0.0.236/trunk@263854 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
wtc%google.com 2012-05-24 20:34:51 +00:00
parent 9ac96c20b6
commit 3b82024c06
4 changed files with 7 additions and 54 deletions

View File

@ -42,7 +42,6 @@ CSRCS = \
sslver.c \
authcert.c \
cmpcert.c \
nsskea.c \
sslinfo.c \
ssl3ecc.c \
$(NULL)

View File

@ -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;
}

View File

@ -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,

View File

@ -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;
}