Skip to content

RSA-OAEP & RSA-PSS errors different between spki and pkcs8 key importing #297

@lucacasonato

Description

@lucacasonato

For RSA-PSS the spec says the following for pkcs8 importing in the block that validates algorithm OID:

If params is not defined, or is not an instance of the RSASSA-PSS-params ASN.1 type defined in [RFC3447], throw a NotSupportedError.

For spki:

If params is not defined, or is not an instance of the RSASSA-PSS-params ASN.1 type defined in [RFC3447], throw a DataError.

One throws a NotSupportedError, the other a DataError for the same class of issue. This is also not tested in WPT (having it wrong doesn't make the tests fail). Found during some routine maintenance of Deno's Web Crypto implementation.

The same is the case for the same bit of code in RSA-OAEP's import key operation.

The question is: is this wrong? Shouldn't both return DataError?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions