Skip to content

Commit f71ed63

Browse files
Merge pull request #73 from cconlon/releasePrep
Release prep and fixes for 1.8.0
2 parents 7f89200 + a4f1447 commit f71ed63

25 files changed

Lines changed: 910 additions & 291 deletions

IDE/Android/.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/.idea/gradle.xml

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/.idea/jarRepositories.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/.idea/runConfigurations.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

IDE/Android/README.md

Lines changed: 79 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,43 @@
1-
This is an example of use with Android Studio.
1+
# Android Studio Example Project
22

3-
An emulation of Nexus 4 API 23 (Android 6.0, API 23) was used with testing and Android Studio IDE version 3.3.2 was used.
3+
This is an example Android Studio project file for wolfssljni / wolfJSSE. This
4+
project should be used for reference only.
45

5-
Steps to run example:
6+
Tool and version information used when testing this project:
67

7-
1) On the Android device BKS format key stores are expected. To convert the JKS example bundles to BKS use the following commands:
8+
- Ubuntu 20.04.3 LTS
9+
- Android Studio Arctic Fox 2020.3.1 Patch 3
10+
- Android Gradle Plugin Version: 4.2.2
11+
- Gradle Version: 6.9.1
12+
- API 28: Android 9.0 (Pie)
13+
- Emulator: Nexus 5X API 28
14+
15+
The following sections outline steps required to run this example on an
16+
Android device or emulator.
17+
18+
## Converting JKS to BKS for Android Use
19+
20+
On the Android device BKS format key stores are expected. To convert the
21+
JKS example bundles to BKS use the following commands. Note: you will need
22+
to download a version of the bcprov JAR from the Bouncy Castle website:
823

924
```
1025
cd examples/provider
1126
./convert-to-bks.sh <path/to/provider>
27+
```
1228

13-
exmaple:
29+
For exmaple, when using bcprov-ext-jdk15on-169.jar:
30+
31+
```
1432
cd examples/provider
15-
./convert-to-bks.sh ~/Downloads/bcprov-jdk15on-161.jar
33+
./convert-to-bks.sh ~/Downloads/bcprov-ext-jdk15on-169.jar
1634
```
1735

18-
2) Push BKS bundles up to the device along with certificates. To do this start up the emulator/device and use "adb push". An example of this would be the following commands from root wolfssljni directory:
36+
## Push BKS to Android Device or Emulator
37+
38+
Push BKS bundles up to the device along with certificates. To do this start
39+
up the emulator/device and use `adb push`. An example of this would be the
40+
following commands from root wolfssljni directory:
1941

2042
```
2143
adb shell
@@ -28,10 +50,56 @@ adb push ./examples/provider/*.bks /sdcard/examples/provider/
2850
adb push ./examples/certs/ /sdcard/examples/
2951
```
3052

31-
3) Add wolfssl source code for compiling. The project looks for the directory wolfssljni/IDE/Android/app/src/main/cpp/wolfssl for wolfSSL source code. This can be done multiple ways one being to download the latest release from wolfSSL's website, unzip it, rename it to wolfssl, and place it in the direcotry wolfssljni/IDE/Android/app/src/main/cpp/. Alternatively GitHub can be used with "cd /IDE/Android/app/src/main/cpp/ && git clone https://github.com/wolfssl/wolfssl". And the final method to be mentioned in this document is by creating a symbolic link to a wolfssl directory on the system by using "cd /IDE/Android/app/src/main/cpp/ && ln -s /path/to/local/wolfssl ./wolfssl".
53+
## Add Native wolfSSL Library Source Code to Project
54+
55+
This example project is already set up to compile and build the native
56+
wolfSSL library source files, but the wolfSSL files themselves have not been
57+
included in this package. You must download or link an appropriate version
58+
of wolfSSL to this project using one of the options below.
59+
60+
The project looks for the directory
61+
`wolfssljni/IDE/Android/app/src/main/cpp/wolfssl` for wolfSSL source code.
62+
This can added in multiple ways:
63+
64+
- OPTION A: Download the latest wolfSSL library release from www.wolfssl.com,
65+
unzip it, rename it to `wolfssl`, and place it in the direcotry
66+
`wolfssljni/IDE/Android/app/src/main/cpp/`.
67+
68+
```
69+
$ unzip wolfssl-X.X.X.zip
70+
$ mv wolfssl-X.X.X wolfssljni/IDE/Android/app/src/main/cpp/wolfssl
71+
```
72+
73+
- OPTION B: Alternatively GitHub can be used to clone wolfSSL:
74+
75+
```
76+
$ cd /IDE/Android/app/src/main/cpp/
77+
$ git clone https://github.com/wolfssl/wolfssl
78+
$ cp wolfssl/options.h.in wolfssl/options.h
79+
```
80+
81+
- OPTION C: A symbolic link to a wolfssl directory on the system by using:
82+
83+
```
84+
$ cd /IDE/Android/app/src/main/cpp/
85+
$ ln -s /path/to/local/wolfssl ./wolfssl
86+
```
87+
88+
## Importing and Building the Example Project with Android Studio
89+
90+
4) Open the Android Studio project by double clicking on the `Android` folder
91+
in wolfssljni/IDE/
92+
93+
5) Build the project and run MainActivity from app -> java/com/example.wolfssl.
94+
This will ask for permissions to access the certificates in the /sdcard/
95+
directory and then print out the server certificate information on success.
96+
97+
6) OPTIONAL: The androidTests can be run after permissions has been given.
98+
app->java->com.wolfssl->provider.jsse.test->WolfSSLJSSETestSuite and
99+
app->java->com.wolfssl->test->WolfSSLTestSuite
32100

33-
4) Open the Android studio project by double clicking on the Android folder in wolfssljni/IDE/
101+
## Support
34102

35-
5) Compile the project and run MainActivity from app -> java -> com -> example.wolfssl. This will ask for permissions to access the certificates in the /sdcard/ directory and then print out the server certificate information on success.
103+
Please contact wolfSSL support at support@wolfssl.com with any questions or
104+
feedback.
36105

37-
6) OPTIONAL : The androidTests can then be ran after permissions has been given. app->java->com.wolfssl->provider.jsse.test->WolfSSLJSSETestSuite and app->java->com.wolfssl->test->WolfSSLTestSuite

IDE/Android/app/src/main/cpp/CMakeLists.txt

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@
66
cmake_minimum_required(VERSION 3.4.1)
77

88
# Add preprocessor defines to CFLAGS
9-
add_definitions(-DWOLFSSL_JNI -DWOLFSSL_DTLS -DOPENSSL_EXTRA -DHAVE_CRL -DHAVE_CRL_MONITOR
10-
-DHAVE_OCSP -DPERSIST_SESSION_CACHE -DPERSIST_CERT_CACHE -DATOMIC_USER
11-
-DHAVE_ECC -DTFM_ECC256 -DHAVE_PK_CALLBACKS -DHAVE_DH -DUSE_FAST_MATH
12-
-DTFM_TIMING_RESISTANT -DECC_TIMING_RESISTANT -DWC_RSA_BLINDING -DTFM_NO_ASM
13-
-DWOLFSSL_USER_IO -DWOLFSSL_CERT_EXT -DWOLFSSL_CERT_GEN
14-
)
9+
add_definitions(-DHAVE_FFDHE_2048 -DWOLFSSL_TLS13 -DHAVE_TLS_EXTENSIONS -DHAVE_SUPPORTED_CURVES
10+
-DTFM_TIMING_RESISTANT -DECC_TIMING_RESISTANT -DWC_RSA_BLINDING -DHAVE_AESGCM
11+
-DWOLFSSL_SHA512 -DWOLFSSL_SHA384 -DHAVE_HKDF -DNO_DSA -DHAVE_ECC -DTFM_ECC256
12+
-DECC_SHAMIR -DWC_RSA_PSS -DWOLFSSL_BASE64_ENCODE -DNO_RC4 -DNO_HC128 -DNO_RABBIT
13+
-DWOLFSSL_SHA224 -DWOLFSSL_SHA3 -DHAVE_POLY1305 -DHAVE_ONE_TIME_AUTH -DHAVE_CHACHA
14+
-DHAVE_HASHDRBG -DHAVE_TLS_EXTENSIONS -DHAVE_SUPPORTED_CURVES -DHAVE_EXTENDED_MASTER
15+
-DHAVE_SNI -DHAVE_ALPN -DWOLFSSL_JNI -DWOLFSSL_DTLS -DOPENSSL_EXTRA -DOPENSSL_ALL
16+
-DHAVE_EX_DATA -DHAVE_CRL -DHAVE_OCSP -DHAVE_CRL_MONITOR -DPERSIST_SESSION_CACHE
17+
-DPERSIST_CERT_CACHE -DATOMIC_USER -DHAVE_PK_CALLBACKS -DWOLFSSL_CERT_EXT -DWOLFSSL_CERT_GEN
18+
-DHAVE_ENCRYPT_THEN_MAC -DNO_MD4 -DWOLFSSL_ENCRYPTED_KEYS -DUSE_FAST_MATH -DNO_DES3
19+
-DKEEP_PEER_CERT -DSESSION_CERTS -DHAVE_SESSION_TICKET -DSIZEOF_LONG=4 -DSIZEOF_LONG_LONG=8
20+
-DTFM_NO_ASM)
1521

1622
# set wolfSSL JNI location as environment variable, change if needed
1723
set(wolfssljni_DIR ${CMAKE_SOURCE_DIR}/../../../../../../)
@@ -31,30 +37,38 @@ add_library(wolfssl SHARED
3137
${wolfssl_DIR}/wolfcrypt/src/asm.c
3238
${wolfssl_DIR}/wolfcrypt/src/asn.c
3339
${wolfssl_DIR}/wolfcrypt/src/blake2b.c
40+
${wolfssl_DIR}/wolfcrypt/src/blake2s.c
3441
${wolfssl_DIR}/wolfcrypt/src/camellia.c
3542
${wolfssl_DIR}/wolfcrypt/src/chacha.c
3643
${wolfssl_DIR}/wolfcrypt/src/chacha20_poly1305.c
3744
${wolfssl_DIR}/wolfcrypt/src/cmac.c
3845
${wolfssl_DIR}/wolfcrypt/src/coding.c
3946
${wolfssl_DIR}/wolfcrypt/src/compress.c
4047
${wolfssl_DIR}/wolfcrypt/src/cpuid.c
48+
${wolfssl_DIR}/wolfcrypt/src/cryptocb.c
4149
${wolfssl_DIR}/wolfcrypt/src/curve25519.c
50+
${wolfssl_DIR}/wolfcrypt/src/curve448.c
4251
${wolfssl_DIR}/wolfcrypt/src/des3.c
4352
${wolfssl_DIR}/wolfcrypt/src/dh.c
4453
${wolfssl_DIR}/wolfcrypt/src/dsa.c
4554
${wolfssl_DIR}/wolfcrypt/src/ecc.c
4655
${wolfssl_DIR}/wolfcrypt/src/ecc_fp.c
56+
${wolfssl_DIR}/wolfcrypt/src/eccsi.c
4757
${wolfssl_DIR}/wolfcrypt/src/ed25519.c
58+
${wolfssl_DIR}/wolfcrypt/src/ed448.c
4859
${wolfssl_DIR}/wolfcrypt/src/error.c
60+
${wolfssl_DIR}/wolfcrypt/src/fe_448.c
4961
${wolfssl_DIR}/wolfcrypt/src/fe_low_mem.c
5062
${wolfssl_DIR}/wolfcrypt/src/fe_operations.c
63+
${wolfssl_DIR}/wolfcrypt/src/ge_448.c
5164
${wolfssl_DIR}/wolfcrypt/src/ge_low_mem.c
5265
${wolfssl_DIR}/wolfcrypt/src/ge_operations.c
5366
${wolfssl_DIR}/wolfcrypt/src/hash.c
5467
${wolfssl_DIR}/wolfcrypt/src/hc128.c
5568
${wolfssl_DIR}/wolfcrypt/src/hmac.c
5669
${wolfssl_DIR}/wolfcrypt/src/idea.c
5770
${wolfssl_DIR}/wolfcrypt/src/integer.c
71+
${wolfssl_DIR}/wolfcrypt/src/kdf.c
5872
${wolfssl_DIR}/wolfcrypt/src/logging.c
5973
${wolfssl_DIR}/wolfcrypt/src/md2.c
6074
${wolfssl_DIR}/wolfcrypt/src/md4.c
@@ -66,28 +80,41 @@ add_library(wolfssl SHARED
6680
${wolfssl_DIR}/wolfcrypt/src/pwdbased.c
6781
${wolfssl_DIR}/wolfcrypt/src/rabbit.c
6882
${wolfssl_DIR}/wolfcrypt/src/random.c
83+
${wolfssl_DIR}/wolfcrypt/src/rc2.c
6984
${wolfssl_DIR}/wolfcrypt/src/ripemd.c
7085
${wolfssl_DIR}/wolfcrypt/src/rsa.c
71-
${wolfssl_DIR}/wolfcrypt/src/sha.c
86+
${wolfssl_DIR}/wolfcrypt/src/sakke.c
7287
${wolfssl_DIR}/wolfcrypt/src/sha256.c
7388
${wolfssl_DIR}/wolfcrypt/src/sha3.c
7489
${wolfssl_DIR}/wolfcrypt/src/sha512.c
90+
${wolfssl_DIR}/wolfcrypt/src/sha.c
7591
${wolfssl_DIR}/wolfcrypt/src/signature.c
92+
${wolfssl_DIR}/wolfcrypt/src/sp_arm32.c
93+
${wolfssl_DIR}/wolfcrypt/src/sp_arm64.c
94+
${wolfssl_DIR}/wolfcrypt/src/sp_armthumb.c
95+
${wolfssl_DIR}/wolfcrypt/src/sp_c32.c
96+
${wolfssl_DIR}/wolfcrypt/src/sp_c64.c
97+
${wolfssl_DIR}/wolfcrypt/src/sp_cortexm.c
98+
${wolfssl_DIR}/wolfcrypt/src/sp_dsp32.c
99+
${wolfssl_DIR}/wolfcrypt/src/sp_int.c
100+
${wolfssl_DIR}/wolfcrypt/src/sp_x86_64.c
76101
${wolfssl_DIR}/wolfcrypt/src/srp.c
77102
${wolfssl_DIR}/wolfcrypt/src/tfm.c
103+
${wolfssl_DIR}/wolfcrypt/src/wc_dsp.c
78104
${wolfssl_DIR}/wolfcrypt/src/wc_encrypt.c
105+
${wolfssl_DIR}/wolfcrypt/src/wc_pkcs11.c
79106
${wolfssl_DIR}/wolfcrypt/src/wc_port.c
80107
${wolfssl_DIR}/wolfcrypt/src/wolfevent.c
81108
${wolfssl_DIR}/wolfcrypt/src/wolfmath.c
82109
${wolfssl_DIR}/src/crl.c
83110
${wolfssl_DIR}/src/internal.c
84-
${wolfssl_DIR}/src/wolfio.c
85111
${wolfssl_DIR}/src/keys.c
86112
${wolfssl_DIR}/src/ocsp.c
87113
${wolfssl_DIR}/src/sniffer.c
88114
${wolfssl_DIR}/src/ssl.c
89-
${wolfssl_DIR}/src/tls.c
90115
${wolfssl_DIR}/src/tls13.c
116+
${wolfssl_DIR}/src/tls.c
117+
${wolfssl_DIR}/src/wolfio.c
91118
)
92119

93120
# set_target_properties(wolfssl PROPERTIES LIBRARY_OUTPUT_DIRECTORY
@@ -97,12 +124,14 @@ add_library(wolfssl SHARED
97124
# wolfSSL JNI Java files are tied into build in Module build.gradle file
98125
add_library(wolfssljni SHARED
99126
${wolfssljni_DIR}/native/com_wolfssl_wolfcrypt_ECC.c
127+
${wolfssljni_DIR}/native/com_wolfssl_wolfcrypt_EccKey.c
100128
${wolfssljni_DIR}/native/com_wolfssl_wolfcrypt_RSA.c
101129
${wolfssljni_DIR}/native/com_wolfssl_WolfSSL.c
102-
${wolfssljni_DIR}/native/com_wolfssl_WolfSSLContext.c
103-
${wolfssljni_DIR}/native/com_wolfssl_WolfSSLSession.c
104130
${wolfssljni_DIR}/native/com_wolfssl_WolfSSLCertificate.c
105131
${wolfssljni_DIR}/native/com_wolfssl_WolfSSLCertManager.c
132+
${wolfssljni_DIR}/native/com_wolfssl_WolfSSLContext.c
133+
${wolfssljni_DIR}/native/com_wolfssl_WolfSSLSession.c
134+
${wolfssljni_DIR}/native/com_wolfssl_WolfSSLX509StoreCtx.c
106135
)
107136

108137
# set_target_properties(wolfssljni PROPERTIES LIBRARY_OUTPUT_DIRECTORY

IDE/Android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77

88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.3.2'
10+
classpath 'com.android.tools.build:gradle:4.2.2'
1111

1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Apr 11 15:51:35 MDT 2019
1+
#Thu Nov 04 15:51:08 MDT 2021
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)