Dead code cleanup: crypto/ec,ecdh,ecdsa
authorRich Salz <rsalz@openssl.org>
Mon, 2 Feb 2015 16:56:47 +0000 (11:56 -0500)
committerRich Salz <rsalz@openssl.org>
Mon, 2 Feb 2015 16:56:47 +0000 (11:56 -0500)
Reviewed-by: Andy Polyakov <appro@openssl.org>
crypto/ec/ec_curve.c
crypto/ecdh/ech_lib.c
crypto/ecdh/ech_locl.h
crypto/ecdh/ech_ossl.c
crypto/ecdsa/ecs_lib.c
crypto/ecdsa/ecs_locl.h
crypto/ecdsa/ecs_ossl.c

index 81846ecc52235be7be0c9b36a9a1e915d476c306..6199e25c6a0135281a10570d6ee1a3dd19432883 100644 (file)
@@ -1061,16 +1061,6 @@ static const struct {
         NID_X9_62_characteristic_two_field, 0, 21, 2
     },
     {
-        /* no seed */
-# if 0
-        /*
-        * The algorithm used to derive the curve parameters from the seed
-        * used here is slightly different than the algorithm described in
-        * X9.62 .
-        */
-        0x24, 0xB7, 0xB1, 0x37, 0xC8, 0xA1, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75,
-        0x61, 0x51, 0x75, 0x6F, 0xD0, 0xDA, 0x2E, 0x5C,
-# endif
         /* p */
         0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC9,
@@ -1100,16 +1090,6 @@ static const struct {
         NID_X9_62_characteristic_two_field, 0, 21, 2
     },
     {
-        /* no seed */
-# if 0
-        /*
-        * The seed here was used to created the curve parameters in normal
-        * basis representation (and not the polynomial representation used
-        * here)
-        */
-        0x85, 0xE2, 0x5B, 0xFE, 0x5C, 0x86, 0x22, 0x6C, 0xDB, 0x12, 0x01, 0x6F,
-        0x75, 0x53, 0xF9, 0xD0, 0xE6, 0x93, 0xA2, 0x68,
-# endif
         /* p */
         0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC9,
index b910b503fbbe9f19408bb8a07c1be8668500b798..51473682a44709f4d08151051516fc0f21b459f9 100644 (file)
@@ -103,11 +103,6 @@ int ECDH_set_method(EC_KEY *eckey, const ECDH_METHOD *meth)
     if (ecdh == NULL)
         return 0;
 
-#if 0
-    mtmp = ecdh->meth;
-    if (mtmp->finish)
-        mtmp->finish(eckey);
-#endif
 #ifndef OPENSSL_NO_ENGINE
     if (ecdh->engine) {
         ENGINE_finish(ecdh->engine);
@@ -115,10 +110,6 @@ int ECDH_set_method(EC_KEY *eckey, const ECDH_METHOD *meth)
     }
 #endif
     ecdh->meth = meth;
-#if 0
-    if (meth->init)
-        meth->init(eckey);
-#endif
     return 1;
 }
 
@@ -152,13 +143,6 @@ static ECDH_DATA *ECDH_DATA_new_method(ENGINE *engine)
 
     ret->flags = ret->meth->flags;
     CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ECDH, ret, &ret->ex_data);
-#if 0
-    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
-        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDH, ret, &ret->ex_data);
-        OPENSSL_free(ret);
-        ret = NULL;
-    }
-#endif
     return (ret);
 }
 
index 4e66024c7581c2135e5b4ed7d729eb5c86fde439..d61ef80c6ba04b4ea3a353de15e411d62b106cbf 100644 (file)
@@ -68,10 +68,6 @@ struct ecdh_method {
                         EC_KEY *ecdh, void *(*KDF) (const void *in,
                                                     size_t inlen, void *out,
                                                     size_t *outlen));
-# if 0
-    int (*init) (EC_KEY *eckey);
-    int (*finish) (EC_KEY *eckey);
-# endif
     int flags;
     char *app_data;
 };
index e60cf10b9cb35abd944c969d053059925c662e38..278c41b84acbd2b40f8d0e1346e605b57e222070 100644 (file)
@@ -86,10 +86,6 @@ static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key,
 static ECDH_METHOD openssl_ecdh_meth = {
     "OpenSSL ECDH method",
     ecdh_compute_key,
-#if 0
-    NULL,                       /* init */
-    NULL,                       /* finish */
-#endif
     ECDH_FLAG_FIPS_METHOD,      /* flags */
     NULL                        /* app_data */
 };
index 321b425d7c530d93c24236c443efca892b0ba8e8..67e521fb8a021224ca851b26d5599d3ac968913e 100644 (file)
@@ -131,13 +131,6 @@ static ECDSA_DATA *ECDSA_DATA_new_method(ENGINE *engine)
 
     ret->flags = ret->meth->flags;
     CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ECDSA, ret, &ret->ex_data);
-#if 0
-    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
-        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDSA, ret, &ret->ex_data);
-        OPENSSL_free(ret);
-        ret = NULL;
-    }
-#endif
     return (ret);
 }
 
index d3a5efc54738987e64de3a086decb13079eccac0..9a0666e20974d2d35da8a3f60d77d9b017cf1464 100644 (file)
@@ -74,10 +74,6 @@ struct ecdsa_method {
                              BIGNUM **r);
     int (*ecdsa_do_verify) (const unsigned char *dgst, int dgst_len,
                             const ECDSA_SIG *sig, EC_KEY *eckey);
-# if 0
-    int (*init) (EC_KEY *eckey);
-    int (*finish) (EC_KEY *eckey);
-# endif
     int flags;
     void *app_data;
 };
index c232321cf91a318c5f62731c1a9f23fec8ec7872..1343850e5a1985f0c1056d965a5ed017efe379e5 100644 (file)
@@ -77,10 +77,6 @@ static ECDSA_METHOD openssl_ecdsa_meth = {
     ecdsa_do_sign,
     ecdsa_sign_setup_no_digest,
     ecdsa_do_verify,
-#if 0
-    NULL,                       /* init */
-    NULL,                       /* finish */
-#endif
     ECDSA_FLAG_FIPS_METHOD,     /* flags */
     NULL                        /* app_data */
 };