├── .gitignore
├── .idea
└── checkstyle-idea.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── key.keystore
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── github
│ │ └── yutianzuo
│ │ └── myapplication
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── yutianzuo
│ │ │ └── myapplication
│ │ │ ├── BeanTest.java
│ │ │ ├── BizNetWrapper.java
│ │ │ ├── Crypto.java
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── github
│ └── yutianzuo
│ └── myapplication
│ └── ExampleUnitTest.java
├── build.gradle
├── curl_native
├── .gitignore
├── CMakeLists.txt
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── github
│ │ └── yutianzuo
│ │ └── curl_native
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── cacert.pem
│ ├── cpp
│ │ ├── aes_cbc.h
│ │ ├── android_utils.h
│ │ ├── include
│ │ │ ├── curl
│ │ │ │ ├── curl.h
│ │ │ │ ├── curlver.h
│ │ │ │ ├── easy.h
│ │ │ │ ├── mprintf.h
│ │ │ │ ├── multi.h
│ │ │ │ ├── stdcheaders.h
│ │ │ │ ├── system.h
│ │ │ │ └── typecheck-gcc.h
│ │ │ ├── mbedtls
│ │ │ │ ├── aes.h
│ │ │ │ ├── aria.h
│ │ │ │ ├── asn1.h
│ │ │ │ ├── asn1write.h
│ │ │ │ ├── base64.h
│ │ │ │ ├── bignum.h
│ │ │ │ ├── build_info.h
│ │ │ │ ├── camellia.h
│ │ │ │ ├── ccm.h
│ │ │ │ ├── chacha20.h
│ │ │ │ ├── chachapoly.h
│ │ │ │ ├── check_config.h
│ │ │ │ ├── cipher.h
│ │ │ │ ├── cmac.h
│ │ │ │ ├── compat-2.x.h
│ │ │ │ ├── config_psa.h
│ │ │ │ ├── constant_time.h
│ │ │ │ ├── ctr_drbg.h
│ │ │ │ ├── debug.h
│ │ │ │ ├── des.h
│ │ │ │ ├── dhm.h
│ │ │ │ ├── ecdh.h
│ │ │ │ ├── ecdsa.h
│ │ │ │ ├── ecjpake.h
│ │ │ │ ├── ecp.h
│ │ │ │ ├── entropy.h
│ │ │ │ ├── error.h
│ │ │ │ ├── gcm.h
│ │ │ │ ├── hkdf.h
│ │ │ │ ├── hmac_drbg.h
│ │ │ │ ├── legacy_or_psa.h
│ │ │ │ ├── lms.h
│ │ │ │ ├── mbedtls_config.h
│ │ │ │ ├── md.h
│ │ │ │ ├── md5.h
│ │ │ │ ├── memory_buffer_alloc.h
│ │ │ │ ├── net_sockets.h
│ │ │ │ ├── nist_kw.h
│ │ │ │ ├── oid.h
│ │ │ │ ├── pem.h
│ │ │ │ ├── pk.h
│ │ │ │ ├── pkcs12.h
│ │ │ │ ├── pkcs5.h
│ │ │ │ ├── pkcs7.h
│ │ │ │ ├── platform.h
│ │ │ │ ├── platform_time.h
│ │ │ │ ├── platform_util.h
│ │ │ │ ├── poly1305.h
│ │ │ │ ├── private_access.h
│ │ │ │ ├── psa_util.h
│ │ │ │ ├── ripemd160.h
│ │ │ │ ├── rsa.h
│ │ │ │ ├── sha1.h
│ │ │ │ ├── sha256.h
│ │ │ │ ├── sha512.h
│ │ │ │ ├── ssl.h
│ │ │ │ ├── ssl_cache.h
│ │ │ │ ├── ssl_ciphersuites.h
│ │ │ │ ├── ssl_cookie.h
│ │ │ │ ├── ssl_ticket.h
│ │ │ │ ├── threading.h
│ │ │ │ ├── timing.h
│ │ │ │ ├── version.h
│ │ │ │ ├── x509.h
│ │ │ │ ├── x509_crl.h
│ │ │ │ ├── x509_crt.h
│ │ │ │ └── x509_csr.h
│ │ │ ├── openssl
│ │ │ │ ├── aes.h
│ │ │ │ ├── asn1.h
│ │ │ │ ├── asn1_mac.h
│ │ │ │ ├── asn1t.h
│ │ │ │ ├── async.h
│ │ │ │ ├── bio.h
│ │ │ │ ├── blowfish.h
│ │ │ │ ├── bn.h
│ │ │ │ ├── buffer.h
│ │ │ │ ├── camellia.h
│ │ │ │ ├── cast.h
│ │ │ │ ├── cmac.h
│ │ │ │ ├── cms.h
│ │ │ │ ├── comp.h
│ │ │ │ ├── conf.h
│ │ │ │ ├── conf_api.h
│ │ │ │ ├── crypto.h
│ │ │ │ ├── ct.h
│ │ │ │ ├── des.h
│ │ │ │ ├── dh.h
│ │ │ │ ├── dsa.h
│ │ │ │ ├── dtls1.h
│ │ │ │ ├── e_os2.h
│ │ │ │ ├── ebcdic.h
│ │ │ │ ├── ec.h
│ │ │ │ ├── ecdh.h
│ │ │ │ ├── ecdsa.h
│ │ │ │ ├── engine.h
│ │ │ │ ├── err.h
│ │ │ │ ├── evp.h
│ │ │ │ ├── hmac.h
│ │ │ │ ├── idea.h
│ │ │ │ ├── kdf.h
│ │ │ │ ├── lhash.h
│ │ │ │ ├── md2.h
│ │ │ │ ├── md4.h
│ │ │ │ ├── md5.h
│ │ │ │ ├── mdc2.h
│ │ │ │ ├── modes.h
│ │ │ │ ├── obj_mac.h
│ │ │ │ ├── objects.h
│ │ │ │ ├── ocsp.h
│ │ │ │ ├── opensslconf.h
│ │ │ │ ├── opensslv.h
│ │ │ │ ├── ossl_typ.h
│ │ │ │ ├── pem.h
│ │ │ │ ├── pem2.h
│ │ │ │ ├── pkcs12.h
│ │ │ │ ├── pkcs7.h
│ │ │ │ ├── rand.h
│ │ │ │ ├── rc2.h
│ │ │ │ ├── rc4.h
│ │ │ │ ├── rc5.h
│ │ │ │ ├── ripemd.h
│ │ │ │ ├── rsa.h
│ │ │ │ ├── safestack.h
│ │ │ │ ├── seed.h
│ │ │ │ ├── sha.h
│ │ │ │ ├── srp.h
│ │ │ │ ├── srtp.h
│ │ │ │ ├── ssl.h
│ │ │ │ ├── ssl2.h
│ │ │ │ ├── ssl3.h
│ │ │ │ ├── stack.h
│ │ │ │ ├── symhacks.h
│ │ │ │ ├── tls1.h
│ │ │ │ ├── ts.h
│ │ │ │ ├── txt_db.h
│ │ │ │ ├── ui.h
│ │ │ │ ├── whrlpool.h
│ │ │ │ ├── x509.h
│ │ │ │ ├── x509_vfy.h
│ │ │ │ └── x509v3.h
│ │ │ └── psa
│ │ │ │ ├── crypto.h
│ │ │ │ ├── crypto_builtin_composites.h
│ │ │ │ ├── crypto_builtin_primitives.h
│ │ │ │ ├── crypto_compat.h
│ │ │ │ ├── crypto_config.h
│ │ │ │ ├── crypto_driver_common.h
│ │ │ │ ├── crypto_driver_contexts_composites.h
│ │ │ │ ├── crypto_driver_contexts_primitives.h
│ │ │ │ ├── crypto_extra.h
│ │ │ │ ├── crypto_platform.h
│ │ │ │ ├── crypto_se_driver.h
│ │ │ │ ├── crypto_sizes.h
│ │ │ │ ├── crypto_struct.h
│ │ │ │ ├── crypto_types.h
│ │ │ │ └── crypto_values.h
│ │ ├── jni.cpp
│ │ ├── lib
│ │ │ ├── arm64
│ │ │ │ ├── libcrypto.a
│ │ │ │ ├── libcurl.a
│ │ │ │ ├── libmbedcrypto.a
│ │ │ │ ├── libmbedtls.a
│ │ │ │ ├── libmbedx509.a
│ │ │ │ ├── libnghttp2.a
│ │ │ │ └── libssl.a
│ │ │ ├── arm64bak
│ │ │ │ ├── libcrypto.a
│ │ │ │ ├── libcurl.a
│ │ │ │ ├── libmbedcrypto.a
│ │ │ │ ├── libmbedtls.a
│ │ │ │ ├── libmbedx509.a
│ │ │ │ ├── libnghttp2.a
│ │ │ │ └── libssl.a
│ │ │ ├── v7a
│ │ │ │ ├── libcurl.a
│ │ │ │ ├── libmbedcrypto.a
│ │ │ │ ├── libmbedtls.a
│ │ │ │ ├── libmbedx509.a
│ │ │ │ ├── libnghttp2.a
│ │ │ │ └── libssl.a
│ │ │ ├── x86
│ │ │ │ ├── libcrypto.a
│ │ │ │ ├── libcurl.a
│ │ │ │ ├── libcurl.la
│ │ │ │ ├── libssl.a
│ │ │ │ └── pkgconfig
│ │ │ │ │ └── libcurl.pc
│ │ │ └── x86_64
│ │ │ │ ├── libcurl.a
│ │ │ │ ├── libmbedcrypto.a
│ │ │ │ ├── libmbedtls.a
│ │ │ │ ├── libmbedx509.a
│ │ │ │ └── libnghttp2.a
│ │ ├── manager
│ │ │ ├── httpmanager.h
│ │ │ ├── requestmanager.cpp
│ │ │ ├── requestmanager.h
│ │ │ └── threadpool.h
│ │ ├── miscs.h
│ │ ├── request
│ │ │ ├── downloadrequest.h
│ │ │ ├── getrequest.h
│ │ │ ├── postfilerequest.h
│ │ │ ├── postrequest.h
│ │ │ ├── putrequest.h
│ │ │ └── request.h
│ │ ├── sha.h
│ │ ├── string_x.h
│ │ └── tools
│ │ │ └── timeutils.h
│ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── yutianzuo
│ │ │ └── curl_native
│ │ │ ├── HttpCallback.java
│ │ │ ├── HttpManager.java
│ │ │ ├── JniCurl.java
│ │ │ ├── RequestManager.java
│ │ │ └── utils
│ │ │ ├── Misc.java
│ │ │ ├── PriorityThreadFactory.java
│ │ │ ├── ThreadHelper.java
│ │ │ └── ThreadUtils.java
│ └── res
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── github
│ └── yutianzuo
│ └── curl_native
│ └── ExampleUnitTest.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── native_crash_handler
├── .gitignore
├── CMakeLists.txt
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── cpp
│ ├── android_utils.h
│ └── native_crash_handler.cpp
│ └── java
│ └── com
│ └── github
│ └── yutianzuo
│ └── native_crash_handler
│ └── NativeCrashHandler.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /.idea/
4 | /.idea/caches/
5 | /local.properties
6 | /.idea/libraries
7 | /.idea/modules.xml
8 | /.idea/workspace.xml
9 | .DS_Store
10 | /build
11 | /captures
12 | .externalNativeBuild
13 | /app/release/
--------------------------------------------------------------------------------
/.idea/checkstyle-idea.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # android-curl
2 | so支持arm64、x86_64架构,可以在真机或者模拟器上运行。
3 | 编译功能包括curl+mbedtls+nghttp2.
4 | 独立的aar module,可以直接引入项目使用,结合app中的封装demo,可以快速集成进入项目中。
5 | 更多请见文档:https://www.jianshu.com/p/895a4e5052e2
6 |
7 | keywords: android curl jni ndk https http openssl http2.0 libnghttp2 nghttp2
8 |
9 | 关键字:安卓 curl jni ndk https https openssl http2.0 libnghttp2 nghttp2
10 |
11 | -----------------------------------------------------------------
12 |
13 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | signingConfigs {
5 | SignConfig {
6 | keyAlias 'key0'
7 | keyPassword '123456'
8 | storeFile file('key.keystore')
9 | storePassword '123456'
10 | }
11 | }
12 | compileSdkVersion 28
13 | defaultConfig {
14 | applicationId "com.github.yutianzuo.curl"
15 | minSdkVersion 20
16 | targetSdkVersion 20
17 | versionCode 1
18 | versionName "1.0"
19 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
20 | ndk {
21 | abiFilters 'armeabi-v7a', 'arm64-v8a' ,'x86_64'//only 64bit
22 | }
23 | }
24 | buildTypes {
25 | release {
26 | signingConfig signingConfigs.SignConfig
27 | minifyEnabled true
28 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
29 | }
30 | debug {
31 | signingConfig signingConfigs.SignConfig
32 | }
33 | }
34 | buildToolsVersion '28.0.3'
35 | productFlavors {
36 | }
37 | lintOptions {
38 | checkReleaseBuilds false
39 | // Or, if you prefer, you can continue to check for errors in release builds,
40 | // but continue the build even when errors are found:
41 | abortOnError false
42 | }
43 | }
44 | repositories {
45 | flatDir {
46 | dirs 'libs'
47 | }
48 | }
49 |
50 | dependencies {
51 | implementation fileTree(include: ['*.jar'], dir: 'libs')
52 | implementation 'androidx.appcompat:appcompat:1.0.0'
53 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
54 | testImplementation 'junit:junit:4.12'
55 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
56 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
57 | implementation project(':curl_native')
58 | implementation project(':native_crash_handler')
59 | //implementation(name: 'curl_native-release', ext: 'aar')
60 | }
61 |
--------------------------------------------------------------------------------
/app/key.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/key.keystore
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 |
22 |
23 |
24 | -keep class com.github.yutianzuo.curl_native.HttpManager{*;}
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/github/yutianzuo/myapplication/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.github.yutianzuo.myapplication;
2 |
3 | import android.content.Context;
4 | import androidx.test.platform.app.InstrumentationRegistry;
5 | import androidx.test.ext.junit.runners.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.github.yutianzuo.myapplication", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/app/src/main/java/com/github/yutianzuo/myapplication/BeanTest.java:
--------------------------------------------------------------------------------
1 | package com.github.yutianzuo.myapplication;
2 |
3 | import java.io.Serializable;
4 |
5 | public class BeanTest implements Serializable {
6 | public String rep;
7 | }
8 |
--------------------------------------------------------------------------------
/app/src/main/java/com/github/yutianzuo/myapplication/Crypto.java:
--------------------------------------------------------------------------------
1 | package com.github.yutianzuo.myapplication;
2 |
3 | import java.security.MessageDigest;
4 | import java.security.NoSuchAlgorithmException;
5 | import java.util.Base64;
6 |
7 | import javax.crypto.Cipher;
8 | import javax.crypto.SecretKey;
9 | import javax.crypto.spec.IvParameterSpec;
10 | import javax.crypto.spec.SecretKeySpec;
11 |
12 | public class Crypto {
13 | /**
14 | * 传入文本内容,返回 SHA-256 串
15 | */
16 | public String SHA256(final String strText) {
17 | return SHA(strText, "SHA-256");
18 | }
19 |
20 | /**
21 | * 字符串 SHA 加密
22 | */
23 | private String SHA(final String strText, final String strType) {
24 | // 返回值
25 | String strResult = null;
26 |
27 | // 是否是有效字符串
28 | if (strText != null && strText.length() > 0) {
29 | try {
30 | // SHA 加密开始
31 | // 创建加密对象 并傳入加密類型
32 | MessageDigest messageDigest = MessageDigest.getInstance(strType);
33 | // 传入要加密的字符串
34 | messageDigest.update(strText.getBytes());
35 | // 得到 byte 類型结果
36 | byte byteBuffer[] = messageDigest.digest();
37 |
38 | // 將 byte 轉換爲 string
39 | StringBuffer strHexString = new StringBuffer();
40 | // 遍歷 byte buffer
41 | for (int i = 0; i < byteBuffer.length; i++) {
42 | String hex = Integer.toHexString(0xff & byteBuffer[i]);
43 | if (hex.length() == 1) {
44 | strHexString.append('0');
45 | }
46 | strHexString.append(hex);
47 | }
48 | // 得到返回結果
49 | strResult = strHexString.toString();
50 | } catch (NoSuchAlgorithmException e) {
51 | e.printStackTrace();
52 | }
53 | }
54 |
55 | return strResult;
56 | }
57 |
58 | /**
59 | * 传入文本内容,返回 SHA-512 串
60 | */
61 | public String SHA512(final String strText) {
62 | return SHA(strText, "SHA-512");
63 | }
64 |
65 | public byte[] aesEncrypt(String key, String iv, String content) {
66 | byte[] byteRet = null;
67 | try {
68 | SecretKeySpec secretKey = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
69 | byte[] initParam = iv.getBytes("UTF-8");
70 | IvParameterSpec ivParameterSpec = new IvParameterSpec(initParam);
71 | //https://stackoverflow.com/questions/29232705/encrypt-text-to-aes-cbc-pkcs7padding
72 | //Java only provides PKCS#5 padding, but it is the same as PKCS#7 padding. See this question on Crypto.SE:
73 | Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
74 | cipher.init(Cipher.ENCRYPT_MODE, secretKey, ivParameterSpec);
75 | // cipher.update(content.getBytes("UTF-8"));
76 | byteRet = cipher.doFinal(content.getBytes("UTF-8"));
77 | // strRet = Base64.getEncoder().encodeToString(result);
78 | } catch (Throwable e) {
79 |
80 | }
81 | return byteRet;
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
16 |
17 |
24 |
25 |
32 |
33 |
40 |
41 |
48 |
49 |
56 |
57 |
64 |
65 |
66 |
72 |
73 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AndroidCurl
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/github/yutianzuo/myapplication/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.github.yutianzuo.myapplication;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:4.1.1'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/curl_native/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/curl_native/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 28
5 | defaultConfig {
6 | minSdkVersion 20
7 | targetSdkVersion 20
8 | versionCode 1
9 | versionName "1.0"
10 |
11 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
12 |
13 | externalNativeBuild {
14 | cmake {
15 | cppFlags "-std=c++11"
16 | //aar better not use dynamic stl library:https://android.googlesource.com/platform/ndk/+/refs/heads/master/docs/user/middleware_vendors.md
17 | //by default cmake use static stl library
18 | //arguments = ["-DANDROID_STL=c++_shared"]
19 | abiFilters 'arm64-v8a', 'x86_64', 'armeabi-v7a'
20 | }
21 | }
22 | }
23 | buildTypes {
24 | release {
25 | minifyEnabled true
26 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27 | externalNativeBuild {
28 | cmake {
29 | cppFlags "-fvisibility=hidden", "-fno-unwind-tables", "-fno-asynchronous-unwind-tables"
30 | arguments "-DCMAKE_BUILD_TYPE=Release", "-DANDROID_PLATFORM=android-21"
31 | }
32 | }
33 | }
34 | debug {
35 | debuggable false
36 | externalNativeBuild {
37 | cmake {
38 | cppFlags "-fvisibility=hidden", "-fno-unwind-tables", "-fno-asynchronous-unwind-tables"
39 | arguments "-DCMAKE_BUILD_TYPE=Debug", "-DANDROID_PLATFORM=android-21"
40 | }
41 | }
42 | }
43 | }
44 | externalNativeBuild {
45 | cmake {
46 | path "CMakeLists.txt"
47 | }
48 | }
49 | buildToolsVersion '28.0.3'
50 | }
51 |
52 | dependencies {
53 | implementation fileTree(include: ['*.jar'], dir: 'libs')
54 | implementation 'androidx.appcompat:appcompat:1.0.0'
55 | testImplementation 'junit:junit:4.12'
56 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
57 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
58 | }
59 |
--------------------------------------------------------------------------------
/curl_native/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
23 |
24 | -renamesourcefileattribute SourceFile
25 | -dontusemixedcaseclassnames
26 | -keeppackagenames
27 | -dontskipnonpubliclibraryclasses
28 | -dontskipnonpubliclibraryclassmembers
29 | -ignorewarnings
30 | -dontpreverify
31 | -verbose
32 | -keepattributes SourceFile,LineNumberTable
33 | -repackageclasses ''
34 | -keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
35 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
36 | -dontoptimize
37 |
38 | -keep public class * extends android.app.Activity
39 | -keep public class * extends android.app.Application
40 | -keep public class * extends android.app.Service
41 | -keep public class * extends android.content.BroadcastReceiver
42 | -keep public class * extends android.content.ContentProvider
43 |
44 | -dontwarn android.support.v4.**,**CompatHoneycomb,**CompatCreatorHoneycombMR2,org.apache.**
45 |
46 | -keepclasseswithmembernames class * {
47 | native ;
48 | }
49 |
50 | -keep class com.github.yutianzuo.curl_native.HttpManager{*;}
51 | -keep class com.github.yutianzuo.curl_native.HttpCallback{*;}
52 | -keep class com.github.yutianzuo.curl_native.RequestManager{*;}
53 | -keep class com.github.yutianzuo.curl_native.utils.Misc{*;}
--------------------------------------------------------------------------------
/curl_native/src/androidTest/java/com/github/yutianzuo/curl_native/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.github.yutianzuo.curl_native;
2 |
3 | import android.content.Context;
4 | import androidx.test.platform.app.InstrumentationRegistry;
5 | import androidx.test.ext.junit.runners.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.github.yutianzuo.curl_native.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/curl_native/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/aes_cbc.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by yutianzuo on 2018/7/2.
3 | //
4 |
5 | #ifndef ANDROID_CURL_AES_CBC_H
6 | #define ANDROID_CURL_AES_CBC_H
7 |
8 | #include
9 | //#include
10 |
11 | /**
12 | * do_encrypt为1时加密,为0时解密。
13 | * opssl官方aes示例
14 | */
15 | inline
16 | int do_crypt(FILE *in, FILE *out, int do_encrypt)
17 | {
18 | /* Allow enough space in output buffer for additional block */
19 | // unsigned char inbuf[1024], outbuf[1024 + EVP_MAX_BLOCK_LENGTH];
20 | // int inlen, outlen;
21 | // EVP_CIPHER_CTX *ctx;
22 | // /*
23 | // * Bogus key and IV: we'd normally set these from
24 | // * another source.
25 | // */
26 | // unsigned char key[] = "0123456789abcdeF";
27 | // unsigned char iv[] = "1234567887654321";
28 | //
29 | // /* Don't set key or IV right away; we want to check lengths */
30 | // ctx = EVP_CIPHER_CTX_new();
31 | // EVP_CipherInit_ex(ctx, EVP_aes_128_cbc(), NULL, NULL, NULL,
32 | // do_encrypt);
33 | // OPENSSL_assert(EVP_CIPHER_CTX_key_length(ctx) == 16);
34 | // OPENSSL_assert(EVP_CIPHER_CTX_iv_length(ctx) == 16);
35 | //
36 | // /* Now we can set key and IV */
37 | // EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, do_encrypt);
38 | //
39 | // for (;;) {
40 | // inlen = fread(inbuf, 1, 1024, in);
41 | // if (inlen <= 0)
42 | // break;
43 | // if (!EVP_CipherUpdate(ctx, outbuf, &outlen, inbuf, inlen)) {
44 | // /* Error */
45 | // EVP_CIPHER_CTX_free(ctx);
46 | // return 0;
47 | // }
48 | // fwrite(outbuf, 1, outlen, out);
49 | // }
50 | // if (!EVP_CipherFinal_ex(ctx, outbuf, &outlen)) {
51 | // /* Error */
52 | // EVP_CIPHER_CTX_free(ctx);
53 | // return 0;
54 | // }
55 | // fwrite(outbuf, 1, outlen, out);
56 | //
57 | // EVP_CIPHER_CTX_free(ctx);
58 | return 1;
59 | }
60 |
61 | inline
62 | std::string decrypt_aescbc(const unsigned char* entrytion_data, int len, std::string& str_key, std::string& str_iv)
63 | {
64 | // unsigned char outbuf[1024 + EVP_MAX_BLOCK_LENGTH];
65 | // int outlen;
66 | // EVP_CIPHER_CTX *ctx;
67 | // ctx = EVP_CIPHER_CTX_new();
68 | // EVP_CipherInit_ex(ctx, EVP_aes_128_cbc(), NULL, NULL, NULL,
69 | // 0); //decryption
70 | // OPENSSL_assert(EVP_CIPHER_CTX_key_length(ctx) == 16);
71 | // OPENSSL_assert(EVP_CIPHER_CTX_iv_length(ctx) == 16);
72 | // EVP_CipherInit_ex(ctx, NULL, NULL, (const unsigned char*)str_key.c_str(), (const unsigned char*)str_iv.c_str(), 0);
73 | //// EVP_CIPHER_CTX_set_padding(ctx, EVP_PADDING_PKCS7); //openssl default
74 | // //assume buff is long enough
75 | // EVP_CipherUpdate(ctx, outbuf, &outlen, entrytion_data, len);
76 | // unsigned char* tmp = outbuf + outlen;
77 | // int final_len;
78 | // EVP_CipherFinal_ex(ctx, tmp, &final_len);
79 | // EVP_CIPHER_CTX_free(ctx);
80 | //
81 | // std::string str_ret((const char*)outbuf, outlen + final_len);
82 | // return str_ret;
83 | return "";
84 | }
85 |
86 | #endif //ANDROID_CURL_AES_CBC_H
87 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/android_utils.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by yutianzuo on 2017/9/26.
3 | //
4 |
5 | #ifndef JNIUTILSAS_ANDROID_UTILS_H
6 | #define JNIUTILSAS_ANDROID_UTILS_H
7 |
8 | #include
9 |
10 | #ifdef ENABLE_LOG
11 |
12 | #define TAG "TAG_NATIVE"
13 |
14 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__) // 定义LOGD类型
15 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, TAG, __VA_ARGS__) // 定义LOGI类型
16 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN, TAG, __VA_ARGS__) // 定义LOGW类型
17 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__) // 定义LOGE类型
18 | #define LOGF(...) __android_log_print(ANDROID_LOG_FATAL, TAG, __VA_ARGS__) // 定义LOGF类型
19 | #else
20 |
21 | #define LOGD(...)
22 | #define LOGI(...)
23 | #define LOGW(...)
24 | #define LOGE(...)
25 | #define LOGF(...)
26 |
27 | #endif
28 |
29 |
30 |
31 | #endif //JNIUTILSAS_ANDROID_UTILS_H
32 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/curl/curlver.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLVER_H
2 | #define __CURL_CURLVER_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* This header file contains nothing but libcurl version info, generated by
26 | a script at release-time. This was made its own header file in 7.11.2 */
27 |
28 | /* This is the global package copyright */
29 | #define LIBCURL_COPYRIGHT "1996 - 2018 Daniel Stenberg, ."
30 |
31 | /* This is the version number of the libcurl package from which this header
32 | file origins: */
33 | #define LIBCURL_VERSION "7.59.0"
34 |
35 | /* The numeric version number is also available "in parts" by using these
36 | defines: */
37 | #define LIBCURL_VERSION_MAJOR 7
38 | #define LIBCURL_VERSION_MINOR 59
39 | #define LIBCURL_VERSION_PATCH 0
40 |
41 | /* This is the numeric version of the libcurl version number, meant for easier
42 | parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
43 | always follow this syntax:
44 |
45 | 0xXXYYZZ
46 |
47 | Where XX, YY and ZZ are the main version, release and patch numbers in
48 | hexadecimal (using 8 bits each). All three numbers are always represented
49 | using two digits. 1.2 would appear as "0x010200" while version 9.11.7
50 | appears as "0x090b07".
51 |
52 | This 6-digit (24 bits) hexadecimal number does not show pre-release number,
53 | and it is always a greater number in a more recent release. It makes
54 | comparisons with greater than and less than work.
55 |
56 | Note: This define is the full hex number and _does not_ use the
57 | CURL_VERSION_BITS() macro since curl's own configure script greps for it
58 | and needs it to contain the full number.
59 | */
60 | #define LIBCURL_VERSION_NUM 0x073b00
61 |
62 | /*
63 | * This is the date and time when the full source package was created. The
64 | * timestamp is not stored in git, as the timestamp is properly set in the
65 | * tarballs by the maketgz script.
66 | *
67 | * The format of the date follows this template:
68 | *
69 | * "2007-11-23"
70 | */
71 | #define LIBCURL_TIMESTAMP "2018-03-14"
72 |
73 | #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
74 | #define CURL_AT_LEAST_VERSION(x,y,z) \
75 | (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
76 |
77 | #endif /* __CURL_CURLVER_H */
78 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/curl/easy.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_EASY_H
2 | #define __CURL_EASY_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | CURL_EXTERN CURL *curl_easy_init(void);
29 | CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
30 | CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
31 | CURL_EXTERN void curl_easy_cleanup(CURL *curl);
32 |
33 | /*
34 | * NAME curl_easy_getinfo()
35 | *
36 | * DESCRIPTION
37 | *
38 | * Request internal information from the curl session with this function. The
39 | * third argument MUST be a pointer to a long, a pointer to a char * or a
40 | * pointer to a double (as the documentation describes elsewhere). The data
41 | * pointed to will be filled in accordingly and can be relied upon only if the
42 | * function returns CURLE_OK. This function is intended to get used *AFTER* a
43 | * performed transfer, all results from this function are undefined until the
44 | * transfer is completed.
45 | */
46 | CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
47 |
48 |
49 | /*
50 | * NAME curl_easy_duphandle()
51 | *
52 | * DESCRIPTION
53 | *
54 | * Creates a new curl session handle with the same options set for the handle
55 | * passed in. Duplicating a handle could only be a matter of cloning data and
56 | * options, internal state info and things like persistent connections cannot
57 | * be transferred. It is useful in multithreaded applications when you can run
58 | * curl_easy_duphandle() for each new thread to avoid a series of identical
59 | * curl_easy_setopt() invokes in every thread.
60 | */
61 | CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
62 |
63 | /*
64 | * NAME curl_easy_reset()
65 | *
66 | * DESCRIPTION
67 | *
68 | * Re-initializes a CURL handle to the default values. This puts back the
69 | * handle to the same state as it was in when it was just created.
70 | *
71 | * It does keep: live connections, the Session ID cache, the DNS cache and the
72 | * cookies.
73 | */
74 | CURL_EXTERN void curl_easy_reset(CURL *curl);
75 |
76 | /*
77 | * NAME curl_easy_recv()
78 | *
79 | * DESCRIPTION
80 | *
81 | * Receives data from the connected socket. Use after successful
82 | * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
83 | */
84 | CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
85 | size_t *n);
86 |
87 | /*
88 | * NAME curl_easy_send()
89 | *
90 | * DESCRIPTION
91 | *
92 | * Sends data over the connected socket. Use after successful
93 | * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
94 | */
95 | CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
96 | size_t buflen, size_t *n);
97 |
98 | #ifdef __cplusplus
99 | }
100 | #endif
101 |
102 | #endif
103 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/curl/mprintf.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_MPRINTF_H
2 | #define __CURL_MPRINTF_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | #include
26 | #include /* needed for FILE */
27 | #include "curl.h" /* for CURL_EXTERN */
28 |
29 | #ifdef __cplusplus
30 | extern "C" {
31 | #endif
32 |
33 | CURL_EXTERN int curl_mprintf(const char *format, ...);
34 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
35 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
36 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
37 | const char *format, ...);
38 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
39 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
40 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
41 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
42 | const char *format, va_list args);
43 | CURL_EXTERN char *curl_maprintf(const char *format, ...);
44 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
45 |
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 |
50 | #endif /* __CURL_MPRINTF_H */
51 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/curl/stdcheaders.h:
--------------------------------------------------------------------------------
1 | #ifndef __STDC_HEADERS_H
2 | #define __STDC_HEADERS_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | #include
26 |
27 | size_t fread(void *, size_t, size_t, FILE *);
28 | size_t fwrite(const void *, size_t, size_t, FILE *);
29 |
30 | int strcasecmp(const char *, const char *);
31 | int strncasecmp(const char *, const char *, size_t);
32 |
33 | #endif /* __STDC_HEADERS_H */
34 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/mbedtls/base64.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file base64.h
3 | *
4 | * \brief RFC 1521 base64 encoding/decoding
5 | */
6 | /*
7 | * Copyright The Mbed TLS Contributors
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 | * not use this file except in compliance with the License.
12 | * You may obtain a copy of the License at
13 | *
14 | * http://www.apache.org/licenses/LICENSE-2.0
15 | *
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 | #ifndef MBEDTLS_BASE64_H
23 | #define MBEDTLS_BASE64_H
24 |
25 | #include "mbedtls/build_info.h"
26 |
27 | #include
28 |
29 | /** Output buffer too small. */
30 | #define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A
31 | /** Invalid character in input. */
32 | #define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | /**
39 | * \brief Encode a buffer into base64 format
40 | *
41 | * \param dst destination buffer
42 | * \param dlen size of the destination buffer
43 | * \param olen number of bytes written
44 | * \param src source buffer
45 | * \param slen amount of data to be encoded
46 | *
47 | * \return 0 if successful, or MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL.
48 | * *olen is always updated to reflect the amount
49 | * of data that has (or would have) been written.
50 | * If that length cannot be represented, then no data is
51 | * written to the buffer and *olen is set to the maximum
52 | * length representable as a size_t.
53 | *
54 | * \note Call this function with dlen = 0 to obtain the
55 | * required buffer size in *olen
56 | */
57 | int mbedtls_base64_encode(unsigned char *dst, size_t dlen, size_t *olen,
58 | const unsigned char *src, size_t slen);
59 |
60 | /**
61 | * \brief Decode a base64-formatted buffer
62 | *
63 | * \param dst destination buffer (can be NULL for checking size)
64 | * \param dlen size of the destination buffer
65 | * \param olen number of bytes written
66 | * \param src source buffer
67 | * \param slen amount of data to be decoded
68 | *
69 | * \return 0 if successful, MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, or
70 | * MBEDTLS_ERR_BASE64_INVALID_CHARACTER if the input data is
71 | * not correct. *olen is always updated to reflect the amount
72 | * of data that has (or would have) been written.
73 | *
74 | * \note Call this function with *dst = NULL or dlen = 0 to obtain
75 | * the required buffer size in *olen
76 | */
77 | int mbedtls_base64_decode(unsigned char *dst, size_t dlen, size_t *olen,
78 | const unsigned char *src, size_t slen);
79 |
80 | #if defined(MBEDTLS_SELF_TEST)
81 | /**
82 | * \brief Checkup routine
83 | *
84 | * \return 0 if successful, or 1 if the test failed
85 | */
86 | int mbedtls_base64_self_test(int verbose);
87 |
88 | #endif /* MBEDTLS_SELF_TEST */
89 |
90 | #ifdef __cplusplus
91 | }
92 | #endif
93 |
94 | #endif /* base64.h */
95 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/mbedtls/compat-2.x.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file compat-2.x.h
3 | *
4 | * \brief Compatibility definitions
5 | *
6 | * \deprecated Use the new names directly instead
7 | */
8 | /*
9 | * Copyright The Mbed TLS Contributors
10 | * SPDX-License-Identifier: Apache-2.0
11 | *
12 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
13 | * not use this file except in compliance with the License.
14 | * You may obtain a copy of the License at
15 | *
16 | * http://www.apache.org/licenses/LICENSE-2.0
17 | *
18 | * Unless required by applicable law or agreed to in writing, software
19 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 | * See the License for the specific language governing permissions and
22 | * limitations under the License.
23 | */
24 |
25 | #if defined(MBEDTLS_DEPRECATED_WARNING)
26 | #warning "Including compat-2.x.h is deprecated"
27 | #endif
28 |
29 | #ifndef MBEDTLS_COMPAT2X_H
30 | #define MBEDTLS_COMPAT2X_H
31 |
32 | /*
33 | * Macros for renamed functions
34 | */
35 | #define mbedtls_ctr_drbg_update_ret mbedtls_ctr_drbg_update
36 | #define mbedtls_hmac_drbg_update_ret mbedtls_hmac_drbg_update
37 | #define mbedtls_md5_starts_ret mbedtls_md5_starts
38 | #define mbedtls_md5_update_ret mbedtls_md5_update
39 | #define mbedtls_md5_finish_ret mbedtls_md5_finish
40 | #define mbedtls_md5_ret mbedtls_md5
41 | #define mbedtls_ripemd160_starts_ret mbedtls_ripemd160_starts
42 | #define mbedtls_ripemd160_update_ret mbedtls_ripemd160_update
43 | #define mbedtls_ripemd160_finish_ret mbedtls_ripemd160_finish
44 | #define mbedtls_ripemd160_ret mbedtls_ripemd160
45 | #define mbedtls_sha1_starts_ret mbedtls_sha1_starts
46 | #define mbedtls_sha1_update_ret mbedtls_sha1_update
47 | #define mbedtls_sha1_finish_ret mbedtls_sha1_finish
48 | #define mbedtls_sha1_ret mbedtls_sha1
49 | #define mbedtls_sha256_starts_ret mbedtls_sha256_starts
50 | #define mbedtls_sha256_update_ret mbedtls_sha256_update
51 | #define mbedtls_sha256_finish_ret mbedtls_sha256_finish
52 | #define mbedtls_sha256_ret mbedtls_sha256
53 | #define mbedtls_sha512_starts_ret mbedtls_sha512_starts
54 | #define mbedtls_sha512_update_ret mbedtls_sha512_update
55 | #define mbedtls_sha512_finish_ret mbedtls_sha512_finish
56 | #define mbedtls_sha512_ret mbedtls_sha512
57 |
58 | #endif /* MBEDTLS_COMPAT2X_H */
59 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/mbedtls/constant_time.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Constant-time functions
3 | */
4 | /*
5 | * Copyright The Mbed TLS Contributors
6 | * SPDX-License-Identifier: Apache-2.0
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
9 | * not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | #ifndef MBEDTLS_CONSTANT_TIME_H
22 | #define MBEDTLS_CONSTANT_TIME_H
23 |
24 | #include
25 |
26 |
27 | /** Constant-time buffer comparison without branches.
28 | *
29 | * This is equivalent to the standard memcmp function, but is likely to be
30 | * compiled to code using bitwise operation rather than a branch.
31 | *
32 | * This function can be used to write constant-time code by replacing branches
33 | * with bit operations using masks.
34 | *
35 | * \param a Pointer to the first buffer.
36 | * \param b Pointer to the second buffer.
37 | * \param n The number of bytes to compare in the buffer.
38 | *
39 | * \return Zero if the content of the two buffer is the same,
40 | * otherwise non-zero.
41 | */
42 | int mbedtls_ct_memcmp(const void *a,
43 | const void *b,
44 | size_t n);
45 |
46 | #endif /* MBEDTLS_CONSTANT_TIME_H */
47 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/mbedtls/platform_time.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file platform_time.h
3 | *
4 | * \brief mbed TLS Platform time abstraction
5 | */
6 | /*
7 | * Copyright The Mbed TLS Contributors
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 | * not use this file except in compliance with the License.
12 | * You may obtain a copy of the License at
13 | *
14 | * http://www.apache.org/licenses/LICENSE-2.0
15 | *
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 | #ifndef MBEDTLS_PLATFORM_TIME_H
23 | #define MBEDTLS_PLATFORM_TIME_H
24 |
25 | #include "mbedtls/build_info.h"
26 |
27 | #ifdef __cplusplus
28 | extern "C" {
29 | #endif
30 |
31 | /*
32 | * The time_t datatype
33 | */
34 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO)
35 | typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t;
36 | #else
37 | /* For time_t */
38 | #include
39 | typedef time_t mbedtls_time_t;
40 | #endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */
41 |
42 | /*
43 | * The function pointers for time
44 | */
45 | #if defined(MBEDTLS_PLATFORM_TIME_ALT)
46 | extern mbedtls_time_t (*mbedtls_time)(mbedtls_time_t *time);
47 |
48 | /**
49 | * \brief Set your own time function pointer
50 | *
51 | * \param time_func the time function implementation
52 | *
53 | * \return 0
54 | */
55 | int mbedtls_platform_set_time(mbedtls_time_t (*time_func)(mbedtls_time_t *time));
56 | #else
57 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO)
58 | #define mbedtls_time MBEDTLS_PLATFORM_TIME_MACRO
59 | #else
60 | #define mbedtls_time time
61 | #endif /* MBEDTLS_PLATFORM_TIME_MACRO */
62 | #endif /* MBEDTLS_PLATFORM_TIME_ALT */
63 |
64 | #ifdef __cplusplus
65 | }
66 | #endif
67 |
68 | #endif /* platform_time.h */
69 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/mbedtls/private_access.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file private_access.h
3 | *
4 | * \brief Macro wrapper for struct's members.
5 | */
6 | /*
7 | * Copyright The Mbed TLS Contributors
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 | * not use this file except in compliance with the License.
12 | * You may obtain a copy of the License at
13 | *
14 | * http://www.apache.org/licenses/LICENSE-2.0
15 | *
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | #ifndef MBEDTLS_PRIVATE_ACCESS_H
24 | #define MBEDTLS_PRIVATE_ACCESS_H
25 |
26 | #ifndef MBEDTLS_ALLOW_PRIVATE_ACCESS
27 | #define MBEDTLS_PRIVATE(member) private_##member
28 | #else
29 | #define MBEDTLS_PRIVATE(member) member
30 | #endif
31 |
32 | #endif /* MBEDTLS_PRIVATE_ACCESS_H */
33 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/mbedtls/ripemd160.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file ripemd160.h
3 | *
4 | * \brief RIPE MD-160 message digest
5 | */
6 | /*
7 | * Copyright The Mbed TLS Contributors
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 | * not use this file except in compliance with the License.
12 | * You may obtain a copy of the License at
13 | *
14 | * http://www.apache.org/licenses/LICENSE-2.0
15 | *
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 | #ifndef MBEDTLS_RIPEMD160_H
23 | #define MBEDTLS_RIPEMD160_H
24 | #include "mbedtls/private_access.h"
25 |
26 | #include "mbedtls/build_info.h"
27 |
28 | #include
29 | #include
30 |
31 | #ifdef __cplusplus
32 | extern "C" {
33 | #endif
34 |
35 | #if !defined(MBEDTLS_RIPEMD160_ALT)
36 | // Regular implementation
37 | //
38 |
39 | /**
40 | * \brief RIPEMD-160 context structure
41 | */
42 | typedef struct mbedtls_ripemd160_context {
43 | uint32_t MBEDTLS_PRIVATE(total)[2]; /*!< number of bytes processed */
44 | uint32_t MBEDTLS_PRIVATE(state)[5]; /*!< intermediate digest state */
45 | unsigned char MBEDTLS_PRIVATE(buffer)[64]; /*!< data block being processed */
46 | }
47 | mbedtls_ripemd160_context;
48 |
49 | #else /* MBEDTLS_RIPEMD160_ALT */
50 | #include "ripemd160_alt.h"
51 | #endif /* MBEDTLS_RIPEMD160_ALT */
52 |
53 | /**
54 | * \brief Initialize RIPEMD-160 context
55 | *
56 | * \param ctx RIPEMD-160 context to be initialized
57 | */
58 | void mbedtls_ripemd160_init(mbedtls_ripemd160_context *ctx);
59 |
60 | /**
61 | * \brief Clear RIPEMD-160 context
62 | *
63 | * \param ctx RIPEMD-160 context to be cleared
64 | */
65 | void mbedtls_ripemd160_free(mbedtls_ripemd160_context *ctx);
66 |
67 | /**
68 | * \brief Clone (the state of) a RIPEMD-160 context
69 | *
70 | * \param dst The destination context
71 | * \param src The context to be cloned
72 | */
73 | void mbedtls_ripemd160_clone(mbedtls_ripemd160_context *dst,
74 | const mbedtls_ripemd160_context *src);
75 |
76 | /**
77 | * \brief RIPEMD-160 context setup
78 | *
79 | * \param ctx context to be initialized
80 | *
81 | * \return 0 if successful
82 | */
83 | int mbedtls_ripemd160_starts(mbedtls_ripemd160_context *ctx);
84 |
85 | /**
86 | * \brief RIPEMD-160 process buffer
87 | *
88 | * \param ctx RIPEMD-160 context
89 | * \param input buffer holding the data
90 | * \param ilen length of the input data
91 | *
92 | * \return 0 if successful
93 | */
94 | int mbedtls_ripemd160_update(mbedtls_ripemd160_context *ctx,
95 | const unsigned char *input,
96 | size_t ilen);
97 |
98 | /**
99 | * \brief RIPEMD-160 final digest
100 | *
101 | * \param ctx RIPEMD-160 context
102 | * \param output RIPEMD-160 checksum result
103 | *
104 | * \return 0 if successful
105 | */
106 | int mbedtls_ripemd160_finish(mbedtls_ripemd160_context *ctx,
107 | unsigned char output[20]);
108 |
109 | /**
110 | * \brief RIPEMD-160 process data block (internal use only)
111 | *
112 | * \param ctx RIPEMD-160 context
113 | * \param data buffer holding one block of data
114 | *
115 | * \return 0 if successful
116 | */
117 | int mbedtls_internal_ripemd160_process(mbedtls_ripemd160_context *ctx,
118 | const unsigned char data[64]);
119 |
120 | /**
121 | * \brief Output = RIPEMD-160( input buffer )
122 | *
123 | * \param input buffer holding the data
124 | * \param ilen length of the input data
125 | * \param output RIPEMD-160 checksum result
126 | *
127 | * \return 0 if successful
128 | */
129 | int mbedtls_ripemd160(const unsigned char *input,
130 | size_t ilen,
131 | unsigned char output[20]);
132 |
133 | #if defined(MBEDTLS_SELF_TEST)
134 |
135 | /**
136 | * \brief Checkup routine
137 | *
138 | * \return 0 if successful, or 1 if the test failed
139 | */
140 | int mbedtls_ripemd160_self_test(int verbose);
141 |
142 | #endif /* MBEDTLS_SELF_TEST */
143 |
144 | #ifdef __cplusplus
145 | }
146 | #endif
147 |
148 | #endif /* mbedtls_ripemd160.h */
149 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/mbedtls/ssl_cookie.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file ssl_cookie.h
3 | *
4 | * \brief DTLS cookie callbacks implementation
5 | */
6 | /*
7 | * Copyright The Mbed TLS Contributors
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 | * not use this file except in compliance with the License.
12 | * You may obtain a copy of the License at
13 | *
14 | * http://www.apache.org/licenses/LICENSE-2.0
15 | *
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 | #ifndef MBEDTLS_SSL_COOKIE_H
23 | #define MBEDTLS_SSL_COOKIE_H
24 | #include "mbedtls/private_access.h"
25 |
26 | #include "mbedtls/build_info.h"
27 |
28 | #include "mbedtls/ssl.h"
29 |
30 | #if !defined(MBEDTLS_USE_PSA_CRYPTO)
31 | #if defined(MBEDTLS_THREADING_C)
32 | #include "mbedtls/threading.h"
33 | #endif
34 | #endif /* !MBEDTLS_USE_PSA_CRYPTO */
35 |
36 | /**
37 | * \name SECTION: Module settings
38 | *
39 | * The configuration options you can set for this module are in this section.
40 | * Either change them in mbedtls_config.h or define them on the compiler command line.
41 | * \{
42 | */
43 | #ifndef MBEDTLS_SSL_COOKIE_TIMEOUT
44 | #define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
45 | #endif
46 |
47 | /** \} name SECTION: Module settings */
48 |
49 | #ifdef __cplusplus
50 | extern "C" {
51 | #endif
52 |
53 | /**
54 | * \brief Context for the default cookie functions.
55 | */
56 | typedef struct mbedtls_ssl_cookie_ctx {
57 | #if defined(MBEDTLS_USE_PSA_CRYPTO)
58 | mbedtls_svc_key_id_t MBEDTLS_PRIVATE(psa_hmac_key); /*!< key id for the HMAC portion */
59 | psa_algorithm_t MBEDTLS_PRIVATE(psa_hmac_alg); /*!< key algorithm for the HMAC portion */
60 | #else
61 | mbedtls_md_context_t MBEDTLS_PRIVATE(hmac_ctx); /*!< context for the HMAC portion */
62 | #endif /* MBEDTLS_USE_PSA_CRYPTO */
63 | #if !defined(MBEDTLS_HAVE_TIME)
64 | unsigned long MBEDTLS_PRIVATE(serial); /*!< serial number for expiration */
65 | #endif
66 | unsigned long MBEDTLS_PRIVATE(timeout); /*!< timeout delay, in seconds if HAVE_TIME,
67 | or in number of tickets issued */
68 |
69 | #if !defined(MBEDTLS_USE_PSA_CRYPTO)
70 | #if defined(MBEDTLS_THREADING_C)
71 | mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
72 | #endif
73 | #endif /* !MBEDTLS_USE_PSA_CRYPTO */
74 | } mbedtls_ssl_cookie_ctx;
75 |
76 | /**
77 | * \brief Initialize cookie context
78 | */
79 | void mbedtls_ssl_cookie_init(mbedtls_ssl_cookie_ctx *ctx);
80 |
81 | /**
82 | * \brief Setup cookie context (generate keys)
83 | */
84 | int mbedtls_ssl_cookie_setup(mbedtls_ssl_cookie_ctx *ctx,
85 | int (*f_rng)(void *, unsigned char *, size_t),
86 | void *p_rng);
87 |
88 | /**
89 | * \brief Set expiration delay for cookies
90 | * (Default MBEDTLS_SSL_COOKIE_TIMEOUT)
91 | *
92 | * \param ctx Cookie context
93 | * \param delay Delay, in seconds if HAVE_TIME, or in number of cookies
94 | * issued in the meantime.
95 | * 0 to disable expiration (NOT recommended)
96 | */
97 | void mbedtls_ssl_cookie_set_timeout(mbedtls_ssl_cookie_ctx *ctx, unsigned long delay);
98 |
99 | /**
100 | * \brief Free cookie context
101 | */
102 | void mbedtls_ssl_cookie_free(mbedtls_ssl_cookie_ctx *ctx);
103 |
104 | /**
105 | * \brief Generate cookie, see \c mbedtls_ssl_cookie_write_t
106 | */
107 | mbedtls_ssl_cookie_write_t mbedtls_ssl_cookie_write;
108 |
109 | /**
110 | * \brief Verify cookie, see \c mbedtls_ssl_cookie_write_t
111 | */
112 | mbedtls_ssl_cookie_check_t mbedtls_ssl_cookie_check;
113 |
114 | #ifdef __cplusplus
115 | }
116 | #endif
117 |
118 | #endif /* ssl_cookie.h */
119 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/mbedtls/timing.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file timing.h
3 | *
4 | * \brief Portable interface to timeouts and to the CPU cycle counter
5 | */
6 | /*
7 | * Copyright The Mbed TLS Contributors
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 | * not use this file except in compliance with the License.
12 | * You may obtain a copy of the License at
13 | *
14 | * http://www.apache.org/licenses/LICENSE-2.0
15 | *
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 | #ifndef MBEDTLS_TIMING_H
23 | #define MBEDTLS_TIMING_H
24 | #include "mbedtls/private_access.h"
25 |
26 | #include "mbedtls/build_info.h"
27 |
28 | #include
29 |
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif
33 |
34 | #if !defined(MBEDTLS_TIMING_ALT)
35 | // Regular implementation
36 | //
37 |
38 | /**
39 | * \brief timer structure
40 | */
41 | struct mbedtls_timing_hr_time {
42 | unsigned char MBEDTLS_PRIVATE(opaque)[32];
43 | };
44 |
45 | /**
46 | * \brief Context for mbedtls_timing_set/get_delay()
47 | */
48 | typedef struct mbedtls_timing_delay_context {
49 | struct mbedtls_timing_hr_time MBEDTLS_PRIVATE(timer);
50 | uint32_t MBEDTLS_PRIVATE(int_ms);
51 | uint32_t MBEDTLS_PRIVATE(fin_ms);
52 | } mbedtls_timing_delay_context;
53 |
54 | #else /* MBEDTLS_TIMING_ALT */
55 | #include "timing_alt.h"
56 | #endif /* MBEDTLS_TIMING_ALT */
57 |
58 | /* Internal use */
59 | unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset);
60 |
61 | /**
62 | * \brief Set a pair of delays to watch
63 | * (See \c mbedtls_timing_get_delay().)
64 | *
65 | * \param data Pointer to timing data.
66 | * Must point to a valid \c mbedtls_timing_delay_context struct.
67 | * \param int_ms First (intermediate) delay in milliseconds.
68 | * The effect if int_ms > fin_ms is unspecified.
69 | * \param fin_ms Second (final) delay in milliseconds.
70 | * Pass 0 to cancel the current delay.
71 | *
72 | * \note To set a single delay, either use \c mbedtls_timing_set_timer
73 | * directly or use this function with int_ms == fin_ms.
74 | */
75 | void mbedtls_timing_set_delay(void *data, uint32_t int_ms, uint32_t fin_ms);
76 |
77 | /**
78 | * \brief Get the status of delays
79 | * (Memory helper: number of delays passed.)
80 | *
81 | * \param data Pointer to timing data
82 | * Must point to a valid \c mbedtls_timing_delay_context struct.
83 | *
84 | * \return -1 if cancelled (fin_ms = 0),
85 | * 0 if none of the delays are passed,
86 | * 1 if only the intermediate delay is passed,
87 | * 2 if the final delay is passed.
88 | */
89 | int mbedtls_timing_get_delay(void *data);
90 |
91 | /**
92 | * \brief Get the final timing delay
93 | *
94 | * \param data Pointer to timing data
95 | * Must point to a valid \c mbedtls_timing_delay_context struct.
96 | *
97 | * \return Final timing delay in milliseconds.
98 | */
99 | uint32_t mbedtls_timing_get_final_delay(
100 | const mbedtls_timing_delay_context *data);
101 |
102 | #ifdef __cplusplus
103 | }
104 | #endif
105 |
106 | #endif /* timing.h */
107 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/mbedtls/version.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file version.h
3 | *
4 | * \brief Run-time version information
5 | */
6 | /*
7 | * Copyright The Mbed TLS Contributors
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 | * not use this file except in compliance with the License.
12 | * You may obtain a copy of the License at
13 | *
14 | * http://www.apache.org/licenses/LICENSE-2.0
15 | *
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 | /*
23 | * This set of run-time variables can be used to determine the version number of
24 | * the Mbed TLS library used. Compile-time version defines for the same can be
25 | * found in build_info.h
26 | */
27 | #ifndef MBEDTLS_VERSION_H
28 | #define MBEDTLS_VERSION_H
29 |
30 | #include "mbedtls/build_info.h"
31 |
32 | #if defined(MBEDTLS_VERSION_C)
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | /**
39 | * Get the version number.
40 | *
41 | * \return The constructed version number in the format
42 | * MMNNPP00 (Major, Minor, Patch).
43 | */
44 | unsigned int mbedtls_version_get_number(void);
45 |
46 | /**
47 | * Get the version string ("x.y.z").
48 | *
49 | * \param string The string that will receive the value.
50 | * (Should be at least 9 bytes in size)
51 | */
52 | void mbedtls_version_get_string(char *string);
53 |
54 | /**
55 | * Get the full version string ("mbed TLS x.y.z").
56 | *
57 | * \param string The string that will receive the value. The mbed TLS version
58 | * string will use 18 bytes AT MOST including a terminating
59 | * null byte.
60 | * (So the buffer should be at least 18 bytes to receive this
61 | * version string).
62 | */
63 | void mbedtls_version_get_string_full(char *string);
64 |
65 | /**
66 | * \brief Check if support for a feature was compiled into this
67 | * mbed TLS binary. This allows you to see at runtime if the
68 | * library was for instance compiled with or without
69 | * Multi-threading support.
70 | *
71 | * \note only checks against defines in the sections "System
72 | * support", "mbed TLS modules" and "mbed TLS feature
73 | * support" in mbedtls_config.h
74 | *
75 | * \param feature The string for the define to check (e.g. "MBEDTLS_AES_C")
76 | *
77 | * \return 0 if the feature is present,
78 | * -1 if the feature is not present and
79 | * -2 if support for feature checking as a whole was not
80 | * compiled in.
81 | */
82 | int mbedtls_version_check_feature(const char *feature);
83 |
84 | #ifdef __cplusplus
85 | }
86 | #endif
87 |
88 | #endif /* MBEDTLS_VERSION_C */
89 |
90 | #endif /* version.h */
91 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/aes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_AES_H
11 | # define HEADER_AES_H
12 |
13 | # include
14 |
15 | # include
16 | # ifdef __cplusplus
17 | extern "C" {
18 | # endif
19 |
20 | # define AES_ENCRYPT 1
21 | # define AES_DECRYPT 0
22 |
23 | /*
24 | * Because array size can't be a const in C, the following two are macros.
25 | * Both sizes are in bytes.
26 | */
27 | # define AES_MAXNR 14
28 | # define AES_BLOCK_SIZE 16
29 |
30 | /* This should be a hidden type, but EVP requires that the size be known */
31 | struct aes_key_st {
32 | # ifdef AES_LONG
33 | unsigned long rd_key[4 * (AES_MAXNR + 1)];
34 | # else
35 | unsigned int rd_key[4 * (AES_MAXNR + 1)];
36 | # endif
37 | int rounds;
38 | };
39 | typedef struct aes_key_st AES_KEY;
40 |
41 | const char *AES_options(void);
42 |
43 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
44 | AES_KEY *key);
45 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
46 | AES_KEY *key);
47 |
48 | void AES_encrypt(const unsigned char *in, unsigned char *out,
49 | const AES_KEY *key);
50 | void AES_decrypt(const unsigned char *in, unsigned char *out,
51 | const AES_KEY *key);
52 |
53 | void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
54 | const AES_KEY *key, const int enc);
55 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
56 | size_t length, const AES_KEY *key,
57 | unsigned char *ivec, const int enc);
58 | void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
59 | size_t length, const AES_KEY *key,
60 | unsigned char *ivec, int *num, const int enc);
61 | void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
62 | size_t length, const AES_KEY *key,
63 | unsigned char *ivec, int *num, const int enc);
64 | void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
65 | size_t length, const AES_KEY *key,
66 | unsigned char *ivec, int *num, const int enc);
67 | void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
68 | size_t length, const AES_KEY *key,
69 | unsigned char *ivec, int *num);
70 | /* NB: the IV is _two_ blocks long */
71 | void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
72 | size_t length, const AES_KEY *key,
73 | unsigned char *ivec, const int enc);
74 | /* NB: the IV is _four_ blocks long */
75 | void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
76 | size_t length, const AES_KEY *key,
77 | const AES_KEY *key2, const unsigned char *ivec,
78 | const int enc);
79 |
80 | int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
81 | unsigned char *out,
82 | const unsigned char *in, unsigned int inlen);
83 | int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
84 | unsigned char *out,
85 | const unsigned char *in, unsigned int inlen);
86 |
87 |
88 | # ifdef __cplusplus
89 | }
90 | # endif
91 |
92 | #endif
93 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/asn1_mac.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #error "This file is obsolete; please update your software."
11 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/async.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #include
11 |
12 | #ifndef HEADER_ASYNC_H
13 | # define HEADER_ASYNC_H
14 |
15 | #if defined(_WIN32)
16 | # if defined(BASETYPES) || defined(_WINDEF_H)
17 | /* application has to include to use this */
18 | #define OSSL_ASYNC_FD HANDLE
19 | #define OSSL_BAD_ASYNC_FD INVALID_HANDLE_VALUE
20 | # endif
21 | #else
22 | #define OSSL_ASYNC_FD int
23 | #define OSSL_BAD_ASYNC_FD -1
24 | #endif
25 |
26 |
27 | # ifdef __cplusplus
28 | extern "C" {
29 | # endif
30 |
31 | typedef struct async_job_st ASYNC_JOB;
32 | typedef struct async_wait_ctx_st ASYNC_WAIT_CTX;
33 |
34 | #define ASYNC_ERR 0
35 | #define ASYNC_NO_JOBS 1
36 | #define ASYNC_PAUSE 2
37 | #define ASYNC_FINISH 3
38 |
39 | int ASYNC_init_thread(size_t max_size, size_t init_size);
40 | void ASYNC_cleanup_thread(void);
41 |
42 | #ifdef OSSL_ASYNC_FD
43 | ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void);
44 | void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx);
45 | int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key,
46 | OSSL_ASYNC_FD fd,
47 | void *custom_data,
48 | void (*cleanup)(ASYNC_WAIT_CTX *, const void *,
49 | OSSL_ASYNC_FD, void *));
50 | int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key,
51 | OSSL_ASYNC_FD *fd, void **custom_data);
52 | int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,
53 | size_t *numfds);
54 | int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd,
55 | size_t *numaddfds, OSSL_ASYNC_FD *delfd,
56 | size_t *numdelfds);
57 | int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key);
58 | #endif
59 |
60 | int ASYNC_is_capable(void);
61 |
62 | int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *ctx, int *ret,
63 | int (*func)(void *), void *args, size_t size);
64 | int ASYNC_pause_job(void);
65 |
66 | ASYNC_JOB *ASYNC_get_current_job(void);
67 | ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job);
68 | void ASYNC_block_pause(void);
69 | void ASYNC_unblock_pause(void);
70 |
71 | /* BEGIN ERROR CODES */
72 | /*
73 | * The following lines are auto generated by the script mkerr.pl. Any changes
74 | * made after this point may be overwritten when the script is next run.
75 | */
76 |
77 | int ERR_load_ASYNC_strings(void);
78 |
79 | /* Error codes for the ASYNC functions. */
80 |
81 | /* Function codes. */
82 | # define ASYNC_F_ASYNC_CTX_NEW 100
83 | # define ASYNC_F_ASYNC_INIT_THREAD 101
84 | # define ASYNC_F_ASYNC_JOB_NEW 102
85 | # define ASYNC_F_ASYNC_PAUSE_JOB 103
86 | # define ASYNC_F_ASYNC_START_FUNC 104
87 | # define ASYNC_F_ASYNC_START_JOB 105
88 |
89 | /* Reason codes. */
90 | # define ASYNC_R_FAILED_TO_SET_POOL 101
91 | # define ASYNC_R_FAILED_TO_SWAP_CONTEXT 102
92 | # define ASYNC_R_INIT_FAILED 105
93 | # define ASYNC_R_INVALID_POOL_SIZE 103
94 |
95 | # ifdef __cplusplus
96 | }
97 | # endif
98 | #endif
99 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/blowfish.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_BLOWFISH_H
11 | # define HEADER_BLOWFISH_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_BF
16 | # include
17 | # ifdef __cplusplus
18 | extern "C" {
19 | # endif
20 |
21 | # define BF_ENCRYPT 1
22 | # define BF_DECRYPT 0
23 |
24 | /*-
25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26 | * ! BF_LONG has to be at least 32 bits wide. !
27 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28 | */
29 | # define BF_LONG unsigned int
30 |
31 | # define BF_ROUNDS 16
32 | # define BF_BLOCK 8
33 |
34 | typedef struct bf_key_st {
35 | BF_LONG P[BF_ROUNDS + 2];
36 | BF_LONG S[4 * 256];
37 | } BF_KEY;
38 |
39 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
40 |
41 | void BF_encrypt(BF_LONG *data, const BF_KEY *key);
42 | void BF_decrypt(BF_LONG *data, const BF_KEY *key);
43 |
44 | void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
45 | const BF_KEY *key, int enc);
46 | void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
47 | const BF_KEY *schedule, unsigned char *ivec, int enc);
48 | void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,
49 | long length, const BF_KEY *schedule,
50 | unsigned char *ivec, int *num, int enc);
51 | void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,
52 | long length, const BF_KEY *schedule,
53 | unsigned char *ivec, int *num);
54 | const char *BF_options(void);
55 |
56 | # ifdef __cplusplus
57 | }
58 | # endif
59 | # endif
60 |
61 | #endif
62 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/buffer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_BUFFER_H
11 | # define HEADER_BUFFER_H
12 |
13 | # include
14 | # ifndef HEADER_CRYPTO_H
15 | # include
16 | # endif
17 |
18 |
19 | #ifdef __cplusplus
20 | extern "C" {
21 | #endif
22 |
23 | # include
24 |
25 | # if !defined(NO_SYS_TYPES_H)
26 | # include
27 | # endif
28 |
29 | /*
30 | * These names are outdated as of OpenSSL 1.1; a future release
31 | * will move them to be deprecated.
32 | */
33 | # define BUF_strdup(s) OPENSSL_strdup(s)
34 | # define BUF_strndup(s, size) OPENSSL_strndup(s, size)
35 | # define BUF_memdup(data, size) OPENSSL_memdup(data, size)
36 | # define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size)
37 | # define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size)
38 | # define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen)
39 |
40 | struct buf_mem_st {
41 | size_t length; /* current number of bytes */
42 | char *data;
43 | size_t max; /* size of buffer */
44 | unsigned long flags;
45 | };
46 |
47 | # define BUF_MEM_FLAG_SECURE 0x01
48 |
49 | BUF_MEM *BUF_MEM_new(void);
50 | BUF_MEM *BUF_MEM_new_ex(unsigned long flags);
51 | void BUF_MEM_free(BUF_MEM *a);
52 | size_t BUF_MEM_grow(BUF_MEM *str, size_t len);
53 | size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
54 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
55 |
56 | /* BEGIN ERROR CODES */
57 | /*
58 | * The following lines are auto generated by the script mkerr.pl. Any changes
59 | * made after this point may be overwritten when the script is next run.
60 | */
61 |
62 | int ERR_load_BUF_strings(void);
63 |
64 | /* Error codes for the BUF functions. */
65 |
66 | /* Function codes. */
67 | # define BUF_F_BUF_MEM_GROW 100
68 | # define BUF_F_BUF_MEM_GROW_CLEAN 105
69 | # define BUF_F_BUF_MEM_NEW 101
70 |
71 | /* Reason codes. */
72 |
73 | # ifdef __cplusplus
74 | }
75 | # endif
76 | #endif
77 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/camellia.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_CAMELLIA_H
11 | # define HEADER_CAMELLIA_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_CAMELLIA
16 | # include
17 | #ifdef __cplusplus
18 | extern "C" {
19 | #endif
20 |
21 | # define CAMELLIA_ENCRYPT 1
22 | # define CAMELLIA_DECRYPT 0
23 |
24 | /*
25 | * Because array size can't be a const in C, the following two are macros.
26 | * Both sizes are in bytes.
27 | */
28 |
29 | /* This should be a hidden type, but EVP requires that the size be known */
30 |
31 | # define CAMELLIA_BLOCK_SIZE 16
32 | # define CAMELLIA_TABLE_BYTE_LEN 272
33 | # define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
34 |
35 | typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match
36 | * with WORD */
37 |
38 | struct camellia_key_st {
39 | union {
40 | double d; /* ensures 64-bit align */
41 | KEY_TABLE_TYPE rd_key;
42 | } u;
43 | int grand_rounds;
44 | };
45 | typedef struct camellia_key_st CAMELLIA_KEY;
46 |
47 | int Camellia_set_key(const unsigned char *userKey, const int bits,
48 | CAMELLIA_KEY *key);
49 |
50 | void Camellia_encrypt(const unsigned char *in, unsigned char *out,
51 | const CAMELLIA_KEY *key);
52 | void Camellia_decrypt(const unsigned char *in, unsigned char *out,
53 | const CAMELLIA_KEY *key);
54 |
55 | void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out,
56 | const CAMELLIA_KEY *key, const int enc);
57 | void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
58 | size_t length, const CAMELLIA_KEY *key,
59 | unsigned char *ivec, const int enc);
60 | void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out,
61 | size_t length, const CAMELLIA_KEY *key,
62 | unsigned char *ivec, int *num, const int enc);
63 | void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out,
64 | size_t length, const CAMELLIA_KEY *key,
65 | unsigned char *ivec, int *num, const int enc);
66 | void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out,
67 | size_t length, const CAMELLIA_KEY *key,
68 | unsigned char *ivec, int *num, const int enc);
69 | void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out,
70 | size_t length, const CAMELLIA_KEY *key,
71 | unsigned char *ivec, int *num);
72 | void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out,
73 | size_t length, const CAMELLIA_KEY *key,
74 | unsigned char ivec[CAMELLIA_BLOCK_SIZE],
75 | unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE],
76 | unsigned int *num);
77 |
78 | # ifdef __cplusplus
79 | }
80 | # endif
81 | # endif
82 |
83 | #endif
84 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/cast.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_CAST_H
11 | # define HEADER_CAST_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_CAST
16 | # ifdef __cplusplus
17 | extern "C" {
18 | # endif
19 |
20 | # define CAST_ENCRYPT 1
21 | # define CAST_DECRYPT 0
22 |
23 | # define CAST_LONG unsigned int
24 |
25 | # define CAST_BLOCK 8
26 | # define CAST_KEY_LENGTH 16
27 |
28 | typedef struct cast_key_st {
29 | CAST_LONG data[32];
30 | int short_key; /* Use reduced rounds for short key */
31 | } CAST_KEY;
32 |
33 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
34 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
35 | const CAST_KEY *key, int enc);
36 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);
37 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);
38 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,
39 | long length, const CAST_KEY *ks, unsigned char *iv,
40 | int enc);
41 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
42 | long length, const CAST_KEY *schedule,
43 | unsigned char *ivec, int *num, int enc);
44 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
45 | long length, const CAST_KEY *schedule,
46 | unsigned char *ivec, int *num);
47 |
48 | # ifdef __cplusplus
49 | }
50 | # endif
51 | # endif
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/cmac.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_CMAC_H
11 | # define HEADER_CMAC_H
12 |
13 | # ifndef OPENSSL_NO_CMAC
14 |
15 | #ifdef __cplusplus
16 | extern "C" {
17 | #endif
18 |
19 | # include
20 |
21 | /* Opaque */
22 | typedef struct CMAC_CTX_st CMAC_CTX;
23 |
24 | CMAC_CTX *CMAC_CTX_new(void);
25 | void CMAC_CTX_cleanup(CMAC_CTX *ctx);
26 | void CMAC_CTX_free(CMAC_CTX *ctx);
27 | EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
28 | int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
29 |
30 | int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
31 | const EVP_CIPHER *cipher, ENGINE *impl);
32 | int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen);
33 | int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen);
34 | int CMAC_resume(CMAC_CTX *ctx);
35 |
36 | #ifdef __cplusplus
37 | }
38 | #endif
39 |
40 | # endif
41 | #endif
42 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/comp.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_COMP_H
11 | # define HEADER_COMP_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_COMP
16 | # include
17 | # ifdef __cplusplus
18 | extern "C" {
19 | # endif
20 |
21 |
22 |
23 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
24 | const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx);
25 | int COMP_CTX_get_type(const COMP_CTX* comp);
26 | int COMP_get_type(const COMP_METHOD *meth);
27 | const char *COMP_get_name(const COMP_METHOD *meth);
28 | void COMP_CTX_free(COMP_CTX *ctx);
29 |
30 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
31 | unsigned char *in, int ilen);
32 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
33 | unsigned char *in, int ilen);
34 |
35 | COMP_METHOD *COMP_zlib(void);
36 |
37 | #if OPENSSL_API_COMPAT < 0x10100000L
38 | #define COMP_zlib_cleanup() while(0) continue
39 | #endif
40 |
41 | # ifdef HEADER_BIO_H
42 | # ifdef ZLIB
43 | const BIO_METHOD *BIO_f_zlib(void);
44 | # endif
45 | # endif
46 |
47 | /* BEGIN ERROR CODES */
48 | /*
49 | * The following lines are auto generated by the script mkerr.pl. Any changes
50 | * made after this point may be overwritten when the script is next run.
51 | */
52 |
53 | int ERR_load_COMP_strings(void);
54 |
55 | /* Error codes for the COMP functions. */
56 |
57 | /* Function codes. */
58 | # define COMP_F_BIO_ZLIB_FLUSH 99
59 | # define COMP_F_BIO_ZLIB_NEW 100
60 | # define COMP_F_BIO_ZLIB_READ 101
61 | # define COMP_F_BIO_ZLIB_WRITE 102
62 |
63 | /* Reason codes. */
64 | # define COMP_R_ZLIB_DEFLATE_ERROR 99
65 | # define COMP_R_ZLIB_INFLATE_ERROR 100
66 | # define COMP_R_ZLIB_NOT_SUPPORTED 101
67 |
68 | # ifdef __cplusplus
69 | }
70 | # endif
71 | # endif
72 | #endif
73 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/conf_api.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_CONF_API_H
11 | # define HEADER_CONF_API_H
12 |
13 | # include
14 | # include
15 |
16 | #ifdef __cplusplus
17 | extern "C" {
18 | #endif
19 |
20 | /* Up until OpenSSL 0.9.5a, this was new_section */
21 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section);
22 | /* Up until OpenSSL 0.9.5a, this was get_section */
23 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section);
24 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */
25 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
26 | const char *section);
27 |
28 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);
29 | char *_CONF_get_string(const CONF *conf, const char *section,
30 | const char *name);
31 | long _CONF_get_number(const CONF *conf, const char *section,
32 | const char *name);
33 |
34 | int _CONF_new_data(CONF *conf);
35 | void _CONF_free_data(CONF *conf);
36 |
37 | #ifdef __cplusplus
38 | }
39 | #endif
40 | #endif
41 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/dtls1.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_DTLS1_H
11 | # define HEADER_DTLS1_H
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | # define DTLS1_VERSION 0xFEFF
18 | # define DTLS1_2_VERSION 0xFEFD
19 | # define DTLS_MIN_VERSION DTLS1_VERSION
20 | # define DTLS_MAX_VERSION DTLS1_2_VERSION
21 | # define DTLS1_VERSION_MAJOR 0xFE
22 |
23 | # define DTLS1_BAD_VER 0x0100
24 |
25 | /* Special value for method supporting multiple versions */
26 | # define DTLS_ANY_VERSION 0x1FFFF
27 |
28 | /* lengths of messages */
29 | # define DTLS1_COOKIE_LENGTH 256
30 |
31 | # define DTLS1_RT_HEADER_LENGTH 13
32 |
33 | # define DTLS1_HM_HEADER_LENGTH 12
34 |
35 | # define DTLS1_HM_BAD_FRAGMENT -2
36 | # define DTLS1_HM_FRAGMENT_RETRY -3
37 |
38 | # define DTLS1_CCS_HEADER_LENGTH 1
39 |
40 | # ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE
41 | # define DTLS1_AL_HEADER_LENGTH 7
42 | # else
43 | # define DTLS1_AL_HEADER_LENGTH 2
44 | # endif
45 |
46 |
47 | /* Timeout multipliers (timeout slice is defined in apps/timeouts.h */
48 | # define DTLS1_TMO_READ_COUNT 2
49 | # define DTLS1_TMO_WRITE_COUNT 2
50 |
51 | # define DTLS1_TMO_ALERT_COUNT 12
52 |
53 | #ifdef __cplusplus
54 | }
55 | #endif
56 | #endif
57 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/ebcdic.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_EBCDIC_H
11 | # define HEADER_EBCDIC_H
12 |
13 | # include
14 |
15 | #ifdef __cplusplus
16 | extern "C" {
17 | #endif
18 |
19 | /* Avoid name clashes with other applications */
20 | # define os_toascii _openssl_os_toascii
21 | # define os_toebcdic _openssl_os_toebcdic
22 | # define ebcdic2ascii _openssl_ebcdic2ascii
23 | # define ascii2ebcdic _openssl_ascii2ebcdic
24 |
25 | extern const unsigned char os_toascii[256];
26 | extern const unsigned char os_toebcdic[256];
27 | void *ebcdic2ascii(void *dest, const void *srce, size_t count);
28 | void *ascii2ebcdic(void *dest, const void *srce, size_t count);
29 |
30 | #ifdef __cplusplus
31 | }
32 | #endif
33 | #endif
34 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/ecdh.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #include
11 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/ecdsa.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #include
11 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/hmac.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_HMAC_H
11 | # define HEADER_HMAC_H
12 |
13 | # include
14 |
15 | # include
16 |
17 | # define HMAC_MAX_MD_CBLOCK 128/* largest known is SHA512 */
18 |
19 | #ifdef __cplusplus
20 | extern "C" {
21 | #endif
22 |
23 | size_t HMAC_size(const HMAC_CTX *e);
24 | HMAC_CTX *HMAC_CTX_new(void);
25 | int HMAC_CTX_reset(HMAC_CTX *ctx);
26 | void HMAC_CTX_free(HMAC_CTX *ctx);
27 |
28 | DEPRECATEDIN_1_1_0(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
29 | const EVP_MD *md))
30 |
31 | /*__owur*/ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
32 | const EVP_MD *md, ENGINE *impl);
33 | /*__owur*/ int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
34 | size_t len);
35 | /*__owur*/ int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
36 | unsigned int *len);
37 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
38 | const unsigned char *d, size_t n, unsigned char *md,
39 | unsigned int *md_len);
40 | __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
41 |
42 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
43 | const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx);
44 |
45 | #ifdef __cplusplus
46 | }
47 | #endif
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/idea.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_IDEA_H
11 | # define HEADER_IDEA_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_IDEA
16 | # ifdef __cplusplus
17 | extern "C" {
18 | # endif
19 |
20 | typedef unsigned int IDEA_INT;
21 |
22 | # define IDEA_ENCRYPT 1
23 | # define IDEA_DECRYPT 0
24 |
25 | # define IDEA_BLOCK 8
26 | # define IDEA_KEY_LENGTH 16
27 |
28 | typedef struct idea_key_st {
29 | IDEA_INT data[9][6];
30 | } IDEA_KEY_SCHEDULE;
31 |
32 | const char *IDEA_options(void);
33 | void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out,
34 | IDEA_KEY_SCHEDULE *ks);
35 | void IDEA_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
36 | void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
37 | void IDEA_cbc_encrypt(const unsigned char *in, unsigned char *out,
38 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
39 | int enc);
40 | void IDEA_cfb64_encrypt(const unsigned char *in, unsigned char *out,
41 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
42 | int *num, int enc);
43 | void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out,
44 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
45 | int *num);
46 | void IDEA_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
47 |
48 | # if OPENSSL_API_COMPAT < 0x10100000L
49 | # define idea_options IDEA_options
50 | # define idea_ecb_encrypt IDEA_ecb_encrypt
51 | # define idea_set_encrypt_key IDEA_set_encrypt_key
52 | # define idea_set_decrypt_key IDEA_set_decrypt_key
53 | # define idea_cbc_encrypt IDEA_cbc_encrypt
54 | # define idea_cfb64_encrypt IDEA_cfb64_encrypt
55 | # define idea_ofb64_encrypt IDEA_ofb64_encrypt
56 | # define idea_encrypt IDEA_encrypt
57 | # endif
58 |
59 | # ifdef __cplusplus
60 | }
61 | # endif
62 | # endif
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/kdf.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_KDF_H
11 | # define HEADER_KDF_H
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | # define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL)
18 | # define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1)
19 | # define EVP_PKEY_CTRL_TLS_SEED (EVP_PKEY_ALG_CTRL + 2)
20 | # define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3)
21 | # define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4)
22 | # define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5)
23 | # define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6)
24 |
25 | # define EVP_PKEY_CTX_set_tls1_prf_md(pctx, md) \
26 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
27 | EVP_PKEY_CTRL_TLS_MD, 0, (void *)md)
28 |
29 | # define EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, sec, seclen) \
30 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
31 | EVP_PKEY_CTRL_TLS_SECRET, seclen, (void *)sec)
32 |
33 | # define EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, seed, seedlen) \
34 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
35 | EVP_PKEY_CTRL_TLS_SEED, seedlen, (void *)seed)
36 |
37 | # define EVP_PKEY_CTX_set_hkdf_md(pctx, md) \
38 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
39 | EVP_PKEY_CTRL_HKDF_MD, 0, (void *)md)
40 |
41 | # define EVP_PKEY_CTX_set1_hkdf_salt(pctx, salt, saltlen) \
42 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
43 | EVP_PKEY_CTRL_HKDF_SALT, saltlen, (void *)salt)
44 |
45 | # define EVP_PKEY_CTX_set1_hkdf_key(pctx, key, keylen) \
46 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
47 | EVP_PKEY_CTRL_HKDF_KEY, keylen, (void *)key)
48 |
49 | # define EVP_PKEY_CTX_add1_hkdf_info(pctx, info, infolen) \
50 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
51 | EVP_PKEY_CTRL_HKDF_INFO, infolen, (void *)info)
52 |
53 | /* BEGIN ERROR CODES */
54 | /*
55 | * The following lines are auto generated by the script mkerr.pl. Any changes
56 | * made after this point may be overwritten when the script is next run.
57 | */
58 |
59 | int ERR_load_KDF_strings(void);
60 |
61 | /* Error codes for the KDF functions. */
62 |
63 | /* Function codes. */
64 | # define KDF_F_PKEY_TLS1_PRF_CTRL_STR 100
65 | # define KDF_F_PKEY_TLS1_PRF_DERIVE 101
66 |
67 | /* Reason codes. */
68 | # define KDF_R_INVALID_DIGEST 100
69 | # define KDF_R_MISSING_PARAMETER 101
70 | # define KDF_R_VALUE_MISSING 102
71 |
72 | # ifdef __cplusplus
73 | }
74 | # endif
75 | #endif
76 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/md2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_MD2_H
11 | # define HEADER_MD2_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_MD2
16 | # include
17 | # ifdef __cplusplus
18 | extern "C" {
19 | # endif
20 |
21 | typedef unsigned char MD2_INT;
22 |
23 | # define MD2_DIGEST_LENGTH 16
24 | # define MD2_BLOCK 16
25 |
26 | typedef struct MD2state_st {
27 | unsigned int num;
28 | unsigned char data[MD2_BLOCK];
29 | MD2_INT cksm[MD2_BLOCK];
30 | MD2_INT state[MD2_BLOCK];
31 | } MD2_CTX;
32 |
33 | const char *MD2_options(void);
34 | int MD2_Init(MD2_CTX *c);
35 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len);
36 | int MD2_Final(unsigned char *md, MD2_CTX *c);
37 | unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md);
38 |
39 | # ifdef __cplusplus
40 | }
41 | # endif
42 | # endif
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/md4.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_MD4_H
11 | # define HEADER_MD4_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_MD4
16 | # include
17 | # include
18 | # ifdef __cplusplus
19 | extern "C" {
20 | # endif
21 |
22 | /*-
23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24 | * ! MD4_LONG has to be at least 32 bits wide. !
25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26 | */
27 | # define MD4_LONG unsigned int
28 |
29 | # define MD4_CBLOCK 64
30 | # define MD4_LBLOCK (MD4_CBLOCK/4)
31 | # define MD4_DIGEST_LENGTH 16
32 |
33 | typedef struct MD4state_st {
34 | MD4_LONG A, B, C, D;
35 | MD4_LONG Nl, Nh;
36 | MD4_LONG data[MD4_LBLOCK];
37 | unsigned int num;
38 | } MD4_CTX;
39 |
40 | int MD4_Init(MD4_CTX *c);
41 | int MD4_Update(MD4_CTX *c, const void *data, size_t len);
42 | int MD4_Final(unsigned char *md, MD4_CTX *c);
43 | unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md);
44 | void MD4_Transform(MD4_CTX *c, const unsigned char *b);
45 |
46 | # ifdef __cplusplus
47 | }
48 | # endif
49 | # endif
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/md5.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_MD5_H
11 | # define HEADER_MD5_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_MD5
16 | # include
17 | # include
18 | # ifdef __cplusplus
19 | extern "C" {
20 | # endif
21 |
22 | /*
23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24 | * ! MD5_LONG has to be at least 32 bits wide. !
25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26 | */
27 | # define MD5_LONG unsigned int
28 |
29 | # define MD5_CBLOCK 64
30 | # define MD5_LBLOCK (MD5_CBLOCK/4)
31 | # define MD5_DIGEST_LENGTH 16
32 |
33 | typedef struct MD5state_st {
34 | MD5_LONG A, B, C, D;
35 | MD5_LONG Nl, Nh;
36 | MD5_LONG data[MD5_LBLOCK];
37 | unsigned int num;
38 | } MD5_CTX;
39 |
40 | int MD5_Init(MD5_CTX *c);
41 | int MD5_Update(MD5_CTX *c, const void *data, size_t len);
42 | int MD5_Final(unsigned char *md, MD5_CTX *c);
43 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
44 | void MD5_Transform(MD5_CTX *c, const unsigned char *b);
45 | # ifdef __cplusplus
46 | }
47 | # endif
48 | # endif
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/mdc2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_MDC2_H
11 | # define HEADER_MDC2_H
12 |
13 | # include
14 |
15 | #ifndef OPENSSL_NO_MDC2
16 | # include
17 | # include
18 | # ifdef __cplusplus
19 | extern "C" {
20 | # endif
21 |
22 | # define MDC2_BLOCK 8
23 | # define MDC2_DIGEST_LENGTH 16
24 |
25 | typedef struct mdc2_ctx_st {
26 | unsigned int num;
27 | unsigned char data[MDC2_BLOCK];
28 | DES_cblock h, hh;
29 | int pad_type; /* either 1 or 2, default 1 */
30 | } MDC2_CTX;
31 |
32 | int MDC2_Init(MDC2_CTX *c);
33 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len);
34 | int MDC2_Final(unsigned char *md, MDC2_CTX *c);
35 | unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md);
36 |
37 | # ifdef __cplusplus
38 | }
39 | # endif
40 | # endif
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/opensslconf.h:
--------------------------------------------------------------------------------
1 | /*
2 | * WARNING: do not edit!
3 | * Generated by Makefile from include/openssl/opensslconf.h.in
4 | *
5 | * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
6 | *
7 | * Licensed under the OpenSSL license (the "License"). You may not use
8 | * this file except in compliance with the License. You can obtain a copy
9 | * in the file LICENSE in the source distribution or at
10 | * https://www.openssl.org/source/license.html
11 | */
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | #ifdef OPENSSL_ALGORITHM_DEFINES
18 | # error OPENSSL_ALGORITHM_DEFINES no longer supported
19 | #endif
20 |
21 | /*
22 | * OpenSSL was configured with the following options:
23 | */
24 |
25 | #ifndef OPENSSL_NO_MD2
26 | # define OPENSSL_NO_MD2
27 | #endif
28 | #ifndef OPENSSL_NO_RC5
29 | # define OPENSSL_NO_RC5
30 | #endif
31 | #ifndef OPENSSL_THREADS
32 | # define OPENSSL_THREADS
33 | #endif
34 | #ifndef OPENSSL_NO_ASAN
35 | # define OPENSSL_NO_ASAN
36 | #endif
37 | #ifndef OPENSSL_NO_ASM
38 | # define OPENSSL_NO_ASM
39 | #endif
40 | #ifndef OPENSSL_NO_CRYPTO_MDEBUG
41 | # define OPENSSL_NO_CRYPTO_MDEBUG
42 | #endif
43 | #ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
44 | # define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
45 | #endif
46 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
47 | # define OPENSSL_NO_EC_NISTP_64_GCC_128
48 | #endif
49 | #ifndef OPENSSL_NO_EGD
50 | # define OPENSSL_NO_EGD
51 | #endif
52 | #ifndef OPENSSL_NO_FUZZ_AFL
53 | # define OPENSSL_NO_FUZZ_AFL
54 | #endif
55 | #ifndef OPENSSL_NO_FUZZ_LIBFUZZER
56 | # define OPENSSL_NO_FUZZ_LIBFUZZER
57 | #endif
58 | #ifndef OPENSSL_NO_HEARTBEATS
59 | # define OPENSSL_NO_HEARTBEATS
60 | #endif
61 | #ifndef OPENSSL_NO_MSAN
62 | # define OPENSSL_NO_MSAN
63 | #endif
64 | #ifndef OPENSSL_NO_SCTP
65 | # define OPENSSL_NO_SCTP
66 | #endif
67 | #ifndef OPENSSL_NO_SSL_TRACE
68 | # define OPENSSL_NO_SSL_TRACE
69 | #endif
70 | #ifndef OPENSSL_NO_SSL3
71 | # define OPENSSL_NO_SSL3
72 | #endif
73 | #ifndef OPENSSL_NO_SSL3_METHOD
74 | # define OPENSSL_NO_SSL3_METHOD
75 | #endif
76 | #ifndef OPENSSL_NO_UBSAN
77 | # define OPENSSL_NO_UBSAN
78 | #endif
79 | #ifndef OPENSSL_NO_UNIT_TEST
80 | # define OPENSSL_NO_UNIT_TEST
81 | #endif
82 | #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
83 | # define OPENSSL_NO_WEAK_SSL_CIPHERS
84 | #endif
85 | #ifndef OPENSSL_NO_AFALGENG
86 | # define OPENSSL_NO_AFALGENG
87 | #endif
88 |
89 |
90 | /*
91 | * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers
92 | * don't like that. This will hopefully silence them.
93 | */
94 | #define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
95 |
96 | /*
97 | * Applications should use -DOPENSSL_API_COMPAT= to suppress the
98 | * declarations of functions deprecated in or before . Otherwise, they
99 | * still won't see them if the library has been built to disable deprecated
100 | * functions.
101 | */
102 | #if defined(OPENSSL_NO_DEPRECATED)
103 | # define DECLARE_DEPRECATED(f)
104 | #elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
105 | # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
106 | #else
107 | # define DECLARE_DEPRECATED(f) f;
108 | #endif
109 |
110 | #ifndef OPENSSL_FILE
111 | # ifdef OPENSSL_NO_FILENAMES
112 | # define OPENSSL_FILE ""
113 | # define OPENSSL_LINE 0
114 | # else
115 | # define OPENSSL_FILE __FILE__
116 | # define OPENSSL_LINE __LINE__
117 | # endif
118 | #endif
119 |
120 | #ifndef OPENSSL_MIN_API
121 | # define OPENSSL_MIN_API 0
122 | #endif
123 |
124 | #if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API
125 | # undef OPENSSL_API_COMPAT
126 | # define OPENSSL_API_COMPAT OPENSSL_MIN_API
127 | #endif
128 |
129 | #if OPENSSL_API_COMPAT < 0x10100000L
130 | # define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f)
131 | #else
132 | # define DEPRECATEDIN_1_1_0(f)
133 | #endif
134 |
135 | #if OPENSSL_API_COMPAT < 0x10000000L
136 | # define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f)
137 | #else
138 | # define DEPRECATEDIN_1_0_0(f)
139 | #endif
140 |
141 | #if OPENSSL_API_COMPAT < 0x00908000L
142 | # define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f)
143 | #else
144 | # define DEPRECATEDIN_0_9_8(f)
145 | #endif
146 |
147 |
148 |
149 | /* Generate 80386 code? */
150 | #undef I386_ONLY
151 |
152 | #undef OPENSSL_UNISTD
153 | #define OPENSSL_UNISTD
154 |
155 | #undef OPENSSL_EXPORT_VAR_AS_FUNCTION
156 |
157 | /*
158 | * The following are cipher-specific, but are part of the public API.
159 | */
160 | #if !defined(OPENSSL_SYS_UEFI)
161 | # define BN_LLONG
162 | /* Only one for the following should be defined */
163 | # undef SIXTY_FOUR_BIT_LONG
164 | # undef SIXTY_FOUR_BIT
165 | # define THIRTY_TWO_BIT
166 | #endif
167 |
168 | #define RC4_INT unsigned char
169 |
170 | #ifdef __cplusplus
171 | }
172 | #endif
173 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/opensslv.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_OPENSSLV_H
11 | # define HEADER_OPENSSLV_H
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | /*-
18 | * Numeric release version identifier:
19 | * MNNFFPPS: major minor fix patch status
20 | * The status nibble has one of the values 0 for development, 1 to e for betas
21 | * 1 to 14, and f for release. The patch level is exactly that.
22 | * For example:
23 | * 0.9.3-dev 0x00903000
24 | * 0.9.3-beta1 0x00903001
25 | * 0.9.3-beta2-dev 0x00903002
26 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev)
27 | * 0.9.3 0x0090300f
28 | * 0.9.3a 0x0090301f
29 | * 0.9.4 0x0090400f
30 | * 1.2.3z 0x102031af
31 | *
32 | * For continuity reasons (because 0.9.5 is already out, and is coded
33 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level
34 | * part is slightly different, by setting the highest bit. This means
35 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start
36 | * with 0x0090600S...
37 | *
38 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.)
39 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
40 | * major minor fix final patch/beta)
41 | */
42 | # define OPENSSL_VERSION_NUMBER 0x1010006fL
43 | # ifdef OPENSSL_FIPS
44 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0f-fips 25 May 2017"
45 | # else
46 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0f 25 May 2017"
47 | # endif
48 |
49 | /*-
50 | * The macros below are to be used for shared library (.so, .dll, ...)
51 | * versioning. That kind of versioning works a bit differently between
52 | * operating systems. The most usual scheme is to set a major and a minor
53 | * number, and have the runtime loader check that the major number is equal
54 | * to what it was at application link time, while the minor number has to
55 | * be greater or equal to what it was at application link time. With this
56 | * scheme, the version number is usually part of the file name, like this:
57 | *
58 | * libcrypto.so.0.9
59 | *
60 | * Some unixen also make a softlink with the major version number only:
61 | *
62 | * libcrypto.so.0
63 | *
64 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the
65 | * shared library version is stored in the file, and is actually a series
66 | * of versions, separated by colons. The rightmost version present in the
67 | * library when linking an application is stored in the application to be
68 | * matched at run time. When the application is run, a check is done to
69 | * see if the library version stored in the application matches any of the
70 | * versions in the version string of the library itself.
71 | * This version string can be constructed in any way, depending on what
72 | * kind of matching is desired. However, to implement the same scheme as
73 | * the one used in the other unixen, all compatible versions, from lowest
74 | * to highest, should be part of the string. Consecutive builds would
75 | * give the following versions strings:
76 | *
77 | * 3.0
78 | * 3.0:3.1
79 | * 3.0:3.1:3.2
80 | * 4.0
81 | * 4.0:4.1
82 | *
83 | * Notice how version 4 is completely incompatible with version, and
84 | * therefore give the breach you can see.
85 | *
86 | * There may be other schemes as well that I haven't yet discovered.
87 | *
88 | * So, here's the way it works here: first of all, the library version
89 | * number doesn't need at all to match the overall OpenSSL version.
90 | * However, it's nice and more understandable if it actually does.
91 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER,
92 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit).
93 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways,
94 | * we need to keep a history of version numbers, which is done in the
95 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and
96 | * should only keep the versions that are binary compatible with the current.
97 | */
98 | # define SHLIB_VERSION_HISTORY ""
99 | # define SHLIB_VERSION_NUMBER "1.1"
100 |
101 |
102 | #ifdef __cplusplus
103 | }
104 | #endif
105 | #endif /* HEADER_OPENSSLV_H */
106 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/pem2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | #ifndef HEADER_PEM_H
15 | int ERR_load_PEM_strings(void);
16 | #endif
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/rand.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_RAND_H
11 | # define HEADER_RAND_H
12 |
13 | # include
14 | # include
15 | # include
16 |
17 | #ifdef __cplusplus
18 | extern "C" {
19 | #endif
20 |
21 | /* Already defined in ossl_typ.h */
22 | /* typedef struct rand_meth_st RAND_METHOD; */
23 |
24 | struct rand_meth_st {
25 | int (*seed) (const void *buf, int num);
26 | int (*bytes) (unsigned char *buf, int num);
27 | void (*cleanup) (void);
28 | int (*add) (const void *buf, int num, double entropy);
29 | int (*pseudorand) (unsigned char *buf, int num);
30 | int (*status) (void);
31 | };
32 |
33 | # ifdef BN_DEBUG
34 | extern int rand_predictable;
35 | # endif
36 |
37 | int RAND_set_rand_method(const RAND_METHOD *meth);
38 | const RAND_METHOD *RAND_get_rand_method(void);
39 | # ifndef OPENSSL_NO_ENGINE
40 | int RAND_set_rand_engine(ENGINE *engine);
41 | # endif
42 | RAND_METHOD *RAND_OpenSSL(void);
43 | #if OPENSSL_API_COMPAT < 0x10100000L
44 | # define RAND_cleanup() while(0) continue
45 | #endif
46 | int RAND_bytes(unsigned char *buf, int num);
47 | DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
48 | void RAND_seed(const void *buf, int num);
49 | #if defined(__ANDROID__) && defined(__NDK_FPABI__)
50 | __NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */
51 | #endif
52 | void RAND_add(const void *buf, int num, double entropy);
53 | int RAND_load_file(const char *file, long max_bytes);
54 | int RAND_write_file(const char *file);
55 | const char *RAND_file_name(char *file, size_t num);
56 | int RAND_status(void);
57 | # ifndef OPENSSL_NO_EGD
58 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
59 | int RAND_egd(const char *path);
60 | int RAND_egd_bytes(const char *path, int bytes);
61 | # endif
62 | int RAND_poll(void);
63 |
64 | #if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H))
65 | /* application has to include in order to use these */
66 | DEPRECATEDIN_1_1_0(void RAND_screen(void))
67 | DEPRECATEDIN_1_1_0(int RAND_event(UINT, WPARAM, LPARAM))
68 | #endif
69 |
70 | /* BEGIN ERROR CODES */
71 | /*
72 | * The following lines are auto generated by the script mkerr.pl. Any changes
73 | * made after this point may be overwritten when the script is next run.
74 | */
75 |
76 | int ERR_load_RAND_strings(void);
77 |
78 | /* Error codes for the RAND functions. */
79 |
80 | /* Function codes. */
81 | # define RAND_F_RAND_BYTES 100
82 |
83 | /* Reason codes. */
84 | # define RAND_R_PRNG_NOT_SEEDED 100
85 |
86 | # ifdef __cplusplus
87 | }
88 | # endif
89 | #endif
90 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/rc2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_RC2_H
11 | # define HEADER_RC2_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_RC2
16 | # ifdef __cplusplus
17 | extern "C" {
18 | # endif
19 |
20 | typedef unsigned int RC2_INT;
21 |
22 | # define RC2_ENCRYPT 1
23 | # define RC2_DECRYPT 0
24 |
25 | # define RC2_BLOCK 8
26 | # define RC2_KEY_LENGTH 16
27 |
28 | typedef struct rc2_key_st {
29 | RC2_INT data[64];
30 | } RC2_KEY;
31 |
32 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits);
33 | void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out,
34 | RC2_KEY *key, int enc);
35 | void RC2_encrypt(unsigned long *data, RC2_KEY *key);
36 | void RC2_decrypt(unsigned long *data, RC2_KEY *key);
37 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
38 | RC2_KEY *ks, unsigned char *iv, int enc);
39 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
40 | long length, RC2_KEY *schedule, unsigned char *ivec,
41 | int *num, int enc);
42 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
43 | long length, RC2_KEY *schedule, unsigned char *ivec,
44 | int *num);
45 |
46 | # ifdef __cplusplus
47 | }
48 | # endif
49 | # endif
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/rc4.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_RC4_H
11 | # define HEADER_RC4_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_RC4
16 | # include
17 | #ifdef __cplusplus
18 | extern "C" {
19 | #endif
20 |
21 | typedef struct rc4_key_st {
22 | RC4_INT x, y;
23 | RC4_INT data[256];
24 | } RC4_KEY;
25 |
26 | const char *RC4_options(void);
27 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
28 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
29 | unsigned char *outdata);
30 |
31 | # ifdef __cplusplus
32 | }
33 | # endif
34 | # endif
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/rc5.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_RC5_H
11 | # define HEADER_RC5_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_RC5
16 | # ifdef __cplusplus
17 | extern "C" {
18 | # endif
19 |
20 | # define RC5_ENCRYPT 1
21 | # define RC5_DECRYPT 0
22 |
23 | # define RC5_32_INT unsigned int
24 |
25 | # define RC5_32_BLOCK 8
26 | # define RC5_32_KEY_LENGTH 16/* This is a default, max is 255 */
27 |
28 | /*
29 | * This are the only values supported. Tweak the code if you want more The
30 | * most supported modes will be RC5-32/12/16 RC5-32/16/8
31 | */
32 | # define RC5_8_ROUNDS 8
33 | # define RC5_12_ROUNDS 12
34 | # define RC5_16_ROUNDS 16
35 |
36 | typedef struct rc5_key_st {
37 | /* Number of rounds */
38 | int rounds;
39 | RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)];
40 | } RC5_32_KEY;
41 |
42 | void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
43 | int rounds);
44 | void RC5_32_ecb_encrypt(const unsigned char *in, unsigned char *out,
45 | RC5_32_KEY *key, int enc);
46 | void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key);
47 | void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key);
48 | void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out,
49 | long length, RC5_32_KEY *ks, unsigned char *iv,
50 | int enc);
51 | void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out,
52 | long length, RC5_32_KEY *schedule,
53 | unsigned char *ivec, int *num, int enc);
54 | void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out,
55 | long length, RC5_32_KEY *schedule,
56 | unsigned char *ivec, int *num);
57 |
58 | # ifdef __cplusplus
59 | }
60 | # endif
61 | # endif
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/ripemd.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_RIPEMD_H
11 | # define HEADER_RIPEMD_H
12 |
13 | # include
14 |
15 | #ifndef OPENSSL_NO_RMD160
16 | # include
17 | # include
18 | # ifdef __cplusplus
19 | extern "C" {
20 | # endif
21 |
22 | # define RIPEMD160_LONG unsigned int
23 |
24 | # define RIPEMD160_CBLOCK 64
25 | # define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4)
26 | # define RIPEMD160_DIGEST_LENGTH 20
27 |
28 | typedef struct RIPEMD160state_st {
29 | RIPEMD160_LONG A, B, C, D, E;
30 | RIPEMD160_LONG Nl, Nh;
31 | RIPEMD160_LONG data[RIPEMD160_LBLOCK];
32 | unsigned int num;
33 | } RIPEMD160_CTX;
34 |
35 | int RIPEMD160_Init(RIPEMD160_CTX *c);
36 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len);
37 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
38 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md);
39 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b);
40 |
41 | # ifdef __cplusplus
42 | }
43 | # endif
44 | # endif
45 |
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/seed.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | /*
11 | * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved.
12 | *
13 | * Redistribution and use in source and binary forms, with or without
14 | * modification, are permitted provided that the following conditions
15 | * are met:
16 | * 1. Redistributions of source code must retain the above copyright
17 | * notice, this list of conditions and the following disclaimer.
18 | * 2. Neither the name of author nor the names of its contributors may
19 | * be used to endorse or promote products derived from this software
20 | * without specific prior written permission.
21 | *
22 | * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 | * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 | * SUCH DAMAGE.
33 | */
34 |
35 | #ifndef HEADER_SEED_H
36 | # define HEADER_SEED_H
37 |
38 | # include
39 |
40 | # ifndef OPENSSL_NO_SEED
41 | # include
42 | # include
43 |
44 | #ifdef __cplusplus
45 | extern "C" {
46 | #endif
47 |
48 | /* look whether we need 'long' to get 32 bits */
49 | # ifdef AES_LONG
50 | # ifndef SEED_LONG
51 | # define SEED_LONG 1
52 | # endif
53 | # endif
54 |
55 | # if !defined(NO_SYS_TYPES_H)
56 | # include
57 | # endif
58 |
59 | # define SEED_BLOCK_SIZE 16
60 | # define SEED_KEY_LENGTH 16
61 |
62 | typedef struct seed_key_st {
63 | # ifdef SEED_LONG
64 | unsigned long data[32];
65 | # else
66 | unsigned int data[32];
67 | # endif
68 | } SEED_KEY_SCHEDULE;
69 |
70 | void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
71 | SEED_KEY_SCHEDULE *ks);
72 |
73 | void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE],
74 | unsigned char d[SEED_BLOCK_SIZE],
75 | const SEED_KEY_SCHEDULE *ks);
76 | void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE],
77 | unsigned char d[SEED_BLOCK_SIZE],
78 | const SEED_KEY_SCHEDULE *ks);
79 |
80 | void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out,
81 | const SEED_KEY_SCHEDULE *ks, int enc);
82 | void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len,
83 | const SEED_KEY_SCHEDULE *ks,
84 | unsigned char ivec[SEED_BLOCK_SIZE], int enc);
85 | void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out,
86 | size_t len, const SEED_KEY_SCHEDULE *ks,
87 | unsigned char ivec[SEED_BLOCK_SIZE], int *num,
88 | int enc);
89 | void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out,
90 | size_t len, const SEED_KEY_SCHEDULE *ks,
91 | unsigned char ivec[SEED_BLOCK_SIZE], int *num);
92 |
93 | # ifdef __cplusplus
94 | }
95 | # endif
96 | # endif
97 |
98 | #endif
99 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/sha.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_SHA_H
11 | # define HEADER_SHA_H
12 |
13 | # include
14 | # include
15 |
16 | #ifdef __cplusplus
17 | extern "C" {
18 | #endif
19 |
20 | /*-
21 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
22 | * ! SHA_LONG has to be at least 32 bits wide. !
23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24 | */
25 | # define SHA_LONG unsigned int
26 |
27 | # define SHA_LBLOCK 16
28 | # define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a
29 | * contiguous array of 32 bit wide
30 | * big-endian values. */
31 | # define SHA_LAST_BLOCK (SHA_CBLOCK-8)
32 | # define SHA_DIGEST_LENGTH 20
33 |
34 | typedef struct SHAstate_st {
35 | SHA_LONG h0, h1, h2, h3, h4;
36 | SHA_LONG Nl, Nh;
37 | SHA_LONG data[SHA_LBLOCK];
38 | unsigned int num;
39 | } SHA_CTX;
40 |
41 | int SHA1_Init(SHA_CTX *c);
42 | int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
43 | int SHA1_Final(unsigned char *md, SHA_CTX *c);
44 | unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
45 | void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
46 |
47 | # define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a
48 | * contiguous array of 32 bit wide
49 | * big-endian values. */
50 |
51 | typedef struct SHA256state_st {
52 | SHA_LONG h[8];
53 | SHA_LONG Nl, Nh;
54 | SHA_LONG data[SHA_LBLOCK];
55 | unsigned int num, md_len;
56 | } SHA256_CTX;
57 |
58 | int SHA224_Init(SHA256_CTX *c);
59 | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len);
60 | int SHA224_Final(unsigned char *md, SHA256_CTX *c);
61 | unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md);
62 | int SHA256_Init(SHA256_CTX *c);
63 | int SHA256_Update(SHA256_CTX *c, const void *data, size_t len);
64 | int SHA256_Final(unsigned char *md, SHA256_CTX *c);
65 | unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
66 | void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
67 |
68 | # define SHA224_DIGEST_LENGTH 28
69 | # define SHA256_DIGEST_LENGTH 32
70 | # define SHA384_DIGEST_LENGTH 48
71 | # define SHA512_DIGEST_LENGTH 64
72 |
73 | /*
74 | * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64
75 | * being exactly 64-bit wide. See Implementation Notes in sha512.c
76 | * for further details.
77 | */
78 | /*
79 | * SHA-512 treats input data as a
80 | * contiguous array of 64 bit
81 | * wide big-endian values.
82 | */
83 | # define SHA512_CBLOCK (SHA_LBLOCK*8)
84 | # if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
85 | # define SHA_LONG64 unsigned __int64
86 | # define U64(C) C##UI64
87 | # elif defined(__arch64__)
88 | # define SHA_LONG64 unsigned long
89 | # define U64(C) C##UL
90 | # else
91 | # define SHA_LONG64 unsigned long long
92 | # define U64(C) C##ULL
93 | # endif
94 |
95 | typedef struct SHA512state_st {
96 | SHA_LONG64 h[8];
97 | SHA_LONG64 Nl, Nh;
98 | union {
99 | SHA_LONG64 d[SHA_LBLOCK];
100 | unsigned char p[SHA512_CBLOCK];
101 | } u;
102 | unsigned int num, md_len;
103 | } SHA512_CTX;
104 |
105 | int SHA384_Init(SHA512_CTX *c);
106 | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len);
107 | int SHA384_Final(unsigned char *md, SHA512_CTX *c);
108 | unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
109 | int SHA512_Init(SHA512_CTX *c);
110 | int SHA512_Update(SHA512_CTX *c, const void *data, size_t len);
111 | int SHA512_Final(unsigned char *md, SHA512_CTX *c);
112 | unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
113 | void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
114 |
115 | #ifdef __cplusplus
116 | }
117 | #endif
118 |
119 | #endif
120 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/srp.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_SRP_H
11 | # define HEADER_SRP_H
12 |
13 | #include
14 |
15 | #ifndef OPENSSL_NO_SRP
16 | # include
17 | # include
18 | # include
19 | # include
20 | # include
21 |
22 | # ifdef __cplusplus
23 | extern "C" {
24 | # endif
25 |
26 | typedef struct SRP_gN_cache_st {
27 | char *b64_bn;
28 | BIGNUM *bn;
29 | } SRP_gN_cache;
30 |
31 |
32 | DEFINE_STACK_OF(SRP_gN_cache)
33 |
34 | typedef struct SRP_user_pwd_st {
35 | /* Owned by us. */
36 | char *id;
37 | BIGNUM *s;
38 | BIGNUM *v;
39 | /* Not owned by us. */
40 | const BIGNUM *g;
41 | const BIGNUM *N;
42 | /* Owned by us. */
43 | char *info;
44 | } SRP_user_pwd;
45 |
46 | void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
47 |
48 | DEFINE_STACK_OF(SRP_user_pwd)
49 |
50 | typedef struct SRP_VBASE_st {
51 | STACK_OF(SRP_user_pwd) *users_pwd;
52 | STACK_OF(SRP_gN_cache) *gN_cache;
53 | /* to simulate a user */
54 | char *seed_key;
55 | const BIGNUM *default_g;
56 | const BIGNUM *default_N;
57 | } SRP_VBASE;
58 |
59 | /*
60 | * Internal structure storing N and g pair
61 | */
62 | typedef struct SRP_gN_st {
63 | char *id;
64 | const BIGNUM *g;
65 | const BIGNUM *N;
66 | } SRP_gN;
67 |
68 | DEFINE_STACK_OF(SRP_gN)
69 |
70 | SRP_VBASE *SRP_VBASE_new(char *seed_key);
71 | void SRP_VBASE_free(SRP_VBASE *vb);
72 | int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
73 |
74 | /* This method ignores the configured seed and fails for an unknown user. */
75 | DEPRECATEDIN_1_1_0(SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username))
76 | /* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/
77 | SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
78 |
79 | char *SRP_create_verifier(const char *user, const char *pass, char **salt,
80 | char **verifier, const char *N, const char *g);
81 | int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
82 | BIGNUM **verifier, const BIGNUM *N,
83 | const BIGNUM *g);
84 |
85 | # define SRP_NO_ERROR 0
86 | # define SRP_ERR_VBASE_INCOMPLETE_FILE 1
87 | # define SRP_ERR_VBASE_BN_LIB 2
88 | # define SRP_ERR_OPEN_FILE 3
89 | # define SRP_ERR_MEMORY 4
90 |
91 | # define DB_srptype 0
92 | # define DB_srpverifier 1
93 | # define DB_srpsalt 2
94 | # define DB_srpid 3
95 | # define DB_srpgN 4
96 | # define DB_srpinfo 5
97 | # undef DB_NUMBER
98 | # define DB_NUMBER 6
99 |
100 | # define DB_SRP_INDEX 'I'
101 | # define DB_SRP_VALID 'V'
102 | # define DB_SRP_REVOKED 'R'
103 | # define DB_SRP_MODIF 'v'
104 |
105 | /* see srp.c */
106 | char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N);
107 | SRP_gN *SRP_get_default_gN(const char *id);
108 |
109 | /* server side .... */
110 | BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u,
111 | const BIGNUM *b, const BIGNUM *N);
112 | BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
113 | const BIGNUM *v);
114 | int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N);
115 | BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N);
116 |
117 | /* client side .... */
118 | BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass);
119 | BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g);
120 | BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
121 | const BIGNUM *x, const BIGNUM *a, const BIGNUM *u);
122 | int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N);
123 |
124 | # define SRP_MINIMAL_N 1024
125 |
126 | # ifdef __cplusplus
127 | }
128 | # endif
129 | # endif
130 |
131 | #endif
132 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/srtp.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | /*
11 | * DTLS code by Eric Rescorla
12 | *
13 | * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc.
14 | */
15 |
16 | #ifndef HEADER_D1_SRTP_H
17 | # define HEADER_D1_SRTP_H
18 |
19 | # include
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | # define SRTP_AES128_CM_SHA1_80 0x0001
26 | # define SRTP_AES128_CM_SHA1_32 0x0002
27 | # define SRTP_AES128_F8_SHA1_80 0x0003
28 | # define SRTP_AES128_F8_SHA1_32 0x0004
29 | # define SRTP_NULL_SHA1_80 0x0005
30 | # define SRTP_NULL_SHA1_32 0x0006
31 |
32 | /* AEAD SRTP protection profiles from RFC 7714 */
33 | # define SRTP_AEAD_AES_128_GCM 0x0007
34 | # define SRTP_AEAD_AES_256_GCM 0x0008
35 |
36 | # ifndef OPENSSL_NO_SRTP
37 |
38 | __owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
39 | __owur int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles);
40 |
41 | __owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);
42 | __owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
43 |
44 | # endif
45 |
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/ssl2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_SSL2_H
11 | # define HEADER_SSL2_H
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | # define SSL2_VERSION 0x0002
18 |
19 | # define SSL2_MT_CLIENT_HELLO 1
20 |
21 | #ifdef __cplusplus
22 | }
23 | #endif
24 | #endif
25 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/stack.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_STACK_H
11 | # define HEADER_STACK_H
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */
18 |
19 | typedef int (*OPENSSL_sk_compfunc)(const void *, const void *);
20 | typedef void (*OPENSSL_sk_freefunc)(void *);
21 | typedef void *(*OPENSSL_sk_copyfunc)(const void *);
22 |
23 | int OPENSSL_sk_num(const OPENSSL_STACK *);
24 | void *OPENSSL_sk_value(const OPENSSL_STACK *, int);
25 |
26 | void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data);
27 |
28 | OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc cmp);
29 | OPENSSL_STACK *OPENSSL_sk_new_null(void);
30 | void OPENSSL_sk_free(OPENSSL_STACK *);
31 | void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *));
32 | OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *, OPENSSL_sk_copyfunc c, OPENSSL_sk_freefunc f);
33 | int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where);
34 | void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc);
35 | void *OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p);
36 | int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data);
37 | int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data);
38 | int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data);
39 | int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data);
40 | void *OPENSSL_sk_shift(OPENSSL_STACK *st);
41 | void *OPENSSL_sk_pop(OPENSSL_STACK *st);
42 | void OPENSSL_sk_zero(OPENSSL_STACK *st);
43 | OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk, OPENSSL_sk_compfunc cmp);
44 | OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *st);
45 | void OPENSSL_sk_sort(OPENSSL_STACK *st);
46 | int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st);
47 |
48 | # if OPENSSL_API_COMPAT < 0x10100000L
49 | # define _STACK OPENSSL_STACK
50 | # define sk_num OPENSSL_sk_num
51 | # define sk_value OPENSSL_sk_value
52 | # define sk_set OPENSSL_sk_set
53 | # define sk_new OPENSSL_sk_new
54 | # define sk_new_null OPENSSL_sk_new_null
55 | # define sk_free OPENSSL_sk_free
56 | # define sk_pop_free OPENSSL_sk_pop_free
57 | # define sk_deep_copy OPENSSL_sk_deep_copy
58 | # define sk_insert OPENSSL_sk_insert
59 | # define sk_delete OPENSSL_sk_delete
60 | # define sk_delete_ptr OPENSSL_sk_delete_ptr
61 | # define sk_find OPENSSL_sk_find
62 | # define sk_find_ex OPENSSL_sk_find_ex
63 | # define sk_push OPENSSL_sk_push
64 | # define sk_unshift OPENSSL_sk_unshift
65 | # define sk_shift OPENSSL_sk_shift
66 | # define sk_pop OPENSSL_sk_pop
67 | # define sk_zero OPENSSL_sk_zero
68 | # define sk_set_cmp_func OPENSSL_sk_set_cmp_func
69 | # define sk_dup OPENSSL_sk_dup
70 | # define sk_sort OPENSSL_sk_sort
71 | # define sk_is_sorted OPENSSL_sk_is_sorted
72 | # endif
73 |
74 | #ifdef __cplusplus
75 | }
76 | #endif
77 |
78 | #endif
79 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/symhacks.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_SYMHACKS_H
11 | # define HEADER_SYMHACKS_H
12 |
13 | # include
14 |
15 | /* Case insensitive linking causes problems.... */
16 | # if defined(OPENSSL_SYS_VMS)
17 | # undef ERR_load_CRYPTO_strings
18 | # define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
19 | # undef OCSP_crlID_new
20 | # define OCSP_crlID_new OCSP_crlID2_new
21 |
22 | # undef d2i_ECPARAMETERS
23 | # define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS
24 | # undef i2d_ECPARAMETERS
25 | # define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS
26 | # undef d2i_ECPKPARAMETERS
27 | # define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS
28 | # undef i2d_ECPKPARAMETERS
29 | # define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS
30 |
31 | /*
32 | * These functions do not seem to exist! However, I'm paranoid... Original
33 | * command in x509v3.h: These functions are being redefined in another
34 | * directory, and clash when the linker is case-insensitive, so let's hide
35 | * them a little, by giving them an extra 'o' at the beginning of the name...
36 | */
37 | # undef X509v3_cleanup_extensions
38 | # define X509v3_cleanup_extensions oX509v3_cleanup_extensions
39 | # undef X509v3_add_extension
40 | # define X509v3_add_extension oX509v3_add_extension
41 | # undef X509v3_add_netscape_extensions
42 | # define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions
43 | # undef X509v3_add_standard_extensions
44 | # define X509v3_add_standard_extensions oX509v3_add_standard_extensions
45 |
46 | /* This one clashes with CMS_data_create */
47 | # undef cms_Data_create
48 | # define cms_Data_create priv_cms_Data_create
49 |
50 | # endif
51 |
52 | #endif /* ! defined HEADER_VMS_IDHACKS_H */
53 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/txt_db.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_TXT_DB_H
11 | # define HEADER_TXT_DB_H
12 |
13 | # include
14 | # include
15 | # include
16 | # include
17 |
18 | # define DB_ERROR_OK 0
19 | # define DB_ERROR_MALLOC 1
20 | # define DB_ERROR_INDEX_CLASH 2
21 | # define DB_ERROR_INDEX_OUT_OF_RANGE 3
22 | # define DB_ERROR_NO_INDEX 4
23 | # define DB_ERROR_INSERT_INDEX_CLASH 5
24 | # define DB_ERROR_WRONG_NUM_FIELDS 6
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | typedef OPENSSL_STRING *OPENSSL_PSTRING;
31 | DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING)
32 |
33 | typedef struct txt_db_st {
34 | int num_fields;
35 | STACK_OF(OPENSSL_PSTRING) *data;
36 | LHASH_OF(OPENSSL_STRING) **index;
37 | int (**qual) (OPENSSL_STRING *);
38 | long error;
39 | long arg1;
40 | long arg2;
41 | OPENSSL_STRING *arg_row;
42 | } TXT_DB;
43 |
44 | TXT_DB *TXT_DB_read(BIO *in, int num);
45 | long TXT_DB_write(BIO *out, TXT_DB *db);
46 | int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *),
47 | OPENSSL_LH_HASHFUNC hash, OPENSSL_LH_COMPFUNC cmp);
48 | void TXT_DB_free(TXT_DB *db);
49 | OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx,
50 | OPENSSL_STRING *value);
51 | int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value);
52 |
53 | #ifdef __cplusplus
54 | }
55 | #endif
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/openssl/whrlpool.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
3 | *
4 | * Licensed under the OpenSSL license (the "License"). You may not use
5 | * this file except in compliance with the License. You can obtain a copy
6 | * in the file LICENSE in the source distribution or at
7 | * https://www.openssl.org/source/license.html
8 | */
9 |
10 | #ifndef HEADER_WHRLPOOL_H
11 | # define HEADER_WHRLPOOL_H
12 |
13 | #include
14 |
15 | # ifndef OPENSSL_NO_WHIRLPOOL
16 | # include
17 | # include
18 | # ifdef __cplusplus
19 | extern "C" {
20 | # endif
21 |
22 | # define WHIRLPOOL_DIGEST_LENGTH (512/8)
23 | # define WHIRLPOOL_BBLOCK 512
24 | # define WHIRLPOOL_COUNTER (256/8)
25 |
26 | typedef struct {
27 | union {
28 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH];
29 | /* double q is here to ensure 64-bit alignment */
30 | double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];
31 | } H;
32 | unsigned char data[WHIRLPOOL_BBLOCK / 8];
33 | unsigned int bitoff;
34 | size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
35 | } WHIRLPOOL_CTX;
36 |
37 | int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
38 | int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes);
39 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits);
40 | int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
41 | unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md);
42 |
43 | # ifdef __cplusplus
44 | }
45 | # endif
46 | # endif
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/psa/crypto_builtin_primitives.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Context structure declaration of the Mbed TLS software-based PSA drivers
3 | * called through the PSA Crypto driver dispatch layer.
4 | * This file contains the context structures of those algorithms which do not
5 | * rely on other algorithms, i.e. are 'primitive' algorithms.
6 | *
7 | * \note This file may not be included directly. Applications must
8 | * include psa/crypto.h.
9 | *
10 | * \note This header and its content is not part of the Mbed TLS API and
11 | * applications must not depend on it. Its main purpose is to define the
12 | * multi-part state objects of the Mbed TLS software-based PSA drivers. The
13 | * definition of these objects are then used by crypto_struct.h to define the
14 | * implementation-defined types of PSA multi-part state objects.
15 | */
16 | /*
17 | * Copyright The Mbed TLS Contributors
18 | * SPDX-License-Identifier: Apache-2.0
19 | *
20 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
21 | * not use this file except in compliance with the License.
22 | * You may obtain a copy of the License at
23 | *
24 | * http://www.apache.org/licenses/LICENSE-2.0
25 | *
26 | * Unless required by applicable law or agreed to in writing, software
27 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
28 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 | * See the License for the specific language governing permissions and
30 | * limitations under the License.
31 | */
32 |
33 | #ifndef PSA_CRYPTO_BUILTIN_PRIMITIVES_H
34 | #define PSA_CRYPTO_BUILTIN_PRIMITIVES_H
35 | #include "mbedtls/private_access.h"
36 |
37 | #include
38 |
39 | /*
40 | * Hash multi-part operation definitions.
41 | */
42 |
43 | #include "mbedtls/md5.h"
44 | #include "mbedtls/ripemd160.h"
45 | #include "mbedtls/sha1.h"
46 | #include "mbedtls/sha256.h"
47 | #include "mbedtls/sha512.h"
48 |
49 | #if defined(MBEDTLS_PSA_BUILTIN_ALG_MD5) || \
50 | defined(MBEDTLS_PSA_BUILTIN_ALG_RIPEMD160) || \
51 | defined(MBEDTLS_PSA_BUILTIN_ALG_SHA_1) || \
52 | defined(MBEDTLS_PSA_BUILTIN_ALG_SHA_224) || \
53 | defined(MBEDTLS_PSA_BUILTIN_ALG_SHA_256) || \
54 | defined(MBEDTLS_PSA_BUILTIN_ALG_SHA_384) || \
55 | defined(MBEDTLS_PSA_BUILTIN_ALG_SHA_512)
56 | #define MBEDTLS_PSA_BUILTIN_HASH
57 | #endif
58 |
59 | typedef struct {
60 | psa_algorithm_t MBEDTLS_PRIVATE(alg);
61 | union {
62 | unsigned dummy; /* Make the union non-empty even with no supported algorithms. */
63 | #if defined(MBEDTLS_PSA_BUILTIN_ALG_MD5)
64 | mbedtls_md5_context md5;
65 | #endif
66 | #if defined(MBEDTLS_PSA_BUILTIN_ALG_RIPEMD160)
67 | mbedtls_ripemd160_context ripemd160;
68 | #endif
69 | #if defined(MBEDTLS_PSA_BUILTIN_ALG_SHA_1)
70 | mbedtls_sha1_context sha1;
71 | #endif
72 | #if defined(MBEDTLS_PSA_BUILTIN_ALG_SHA_256) || \
73 | defined(MBEDTLS_PSA_BUILTIN_ALG_SHA_224)
74 | mbedtls_sha256_context sha256;
75 | #endif
76 | #if defined(MBEDTLS_PSA_BUILTIN_ALG_SHA_512) || \
77 | defined(MBEDTLS_PSA_BUILTIN_ALG_SHA_384)
78 | mbedtls_sha512_context sha512;
79 | #endif
80 | } MBEDTLS_PRIVATE(ctx);
81 | } mbedtls_psa_hash_operation_t;
82 |
83 | #define MBEDTLS_PSA_HASH_OPERATION_INIT { 0, { 0 } }
84 |
85 | /*
86 | * Cipher multi-part operation definitions.
87 | */
88 |
89 | #include "mbedtls/cipher.h"
90 |
91 | #if defined(MBEDTLS_PSA_BUILTIN_ALG_STREAM_CIPHER) || \
92 | defined(MBEDTLS_PSA_BUILTIN_ALG_CTR) || \
93 | defined(MBEDTLS_PSA_BUILTIN_ALG_CFB) || \
94 | defined(MBEDTLS_PSA_BUILTIN_ALG_OFB) || \
95 | defined(MBEDTLS_PSA_BUILTIN_ALG_ECB_NO_PADDING) || \
96 | defined(MBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING) || \
97 | defined(MBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS7)
98 | #define MBEDTLS_PSA_BUILTIN_CIPHER 1
99 | #endif
100 |
101 | typedef struct {
102 | /* Context structure for the Mbed TLS cipher implementation. */
103 | psa_algorithm_t MBEDTLS_PRIVATE(alg);
104 | uint8_t MBEDTLS_PRIVATE(iv_length);
105 | uint8_t MBEDTLS_PRIVATE(block_length);
106 | union {
107 | unsigned int MBEDTLS_PRIVATE(dummy);
108 | mbedtls_cipher_context_t MBEDTLS_PRIVATE(cipher);
109 | } MBEDTLS_PRIVATE(ctx);
110 | } mbedtls_psa_cipher_operation_t;
111 |
112 | #define MBEDTLS_PSA_CIPHER_OPERATION_INIT { 0, 0, 0, { 0 } }
113 |
114 | #endif /* PSA_CRYPTO_BUILTIN_PRIMITIVES_H */
115 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/psa/crypto_driver_common.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file psa/crypto_driver_common.h
3 | * \brief Definitions for all PSA crypto drivers
4 | *
5 | * This file contains common definitions shared by all PSA crypto drivers.
6 | * Do not include it directly: instead, include the header file(s) for
7 | * the type(s) of driver that you are implementing. For example, if
8 | * you are writing a dynamically registered driver for a secure element,
9 | * include `psa/crypto_se_driver.h`.
10 | *
11 | * This file is part of the PSA Crypto Driver Model, containing functions for
12 | * driver developers to implement to enable hardware to be called in a
13 | * standardized way by a PSA Cryptographic API implementation. The functions
14 | * comprising the driver model, which driver authors implement, are not
15 | * intended to be called by application developers.
16 | */
17 |
18 | /*
19 | * Copyright The Mbed TLS Contributors
20 | * SPDX-License-Identifier: Apache-2.0
21 | *
22 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
23 | * not use this file except in compliance with the License.
24 | * You may obtain a copy of the License at
25 | *
26 | * http://www.apache.org/licenses/LICENSE-2.0
27 | *
28 | * Unless required by applicable law or agreed to in writing, software
29 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
30 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 | * See the License for the specific language governing permissions and
32 | * limitations under the License.
33 | */
34 | #ifndef PSA_CRYPTO_DRIVER_COMMON_H
35 | #define PSA_CRYPTO_DRIVER_COMMON_H
36 |
37 | #include
38 | #include
39 |
40 | /* Include type definitions (psa_status_t, psa_algorithm_t,
41 | * psa_key_type_t, etc.) and macros to build and analyze values
42 | * of these types. */
43 | #include "crypto_types.h"
44 | #include "crypto_values.h"
45 | /* Include size definitions which are used to size some arrays in operation
46 | * structures. */
47 | #include
48 |
49 | /** For encrypt-decrypt functions, whether the operation is an encryption
50 | * or a decryption. */
51 | typedef enum {
52 | PSA_CRYPTO_DRIVER_DECRYPT,
53 | PSA_CRYPTO_DRIVER_ENCRYPT
54 | } psa_encrypt_or_decrypt_t;
55 |
56 | #endif /* PSA_CRYPTO_DRIVER_COMMON_H */
57 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/include/psa/crypto_platform.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file psa/crypto_platform.h
3 | *
4 | * \brief PSA cryptography module: Mbed TLS platform definitions
5 | *
6 | * \note This file may not be included directly. Applications must
7 | * include psa/crypto.h.
8 | *
9 | * This file contains platform-dependent type definitions.
10 | *
11 | * In implementations with isolation between the application and the
12 | * cryptography module, implementers should take care to ensure that
13 | * the definitions that are exposed to applications match what the
14 | * module implements.
15 | */
16 | /*
17 | * Copyright The Mbed TLS Contributors
18 | * SPDX-License-Identifier: Apache-2.0
19 | *
20 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
21 | * not use this file except in compliance with the License.
22 | * You may obtain a copy of the License at
23 | *
24 | * http://www.apache.org/licenses/LICENSE-2.0
25 | *
26 | * Unless required by applicable law or agreed to in writing, software
27 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
28 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 | * See the License for the specific language governing permissions and
30 | * limitations under the License.
31 | */
32 |
33 | #ifndef PSA_CRYPTO_PLATFORM_H
34 | #define PSA_CRYPTO_PLATFORM_H
35 | #include "mbedtls/private_access.h"
36 |
37 | /* Include the Mbed TLS configuration file, the way Mbed TLS does it
38 | * in each of its header files. */
39 | #include "mbedtls/build_info.h"
40 |
41 | /* Translate between classic MBEDTLS_xxx feature symbols and PSA_xxx
42 | * feature symbols. */
43 | #include "mbedtls/config_psa.h"
44 |
45 | /* PSA requires several types which C99 provides in stdint.h. */
46 | #include
47 |
48 | #if defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER)
49 |
50 | /* Building for the PSA Crypto service on a PSA platform, a key owner is a PSA
51 | * partition identifier.
52 | *
53 | * The function psa_its_identifier_of_slot() in psa_crypto_storage.c that
54 | * translates a key identifier to a key storage file name assumes that
55 | * mbedtls_key_owner_id_t is a 32-bit integer. This function thus needs
56 | * reworking if mbedtls_key_owner_id_t is not defined as a 32-bit integer
57 | * here anymore.
58 | */
59 | typedef int32_t mbedtls_key_owner_id_t;
60 |
61 | /** Compare two key owner identifiers.
62 | *
63 | * \param id1 First key owner identifier.
64 | * \param id2 Second key owner identifier.
65 | *
66 | * \return Non-zero if the two key owner identifiers are equal, zero otherwise.
67 | */
68 | static inline int mbedtls_key_owner_id_equal(mbedtls_key_owner_id_t id1,
69 | mbedtls_key_owner_id_t id2)
70 | {
71 | return id1 == id2;
72 | }
73 |
74 | #endif /* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
75 |
76 | /*
77 | * When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is being built for SPM
78 | * (Secure Partition Manager) integration which separates the code into two
79 | * parts: NSPE (Non-Secure Processing Environment) and SPE (Secure Processing
80 | * Environment). When building for the SPE, an additional header file should be
81 | * included.
82 | */
83 | #if defined(MBEDTLS_PSA_CRYPTO_SPM)
84 | #define PSA_CRYPTO_SECURE 1
85 | #include "crypto_spe.h"
86 | #endif // MBEDTLS_PSA_CRYPTO_SPM
87 |
88 | #if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)
89 | /** The type of the context passed to mbedtls_psa_external_get_random().
90 | *
91 | * Mbed TLS initializes the context to all-bits-zero before calling
92 | * mbedtls_psa_external_get_random() for the first time.
93 | *
94 | * The definition of this type in the Mbed TLS source code is for
95 | * demonstration purposes. Implementers of mbedtls_psa_external_get_random()
96 | * are expected to replace it with a custom definition.
97 | */
98 | typedef struct {
99 | uintptr_t MBEDTLS_PRIVATE(opaque)[2];
100 | } mbedtls_psa_external_random_context_t;
101 | #endif /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */
102 |
103 | #endif /* PSA_CRYPTO_PLATFORM_H */
104 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64/libcrypto.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64/libcrypto.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64/libcurl.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64/libmbedcrypto.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64/libmbedcrypto.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64/libmbedtls.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64/libmbedtls.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64/libmbedx509.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64/libmbedx509.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64/libnghttp2.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64/libnghttp2.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64/libssl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64/libssl.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64bak/libcrypto.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64bak/libcrypto.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64bak/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64bak/libcurl.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64bak/libmbedcrypto.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64bak/libmbedcrypto.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64bak/libmbedtls.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64bak/libmbedtls.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64bak/libmbedx509.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64bak/libmbedx509.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64bak/libnghttp2.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64bak/libnghttp2.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/arm64bak/libssl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/arm64bak/libssl.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/v7a/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/v7a/libcurl.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/v7a/libmbedcrypto.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/v7a/libmbedcrypto.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/v7a/libmbedtls.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/v7a/libmbedtls.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/v7a/libmbedx509.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/v7a/libmbedx509.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/v7a/libnghttp2.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/v7a/libnghttp2.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/v7a/libssl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/v7a/libssl.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/x86/libcrypto.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/x86/libcrypto.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/x86/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/x86/libcurl.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/x86/libcurl.la:
--------------------------------------------------------------------------------
1 | # libcurl.la - a libtool library file
2 | # Generated by libtool (GNU libtool) 2.4
3 | #
4 | # Please DO NOT delete this file!
5 | # It is necessary for linking the library.
6 |
7 | # The name that we can dlopen(3).
8 | dlname=''
9 |
10 | # Names of this library.
11 | library_names=''
12 |
13 | # The name of the static archive.
14 | old_library='libcurl.a'
15 |
16 | # Linker flags that can not go in dependency_libs.
17 | inherited_linker_flags=''
18 |
19 | # Libraries that this one depends upon.
20 | dependency_libs=' -L=/usr/lib -lssl -lcrypto -lz'
21 |
22 | # Names of additional weak libraries provided by this library
23 | weak_library_names=''
24 |
25 | # Version information for libcurl.
26 | current=9
27 | age=5
28 | revision=0
29 |
30 | # Is this an already installed library?
31 | installed=yes
32 |
33 | # Should we warn about portability when linking against -modules?
34 | shouldnotlink=no
35 |
36 | # Files to dlopen/dlpreopen
37 | dlopen=''
38 | dlpreopen=''
39 |
40 | # Directory that this library needs to be installed in:
41 | libdir='/Users/yutianzuo/code/github/build_script/curl_x86_out/lib'
42 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/x86/libssl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/x86/libssl.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/x86/pkgconfig/libcurl.pc:
--------------------------------------------------------------------------------
1 | #***************************************************************************
2 | # _ _ ____ _
3 | # Project ___| | | | _ \| |
4 | # / __| | | | |_) | |
5 | # | (__| |_| | _ <| |___
6 | # \___|\___/|_| \_\_____|
7 | #
8 | # Copyright (C) 1998 - 2012, Daniel Stenberg, , et al.
9 | #
10 | # This software is licensed as described in the file COPYING, which
11 | # you should have received as part of this distribution. The terms
12 | # are also available at https://curl.haxx.se/docs/copyright.html.
13 | #
14 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 | # copies of the Software, and permit persons to whom the Software is
16 | # furnished to do so, under the terms of the COPYING file.
17 | #
18 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 | # KIND, either express or implied.
20 | #
21 | ###########################################################################
22 |
23 | # This should most probably benefit from getting a "Requires:" field added
24 | # dynamically by configure.
25 | #
26 | prefix=/Users/yutianzuo/code/github/build_script/curl_x86_out
27 | exec_prefix=${prefix}
28 | libdir=${exec_prefix}/lib
29 | includedir=${prefix}/include
30 | supported_protocols="FILE FTP FTPS HTTP HTTPS TFTP"
31 | supported_features="SSL IPv6 UnixSockets libz AsynchDNS NTLM NTLM_WB TLS-SRP HTTPS-proxy"
32 |
33 | Name: libcurl
34 | URL: https://curl.haxx.se/
35 | Description: Library to transfer files with ftp, http, etc.
36 | Version: 7.59.0
37 | Libs: -L${libdir} -lcurl
38 | Libs.private: -lssl -lcrypto -lz
39 | Cflags: -I${includedir} -DCURL_STATICLIB
40 |
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/x86_64/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/x86_64/libcurl.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/x86_64/libmbedcrypto.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/x86_64/libmbedcrypto.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/x86_64/libmbedtls.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/x86_64/libmbedtls.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/x86_64/libmbedx509.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/x86_64/libmbedx509.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/lib/x86_64/libnghttp2.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yutianzuo/android-curl/f5520318c164e05bcc58eb1398aec37c98fbdfb9/curl_native/src/main/cpp/lib/x86_64/libnghttp2.a
--------------------------------------------------------------------------------
/curl_native/src/main/cpp/manager/httpmanager.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by yutianzuo on 2018/5/15.
3 | //
4 |
5 | #ifndef USELIBCURL_HTTPMANAGER_H
6 | #define USELIBCURL_HTTPMANAGER_H
7 |
8 | #include "requestmanager.h"
9 | #include