OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Copyright (C) 2009 The Android Open Source Project | 3 # Copyright (C) 2009 The Android Open Source Project |
4 # | 4 # |
5 # Licensed under the Apache License, Version 2.0 (the "License"); | 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
6 # you may not use this file except in compliance with the License. | 6 # you may not use this file except in compliance with the License. |
7 # You may obtain a copy of the License at | 7 # You may obtain a copy of the License at |
8 # | 8 # |
9 # http://www.apache.org/licenses/LICENSE-2.0 | 9 # http://www.apache.org/licenses/LICENSE-2.0 |
10 # | 10 # |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 # $1: generator path (perl script) | 111 # $1: generator path (perl script) |
112 # $2: optional output file name. | 112 # $2: optional output file name. |
113 function default_asm_file () { | 113 function default_asm_file () { |
114 if [ "$2" ]; then | 114 if [ "$2" ]; then |
115 echo "$2" | 115 echo "$2" |
116 else | 116 else |
117 echo "${1%%.pl}.S" | 117 echo "${1%%.pl}.S" |
118 fi | 118 fi |
119 } | 119 } |
120 | 120 |
| 121 function default_asm_mac_ia32_file () { |
| 122 if [ "$2" ]; then |
| 123 echo "$2" |
| 124 else |
| 125 echo "${1%%.pl}-mac.S" |
| 126 fi |
| 127 } |
121 # Generate an ARM assembly file. | 128 # Generate an ARM assembly file. |
122 # $1: generator (perl script) | 129 # $1: generator (perl script) |
123 # $2: [optional] output file name | 130 # $2: [optional] output file name |
124 function gen_asm_arm () { | 131 function gen_asm_arm () { |
125 local OUT | 132 local OUT |
126 OUT=$(default_asm_file "$@") | 133 OUT=$(default_asm_file "$@") |
127 perl "$1" > "$OUT" | 134 perl "$1" > "$OUT" |
128 } | 135 } |
129 | 136 |
130 function gen_asm_mips () { | 137 function gen_asm_mips () { |
(...skipping 10 matching lines...) Expand all Loading... |
141 OUT=$(default_asm_file "$@") | 148 OUT=$(default_asm_file "$@") |
142 perl "$1" elf -fPIC > "$OUT" | 149 perl "$1" elf -fPIC > "$OUT" |
143 } | 150 } |
144 | 151 |
145 function gen_asm_x86_64 () { | 152 function gen_asm_x86_64 () { |
146 local OUT | 153 local OUT |
147 OUT=$(default_asm_file "$@") | 154 OUT=$(default_asm_file "$@") |
148 perl "$1" elf "$OUT" > "$OUT" | 155 perl "$1" elf "$OUT" > "$OUT" |
149 } | 156 } |
150 | 157 |
| 158 function gen_asm_mac_ia32 () { |
| 159 local OUT |
| 160 OUT=$(default_asm_mac_ia32_file "$@") |
| 161 perl "$1" macosx "$OUT" > "$OUT" |
| 162 } |
151 | 163 |
152 # Filter all items in a list that match a given pattern. | 164 # Filter all items in a list that match a given pattern. |
153 # $1: space-separated list | 165 # $1: space-separated list |
154 # $2: egrep pattern. | 166 # $2: egrep pattern. |
155 # Out: items in $1 that match $2 | 167 # Out: items in $1 that match $2 |
156 function filter_by_egrep() { | 168 function filter_by_egrep() { |
157 declare -r pattern=$1 | 169 declare -r pattern=$1 |
158 shift | 170 shift |
159 echo "$@" | tr ' ' '\n' | grep -e "$pattern" | tr '\n' ' ' | 171 echo "$@" | tr ' ' '\n' | grep -e "$pattern" | tr '\n' ' ' |
160 } | 172 } |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 gen_asm_x86_64 crypto/aes/asm/aes-x86_64.pl | 420 gen_asm_x86_64 crypto/aes/asm/aes-x86_64.pl |
409 gen_asm_x86_64 crypto/aes/asm/aesni-sha1-x86_64.pl | 421 gen_asm_x86_64 crypto/aes/asm/aesni-sha1-x86_64.pl |
410 gen_asm_x86_64 crypto/md5/asm/md5-x86_64.pl | 422 gen_asm_x86_64 crypto/md5/asm/md5-x86_64.pl |
411 gen_asm_x86_64 crypto/bn/asm/modexp512-x86_64.pl | 423 gen_asm_x86_64 crypto/bn/asm/modexp512-x86_64.pl |
412 gen_asm_x86_64 crypto/bn/asm/x86_64-mont.pl | 424 gen_asm_x86_64 crypto/bn/asm/x86_64-mont.pl |
413 gen_asm_x86_64 crypto/bn/asm/x86_64-gf2m.pl | 425 gen_asm_x86_64 crypto/bn/asm/x86_64-gf2m.pl |
414 gen_asm_x86_64 crypto/bn/asm/x86_64-mont5.pl | 426 gen_asm_x86_64 crypto/bn/asm/x86_64-mont5.pl |
415 gen_asm_x86_64 crypto/rc4/asm/rc4-x86_64.pl | 427 gen_asm_x86_64 crypto/rc4/asm/rc4-x86_64.pl |
416 gen_asm_x86_64 crypto/rc4/asm/rc4-md5-x86_64.pl | 428 gen_asm_x86_64 crypto/rc4/asm/rc4-md5-x86_64.pl |
417 | 429 |
| 430 # Generate mac_ia32 asm |
| 431 gen_asm_mac_ia32 crypto/x86cpuid.pl |
| 432 gen_asm_mac_ia32 crypto/aes/asm/aes-586.pl |
| 433 gen_asm_mac_ia32 crypto/aes/asm/vpaes-x86.pl |
| 434 gen_asm_mac_ia32 crypto/aes/asm/aesni-x86.pl |
| 435 gen_asm_mac_ia32 crypto/bn/asm/bn-586.pl |
| 436 gen_asm_mac_ia32 crypto/bn/asm/co-586.pl |
| 437 gen_asm_mac_ia32 crypto/bn/asm/x86-mont.pl |
| 438 gen_asm_mac_ia32 crypto/bn/asm/x86-gf2m.pl |
| 439 gen_asm_mac_ia32 crypto/modes/asm/ghash-x86.pl |
| 440 gen_asm_mac_ia32 crypto/sha/asm/sha1-586.pl |
| 441 gen_asm_mac_ia32 crypto/sha/asm/sha256-586.pl |
| 442 gen_asm_mac_ia32 crypto/sha/asm/sha512-586.pl |
| 443 gen_asm_mac_ia32 crypto/md5/asm/md5-586.pl |
| 444 gen_asm_mac_ia32 crypto/des/asm/des-586.pl |
| 445 gen_asm_mac_ia32 crypto/des/asm/crypt586.pl |
| 446 gen_asm_mac_ia32 crypto/bf/asm/bf-586.pl |
| 447 |
418 # Setup android.testssl directory | 448 # Setup android.testssl directory |
419 mkdir android.testssl | 449 mkdir android.testssl |
420 cat test/testssl | \ | 450 cat test/testssl | \ |
421 sed 's#../util/shlib_wrap.sh ./ssltest#adb shell /system/bin/ssltest#' | \ | 451 sed 's#../util/shlib_wrap.sh ./ssltest#adb shell /system/bin/ssltest#' | \ |
422 sed 's#../util/shlib_wrap.sh ../apps/openssl#adb shell /system/bin/openssl#'
| \ | 452 sed 's#../util/shlib_wrap.sh ../apps/openssl#adb shell /system/bin/openssl#'
| \ |
423 sed 's#adb shell /system/bin/openssl no-dh#[ `adb shell /system/bin/openssl
no-dh` = no-dh ]#' | \ | 453 sed 's#adb shell /system/bin/openssl no-dh#[ `adb shell /system/bin/openssl
no-dh` = no-dh ]#' | \ |
424 sed 's#adb shell /system/bin/openssl no-rsa#[ `adb shell /system/bin/openssl
no-rsa` = no-dh ]#' | \ | 454 sed 's#adb shell /system/bin/openssl no-rsa#[ `adb shell /system/bin/openssl
no-rsa` = no-dh ]#' | \ |
425 sed 's#../apps/server2.pem#/sdcard/android.testssl/server2.pem#' | \ | 455 sed 's#../apps/server2.pem#/sdcard/android.testssl/server2.pem#' | \ |
426 cat > \ | 456 cat > \ |
427 android.testssl/testssl | 457 android.testssl/testssl |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 rm -f $patch | 585 rm -f $patch |
556 touch $patch | 586 touch $patch |
557 for i in $sources; do | 587 for i in $sources; do |
558 LC_ALL=C TZ=UTC0 diff -aup $OPENSSL_DIR_ORIG/$i $OPENSSL_DIR/$i >> $patch &&
die "ERROR: No diff for patch $path in file $i" | 588 LC_ALL=C TZ=UTC0 diff -aup $OPENSSL_DIR_ORIG/$i $OPENSSL_DIR/$i >> $patch &&
die "ERROR: No diff for patch $path in file $i" |
559 done | 589 done |
560 echo "Generated patch $patch" | 590 echo "Generated patch $patch" |
561 echo "NOTE To make sure there are not unwanted changes from conflicting patche
s, be sure to review the generated patch." | 591 echo "NOTE To make sure there are not unwanted changes from conflicting patche
s, be sure to review the generated patch." |
562 } | 592 } |
563 | 593 |
564 main $@ | 594 main $@ |
OLD | NEW |