File: cram_md5.t

package info (click to toggle)
libauthen-sasl-perl 2.12-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 324 kB
  • ctags: 320
  • sloc: perl: 4,029; makefile: 42
file content (32 lines) | stat: -rw-r--r-- 669 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!perl

BEGIN {
  eval { require Digest::HMAC_MD5 }
}

use Test::More ($Digest::HMAC_MD5::VERSION ? (tests => 5) : (skip_all => 'Need Digest::HMAC_MD5'));

use Authen::SASL qw(Perl);

my $sasl = Authen::SASL->new(
  mechanism => 'CRAM-MD5',
  callback => {
    user => 'gbarr',
    pass => 'fred',
    authname => 'none'
  },
);
ok($sasl, 'new');

is($sasl->mechanism, 'CRAM-MD5', 'sasl mechanism');

my $conn = $sasl->client_new("ldap","localhost", "noplaintext noanonymous");

is($conn->mechanism, 'CRAM-MD5', 'conn mechanism');


is($conn->client_start, '', 'client_start');

is($conn->client_step("xyz"), 'gbarr 36c931fe47f3fe9c7adbf810b3c7c4ad', 'client_step');