Skip to content

Wycheproof nit: Cipher.getParameters() returns null for RSA-OAEP after init() #223

Description

@MarkAtwood

Found by the wychcheck-jce Wycheproof runner.

Failing test

  • RsaOaepTest.testDefaults

Root cause

After cipher.init(Cipher.ENCRYPT_MODE, key) for an RSA-OAEP cipher, cipher.getParameters() returns null instead of an AlgorithmParameters instance containing the active OAEPParameterSpec.

Callers that introspect the default parameters (e.g. to log or validate them) receive a NullPointerException when they call params.getParameterSpec(OAEPParameterSpec.class).

The JDK standard notes that for ciphers using parameters (like OAEP), getParameters() should return the current effective parameters.

Priority

Low — affects parameter-introspection code paths not common in normal application code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions