unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob cb94f14673dfc8391c4efc0e84c819e60bd09a79 1261 bytes (raw)
name: gnu/packages/patches/rnp-fix-test.patch 	 # note: path name is non-authoritative(*)

 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
 
From fede676aec9201cfd18b47ffb60ebb55fa90abac Mon Sep 17 00:00:00 2001
From: Justus Winter <teythoon@avior.uberspace.de>
Date: Tue, 21 Jul 2020 15:54:32 +0200
Subject: [PATCH 2/6] Make test more robust.

Previously, a single character "0" was written to the RSA signature
data to invalidate the signature.   However, there is a 1 in 256
chance of there being a "0" character there, in which case the
invalidation fails.  Instead, overwrite nine characters, reducing the
chance of failure to 1 in 2^72.
---
 src/tests/key-unlock.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tests/key-unlock.cpp b/src/tests/key-unlock.cpp
index 66a44f0d..5610f065 100644
--- a/src/tests/key-unlock.cpp
+++ b/src/tests/key-unlock.cpp
@@ -149,8 +149,8 @@ TEST_F(rnp_tests, test_key_unlock_pgp)
     std::fstream verf("dummyfile.dat.pgp",
                       std::ios_base::binary | std::ios_base::out | std::ios_base::in);
     off_t        versize = file_size("dummyfile.dat.pgp");
-    verf.seekg(versize - 3, std::ios::beg);
-    verf.write("0x0C", 1);
+    verf.seekg(versize - 9, std::ios::beg);
+    verf.write("foobarbaz", 9);
     verf.close();
     assert_false(cli_rnp_process_file(&cfg, &rnp));
     rnp_cfg_free(&cfg);
-- 
2.20.1


debug log:

solving cb94f14673 ...
found cb94f14673 in https://yhetil.org/guix-patches/20200723120322.8385-3-justus@sequoia-pgp.org/

applying [1/1] https://yhetil.org/guix-patches/20200723120322.8385-3-justus@sequoia-pgp.org/
diff --git a/gnu/packages/patches/rnp-fix-test.patch b/gnu/packages/patches/rnp-fix-test.patch
new file mode 100644
index 0000000000..cb94f14673

1:36: trailing whitespace.
-- 
Checking patch gnu/packages/patches/rnp-fix-test.patch...
1:38: new blank line at EOF.
+
Applied patch gnu/packages/patches/rnp-fix-test.patch cleanly.
warning: 2 lines add whitespace errors.

index at:
100644 cb94f14673dfc8391c4efc0e84c819e60bd09a79	gnu/packages/patches/rnp-fix-test.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).