Programming in FIPS Mode

When the device is set to FIPS-compliant mode (see the SafeNet ProtectToolkit-C Administration Manual), the following Security Mode flags are set, altering the behavior of PKCS#11. Programmers must consider these restrictions when designing applications.

No Public Crypto

When this flag is TRUE, each token will have the CKF_LOGIN_REQUIRED flag set and all the cryptographic C_xxxInit functions and key operation functions: C_GenerateKey, C_GenerateKeyPair, C_WrapKey, C_UnwrapKey, C_DeriveKey, C_DigestKey will fail unless the session state is in a User mode (that is, either the USER or SO must be logged in).

If the session state is not in a User mode, any attempt to write to a token will fail (that is, using the functions C_CreateObject, C_DestroyObject and C_SetAttributeValue).

No Clear PINS

When this flag is TRUE, the device will not allow clear-text authentication data to pass through the host data port.

With this flag enabled, the C_InitToken function will fail with the error result CKR_ACCESS_DENIED. In order to initialize tokens, the SafeNet extension function CT_InitToken must be used. The SafeNet tools ctconf and gCTAdmin are aware of this restriction and will automatically use the appropriate function.

The other functions that supply PINs to the adapter, C_InitPin, C_Login, C_SetPin, and CT_InitToken, will encrypt the PINs before supplying the request to the adapter. The C_CreateObject, C_GenerateKey, C_SeedRandom functions will also be encrypted, as they may contain sensitive values. The encryption and decryption is performed by the Secure Messaging System (SMS) and any application will see the request AFTER it has been verified and decrypted by the SMS.

Because the SMS automatically encrypts the PINs, there is no effect on the application.

Finally, with this flag enabled, secret and private key objects will always have their CKA_SENSITIVE attribute set to TRUE. Any attempt to create a non-sensitive key (that is, set CKA_SENSITIVE=FALSE) or specify CKA_SENSITIVE=FALSE for any object on the device will fail.

An application will fail if it attempts to create, derive, or unwrap keys with CKA_SENSITIVE=FALSE.

CAUTION!   The No Clear PINs flag must be set to enable Full Secure Messaging Encryption and Full Secure Messaging Signing.

Authentication Protection

This flag is TRUE and all requests coming from an authenticated user (i.e. a request from a logged in user) must be cryptographically signed.

The signature verification is performed by the SMS and any application will see the request AFTER it has been verified by the SMS. This flag does not impact on an application.

Security Mode Locked

This flag is TRUE and means the settings of the other flags in this mode structure may not be changed (they are Read Only).

This flag may be set to TRUE when FALSE but never FALSE when TRUE.  The only way to set this flag to FALSE once it has been set to TRUE is to tamper the device.

Tamper Before Upgrade

This flag is TRUE and all keys, objects and PINs stored in the device’s Secure Memory will automatically be erased during any OS Firmware Upgrade, FM Upgrade or FM Disable operation.

Designers should consider their key backup and recovery plans when using FIPS mode.

Only-FIPS Approved Algorithms

This flag is TRUE and restricts the PKCS#11 mechanisms available to only the FIPS approved mechanisms. Some algorithms will have their key sizes limited when this flag is true.

Refer to SafeNet ProtectToolkit-C Mechanisms for the list of FIPS-approved mechanisms.