Skip Menu |

This queue is for tickets about the Authen-SASL-SASLprep CPAN distribution.

Report information
The Basics
Id: 117767
Status: patched
Priority: 0/
Queue: Authen-SASL-SASLprep

People
Owner: CFAERBER [...] cpan.org
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in:
  • 1.00
  • 1.01
  • 1.011
  • 1.100
Fixed in: (no value)



Subject: Please add 'stored strings' capability
Currently, Authen::SASL::SASLprep doesn't pass an "unassigned_check" argument to Unicode::Stringprep. This means it's in "query string" mode, which allows unassigned characters. For usernames/passwords, it might be more appropriate to be using "stored strings" mode. (See https://tools.ietf.org/html/rfc3454#section-7 for differences.) Could you please add a feature to do stored mode? Possibly, just a boolean second parameter. Thank you.
Thanks for your input. I think that it might best be implemented in Unicode::Stringprep. It's strange that it never occurred to me to implement it there, even though it's required by Net::IDN::Nameprep.
On Tue Sep 13 16:01:11 2016, CFAERBER wrote: Show quoted text
> Thanks for your input. I think that it might best be implemented in > Unicode::Stringprep. It's strange that it never occurred to me to > implement it there, even though it's required by Net::IDN::Nameprep.
I think it may already be implemented: https://metacpan.org/source/CFAERBER/Unicode-Stringprep-1.105/lib/Unicode/Stringprep.pm#L39 I'm not sure that achieves all the right semantics, but it seems close. The problem with Authen::SASL::SASLprep that I'm raising with this bug is that there's no way to set that argument. Something like: saslprep($input, $use_stored_mode);
Yes, U::S does implement stored strings. However, it currently only returns a closure with all parameters baked in. You cannot, currently, select stored and query strings on a per-case basis.
I've implemented stored strings in version 1.100. This uses the same workaround as Net::IDN::IDNA2003 to work around Unicode::Stringprep's limitation (just create two separate functions/closures). This is not very efficient but I think that the best idea is to make Unicode::Stringprep more efficient if it is used multiple times with (partially) the same parameters.
Thank you! I think that's workable solution. Personally, I would make _saslprep_stored and _saslprep_query into lexical variables to keep them encapsulated, but that's your call. If you're concerned about the extra subroutine call overhead, I would just provide and export saslprep_query and saslprep_stored as separate subs and either have saslprep route between them or else have it just be an alias for saslprep_query. I.e. *saslprep_stored = Unicode::Stringprep->new( ... ); *saslprep_query = Unicode::Stringprep->new( ... ); *saslprep = \&saslprep_query;