pike.git/lib/modules/SSL.pmod/https.pike:190: Inside #if defined(HTTPS_CLIENT)
{
#ifdef HTTPS_CLIENT
Stdio.File con = Stdio.File();
if (!con->connect("127.0.0.1", PORT)) {
werror("Failed to connect to server: %s\n", strerror(con->errno()));
return 17;
}
client(con);
return -17;
#else
+ Crypto.Sign key;
+
#ifdef ECDSA_MODE
#if constant(Crypto.ECC.Curve)
- ecdsa = Crypto.ECC.SECP_521R1.ECDSA()->
+ key = Crypto.ECC.SECP_521R1.ECDSA()->
set_random(Crypto.Random.random_string)->generate_key();
my_certificate =
- Standards.X509.make_selfsigned_certificate(ecdsa, 3600*4, ([
+ Standards.X509.make_selfsigned_certificate(key, 3600*4, ([
"organizationName" : "Test",
"commonName" : "*",
]));
ecdsa_mode();
#else
#error ECDSA not supported by this Pike.
exit(1);
#endif
#else
SSL3_DEBUG_MSG("Cert: '%s'\n", String.string2hex(my_certificate));
pike.git/lib/modules/SSL.pmod/https.pike:224: Inside #if 0
object q = key[5][1];
werror("n = %s\np = %s\nq = %s\npq = %s\n",
n->digits(), p->digits(), q->digits(), (p*q)->digits());
rsa = Crypto.RSA();
rsa->set_public_key(n, e);
rsa->set_private_key(d);
#else /* !0 */
// FIXME: Is this correct?
- rsa = Standards.PKCS.RSA.parse_private_key(my_key);
+ key = Standards.PKCS.RSA.parse_private_key(my_key);
#endif /* 0 */
// Make sure all cipher suites are available.
rsa_mode();
#endif
SSL3_DEBUG_MSG("Cipher suites:\n%s", fmt_cipher_suites(preferred_suites));
- certificates = ({ my_certificate });
+ add_cert(key, ({ my_certificate }));
random = no_random()->read;
werror("Starting\n");
if (!bind(PORT, my_accept_callback))
{
perror("");
return 17;
}
else {
werror("Listening on port %d.\n", PORT);
return -17;
}
#endif
}