YubiHSM Error and Status Codes

Error Codes

Below are error codes returned by a YubiHSM device.

Name Value Description
AUTHENTICATION FAILED 0x04 Wrong Authentication Key
DEMO MODE 0x10 Demo device must be power-cycled
INSUFFICIENT PERMISSIONS 0x09 Insufficient permissions for the command
INVALID COMMAND 0x01 Unknown command
INVALID DATA 0x02 Malformed data for the command
INVALID ID 0x0c Invalid ID
INVALID OTP 0x0f OTP decryption failed
INVALID SESSION 0x03 The session has expired or does not exist
LOG FULL 0x0a The log is full and force audit is enabled
OBJECT EXISTS 0x11 Unable to overwrite object
OBJECT NOT FOUND 0x0b No object found matching given ID and Type
OK 0x00 Success
SESSION FAILED 0x06 Session setup failed
SESSIONS FULL 0x05 No more available sessions
SSH CA CONSTRAINT
VIOLATION
0x0e Constraints in SSH Template not met
STORAGE FAILED 0x07 Storage full
WRONG LENGTH 0x08 Wrong data length for the command

Status Codes Reference

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_BUFFER_TOO_SMALL
Not enough space
to store data
NTE_BUFFER_TOO_SMALL
YHR_CONNECTION_ERROR
Transport Backend
error
NTE_DEVICE_NOT_READY
YHR_CONNECTOR_ERROR
Connector
operation Failed
NTE_DEVICE_NOT_READY
YHR_CONNECTOR_NOT_FOUND
Unable to find a
suitable connector
NTE_DEVICE_NOT_READY
YHR_CRYPTOGRAM_MISMATCH
Unable to verify
cryptogram
NTE_BAD_SIGNATURE
YHR_DEVICE_AUTHENTICATION
_FAILED
Message encryption /
verification failed
NTE_INCORRECT_PASSWORD

YHR_DEVICE_COMMAND
_UNEXECUTED







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

Demo mode, power
cycle device
NTE_DEVICE_NOT_READY
YHR_DEVICE_INSUFFICIENT
_PERMISSIONS
Wrong permissions
for operation
NTE_PERM
YHR_DEVICE_INVALID
_COMMAND
Invalid command NTE_NOT_SUPPORTED
YHR_DEVICE_INVALID_DATA
Malformed command /
invalid data
NTE_INVALID_PARAMETER
YHR_DEVICE_INVALID_ID
Illegal ID used
NTE_INVALID_PARAMETER[]
YHR_DEVICE_INVALID_OTP
Invalid OTP
NTE_INCORRECT_PASSWORD
YHR_DEVICE_INVALID
_SESSION
Invalid session NTE_DEVICE_NOT_READY
YHR_DEVICE_LOG_FULL


Log buffer is full
and forced audit is
set
NTE_DEVICE_NOT_READY
YHR_DEVICE_OBJECT_EXISTS
An object with the
specified ID already
exists
NTE_EXISTS
YHR_DEVICE_OBJECT
_NOT_FOUND
Object not found NTE_NOT_FOUND
YHR_DEVICE_OK No error NTE_OP_OK
YHR_DEVICE_SESSION_FAILED
Session creation
failed
NTE_DEVICE_NOT_READY
YHR_DEVICE_SESSIONS_FULL
All sessions are
allocated
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_GENERIC_ERROR Generic error NTE_FAIL
YHR_INIT_ERROR
Unable to initialize
libyubihsm
NTE_PROVIDER_DLL_FAIL
YHR_INVALID_PARAMETERS
Invalid argument to
a function
NTE_INVALID_PARAMETER
YHR_MAC_MISMATCH
Unable to verify MAC
NTE_BAD_SIGNATURE
YHR_MEMORY_ERROR
The YubiHSM or
software library was
not able to allocate
memory to perform
the requested
operation
NTE_NO_MEMORY
YHR_SESSION
_AUTHENTICATION_FAILED
Unable to
authenticate session
NTE_INCORRECT_PASSWORD
YHR_SUCCESS
The operation
completed
Successfully
ERROR_SUCCESS
YHR_WRONG_LENGTH
This error may occur
if there is a
mismatch between the
YubiHSM firmware
version and
libyubihsm library
version
NTE_BAD_LEN