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

version» Context lines:

pike.git/lib/modules/SSL.pmod/https.pike:1:   #pike __REAL_VERSION__    - /* $Id: https.pike,v 1.13 2003/01/20 17:44:01 nilsson Exp $ + /* $Id: https.pike,v 1.14 2003/01/27 01:41:17 nilsson Exp $    *    * dummy https server    */      //! Dummy HTTPS server      #define PORT 25678      import Stdio;   
pike.git/lib/modules/SSL.pmod/https.pike:110:      void my_accept_callback(object f)   {    werror("Accept!\n");    conn(accept());   }      int main()   {   #ifdef SSL3_DEBUG -  werror(sprintf("Cert: '%s'\n", Crypto.string_to_hex(my_certificate))); -  werror(sprintf("Key: '%s'\n", Crypto.string_to_hex(my_key))); - // werror(sprintf("Decoded cert: %O\n", SSL.asn1.ber_decode(my_certificate)->get_asn1())); +  werror("Cert: '%s'\n", Crypto.string_to_hex(my_certificate)); +  werror("Key: '%s'\n", Crypto.string_to_hex(my_key)); + // werror("Decoded cert: %O\n", SSL.asn1.ber_decode(my_certificate)->get_asn1());   #endif   #if 0    array key = SSL.asn1.ber_decode(my_key)->get_asn1()[1];   #ifdef SSL3_DEBUG -  werror(sprintf("Decoded key: %O\n", key)); +  werror("Decoded key: %O\n", key);   #endif    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];    -  werror(sprintf("n = %s\np = %s\nq = %s\npq = %s\n", -  n->digits(), p->digits(), q->digits(), (p*q)->digits())); +  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);   #endif /* 0 */    certificates = ({ my_certificate });    random = no_random()->read;