Skip to content

Commit 9642e3b

Browse files
philljjdanielinux
authored andcommitted
esp: fix f-3378.
1 parent 8a6db7a commit 9642e3b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/wolfesp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,13 @@ esp_des3_rfc2451_enc(const wolfIP_esp_sa * esp_sa, uint8_t * esp_data,
817817
enc_payload = esp_enc_payload(esp_data, iv_len);
818818
iv = esp_enc_iv(esp_data);
819819

820+
/* Generate random iv block for cbc method. */
821+
ret = wc_RNG_GenerateBlock(&wc_rng, iv, iv_len);
822+
if (ret) {
823+
ESP_LOG("error: wc_RNG_GenerateBlock: %d\n", ret);
824+
goto des3_enc_out;
825+
}
826+
820827
ret = wc_Des3Init(&des3_enc, NULL, INVALID_DEVID);
821828
if (ret != 0) {
822829
ESP_LOG("error: wc_Des3Init: %d\n", ret);

0 commit comments

Comments
 (0)