From: Dr. Stephen Henson Date: Fri, 11 Sep 2015 17:16:23 +0000 (+0100) Subject: Fix "defined but not used" warnings. X-Git-Tag: OpenSSL_1_1_0-pre1~627 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=8cf2782399c449ecf91f2d292f483e7999a40f6d Fix "defined but not used" warnings. Reviewed-by: Matt Caswell --- diff --git a/crypto/include/internal/bn_srp.h b/crypto/include/internal/bn_srp.h index 61befd3e9e..153c8cde12 100644 --- a/crypto/include/internal/bn_srp.h +++ b/crypto/include/internal/bn_srp.h @@ -21,16 +21,4 @@ extern const BIGNUM bn_generator_5; extern const BIGNUM bn_generator_2; -static SRP_gN knowngN[] = { - {"8192", (BIGNUM *)&bn_generator_19, (BIGNUM *)&bn_group_8192}, - {"6144", (BIGNUM *)&bn_generator_5, (BIGNUM *)&bn_group_6144}, - {"4096", (BIGNUM *)&bn_generator_5, (BIGNUM *)&bn_group_4096}, - {"3072", (BIGNUM *)&bn_generator_5, (BIGNUM *)&bn_group_3072}, - {"2048", (BIGNUM *)&bn_generator_2, (BIGNUM *)&bn_group_2048}, - {"1536", (BIGNUM *)&bn_generator_2, (BIGNUM *)&bn_group_1536}, - {"1024", (BIGNUM *)&bn_generator_2, (BIGNUM *)&bn_group_1024}, -}; - -# define KNOWN_GN_NUMBER sizeof(knowngN) / sizeof(SRP_gN) - #endif diff --git a/crypto/srp/srp_lib.c b/crypto/srp/srp_lib.c index 893047349a..850ec2ce64 100644 --- a/crypto/srp/srp_lib.c +++ b/crypto/srp/srp_lib.c @@ -306,6 +306,18 @@ int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N) return SRP_Verify_B_mod_N(A, N); } +static SRP_gN knowngN[] = { + {"8192", (BIGNUM *)&bn_generator_19, (BIGNUM *)&bn_group_8192}, + {"6144", (BIGNUM *)&bn_generator_5, (BIGNUM *)&bn_group_6144}, + {"4096", (BIGNUM *)&bn_generator_5, (BIGNUM *)&bn_group_4096}, + {"3072", (BIGNUM *)&bn_generator_5, (BIGNUM *)&bn_group_3072}, + {"2048", (BIGNUM *)&bn_generator_2, (BIGNUM *)&bn_group_2048}, + {"1536", (BIGNUM *)&bn_generator_2, (BIGNUM *)&bn_group_1536}, + {"1024", (BIGNUM *)&bn_generator_2, (BIGNUM *)&bn_group_1024}, +}; + +# define KNOWN_GN_NUMBER sizeof(knowngN) / sizeof(SRP_gN) + /* * Check if G and N are kwown parameters. The values have been generated * from the ietf-tls-srp draft version 8 diff --git a/crypto/x509v3/ext_dat.h b/crypto/x509v3/ext_dat.h index 0e93d82e95..c1ddedbfab 100644 --- a/crypto/x509v3/ext_dat.h +++ b/crypto/x509v3/ext_dat.h @@ -70,69 +70,3 @@ extern const X509V3_EXT_METHOD v3_policy_mappings, v3_policy_constraints; extern const X509V3_EXT_METHOD v3_name_constraints, v3_inhibit_anyp, v3_idp; extern const X509V3_EXT_METHOD v3_addr, v3_asid; extern const X509V3_EXT_METHOD v3_ct_scts[]; - -/* - * This table will be searched using OBJ_bsearch so it *must* kept in order - * of the ext_nid values. - */ - -static const X509V3_EXT_METHOD *standard_exts[] = { - &v3_nscert, - &v3_ns_ia5_list[0], - &v3_ns_ia5_list[1], - &v3_ns_ia5_list[2], - &v3_ns_ia5_list[3], - &v3_ns_ia5_list[4], - &v3_ns_ia5_list[5], - &v3_ns_ia5_list[6], - &v3_skey_id, - &v3_key_usage, - &v3_pkey_usage_period, - &v3_alt[0], - &v3_alt[1], - &v3_bcons, - &v3_crl_num, - &v3_cpols, - &v3_akey_id, - &v3_crld, - &v3_ext_ku, - &v3_delta_crl, - &v3_crl_reason, -#ifndef OPENSSL_NO_OCSP - &v3_crl_invdate, -#endif - &v3_sxnet, - &v3_info, -#ifndef OPENSSL_NO_RFC3779 - &v3_addr, - &v3_asid, -#endif -#ifndef OPENSSL_NO_OCSP - &v3_ocsp_nonce, - &v3_ocsp_crlid, - &v3_ocsp_accresp, - &v3_ocsp_nocheck, - &v3_ocsp_acutoff, - &v3_ocsp_serviceloc, -#endif - &v3_sinfo, - &v3_policy_constraints, -#ifndef OPENSSL_NO_OCSP - &v3_crl_hold, -#endif - &v3_pci, - &v3_name_constraints, - &v3_policy_mappings, - &v3_inhibit_anyp, - &v3_idp, - &v3_alt[2], - &v3_freshest_crl, -#ifndef OPENSSL_NO_SCT - &v3_ct_scts[0], - &v3_ct_scts[1], -#endif -}; - -/* Number of standard extensions */ - -#define STANDARD_EXTENSION_COUNT OSSL_NELEM(standard_exts) diff --git a/crypto/x509v3/v3_lib.c b/crypto/x509v3/v3_lib.c index 93af5716cf..5073575623 100644 --- a/crypto/x509v3/v3_lib.c +++ b/crypto/x509v3/v3_lib.c @@ -96,6 +96,72 @@ DECLARE_OBJ_BSEARCH_CMP_FN(const X509V3_EXT_METHOD *, IMPLEMENT_OBJ_BSEARCH_CMP_FN(const X509V3_EXT_METHOD *, const X509V3_EXT_METHOD *, ext); +/* + * This table will be searched using OBJ_bsearch so it *must* kept in order + * of the ext_nid values. + */ + +static const X509V3_EXT_METHOD *standard_exts[] = { + &v3_nscert, + &v3_ns_ia5_list[0], + &v3_ns_ia5_list[1], + &v3_ns_ia5_list[2], + &v3_ns_ia5_list[3], + &v3_ns_ia5_list[4], + &v3_ns_ia5_list[5], + &v3_ns_ia5_list[6], + &v3_skey_id, + &v3_key_usage, + &v3_pkey_usage_period, + &v3_alt[0], + &v3_alt[1], + &v3_bcons, + &v3_crl_num, + &v3_cpols, + &v3_akey_id, + &v3_crld, + &v3_ext_ku, + &v3_delta_crl, + &v3_crl_reason, +#ifndef OPENSSL_NO_OCSP + &v3_crl_invdate, +#endif + &v3_sxnet, + &v3_info, +#ifndef OPENSSL_NO_RFC3779 + &v3_addr, + &v3_asid, +#endif +#ifndef OPENSSL_NO_OCSP + &v3_ocsp_nonce, + &v3_ocsp_crlid, + &v3_ocsp_accresp, + &v3_ocsp_nocheck, + &v3_ocsp_acutoff, + &v3_ocsp_serviceloc, +#endif + &v3_sinfo, + &v3_policy_constraints, +#ifndef OPENSSL_NO_OCSP + &v3_crl_hold, +#endif + &v3_pci, + &v3_name_constraints, + &v3_policy_mappings, + &v3_inhibit_anyp, + &v3_idp, + &v3_alt[2], + &v3_freshest_crl, +#ifndef OPENSSL_NO_SCT + &v3_ct_scts[0], + &v3_ct_scts[1], +#endif +}; + +/* Number of standard extensions */ + +#define STANDARD_EXTENSION_COUNT OSSL_NELEM(standard_exts) + const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) { X509V3_EXT_METHOD tmp;