From 2f39adc517068b9639e5b00beb4c21d573270ae7 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 1 May 2018 13:58:38 -0700 Subject: [PATCH] server/sigserver: delete old and unused sigserver We can resurrect later. Or more likely: we'll support perkeepd being configured (#1134) as only a signing server. Change-Id: I19278e107baf02864c085421327392a6ffbb3364 --- server/sigserver/.gitignore | 4 - server/sigserver/camsigd.go | 83 --------------- server/sigserver/client.pl | 50 --------- server/sigserver/run.sh | 4 - server/sigserver/sign.go | 55 ---------- server/sigserver/spec.txt | 44 -------- server/sigserver/test/00-start.t | 20 ---- server/sigserver/test/10-sign.t | 96 ------------------ server/sigserver/test/CamsigdTest.pm | 78 -------------- server/sigserver/test/doc.tmp | 1 - ...f3494f698aa498d5906349c0aa0a183d89a6.camli | 30 ------ server/sigserver/test/sig.tmp | 6 -- server/sigserver/test/test-keyring.gpg | Bin 1196 -> 0 bytes server/sigserver/test/test-keyring2.gpg | Bin 1202 -> 0 bytes server/sigserver/test/test-secring.gpg | Bin 2498 -> 0 bytes server/sigserver/test/test-secring2.gpg | Bin 2504 -> 0 bytes server/sigserver/test/test.json | 5 - server/sigserver/verify.go | 64 ------------ 18 files changed, 540 deletions(-) delete mode 100644 server/sigserver/.gitignore delete mode 100644 server/sigserver/camsigd.go delete mode 100755 server/sigserver/client.pl delete mode 100755 server/sigserver/run.sh delete mode 100644 server/sigserver/sign.go delete mode 100644 server/sigserver/spec.txt delete mode 100644 server/sigserver/test/00-start.t delete mode 100644 server/sigserver/test/10-sign.t delete mode 100644 server/sigserver/test/CamsigdTest.pm delete mode 100644 server/sigserver/test/doc.tmp delete mode 100644 server/sigserver/test/pubkey-blobs/sha1-82e6f3494f698aa498d5906349c0aa0a183d89a6.camli delete mode 100644 server/sigserver/test/sig.tmp delete mode 100644 server/sigserver/test/test-keyring.gpg delete mode 100644 server/sigserver/test/test-keyring2.gpg delete mode 100644 server/sigserver/test/test-secring.gpg delete mode 100644 server/sigserver/test/test-secring2.gpg delete mode 100644 server/sigserver/test/test.json delete mode 100644 server/sigserver/verify.go diff --git a/server/sigserver/.gitignore b/server/sigserver/.gitignore deleted file mode 100644 index 426570e33..000000000 --- a/server/sigserver/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -camsigd -sigserver -*.6 -*.8 diff --git a/server/sigserver/camsigd.go b/server/sigserver/camsigd.go deleted file mode 100644 index dca02176b..000000000 --- a/server/sigserver/camsigd.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2011 The Perkeep Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// The sigserver is a stand-alone JSON signing and verification server. -// -// TODO(bradfitz): as of 2012-01-10 this is very old and superceded by -// the general server and pkg/serverconfig. We should just make it -// possible to configure a signing-only server with -// serverconfig/genconfig.go. I think we basically already can. Then -// we can delete this. -package main // import "perkeep.org/server/sigserver" - -import ( - "flag" - "fmt" - "log" - "net/http" - - "perkeep.org/internal/httputil" - "perkeep.org/pkg/auth" - "perkeep.org/pkg/blob" - "perkeep.org/pkg/webserver" -) - -var accessPassword string - -var flagPubKeyDir = flag.String("pubkey-dir", "test/pubkey-blobs", - "Temporary development hack; directory to dig-xxxx.camli public keys.") - -// TODO: for now, the only implementation of the blobref.Fetcher -// interface for fetching public keys is the "local, from disk" -// implementation used for testing. In reality we'd want to be able -// to fetch these from blobservers. -var pubKeyFetcher = blob.NewSimpleDirectoryFetcher(*flagPubKeyDir) - -func handleRoot(conn http.ResponseWriter, req *http.Request) { - fmt.Fprintf(conn, "camsigd") -} - -func handleCamliSig(conn http.ResponseWriter, req *http.Request) { - handler := func(conn http.ResponseWriter, req *http.Request) { - httputil.BadRequestError(conn, "Unsupported path or method.") - } - - switch req.Method { - case "POST": - switch req.URL.Path { - case "/camli/sig/sign": - handler = auth.RequireAuth(handleSign, auth.OpSign) - case "/camli/sig/verify": - handler = handleVerify - } - } - handler(conn, req) -} - -func main() { - flag.Parse() - - mode, err := auth.FromEnv() - if err != nil { - log.Fatal(err) - } - auth.SetMode(mode) - - ws := webserver.New() - ws.HandleFunc("/", handleRoot) - ws.HandleFunc("/camli/sig/", handleCamliSig) - ws.Serve() -} diff --git a/server/sigserver/client.pl b/server/sigserver/client.pl deleted file mode 100755 index cce21000e..000000000 --- a/server/sigserver/client.pl +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/perl - -use strict; -use LWP::UserAgent; -use HTTP::Request; -use HTTP::Request::Common; -use Getopt::Long; - -my $keyid = "26F5ABDA"; -my $server = "http://localhost:2856"; -GetOptions("keyid=s" => \$keyid, - "server=s" => \$server) - or usage(); - -$server =~ s!/$!!; - -my $file = shift or usage(); --f $file or usage("$file isn't a file"); - -my $json = do { undef $/; open(my $fh, $file); <$fh> }; - -sub usage { - my $err = shift; - if ($err) { - print STDERR "Error: $err\n"; - } - print STDERR "Usage: client.pl [OPTS] \n"; - print STDERR "Options:\n"; - print STDERR " --keyid=\n"; - print STDERR " --server=http://host:port\n"; - exit(1); -} - -my $req = POST("$server/camli/sig/sign", - "Authorization" => "Basic dGVzdDp0ZXN0", # test:test - Content => { - "json" => $json, - "keyid" => $keyid, - }); - -my $ua = LWP::UserAgent->new; -my $res = $ua->request($req); -unless ($res->is_success) { - die "Failure: " . $res->status_line . ": " . $res->content; -} - -print $res->content; - - - diff --git a/server/sigserver/run.sh b/server/sigserver/run.sh deleted file mode 100755 index 27a38b252..000000000 --- a/server/sigserver/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -export CAMLI_PASSWORD=test -make && ./sigserver "$@" diff --git a/server/sigserver/sign.go b/server/sigserver/sign.go deleted file mode 100644 index 6ab13363a..000000000 --- a/server/sigserver/sign.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2011 The Perkeep Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "fmt" - "net/http" - - "perkeep.org/internal/httputil" - "perkeep.org/pkg/jsonsign" -) - -const maxJSONLength = 1024 * 1024 - -func handleSign(conn http.ResponseWriter, req *http.Request) { - if !(req.Method == "POST" && req.URL.Path == "/camli/sig/sign") { - httputil.BadRequestError(conn, "Inconfigured handler.") - return - } - - req.ParseForm() - - jsonStr := req.FormValue("json") - if jsonStr == "" { - httputil.BadRequestError(conn, "Missing json parameter") - return - } - if len(jsonStr) > maxJSONLength { - httputil.BadRequestError(conn, "json parameter too large") - return - } - - sreq := &jsonsign.SignRequest{UnsignedJSON: jsonStr, Fetcher: pubKeyFetcher} - signedJson, err := sreq.Sign() - if err != nil { - // TODO: some aren't really a "bad request" - httputil.BadRequestError(conn, fmt.Sprintf("%v", err)) - return - } - conn.Write([]byte(signedJson)) -} diff --git a/server/sigserver/spec.txt b/server/sigserver/spec.txt deleted file mode 100644 index 3381caa69..000000000 --- a/server/sigserver/spec.txt +++ /dev/null @@ -1,44 +0,0 @@ -Sign: - -(https) POST /camli/sig/sign -WWW-Authenticate: [user] [b64pass] - - json=[json to sign] - keyid=[GnuPG key id / implementation dependent] - -On good response: - HTTP 200 OK - (signed blob) - -else: (if signing fails) - HTTP 4xx/5xx - - -TODO(bslatkin): Should the sign response be a more specific value, so -we can tell the difference between a temporary server error and a signing -failure? For verification purposes we need that characteristic anyways. - ---- - -Verify: - -(https) POST /camli/sig/verify - - sjson=[signed json to verify] - (proposed) keyarmored=[GnuPG armored key] - -On good response: - HTTP 200 OK - - YES - -else: (if verification fails) - HTTP 200 OK - - - - -Verify will look in the object to find the "camliSigner" key and use that -blobref's contents (assumed to be a public key) to verify the signature on -the object. Configuring the signing server to have the public key blobref -is out of scope. diff --git a/server/sigserver/test/00-start.t b/server/sigserver/test/00-start.t deleted file mode 100644 index e1c41d2c0..000000000 --- a/server/sigserver/test/00-start.t +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/perl - -use strict; -use Test::More; -use FindBin; -use lib "$FindBin::Bin"; -use CamsigdTest; - -my $server = CamsigdTest::start(); - -ok($server, "Started the server") or BAIL_OUT("can't start the server"); - -my $ua = LWP::UserAgent->new; -my $req = HTTP::Request->new("GET", $server->root . "/"); -my $res = $ua->request($req); -ok($res, "got an HTTP response") or done_testing(); -ok($res->is_success, "HTTP response is successful"); - -done_testing(3); - diff --git a/server/sigserver/test/10-sign.t b/server/sigserver/test/10-sign.t deleted file mode 100644 index bc430c58b..000000000 --- a/server/sigserver/test/10-sign.t +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/perl - -use strict; -use Test::More; -use FindBin; -use lib "$FindBin::Bin"; -use CamsigdTest; -use JSON::Any; -use HTTP::Request::Common; - -my $server = CamsigdTest::start(); -ok($server, "Started the server") or BAIL_OUT("can't start the server"); - -my $ua = LWP::UserAgent->new; - -use constant CAMLI_SIGNER => "sha1-82e6f3494f698aa498d5906349c0aa0a183d89a6"; - -my $j = JSON::Any->new; -my $json = $j->objToJson({ "camliVersion" => 1, - "camliSigner" => CAMLI_SIGNER, - "foo" => "bar", - }); - -# Sign it. -my $sjson; -{ - my $req = req("sign", { "json" => $json }); - my $res = $ua->request($req); - ok($res, "got an HTTP sig response") or done_testing(); - ok($res->is_success, "HTTP sig response is successful") or done_testing(); - $sjson = $res->content; - print "Got signed: $sjson"; - like($sjson, qr/camliSig/, "contains camliSig substring"); - - my $sobj = $j->jsonToObj($sjson); - is($sobj->{"foo"}, "bar", "key foo is still bar"); - is($sobj->{"camliVersion"}, 1, "key camliVersion is still 1"); - ok(defined $sobj->{"camliSig"}, "has camliSig key"); - ok(defined $sobj->{"camliSigner"}, "has camliSigner key"); - is(scalar keys %$sobj, 4, "total of 3 keys in signed object"); -} - -# Verify it. -{ - my $req = req("verify", { "sjson" => $sjson }); - my $res = $ua->request($req); - ok($res, "got an HTTP verify response") or done_testing(); - ok($res->is_success, "HTTP verify response is successful") or done_testing(); - print "Verify response: " . $res->content; - my $vobj = $j->jsonToObj($res->content); - ok(defined($vobj->{'signatureValid'}), "has 'signatureValid' key"); - ok($vobj->{'signatureValid'}, "signature is valid"); - my $vdat = $vobj->{'verifiedData'}; - ok(defined($vdat), "has verified data"); - is($vdat->{'camliSigner'}, CAMLI_SIGNER, "signer matches"); - is($vdat->{'foo'}, "bar") -} - -# Verification that should fail. -{ - my $req = req("verify", { "sjson" => "{}" }); - my $res = $ua->request($req); - ok($res, "got an HTTP verify response") or done_testing(); - ok($res->is_success, "HTTP verify response is successful") or done_testing(); - print "Verify response: " . $res->content; - my $vobj = $j->jsonToObj($res->content); - ok(defined($vobj->{'signatureValid'}), "has 'signatureValid' key"); - is(0, $vobj->{'signatureValid'}, "signature is properly invalid"); - ok(!defined($vobj->{'verifiedData'}), "no verified data key"); - ok(defined($vobj->{'errorMessage'}), "has an error message"); -} - -# Imposter! Verification should fail. -{ - my $eviljson = q{{"camliVersion":1,"camliSigner":"sha1-82e6f3494f698aa498d5906349c0aa0a183d89a6","foo":"evilbar","camliSig":"iQEcBAABAgAGBQJM+tnUAAoJEIUeCLJL7Fq1ruwH/RplOpmrTK51etXUHayRGN0RM0Jxttjwa0pPuiHr7fJifaZo2pvMZOMAttjFEP/HMjvpSVi8P7awBFXXlCTj0CAlexsmCsPEHzITXe3siFzH+XCSmfHNPYYti0apQ2+OcWNnzqWXLiEfP5yRVXxcxoWuxYlnFu+mfw5VdjrJpIa+n3Ys5D4zUPVCSNtF4XV537czqfd9AiSfKCY/aL2NuZykl4WtP3JgYl8btE84EjNLFasQDstcWOvp7rrP6T8hQQotw5/F4SmmFM6ybkWXk/Wkax3XpzW9qL00VqhxHd4JIWaSzSV/WcSQwCoLWc7uXttOWgVtMIhzpjeMlqt1gc0==QYU2"}}; - my $req = req("verify", { "sjson" => $eviljson }); - my $res = $ua->request($req); - ok($res, "got an HTTP verify response") or done_testing(); - ok($res->is_success, "HTTP verify response is successful") or done_testing(); - print "Verify response: " . $res->content; - my $vobj = $j->jsonToObj($res->content); - ok(defined($vobj->{'signatureValid'}), "has 'signatureValid' key"); - is(0, $vobj->{'signatureValid'}, "signature is properly invalid"); - ok(!defined($vobj->{'verifiedData'}), "no verified data key"); - ok(defined($vobj->{'errorMessage'}), "has an error message"); - like($vobj->{'errorMessage'}, qr/bad signature: RSA verification error/, "verification error"); -} - -done_testing(29); - -sub req { - my ($method, $post_params) = @_; - return POST($server->root . "/camli/sig/" . $method, - "Authorization" => "Basic dGVzdDp0ZXN0", # test:test - Content => $post_params); -} diff --git a/server/sigserver/test/CamsigdTest.pm b/server/sigserver/test/CamsigdTest.pm deleted file mode 100644 index b238898d4..000000000 --- a/server/sigserver/test/CamsigdTest.pm +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/perl -# -# Common test library for camsigd (sigserver) - -package CamsigdTest; - -use strict; -use Test::More; -use FindBin; -use LWP::UserAgent; -use HTTP::Request; -use Fcntl; - -our $BINARY = "$FindBin::Bin/../sigserver"; - -sub start { - my ($port_rd, $port_wr, $exit_rd, $exit_wr); - my $flags; - pipe $port_rd, $port_wr; - pipe $exit_rd, $exit_wr; - - $flags = fcntl($port_wr, F_GETFD, 0); - fcntl($port_wr, F_SETFD, $flags & ~FD_CLOEXEC); - $flags = fcntl($exit_rd, F_GETFD, 0); - fcntl($exit_rd, F_SETFD, $flags & ~FD_CLOEXEC); - - $ENV{TESTING_PORT_WRITE_FD} = fileno($port_wr); - $ENV{TESTING_CONTROL_READ_FD} = fileno($exit_rd); - $ENV{CAMLI_PASSWORD} = "test"; - - die "Binary $BINARY doesn't exist\n" unless -x $BINARY; - - my $pid = fork; - die "Failed to fork" unless defined($pid); - if ($pid == 0) { - # child - exec $BINARY, "-listen=:0"; - die "failed to exec: $!\n"; - } - close($exit_rd); # child owns this side - close($port_wr); # child owns this side - - print "Waiting for server to start...\n"; - my $line = <$port_rd>; - close($port_rd); - - # Parse the port line out - chomp $line; - # print "Got port line: $line\n"; - die "Failed to start, no port info." unless $line =~ /:(\d+)$/; - my $port = $1; - - return CamsigdTest::Server->new($pid, $port, $exit_wr); -} - -package CamsigdTest::Server; - -sub new { - my ($class, $pid, $port, $pipe_writer) = @_; - return bless { - pid => $pid, - port => $port, - pipe_writer => $pipe_writer, - }; -} - -sub DESTROY { - my $self = shift; - my $pipe = $self->{pipe_writer}; - syswrite($pipe, "EXIT\n", 5); -} - -sub root { - my $self = shift; - return "http://localhost:$self->{port}"; -} - -1; diff --git a/server/sigserver/test/doc.tmp b/server/sigserver/test/doc.tmp deleted file mode 100644 index 2dcc98c1b..000000000 --- a/server/sigserver/test/doc.tmp +++ /dev/null @@ -1 +0,0 @@ -{"camliVersion":1,"foo":"bar" \ No newline at end of file diff --git a/server/sigserver/test/pubkey-blobs/sha1-82e6f3494f698aa498d5906349c0aa0a183d89a6.camli b/server/sigserver/test/pubkey-blobs/sha1-82e6f3494f698aa498d5906349c0aa0a183d89a6.camli deleted file mode 100644 index bb94ce585..000000000 --- a/server/sigserver/test/pubkey-blobs/sha1-82e6f3494f698aa498d5906349c0aa0a183d89a6.camli +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.10 (GNU/Linux) - -mQENBEzgoVsBCAC/56aEJ9BNIGV9FVP+WzenTAkg12k86YqlwJVAB/VwdMlyXxvi -bCT1RVRfnYxscs14LLfcMWF3zMucw16mLlJCBSLvbZ0jn4h+/8vK5WuAdjw2YzLs -WtBcjWn3lV6tb4RJz5gtD/o1w8VWxwAnAVIWZntKAWmkcChCRgdUeWso76+plxE5 -aRYBJqdT1mctGqNEISd/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wFH0g4RJVHXQ -BUDbg7OZbWumzD4Br28si6XDVMP6fLOeyD0EHYb6LhAHDkBLqx6e3kKG1mQ8fMIV -O4YMQfskYH2FJqlCtgMnM8N3oslPBTpZedNPSUq7HJh2pKr9GIDi1V+Hgc/qEigE -dj9f2zSSaKZdC4eL73GvlQOh+4XqgaMnMiKfI+/2WlRaJs1KOgKmIp5yHt0qY0ef -y+40BY/z9pMjyUvr/Wwp8KXArw0NAwzp8NUl5fNxRg9XWQWLn6hW8ydR20X3t2ym -iNSWzNQiTT6k7fumOABCoSZsow/AJxQSxqKOJBjgpKjIKCgY -=ru0J ------END PGP PUBLIC KEY BLOCK----- diff --git a/server/sigserver/test/sig.tmp b/server/sigserver/test/sig.tmp deleted file mode 100644 index 95538f6bc..000000000 --- a/server/sigserver/test/sig.tmp +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.10 (GNU/Linux) - -iQEcBAABAgAGBQJM9KDoAAoJECkxpnwm9avabeYH/2+Rm1FjSDKIxUlF+RCvaKWYflJuCtazJTWezud3CL+q2DSWEl8o7z6TUDB15w8nzRlLDEXqqGYPec76eyoyh4R98A2oxmms1nJY1HFXWN4LFUcinOBnM175f5qyiFr0c64sSMaBt21Qkt6Ncecg7NpTyl31Uz3JmlG7SZRm5yL08shbNR0AvTSnwUAwyWiy+v9qwvK3VoAxA2CXgJDTudEjf8MoMna0MmF43hWSdqGkqVao5rJtpru+iMHXkaqrgX24go1PRwVOyz6mJdgkqnYMqGinYAw+w05s09wfpQ/xLEuCCYfehtLGcSPEPkfFD701hgo/9OR1w+hdrrFKSNo= -=Nzxs ------END PGP SIGNATURE----- diff --git a/server/sigserver/test/test-keyring.gpg b/server/sigserver/test/test-keyring.gpg deleted file mode 100644 index 3d20ba6837e26057e38b773a00e79af92f52acb6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1196 zcmV;d1XKH&0SyF9;GtUq2mrt5ri3TZO(11`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M|?fa%U079WAY@-jrClnIKqK+gO;H0R? KC@2`P0ssRNTnzyL diff --git a/server/sigserver/test/test-keyring2.gpg b/server/sigserver/test/test-keyring2.gpg deleted file mode 100644 index ded7d5151dfbfb7a3c78487e9b4a5173fac49fed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1202 zcmV;j1Wo&y0SyF9`qozg2msMS7aR1l5OrP4g-&1Xz@s_KW-h}1%ZWHtsk5HT7C9J= zJVDUcaIqA)(G1;=L51Sr)T*IMhcwF(O+r&uZ33S;)KR^4iM7j7g}=?S&Gpr+@cBql zl#+2RUB=OhDo>Stdhc^m!Rnf;jcI^@Oc2JvR!)VsAXI;N$~7(}RP%Rpq@^{V{G0Hc zy}~TqhRR*{7o00)^d@qPM1o|Lw7@A3mni?7O9kdi7cBdFal4oJrYeQ*fM18%=oAev zbY=|%Wn71F-zNcFPGaPcVOc5Io`q@Ly;c*}JXDaI+|aH#q7cWjX$IL=X5O+w!Yzg& zU_WwF;tU8_Gpo}hdKmx_0RRECD??#zY-u1=Wpi|Ob7gWMRCjM6JY!*PY-uiZWpi{u zWq4t2aBO8RV{dIfi2*nS69EDMA_W3W`qozh8v_Ol2?z%R0tOWb0tpHW1Qr4V0RkQY z0vCV)3JDN}9tg5a>{_*RjtBswiH|9$ign%e)0XUK=^QDtpERG8l4wQ5bFkd}-cnn@ zgxCq)M8ynbJI*XHq)#R%pL5r#Kk?x4UK`acBpNS(@n)zW^O>|mJRA<<5UG{>2;XE* zq_^y}wzlzh?lxPPOV9hBuCrwu>iyDSO^#w$v7BbXrbHI9?G{>|%q-nOE34m>3uM7> zTc)UBRKS4gHLg!(2H64)go#Dz;hd z7jz2b0SB^#V3r74Hxf14Ap^B9F?)^Kv56jT--3W2E`*r8pdj78q#FbKN2H5DI@jrZLXI0YwWmvvF_S zwes!(!{^F@&X(MSJ(0>3C0RRDs0Urby0RjLC1p-X^)>i@>3;+rV z5QQEHvP+oIwgYi}0fSga0NhDa zjGCmpgz|BN_Tm>2Xc$-~*M(`)cXe)4hjL?Aa6IH)JN5{t6mAA7yftQgCj@`19!dYd zL^kq|^>cZ#I?DC#!o%*fx$SJsJ`U-)+dg?+h?ueQ1-ouhw;JNKZQf!@LMthqMh>;+ znEcL!X)l&_Gz_^w7WuONVLi7-ODc;i4w@~>wjoaBdj5i7m2zJ)bza*Tzxq3eGK!g= zR&xuFbJi+{swXDhQ47fP&%|<%B~3lQ0BNO_TU(hf4uqSnS}JzV8(jh4Nw*0P9l#jH Q_82C$#xxPx# diff --git a/server/sigserver/test/test-secring.gpg b/server/sigserver/test/test-secring.gpg deleted file mode 100644 index bca3ad0392b59249597bc1ec8a93a5d9f6141758..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2498 zcmV;z2|f0e1DFI%;GtUq2mrt5ri3TZO(11`6;u9OH>XSqAlGR;>58Sml|TpeaCFIX zUmN0VB=tp9U!9C>a?N-wx7;ydcg)M2!(OH?QbGkH?`@qUpNM|{%gW_zfOb4KV>0Yo z&|Hma_my6)Z-hzDm@N76B%w zQ`ToK8lyxZCx2Ok%!3KmT?-Y9e0a}SSi5UO_T#m7Kp%fyv(`+RK!8xK>`Gx2QHRnB z0jz`KND|WrWl*@mQ{NhRMvTu_B)A?r4SnSSil&({3;h{=aN;x)dT0KFj(vez<{bbQ zcUgB<HCtsTo?UIY?o8P)-l;skFtF!kjTIu zn*|i?O6N>5MhWts?3DK0aq;yP4xx(}bknMyLN}9E{y6VrE$S>x$U`(IlR`Q!Zh_8d zdqWb*g1x_~!v*!hqfApW)dK_o$D|i;6pxSHPaTCh_1>e$&42Ft;x3fGz^UJ+)FqgF zVvaE3{-+kg3V5Wc?oHE9$jFWXJ_5>)1Vb61)g&E<3>I z!Yrv66{d;_vH*Oy?|DyzC*@D%tzN0!w*1QQDM;7wI%Z5=O+6&}i&}$A1OWCFdJG6# z$j+G^Lm|%&+PNI~Ps@w$?M+ICg2DI12q+rJ1yWNqZBO(@?1wN;%E%(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&nlX<) z4m8XS>`|82cy6ROTzDRr8u3mt2aTGhS%}MaIbUM7AF=?9(X=b!Ykd8>ChL0#0AH^I z|7Pkc^0R^%;X`5*?ONdj;Q`1Cs72zRr**w)b95Y{}}by{B#sDD0b1#{~H}F zp9BAc$87!>4ho|wioapc!ld;DPe#PZze+TT0Urby0RjLC1p-Xqp<4nQ3;+rV5GgUH zd?xj)+F`&50Hkt{p8@nr`U$D5U8e9&0jF2%z)|#rgh^C&&;>x-gR_}!Yo^RT0k3Z? zi>1R}fWITMr6+4CuLHi_NeT62eLbd}ZGsAbH z$xj73S$We>NlLpMn0BP9{TP7a)nA8!&*~B=1a?1P+cc7Brd?#sh3bK$ zCo&?RBk%TFR9Ys@N;(3jBA#*{-6~^8pUdtv1&{OglOxGX>-}sg@TI`74GjYf>G0Jh z<@0ey4_8?Qi=U`g^CwZ;MfbOCrij#*%+w-HKBVpYrZ@mXp(bpj55OlB62_vABpBeN MsK_WN7_b5W05^l1$p8QV diff --git a/server/sigserver/test/test-secring2.gpg b/server/sigserver/test/test-secring2.gpg deleted file mode 100644 index f4b7ed22286696c1f8ee02530e882fc2252bbdaf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2504 zcmV;(2{-nY1DFI%`qozg2msMS7aR1l5OrP4g-&1Xz@s_KW-h}1%ZWHtsk5HT7C9J= zJVDUcaIqA)(G1;=L51Sr)T*IMhcwF(O+r&uZ33S;)KR^4iM7j7g}=?S&Gpr+@cBql zl#+2RUB=OhDo>Stdhc^m!Rnf;jcI^@Oc2JvR!)VsAXI;N$~7(}RP%Rpq@^{V{G0Hc zy}~TqhRR*{7o00)^d@qPM1o|Lw7@A3mni?7O9kdi7cBdFal4oJrYeQ*fM18%=oAev zbY=|%Wn71F-zNcFPGaPcVOc5Io`q@Ly;c*}JXDaI+|aH#q7cWjX$IL=X5O+w!Yzg& zU_WwF;tU8_Gpo}hdKmx_0RRC22mA^fe4Rs(^gWLSy$>Id4$X6gu?|ux*K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ozdC+-$`Qjfxa~o!2|%$HhOUGyhlRpPm+nq$gh3)HQxaQ>F{> z6%PHauK-W`y+On{6+!~-yyf?zL?XB1OOABoy$5q98CPtH6<{)2)lv6d)l9T;Tkd#} z*F!6Sk4PL8?*UuO{1Nb8#s$*GQ^~`AhflnX5LgKW0P(14x;s6^9pgG6g^$U{k~;dx z$mB2od>z!#bc?+q06$(ucd7Z5%%o@2=YPnNbiQq<-xd>qz+3Z7)`|hp_0y;^a~$2@ zUE!uH7;7(O)kBT#ji#m~Hzd_&I0AVUw)!N0R6$nCKY?_Jz*vsMp`thu_c*=F4u~3$ zZcJacM+5-vAF5Y}?t?+xL4$;M2Sh*Lr4{GT41!-Xe1RZ?-9K}Ew81D-&{ zBuf+Sv}{vd3mza+A;g3zA)D1?(C8o0TT>GQVs5TD2#En71Q-DV00{*GO#0SW0vikf z3JDN}9tg5a>{_)$$Or#bJm-kSepGPQE@eN9TWei$W6g&oKD(6y^f0yqaeV=USVsWd zNmGoPq`ZXkaf9~a7ZGR}SSHtnY0`IfZc~SHV^?rIA2fId0mK@vGE1FZc(=y; S7{&G&Cbh;iA)nZ=0ssKko~)Aq diff --git a/server/sigserver/test/test.json b/server/sigserver/test/test.json deleted file mode 100644 index c9a369570..000000000 --- a/server/sigserver/test/test.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "foo": "bar", - "blah": "baz" } - - diff --git a/server/sigserver/verify.go b/server/sigserver/verify.go deleted file mode 100644 index 99f89017d..000000000 --- a/server/sigserver/verify.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2011 The Perkeep Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -/* - - $ gpg --no-default-keyring --keyring=/tmp/foo --import --armor test/pubkey-blobs/sha1-82e6f3494f69 - - $ gpg --no-default-keyring --keyring=/tmp/foo --verify sig.tmp doc.tmp ; echo $? - gpg: Signature made Mon 29 Nov 2010 10:59:52 PM PST using RSA key ID 26F5ABDA - gpg: Good signature from "Camli Tester " - gpg: WARNING: This key is not certified with a trusted signature! - gpg: There is no indication that the signature belongs to the owner. - Primary key fingerprint: FBB8 9AA3 20A2 806F E497 C049 2931 A67C 26F5 ABDA0 - -*/ - -import ( - "net/http" - "perkeep.org/internal/httputil" - "perkeep.org/pkg/jsonsign" -) - -func handleVerify(conn http.ResponseWriter, req *http.Request) { - if !(req.Method == "POST" && req.URL.Path == "/camli/sig/verify") { - httputil.BadRequestError(conn, "Inconfigured handler.") - return - } - - req.ParseForm() - sjson := req.FormValue("sjson") - if sjson == "" { - httputil.BadRequestError(conn, "Missing sjson parameter.") - return - } - - m := make(map[string]interface{}) - - vreq := jsonsign.NewVerificationRequest(sjson, pubKeyFetcher) - if vreq.Verify() { - m["signatureValid"] = 1 - m["verifiedData"] = vreq.PayloadMap - } else { - m["signatureValid"] = 0 - m["errorMessage"] = vreq.Err.Error() - } - - conn.WriteHeader(http.StatusOK) // no HTTP response code fun, error info in JSON - httputil.ReturnJSON(conn, m) -}