X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=contrib%2Fdecrypt_headers.php;h=2fec8df750be760566416fba12271da8c9f77e5b;hp=9b27fd0d0614e80f24ab9672aaa5580ff432f892;hb=ad2d75f676d6567af5439e27ee338b54eb5d028d;hpb=372bcbb816818b4c0ad99c263793235a4ce7626e diff --git a/contrib/decrypt_headers.php b/contrib/decrypt_headers.php index 9b27fd0d..2fec8df7 100644 --- a/contrib/decrypt_headers.php +++ b/contrib/decrypt_headers.php @@ -3,7 +3,7 @@ /** * Script provides form to decode encrypted header information. * - * @copyright © 2005-2006 The SquirrelMail Project Team + * @copyright 2005-2010 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -60,23 +60,30 @@ echo '"; if (sqgetGlobalVar('submit',$submit,SQ_POST)) { + $continue = TRUE; if (! sqgetGlobalVar('secret',$secret,SQ_POST) || - empty($secret)) - echo "

You must enter encryption key.

\n"; + empty($secret)) { + $continue = FALSE; + echo "

You must enter an encryption key.

\n"; + } if (! sqgetGlobalVar('enc_string',$enc_string,SQ_POST) || - empty($enc_string)) - echo "

You must enter encrypted string.

\n"; + empty($enc_string)) { + $continue = FALSE; + echo "

You must enter an encrypted string.

\n"; + } - if (isset($enc_string) && ! base64_decode($enc_string)) { - echo "

Encrypted string should be BASE64 encoded.
\n" - ."Please enter all characters that are listed after header name.

\n"; - } elseif (isset($secret)) { - $string=OneTimePadDecrypt($enc_string,base64_encode($secret)); + if ($continue) { + if (isset($enc_string) && ! base64_decode($enc_string)) { + echo "

Encrypted string should be BASE64 encoded.
\n" + ."Please enter all characters that are listed after header name.

\n"; + } elseif (isset($secret)) { + $string=OneTimePadDecrypt($enc_string,base64_encode($secret)); - if (sqgetGlobalVar('ip_addr',$is_addr,SQ_POST)) { - $string=hex2ip($string); + if (sqgetGlobalVar('ip_addr',$is_addr,SQ_POST)) { + $string=hex2ip($string); + } + echo "

Decoded string: ".htmlspecialchars($string)."

\n"; } - echo "

Decoded string: ".$string."

\n"; } echo "
"; } @@ -85,7 +92,7 @@ if (sqgetGlobalVar('submit',$submit,SQ_POST)) {

Secret key:
Encrypted string:
-Check, if it is an address string:
+