From 35afc7e39e9e95562fb39c070855f5c16ebd44ff Mon Sep 17 00:00:00 2001
From: Martin Nilsson <nilsson@opera.com>
Date: Sat, 1 Mar 2014 08:26:24 +0100
Subject: [PATCH] Remove deprecated ecdsa accessor. Since ecdsa is new, it
 doesn't make sense to add legacy API for it.

---
 lib/modules/SSL.pmod/context.pike | 17 -----------------
 lib/modules/SSL.pmod/testsuite.in | 14 +++++++-------
 2 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/lib/modules/SSL.pmod/context.pike b/lib/modules/SSL.pmod/context.pike
index e016760664..29c57b38c9 100644
--- a/lib/modules/SSL.pmod/context.pike
+++ b/lib/modules/SSL.pmod/context.pike
@@ -224,23 +224,6 @@ __deprecated__ void `dsa=(Crypto.DSA k)
 //! Parameters for dh keyexchange.
 .Cipher.DHKeyExchange dh_ke;
 
-#if constant(Crypto.ECC.Curve)
-//! Compatibility.
-//! @deprecated private_key
-__deprecated__ Crypto.ECC.SECP_521R1.ECDSA `ecdsa()
-{
-  return private_key && has_prefix(private_key->name(), "ECDSA") && 
-    [object(Crypto.ECC.SECP_521R1.ECDSA)]private_key;
-}
-
-//! Compatibility.
-//! @deprecated private_key
-__deprecated__ void `ecdsa=(Crypto.ECC.SECP_521R1.ECDSA k)
-{
-  private_key = k;
-}
-#endif
-
 //! Used to generate random cookies for the hello-message. If we use
 //! the RSA keyexchange method, and this is a server, this random
 //! number generator is not used for generating the master_secret. By
diff --git a/lib/modules/SSL.pmod/testsuite.in b/lib/modules/SSL.pmod/testsuite.in
index 0299647c5b..9b3e7b5ad2 100644
--- a/lib/modules/SSL.pmod/testsuite.in
+++ b/lib/modules/SSL.pmod/testsuite.in
@@ -79,7 +79,7 @@ test_do([[
   ASSERT(key);
 
   object rsa = Standards.PKCS.RSA.parse_private_key(key);
-  ctx->rsa = rsa;
+  ctx->private_key = rsa;
   ASSERT(rsa->rsa_size()>512);
   ctx->short_rsa = Crypto.RSA();
   ctx->short_rsa->set_random(ctx->random);
@@ -95,12 +95,12 @@ test_do([[
 test_do([[
   SSL.context ctx = SSL.context();
   ctx->random = random_string;
-  ctx->dsa = Crypto.DSA()->generate_key(1024, 160);
+  ctx->private_key = Crypto.DSA()->generate_key(1024, 160);
   mapping attrs = ([
     "organizationName" : "Test",
     "commonName" : "*",
   ]);
-  string cert = Standards.X509.make_selfsigned_certificate(ctx->dsa,
+  string cert = Standards.X509.make_selfsigned_certificate(ctx->private_key,
     3600*24, attrs);
   ctx->certificates = ({ cert });
   ctx->dhe_dss_mode();
@@ -110,13 +110,13 @@ test_do([[
 test_do([[
   SSL.context ctx = SSL.context();
   ctx->random = random_string;
-  ctx->ecdsa = Crypto.ECC.SECP_521R1.ECDSA()->
+  ctx->private_key = Crypto.ECC.SECP_521R1.ECDSA()->
     set_random(random_string)->generate_key();
   mapping attrs = ([
     "organizationName" : "Test",
     "commonName" : "*",
   ]);
-  string cert = Standards.X509.make_selfsigned_certificate(ctx->ecdsa,
+  string cert = Standards.X509.make_selfsigned_certificate(ctx->private_key,
     3600*24, attrs);
   ctx->certificates = ({ cert });
   ctx->ecdsa_mode();
@@ -467,13 +467,13 @@ test_tests([[
 object make_context(Crypto.ECC.Curve curve) {
   SSL.context ctx = SSL.context();
   ctx->random = random_string;
-  ctx->ecdsa = curve->ECDSA()->
+  ctx->private_key = curve->ECDSA()->
     set_random(random_string)->generate_key();
   mapping attrs = ([
     "organizationName" : "Test",
     "commonName" : "*",
   ]);
-  string cert = Standards.X509.make_selfsigned_certificate(ctx->ecdsa,
+  string cert = Standards.X509.make_selfsigned_certificate(ctx->private_key,
     3600*24, attrs);
   ctx->certificates = ({ cert });
   ctx->ecdsa_mode();
-- 
GitLab