comparison auth_basic.t @ 152:c9be30f65be7

Tests: various password schemes are in 1.0.3.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 01 Jun 2011 14:11:42 +0400
parents 6b73d6c8f26c
children c0ae29632905
comparison
equal deleted inserted replaced
151:1c39b7edc593 152:c9be30f65be7
73 unlike(http_get_auth('/', 'crypt', '123'), qr!SEETHIS!, 'normal wrong'); 73 unlike(http_get_auth('/', 'crypt', '123'), qr!SEETHIS!, 'normal wrong');
74 74
75 like(http_get_auth('/', 'crypt1', 'password'), qr!SEETHIS!, 'crypt $1$ (md5)'); 75 like(http_get_auth('/', 'crypt1', 'password'), qr!SEETHIS!, 'crypt $1$ (md5)');
76 unlike(http_get_auth('/', 'crypt1', '123'), qr!SEETHIS!, 'crypt $1$ wrong'); 76 unlike(http_get_auth('/', 'crypt1', '123'), qr!SEETHIS!, 'crypt $1$ wrong');
77 77
78 TODO: {
79 local $TODO = 'not yet';
80
81 like(http_get_auth('/', 'apr1', 'password'), qr!SEETHIS!, 'apr1 md5'); 78 like(http_get_auth('/', 'apr1', 'password'), qr!SEETHIS!, 'apr1 md5');
82 like(http_get_auth('/', 'plain', 'password'), qr!SEETHIS!, 'plain password'); 79 like(http_get_auth('/', 'plain', 'password'), qr!SEETHIS!, 'plain password');
83 like(http_get_auth('/', 'ssha', 'password'), qr!SEETHIS!, 'ssha'); 80
81 SKIP: {
82 # SHA1 may not be available unless we have OpenSSL
83
84 skip 'no sha1', 1 unless $t->has_module('--with-http_ssl_module')
85 or $t->has_module('--with-sha1')
86 or $t->has_module('--with-openssl');
87
88 like(http_get_auth('/', 'ssha', 'password'), qr!SEETHIS!, 'ssha');
84 } 89 }
85 90
86 unlike(http_get_auth('/', 'apr1', '123'), qr!SEETHIS!, 'apr1 md5 wrong'); 91 unlike(http_get_auth('/', 'apr1', '123'), qr!SEETHIS!, 'apr1 md5 wrong');
87 unlike(http_get_auth('/', 'plain', '123'), qr!SEETHIS!, 'plain wrong'); 92 unlike(http_get_auth('/', 'plain', '123'), qr!SEETHIS!, 'plain wrong');
88 unlike(http_get_auth('/', 'ssha', '123'), qr!SEETHIS!, 'ssha wrong'); 93 unlike(http_get_auth('/', 'ssha', '123'), qr!SEETHIS!, 'ssha wrong');