summaryrefslogtreecommitdiff
path: root/lib/cryptohi
diff options
context:
space:
mode:
authorFranziskus Kiefer <franziskuskiefer@gmail.com>2016-02-25 15:28:52 +0100
committerFranziskus Kiefer <franziskuskiefer@gmail.com>2016-02-25 15:28:52 +0100
commit11a75954a8c9f7d0c94f089d595b8c1da3a5ca83 (patch)
treeb60e60f4ace2e9be9c6eb9dca0c7f15d7fba6e51 /lib/cryptohi
parentdb6e138764000f48d554bcf63526896d0f8036f1 (diff)
downloadnss-hg-11a75954a8c9f7d0c94f089d595b8c1da3a5ca83.tar.gz
Bug 1251185, NSS clang-format: else line-break fixes, r=ttaubertNSS_3_23_BETA7
Diffstat (limited to 'lib/cryptohi')
-rw-r--r--lib/cryptohi/seckey.c39
-rw-r--r--lib/cryptohi/secsign.c9
-rw-r--r--lib/cryptohi/secvfy.c21
3 files changed, 23 insertions, 46 deletions
diff --git a/lib/cryptohi/seckey.c b/lib/cryptohi/seckey.c
index f31867828..827413a70 100644
--- a/lib/cryptohi/seckey.c
+++ b/lib/cryptohi/seckey.c
@@ -348,8 +348,7 @@ seckey_UpdateCertPQGChain(CERTCertificate *subjectCert, int count)
return SECSuccess;
}
- }
- else {
+ } else {
return SECFailure; /* return failure if oid is NULL */
}
@@ -393,8 +392,7 @@ seckey_UpdateCertPQGChain(CERTCertificate *subjectCert, int count)
rv = SECFailure;
goto loser;
}
- }
- else {
+ } else {
rv = SECFailure; /* return failure if oid is NULL */
goto loser;
}
@@ -481,8 +479,7 @@ seckey_DSADecodePQG(PLArenaPool *arena, SECKEYPublicKey *pubk,
SECKEY_PQGParamsTemplate,
&newparams);
}
- }
- else {
+ } else {
if (SECSuccess == rv) {
/* else the old fortezza-only wrapped format is used. */
@@ -1080,16 +1077,14 @@ SECKEY_CopyPrivateKey(const SECKEYPrivateKey *privk)
PK11_CopyKey(privk->pkcs11Slot, privk->pkcs11ID);
if (copyk->pkcs11ID == CK_INVALID_HANDLE)
goto fail;
- }
- else {
+ } else {
copyk->pkcs11ID = privk->pkcs11ID;
}
copyk->pkcs11IsTemp = privk->pkcs11IsTemp;
copyk->wincx = privk->wincx;
copyk->staticflags = privk->staticflags;
return copyk;
- }
- else {
+ } else {
PORT_SetError(SEC_ERROR_NO_MEMORY);
}
@@ -1124,8 +1119,7 @@ SECKEY_CopyPublicKey(const SECKEYPublicKey *pubk)
PK11_IsPermObject(pubk->pkcs11Slot, pubk->pkcs11ID)) {
copyk->pkcs11Slot = PK11_ReferenceSlot(pubk->pkcs11Slot);
copyk->pkcs11ID = pubk->pkcs11ID;
- }
- else {
+ } else {
copyk->pkcs11Slot = NULL; /* go get own reference */
copyk->pkcs11ID = CK_INVALID_HANDLE;
}
@@ -1358,8 +1352,7 @@ seckey_CreateSubjectPublicKeyInfo_helper(SECKEYPublicKey *pubk)
default:
break;
}
- }
- else {
+ } else {
PORT_SetError(SEC_ERROR_NO_MEMORY);
}
@@ -1445,8 +1438,7 @@ SECKEY_DecodeDERSubjectPublicKeyInfo(const SECItem *spkider)
}
if (rv == SECSuccess)
return spki;
- }
- else {
+ } else {
PORT_SetError(SEC_ERROR_NO_MEMORY);
}
@@ -1593,12 +1585,10 @@ SECKEY_DestroyPrivateKeyInfo(SECKEYPrivateKeyInfo *pvk,
PORT_Memset(pvk, 0, sizeof(*pvk));
if (freeit == PR_TRUE) {
PORT_FreeArena(poolp, PR_TRUE);
- }
- else {
+ } else {
pvk->arena = poolp;
}
- }
- else {
+ } else {
SECITEM_ZfreeItem(&pvk->version, PR_FALSE);
SECITEM_ZfreeItem(&pvk->privateKey, PR_FALSE);
SECOID_DestroyAlgorithmID(&pvk->algorithm, PR_FALSE);
@@ -1626,12 +1616,10 @@ SECKEY_DestroyEncryptedPrivateKeyInfo(SECKEYEncryptedPrivateKeyInfo *epki,
PORT_Memset(epki, 0, sizeof(*epki));
if (freeit == PR_TRUE) {
PORT_FreeArena(poolp, PR_TRUE);
- }
- else {
+ } else {
epki->arena = poolp;
}
- }
- else {
+ } else {
SECITEM_ZfreeItem(&epki->encryptedData, PR_FALSE);
SECOID_DestroyAlgorithmID(&epki->algorithm, PR_FALSE);
PORT_Memset(epki, 0, sizeof(*epki));
@@ -1912,8 +1900,7 @@ loser:
#define SECKEY_CacheAttribute(key, attribute) \
if (CK_TRUE == PK11_HasAttributeSet(key->pkcs11Slot, key->pkcs11ID, attribute, PR_FALSE)) { \
key->staticflags |= SECKEY_##attribute; \
- } \
- else { \
+ } else { \
key->staticflags &= (~SECKEY_##attribute); \
}
diff --git a/lib/cryptohi/secsign.c b/lib/cryptohi/secsign.c
index c59114c36..0243c2648 100644
--- a/lib/cryptohi/secsign.c
+++ b/lib/cryptohi/secsign.c
@@ -177,8 +177,7 @@ SGN_End(SGNContext *cx, SECItem *result)
if (rv != SECSuccess) {
goto loser;
}
- }
- else {
+ } else {
digder.data = digest;
digder.len = part1;
}
@@ -215,8 +214,7 @@ SGN_End(SGNContext *cx, SECItem *result)
PORT_Free(sigitem.data);
if (rv != SECSuccess)
goto loser;
- }
- else {
+ } else {
result->len = sigitem.len;
result->data = sigitem.data;
}
@@ -396,8 +394,7 @@ SGN_Digest(SECKEYPrivateKey *privKey,
if (rv != SECSuccess) {
goto loser;
}
- }
- else {
+ } else {
digder.data = digest->data;
digder.len = digest->len;
}
diff --git a/lib/cryptohi/secvfy.c b/lib/cryptohi/secvfy.c
index 5090f1aeb..2ac21abd4 100644
--- a/lib/cryptohi/secvfy.c
+++ b/lib/cryptohi/secvfy.c
@@ -105,8 +105,7 @@ recoverPKCS1DigestInfo(SECOidTag givenDigestAlg,
if (rv == SECSuccess) {
*digestInfoLen = it.len;
*digestInfo = (unsigned char *)it.data;
- }
- else {
+ } else {
if (it.data) {
PORT_Free(it.data);
}
@@ -195,8 +194,7 @@ decodeECorDSASignature(SECOidTag algid, const SECItem *sig, unsigned char *dsig,
if ((dsasig == NULL) || (dsasig->len != len)) {
rv = SECFailure;
- }
- else {
+ } else {
PORT_Memcpy(dsig, dsasig->data, dsasig->len);
}
@@ -296,17 +294,13 @@ sec_DecodeSigAlg(const SECKEYPublicKey *key, SECOidTag sigAlg,
len = SECKEY_PublicKeyStrength(key);
if (len < 28) { /* 28 bytes == 224 bits */
*hashalg = SEC_OID_SHA1;
- }
- else if (len < 32) { /* 32 bytes == 256 bits */
+ } else if (len < 32) { /* 32 bytes == 256 bits */
*hashalg = SEC_OID_SHA224;
- }
- else if (len < 48) { /* 48 bytes == 384 bits */
+ } else if (len < 48) { /* 48 bytes == 384 bits */
*hashalg = SEC_OID_SHA256;
- }
- else if (len < 64) { /* 48 bytes == 512 bits */
+ } else if (len < 64) { /* 48 bytes == 512 bits */
*hashalg = SEC_OID_SHA384;
- }
- else {
+ } else {
/* use the largest in this case */
*hashalg = SEC_OID_SHA512;
}
@@ -667,8 +661,7 @@ vfy_VerifyDigest(const SECItem *digest, const SECKEYPublicKey *key,
if (PK11_Verify(cx->key, &dsasig, (SECItem *)digest, cx->wincx) !=
SECSuccess) {
PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
- }
- else {
+ } else {
rv = SECSuccess;
}
break;