From 2aa4a82499d4becd2284cdb482213d541b8804dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:29:10 +0200 Subject: Adding upstream version 86.0.1. 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/1') 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