blob: 2b6c07f235bc8600e11e95e639ffe892f43ae506 [file] [log] [blame]
Brian Carlstrom8113f6d2010-06-17 16:46:35 -07001Bouncy Castle on the Android platform.
2---
3
4The code in this directory is based on $BOUNCYCASTLE_VERSION in the
Adam Vartanian8ba9ca52017-10-20 12:18:11 +01005file bouncycastle.version. See the in-file change markers for more information
6on how the code differs from $BOUNCYCASTLE_VERSION.
Brian Carlstrom8113f6d2010-06-17 16:46:35 -07007
8Porting New Versions of Bouncy Castle.
9--
10
11The following steps are recommended for porting new Bouncy Castle versions.
12
131) Retrieve the appropriate version of the Bouncy Castle source from
Brian Carlstrome6bf3e82012-09-17 16:04:47 -070014 www.bouncycastle.org/latest_releases.html (both bcprov-jdk*-*.tar.gz
15 and bcpkix-jdk*-*.tar.gz files).
16
17 Check the checksum (found at http://bouncycastle.org/checksums.html) with:
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070018
19 md5sum bcprov-jdk*-*.tar.gz
20 sha1sum bcprov-jdk*-*.tar.gz
Brian Carlstrome6bf3e82012-09-17 16:04:47 -070021 md5sum bcpkix-jdk*-*.tar.gz
22 sha1sum bcpkix-jdk*-*.tar.gz
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070023
Adam Vartanian8ba9ca52017-10-20 12:18:11 +0100242) Submit the code to the upstream-master branch:
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070025
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010026 a) Create a new branch tracking upstream-master
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070027
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010028 git checkout -b upgrade-to-xxx --track aosp/upstream-master
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070029
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010030 b) Update the variables in bouncycastle.version.
Brian Carlstrome6bf3e82012-09-17 16:04:47 -070031
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010032 c) Expand the source from the .tar.gz files
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070033
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010034 d) Replace bc{prov,pkix}/src/main/java/org with the equivalent source
35 directory
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070036
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010037 e) Ensure any new files are added
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070038
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010039 git add bc{prov,pkix}
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070040
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010041 f) Commit the change
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070042
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010043 git commit -a -m 'bouncycastle: Android tree with upstream code for version X.XX'
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070044
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010045 g) Get the change reviewed
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070046
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010047 repo upload . -D upstream-master
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070048
Adam Vartanian8ba9ca52017-10-20 12:18:11 +0100493) Merge the code into the master branch
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070050
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010051 a) Create a new branch
Brian Carlstrom517da5b2012-09-14 00:21:37 -070052
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010053 repo start merge-xxx
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070054
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010055 b) Merge the changes in
Brian Carlstrom8113f6d2010-06-17 16:46:35 -070056
Adam Vartanian8ba9ca52017-10-20 12:18:11 +010057 git fetch aosp upstream-master
58 git merge aosp/upstream-master
59
60 c) Resolve any conflicts. Some common cases:
61
62 * If upstream changed a file that's deleted locally, we probably don't
63 need it
64 * If upstream added a file to a directory we deleted, we probably don't
65 need it
66
67 d) Confirm all changes
68
69 git diff aosp/master
70
71 e) Run the tests, commonly at least
72
73 cts -m CtsLibcoreTestCases
74 cts -m CtsLibcoreFileIOTestCases
75 cts -m CtsLibcoreJsr166TestCases
76 cts -m CtsLibcoreOjTestCases
77 cts -m CtsLibcoreOkHttpTestCases
78 cts -m CtsLibcoreWycheproofBCTestCases
79
80 e) Get the change reviewed
81
82 repo upload .