Skip to content

Commit

Permalink
Bug 1349556 - Remove unused functions from libssl r=franziskus
Browse files Browse the repository at this point in the history
Differential Revision: https://nss-review.dev.mozaws.net/D270

--HG--
extra : amend_source : 6aeb97264bd980a7f47ddc10aaeb7c44d8c0d383
  • Loading branch information
Tim Taubert committed Mar 22, 2017
1 parent a6962df commit b4f556b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 38 deletions.
29 changes: 2 additions & 27 deletions lib/ssl/ssl3con.c
Expand Up @@ -1769,29 +1769,6 @@ ssl3_InitCompressionContext(ssl3CipherSpec *pwSpec)
return SECSuccess;
}

/* This function should probably be moved to pk11wrap and be named
* PK11_ParamFromIVAndEffectiveKeyBits
*/
static SECItem *
ssl3_ParamFromIV(CK_MECHANISM_TYPE mtype, SECItem *iv, CK_ULONG ulEffectiveBits)
{
SECItem *param = PK11_ParamFromIV(mtype, iv);
if (param && param->data && param->len >= sizeof(CK_RC2_PARAMS)) {
switch (mtype) {
case CKM_RC2_KEY_GEN:
case CKM_RC2_ECB:
case CKM_RC2_CBC:
case CKM_RC2_MAC:
case CKM_RC2_MAC_GENERAL:
case CKM_RC2_CBC_PAD:
*(CK_RC2_PARAMS *)param->data = ulEffectiveBits;
default:
break;
}
}
return param;
}

/* ssl3_BuildRecordPseudoHeader writes the SSL/TLS pseudo-header (the data
* which is included in the MAC or AEAD additional data) to |out| and returns
* its length. See https://tools.ietf.org/html/rfc5246#section-6.2.3.3 for the
Expand Down Expand Up @@ -1973,7 +1950,6 @@ ssl3_InitPendingContexts(sslSocket *ss)
CK_MECHANISM_TYPE mechanism;
CK_MECHANISM_TYPE mac_mech;
CK_ULONG macLength;
CK_ULONG effKeyBits;
SECItem iv;
SECItem mac_param;
SSLCipherAlgorithm calg;
Expand Down Expand Up @@ -2043,14 +2019,13 @@ ssl3_InitPendingContexts(sslSocket *ss)
return SECSuccess;
}
mechanism = ssl3_Alg2Mech(calg);
effKeyBits = cipher_def->key_size * BPB;

/*
* build the server context
*/
iv.data = pwSpec->server.write_iv;
iv.len = cipher_def->iv_size;
param = ssl3_ParamFromIV(mechanism, &iv, effKeyBits);
param = PK11_ParamFromIV(mechanism, &iv);
if (param == NULL) {
ssl_MapLowLevelError(SSL_ERROR_IV_PARAM_FAILURE);
goto fail;
Expand All @@ -2074,7 +2049,7 @@ ssl3_InitPendingContexts(sslSocket *ss)
iv.data = pwSpec->client.write_iv;
iv.len = cipher_def->iv_size;

param = ssl3_ParamFromIV(mechanism, &iv, effKeyBits);
param = PK11_ParamFromIV(mechanism, &iv);
if (param == NULL) {
ssl_MapLowLevelError(SSL_ERROR_IV_PARAM_FAILURE);
goto fail;
Expand Down
10 changes: 0 additions & 10 deletions lib/ssl/ssl3ecc.c
Expand Up @@ -257,16 +257,6 @@ ssl3_SendECDHClientKeyExchange(sslSocket *ss, SECKEYPublicKey *svrPubKey)
return SECFailure;
}

/* This function returns the size of the key_exchange field in
* the KeyShareEntry structure, i.e.:
* opaque point <1..2^8-1>; */
unsigned int
tls13_SizeOfECDHEKeyShareKEX(const SECKEYPublicKey *pubKey)
{
PORT_Assert(pubKey->keyType == ecKey);
return pubKey->u.ec.publicValue.len;
}

/* This function encodes the key_exchange field in
* the KeyShareEntry structure. */
SECStatus
Expand Down
1 change: 0 additions & 1 deletion lib/ssl/sslimpl.h
Expand Up @@ -1644,7 +1644,6 @@ extern SECStatus ssl3_SendECDHServerKeyExchange(sslSocket *ss);
extern SECStatus ssl_ImportECDHKeyShare(
sslSocket *ss, SECKEYPublicKey *peerKey,
SSL3Opaque *b, PRUint32 length, const sslNamedGroupDef *curve);
unsigned int tls13_SizeOfECDHEKeyShareKEX(const SECKEYPublicKey *pubKey);
SECStatus tls13_EncodeECDHEKeyShareKEX(const sslSocket *ss,
const SECKEYPublicKey *pubKey);

Expand Down

0 comments on commit b4f556b

Please sign in to comment.