git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix DYNLOOKUP build for lsearch. Bug 3012
[exim.git]
/
src
/
util
/
cramtest.pl
diff --git
a/src/util/cramtest.pl
b/src/util/cramtest.pl
index 87b3eb451699c7841311bf792ea98f82b116ad65..9fc797ba2158b56c9219dac39370071c9dd26d6d 100755
(executable)
--- a/
src/util/cramtest.pl
+++ b/
src/util/cramtest.pl
@@
-1,10
+1,11
@@
#!/usr/bin/perl
#!/usr/bin/perl
-# $Cambridge: exim/src/util/cramtest.pl,v 1.1 2004/10/07 10:39:03 ph10 Exp $
+# Copyright (c) The Exim Maintainers 2022
+# SPDX-License-Identifier: GPL-2.0-or-later
-# 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
# module instead of the deprecated MD5 module.
# The script prompts for three data values: a user name, a password, and the
@@
-22,11
+23,13
@@
# Copyright (c) 2002
# 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.
# Public domain is OK with me.
+BEGIN { pop @INC if $INC[-1] eq '.' };
+
use MIME::Base64;
use MIME::Base64;
-use D
IGEST
::MD5;
+use D
igest
::MD5;
print "User: ";
chop($user = <>);
print "User: ";
chop($user = <>);
@@
-38,15
+41,15
@@
$chal =~ s/^334 //;
$context = new Digest::MD5;
if (length($passwd) > 64) {
$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++) {
}
@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();
}
$context->add(pack("C64", @pass_ipad), decode_base64($chal));
$digest = $context->digest();