From d9b45cc3b00af749baf28e4dfa1afe6c7d2708ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Fri, 27 Sep 2024 18:18:36 +0200 Subject: [PATCH] minor --- bench/bench_engine.ml | 2 +- src/engine.ml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/bench_engine.ml b/bench/bench_engine.ml index 9bcf6cb..d59e66f 100644 --- a/bench/bench_engine.ml +++ b/bench/bench_engine.ml @@ -194,7 +194,7 @@ let test_receive_data cipher = Staged.stage @@ fun () -> match Miragevpn.handle established_client (`Data pkt) with | Ok _ -> () - | Error _ -> assert false + | Error err -> Format.kasprintf failwith "%a" Miragevpn.pp_error err in Test.make ~name:"decode data" staged diff --git a/src/engine.ml b/src/engine.ml index 398b5e9..afa59c2 100644 --- a/src/engine.ml +++ b/src/engine.ml @@ -1147,7 +1147,7 @@ let out ?add_timestamp prefix_len (ctx : keys) hmac_algorithm compress rng data Bytes.create (prefix_len + String.length replay_id + tag_size + String.length data) in - Bytes.blit_string replay_id 0 b prefix_len (String.length replay_id); + set_replay_id b prefix_len; authenticate_encrypt_into ~key:my_key ~nonce ~adata:replay_id data ~src_off:0 b ~dst_off:(prefix_len + String.length replay_id + tag_size)