unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 87b24829b4bb6fcd7371e583ada173fa8a0968ac 1585 bytes (raw)
name: gnu/packages/patches/ecryptfs-utils-openssl-1.1.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 
diff --git a/src/key_mod/ecryptfs_key_mod_openssl.c b/src/key_mod/ecryptfs_key_mod_openssl.c
index 56ebe2d..3959974 100644
--- a/src/key_mod/ecryptfs_key_mod_openssl.c
+++ b/src/key_mod/ecryptfs_key_mod_openssl.c
@@ -141,6 +141,7 @@ ecryptfs_openssl_destroy_subgraph_ctx(struct ecryptfs_subgraph_ctx *ctx)
 static int ecryptfs_openssl_generate_signature(char *sig, RSA *key)
 {
 	int len, nbits, ebits, i;
+	const BIGNUM *n, *e;
 	int nbytes, ebytes;
 	unsigned char *hash;
 	unsigned char *data = NULL;
@@ -152,11 +153,14 @@ static int ecryptfs_openssl_generate_signature(char *sig, RSA *key)
 		rc = -ENOMEM;
 		goto out;
 	}
-	nbits = BN_num_bits(key->n);
+
+	RSA_get0_key(key, &n, &e, NULL);
+
+	nbits = BN_num_bits(n);
 	nbytes = nbits / 8;
 	if (nbits % 8)
 		nbytes++;
-	ebits = BN_num_bits(key->e);
+	ebits = BN_num_bits(e);
 	ebytes = ebits / 8;
 	if (ebits % 8)
 		ebytes++;
@@ -179,11 +183,11 @@ static int ecryptfs_openssl_generate_signature(char *sig, RSA *key)
 	data[i++] = '\02';
 	data[i++] = (nbits >> 8);
 	data[i++] = nbits;
-	BN_bn2bin(key->n, &(data[i]));
+	BN_bn2bin(n, &(data[i]));
 	i += nbytes;
 	data[i++] = (ebits >> 8);
 	data[i++] = ebits;
-	BN_bn2bin(key->e, &(data[i]));
+	BN_bn2bin(e, &(data[i]));
 	i += ebytes;
 	SHA1(data, len + 3, hash);
 	to_hex(sig, (char *)hash, ECRYPTFS_SIG_SIZE);
@@ -278,7 +282,7 @@ static int ecryptfs_openssl_read_key(RSA **rsa, unsigned char *blob)
 	BIO *in = NULL;
 	int rc;
 
-	CRYPTO_malloc_init();
+	OPENSSL_malloc_init();
 	ERR_load_crypto_strings();
 	OpenSSL_add_all_algorithms();
 	ENGINE_load_builtin_engines();

debug log:

solving 87b24829b4 ...
found 87b24829b4 in https://yhetil.org/guix-patches/cfe83bc19e6b7a5f2a63d742c3647dac7256d26e.1708355625.git.brian@kubisiak.com/

applying [1/1] https://yhetil.org/guix-patches/cfe83bc19e6b7a5f2a63d742c3647dac7256d26e.1708355625.git.brian@kubisiak.com/
diff --git a/gnu/packages/patches/ecryptfs-utils-openssl-1.1.patch b/gnu/packages/patches/ecryptfs-utils-openssl-1.1.patch
new file mode 100644
index 0000000000..87b24829b4

1:14: space before tab in indent.
 	int len, nbits, ebits, i;
1:16: space before tab in indent.
 	int nbytes, ebytes;
1:17: space before tab in indent.
 	unsigned char *hash;
1:18: space before tab in indent.
 	unsigned char *data = NULL;
1:20: space before tab in indent.
 		rc = -ENOMEM;
Checking patch gnu/packages/patches/ecryptfs-utils-openssl-1.1.patch...
Applied patch gnu/packages/patches/ecryptfs-utils-openssl-1.1.patch cleanly.
warning: squelched 23 whitespace errors
warning: 28 lines add whitespace errors.

index at:
100644 87b24829b4bb6fcd7371e583ada173fa8a0968ac	gnu/packages/patches/ecryptfs-utils-openssl-1.1.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).