Skip to content

Commit af3138b

Browse files
committed
Limit keyexport output on error.
1 parent 81d36d2 commit af3138b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/wh_server_keystore.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,12 @@ int wh_Server_HandleKeyRequest(whServerContext* server, uint16_t magic,
707707
ret = WH_ERROR_OK;
708708

709709
if (ret == WH_ERROR_OK) {
710-
resp.len = keySz;
710+
/* Only provide key output if no error */
711+
if (resp.rc == WH_ERROR_OK) {
712+
resp.len = keySz;
713+
} else {
714+
resp.len = 0;
715+
}
711716
memcpy(resp.label, meta->label, sizeof(meta->label));
712717

713718
(void)wh_MessageKeystore_TranslateExportResponse(

0 commit comments

Comments
 (0)