diff options
author | Richard PALO <richard@NetBSD.org> | 2015-02-04 09:52:41 +0100 |
---|---|---|
committer | Dan McDonald <danmcd@omniti.com> | 2015-02-16 20:33:42 -0500 |
commit | 6b35cb3cf158584a9408d44b9b6796564e8e1882 (patch) | |
tree | deb6681abe247a479099ad1a5bea147d402436be /usr/src/cmd | |
parent | 336069c20319c172c4ff9d87d67e8f6301c98a5d (diff) | |
download | illumos-gate-6b35cb3cf158584a9408d44b9b6796564e8e1882.tar.gz |
5591 initialisation inversion of component order in cmd-crypto/elfsign.c
5620 cstyle updates for cmd/cmd-crypto and lib/libkmf
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: David Höppner <0xffea@gmail.com>
Reviewed by: Josef "Jeff" Sipek <jeffpc@josefsipek.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/cmd')
-rw-r--r-- | usr/src/cmd/cmd-crypto/elfsign/elfsign.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/kmfcfg/util.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/delete.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/download.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/export.c | 8 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/gencert.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/gencsr.c | 8 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/genkey.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/genkeypair.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/import.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/list.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/pktool.c | 28 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/setpin.c | 8 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/pktool/signcsr.c | 12 | ||||
-rw-r--r-- | usr/src/cmd/cmd-crypto/tpmadm/admin_cmds.c | 14 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c | 2 |
16 files changed, 51 insertions, 55 deletions
diff --git a/usr/src/cmd/cmd-crypto/elfsign/elfsign.c b/usr/src/cmd/cmd-crypto/elfsign/elfsign.c index 45ae510f4a..b11da36e7b 100644 --- a/usr/src/cmd/cmd-crypto/elfsign/elfsign.c +++ b/usr/src/cmd/cmd-crypto/elfsign/elfsign.c @@ -736,7 +736,7 @@ create_csr(char *dn) KMF_X509_NAME csrSubject; KMF_CSR_DATA csr; KMF_ALGORITHM_INDEX sigAlg = KMF_ALGID_MD5WithRSA; - KMF_DATA signedCsr = { NULL, 0 }; + KMF_DATA signedCsr = { 0, NULL }; char *err; KMF_ATTRIBUTE attrlist[16]; KMF_ENCODE_FORMAT format; diff --git a/usr/src/cmd/cmd-crypto/kmfcfg/util.c b/usr/src/cmd/cmd-crypto/kmfcfg/util.c index f151e454ce..86db23affc 100644 --- a/usr/src/cmd/cmd-crypto/kmfcfg/util.c +++ b/usr/src/cmd/cmd-crypto/kmfcfg/util.c @@ -22,8 +22,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <strings.h> #include <ctype.h> @@ -242,7 +240,7 @@ parseEKUOIDs(char *ekulist, KMF_POLICY_RECORD *plc) { int rv = KC_OK; char *p; - KMF_OID newoid = {NULL, 0}; + KMF_OID newoid = { 0, NULL }; KMF_EKU_POLICY *ekus = &plc->eku_set; if (ekulist == NULL || !strlen(ekulist)) diff --git a/usr/src/cmd/cmd-crypto/pktool/delete.c b/usr/src/cmd/cmd-crypto/pktool/delete.c index 676552baf5..d84b216f9d 100644 --- a/usr/src/cmd/cmd-crypto/pktool/delete.c +++ b/usr/src/cmd/cmd-crypto/pktool/delete.c @@ -736,7 +736,7 @@ pk_delete(int argc, char *argv[]) int rv = 0; char *find_criteria = NULL; KMF_CERT_VALIDITY find_criteria_flag = KMF_ALL_CERTS; - KMF_CREDENTIAL tokencred = {NULL, 0}; + KMF_CREDENTIAL tokencred = { NULL, 0 }; /* Parse command line options. Do NOT i18n/l10n. */ while ((opt = getopt_av(argc, argv, diff --git a/usr/src/cmd/cmd-crypto/pktool/download.c b/usr/src/cmd/cmd-crypto/pktool/download.c index 153af9e574..89edb79255 100644 --- a/usr/src/cmd/cmd-crypto/pktool/download.c +++ b/usr/src/cmd/cmd-crypto/pktool/download.c @@ -51,8 +51,8 @@ pk_download(int argc, char *argv[]) KMF_ENCODE_FORMAT format; KMF_RETURN ch_rv = KMF_OK; char *fullpath = NULL; - KMF_DATA cert = {NULL, 0}; - KMF_DATA cert_der = {NULL, 0}; + KMF_DATA cert = { 0, NULL }; + KMF_DATA cert_der = { 0, NULL }; while ((opt = getopt_av(argc, argv, "t:(objtype)u:(url)h:(http_proxy)o:(outfile)d:(dir)")) != EOF) { diff --git a/usr/src/cmd/cmd-crypto/pktool/export.c b/usr/src/cmd/cmd-crypto/pktool/export.c index b1339850f2..cead1d53a9 100644 --- a/usr/src/cmd/cmd-crypto/pktool/export.c +++ b/usr/src/cmd/cmd-crypto/pktool/export.c @@ -164,7 +164,7 @@ pk_export_pk12_nss(KMF_HANDLE_T kmfhandle, { KMF_RETURN rv = KMF_OK; KMF_KEYSTORE_TYPE kstype; - KMF_CREDENTIAL p12cred = { NULL, 0}; + KMF_CREDENTIAL p12cred = { NULL, 0 }; KMF_ATTRIBUTE attrlist[16]; int numattr = 0; @@ -238,7 +238,7 @@ pk_export_pk12_files(KMF_HANDLE_T kmfhandle, { KMF_RETURN rv; KMF_KEYSTORE_TYPE kstype; - KMF_CREDENTIAL p12cred = { NULL, 0}; + KMF_CREDENTIAL p12cred = { NULL, 0 }; KMF_ATTRIBUTE attrlist[16]; int numattr = 0; @@ -373,7 +373,7 @@ pk_export_pk12_pk11(KMF_HANDLE_T kmfhandle, char *token_spec, { KMF_RETURN rv = KMF_OK; KMF_KEYSTORE_TYPE kstype; - KMF_CREDENTIAL p12cred = { NULL, 0}; + KMF_CREDENTIAL p12cred = { NULL, 0 }; KMF_ATTRIBUTE attrlist[16]; int numattr = 0; @@ -693,7 +693,7 @@ pk_export(int argc, char *argv[]) int oclass = PK_CERT_OBJ; KMF_BIGINT serial = { NULL, 0 }; KMF_HANDLE_T kmfhandle = NULL; - KMF_CREDENTIAL tokencred = {NULL, 0}; + KMF_CREDENTIAL tokencred = { NULL, 0 }; /* Parse command line options. Do NOT i18n/l10n. */ while ((opt = getopt_av(argc, argv, diff --git a/usr/src/cmd/cmd-crypto/pktool/gencert.c b/usr/src/cmd/cmd-crypto/pktool/gencert.c index 9a5520f982..95dd206c44 100644 --- a/usr/src/cmd/cmd-crypto/pktool/gencert.c +++ b/usr/src/cmd/cmd-crypto/pktool/gencert.c @@ -598,7 +598,7 @@ pk_gencert(int argc, char *argv[]) KMF_ALGORITHM_INDEX sigAlg = KMF_ALGID_SHA1WithRSA; boolean_t interactive = B_FALSE; char *subname = NULL; - KMF_CREDENTIAL tokencred = {NULL, 0}; + KMF_CREDENTIAL tokencred = { NULL, 0 }; uint16_t kubits = 0; int altcrit = 0, kucrit = 0; EKU_LIST *ekulist = NULL; diff --git a/usr/src/cmd/cmd-crypto/pktool/gencsr.c b/usr/src/cmd/cmd-crypto/pktool/gencsr.c index 3e2da95af6..501e8cabe7 100644 --- a/usr/src/cmd/cmd-crypto/pktool/gencsr.c +++ b/usr/src/cmd/cmd-crypto/pktool/gencsr.c @@ -56,7 +56,7 @@ gencsr_pkcs11(KMF_HANDLE_T kmfhandle, KMF_KEY_HANDLE pubk, prik; KMF_X509_NAME csrSubject; KMF_CSR_DATA csr; - KMF_DATA signedCsr = {NULL, 0}; + KMF_DATA signedCsr = { 0, NULL }; KMF_KEYSTORE_TYPE kstype = KMF_KEYSTORE_PK11TOKEN; int numattr = 0; @@ -177,7 +177,7 @@ gencsr_file(KMF_HANDLE_T kmfhandle, KMF_KEY_HANDLE pubk, prik; KMF_X509_NAME csrSubject; KMF_CSR_DATA csr; - KMF_DATA signedCsr = {NULL, 0}; + KMF_DATA signedCsr = { 0, NULL }; char *fullcsrpath = NULL; char *fullkeypath = NULL; @@ -272,7 +272,7 @@ gencsr_nss(KMF_HANDLE_T kmfhandle, KMF_KEY_HANDLE pubk, prik; KMF_X509_NAME csrSubject; KMF_CSR_DATA csr; - KMF_DATA signedCsr = {NULL, 0}; + KMF_DATA signedCsr = { 0, NULL }; KMF_KEYSTORE_TYPE kstype = KMF_KEYSTORE_NSS; int numattr = 0; @@ -392,7 +392,7 @@ pk_gencsr(int argc, char *argv[]) KMF_ALGORITHM_INDEX sigAlg = KMF_ALGID_SHA1WithRSA; boolean_t interactive = B_FALSE; char *subname = NULL; - KMF_CREDENTIAL tokencred = {NULL, 0}; + KMF_CREDENTIAL tokencred = { NULL, 0 }; KMF_GENERALNAMECHOICES alttype = 0; int altcrit = 0, kucrit = 0; EKU_LIST *ekulist = NULL; diff --git a/usr/src/cmd/cmd-crypto/pktool/genkey.c b/usr/src/cmd/cmd-crypto/pktool/genkey.c index 3b689d3308..8a0fcdbe40 100644 --- a/usr/src/cmd/cmd-crypto/pktool/genkey.c +++ b/usr/src/cmd/cmd-crypto/pktool/genkey.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <string.h> #include <ctype.h> @@ -378,7 +376,7 @@ pk_genkey(int argc, char *argv[]) KMF_HANDLE_T kmfhandle = NULL; KMF_KEY_ALG keyAlg = KMF_GENERIC_SECRET; boolean_t print_hex = B_FALSE; - KMF_CREDENTIAL tokencred = {NULL, 0}; + KMF_CREDENTIAL tokencred = { NULL, 0 }; while ((opt = getopt_av(argc, argv, "k:(keystore)l:(label)T:(token)d:(dir)p:(prefix)" diff --git a/usr/src/cmd/cmd-crypto/pktool/genkeypair.c b/usr/src/cmd/cmd-crypto/pktool/genkeypair.c index 27c0af0cd2..989ee3e6aa 100644 --- a/usr/src/cmd/cmd-crypto/pktool/genkeypair.c +++ b/usr/src/cmd/cmd-crypto/pktool/genkeypair.c @@ -334,7 +334,7 @@ pk_genkeypair(int argc, char *argv[]) KMF_ENCODE_FORMAT fmt = KMF_FORMAT_ASN1; KMF_KEY_ALG keyAlg = KMF_RSA; KMF_ALGORITHM_INDEX sigAlg; - KMF_CREDENTIAL tokencred = {NULL, 0}; + KMF_CREDENTIAL tokencred = { NULL, 0 }; KMF_OID *curveoid = NULL; /* ECC */ int y_flag = 0; diff --git a/usr/src/cmd/cmd-crypto/pktool/import.c b/usr/src/cmd/cmd-crypto/pktool/import.c index f11990e121..7c52c427d0 100644 --- a/usr/src/cmd/cmd-crypto/pktool/import.c +++ b/usr/src/cmd/cmd-crypto/pktool/import.c @@ -707,7 +707,7 @@ pk_import_rawkey(KMF_HANDLE_T kmfhandle, uint32_t keylen; boolean_t sensitive = B_FALSE; boolean_t not_extractable = B_FALSE; - KMF_DATA keydata = {NULL, 0}; + KMF_DATA keydata = { 0, NULL }; KMF_KEY_HANDLE rawkey; rv = kmf_read_input_file(kmfhandle, filename, &keydata); diff --git a/usr/src/cmd/cmd-crypto/pktool/list.c b/usr/src/cmd/cmd-crypto/pktool/list.c index 369e1fbe45..08e893fd51 100644 --- a/usr/src/cmd/cmd-crypto/pktool/list.c +++ b/usr/src/cmd/cmd-crypto/pktool/list.c @@ -314,7 +314,7 @@ list_pk11_objects(KMF_HANDLE_T kmfhandle, char *token, int oclass, KMF_KEY_CLASS keyclass; KMF_ENCODE_FORMAT format; int auth = 0; - KMF_CREDENTIAL cred = {NULL, 0}; + KMF_CREDENTIAL cred = { NULL, 0 }; /* * Symmetric keys and RSA/DSA/ECDSA private keys are always @@ -916,7 +916,7 @@ pk_list(int argc, char *argv[]) KMF_HANDLE_T kmfhandle = NULL; char *find_criteria = NULL; KMF_CERT_VALIDITY find_criteria_flag = KMF_ALL_CERTS; - KMF_CREDENTIAL tokencred = {NULL, 0}; + KMF_CREDENTIAL tokencred = { NULL, 0 }; /* Parse command line options. Do NOT i18n/l10n. */ while ((opt = getopt_av(argc, argv, diff --git a/usr/src/cmd/cmd-crypto/pktool/pktool.c b/usr/src/cmd/cmd-crypto/pktool/pktool.c index e04f582781..5bda8faa93 100644 --- a/usr/src/cmd/cmd-crypto/pktool/pktool.c +++ b/usr/src/cmd/cmd-crypto/pktool/pktool.c @@ -520,20 +520,20 @@ static int pk_help(int argc, char *argv[]); /* Command structure for verbs and their actions. Do NOT i18n/l10n. */ static verbcmd cmds[] = { - { NULL, pk_tokens, 0, NULL, NULL}, - { NULL, pk_setpin, 0, NULL, NULL}, - { NULL, pk_list, 0, NULL, NULL}, - { NULL, pk_delete, 0, NULL, NULL}, - { NULL, pk_import, 0, NULL, NULL}, - { NULL, pk_export, 0, NULL, NULL}, - { NULL, pk_gencert, 0, NULL, NULL}, - { NULL, pk_gencsr, 0, NULL, NULL}, - { NULL, pk_download, 0, NULL, NULL}, - { NULL, pk_genkey, 0, NULL, NULL}, - { NULL, pk_signcsr, 0, NULL, NULL}, - { NULL, pk_inittoken, 0, NULL, NULL}, - { NULL, pk_genkeypair, 0, NULL, NULL}, - { NULL, pk_help, 0, NULL, NULL} + { NULL, pk_tokens, 0, NULL, NULL }, + { NULL, pk_setpin, 0, NULL, NULL }, + { NULL, pk_list, 0, NULL, NULL }, + { NULL, pk_delete, 0, NULL, NULL }, + { NULL, pk_import, 0, NULL, NULL }, + { NULL, pk_export, 0, NULL, NULL }, + { NULL, pk_gencert, 0, NULL, NULL }, + { NULL, pk_gencsr, 0, NULL, NULL }, + { NULL, pk_download, 0, NULL, NULL }, + { NULL, pk_genkey, 0, NULL, NULL }, + { NULL, pk_signcsr, 0, NULL, NULL }, + { NULL, pk_inittoken, 0, NULL, NULL }, + { NULL, pk_genkeypair, 0, NULL, NULL }, + { NULL, pk_help, 0, NULL, NULL } }; static int num_cmds = sizeof (cmds) / sizeof (verbcmd); diff --git a/usr/src/cmd/cmd-crypto/pktool/setpin.c b/usr/src/cmd/cmd-crypto/pktool/setpin.c index 471e449ccc..40b49338e5 100644 --- a/usr/src/cmd/cmd-crypto/pktool/setpin.c +++ b/usr/src/cmd/cmd-crypto/pktool/setpin.c @@ -44,8 +44,8 @@ setpin_nss(KMF_HANDLE_T handle, char *token_spec, char *dir, char *prefix) { int rv = 0; - KMF_CREDENTIAL oldcred = {NULL, 0}; - KMF_CREDENTIAL newpincred = {NULL, 0}; + KMF_CREDENTIAL oldcred = { NULL, 0 }; + KMF_CREDENTIAL newpincred = { NULL, 0 }; CK_UTF8CHAR_PTR old_pin = NULL, new_pin = NULL; CK_ULONG old_pinlen = 0, new_pinlen = 0; KMF_ATTRIBUTE setpinattrs[6]; @@ -119,8 +119,8 @@ setpin_pkcs11(KMF_HANDLE_T handle, char *token_spec, boolean_t souser) CK_RV rv = CKR_OK; char *token_name = NULL; CK_TOKEN_INFO token_info; - KMF_CREDENTIAL newpincred = {NULL, 0}; - KMF_CREDENTIAL oldcred = {NULL, 0}; + KMF_CREDENTIAL newpincred = { NULL, 0 }; + KMF_CREDENTIAL oldcred = { NULL, 0 }; KMF_KEYSTORE_TYPE kstype = KMF_KEYSTORE_PK11TOKEN; KMF_ATTRIBUTE attrlist[6]; CK_USER_TYPE user = CKU_USER; diff --git a/usr/src/cmd/cmd-crypto/pktool/signcsr.c b/usr/src/cmd/cmd-crypto/pktool/signcsr.c index c13bdffbc2..d7ab9e6d83 100644 --- a/usr/src/cmd/cmd-crypto/pktool/signcsr.c +++ b/usr/src/cmd/cmd-crypto/pktool/signcsr.c @@ -49,8 +49,8 @@ read_csrdata(KMF_HANDLE_T handle, char *csrfile, KMF_CSR_DATA *csrdata) { KMF_RETURN rv = KMF_OK; KMF_ENCODE_FORMAT csrfmt; - KMF_DATA csrfiledata = {NULL, 0}; - KMF_DATA rawcsr = {NULL, 0}; + KMF_DATA csrfiledata = { 0, NULL }; + KMF_DATA rawcsr = { 0, NULL }; rv = kmf_get_file_format(csrfile, &csrfmt); if (rv != KMF_OK) @@ -265,7 +265,7 @@ pk_signcsr_files(KMF_HANDLE_T handle, KMF_KEYSTORE_TYPE kstype = KMF_KEYSTORE_OPENSSL; KMF_KEY_CLASS keyclass = KMF_ASYM_PRI; KMF_KEY_HANDLE cakey; - KMF_DATA certdata = {NULL, 0}; + KMF_DATA certdata = { 0, NULL }; int numattr, count; (void) memset(&cakey, 0, sizeof (cakey)); @@ -361,8 +361,8 @@ pk_signcsr_pk11_nss(KMF_HANDLE_T handle, KMF_ENCODE_FORMAT fmt, int store, char *outlabel) { KMF_RETURN rv = KMF_OK; - KMF_DATA outcert = {NULL, 0}; - KMF_CSR_DATA csrdata = {NULL, 0}; + KMF_DATA outcert = { 0, NULL }; + KMF_CSR_DATA csrdata = { 0, NULL }; KMF_KEY_HANDLE casignkey; KMF_KEY_CLASS keyclass = KMF_ASYM_PRI; KMF_ATTRIBUTE attrlist[16]; @@ -548,7 +548,7 @@ pk_signcsr(int argc, char *argv[]) KMF_KEYSTORE_TYPE kstype = 0; KMF_RETURN rv = KMF_OK; KMF_HANDLE_T kmfhandle = NULL; - KMF_CREDENTIAL tokencred = {NULL, 0}; + KMF_CREDENTIAL tokencred = { NULL, 0 }; KMF_GENERALNAMECHOICES alttype = 0; KMF_ENCODE_FORMAT fmt = KMF_FORMAT_PEM; diff --git a/usr/src/cmd/cmd-crypto/tpmadm/admin_cmds.c b/usr/src/cmd/cmd-crypto/tpmadm/admin_cmds.c index fcdc801baa..8155affad2 100644 --- a/usr/src/cmd/cmd-crypto/tpmadm/admin_cmds.c +++ b/usr/src/cmd/cmd-crypto/tpmadm/admin_cmds.c @@ -50,13 +50,13 @@ int cmd_keyinfo(TSS_HCONTEXT hContext, TSS_HTPM hTPM, int argc, char *argv[]); int cmd_deletekey(TSS_HCONTEXT hContext, TSS_HTPM hTPM, int argc, char *argv[]); cmdtable_t commands[] = { - {"status", "", cmd_status}, - {"init", "", cmd_init}, - {"clear", "[owner | lock]", cmd_clear}, - {"auth", "", cmd_auth}, - {"keyinfo", "[uuid]", cmd_keyinfo}, - {"deletekey", "uuid", cmd_deletekey}, - {NULL, NULL, NULL}, + { "status", "", cmd_status }, + { "init", "", cmd_init }, + { "clear", "[owner | lock]", cmd_clear }, + { "auth", "", cmd_auth }, + { "keyinfo", "[uuid]", cmd_keyinfo }, + { "deletekey", "uuid", cmd_deletekey }, + { NULL, NULL, NULL }, }; BYTE well_known[] = TSS_WELL_KNOWN_SECRET; diff --git a/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c b/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c index df701805f9..aed788596e 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c @@ -577,7 +577,7 @@ load_from_pkcs11(KMF_HANDLE_T kmfh, KMF_X509_DER_CERT cert; KMF_KEY_HANDLE key, rawkey; KMF_CREDENTIAL creds; - KMF_DATA iddata = { NULL, 0 }; + KMF_DATA iddata = { 0, NULL }; kssl_params_t *kssl_params = NULL; uint32_t ncerts, nkeys; char *err, *idstr = NULL; |