public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:dev commit in: app-crypt/reop/, app-crypt/reop/files/
@ 2024-07-10 23:52 Haelwenn Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Haelwenn Monnier @ 2024-07-10 23:52 UTC (permalink / raw
  To: gentoo-commits

commit:     1fd7313bb6cc36d7aa1efe51a641500da0bfdd66
Author:     Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me>
AuthorDate: Wed Jul 10 23:46:57 2024 +0000
Commit:     Haelwenn Monnier <contact <AT> hacktivis <DOT> me>
CommitDate: Wed Jul 10 23:48:00 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=1fd7313b

app-crypt/reop: Modern-C fixes

Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me>

 .../reop-2.1.1-base64-function-signatures.patch    | 41 ++++++++++++++++++++++
 .../reop-2.1.1-bcrypt_hash-cdata-sizeof.patch      | 11 ++++++
 .../{reop-2.1.1.ebuild => reop-2.1.1-r1.ebuild}    |  7 +++-
 3 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/app-crypt/reop/files/reop-2.1.1-base64-function-signatures.patch b/app-crypt/reop/files/reop-2.1.1-base64-function-signatures.patch
new file mode 100644
index 000000000..1641abd81
--- /dev/null
+++ b/app-crypt/reop/files/reop-2.1.1-base64-function-signatures.patch
@@ -0,0 +1,41 @@
+--- a/other/other.c
++++ b/other/other.c
+@@ -328,11 +328,7 @@ static const char Pad64 = '=';
+    */
+ 
+ int
+-b64_ntop(src, srclength, target, targsize)
+-	u_char const *src;
+-	size_t srclength;
+-	char *target;
+-	size_t targsize;
++b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize)
+ {
+ 	size_t datalength = 0;
+ 	u_char input[3];
+@@ -392,10 +388,7 @@ b64_ntop(src, srclength, target, targsize)
+  */
+ 
+ int
+-b64_pton(src, target, targsize)
+-	char const *src;
+-	u_char *target;
+-	size_t targsize;
++b64_pton(char const *src, u_char *target, size_t targsize)
+ {
+ 	int tarindex, state, ch;
+ 	u_char nextbyte;
+diff --git a/other/other.h b/other/other.h
+index 08701fa..9ff1c0d 100644
+--- a/other/other.h
++++ b/other/other.h
+@@ -3,6 +3,9 @@
+ 
+ #define _PATH_TTY "/dev/tty"
+ 
++int b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize);
++int b64_pton(char const *src, u_char *target, size_t targsize);
++
+ #ifndef HAVE_STRLCAT
+ size_t strlcat(char *dst, const char *src, size_t siz);
+ #endif

diff --git a/app-crypt/reop/files/reop-2.1.1-bcrypt_hash-cdata-sizeof.patch b/app-crypt/reop/files/reop-2.1.1-bcrypt_hash-cdata-sizeof.patch
new file mode 100644
index 000000000..d418740d3
--- /dev/null
+++ b/app-crypt/reop/files/reop-2.1.1-bcrypt_hash-cdata-sizeof.patch
@@ -0,0 +1,11 @@
+--- a/other/other.c
++++ b/other/other.c
+@@ -659,7 +659,7 @@ bcrypt_hash(u_int8_t *sha2pass, u_int8_t *sha2salt, u_int8_t *out)
+ 		cdata[i] = Blowfish_stream2word(ciphertext, sizeof(ciphertext),
+ 		    &j);
+ 	for (i = 0; i < 64; i++)
+-		blf_enc(&state, cdata, sizeof(cdata) / sizeof(uint64_t));
++		blf_enc(&state, cdata, sizeof(cdata) / sizeof(uint32_t));
+ 
+ 	/* copy out */
+ 	for (i = 0; i < BCRYPT_BLOCKS; i++) {

diff --git a/app-crypt/reop/reop-2.1.1.ebuild b/app-crypt/reop/reop-2.1.1-r1.ebuild
similarity index 76%
rename from app-crypt/reop/reop-2.1.1.ebuild
rename to app-crypt/reop/reop-2.1.1-r1.ebuild
index 6ce103535..0d22e5341 100644
--- a/app-crypt/reop/reop-2.1.1.ebuild
+++ b/app-crypt/reop/reop-2.1.1-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2020-2021 Gentoo Authors
+# Copyright 2020-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -16,6 +16,11 @@ KEYWORDS="~amd64"
 DEPEND="dev-libs/libsodium:="
 RDEPEND="${DEPEND}"
 
+PATCHES=(
+	"${FILESDIR}/reop-2.1.1-base64-function-signatures.patch"
+	"${FILESDIR}/reop-2.1.1-bcrypt_hash-cdata-sizeof.patch"
+)
+
 src_compile() {
 	emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" LDFLAGS="-lsodium ${LDFLAGS}"
 }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: app-crypt/reop/, app-crypt/reop/files/
@ 2025-05-31 22:49 Haelwenn Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Haelwenn Monnier @ 2025-05-31 22:49 UTC (permalink / raw
  To: gentoo-commits

commit:     23baf35dda74da80cbf14568c20b5349f180e572
Author:     Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me>
AuthorDate: Sat May 31 22:42:50 2025 +0000
Commit:     Haelwenn Monnier <contact <AT> hacktivis <DOT> me>
CommitDate: Sat May 31 22:49:33 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=23baf35d

app-crypt/reop: Fix bcrypt_hash length

Closes: https://bugs.gentoo.org/956772
Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me>

 .../reop-2.1.1-bcrypt_hash-cdata-sizeof.patch      | 24 +++++++++++++++++++---
 .../{reop-2.1.1-r1.ebuild => reop-2.1.1-r2.ebuild} |  0
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/app-crypt/reop/files/reop-2.1.1-bcrypt_hash-cdata-sizeof.patch b/app-crypt/reop/files/reop-2.1.1-bcrypt_hash-cdata-sizeof.patch
index d418740d3d..95d8690d8c 100644
--- a/app-crypt/reop/files/reop-2.1.1-bcrypt_hash-cdata-sizeof.patch
+++ b/app-crypt/reop/files/reop-2.1.1-bcrypt_hash-cdata-sizeof.patch
@@ -1,11 +1,29 @@
+From 04a2240bd8f465bcae6b595d912af3e2965856de Mon Sep 17 00:00:00 2001
+From: millert <millert@openbsd.org>
+Date: Thu, 9 Jul 2020 19:17:19 +0000
+Subject: [PATCH] Fix a warning false positive from clang 10. blf_enc() takes a
+ number of 64-bit blocks to encrypt, but using sizeof(uint64_t) in the
+ calculation triggers a warning from clang 10 because the actual data type is
+ uint32_t.  Pass BCRYPT_WORDS / 2 for the number of blocks like libc bcrypt(3)
+ does.  OK kettenis@
+
+
+---
+Haelwenn (lanodan) Monnier: Substituted BCRYPT_WORDS for 8, removed $OpenBSD$ hunk
+
+ sys/lib/libsa/bcrypt_pbkdf.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sys/lib/libsa/bcrypt_pbkdf.c b/sys/lib/libsa/bcrypt_pbkdf.c
+index 4020ada74a43..df0e34c4e46d 100644
 --- a/other/other.c
 +++ b/other/other.c
-@@ -659,7 +659,7 @@ bcrypt_hash(u_int8_t *sha2pass, u_int8_t *sha2salt, u_int8_t *out)
+@@ -76,7 +76,7 @@ bcrypt_hash(uint8_t *sha2pass, uint8_t *sha2salt, uint8_t *out)
  		cdata[i] = Blowfish_stream2word(ciphertext, sizeof(ciphertext),
  		    &j);
  	for (i = 0; i < 64; i++)
 -		blf_enc(&state, cdata, sizeof(cdata) / sizeof(uint64_t));
-+		blf_enc(&state, cdata, sizeof(cdata) / sizeof(uint32_t));
++		blf_enc(&state, cdata, 8 / 2);
  
  	/* copy out */
- 	for (i = 0; i < BCRYPT_BLOCKS; i++) {
+ 	for (i = 0; i < BCRYPT_WORDS; i++) {

diff --git a/app-crypt/reop/reop-2.1.1-r1.ebuild b/app-crypt/reop/reop-2.1.1-r2.ebuild
similarity index 100%
rename from app-crypt/reop/reop-2.1.1-r1.ebuild
rename to app-crypt/reop/reop-2.1.1-r2.ebuild


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-31 22:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-31 22:49 [gentoo-commits] repo/proj/guru:dev commit in: app-crypt/reop/, app-crypt/reop/files/ Haelwenn Monnier
  -- strict thread matches above, loose matches on Subject: below --
2024-07-10 23:52 Haelwenn Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox