From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- security/nss/cmd/signver/examples/1/form.pl | 22 ++++++++ .../nss/cmd/signver/examples/1/signedForm.html | 55 ++++++++++++++++++++ .../nss/cmd/signver/examples/1/signedForm.nt.html | 55 ++++++++++++++++++++ security/nss/cmd/signver/examples/1/signedForm.pl | 60 ++++++++++++++++++++++ 4 files changed, 192 insertions(+) create mode 100755 security/nss/cmd/signver/examples/1/form.pl create mode 100644 security/nss/cmd/signver/examples/1/signedForm.html create mode 100644 security/nss/cmd/signver/examples/1/signedForm.nt.html create mode 100755 security/nss/cmd/signver/examples/1/signedForm.pl (limited to 'security/nss/cmd/signver/examples') diff --git a/security/nss/cmd/signver/examples/1/form.pl b/security/nss/cmd/signver/examples/1/form.pl new file mode 100755 index 0000000000..f2cfddc691 --- /dev/null +++ b/security/nss/cmd/signver/examples/1/form.pl @@ -0,0 +1,22 @@ +#! /usr/bin/perl +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +print "Content-type: text/html\n\n"; +print "Server Name: ", $ENV{'SERVER_NAME'}, "
", "\n"; +print "Server Port: ", $ENV{'SERVER_PORT'}, "
", "\n"; +print "Server Software: ", $ENV{'SERVER_SOFTWARE'}, "
", "\n"; +print "Server Protocol: ", $ENV{'SERVER_PROTOCOL'}, "
", "\n"; +print "CGI Revision: ", $ENV{'GATEWAY_INTERFACE'}, "
", "\n"; +print "Browser: ", $ENV{'HTTP_USER_AGENT'}, "
", "\n"; +print "Remote Address: ", $ENV{'REMOTE_ADDR'}, "
", "\n"; +print "Remote Host: ", $ENV{'REMOTE_HOST'}, "
", "\n"; +print "Remote User: ", $ENV{'REMOTE_USER'}, "
", "\n"; +print "You typed:\n"; + +while( $_ = ) { + print "$_"; +} + diff --git a/security/nss/cmd/signver/examples/1/signedForm.html b/security/nss/cmd/signver/examples/1/signedForm.html new file mode 100644 index 0000000000..ac48e3f1e6 --- /dev/null +++ b/security/nss/cmd/signver/examples/1/signedForm.html @@ -0,0 +1,55 @@ + + + +Form to sign + + + + +
+ + + +
+ +
+ +
+ + + +
+ + diff --git a/security/nss/cmd/signver/examples/1/signedForm.nt.html b/security/nss/cmd/signver/examples/1/signedForm.nt.html new file mode 100644 index 0000000000..1a126d2ff9 --- /dev/null +++ b/security/nss/cmd/signver/examples/1/signedForm.nt.html @@ -0,0 +1,55 @@ + + + +Form to sign + + + + +
+ + + +
+ +
+ +
+ + + +
+ + diff --git a/security/nss/cmd/signver/examples/1/signedForm.pl b/security/nss/cmd/signver/examples/1/signedForm.pl new file mode 100755 index 0000000000..847814c90a --- /dev/null +++ b/security/nss/cmd/signver/examples/1/signedForm.pl @@ -0,0 +1,60 @@ +#! /usr/bin/perl +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + + +sub decode { + read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); + @pairs = split(/&/, $buffer); + foreach $pair (@pairs) + { + ($name, $value) = split(/=/, $pair); + $value =~tr/+/ /; + $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + $FORM{$name} = $value; +# print "name=$name value=$value
\n"; + } +} + +print "Content-type: text/html\n\n"; + +&decode(); + +$dataSignature = $FORM{'dataSignature'}; +$dataToSign = $FORM{'dataToSign'}; + +unlink("signature"); +open(FILE1,">signature") || die("Cannot open file for writing\n"); + +print FILE1 "$dataSignature"; + +close(FILE1); + + +unlink("data"); +open(FILE2,">data") || die("Cannot open file for writing\n"); + +print FILE2 "$dataToSign"; + +close(FILE2); + + +print "
Signed Data:
", "$dataToSign", "
"; + +print "
Verification Info:
"; + +$verInfo = `./signver -D . -s signature -d data -v`; +print "$verInfo
"; + +print "
Signature Data:
", "$dataSignature", "
"; + +print "
Signature Info:
"; + +foreach $line (`./signver -s signature -A`) { + print "$line
\n"; +} + +print "End of Info
"; + -- cgit v1.2.3