Skip to content

Commit e74dfa8

Browse files
committed
Don't erase token if there is a load error
Token data load errors should probably error, not silently erase the token. There does not seem to be a good way to test this with our current test framework.
1 parent 88e44c7 commit e74dfa8

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/internal.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3843,10 +3843,7 @@ static int wp11_Token_Load(WP11_Slot* slot, int tokenId, WP11_Token* token)
38433843
token->state = WP11_TOKEN_STATE_INITIALIZED;
38443844
}
38453845
if (ret != 0) {
3846-
/* Failed to load - clear out any data and initialize. */
3847-
wp11_Token_Final(token);
3848-
wp11_Token_Init(token, token->label);
3849-
ret = 0;
3846+
ret = CKR_DEVICE_ERROR;
38503847
}
38513848
}
38523849
else if (ret == NOT_AVAILABLE_E) {

0 commit comments

Comments
 (0)