| 1 | #!/bin/bash |
| 2 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"). |
| 5 | # You may not use this file except in compliance with the License. |
| 6 | # A copy of the License is located at |
| 7 | # |
| 8 | # http://aws.amazon.com/apache2.0 |
| 9 | # |
| 10 | # or in the "license" file accompanying this file. This file is distributed |
| 11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 12 | # express or implied. See the License for the specific language governing |
| 13 | # permissions and limitations under the License. |
| 14 | # |
| 15 | |
| 16 | set -x |
| 17 | set -e |
| 18 | |
| 19 | BASEDIR=$(pwd) |
| 20 | echo $BASEDIR |
| 21 | S2N_BASE="$BASEDIR/../../../.." |
| 22 | echo $S2N_BASE |
| 23 | |
| 24 | cd $BASEDIR |
| 25 | mkdir -p crypto |
| 26 | #The hmac should be based off the old hmac, so just apply the patches to add the invariants |
| 27 | cp $S2N_BASE/crypto/s2n_hmac.c crypto/ |
| 28 | cp $S2N_BASE/crypto/s2n_hmac.h crypto/ |
| 29 | patch -p5 < ../patches/hmac.patch |
| 30 | |
| 31 | #the hash uses my stubs for now, so replace the file |
| 32 | cp stubs/s2n_hash.c crypto/ |
| 33 | cp stubs/s2n_hash.h crypto/ |
| 34 | |
| 35 | mkdir -p error |
| 36 | cp ../stubs/s2n_errno.c error/ |
| 37 | |
| 38 | mkdir -p tls |
| 39 | #add invariants etc needed for the proof to the s2n_cbc code |
| 40 | cp $S2N_BASE/tls/s2n_cbc.c tls/ |
| 41 | patch -p5 < ../patches/cbc.patch |
| 42 | |
| 43 | mkdir -p utils |
| 44 | cp $S2N_BASE/utils/s2n_safety.c utils/ |
| 45 | patch -p1 < ../patches/safety.patch |
| 46 | |
| 47 | cp ../stubs/s2n_annotations.h utils/ |
| 48 | cp ../stubs/s2n_ensure.h utils/ |
| 49 | cp ../stubs/s2n_ensure.c utils/ |