diff --git a/cr_hsm_code.c b/cr_hsm_code.c index eda5de5..b784779 100644 --- a/cr_hsm_code.c +++ b/cr_hsm_code.c @@ -246,7 +246,13 @@ void hsm_finalize( void ) { RQCard_fips_free( &hsmCard, &hsmFips ); RQCard_destroy( &hsmCard ); + +#ifdef ENCRYPT_AES NFKM_freekey( hsmHandle, hsmAeskeyinfo, NULL ); +#else // !ENCRYPT_AES + NFKM_freekey( hsmHandle, hsmRsakeyinfo, NULL ); +#endif // ENCRYPT_AES + NFKM_freeinfo( hsmHandle, &hsmWorld, NULL ); NFastApp_Disconnect( hsmConnection, NULL ); NFastApp_Finish( hsmHandle, NULL );