Skip to content
Snippets Groups Projects
Commit 6222d27b authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

SSL: Updated to the new Crypto.Sign API.

parent 8d8ad8bf
No related branches found
No related tags found
No related merge requests found
...@@ -1266,7 +1266,7 @@ class CertificatePair ...@@ -1266,7 +1266,7 @@ class CertificatePair
int cert_type; int cert_type;
//! Private key. //! Private key.
Crypto.Sign key; Crypto.Sign.State key;
//! Chain of certificates, root cert last. //! Chain of certificates, root cert last.
array(string(8bit)) certs; array(string(8bit)) certs;
...@@ -1380,7 +1380,7 @@ class CertificatePair ...@@ -1380,7 +1380,7 @@ class CertificatePair
//! //!
//! @note //! @note
//! Performs various validation checks. //! Performs various validation checks.
protected void create(Crypto.Sign key, array(string(8bit)) certs, protected void create(Crypto.Sign.State key, array(string(8bit)) certs,
array(string(8bit))|void extra_name_globs) array(string(8bit))|void extra_name_globs)
{ {
if (!sizeof(certs)) { if (!sizeof(certs)) {
......
...@@ -141,8 +141,8 @@ Alert alert_factory(object con, ...@@ -141,8 +141,8 @@ Alert alert_factory(object con,
//! //!
//! When the counters reach zero, the corresponding RSA key is cleared, //! When the counters reach zero, the corresponding RSA key is cleared,
//! and a new generated on demand at which time the counter is reset. //! and a new generated on demand at which time the counter is reset.
Crypto.RSA long_rsa; Crypto.RSA.State long_rsa;
Crypto.RSA short_rsa; Crypto.RSA.State short_rsa;
//! Counters for export RSA keys. //! Counters for export RSA keys.
int long_rsa_counter; int long_rsa_counter;
...@@ -713,9 +713,9 @@ array(CertificatePair) find_cert_domain(string(8bit) domain) ...@@ -713,9 +713,9 @@ array(CertificatePair) find_cert_domain(string(8bit) domain)
//! //!
//! Supported key types are currently: //! Supported key types are currently:
//! @mixed //! @mixed
//! @type Crypto.RSA //! @type Crypto.RSA.State
//! Rivest-Shamir-Adelman. //! Rivest-Shamir-Adelman.
//! @type Crypto.DSA //! @type Crypto.DSA.State
//! Digital Signing Algorithm. //! Digital Signing Algorithm.
//! @type Crypto.ECC.Curve.ECDSA //! @type Crypto.ECC.Curve.ECDSA
//! Elliptic Curve Digital Signing Algorithm. //! Elliptic Curve Digital Signing Algorithm.
...@@ -744,7 +744,7 @@ array(CertificatePair) find_cert_domain(string(8bit) domain) ...@@ -744,7 +744,7 @@ array(CertificatePair) find_cert_domain(string(8bit) domain)
//! //!
//! @seealso //! @seealso
//! @[find_cert()] //! @[find_cert()]
void add_cert(Crypto.Sign key, array(string(8bit)) certs, void add_cert(Crypto.Sign.State key, array(string(8bit)) certs,
array(string(8bit))|void extra_name_globs) array(string(8bit))|void extra_name_globs)
{ {
CertificatePair cp = CertificatePair(key, certs, extra_name_globs); CertificatePair cp = CertificatePair(key, certs, extra_name_globs);
...@@ -900,7 +900,7 @@ void purge_session(Session s) ...@@ -900,7 +900,7 @@ void purge_session(Session s)
// --- Compat code below // --- Compat code below
// //
protected Crypto.RSA compat_rsa; protected Crypto.RSA.State compat_rsa;
protected array(string(8bit)) compat_certificates; protected array(string(8bit)) compat_certificates;
//! The servers default private RSA key. //! The servers default private RSA key.
...@@ -911,7 +911,7 @@ protected array(string(8bit)) compat_certificates; ...@@ -911,7 +911,7 @@ protected array(string(8bit)) compat_certificates;
//! //!
//! @seealso //! @seealso
//! @[`certificates], @[find_cert()] //! @[`certificates], @[find_cert()]
__deprecated__ Crypto.RSA `rsa() __deprecated__ Crypto.RSA.State `rsa()
{ {
return compat_rsa; return compat_rsa;
} }
...@@ -924,7 +924,7 @@ __deprecated__ Crypto.RSA `rsa() ...@@ -924,7 +924,7 @@ __deprecated__ Crypto.RSA `rsa()
//! //!
//! @seealso //! @seealso
//! @[`certificates=], @[add_cert()] //! @[`certificates=], @[add_cert()]
__deprecated__ void `rsa=(Crypto.RSA k) __deprecated__ void `rsa=(Crypto.RSA.State k)
{ {
compat_rsa = k; compat_rsa = k;
if (k && compat_certificates) { if (k && compat_certificates) {
...@@ -976,7 +976,7 @@ __deprecated__ void `certificates=(array(string(8bit)) certs) ...@@ -976,7 +976,7 @@ __deprecated__ void `certificates=(array(string(8bit)) certs)
//! //!
//! @seealso //! @seealso
//! @[`certificates], @[find_cert()] //! @[`certificates], @[find_cert()]
__deprecated__ Crypto.RSA `client_rsa() __deprecated__ Crypto.RSA.State `client_rsa()
{ {
return compat_rsa; return compat_rsa;
} }
...@@ -989,7 +989,7 @@ __deprecated__ Crypto.RSA `client_rsa() ...@@ -989,7 +989,7 @@ __deprecated__ Crypto.RSA `client_rsa()
//! //!
//! @seealso //! @seealso
//! @[`client_certificates=], @[add_cert()] //! @[`client_certificates=], @[add_cert()]
__deprecated__ void `client_rsa=(Crypto.RSA k) __deprecated__ void `client_rsa=(Crypto.RSA.State k)
{ {
compat_rsa = k; compat_rsa = k;
if (k && compat_certificates) { if (k && compat_certificates) {
...@@ -1037,14 +1037,14 @@ __deprecated__ void `client_certificates=(array(array(string(8bit))) certs) ...@@ -1037,14 +1037,14 @@ __deprecated__ void `client_certificates=(array(array(string(8bit))) certs)
//! Compatibility. //! Compatibility.
//! @deprecated find_cert //! @deprecated find_cert
__deprecated__ Crypto.DSA `dsa() __deprecated__ Crypto.DSA.State `dsa()
{ {
return UNDEFINED; return UNDEFINED;
} }
//! Compatibility. //! Compatibility.
//! @deprecated add_cert //! @deprecated add_cert
__deprecated__ void `dsa=(Crypto.DSA k) __deprecated__ void `dsa=(Crypto.DSA.State k)
{ {
error("The old DSA API is not supported anymore.\n"); error("The old DSA API is not supported anymore.\n");
} }
......
...@@ -54,10 +54,10 @@ array(string(8bit)) peer_certificate_chain; ...@@ -54,10 +54,10 @@ array(string(8bit)) peer_certificate_chain;
array(string(8bit)) certificate_chain; array(string(8bit)) certificate_chain;
//! Our private key. //! Our private key.
Crypto.Sign private_key; Crypto.Sign.State private_key;
//! The peer's public key (from the certificate). //! The peer's public key (from the certificate).
Crypto.Sign peer_public_key; Crypto.Sign.State peer_public_key;
//! The max fragment size requested by the client. //! The max fragment size requested by the client.
int max_packet_size = PACKET_MAX_SIZE; int max_packet_size = PACKET_MAX_SIZE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment