Fix length checks in X509_cmp_time to avoid out-of-bounds reads.
[openssl.git] / crypto / arm64cpuid.pl
1 #!/usr/bin/env perl
2
3 $flavour = shift;
4 $output  = shift;
5
6 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
7 ( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
8 ( $xlate="${dir}perlasm/arm-xlate.pl" and -f $xlate) or
9 die "can't locate arm-xlate.pl";
10
11 open OUT,"| \"$^X\" $xlate $flavour $output";
12 *STDOUT=*OUT;
13
14 $code.=<<___;
15 #include "arm_arch.h"
16
17 .text
18 .arch   armv8-a+crypto
19
20 .align  5
21 .globl  _armv7_neon_probe
22 .type   _armv7_neon_probe,%function
23 _armv7_neon_probe:
24         orr     v15.16b, v15.16b, v15.16b
25         ret
26 .size   _armv7_neon_probe,.-_armv7_neon_probe
27
28 .globl  _armv7_tick
29 .type   _armv7_tick,%function
30 _armv7_tick:
31 #ifdef  __APPLE__
32         mrs     x0, CNTPCT_EL0
33 #else
34         mrs     x0, CNTVCT_EL0
35 #endif
36         ret
37 .size   _armv7_tick,.-_armv7_tick
38
39 .globl  _armv8_aes_probe
40 .type   _armv8_aes_probe,%function
41 _armv8_aes_probe:
42         aese    v0.16b, v0.16b
43         ret
44 .size   _armv8_aes_probe,.-_armv8_aes_probe
45
46 .globl  _armv8_sha1_probe
47 .type   _armv8_sha1_probe,%function
48 _armv8_sha1_probe:
49         sha1h   s0, s0
50         ret
51 .size   _armv8_sha1_probe,.-_armv8_sha1_probe
52
53 .globl  _armv8_sha256_probe
54 .type   _armv8_sha256_probe,%function
55 _armv8_sha256_probe:
56         sha256su0       v0.4s, v0.4s
57         ret
58 .size   _armv8_sha256_probe,.-_armv8_sha256_probe
59 .globl  _armv8_pmull_probe
60 .type   _armv8_pmull_probe,%function
61 _armv8_pmull_probe:
62         pmull   v0.1q, v0.1d, v0.1d
63         ret
64 .size   _armv8_pmull_probe,.-_armv8_pmull_probe
65 ___
66
67 print $code;
68 close STDOUT;