Skip to content

pem_to_key() does not handle the case where public_key:pem_decode returns [] #43

@yulius-take2

Description

@yulius-take2

It appears that invalid pem_decodes aren't handled properly.

The case for [] is not handled.

https://github.com/artemeff/jwt/blob/master/src/jwt.erl#L333-L340

errorContext: child_terminated
reason: {{case_clause,[]},
         [{jwt,pem_to_key,1,
               [{file,"/build/_build/default/lib/jwt/src/jwt.erl"},
                {line,323}]},
          {jwt,jwt_check_sig,4,
               [{file,"/build/_build/default/lib/jwt/src/jwt.erl"},
                {line,235}]},
          {jwt,check_signature,1,
               [{file,"/build/_build/default/lib/jwt/src/jwt.erl"},
                {line,174}]},
          {jwt,reduce_while,3,
               [{file,"/build/_build/default/lib/jwt/src/jwt.erl"},
                {line,119}]},
          {jwt,decode,3,
               [{file,"/build/_build/default/lib/jwt/src/jwt.erl"},
                {line,101}]},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions