Roxen.git / server / config_interface / actions / make_selfsigned_rsa.pike

version» Context lines:

Roxen.git/server/config_interface/actions/make_selfsigned_rsa.pike:1:   /* -  * $Id: make_selfsigned_rsa.pike,v 1.10 2008/08/15 12:33:54 mast Exp $ +  * $Id$    */      #if constant (Nettle)      inherit "ssl_common.pike";   inherit "wizard";   #include <roxen.h>   //<locale-token project="admin_tasks"> LOCALE </locale-token>   #define LOCALE(X,Y) _STR_LOCALE("admin_tasks",X,Y)   
Roxen.git/server/config_interface/actions/make_selfsigned_rsa.pike:86:    "organizationUnitName", "commonName" }), attr)    {    if (id->variables[attr]) {    attrs[attr] = global.String.trim_whites (id->variables[attr]);    if (attrs[attr] == "") m_delete (attrs, attr);    }    }       array name = ({ });    if (attrs->countryName) -  name += ({(["countryName": asn1_printable_string (attrs->countryName)])}); +  name += ({([ "countryName": PrintableString(attrs->countryName) ])});    foreach( ({ "stateOrProvinceName",    "localityName", "organizationName",    "organizationUnitName", "commonName" }), attr)    {    if (attrs[attr]) -  /* UTF8String is the recommended type. But it seems that -  * netscape can't handle that. So when PrintableString doesn't -  * suffice, we use latin1 but call it TeletexString (since at -  * least netscape expects things that way). */ -  name += ({ ([ attr : (asn1_printable_valid (attrs[attr]) ? -  asn1_printable_string : -  asn1_broken_teletex_string) (attrs[attr]) ]) }); +  name += ({ ([ attr : UTF8String(attrs[attr]) ]) });    }    -  /* Create a plain X.509 v1 certificate, without any extensions */ -  string cert = Tools.X509.make_selfsigned_rsa_certificate +  /* Create a plain X.509 v1 certificate, with default extensions and hash. */ +  string cert = Standards.X509.make_selfsigned_certificate    (rsa, 24 * 3600 * (int) id->variables->ttl, name);       string res=("<font size='+2'>"+LOCALE(133,"This is your Certificate.")+    "</font>"    "<textarea name='certificate' cols='80' rows='12'>");       res += Tools.PEM.simple_build_pem("CERTIFICATE", cert);       res += "</textarea>";   
Roxen.git/server/config_interface/actions/make_selfsigned_rsa.pike:148:    + (strerror(file->errno()) || (string) file->errno())    + ".";    return 1;    }    }    return 0;   }      mixed wizard_done(object id, object mc)   { +  roxen.background_run(0, roxen.scan_certs);    return http_string_answer( sprintf("<p>"+LOCALE(131,"Wrote %d bytes to %s.")+    "</p>\n<p><cf-ok/></p>\n",    strlen(id->variables->certificate),    combine_path(getcwd(), "../local/",    id->variables->cert_file)) );   }         mixed parse( RequestID id ) { return wizard_for(id,0); }         #endif /* constant (Nettle) */