File: 0009-tests-random_text-don-t-include-contested-r.patch

package info (click to toggle)
rnp 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,656 kB
  • sloc: cpp: 74,613; python: 5,272; ansic: 5,035; sh: 1,661; makefile: 25
file content (36 lines) | stat: -rw-r--r-- 1,463 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Wed, 15 Oct 2025 17:40:04 -0400
Subject: tests: random_text: don't include contested `\r`

The OpenPGP ecosystem has at least two (maybe three) different
perspectives on how to handle text-mode normalization of `\r` line
endings.

See
https://mailarchive.ietf.org/arch/msg/openpgp/NzVArGf7JiBVm-3BmMdkFH_1nvM
for more details.

In the meantime, don't bother trying to align RNP with any particular
choice on whether `\r` should be normalized when making text
signatures by not including `\r` in the test messages being signed.
---
 src/tests/cli_common.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tests/cli_common.py b/src/tests/cli_common.py
index 1d3d81f..fc55eed 100644
--- a/src/tests/cli_common.py
+++ b/src/tests/cli_common.py
@@ -67,10 +67,10 @@ def pswd_pipe(password):
 def random_text(path, size):
     # Generate random text, with 50% probability good-compressible
     if random.randint(0, 10) < 5:
-        st = ''.join(random.choice(string.ascii_letters + string.digits + " \t\r\n-,.")
+        st = ''.join(random.choice(string.ascii_letters + string.digits + " \t\n-,.")
                      for _ in range(size))
     else:
-        st = ''.join(random.choice("abcdef0123456789 \t\r\n-,.") for _ in range(size))
+        st = ''.join(random.choice("abcdef0123456789 \t\n-,.") for _ in range(size))
     with open(path, 'w+') as f:
         f.write(st)