Status Codes

The YubiHSM software components have a standard set of status codes to report the status of an HSM operation. To comply with the expectations of specific platforms, these status codes are converted to the appropriate API status code.

Currently, this translation is only performed for the Windows Key Storage Provider. The error codes, their meanings and translated values are as follows:

Libyubihsm Error Code Description Windows CNG Translation

YHR_SUCCESS

The operation completed successfully

ERROR_SUCCESS

YHR_MEMORY_ERROR

The YubiHSM or software library was not able to allocate memory to perform the requested operation

NTE_NO_MEMORY

YHR_INIT_ERROR

Unable to initialize libyubihsm

NTE_PROVIDER_DLL_FAIL

YHR_CONNECTION_ERROR

Transport Backend error

NTE_DEVICE_NOT_READY

YHR_CONNECTOR_NOT_FOUND

Unable to find a suitable connector

NTE_DEVICE_NOT_READY

YHR_INVALID_PARAMETERS

Invalid argument to a function

NTE_INVALID_PARAMETER

YHR_WRONG_LENGTH

This error may occur if there is a mismatch between the YubiHSM firmware version and libyubihsm library version

NTE_BAD_LEN

YHR_BUFFER_TOO_SMALL

Not enough space to store data

NTE_BUFFER_TOO_SMALL

YHR_CRYPTOGRAM_MISMATCH

Unable to verify cryptogram

NTE_BAD_SIGNATURE

YHR_SESSION_AUTHENTICATION_FAILED

Unable to authenticate session

NTE_INCORRECT_PASSWORD

YHR_MAC_MISMATCH

Unable to verify MAC

NTE_BAD_SIGNATURE

YHR_DEVICE_OK

No error

NTE_OP_OK

YHR_DEVICE_INVALID_COMMAND

Invalid command

NTE_NOT_SUPPORTED

YHR_DEVICE_INVALID_DATA

Malformed command / invalid data

NTE_INVALID_PARAMETER

YHR_DEVICE_INVALID_SESSION

Invalid session

NTE_DEVICE_NOT_READY

YHR_DEVICE_AUTHENTICATION_FAILED

Message encryption / verification failed

NTE_INCORRECT_PASSWORD

YHR_DEVICE_SESSIONS_FULL

All sessions are allocated

NTE_DEVICE_NOT_READY

YHR_DEVICE_SESSION_FAILED

Session creation failed

NTE_DEVICE_NOT_READY

YHR_DEVICE_STORAGE_FAILED

Storage failure

NTE_TOKEN_KEYSET_STORAGE_FULL

YHR_DEVICE_WRONG_LENGTH

Wrong length

NTE_BAD_LEN

YHR_DEVICE_INSUFFICIENT_PERMISSIONS

Wrong permissions for operation

NTE_PERM

YHR_DEVICE_LOG_FULL

Log buffer is full and forced audit is set

NTE_DEVICE_NOT_READY

YHR_DEVICE_OBJECT_NOT_FOUND

Object not found

NTE_NOT_FOUND

YHR_DEVICE_INVALID_ID

Illegal ID used

NTE_INVALID_PARAMETER[]

YHR_DEVICE_INVALID_OTP

Invalid OTP

NTE_INCORRECT_PASSWORD

YHR_DEVICE_DEMO_MODE

Demo mode, power cycle device

NTE_DEVICE_NOT_READY

YHR_DEVICE_COMMAND_UNEXECUTED

The HSM attempted to execute a command, but it did not complete in the time allotted. The command has not terminated, and the current state of the session is unavailable

NTE_SYS_ERR

YHR_GENERIC_ERROR

Generic error

NTE_FAIL

YHR_DEVICE_OBJECT_EXISTS

An object with the specified ID already exists

NTE_EXISTS

YHR_CONNECTOR_ERROR

Connector operation failed

NTE_DEVICE_NOT_READY