diff options
author | miod <> | 2014-05-02 19:59:16 +0000 |
---|---|---|
committer | miod <> | 2014-05-02 19:59:16 +0000 |
commit | 9b91067767652b8b5119230a0a75c4b09267511d (patch) | |
tree | b001363f34bc734a46d4080316ad1c0574f515a3 /src/lib | |
parent | a928011ef8b6701a9f677f7a5f330726c9b7cc2f (diff) | |
download | openbsd-9b91067767652b8b5119230a0a75c4b09267511d.tar.gz openbsd-9b91067767652b8b5119230a0a75c4b09267511d.tar.bz2 openbsd-9b91067767652b8b5119230a0a75c4b09267511d.zip |
The assembly sha512 code detects at runtime if it is running on a 64-bit
processor (PA2.0) and, if so, switches to 64-bit code.
However, when running under a 32-bit OpenBSD/hppa kernel, there is no guarantee
that the upper part of the registers will be preserved accross context switches
(or even userland->kernel boundaries), which causes this code to fail.
Wrap the generated code within #ifndef __OpenBSD__ in that case, to avoid
using the 64-bit code completely. (OpenBSD/hppa64, once stable, will not be
affected by this)
Diffstat (limited to 'src/lib')
-rwxr-xr-x | src/lib/libcrypto/sha/asm/sha512-parisc.pl | 6 | ||||
-rwxr-xr-x | src/lib/libssl/src/crypto/sha/asm/sha512-parisc.pl | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/libcrypto/sha/asm/sha512-parisc.pl b/src/lib/libcrypto/sha/asm/sha512-parisc.pl index 578e3f4daf..4af7731661 100755 --- a/src/lib/libcrypto/sha/asm/sha512-parisc.pl +++ b/src/lib/libcrypto/sha/asm/sha512-parisc.pl | |||
@@ -269,6 +269,9 @@ L\$pic | |||
269 | ldo L\$table-L\$pic($Tbl),$Tbl | 269 | ldo L\$table-L\$pic($Tbl),$Tbl |
270 | ___ | 270 | ___ |
271 | $code.=<<___ if ($SZ==8 && $SIZE_T==4); | 271 | $code.=<<___ if ($SZ==8 && $SIZE_T==4); |
272 | #ifndef __OpenBSD__ | ||
273 | ___ | ||
274 | $code.=<<___ if ($SZ==8 && $SIZE_T==4); | ||
272 | ldi 31,$t1 | 275 | ldi 31,$t1 |
273 | mtctl $t1,%cr11 | 276 | mtctl $t1,%cr11 |
274 | extrd,u,*= $t1,%sar,1,$t1 ; executes on PA-RISC 1.0 | 277 | extrd,u,*= $t1,%sar,1,$t1 ; executes on PA-RISC 1.0 |
@@ -363,6 +366,9 @@ $code.=<<___; | |||
363 | .ALIGN 64 | 366 | .ALIGN 64 |
364 | L\$parisc1 | 367 | L\$parisc1 |
365 | ___ | 368 | ___ |
369 | $code.=<<___ if ($SZ==8 && $SIZE_T==4); | ||
370 | #endif | ||
371 | ___ | ||
366 | 372 | ||
367 | @V=( $Ahi, $Alo, $Bhi, $Blo, $Chi, $Clo, $Dhi, $Dlo, | 373 | @V=( $Ahi, $Alo, $Bhi, $Blo, $Chi, $Clo, $Dhi, $Dlo, |
368 | $Ehi, $Elo, $Fhi, $Flo, $Ghi, $Glo, $Hhi, $Hlo) = | 374 | $Ehi, $Elo, $Fhi, $Flo, $Ghi, $Glo, $Hhi, $Hlo) = |
diff --git a/src/lib/libssl/src/crypto/sha/asm/sha512-parisc.pl b/src/lib/libssl/src/crypto/sha/asm/sha512-parisc.pl index 578e3f4daf..4af7731661 100755 --- a/src/lib/libssl/src/crypto/sha/asm/sha512-parisc.pl +++ b/src/lib/libssl/src/crypto/sha/asm/sha512-parisc.pl | |||
@@ -269,6 +269,9 @@ L\$pic | |||
269 | ldo L\$table-L\$pic($Tbl),$Tbl | 269 | ldo L\$table-L\$pic($Tbl),$Tbl |
270 | ___ | 270 | ___ |
271 | $code.=<<___ if ($SZ==8 && $SIZE_T==4); | 271 | $code.=<<___ if ($SZ==8 && $SIZE_T==4); |
272 | #ifndef __OpenBSD__ | ||
273 | ___ | ||
274 | $code.=<<___ if ($SZ==8 && $SIZE_T==4); | ||
272 | ldi 31,$t1 | 275 | ldi 31,$t1 |
273 | mtctl $t1,%cr11 | 276 | mtctl $t1,%cr11 |
274 | extrd,u,*= $t1,%sar,1,$t1 ; executes on PA-RISC 1.0 | 277 | extrd,u,*= $t1,%sar,1,$t1 ; executes on PA-RISC 1.0 |
@@ -363,6 +366,9 @@ $code.=<<___; | |||
363 | .ALIGN 64 | 366 | .ALIGN 64 |
364 | L\$parisc1 | 367 | L\$parisc1 |
365 | ___ | 368 | ___ |
369 | $code.=<<___ if ($SZ==8 && $SIZE_T==4); | ||
370 | #endif | ||
371 | ___ | ||
366 | 372 | ||
367 | @V=( $Ahi, $Alo, $Bhi, $Blo, $Chi, $Clo, $Dhi, $Dlo, | 373 | @V=( $Ahi, $Alo, $Bhi, $Blo, $Chi, $Clo, $Dhi, $Dlo, |
368 | $Ehi, $Elo, $Fhi, $Flo, $Ghi, $Glo, $Hhi, $Hlo) = | 374 | $Ehi, $Elo, $Fhi, $Flo, $Ghi, $Glo, $Hhi, $Hlo) = |