Branch: Tag:

2004-08-18

2004-08-18 15:44:16 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added custom variable types for the SSL certificate files.
SSLProtocol is now compiled in a #pike __REAL_VERSION__ context.

Rev: server/base_server/roxen.pike:1.878

6:   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.877 2004/06/30 16:58:39 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.878 2004/08/18 15:44:16 grubba Exp $";      //! @appears roxen   //!
1606:    }   }    + #pike __REAL_VERSION__   #if constant(SSL.sslfile)   class SSLProtocol   //! Base protocol for SSL ports. Exactly like Port, but uses SSL.
1615: Inside #if constant(SSL.sslfile)
   // SSL context    SSL.context ctx;    +  class CertificateListVariable +  { +  inherit Variable.FileList; +  +  string doc() +  { +  return sprintf(::doc() + "\n", +  combine_path(getcwd(), "../local"), +  getcwd()); +  } +  } +  +  class KeyFileVariable +  { +  inherit Variable.String; +  +  string doc() +  { +  return sprintf(::doc() + "\n", +  combine_path(getcwd(), "../local"), +  getcwd()); +  } +  } +     class destruct_protected_sslfile    {    SSL.sslfile sslfile;
1704: Inside #if constant(SSL.sslfile)
   if( f2 )    msg = Tools.PEM.pem_msg()->init( f2 );    + #if constant(Crypto.Random.random_string) +  function r = Crypto.Random.random_string; + #else    function r = Crypto.randomness.reasonably_random()->read; -  + #endif       SSL3_WERR(sprintf("key file contains: %O", indices(msg->parts)));   
1732: Inside #if constant(SSL.sslfile)
   if (rsa->rsa_size() > 512)    {    /* Too large for export */ + #if constant(Crypto.RSA) +  ctx->short_rsa = Crypto.RSA()->generate_key(512, r); + #else    ctx->short_rsa = Crypto.rsa()->generate_key(512, r); -  + #endif       // ctx->long_rsa = Crypto.rsa()->generate_key(rsa->rsa_size(), r);    }
1814:    }   }   #endif + // FIXME: Remove the following line when targetting for a newer Pike! + #pike 7.4      mapping(string:Protocol) build_protocols_mapping()   {