DCIT / perl-Crypt-JWT

Other
54 stars 18 forks source link

No JWS support for ES256K 'alg' type #29

Closed mkryshak closed 3 years ago

mkryshak commented 3 years ago

This looks like a simple RegEx match issue on line 696:

sub encode_jwt {
  my %args = @_;

  croak "JWT: missing 'alg'" unless $args{alg};
  my $ser = $args{serialization} || 'compact';
  if ($args{alg} =~ /^(none|EdDSA|((HS|RS|PS|ES)(512|384|256)))$/) {

Setting alg to ES256K will not match this RegEx and instead default to JWE instead of JWS.