bbusschots / hsxkpasswd

A Perl module and terminal command for generating secure memorable passwords inspired by the fabulous XKCD web comic and Steve Gibson's Password Hay Stacks. This is the library that powers www.xkpasswd.net
http://www.bartb.ie/xkpasswd
BSD 2-Clause "Simplified" License
278 stars 48 forks source link

t/02-generate-passwords.t fails with Type-Tiny-2.000001 #42

Open eclipseo opened 2 years ago

eclipseo commented 2 years ago

After upgrading Type-Tiny from 1.016010 to 2.000001 t/02-generate-passwords.t fails like this:

t/01-defined-constants.t ... ok
#   Failed test 'password generation with named argument 'dictionary_list''
#   at t/02-generate-passwords.t line 28.
#   Failed test 'password generation with named argument 'dictionary_file''
#   at t/02-generate-passwords.t line 35.
#   Failed test 'password generation with named arguments 'dictionary_file' & 'dictionary_file_encoding''
#   at t/02-generate-passwords.t line 41.
# Looks like you failed 3 tests of 10.
t/02-generate-passwords.t .. 
Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/10 subtests 

This is triggered by this change in Type-Tiny https://github.com/tobyink/p5-type-tiny/commit/4baba12312f45d2e657468e26b64c643687651d1:

commit 4baba12312f45d2e657468e26b64c643687651d1 (HEAD)
Author: Toby Inkster <mail@tobyinkster.co.uk>
Date:   Sun Sep 11 19:16:15 2022 +0100

    Bring multisig functionality into the v2 API

I can reduce the reproducer to:

perl -T -I/tmp/p5-type-tiny/lib -Ilib -e 'use Crypt::HSXKPasswd; Crypt::HSXKPasswd->new(dictionary_list => [qw(seme tes words)])'
Alternative signatures must be CODE, HASH, or ARRAY refs at /tmp/p5-type-tiny/lib/Type/Params/Signature.pm line 26.

This exception was added in the linked commit.

paultcochrane commented 1 month ago

See also the discussion in https://rt.cpan.org/Public/Bug/Display.html?id=144672.

It seems that the fix to this issue is to fix the square brackets in the call to multisig in lib/Crypt/HSXKPasswd/Dictionary/Basic.pm as patched by @perlpunk in https://rt.cpan.org/Transaction/Display.html?id=2415456.