mirror of
https://github.com/imapsync/imapsync.git
synced 2025-08-04 16:01:29 +02:00
1.398
This commit is contained in:
parent
3f8607bd96
commit
d88bf4b46a
90 changed files with 13227 additions and 504 deletions
54
NTLM-1.05/t/03_oo.t
Normal file
54
NTLM-1.05/t/03_oo.t
Normal file
|
@ -0,0 +1,54 @@
|
|||
#! /usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 12;
|
||||
|
||||
use Authen::NTLM;
|
||||
use MIME::Base64;
|
||||
|
||||
my $user = "test";
|
||||
my $domain = "test";
|
||||
my $passwd = "test";
|
||||
my $msg1 = "TlRMTVNTUAABAAAAB7IAAAQABAAgAAAABAAEACQAAAB0ZXN0dGVzdA==";
|
||||
my $challenge = "TlRMTVNTUAACAAAABAAEADAAAAAFggEAQUJDREVGR0gAAAAAAAAAAAAAAAAAAAAAdGVzdA==";
|
||||
my $msg2 = "TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAQABABwAAAACAAIAHQAAAAIAAgAfAAAAAAAAABEAAAABYIBAJ7/TlMo4HLg0gOk6iKq4bv2vk35ozHEKKoqG8nTkQ5S82zyqpJzxPDJHUMynnKsBHRlc3R0AGUAcwB0AHQAZQBzAHQA";
|
||||
|
||||
my $a = Authen::NTLM-> new(
|
||||
user => $user,
|
||||
domain => $domain,
|
||||
password => $passwd,
|
||||
);
|
||||
|
||||
# 2: username
|
||||
|
||||
ok($a->user eq $user, 'ntlm_user');
|
||||
|
||||
# 3: domain
|
||||
|
||||
ok($a->domain eq $domain, 'ntlm_domain');
|
||||
|
||||
# 4: password
|
||||
|
||||
ok($a->password eq $passwd, 'ntlm_password');
|
||||
|
||||
# 5: initial message
|
||||
|
||||
my $reply1 = $a-> challenge;
|
||||
ok($reply1 eq $msg1, 'reply 1');
|
||||
|
||||
# 6-12: decode challenge - not normally user accessed
|
||||
|
||||
my $c = &Authen::NTLM::decode_challenge(decode_base64($challenge));
|
||||
ok($c->{ident} eq "NTLMSSP", 'header');
|
||||
ok($c->{type} == 2, 'type');
|
||||
ok($c->{flags} == 0x00018205, 'flags');
|
||||
ok($c->{data} eq "ABCDEFGH", 'data');
|
||||
ok($c->{domain}{len} == 4, 'domain length');
|
||||
ok($c->{domain}{offset} == 48, 'domain offset');
|
||||
ok($c->{buffer} eq "test", 'contents');
|
||||
|
||||
# 13: challenge response
|
||||
|
||||
my $reply2 = $a-> challenge($challenge);
|
||||
ok($reply2 eq $msg2, 'reply 2');
|
Loading…
Add table
Add a link
Reference in a new issue