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

version» Context lines:

pike.git/lib/modules/SSL.pmod/https.pike:33:   class conn {    import Stdio;       object sslfile;       string message = "<html><head><title>SSL-3 server</title></head>\n"    "<body><h1>This is a minimal SSL-3 http server</h1>\n"    "<hr><it>/nisse</it></body></html>\n";    int index = 0;    -  void do_write() +  void write_callback()    {    if (index < strlen(message))    {    int written = sslfile->write(message[index..]);    if (written > 0)    index += written;    else    sslfile->close();    }    if (index == strlen(message))    sslfile->close();    }       void read_callback(mixed id, string data)    {   #ifdef SSL3_DEBUG -  werror("Recieved: '" + data + "'\n"); +  werror("Received: '" + data + "'\n");   #endif -  do_write(); +  sslfile->set_write_callback(write_callback);    }    -  void write_callback(mixed id) -  { -  do_write(); -  } -  +     void create(object f)    {    sslfile = f; -  sslfile->set_nonblocking(read_callback, write_callback, 0); +  sslfile->set_nonblocking(read_callback, 0, 0);    }   }      class no_random {    object rc4 = Crypto.rc4();       void create(string|void secret)    {    if (!secret)    secret = sprintf("Foo!%4c", time());
pike.git/lib/modules/SSL.pmod/https.pike:154:    exponent2 INTEGER, -- d mod (q-1)    coefficient INTEGER -- (inverse of q) mod p }      Version ::= INTEGER      */      void my_accept_callback(object f)   {    werror("Accept!\n"); -  conn(f->accept()); +  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()));   #endif    array key = SSL.asn1.ber_decode(my_key)->get_asn1()[1];
pike.git/lib/modules/SSL.pmod/https.pike:196:    return 17;    }    else    return -17;   }      void create()   {   #ifdef SSL3_DEBUG    werror("https->create\n"); - #ifdef SSL3_DEBUG + #endif    sslport::create();   }