summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2005-08-30 09:19:33 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2005-08-30 09:19:33 +0000
commitaa2b5c79bb551ce28868d751715aed7c6c21d053 (patch)
tree32959d4664d5df16f252e884aee10fe562b16801 /src/util
parent9cec981fa37f4ad2f5234a2a5c296ae6ebebd019 (diff)
downloadexim4-aa2b5c79bb551ce28868d751715aed7c6c21d053.tar.gz
(1) a new wish (2) minor tweaks to dbmbuild and cramtest when setting up
new tests.
Diffstat (limited to 'src/util')
-rwxr-xr-xsrc/util/cramtest.pl22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/util/cramtest.pl b/src/util/cramtest.pl
index 87b3eb451..6135ff05e 100755
--- a/src/util/cramtest.pl
+++ b/src/util/cramtest.pl
@@ -1,10 +1,10 @@
#!/usr/bin/perl
-# $Cambridge: exim/src/util/cramtest.pl,v 1.1 2004/10/07 10:39:03 ph10 Exp $
+# $Cambridge: exim/src/util/cramtest.pl,v 1.2 2005/08/30 09:19:33 ph10 Exp $
-# This script is contributed by Vadim Vygonets to aid in debugging CRAM-MD5
-# authentication.
+# This script is contributed by Vadim Vygonets to aid in debugging CRAM-MD5
+# authentication.
-# A patch was contributed by Jon Warbrick to upgrade it to use the Digest::MD5
+# A patch was contributed by Jon Warbrick to upgrade it to use the Digest::MD5
# module instead of the deprecated MD5 module.
# The script prompts for three data values: a user name, a password, and the
@@ -22,11 +22,11 @@
# Copyright (c) 2002
-# Vadim Vygonets <vadik-exim@vygo.net>. All rights reserved.
+# Vadim Vygonets <vadik-exim@vygo.net>. All rights reserved.
# Public domain is OK with me.
use MIME::Base64;
-use DIGEST::MD5;
+use Digest::MD5;
print "User: ";
chop($user = <>);
@@ -38,15 +38,15 @@ $chal =~ s/^334 //;
$context = new Digest::MD5;
if (length($passwd) > 64) {
- $context->add($passwd);
- $passwd = $context->digest();
- $context->reset();
+ $context->add($passwd);
+ $passwd = $context->digest();
+ $context->reset();
}
@passwd = unpack("C*", pack("a64", $passwd));
for ($i = 0; $i < 64; $i++) {
- $pass_ipad[$i] = $passwd[$i] ^ 0x36;
- $pass_opad[$i] = $passwd[$i] ^ 0x5C;
+ $pass_ipad[$i] = $passwd[$i] ^ 0x36;
+ $pass_opad[$i] = $passwd[$i] ^ 0x5C;
}
$context->add(pack("C64", @pass_ipad), decode_base64($chal));
$digest = $context->digest();