Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible regression caused in Crypt::HSXKPasswd by Type::Tiny 2.000001 #127

Closed
perlpunk opened this issue Dec 20, 2022 · 3 comments
Closed
Assignees

Comments

@perlpunk
Copy link

perlpunk commented Dec 20, 2022

I'm not sure if this is a regression in Type::Tiny or a mistake in Crypt::HSXKPasswd

https://rt.cpan.org/Public/Bug/Display.html?id=144672

There are currently two reproducers for two similar, probably related bugs:

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.
[   30s] 
[   30s] #   Failed test 'password generation with named argument 'dictionary_list''
[   30s] #   at t/02-generate-passwords.t line 28.
[   30s] 
[   30s] #   Failed test 'password generation with named argument 'dictionary_file''
[   30s] #   at t/02-generate-passwords.t line 35.
[   30s] 
[   30s] #   Failed test 'password generation with named arguments 'dictionary_file' & 'dictionary_file_encoding''
[   30s] #   at t/02-generate-passwords.t line 41.
[   30s] # Looks like you failed 3 tests of 10.
[   30s] t/02-generate-passwords.t .. 
[   30s] Dubious, test returned 3 (wstat 768, 0x300)
[   30s] Failed 3/10 subtests 

If I output $@ I get:

    ERROR - Crypt::HSXKPasswd::hsxkpasswd(): Failed to generate password with the following error: Can't use an undefined value as a subroutine reference at /tmp/Crypt-HSXKPasswd-v3.6/blib/lib/Crypt/HSXKPasswd/Dictionary/Basic.pm line 221

Maybe the code in Crypt::HSXKPasswd is using it in the wrong way, but it would be nice if you could have a quick look.

I can also reproduce it with the latest developer version.

edit: fix code markers

@perlpunk perlpunk changed the title Possible regression caused in Crypt::HSXKPasswd Possible regression caused in Crypt::HSXKPasswd by Type::Tine 2.000001 Dec 20, 2022
@perlpunk perlpunk changed the title Possible regression caused in Crypt::HSXKPasswd by Type::Tine 2.000001 Possible regression caused in Crypt::HSXKPasswd by Type::Tiny 2.000001 Dec 20, 2022
@tobyink tobyink self-assigned this Dec 21, 2022
@tobyink
Copy link
Owner

tobyink commented Dec 21, 2022

Interesting. A quick look seems to suggest the module is calling multisig correctly, so the bug is probably in Type::Tiny (or more specifically, in Type::Params::Alternatives).

@tobyink
Copy link
Owner

tobyink commented Dec 21, 2022

It's calling multisig incorrectly. I'll add details to the Crypt::HSXKPasswd ticket.

@tobyink tobyink closed this as completed Dec 21, 2022
@perlpunk
Copy link
Author

perlpunk commented Jan 2, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants