Skip to content

Commit

Permalink
Bug 1118245. Apply uniform style across NSS [remove trailing commas i…
Browse files Browse the repository at this point in the history
…n initializers]. r=ekr
  • Loading branch information
franziskuskiefer committed Nov 10, 2015
1 parent be55989 commit 1a1ccb8
Show file tree
Hide file tree
Showing 29 changed files with 183 additions and 183 deletions.
2 changes: 1 addition & 1 deletion cmd/certutil/keystuff.c
Expand Up @@ -42,7 +42,7 @@ const SEC_ASN1Template SECKEY_PQGParamsTemplate[] = {
{ SEC_ASN1_INTEGER, offsetof(SECKEYPQGParams,prime) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPQGParams,subPrime) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPQGParams,base) },
{ 0, }
{ 0 }
};

/* returns 0 for success, -1 for failure (EOF encountered) */
Expand Down
6 changes: 3 additions & 3 deletions cmd/fipstest/fipstest.c
Expand Up @@ -5344,9 +5344,9 @@ rsa_siggen_test(char *reqfn)
NSSLOWKEYPublicKey * rsa_public_key;
NSSLOWKEYPrivateKey * rsa_private_key;
NSSLOWKEYPrivateKey low_RSA_private_key = { NULL,
NSSLOWKEYRSAKey, };
NSSLOWKEYRSAKey };
NSSLOWKEYPublicKey low_RSA_public_key = { NULL,
NSSLOWKEYRSAKey, };
NSSLOWKEYRSAKey };

low_RSA_private_key.u.rsa = *rsaBlapiPrivKey;
low_RSA_public_key.u.rsa = *rsaBlapiPublicKey;
Expand Down Expand Up @@ -5610,7 +5610,7 @@ rsa_sigver_test(char *reqfn)
SECStatus rv = SECFailure;
NSSLOWKEYPublicKey * rsa_public_key;
NSSLOWKEYPublicKey low_RSA_public_key = { NULL,
NSSLOWKEYRSAKey, };
NSSLOWKEYRSAKey };

/* convert to a low RSA public key */
low_RSA_public_key.u.rsa = rsaBlapiPublicKey;
Expand Down
2 changes: 1 addition & 1 deletion cmd/libpkix/pkixutil/pkixutil.c
Expand Up @@ -154,7 +154,7 @@ testFunctionRef testFnRefTable[] = {
{"test_mutex3", test_mutex3},
{"test_object", test_object},
{"test_oid", test_oid},
/* {"test_rwlock", test_rwlock, }*/
/* {"test_rwlock", test_rwlock }*/
{"test_string", test_string},
{"test_string2", test_string2},
{"build_chain", build_chain},
Expand Down
2 changes: 1 addition & 1 deletion cmd/makepqg/makepqg.c
Expand Up @@ -28,7 +28,7 @@ const SEC_ASN1Template seckey_PQGParamsTemplate[] = {
{ SEC_ASN1_INTEGER, offsetof(SECKEYPQGParams,prime) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPQGParams,subPrime) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPQGParams,base) },
{ 0, }
{ 0 }
};


Expand Down
4 changes: 2 additions & 2 deletions cmd/pk1sign/pk1sign.c
Expand Up @@ -44,8 +44,8 @@ SEC_ASN1Template CERTSignatureDataTemplate[] =
offsetof(CERTSignedData,signatureAlgorithm),
SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
{ SEC_ASN1_BIT_STRING,
offsetof(CERTSignedData,signature), },
{ 0, }
offsetof(CERTSignedData,signature) },
{ 0 }
};


Expand Down
2 changes: 1 addition & 1 deletion lib/certdb/certdb.c
Expand Up @@ -51,7 +51,7 @@ const SEC_ASN1Template CERT_CertExtensionTemplate[] = {
offsetof(CERTCertExtension,critical) },
{ SEC_ASN1_OCTET_STRING,
offsetof(CERTCertExtension,value) },
{ 0, }
{ 0 }
};

const SEC_ASN1Template CERT_SequenceOfCertExtensionTemplate[] = {
Expand Down
4 changes: 2 additions & 2 deletions lib/certdb/crl.c
Expand Up @@ -30,10 +30,10 @@ const SEC_ASN1Template SEC_CERTExtensionTemplate[] = {
{ SEC_ASN1_OBJECT_ID,
offsetof(CERTCertExtension,id) },
{ SEC_ASN1_OPTIONAL | SEC_ASN1_BOOLEAN, /* XXX DER_DEFAULT */
offsetof(CERTCertExtension,critical), },
offsetof(CERTCertExtension,critical) },
{ SEC_ASN1_OCTET_STRING,
offsetof(CERTCertExtension,value) },
{ 0, }
{ 0 }
};

static const SEC_ASN1Template SEC_CERTExtensionsTemplate[] = {
Expand Down
6 changes: 3 additions & 3 deletions lib/certdb/genname.c
Expand Up @@ -32,7 +32,7 @@ static const SEC_ASN1Template CERTNameConstraintTemplate[] = {
{ SEC_ASN1_OPTIONAL | SEC_ASN1_CONTEXT_SPECIFIC | SEC_ASN1_XTRN | 1,
offsetof(CERTNameConstraint, max),
SEC_ASN1_SUB(SEC_IntegerTemplate) },
{ 0, }
{ 0 }
};

const SEC_ASN1Template CERT_NameConstraintSubtreeSubTemplate[] = {
Expand All @@ -47,7 +47,7 @@ static const SEC_ASN1Template CERTNameConstraintsTemplate[] = {
{ SEC_ASN1_OPTIONAL | SEC_ASN1_CONSTRUCTED | SEC_ASN1_CONTEXT_SPECIFIC | 1,
offsetof(CERTNameConstraints, DERExcluded),
CERT_NameConstraintSubtreeSubTemplate},
{ 0, }
{ 0 }
};


Expand All @@ -58,7 +58,7 @@ static const SEC_ASN1Template CERTOthNameTemplate[] = {
{ SEC_ASN1_CONTEXT_SPECIFIC | SEC_ASN1_CONSTRUCTED | SEC_ASN1_EXPLICIT |
SEC_ASN1_XTRN | 0, offsetof(OtherName, name),
SEC_ASN1_SUB(SEC_AnyTemplate) },
{ 0, }
{ 0 }
};

static const SEC_ASN1Template CERTOtherNameTemplate[] = {
Expand Down
6 changes: 3 additions & 3 deletions lib/certdb/secname.c
Expand Up @@ -15,10 +15,10 @@ static const SEC_ASN1Template cert_AVATemplate[] = {
{ SEC_ASN1_SEQUENCE,
0, NULL, sizeof(CERTAVA) },
{ SEC_ASN1_OBJECT_ID,
offsetof(CERTAVA,type), },
offsetof(CERTAVA,type) },
{ SEC_ASN1_ANY,
offsetof(CERTAVA,value), },
{ 0, }
offsetof(CERTAVA,value) },
{ 0 }
};

const SEC_ASN1Template CERT_RDNTemplate[] = {
Expand Down
2 changes: 1 addition & 1 deletion lib/certdb/xbsconst.c
Expand Up @@ -32,7 +32,7 @@ static const SEC_ASN1Template CERTBasicConstraintsTemplate[] = {
offsetof(EncodedContext,isCA)},
{ SEC_ASN1_OPTIONAL | SEC_ASN1_INTEGER,
offsetof(EncodedContext,pathLenConstraint) },
{ 0, }
{ 0 }
};

static unsigned char hexTrue = 0xff;
Expand Down
4 changes: 2 additions & 2 deletions lib/certdb/xconst.c
Expand Up @@ -41,7 +41,7 @@ static const SEC_ASN1Template CERTPrivateKeyUsagePeriodTemplate[] = {
{ SEC_ASN1_OPTIONAL | SEC_ASN1_CONTEXT_SPECIFIC | SEC_ASN1_XTRN | 1,
offsetof(CERTPrivKeyUsagePeriod, notAfter),
SEC_ASN1_SUB(SEC_GeneralizedTimeTemplate)},
{ 0, }
{ 0 }
};


Expand All @@ -57,7 +57,7 @@ const SEC_ASN1Template CERTAuthInfoAccessItemTemplate[] = {
offsetof(CERTAuthInfoAccess, method) },
{ SEC_ASN1_ANY,
offsetof(CERTAuthInfoAccess, derLocation) },
{ 0, }
{ 0 }
};

const SEC_ASN1Template CERTAuthInfoAccessTemplate[] = {
Expand Down
8 changes: 4 additions & 4 deletions lib/certhigh/ocspsig.c
Expand Up @@ -126,10 +126,10 @@ static const SEC_ASN1Template mySECOID_AlgorithmIDTemplate[] = {
{ SEC_ASN1_SEQUENCE,
0, NULL, sizeof(SECAlgorithmID) },
{ SEC_ASN1_OBJECT_ID,
offsetof(SECAlgorithmID,algorithm), },
offsetof(SECAlgorithmID,algorithm) },
{ SEC_ASN1_OPTIONAL | SEC_ASN1_ANY,
offsetof(SECAlgorithmID,parameters), },
{ 0, }
offsetof(SECAlgorithmID,parameters) },
{ 0 }
};

static const SEC_ASN1Template mySEC_AnyTemplate[] = {
Expand Down Expand Up @@ -184,7 +184,7 @@ static const SEC_ASN1Template myCERT_CertExtensionTemplate[] = {
offsetof(CERTCertExtension,critical) },
{ SEC_ASN1_OCTET_STRING,
offsetof(CERTCertExtension,value) },
{ 0, }
{ 0 }
};

static const SEC_ASN1Template myCERT_SequenceOfCertExtensionTemplate[] = {
Expand Down
2 changes: 1 addition & 1 deletion lib/crmf/crmftmpl.c
Expand Up @@ -38,7 +38,7 @@ static const SEC_ASN1Template CRMFCertExtensionTemplate[] = {
offsetof(CRMFCertExtension,critical) },
{ SEC_ASN1_OCTET_STRING,
offsetof(CRMFCertExtension,value) },
{ 0, }
{ 0 }
};

static const SEC_ASN1Template CRMFSequenceOfCertExtensionTemplate[] = {
Expand Down
2 changes: 1 addition & 1 deletion lib/cryptohi/dsautil.c
Expand Up @@ -20,7 +20,7 @@ const SEC_ASN1Template DSA_SignatureTemplate[] =
{ SEC_ASN1_SEQUENCE, 0, NULL, sizeof(DSA_ASN1Signature) },
{ SEC_ASN1_INTEGER, offsetof(DSA_ASN1Signature,r) },
{ SEC_ASN1_INTEGER, offsetof(DSA_ASN1Signature,s) },
{ 0, }
{ 0 }
};

/* Input is variable length multi-byte integer, MSB first (big endian).
Expand Down
26 changes: 13 additions & 13 deletions lib/cryptohi/seckey.c
Expand Up @@ -25,8 +25,8 @@ const SEC_ASN1Template CERT_SubjectPublicKeyInfoTemplate[] = {
offsetof(CERTSubjectPublicKeyInfo,algorithm),
SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
{ SEC_ASN1_BIT_STRING,
offsetof(CERTSubjectPublicKeyInfo,subjectPublicKey), },
{ 0, }
offsetof(CERTSubjectPublicKeyInfo,subjectPublicKey) },
{ 0 }
};

const SEC_ASN1Template CERT_PublicKeyAndChallengeTemplate[] =
Expand All @@ -39,9 +39,9 @@ const SEC_ASN1Template CERT_PublicKeyAndChallengeTemplate[] =

const SEC_ASN1Template SECKEY_RSAPublicKeyTemplate[] = {
{ SEC_ASN1_SEQUENCE, 0, NULL, sizeof(SECKEYPublicKey) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.rsa.modulus), },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.rsa.publicExponent), },
{ 0, }
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.rsa.modulus) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.rsa.publicExponent) },
{ 0 }
};

static const SEC_ASN1Template seckey_PointerToAlgorithmIDTemplate[] = {
Expand Down Expand Up @@ -73,30 +73,30 @@ const SEC_ASN1Template SECKEY_RSAPSSParamsTemplate[] =
};

const SEC_ASN1Template SECKEY_DSAPublicKeyTemplate[] = {
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.dsa.publicValue), },
{ 0, }
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.dsa.publicValue) },
{ 0 }
};

const SEC_ASN1Template SECKEY_PQGParamsTemplate[] = {
{ SEC_ASN1_SEQUENCE, 0, NULL, sizeof(SECKEYPQGParams) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPQGParams,prime) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPQGParams,subPrime) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPQGParams,base) },
{ 0, }
{ 0 }
};

const SEC_ASN1Template SECKEY_DHPublicKeyTemplate[] = {
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.dh.publicValue), },
{ 0, }
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.dh.publicValue) },
{ 0 }
};

const SEC_ASN1Template SECKEY_DHParamKeyTemplate[] = {
{ SEC_ASN1_SEQUENCE, 0, NULL, sizeof(SECKEYPublicKey) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.dh.prime), },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.dh.base), },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.dh.prime) },
{ SEC_ASN1_INTEGER, offsetof(SECKEYPublicKey,u.dh.base) },
/* XXX chrisk: this needs to be expanded for decoding of j and validationParms (RFC2459 7.3.2) */
{ SEC_ASN1_SKIP_REST },
{ 0, }
{ 0 }
};

SEC_ASN1_CHOOSER_IMPLEMENT(SECKEY_DSAPublicKeyTemplate)
Expand Down
28 changes: 14 additions & 14 deletions lib/cryptohi/secsign.c
Expand Up @@ -113,10 +113,10 @@ static DERTemplate SECAlgorithmIDTemplate[] = {
{ DER_SEQUENCE,
0, NULL, sizeof(SECAlgorithmID) },
{ DER_OBJECT_ID,
offsetof(SECAlgorithmID,algorithm), },
offsetof(SECAlgorithmID,algorithm) },
{ DER_OPTIONAL | DER_ANY,
offsetof(SECAlgorithmID,parameters), },
{ 0, }
offsetof(SECAlgorithmID,parameters) },
{ 0 }
};

/*
Expand All @@ -128,10 +128,10 @@ static DERTemplate SGNDigestInfoTemplate[] = {
0, NULL, sizeof(SGNDigestInfo) },
{ DER_INLINE,
offsetof(SGNDigestInfo,digestAlgorithm),
SECAlgorithmIDTemplate, },
SECAlgorithmIDTemplate },
{ DER_OCTET_STRING,
offsetof(SGNDigestInfo,digest), },
{ 0, }
offsetof(SGNDigestInfo,digest) },
{ 0 }
};

SECStatus
Expand Down Expand Up @@ -269,13 +269,13 @@ DERTemplate CERTSignedDataTemplate[] =
{ DER_SEQUENCE,
0, NULL, sizeof(CERTSignedData) },
{ DER_ANY,
offsetof(CERTSignedData,data), },
offsetof(CERTSignedData,data) },
{ DER_INLINE,
offsetof(CERTSignedData,signatureAlgorithm),
SECAlgorithmIDTemplate, },
SECAlgorithmIDTemplate },
{ DER_BIT_STRING,
offsetof(CERTSignedData,signature), },
{ 0, }
offsetof(CERTSignedData,signature) },
{ 0 }
};

SEC_ASN1_MKSUB(SECOID_AlgorithmIDTemplate)
Expand All @@ -285,13 +285,13 @@ const SEC_ASN1Template CERT_SignedDataTemplate[] =
{ SEC_ASN1_SEQUENCE,
0, NULL, sizeof(CERTSignedData) },
{ SEC_ASN1_ANY,
offsetof(CERTSignedData,data), },
offsetof(CERTSignedData,data) },
{ SEC_ASN1_INLINE | SEC_ASN1_XTRN,
offsetof(CERTSignedData,signatureAlgorithm),
SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate), },
SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
{ SEC_ASN1_BIT_STRING,
offsetof(CERTSignedData,signature), },
{ 0, }
offsetof(CERTSignedData,signature) },
{ 0 }
};

SEC_ASN1_CHOOSER_IMPLEMENT(CERT_SignedDataTemplate)
Expand Down
2 changes: 1 addition & 1 deletion lib/cryptohi/secvfy.c
Expand Up @@ -207,7 +207,7 @@ const SEC_ASN1Template hashParameterTemplate[] =
{ SEC_ASN1_SEQUENCE, 0, NULL, sizeof(SECItem) },
{ SEC_ASN1_OBJECT_ID, 0 },
{ SEC_ASN1_SKIP_REST },
{ 0, }
{ 0 }
};

/*
Expand Down
6 changes: 3 additions & 3 deletions lib/libpkix/pkix_pl_nss/module/pkix_pl_httpcertstore.c
Expand Up @@ -39,10 +39,10 @@ const SEC_ASN1Template SECOID_AlgorithmIDTemplate[] = {
{ SEC_ASN1_SEQUENCE,
0, NULL, sizeof(SECAlgorithmID) },
{ SEC_ASN1_OBJECT_ID,
offsetof(SECAlgorithmID,algorithm), },
offsetof(SECAlgorithmID,algorithm) },
{ SEC_ASN1_OPTIONAL | SEC_ASN1_ANY,
offsetof(SECAlgorithmID,parameters), },
{ 0, }
offsetof(SECAlgorithmID,parameters) },
{ 0 }
}; */

/* --Private-HttpCertStoreContext-Object Functions----------------------- */
Expand Down
6 changes: 3 additions & 3 deletions lib/pkcs7/secmime.c
Expand Up @@ -305,10 +305,10 @@ static const SEC_ASN1Template smime_capability_template[] = {
{ SEC_ASN1_SEQUENCE,
0, NULL, sizeof(smime_capability) },
{ SEC_ASN1_OBJECT_ID,
offsetof(smime_capability,capabilityID), },
offsetof(smime_capability,capabilityID) },
{ SEC_ASN1_OPTIONAL | SEC_ASN1_ANY,
offsetof(smime_capability,parameters), },
{ 0, }
offsetof(smime_capability,parameters) },
{ 0 }
};

static const SEC_ASN1Template smime_capabilities_template[] = {
Expand Down
8 changes: 4 additions & 4 deletions lib/smime/smimeutil.c
Expand Up @@ -47,10 +47,10 @@ static const SEC_ASN1Template NSSSMIMECapabilityTemplate[] = {
{ SEC_ASN1_SEQUENCE,
0, NULL, sizeof(NSSSMIMECapability) },
{ SEC_ASN1_OBJECT_ID,
offsetof(NSSSMIMECapability,capabilityID), },
offsetof(NSSSMIMECapability,capabilityID) },
{ SEC_ASN1_OPTIONAL | SEC_ASN1_ANY,
offsetof(NSSSMIMECapability,parameters), },
{ 0, }
offsetof(NSSSMIMECapability,parameters) },
{ 0 }
};

static const SEC_ASN1Template NSSSMIMECapabilitiesTemplate[] = {
Expand Down Expand Up @@ -97,7 +97,7 @@ static const SEC_ASN1Template smime_encryptionkeypref_template[] = {
offsetof(NSSSMIMEEncryptionKeyPreference,id.subjectKeyID),
SEC_ASN1_SUB(SEC_OctetStringTemplate),
NSSSMIMEEncryptionKeyPref_SubjectKeyID },
{ 0, }
{ 0 }
};

/* smime_cipher_map - map of SMIME symmetric "ciphers" to algtag & parameters */
Expand Down
4 changes: 2 additions & 2 deletions lib/softoken/fipstest.c
Expand Up @@ -1512,8 +1512,8 @@ sftk_fips_RSA_PowerUpSelfTest( void )
NSSLOWKEYPrivateKey * rsa_private_key;
SECStatus rsa_status;

NSSLOWKEYPublicKey low_public_key = { NULL, NSSLOWKEYRSAKey, };
NSSLOWKEYPrivateKey low_private_key = { NULL, NSSLOWKEYRSAKey, };
NSSLOWKEYPublicKey low_public_key = { NULL, NSSLOWKEYRSAKey };
NSSLOWKEYPrivateKey low_private_key = { NULL, NSSLOWKEYRSAKey };
PRUint8 rsa_computed_ciphertext[FIPS_RSA_ENCRYPT_LENGTH];
PRUint8 rsa_computed_plaintext[FIPS_RSA_DECRYPT_LENGTH];

Expand Down

0 comments on commit 1a1ccb8

Please sign in to comment.