pike.git/lib/modules/SSL.pmod/https.pike:25: Inside #if constant(SSL.Cipher.CipherAlgorithm) and #if undefined(HTTPS_CLIENT)
{
SSL3_DEBUG_MSG("https->create\n");
sslport::create();
}
void my_accept_callback(object f)
{
werror("Accept!\n");
conn(accept());
}
+
+ protected string fmt_cipher_suites(array(int) s)
+ {
+ String.Buffer b = String.Buffer();
+ mapping(int:string) ciphers = ([]);
+ foreach([array(string)]indices(SSL.Constants), string id)
+ if( has_prefix(id, "SSL_") || has_prefix(id, "TLS_") ||
+ has_prefix(id, "SSL2_") )
+ ciphers[SSL.Constants[id]] = id;
+ foreach(s, int c)
+ b->sprintf(" %-6d: %09x: %s\n",
+ c, cipher_suite_sort_key(c), ciphers[c]||"unknown");
+ return (string)b;
+ }
#endif
string my_certificate = MIME.decode_base64(
"MIIBxDCCAW4CAQAwDQYJKoZIhvcNAQEEBQAwbTELMAkGA1UEBhMCREUxEzARBgNV\n"
"BAgTClRodWVyaW5nZW4xEDAOBgNVBAcTB0lsbWVuYXUxEzARBgNVBAoTClRVIEls\n"
"bWVuYXUxDDAKBgNVBAsTA1BNSTEUMBIGA1UEAxMLZGVtbyBzZXJ2ZXIwHhcNOTYw\n"
"NDMwMDUzNjU4WhcNOTYwNTMwMDUzNjU5WjBtMQswCQYDVQQGEwJERTETMBEGA1UE\n"
"CBMKVGh1ZXJpbmdlbjEQMA4GA1UEBxMHSWxtZW5hdTETMBEGA1UEChMKVFUgSWxt\n"
"ZW5hdTEMMAoGA1UECxMDUE1JMRQwEgYDVQQDEwtkZW1vIHNlcnZlcjBcMA0GCSqG\n"
"SIb3DQEBAQUAA0sAMEgCQQDBB6T7bGJhRhRSpDESxk6FKh3iKKrpn4KcDtFM0W6s\n"
pike.git/lib/modules/SSL.pmod/https.pike:202: Inside #if constant(SSL.Cipher.CipherAlgorithm) and #if 0
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);
#endif /* 0 */
// Make sure all cipher suites are available.
rsa_mode();
+ SSL3_DEBUG_MSG("Cipher suites:\n%s", fmt_cipher_suites(preferred_suites));
certificates = ({ 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
}
#else // constant(SSL.Cipher.CipherAlgorithm)
constant this_program_does_not_exist = 1;
#endif