|
Revision 1098, 1.0 kB
(checked in by hachi, 2 years ago)
|
|
Branching for boomer from release-19, rev 62318
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | #!/usr/bin/perl -w |
|---|
| 2 | |
|---|
| 3 | use lib 'lib'; |
|---|
| 4 | |
|---|
| 5 | use MT::App::Comments; |
|---|
| 6 | |
|---|
| 7 | use MT; |
|---|
| 8 | |
|---|
| 9 | $mt = new MT; |
|---|
| 10 | |
|---|
| 11 | sub usage { |
|---|
| 12 | print <<HERE; |
|---|
| 13 | Usage: sig-validate [email::name::nick::ts::token] [r::s] |
|---|
| 14 | [] brackets are optional |
|---|
| 15 | r and s are the fields of the signature |
|---|
| 16 | HERE |
|---|
| 17 | exit(1); |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | $ARGV[0] or usage(); |
|---|
| 21 | $ARGV[1] or usage(); |
|---|
| 22 | |
|---|
| 23 | $ARGV[0] =~ s/^[(.*)]$/$1/; |
|---|
| 24 | $ARGV[1] =~ s/^[(.*)]$/$1/; |
|---|
| 25 | |
|---|
| 26 | my ($email, $name, $nick, $ts, $token) = split '::', $ARGV[0]; |
|---|
| 27 | |
|---|
| 28 | my $validation = MT::App::Comments::_validate_signature($mt, |
|---|
| 29 | $ARGV[1], |
|---|
| 30 | email => $email, |
|---|
| 31 | name => $name, |
|---|
| 32 | nick => $nick, |
|---|
| 33 | ts => $ts, |
|---|
| 34 | token => $token); |
|---|
| 35 | print "The signature with timestamp together are: ", |
|---|
| 36 | $validation ? "VALID" : "invalid", "\n"; |
|---|