projects
/
mirror
/
userdir-ldap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d038752
)
Removed (hard-)dependency of Util.pm on Cryptix modules
author
tausq
<>
Mon, 29 Nov 1999 01:44:53 +0000
(
01:44
+0000)
committer
tausq
<>
Mon, 29 Nov 1999 01:44:53 +0000
(
01:44
+0000)
ud-fingerserv
patch
|
blob
|
history
web/Util.pm
patch
|
blob
|
history
diff --git
a/ud-fingerserv
b/ud-fingerserv
index
133781a
..
7f33835
100755
(executable)
--- a/
ud-fingerserv
+++ b/
ud-fingerserv
@@
-1,12
+1,11
@@
#!/usr/bin/perl
#!/usr/bin/perl
-# $Id: ud-fingerserv,v 1.1
2 1999/10/20 06:01:58 jgg
Exp $
+# $Id: ud-fingerserv,v 1.1
3 1999/11/29 02:44:53 tausq
Exp $
# (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
use lib '/var/www/userdir-ldap/';
#use lib '/home/randolph/projects/userdir-ldap/web';
use strict vars;
# (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
use lib '/var/www/userdir-ldap/';
#use lib '/home/randolph/projects/userdir-ldap/web';
use strict vars;
-#use Apache::Registry;
use IO::Handle;
use IO::Socket;
use POSIX qw(:sys_wait_h);
use IO::Handle;
use IO::Socket;
use POSIX qw(:sys_wait_h);
@@
-28,10
+27,11
@@
my %attrs = (
'email' => 'Email',
'keyfingerprint' => 'Fingerprint',
'key' => 'Key block',
'email' => 'Email',
'keyfingerprint' => 'Fingerprint',
'key' => 'Key block',
- 'ircnick' => 'IRC nickname'
+ 'ircnick' => 'IRC nickname',
+ 'labeledurl' => 'URL'
);
);
-my @summarykeys = ('cn', 'mn', 'sn', 'email', 'ircnick', 'keyfingerprint', 'key');
+my @summarykeys = ('cn', 'mn', 'sn', 'email', '
labeledurl', '
ircnick', 'keyfingerprint', 'key');
$SIG{__DIE__} = \&DieHandler;
$SIG{INT} = \&DieHandler;
$SIG{__DIE__} = \&DieHandler;
$SIG{INT} = \&DieHandler;
diff --git
a/web/Util.pm
b/web/Util.pm
index
89ef3fb
..
9ee563f
100644
(file)
--- a/
web/Util.pm
+++ b/
web/Util.pm
@@
-2,14
+2,20
@@
package Util;
use strict;
package Util;
use strict;
-use Crypt::Blowfish;
my $blocksize = 8; # A blowfish block is 8 bytes
my $configfile = "/etc/userdir-ldap/userdir-ldap.conf";
my $blocksize = 8; # A blowfish block is 8 bytes
my $configfile = "/etc/userdir-ldap/userdir-ldap.conf";
-#my $configfile = "
.
/userdir-ldap.conf";
+#my $configfile = "
/home/randolph/projects/userdir-ldap
/userdir-ldap.conf";
my %config = &ReadConfigFile;
my %config = &ReadConfigFile;
+my $hascryptix = 1;
+eval 'use Crypt::Blowfish';
+if ($@) {
+ $hascryptix = undef;
+ print "No cryptix\n";
+}
+
sub CreateKey {
my $keysize = shift;
my $input;
sub CreateKey {
my $keysize = shift;
my $input;
@@
-47,8
+53,8
@@
sub Encrypt {
$input .= " " x ($blocksize - (length($input) % $blocksize)) if (length($input % $blocksize));
$input .= " " x ($blocksize - (length($input) % $blocksize)) if (length($input % $blocksize));
- for ($pos = 0; $pos < length($input); $pos += $blocksize) {
- $output .= unpack("H16", $cipher->encrypt(substr($input, $pos, $blocksize)));
+ for ($pos = 0; $pos < length($input); $pos += $blocksize) {
+ $output .= unpack("H16", $cipher->encrypt(substr($input, $pos, $blocksize)))
if ($hascryptix)
;
}
return $output;
}
}
return $output;
}
@@
-64,7
+70,7
@@
sub Decrypt {
for ($pos = 0; $pos < length($input); $pos += $blocksize*2) {
$portion = pack("H16", substr($input, $pos, $blocksize*2));
for ($pos = 0; $pos < length($input); $pos += $blocksize*2) {
$portion = pack("H16", substr($input, $pos, $blocksize*2));
- $output .= $cipher->decrypt($portion);
+ $output .= $cipher->decrypt($portion)
if ($hascryptix)
;
}
$output =~ s/ +$//;
}
$output =~ s/ +$//;
@@
-258,7
+264,7
@@
sub ReadConfigFile {
# Chop off any trailing comments
s/#.*//;
($attr, $setting) = split(/=/, $_, 2);
# Chop off any trailing comments
s/#.*//;
($attr, $setting) = split(/=/, $_, 2);
- $setting =~ s/"//g;
+ $setting =~ s/"//g;
#"
$setting =~ s/;$//;
$attr =~ s/^ +//; $attr =~ s/ +$//;
$setting =~ s/^ +//; $setting =~ s/ +$//;
$setting =~ s/;$//;
$attr =~ s/^ +//; $attr =~ s/ +$//;
$setting =~ s/^ +//; $setting =~ s/ +$//;