pike.git / lib / modules / SSL.pmod / https.pike

version» Context lines:

pike.git/lib/modules/SSL.pmod/https.pike:195: Inside #if constant(SSL.Cipher.CipherAlgorithm) and #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 + #ifdef ECDSA_MODE +  ecdsa = Crypto.ECC.SECP_521R1.ECDSA()-> +  set_random(Crypto.Random.random_string)->generate_key(); +  my_certificate = +  Standards.X509.make_selfsigned_certificate(ecdsa, 3600*4, ([ +  "organizationName" : "Test", +  "commonName" : "*", +  ])); +  ecdsa_mode(); + #else    SSL3_DEBUG_MSG("Cert: '%s'\n", String.string2hex(my_certificate));    SSL3_DEBUG_MSG("Key: '%s'\n", String.string2hex(my_key));   #if 0    array key = SSL.asn1.ber_decode(my_key)->get_asn1()[1];    SSL3_DEBUG_MSG("Decoded key: %O\n", key);    object n = key[1][1];    object e = key[2][1];    object d = key[3][1];    object p = key[4][1];    object q = key[5][1];
pike.git/lib/modules/SSL.pmod/https.pike:218: 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(); + #endif    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