Skip to content

Returning not found status when security condition not required #65

@mistial-dev

Description

@mistial-dev

As a relatively minor issue, the YubiKey returns that the security status is not satisfied before checking/revealing that a Data Object is not present.

YubiKey manager uses the printed data object to store the management key in PIN-protected configurations (as it can only be read with the PIN entered), so consistent behaviour here helps ensure compatibility.

An upcoming compatibility pull request will change the behaviour to match that of the YubiKey.

			if (file == null || file.data == null ||
			    file.len == 0) {
				ISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);
				return;
			}

			final byte policy;
			if (isContact())
				policy = file.contact;
			else
				policy = file.contactless;

			if (policy == File.P_NEVER) {
				ISOException.throwIt(
				    ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
				return;
			}

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