Skip to content

Commit 83a8a0a

Browse files
committed
keystore: remove unused WH_KS_OP_ERASE operation
1 parent 6cd6fd9 commit 83a8a0a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/wh_server_keystore.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ static whKeyCacheContext* _GetCacheContext(whServerContext* server,
8686
typedef enum {
8787
WH_KS_OP_CACHE = 0,
8888
WH_KS_OP_COMMIT,
89-
WH_KS_OP_ERASE,
9089
WH_KS_OP_EVICT,
9190
WH_KS_OP_EXPORT,
9291
WH_KS_OP_REVOKE,
@@ -173,13 +172,6 @@ static int _KeystoreCheckPolicy(whServerContext* server, whKsOp op,
173172
}
174173
break;
175174

176-
case WH_KS_OP_ERASE:
177-
if (flags &
178-
(WH_NVM_FLAGS_NONMODIFIABLE | WH_NVM_FLAGS_NONDESTROYABLE)) {
179-
return WH_ERROR_ACCESS;
180-
}
181-
break;
182-
183175
case WH_KS_OP_EXPORT:
184176
if (flags & WH_NVM_FLAGS_NONEXPORTABLE) {
185177
return WH_ERROR_ACCESS;
@@ -190,6 +182,9 @@ static int _KeystoreCheckPolicy(whServerContext* server, whKsOp op,
190182
case WH_KS_OP_REVOKE:
191183
/* Always allowed */
192184
break;
185+
default:
186+
/* unknown operation */
187+
return WH_ERROR_BADARGS;
193188
}
194189

195190
return WH_ERROR_OK;

0 commit comments

Comments
 (0)