Skip to content

Commit f606833

Browse files
committed
Added recent openssl commit which allows older platforms e.g. centos-6 to build
Without this change many assembler errors are produced due to insufficient detection of SHA512 Extensions availability. Issue: openssl/openssl#28463 Fix commit: openssl/openssl@241d482 Changelog: none Ticket: ENT-13491 (cherry picked from commit 91c96af)
1 parent 6cf2f5a commit f606833

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
commit 241d4826f8ee39c92d9b3233146c3e12314871ec
2+
Author: rainerjung <[email protected]>
3+
Date: Tue Sep 9 00:10:40 2025 +0200
4+
5+
Update sha512-x86_64.pl
6+
7+
Do not use new assembler code for CPUs with SHA512 support in case the assembler only supports avx but not avx2.
8+
9+
Reviewed-by: Shane Lontis <[email protected]>
10+
Reviewed-by: Paul Dale <[email protected]>
11+
(Merged from https://github.com/openssl/openssl/pull/28488)
12+
13+
diff --git a/crypto/sha/asm/sha512-x86_64.pl b/crypto/sha/asm/sha512-x86_64.pl
14+
index cdc585c..029468d 100755
15+
--- a/crypto/sha/asm/sha512-x86_64.pl
16+
+++ b/crypto/sha/asm/sha512-x86_64.pl
17+
@@ -574,7 +574,9 @@ $TABLE:
18+
.quad 0x0001020304050607,0x08090a0b0c0d0e0f
19+
.quad 0x0001020304050607,0x08090a0b0c0d0e0f
20+
.asciz "SHA512 block transform for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
21+
+___
22+
23+
+$code.=<<___ if ($avx>1);
24+
# $K512 duplicates data every 16 bytes.
25+
# The Intel(R) SHA512 implementation requires reads of 32 consecutive bytes.
26+
.align 64
27+
@@ -620,6 +622,8 @@ ${TABLE}_single:
28+
.quad 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c
29+
.quad 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a
30+
.quad 0x5fcb6fab3ad6faec, 0x6c44198c4a475817
31+
+___
32+
+$code.=<<___;
33+
.previous
34+
___
35+
}
36+
@@ -2379,7 +2383,7 @@ ___
37+
}}
38+
}}}}}
39+
40+
-if ($SZ==8) {
41+
+if ($SZ==8 && $avx>1) {
42+
$code.=<<___;
43+
.type ${func}_sha512ext,\@function,3
44+
.align 64

deps-packaging/openssl/cfbuild-openssl.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Release: 1
77
Source0: openssl-%{openssl_version}.tar.gz
88
Patch0: 0006-Add-latomic-on-AIX-7.patch
99
Patch1: 0008-Define-_XOPEN_SOURCE_EXTENDED-as-1.patch
10+
Patch2: 0010-Update-sha512-x86_64-pl.patch
1011
License: MIT
1112
Group: Other
1213
Url: https://cfengine.com
@@ -22,6 +23,7 @@ mkdir -p %{_builddir}
2223

2324
%patch0 -p1
2425
%patch1 -p1
26+
%patch2 -p1
2527

2628
%build
2729

0 commit comments

Comments
 (0)