#! /usr/bin/perl -w
#
#
# -------------------------------------------------------------------
# X-BONE
#
# http://www.isi.edu/xbone
# USC Information Sciences Institute (USC/ISI)
# Marina del Rey, California 90292, USA
# Copyright (c) 1998-2005
#
# -------------------------------------------------------------------
#
# Copyright (c) 1998-2005 by the University of Southern California.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation in source and binary forms for non-commercial
# purposes and without fee is hereby granted, provided that the above
# copyright notice appear in all copies and that both the copyright
# notice and this permission notice appear in supporting
# documentation, and that any documentation, advertising materials,
# and other materials related to such distribution and use acknowledge
# that the software was developed by the University of Southern
# California, Information Sciences Institute. The name of the
# University may not be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THE UNIVERSITY OF SOUTHERN CALIFORNIA MAKES NO REPRESENTATIONS ABOUT
# THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. THIS SOFTWARE IS
# PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# Other copyrights might apply to parts of this software and are so
# noted when applicable.
#
# -------------------------------------------------------------------
#
# Effort partly sponsored by the Defense Advanced Research Projects
# Agency (DARPA) and Air Force Research Laboratory, Air Force Materiel
# Command, USAF, under agreement numbers F30602-98-1-0200 (X-Bone) and
# F30602-01-2-0529 (DynaBone). The views and conclusions contained
# herein are those of the authors and should not be interpreted as
# necessarily representing the official policies or endorsements,
# either expressed or implied, of the Defense Advanced Research
# Projects Agency (DARPA), the Air Force Research Laboratory, or the
# U.S. Government.
#
# This work was partly supported by the NSF STI-XTEND (ANI-0230789)
# and NETFS (ANI-0129689) projects. Any opinions, findings, and
# conclusions or recommendations expressed in this material are those
# of the authors and do not necessarily reflect the views of the
# National Science Foundation.
#
# -------------------------------------------------------------------
# $RCSfile: xb-req-user-cert.pl,v $
#
# $Revision: 1.9 $
# $Author: pingali $
# $Date: 2005/03/31 07:04:04 $
# $State: Exp $
# ----------------------------------------------------------------------------
#
# Primary Author: Lars Eggert
use strict;
use sigtrap;
use lib qw(../lib);
use CGI qw(:standard :html3);
use CGI::Carp qw(fatalsToBrowser);
use File::CounterFile; # module to maintain certificate request counter
use Mail::Sendmail;
use XB_Common;
# init params if they're undefined
foreach my $v ("commonName", "emailAddress", "organizationName",
"organizationalUnitName", "localityName", "stateOrProvinceName",
"countryName", "sessionId", "reqEntry", "SPKAC") {
unless(defined param($v)) { param($v, ""); }
}
# if we have all required parameters, process request, else display form
if(param("commonName") and param("emailAddress")
and param("organizationName") and param("SPKAC")) {
process_req;
print header,
start_html(-title => "Certificate Request Submission Succeeded",
-background => "/xbone/images/background_med_tan.gif",
-style => { -src =>"/xbone/xbone.css" }),
h1({-class => "secheader"}, "Certificate Request Submission Succeeded"),
p("We will now have to verify your user information."),
p("You will be contacted by the X-Bone CA."),
p("As soon as your identity has been confirmed, we will e-mail you " .
"the URL of your signed X-Bone user certificate along with " .
"instructions to install it in your browser."),
p("Back to the ", a({-href => "/xbone"}, "Main X-Bone page") . "."),
end_html;
} else {
# redisplay form
my $title = "X-Bone User Certificate Request";
print header, start_html(-title => $title,
-background => "/xbone/images/background_med_tan.gif",
-style => {-src =>"/xbone/xbone.css"}),
h1({-class => "secheader"} ,$title),
dl(dt(h2(span({-class => "normalheader"}, "Information about the X-Bone".
" X.509 Certificates:"))),
dd("The X-Bone project signs X.509 certificates only for collaborators ",
"of our project. If this is an independent installation at your local",
"site, you will need to either setup your own certification authority",
"(see instructions in the ". a({-href => "http://www.openssl.org"},
"OpenSSL") . " package) or use a commercial service (e.g., Verisign)."
)), p,
p("Enter your information below. You must fill out ",
span({-class => "secheader"}, "all highlighted fields"),
", all others are optional."),
p("Key generation only works with browsers that support the Netscape/Mozilla",
" key generation API. If the \"Key Length\"",
"field below is empty, your current browser does not!"),
p("You may still be able to use X-Bone with this browsers, however:"),
ol(li("Create a key using Netscape/Mozilla."),
li("Export your key from Netscape/Mozilla browser into a file."),
li("Import the exported key file into the browser of your choice.")),
p("For example, Microsoft Internet Explorer (recent versions) can be used ",
"with X-Bone with these steps."),
startform(-action => url(-relative => "1"), -method => "post"),
table(Tr(th( {-class => "secheader"}, "commonName", "Name"),
td(textfield(-name => "commonName", -size => "40",
-maxlength => "64"))),
Tr(th( {-class => "secheader"}, "emailAddress", "E-Mail"),
td(textfield(-name => "emailAddress", -size => "40",
-maxlength => "64"))),
Tr(th( {-class => "secheader"}, "organizationName", "Organization"),
td(textfield(-name => "organizationName", -size => "40",
-maxlength => "64"))),
Tr(th( {-class => "normalheader"}, "Organizational Unit"),
td(textfield(-name => "organizationalUnitName", -size => "40",
-maxlength => "64"))),
Tr(th( {-class => "normalheader"}, "City"),
td(textfield(-name => "localityName", -size => "20",
-maxlength => "32"))),
Tr(th( {-class => "normalheader"}, "State"),
td(textfield(-name => "stateOrProvinceName", -size => "20",
-maxlength => "32"))),
Tr(th( {-class => "normalheader"}, "Country"),
td(textfield(-name => "countryName", -size => "2",
-maxlength => "2"))),
Tr(th( {-class => "normalheader"}, "Key Length"),
td('<keygen name="SPKAC" challenge="challengePassword">'))), br,
submit(-name => "submit", -value => "Submit $title"), " ",
CGI::reset({-class => "black"}, "Undo Changes"), end_form,
p("Back to the ", a({-href => "/xbone"}, "Main X-Bone page") . "."),
end_html;
}
syntax highlighted by Code2HTML, v. 0.9.1