From 61fd100218a7dd90766cf146b2d2dde4c594be0a Mon Sep 17 00:00:00 2001 From: Yuval Kogman Date: Sat, 30 Aug 2025 01:37:33 +0200 Subject: [PATCH] directory: limit V1 requests to 7168 bytes This ensures that the OHTTP relay will not be able to distinguish v1 from v2 responses to the receiver. --- payjoin-directory/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payjoin-directory/src/lib.rs b/payjoin-directory/src/lib.rs index 71caff21a..5c45802bb 100644 --- a/payjoin-directory/src/lib.rs +++ b/payjoin-directory/src/lib.rs @@ -21,7 +21,7 @@ const CHACHA20_POLY1305_NONCE_LEN: usize = 32; // chacha20poly1305 n_k const POLY1305_TAG_SIZE: usize = 16; pub const BHTTP_REQ_BYTES: usize = ENCAPSULATED_MESSAGE_BYTES - (CHACHA20_POLY1305_NONCE_LEN + POLY1305_TAG_SIZE); -const V1_MAX_BUFFER_SIZE: usize = 65536; +const V1_MAX_BUFFER_SIZE: usize = 7168; const V1_REJECT_RES_JSON: &str = r#"{{"errorCode": "original-psbt-rejected ", "message": "Body is not a string"}}"#;