├── .gitignore
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── io
│ │ └── github
│ │ └── lizhangqu
│ │ └── curl
│ │ └── sample
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── io
│ │ │ └── github
│ │ │ └── lizhangqu
│ │ │ └── curl
│ │ │ └── sample
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.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
│ └── io
│ └── github
│ └── lizhangqu
│ └── curl
│ └── sample
│ └── ExampleUnitTest.java
├── build.gradle
├── common_function.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library
├── .gitignore
├── CMakeLists.txt
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── io
│ │ └── github
│ │ └── lizhangqu
│ │ └── curl
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── cpp
│ │ ├── Android.mk
│ │ ├── Application.mk
│ │ ├── build.sh
│ │ ├── log.h
│ │ ├── native.cpp
│ │ ├── native.h
│ │ └── thirdparty
│ │ │ ├── include
│ │ │ ├── curl
│ │ │ │ ├── curl.h
│ │ │ │ ├── curlbuild.h
│ │ │ │ ├── curlrules.h
│ │ │ │ ├── curlver.h
│ │ │ │ ├── easy.h
│ │ │ │ ├── mprintf.h
│ │ │ │ ├── multi.h
│ │ │ │ ├── stdcheaders.h
│ │ │ │ └── typecheck-gcc.h
│ │ │ ├── nghttp2
│ │ │ │ ├── nghttp2.h
│ │ │ │ └── nghttp2ver.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
│ │ │ └── lib
│ │ │ ├── libcrypto.a
│ │ │ ├── libcurl.a
│ │ │ ├── libnghttp2.a
│ │ │ └── libssl.a
│ ├── java
│ │ └── io
│ │ │ └── github
│ │ │ └── lizhangqu
│ │ │ └── curl
│ │ │ └── Curl.java
│ ├── obj
│ │ └── local
│ │ │ └── armeabi
│ │ │ └── objs
│ │ │ └── curl-client
│ │ │ ├── native.o
│ │ │ └── native.o.d
│ └── res
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── io
│ └── github
│ └── lizhangqu
│ └── curl
│ └── ExampleUnitTest.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | //公共函数
2 | apply from: "${project.rootProject.file('common_function.gradle')}"
3 | apply plugin: 'com.android.application'
4 |
5 | android {
6 | compileSdkVersion global_compileSdkVersion
7 | buildToolsVersion global_buildToolsVersion
8 | defaultConfig {
9 | applicationId "io.github.lizhangqu.curl.sample"
10 | minSdkVersion MIN_SDK_VERSION
11 | targetSdkVersion TARGET_SDK_VERSION
12 | versionCode 1
13 | versionCode 1
14 | versionName "1.0"
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 | ndk {
17 | abiFilters isDebug() ? global_debug_abiFilters : global_abiFilters
18 | }
19 | }
20 |
21 | if (isDebug()) {
22 | packagingOptions {
23 | doNotStrip "*/armeabi/*.so"
24 | doNotStrip "*/armeabi-v7a/*.so"
25 | doNotStrip "*/arm64-v8a/*.so"
26 | doNotStrip "*/x86/*.so"
27 | doNotStrip "*/x86_64/*.so"
28 | doNotStrip "*/mips/*.so"
29 | doNotStrip "*/mips64/*.so"
30 | }
31 | }
32 |
33 | buildTypes {
34 | release {
35 | minifyEnabled false
36 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
37 | }
38 | }
39 | }
40 |
41 | dependencies {
42 | compile fileTree(dir: 'libs', include: ['*.jar'])
43 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
44 | exclude group: 'com.android.support', module: 'support-annotations'
45 | })
46 | testCompile 'junit:junit:4.12'
47 | compile "com.android.support:appcompat-v7:${SUPPORT_VERSION}"
48 | if (isDebug()) {
49 | debugCompile project(path: ':library', configuration: "debug")
50 | releaseCompile project(path: ':library', configuration: "release")
51 | } else {
52 | compile project(':library')
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/lizhangqu/AndroidSDK/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/io/github/lizhangqu/curl/sample/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package io.github.lizhangqu.curl.sample;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("io.github.lizhangqu.curl.sample", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/lizhangqu/curl/sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package io.github.lizhangqu.curl.sample;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 | import android.view.View;
6 |
7 | import io.github.lizhangqu.curl.Curl;
8 |
9 | public class MainActivity extends AppCompatActivity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_main);
15 | findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() {
16 | @Override
17 | public void onClick(View v) {
18 | Curl.dump("https://vap.gw.weidian.com/com.vdian.sword/appconf/getConfig/1.1");
19 | }
20 | });
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | CurlForAndroid
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/io/github/lizhangqu/curl/sample/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package io.github.lizhangqu.curl.sample;
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() throws Exception {
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 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.2'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
25 | subprojects {
26 | ext.global_compileSdkVersion = COMPILE_SDK_VERSION.toInteger()
27 | ext.global_buildToolsVersion = "${BUILD_TOOLS_VERSION}"
28 | ext.global_abiFilters = ["armeabi-v7a", "armeabi", "arm64-v8a", "x86", "x86_64", "mips", "mips64"] as String[]
29 | ext.global_debug_abiFilters = ["armeabi"] as String[]
30 | ext.global_cFlags = ["-fpic", "-fexceptions", "-frtti"] as String[]
31 | ext.global_cppFlags = ["-fpic", "-fexceptions", "-frtti"] as String[]
32 | ext.global_arguments = ["-DANDROID_STL=c++_static", "-DANDROID_PLATFORM=android-14"] as String[]
33 | }
--------------------------------------------------------------------------------
/common_function.gradle:
--------------------------------------------------------------------------------
1 | /**
2 | * 是否是debug
3 | * @return
4 | */
5 | boolean isDebug() {
6 | boolean ret = false
7 | try {
8 | Properties properties = new Properties()
9 | File file = project.rootProject.file('local.properties')
10 | if (!file.exists()) {
11 | return false
12 | }
13 | properties.load(file.newDataInputStream())
14 | String debugStr = properties.getProperty("debug")
15 | if (debugStr != null && debugStr.length() > 0) {
16 | ret = debugStr.toBoolean()
17 | }
18 | } catch (Throwable throwable) {
19 | throwable.printStackTrace()
20 | ret = false
21 | }
22 | project.logger.error("[${project.name}]Debug:${ret}")
23 | return ret
24 | }
25 |
26 | ext {
27 | isDebug = this.&isDebug
28 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | BUILD_TOOLS_VERSION=25.0.3
15 | COMPILE_SDK_VERSION=25
16 | MIN_SDK_VERSION=14
17 | TARGET_SDK_VERSION=22
18 | SUPPORT_VERSION=25.3.1
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed May 17 20:31:56 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/library/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.6)
2 | project(CURL)
3 |
4 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpic -frtti -fexceptions")
5 |
6 | #release时去除符号表,不然很大,debug时不去除,因为要debug
7 | if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
8 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s")
9 | endif()
10 |
11 | if(UNIX)
12 | add_definitions(-fPIC)
13 | elseif(WIN32)
14 | set(STATIC_FLAGS "-static-libstdc++ -static-libgcc -static")
15 | set(CMAKE_SHARED_LIBRARY_PREFIX "")
16 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${STATIC_FLAGS}")
17 | endif()
18 | if(ANDROID AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
19 | add_definitions(-no-integrated-as)
20 | endif()
21 | if(ANDROID AND "${ANDROID_STL}" STREQUAL c++_static)
22 | set(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} -latomic")
23 | endif()
24 |
25 | include_directories(
26 | ${CMAKE_SOURCE_DIR}/src/main/cpp/log.h
27 | ${CMAKE_SOURCE_DIR}/src/main/cpp/native.h
28 | ${CMAKE_SOURCE_DIR}/src/main/cpp/thirdparty/include
29 | )
30 |
31 |
32 |
33 | add_library(crypto STATIC IMPORTED)
34 | set_target_properties(crypto
35 | PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/src/main/cpp/thirdparty/lib/libcrypto.a)
36 |
37 | add_library(ssl STATIC IMPORTED)
38 | set_target_properties(ssl
39 | PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/src/main/cpp/thirdparty/lib/libssl.a)
40 |
41 |
42 | add_library(nghttp2 STATIC IMPORTED)
43 | set_target_properties(nghttp2
44 | PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/src/main/cpp/thirdparty/lib/libnghttp2.a)
45 |
46 |
47 | add_library(curl STATIC IMPORTED)
48 | set_target_properties(curl
49 | PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/src/main/cpp/thirdparty/lib/libcurl.a)
50 |
51 |
52 | set(CURL_FILES
53 | ${CMAKE_SOURCE_DIR}/src/main/cpp/native.cpp
54 | ${CMAKE_SOURCE_DIR}/src/main/cpp/thirdparty/include
55 | )
56 |
57 | add_library(
58 | curl-client
59 | SHARED
60 | ${CURL_FILES})
61 |
62 | target_link_libraries(
63 | curl-client
64 | curl
65 | nghttp2
66 | ssl
67 | crypto
68 | log
69 | atomic
70 | z
71 | )
72 |
--------------------------------------------------------------------------------
/library/build.gradle:
--------------------------------------------------------------------------------
1 | //公共函数
2 | apply from: "${project.rootProject.file('common_function.gradle')}"
3 | apply plugin: 'com.android.library'
4 |
5 | android {
6 | compileSdkVersion global_compileSdkVersion
7 | buildToolsVersion global_buildToolsVersion
8 |
9 | defaultConfig {
10 | if (isDebug()) {
11 | publishNonDefault true
12 | }
13 | minSdkVersion MIN_SDK_VERSION
14 | targetSdkVersion TARGET_SDK_VERSION
15 | versionCode 1
16 | versionName "1.0"
17 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
18 |
19 | ndk {
20 | abiFilters isDebug() ? global_debug_abiFilters : global_abiFilters
21 | }
22 |
23 | externalNativeBuild {
24 | cmake {
25 | cFlags global_cFlags
26 | cppFlags global_cppFlags
27 | arguments global_arguments
28 | }
29 | }
30 | }
31 |
32 | externalNativeBuild {
33 | cmake {
34 | path project.file("CMakeLists.txt")
35 | }
36 | }
37 |
38 | if (isDebug()) {
39 | packagingOptions {
40 | doNotStrip "*/armeabi/*.so"
41 | doNotStrip "*/armeabi-v7a/*.so"
42 | doNotStrip "*/arm64-v8a/*.so"
43 | doNotStrip "*/x86/*.so"
44 | doNotStrip "*/x86_64/*.so"
45 | doNotStrip "*/mips/*.so"
46 | doNotStrip "*/mips64/*.so"
47 | }
48 | }
49 |
50 | buildTypes {
51 | release {
52 | minifyEnabled false
53 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
54 | }
55 | }
56 | }
57 |
58 | dependencies {
59 | compile fileTree(dir: 'libs', include: ['*.jar'])
60 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
61 | exclude group: 'com.android.support', module: 'support-annotations'
62 | })
63 | testCompile 'junit:junit:4.12'
64 | provided "com.android.support:support-annotations:${SUPPORT_VERSION}"
65 | }
66 |
--------------------------------------------------------------------------------
/library/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/lizhangqu/AndroidSDK/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/library/src/androidTest/java/io/github/lizhangqu/curl/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package io.github.lizhangqu.curl;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("io.github.lizhangqu.curl.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/library/src/main/cpp/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 | LOCAL_MODULE := libcrypto
5 | LOCAL_SRC_FILES := $(LOCAL_PATH)/thirdparty/lib/libcrypto.a
6 | include $(PREBUILT_STATIC_LIBRARY)
7 |
8 | include $(CLEAR_VARS)
9 | LOCAL_MODULE := libssl
10 | LOCAL_SRC_FILES := $(LOCAL_PATH)/thirdparty/lib/libssl.a
11 | include $(PREBUILT_STATIC_LIBRARY)
12 |
13 | include $(CLEAR_VARS)
14 | LOCAL_MODULE := libnghttp2
15 | LOCAL_SRC_FILES := $(LOCAL_PATH)/thirdparty/lib/libnghttp2.a
16 | include $(PREBUILT_STATIC_LIBRARY)
17 |
18 | include $(CLEAR_VARS)
19 | LOCAL_MODULE := libcurl
20 | LOCAL_SRC_FILES := $(LOCAL_PATH)/thirdparty/lib/libcurl.a
21 | include $(PREBUILT_STATIC_LIBRARY)
22 |
23 | include $(CLEAR_VARS)
24 |
25 | LOCAL_MODULE := curl-client
26 | LOCAL_SRC_FILES := \
27 | native.cpp \
28 | log.h \
29 | native.h
30 |
31 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/thirdparty/include
32 |
33 | TARGET_PLATFORM := android-14
34 |
35 |
36 |
37 | LOCAL_LDLIBS += -latomic -lz -llog
38 | LOCAL_STATIC_LIBRARIES := libcurl libnghttp2 libssl libcrypto
39 |
40 | include $(BUILD_SHARED_LIBRARY)
41 |
42 |
--------------------------------------------------------------------------------
/library/src/main/cpp/Application.mk:
--------------------------------------------------------------------------------
1 | APP_ABI := armeabi
2 | APP_PLATFORM := android-14
3 | APP_OPTIM := release
4 | APP_STL := c++_static
5 |
6 | APP_THIN_ARCHIVE := true
7 | APP_CPPFLAGS := -fpic -fexceptions -frtti
8 | APP_GNUSTL_FORCE_CPP_FEATURES := pic exceptions rtti
9 |
--------------------------------------------------------------------------------
/library/src/main/cpp/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ndk-build clean NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk NDK_APPLICATION_MK=Application.mk
4 | ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk NDK_APPLICATION_MK=Application.mk
5 |
--------------------------------------------------------------------------------
/library/src/main/cpp/log.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by 李樟取 on 2017/5/25.
3 | //
4 |
5 | #ifndef CURL_LOG_H
6 | #define CURL_LOG_H
7 |
8 | #ifdef ANDROID
9 |
10 | #include
11 |
12 | #define TAG "CURL"
13 |
14 | #define ALOGE(fmt, ...) __android_log_print(ANDROID_LOG_ERROR, TAG, fmt, ##__VA_ARGS__)
15 | #define ALOGI(fmt, ...) __android_log_print(ANDROID_LOG_INFO, TAG, fmt, ##__VA_ARGS__)
16 | #define ALOGD(fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, TAG, fmt, ##__VA_ARGS__)
17 | #define ALOGW(fmt, ...) __android_log_print(ANDROID_LOG_WARN, TAG, fmt, ##__VA_ARGS__)
18 | #else
19 | #define ALOGE printf
20 | #define ALOGI printf
21 | #define ALOGD printf
22 | #define ALOGW printf
23 | #endif
24 |
25 | #endif //CURL_LOG_H
--------------------------------------------------------------------------------
/library/src/main/cpp/native.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by 李樟取 on 2017/5/25.
3 | //
4 |
5 | #ifndef CURL_NATIVE_H
6 | #define CURL_NATIVE_H
7 |
8 | #include "jni.h"
9 |
10 |
11 | #ifndef NELEM
12 | # define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0])))
13 | #endif
14 |
15 |
16 | #ifndef CLASSNAME
17 | #define CLASSNAME "io/github/lizhangqu/curl/Curl"
18 | #endif
19 |
20 | #endif //CURL_NATIVE_H
21 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/include/curl/curlbuild.h:
--------------------------------------------------------------------------------
1 | /* include/curl/curlbuild.h. Generated from curlbuild.h.in by configure. */
2 | #ifndef __CURL_CURLBUILD_H
3 | #define __CURL_CURLBUILD_H
4 | /***************************************************************************
5 | * _ _ ____ _
6 | * Project ___| | | | _ \| |
7 | * / __| | | | |_) | |
8 | * | (__| |_| | _ <| |___
9 | * \___|\___/|_| \_\_____|
10 | *
11 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al.
12 | *
13 | * This software is licensed as described in the file COPYING, which
14 | * you should have received as part of this distribution. The terms
15 | * are also available at https://curl.haxx.se/docs/copyright.html.
16 | *
17 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
18 | * copies of the Software, and permit persons to whom the Software is
19 | * furnished to do so, under the terms of the COPYING file.
20 | *
21 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22 | * KIND, either express or implied.
23 | *
24 | ***************************************************************************/
25 |
26 | /* ================================================================ */
27 | /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
28 | /* ================================================================ */
29 |
30 | /*
31 | * NOTE 1:
32 | * -------
33 | *
34 | * Nothing in this file is intended to be modified or adjusted by the
35 | * curl library user nor by the curl library builder.
36 | *
37 | * If you think that something actually needs to be changed, adjusted
38 | * or fixed in this file, then, report it on the libcurl development
39 | * mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
40 | *
41 | * This header file shall only export symbols which are 'curl' or 'CURL'
42 | * prefixed, otherwise public name space would be polluted.
43 | *
44 | * NOTE 2:
45 | * -------
46 | *
47 | * Right now you might be staring at file include/curl/curlbuild.h.in or
48 | * at file include/curl/curlbuild.h, this is due to the following reason:
49 | *
50 | * On systems capable of running the configure script, the configure process
51 | * will overwrite the distributed include/curl/curlbuild.h file with one that
52 | * is suitable and specific to the library being configured and built, which
53 | * is generated from the include/curl/curlbuild.h.in template file.
54 | *
55 | */
56 |
57 | /* ================================================================ */
58 | /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
59 | /* ================================================================ */
60 |
61 | #ifdef CURL_SIZEOF_LONG
62 | #error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
63 | Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
64 | #endif
65 |
66 | #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
67 | #error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
68 | Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
69 | #endif
70 |
71 | #ifdef CURL_SIZEOF_CURL_SOCKLEN_T
72 | #error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
73 | Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
74 | #endif
75 |
76 | #ifdef CURL_TYPEOF_CURL_OFF_T
77 | #error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
78 | Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
79 | #endif
80 |
81 | #ifdef CURL_FORMAT_CURL_OFF_T
82 | #error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
83 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
84 | #endif
85 |
86 | #ifdef CURL_FORMAT_CURL_OFF_TU
87 | #error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
88 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
89 | #endif
90 |
91 | #ifdef CURL_FORMAT_OFF_T
92 | #error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
93 | Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
94 | #endif
95 |
96 | #ifdef CURL_SIZEOF_CURL_OFF_T
97 | #error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
98 | Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
99 | #endif
100 |
101 | #ifdef CURL_SUFFIX_CURL_OFF_T
102 | #error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
103 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
104 | #endif
105 |
106 | #ifdef CURL_SUFFIX_CURL_OFF_TU
107 | #error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
108 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
109 | #endif
110 |
111 | /* ================================================================ */
112 | /* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
113 | /* ================================================================ */
114 |
115 | /* Configure process defines this to 1 when it finds out that system */
116 | /* header file ws2tcpip.h must be included by the external interface. */
117 | /* #undef CURL_PULL_WS2TCPIP_H */
118 | #ifdef CURL_PULL_WS2TCPIP_H
119 | # ifndef WIN32_LEAN_AND_MEAN
120 | # define WIN32_LEAN_AND_MEAN
121 | # endif
122 | # include
123 | # include
124 | # include
125 | #endif
126 |
127 | /* Configure process defines this to 1 when it finds out that system */
128 | /* header file sys/types.h must be included by the external interface. */
129 | #define CURL_PULL_SYS_TYPES_H 1
130 | #ifdef CURL_PULL_SYS_TYPES_H
131 | # include
132 | #endif
133 |
134 | /* Configure process defines this to 1 when it finds out that system */
135 | /* header file stdint.h must be included by the external interface. */
136 | #define CURL_PULL_STDINT_H 1
137 | #ifdef CURL_PULL_STDINT_H
138 | # include
139 | #endif
140 |
141 | /* Configure process defines this to 1 when it finds out that system */
142 | /* header file inttypes.h must be included by the external interface. */
143 | #define CURL_PULL_INTTYPES_H 1
144 | #ifdef CURL_PULL_INTTYPES_H
145 | # include
146 | #endif
147 |
148 | /* Configure process defines this to 1 when it finds out that system */
149 | /* header file sys/socket.h must be included by the external interface. */
150 | #define CURL_PULL_SYS_SOCKET_H 1
151 | #ifdef CURL_PULL_SYS_SOCKET_H
152 | # include
153 | #endif
154 |
155 | /* Configure process defines this to 1 when it finds out that system */
156 | /* header file sys/poll.h must be included by the external interface. */
157 | /* #undef CURL_PULL_SYS_POLL_H */
158 | #ifdef CURL_PULL_SYS_POLL_H
159 | # include
160 | #endif
161 |
162 | /* The size of `long', as computed by sizeof. */
163 | #define CURL_SIZEOF_LONG 4
164 |
165 | /* Integral data type used for curl_socklen_t. */
166 | #define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
167 |
168 | /* The size of `curl_socklen_t', as computed by sizeof. */
169 | #define CURL_SIZEOF_CURL_SOCKLEN_T 4
170 |
171 | /* Data type definition of curl_socklen_t. */
172 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
173 |
174 | /* Signed integral data type used for curl_off_t. */
175 | #define CURL_TYPEOF_CURL_OFF_T int64_t
176 |
177 | /* Data type definition of curl_off_t. */
178 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
179 |
180 | /* curl_off_t formatting string directive without "%" conversion specifier. */
181 | #define CURL_FORMAT_CURL_OFF_T "lld"
182 |
183 | /* unsigned curl_off_t formatting string without "%" conversion specifier. */
184 | #define CURL_FORMAT_CURL_OFF_TU "llu"
185 |
186 | /* curl_off_t formatting string directive with "%" conversion specifier. */
187 | #define CURL_FORMAT_OFF_T "%lld"
188 |
189 | /* The size of `curl_off_t', as computed by sizeof. */
190 | #define CURL_SIZEOF_CURL_OFF_T 8
191 |
192 | /* curl_off_t constant suffix. */
193 | #define CURL_SUFFIX_CURL_OFF_T LL
194 |
195 | /* unsigned curl_off_t constant suffix. */
196 | #define CURL_SUFFIX_CURL_OFF_TU ULL
197 |
198 | #endif /* __CURL_CURLBUILD_H */
199 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/include/curl/curlrules.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLRULES_H
2 | #define __CURL_CURLRULES_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2012, 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 | /* ================================================================ */
26 | /* COMPILE TIME SANITY CHECKS */
27 | /* ================================================================ */
28 |
29 | /*
30 | * NOTE 1:
31 | * -------
32 | *
33 | * All checks done in this file are intentionally placed in a public
34 | * header file which is pulled by curl/curl.h when an application is
35 | * being built using an already built libcurl library. Additionally
36 | * this file is also included and used when building the library.
37 | *
38 | * If compilation fails on this file it is certainly sure that the
39 | * problem is elsewhere. It could be a problem in the curlbuild.h
40 | * header file, or simply that you are using different compilation
41 | * settings than those used to build the library.
42 | *
43 | * Nothing in this file is intended to be modified or adjusted by the
44 | * curl library user nor by the curl library builder.
45 | *
46 | * Do not deactivate any check, these are done to make sure that the
47 | * library is properly built and used.
48 | *
49 | * You can find further help on the libcurl development mailing list:
50 | * https://cool.haxx.se/mailman/listinfo/curl-library/
51 | *
52 | * NOTE 2
53 | * ------
54 | *
55 | * Some of the following compile time checks are based on the fact
56 | * that the dimension of a constant array can not be a negative one.
57 | * In this way if the compile time verification fails, the compilation
58 | * will fail issuing an error. The error description wording is compiler
59 | * dependent but it will be quite similar to one of the following:
60 | *
61 | * "negative subscript or subscript is too large"
62 | * "array must have at least one element"
63 | * "-1 is an illegal array size"
64 | * "size of array is negative"
65 | *
66 | * If you are building an application which tries to use an already
67 | * built libcurl library and you are getting this kind of errors on
68 | * this file, it is a clear indication that there is a mismatch between
69 | * how the library was built and how you are trying to use it for your
70 | * application. Your already compiled or binary library provider is the
71 | * only one who can give you the details you need to properly use it.
72 | */
73 |
74 | /*
75 | * Verify that some macros are actually defined.
76 | */
77 |
78 | #ifndef CURL_SIZEOF_LONG
79 | # error "CURL_SIZEOF_LONG definition is missing!"
80 | Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
81 | #endif
82 |
83 | #ifndef CURL_TYPEOF_CURL_SOCKLEN_T
84 | # error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
85 | Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
86 | #endif
87 |
88 | #ifndef CURL_SIZEOF_CURL_SOCKLEN_T
89 | # error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
90 | Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
91 | #endif
92 |
93 | #ifndef CURL_TYPEOF_CURL_OFF_T
94 | # error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
95 | Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
96 | #endif
97 |
98 | #ifndef CURL_FORMAT_CURL_OFF_T
99 | # error "CURL_FORMAT_CURL_OFF_T definition is missing!"
100 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
101 | #endif
102 |
103 | #ifndef CURL_FORMAT_CURL_OFF_TU
104 | # error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
105 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
106 | #endif
107 |
108 | #ifndef CURL_FORMAT_OFF_T
109 | # error "CURL_FORMAT_OFF_T definition is missing!"
110 | Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
111 | #endif
112 |
113 | #ifndef CURL_SIZEOF_CURL_OFF_T
114 | # error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
115 | Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
116 | #endif
117 |
118 | #ifndef CURL_SUFFIX_CURL_OFF_T
119 | # error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
120 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
121 | #endif
122 |
123 | #ifndef CURL_SUFFIX_CURL_OFF_TU
124 | # error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
125 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
126 | #endif
127 |
128 | /*
129 | * Macros private to this header file.
130 | */
131 |
132 | #define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
133 |
134 | #define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
135 |
136 | /*
137 | * Verify that the size previously defined and expected for long
138 | * is the same as the one reported by sizeof() at compile time.
139 | */
140 |
141 | typedef char
142 | __curl_rule_01__
143 | [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
144 |
145 | /*
146 | * Verify that the size previously defined and expected for
147 | * curl_off_t is actually the the same as the one reported
148 | * by sizeof() at compile time.
149 | */
150 |
151 | typedef char
152 | __curl_rule_02__
153 | [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
154 |
155 | /*
156 | * Verify at compile time that the size of curl_off_t as reported
157 | * by sizeof() is greater or equal than the one reported for long
158 | * for the current compilation.
159 | */
160 |
161 | typedef char
162 | __curl_rule_03__
163 | [CurlchkszGE(curl_off_t, long)];
164 |
165 | /*
166 | * Verify that the size previously defined and expected for
167 | * curl_socklen_t is actually the the same as the one reported
168 | * by sizeof() at compile time.
169 | */
170 |
171 | typedef char
172 | __curl_rule_04__
173 | [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
174 |
175 | /*
176 | * Verify at compile time that the size of curl_socklen_t as reported
177 | * by sizeof() is greater or equal than the one reported for int for
178 | * the current compilation.
179 | */
180 |
181 | typedef char
182 | __curl_rule_05__
183 | [CurlchkszGE(curl_socklen_t, int)];
184 |
185 | /* ================================================================ */
186 | /* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
187 | /* ================================================================ */
188 |
189 | /*
190 | * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
191 | * these to be visible and exported by the external libcurl interface API,
192 | * while also making them visible to the library internals, simply including
193 | * curl_setup.h, without actually needing to include curl.h internally.
194 | * If some day this section would grow big enough, all this should be moved
195 | * to its own header file.
196 | */
197 |
198 | /*
199 | * Figure out if we can use the ## preprocessor operator, which is supported
200 | * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
201 | * or __cplusplus so we need to carefully check for them too.
202 | */
203 |
204 | #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
205 | defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
206 | defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
207 | defined(__ILEC400__)
208 | /* This compiler is believed to have an ISO compatible preprocessor */
209 | #define CURL_ISOCPP
210 | #else
211 | /* This compiler is believed NOT to have an ISO compatible preprocessor */
212 | #undef CURL_ISOCPP
213 | #endif
214 |
215 | /*
216 | * Macros for minimum-width signed and unsigned curl_off_t integer constants.
217 | */
218 |
219 | #if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
220 | # define __CURL_OFF_T_C_HLPR2(x) x
221 | # define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
222 | # define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
223 | __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
224 | # define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
225 | __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
226 | #else
227 | # ifdef CURL_ISOCPP
228 | # define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
229 | # else
230 | # define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
231 | # endif
232 | # define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
233 | # define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
234 | # define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
235 | #endif
236 |
237 | /*
238 | * Get rid of macros private to this header file.
239 | */
240 |
241 | #undef CurlchkszEQ
242 | #undef CurlchkszGE
243 |
244 | /*
245 | * Get rid of macros not intended to exist beyond this point.
246 | */
247 |
248 | #undef CURL_PULL_WS2TCPIP_H
249 | #undef CURL_PULL_SYS_TYPES_H
250 | #undef CURL_PULL_SYS_SOCKET_H
251 | #undef CURL_PULL_SYS_POLL_H
252 | #undef CURL_PULL_STDINT_H
253 | #undef CURL_PULL_INTTYPES_H
254 |
255 | #undef CURL_TYPEOF_CURL_SOCKLEN_T
256 | #undef CURL_TYPEOF_CURL_OFF_T
257 |
258 | #ifdef CURL_NO_OLDIES
259 | #undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
260 | #endif
261 |
262 | #endif /* __CURL_CURLRULES_H */
263 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 - 2017, 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 - 2017 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.53.1"
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 53
39 | #define LIBCURL_VERSION_PATCH 1
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 0x073501
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 should follow this template:
68 | *
69 | * "Mon Feb 12 11:35:33 UTC 2007"
70 | */
71 | #define LIBCURL_TIMESTAMP "Fri Feb 24 07:49:42 UTC 2017"
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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/include/nghttp2/nghttp2ver.h:
--------------------------------------------------------------------------------
1 | /*
2 | * nghttp2 - HTTP/2 C Library
3 | *
4 | * Copyright (c) 2012, 2013 Tatsuhiro Tsujikawa
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining
7 | * a copy of this software and associated documentation files (the
8 | * "Software"), to deal in the Software without restriction, including
9 | * without limitation the rights to use, copy, modify, merge, publish,
10 | * distribute, sublicense, and/or sell copies of the Software, and to
11 | * permit persons to whom the Software is furnished to do so, subject to
12 | * the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be
15 | * included in all copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 | */
25 | #ifndef NGHTTP2VER_H
26 | #define NGHTTP2VER_H
27 |
28 | /**
29 | * @macro
30 | * Version number of the nghttp2 library release
31 | */
32 | #define NGHTTP2_VERSION "1.23.0-DEV"
33 |
34 | /**
35 | * @macro
36 | * Numerical representation of the version number of the nghttp2 library
37 | * release. This is a 24 bit number with 8 bits for major number, 8 bits
38 | * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
39 | */
40 | #define NGHTTP2_VERSION_NUM 0x011700
41 |
42 | #endif /* NGHTTP2VER_H */
43 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/include/openssl/conf.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_H
11 | # define HEADER_CONF_H
12 |
13 | # include
14 | # include
15 | # include
16 | # include
17 | # include
18 |
19 | # include
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | typedef struct {
26 | char *section;
27 | char *name;
28 | char *value;
29 | } CONF_VALUE;
30 |
31 | DEFINE_STACK_OF(CONF_VALUE)
32 | DEFINE_LHASH_OF(CONF_VALUE);
33 |
34 | struct conf_st;
35 | struct conf_method_st;
36 | typedef struct conf_method_st CONF_METHOD;
37 |
38 | struct conf_method_st {
39 | const char *name;
40 | CONF *(*create) (CONF_METHOD *meth);
41 | int (*init) (CONF *conf);
42 | int (*destroy) (CONF *conf);
43 | int (*destroy_data) (CONF *conf);
44 | int (*load_bio) (CONF *conf, BIO *bp, long *eline);
45 | int (*dump) (const CONF *conf, BIO *bp);
46 | int (*is_number) (const CONF *conf, char c);
47 | int (*to_int) (const CONF *conf, char c);
48 | int (*load) (CONF *conf, const char *name, long *eline);
49 | };
50 |
51 | /* Module definitions */
52 |
53 | typedef struct conf_imodule_st CONF_IMODULE;
54 | typedef struct conf_module_st CONF_MODULE;
55 |
56 | DEFINE_STACK_OF(CONF_MODULE)
57 | DEFINE_STACK_OF(CONF_IMODULE)
58 |
59 | /* DSO module function typedefs */
60 | typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
61 | typedef void conf_finish_func (CONF_IMODULE *md);
62 |
63 | # define CONF_MFLAGS_IGNORE_ERRORS 0x1
64 | # define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
65 | # define CONF_MFLAGS_SILENT 0x4
66 | # define CONF_MFLAGS_NO_DSO 0x8
67 | # define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
68 | # define CONF_MFLAGS_DEFAULT_SECTION 0x20
69 |
70 | int CONF_set_default_method(CONF_METHOD *meth);
71 | void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
72 | LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
73 | long *eline);
74 | # ifndef OPENSSL_NO_STDIO
75 | LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
76 | long *eline);
77 | # endif
78 | LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
79 | long *eline);
80 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
81 | const char *section);
82 | char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
83 | const char *name);
84 | long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
85 | const char *name);
86 | void CONF_free(LHASH_OF(CONF_VALUE) *conf);
87 | #ifndef OPENSSL_NO_STDIO
88 | int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
89 | #endif
90 | int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
91 |
92 | DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name))
93 |
94 | #if OPENSSL_API_COMPAT < 0x10100000L
95 | # define OPENSSL_no_config() \
96 | OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL)
97 | #endif
98 |
99 | /*
100 | * New conf code. The semantics are different from the functions above. If
101 | * that wasn't the case, the above functions would have been replaced
102 | */
103 |
104 | struct conf_st {
105 | CONF_METHOD *meth;
106 | void *meth_data;
107 | LHASH_OF(CONF_VALUE) *data;
108 | };
109 |
110 | CONF *NCONF_new(CONF_METHOD *meth);
111 | CONF_METHOD *NCONF_default(void);
112 | CONF_METHOD *NCONF_WIN32(void);
113 | void NCONF_free(CONF *conf);
114 | void NCONF_free_data(CONF *conf);
115 |
116 | int NCONF_load(CONF *conf, const char *file, long *eline);
117 | # ifndef OPENSSL_NO_STDIO
118 | int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
119 | # endif
120 | int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
121 | STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
122 | const char *section);
123 | char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
124 | int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
125 | long *result);
126 | #ifndef OPENSSL_NO_STDIO
127 | int NCONF_dump_fp(const CONF *conf, FILE *out);
128 | #endif
129 | int NCONF_dump_bio(const CONF *conf, BIO *out);
130 |
131 | #define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
132 |
133 | /* Module functions */
134 |
135 | int CONF_modules_load(const CONF *cnf, const char *appname,
136 | unsigned long flags);
137 | int CONF_modules_load_file(const char *filename, const char *appname,
138 | unsigned long flags);
139 | void CONF_modules_unload(int all);
140 | void CONF_modules_finish(void);
141 | #if OPENSSL_API_COMPAT < 0x10100000L
142 | # define CONF_modules_free() while(0) continue
143 | #endif
144 | int CONF_module_add(const char *name, conf_init_func *ifunc,
145 | conf_finish_func *ffunc);
146 |
147 | const char *CONF_imodule_get_name(const CONF_IMODULE *md);
148 | const char *CONF_imodule_get_value(const CONF_IMODULE *md);
149 | void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
150 | void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
151 | CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
152 | unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
153 | void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
154 | void *CONF_module_get_usr_data(CONF_MODULE *pmod);
155 | void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
156 |
157 | char *CONF_get1_default_config_file(void);
158 |
159 | int CONF_parse_list(const char *list, int sep, int nospc,
160 | int (*list_cb) (const char *elem, int len, void *usr),
161 | void *arg);
162 |
163 | void OPENSSL_load_builtin_modules(void);
164 |
165 | /* BEGIN ERROR CODES */
166 | /*
167 | * The following lines are auto generated by the script mkerr.pl. Any changes
168 | * made after this point may be overwritten when the script is next run.
169 | */
170 |
171 | int ERR_load_CONF_strings(void);
172 |
173 | /* Error codes for the CONF functions. */
174 |
175 | /* Function codes. */
176 | # define CONF_F_CONF_DUMP_FP 104
177 | # define CONF_F_CONF_LOAD 100
178 | # define CONF_F_CONF_LOAD_FP 103
179 | # define CONF_F_CONF_PARSE_LIST 119
180 | # define CONF_F_DEF_LOAD 120
181 | # define CONF_F_DEF_LOAD_BIO 121
182 | # define CONF_F_MODULE_INIT 115
183 | # define CONF_F_MODULE_LOAD_DSO 117
184 | # define CONF_F_MODULE_RUN 118
185 | # define CONF_F_NCONF_DUMP_BIO 105
186 | # define CONF_F_NCONF_DUMP_FP 106
187 | # define CONF_F_NCONF_GET_NUMBER_E 112
188 | # define CONF_F_NCONF_GET_SECTION 108
189 | # define CONF_F_NCONF_GET_STRING 109
190 | # define CONF_F_NCONF_LOAD 113
191 | # define CONF_F_NCONF_LOAD_BIO 110
192 | # define CONF_F_NCONF_LOAD_FP 114
193 | # define CONF_F_NCONF_NEW 111
194 | # define CONF_F_STR_COPY 101
195 |
196 | /* Reason codes. */
197 | # define CONF_R_ERROR_LOADING_DSO 110
198 | # define CONF_R_LIST_CANNOT_BE_NULL 115
199 | # define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
200 | # define CONF_R_MISSING_EQUAL_SIGN 101
201 | # define CONF_R_MISSING_INIT_FUNCTION 112
202 | # define CONF_R_MODULE_INITIALIZATION_ERROR 109
203 | # define CONF_R_NO_CLOSE_BRACE 102
204 | # define CONF_R_NO_CONF 105
205 | # define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106
206 | # define CONF_R_NO_SECTION 107
207 | # define CONF_R_NO_SUCH_FILE 114
208 | # define CONF_R_NO_VALUE 108
209 | # define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
210 | # define CONF_R_UNKNOWN_MODULE_NAME 113
211 | # define CONF_R_VARIABLE_HAS_NO_VALUE 104
212 |
213 | # ifdef __cplusplus
214 | }
215 | # endif
216 | #endif
217 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/include/openssl/des.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_DES_H
11 | # define HEADER_DES_H
12 |
13 | # include
14 |
15 | # ifndef OPENSSL_NO_DES
16 | # ifdef __cplusplus
17 | extern "C" {
18 | # endif
19 | # include
20 |
21 | typedef unsigned int DES_LONG;
22 |
23 | # ifdef OPENSSL_BUILD_SHLIBCRYPTO
24 | # undef OPENSSL_EXTERN
25 | # define OPENSSL_EXTERN OPENSSL_EXPORT
26 | # endif
27 |
28 | typedef unsigned char DES_cblock[8];
29 | typedef /* const */ unsigned char const_DES_cblock[8];
30 | /*
31 | * With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and
32 | * const_DES_cblock * are incompatible pointer types.
33 | */
34 |
35 | typedef struct DES_ks {
36 | union {
37 | DES_cblock cblock;
38 | /*
39 | * make sure things are correct size on machines with 8 byte longs
40 | */
41 | DES_LONG deslong[2];
42 | } ks[16];
43 | } DES_key_schedule;
44 |
45 | # define DES_KEY_SZ (sizeof(DES_cblock))
46 | # define DES_SCHEDULE_SZ (sizeof(DES_key_schedule))
47 |
48 | # define DES_ENCRYPT 1
49 | # define DES_DECRYPT 0
50 |
51 | # define DES_CBC_MODE 0
52 | # define DES_PCBC_MODE 1
53 |
54 | # define DES_ecb2_encrypt(i,o,k1,k2,e) \
55 | DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
56 |
57 | # define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
58 | DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
59 |
60 | # define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
61 | DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
62 |
63 | # define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
64 | DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
65 |
66 | OPENSSL_DECLARE_GLOBAL(int, DES_check_key); /* defaults to false */
67 | # define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key)
68 |
69 | const char *DES_options(void);
70 | void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
71 | DES_key_schedule *ks1, DES_key_schedule *ks2,
72 | DES_key_schedule *ks3, int enc);
73 | DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output,
74 | long length, DES_key_schedule *schedule,
75 | const_DES_cblock *ivec);
76 | /* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */
77 | void DES_cbc_encrypt(const unsigned char *input, unsigned char *output,
78 | long length, DES_key_schedule *schedule,
79 | DES_cblock *ivec, int enc);
80 | void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output,
81 | long length, DES_key_schedule *schedule,
82 | DES_cblock *ivec, int enc);
83 | void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output,
84 | long length, DES_key_schedule *schedule,
85 | DES_cblock *ivec, const_DES_cblock *inw,
86 | const_DES_cblock *outw, int enc);
87 | void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
88 | long length, DES_key_schedule *schedule,
89 | DES_cblock *ivec, int enc);
90 | void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
91 | DES_key_schedule *ks, int enc);
92 |
93 | /*
94 | * This is the DES encryption function that gets called by just about every
95 | * other DES routine in the library. You should not use this function except
96 | * to implement 'modes' of DES. I say this because the functions that call
97 | * this routine do the conversion from 'char *' to long, and this needs to be
98 | * done to make sure 'non-aligned' memory access do not occur. The
99 | * characters are loaded 'little endian'. Data is a pointer to 2 unsigned
100 | * long's and ks is the DES_key_schedule to use. enc, is non zero specifies
101 | * encryption, zero if decryption.
102 | */
103 | void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc);
104 |
105 | /*
106 | * This functions is the same as DES_encrypt1() except that the DES initial
107 | * permutation (IP) and final permutation (FP) have been left out. As for
108 | * DES_encrypt1(), you should not use this function. It is used by the
109 | * routines in the library that implement triple DES. IP() DES_encrypt2()
110 | * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1()
111 | * DES_encrypt1() DES_encrypt1() except faster :-).
112 | */
113 | void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc);
114 |
115 | void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
116 | DES_key_schedule *ks2, DES_key_schedule *ks3);
117 | void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
118 | DES_key_schedule *ks2, DES_key_schedule *ks3);
119 | void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
120 | long length,
121 | DES_key_schedule *ks1, DES_key_schedule *ks2,
122 | DES_key_schedule *ks3, DES_cblock *ivec, int enc);
123 | void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,
124 | long length, DES_key_schedule *ks1,
125 | DES_key_schedule *ks2, DES_key_schedule *ks3,
126 | DES_cblock *ivec, int *num, int enc);
127 | void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out,
128 | int numbits, long length, DES_key_schedule *ks1,
129 | DES_key_schedule *ks2, DES_key_schedule *ks3,
130 | DES_cblock *ivec, int enc);
131 | void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out,
132 | long length, DES_key_schedule *ks1,
133 | DES_key_schedule *ks2, DES_key_schedule *ks3,
134 | DES_cblock *ivec, int *num);
135 | char *DES_fcrypt(const char *buf, const char *salt, char *ret);
136 | char *DES_crypt(const char *buf, const char *salt);
137 | void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
138 | long length, DES_key_schedule *schedule,
139 | DES_cblock *ivec);
140 | void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,
141 | long length, DES_key_schedule *schedule,
142 | DES_cblock *ivec, int enc);
143 | DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[],
144 | long length, int out_count, DES_cblock *seed);
145 | int DES_random_key(DES_cblock *ret);
146 | void DES_set_odd_parity(DES_cblock *key);
147 | int DES_check_key_parity(const_DES_cblock *key);
148 | int DES_is_weak_key(const_DES_cblock *key);
149 | /*
150 | * DES_set_key (= set_key = DES_key_sched = key_sched) calls
151 | * DES_set_key_checked if global variable DES_check_key is set,
152 | * DES_set_key_unchecked otherwise.
153 | */
154 | int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
155 | int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);
156 | int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule);
157 | void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule);
158 | void DES_string_to_key(const char *str, DES_cblock *key);
159 | void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2);
160 | void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out,
161 | long length, DES_key_schedule *schedule,
162 | DES_cblock *ivec, int *num, int enc);
163 | void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out,
164 | long length, DES_key_schedule *schedule,
165 | DES_cblock *ivec, int *num);
166 |
167 | # define DES_fixup_key_parity DES_set_odd_parity
168 |
169 | # ifdef __cplusplus
170 | }
171 | # endif
172 | # endif
173 |
174 | #endif
175 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/include/openssl/e_os2.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_E_OS2_H
11 | # define HEADER_E_OS2_H
12 |
13 | # include
14 |
15 | #ifdef __cplusplus
16 | extern "C" {
17 | #endif
18 |
19 | /******************************************************************************
20 | * Detect operating systems. This probably needs completing.
21 | * The result is that at least one OPENSSL_SYS_os macro should be defined.
22 | * However, if none is defined, Unix is assumed.
23 | **/
24 |
25 | # define OPENSSL_SYS_UNIX
26 |
27 | /* --------------------- Microsoft operating systems ---------------------- */
28 |
29 | /*
30 | * Note that MSDOS actually denotes 32-bit environments running on top of
31 | * MS-DOS, such as DJGPP one.
32 | */
33 | # if defined(OPENSSL_SYS_MSDOS)
34 | # undef OPENSSL_SYS_UNIX
35 | # endif
36 |
37 | /*
38 | * For 32 bit environment, there seems to be the CygWin environment and then
39 | * all the others that try to do the same thing Microsoft does...
40 | */
41 | /*
42 | * UEFI lives here because it might be built with a Microsoft toolchain and
43 | * we need to avoid the false positive match on Windows.
44 | */
45 | # if defined(OPENSSL_SYS_UEFI)
46 | # undef OPENSSL_SYS_UNIX
47 | # elif defined(OPENSSL_SYS_UWIN)
48 | # undef OPENSSL_SYS_UNIX
49 | # define OPENSSL_SYS_WIN32_UWIN
50 | # else
51 | # if defined(__CYGWIN__) || defined(OPENSSL_SYS_CYGWIN)
52 | # undef OPENSSL_SYS_UNIX
53 | # define OPENSSL_SYS_WIN32_CYGWIN
54 | # else
55 | # if defined(_WIN32) || defined(OPENSSL_SYS_WIN32)
56 | # undef OPENSSL_SYS_UNIX
57 | # if !defined(OPENSSL_SYS_WIN32)
58 | # define OPENSSL_SYS_WIN32
59 | # endif
60 | # endif
61 | # if defined(_WIN64) || defined(OPENSSL_SYS_WIN64)
62 | # undef OPENSSL_SYS_UNIX
63 | # if !defined(OPENSSL_SYS_WIN64)
64 | # define OPENSSL_SYS_WIN64
65 | # endif
66 | # endif
67 | # if defined(OPENSSL_SYS_WINNT)
68 | # undef OPENSSL_SYS_UNIX
69 | # endif
70 | # if defined(OPENSSL_SYS_WINCE)
71 | # undef OPENSSL_SYS_UNIX
72 | # endif
73 | # endif
74 | # endif
75 |
76 | /* Anything that tries to look like Microsoft is "Windows" */
77 | # if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
78 | # undef OPENSSL_SYS_UNIX
79 | # define OPENSSL_SYS_WINDOWS
80 | # ifndef OPENSSL_SYS_MSDOS
81 | # define OPENSSL_SYS_MSDOS
82 | # endif
83 | # endif
84 |
85 | /*
86 | * DLL settings. This part is a bit tough, because it's up to the
87 | * application implementor how he or she will link the application, so it
88 | * requires some macro to be used.
89 | */
90 | # ifdef OPENSSL_SYS_WINDOWS
91 | # ifndef OPENSSL_OPT_WINDLL
92 | # if defined(_WINDLL) /* This is used when building OpenSSL to
93 | * indicate that DLL linkage should be used */
94 | # define OPENSSL_OPT_WINDLL
95 | # endif
96 | # endif
97 | # endif
98 |
99 | /* ------------------------------- OpenVMS -------------------------------- */
100 | # if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYS_VMS)
101 | # if !defined(OPENSSL_SYS_VMS)
102 | # undef OPENSSL_SYS_UNIX
103 | # endif
104 | # define OPENSSL_SYS_VMS
105 | # if defined(__DECC)
106 | # define OPENSSL_SYS_VMS_DECC
107 | # elif defined(__DECCXX)
108 | # define OPENSSL_SYS_VMS_DECC
109 | # define OPENSSL_SYS_VMS_DECCXX
110 | # else
111 | # define OPENSSL_SYS_VMS_NODECC
112 | # endif
113 | # endif
114 |
115 | /* -------------------------------- Unix ---------------------------------- */
116 | # ifdef OPENSSL_SYS_UNIX
117 | # if defined(linux) || defined(__linux__) && !defined(OPENSSL_SYS_LINUX)
118 | # define OPENSSL_SYS_LINUX
119 | # endif
120 | # if defined(_AIX) && !defined(OPENSSL_SYS_AIX)
121 | # define OPENSSL_SYS_AIX
122 | # endif
123 | # endif
124 |
125 | /* -------------------------------- VOS ----------------------------------- */
126 | # if defined(__VOS__) && !defined(OPENSSL_SYS_VOS)
127 | # define OPENSSL_SYS_VOS
128 | # ifdef __HPPA__
129 | # define OPENSSL_SYS_VOS_HPPA
130 | # endif
131 | # ifdef __IA32__
132 | # define OPENSSL_SYS_VOS_IA32
133 | # endif
134 | # endif
135 |
136 | /**
137 | * That's it for OS-specific stuff
138 | *****************************************************************************/
139 |
140 | /* Specials for I/O an exit */
141 | # ifdef OPENSSL_SYS_MSDOS
142 | # define OPENSSL_UNISTD_IO
143 | # define OPENSSL_DECLARE_EXIT extern void exit(int);
144 | # else
145 | # define OPENSSL_UNISTD_IO OPENSSL_UNISTD
146 | # define OPENSSL_DECLARE_EXIT /* declared in unistd.h */
147 | # endif
148 |
149 | /*-
150 | * Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare
151 | * certain global symbols that, with some compilers under VMS, have to be
152 | * defined and declared explicitly with globaldef and globalref.
153 | * Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare
154 | * DLL exports and imports for compilers under Win32. These are a little
155 | * more complicated to use. Basically, for any library that exports some
156 | * global variables, the following code must be present in the header file
157 | * that declares them, before OPENSSL_EXTERN is used:
158 | *
159 | * #ifdef SOME_BUILD_FLAG_MACRO
160 | * # undef OPENSSL_EXTERN
161 | * # define OPENSSL_EXTERN OPENSSL_EXPORT
162 | * #endif
163 | *
164 | * The default is to have OPENSSL_EXPORT, OPENSSL_EXTERN and OPENSSL_GLOBAL
165 | * have some generally sensible values.
166 | */
167 |
168 | # if defined(OPENSSL_SYS_VMS_NODECC)
169 | # define OPENSSL_EXPORT globalref
170 | # define OPENSSL_EXTERN globalref
171 | # define OPENSSL_GLOBAL globaldef
172 | # elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL)
173 | # define OPENSSL_EXPORT extern __declspec(dllexport)
174 | # define OPENSSL_EXTERN extern __declspec(dllimport)
175 | # define OPENSSL_GLOBAL
176 | # else
177 | # define OPENSSL_EXPORT extern
178 | # define OPENSSL_EXTERN extern
179 | # define OPENSSL_GLOBAL
180 | # endif
181 |
182 | /*-
183 | * Macros to allow global variables to be reached through function calls when
184 | * required (if a shared library version requires it, for example.
185 | * The way it's done allows definitions like this:
186 | *
187 | * // in foobar.c
188 | * OPENSSL_IMPLEMENT_GLOBAL(int,foobar,0)
189 | * // in foobar.h
190 | * OPENSSL_DECLARE_GLOBAL(int,foobar);
191 | * #define foobar OPENSSL_GLOBAL_REF(foobar)
192 | */
193 | # ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION
194 | # define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) \
195 | type *_shadow_##name(void) \
196 | { static type _hide_##name=value; return &_hide_##name; }
197 | # define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
198 | # define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
199 | # else
200 | # define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) OPENSSL_GLOBAL type _shadow_##name=value;
201 | # define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name
202 | # define OPENSSL_GLOBAL_REF(name) _shadow_##name
203 | # endif
204 |
205 | # ifdef _WIN32
206 | # ifdef _WIN64
207 | # define ossl_ssize_t __int64
208 | # define OSSL_SSIZE_MAX _I64_MAX
209 | # else
210 | # define ossl_ssize_t int
211 | # define OSSL_SSIZE_MAX INT_MAX
212 | # endif
213 | # endif
214 |
215 | # if defined(OPENSSL_SYS_UEFI) && !defined(ssize_t)
216 | # define ossl_ssize_t int
217 | # define OSSL_SSIZE_MAX INT_MAX
218 | # endif
219 |
220 | # ifndef ossl_ssize_t
221 | # define ossl_ssize_t ssize_t
222 | # if defined(SSIZE_MAX)
223 | # define OSSL_SSIZE_MAX SSIZE_MAX
224 | # elif defined(_POSIX_SSIZE_MAX)
225 | # define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX
226 | # endif
227 | # endif
228 |
229 | # ifdef DEBUG_UNUSED
230 | # define __owur __attribute__((__warn_unused_result__))
231 | # else
232 | # define __owur
233 | # endif
234 |
235 | /* Standard integer types */
236 | # if defined(OPENSSL_SYS_UEFI)
237 | typedef INT8 int8_t;
238 | typedef UINT8 uint8_t;
239 | typedef INT16 int16_t;
240 | typedef UINT16 uint16_t;
241 | typedef INT32 int32_t;
242 | typedef UINT32 uint32_t;
243 | typedef INT64 int64_t;
244 | typedef UINT64 uint64_t;
245 | # define PRIu64 "%Lu"
246 | # elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
247 | defined(__osf__) || defined(__sgi) || defined(__hpux) || \
248 | defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__)
249 | # include
250 | # elif defined(_MSC_VER) && _MSC_VER<=1500
251 | /*
252 | * minimally required typdefs for systems not supporting inttypes.h or
253 | * stdint.h: currently just older VC++
254 | */
255 | typedef signed char int8_t;
256 | typedef unsigned char uint8_t;
257 | typedef short int16_t;
258 | typedef unsigned short uint16_t;
259 | typedef int int32_t;
260 | typedef unsigned int uint32_t;
261 | typedef __int64 int64_t;
262 | typedef unsigned __int64 uint64_t;
263 | # else
264 | # include
265 | # endif
266 |
267 | /*
268 | * We need a format operator for some client tools for uint64_t. If inttypes.h
269 | * isn't available or did not define it, just go with hard-coded.
270 | */
271 | # ifndef PRIu64
272 | # ifdef SIXTY_FOUR_BIT_LONG
273 | # define PRIu64 "lu"
274 | # else
275 | # define PRIu64 "llu"
276 | # endif
277 | # endif
278 |
279 | /* ossl_inline: portable inline definition usable in public headers */
280 | # if !defined(inline) && !defined(__cplusplus)
281 | # if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
282 | /* just use inline */
283 | # define ossl_inline inline
284 | # elif defined(__GNUC__) && __GNUC__>=2
285 | # define ossl_inline __inline__
286 | # elif defined(_MSC_VER)
287 | /*
288 | * Visual Studio: inline is available in C++ only, however
289 | * __inline is available for C, see
290 | * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx
291 | */
292 | # define ossl_inline __inline
293 | # else
294 | # define ossl_inline
295 | # endif
296 | # else
297 | # define ossl_inline inline
298 | # endif
299 |
300 | # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
301 | # define ossl_noreturn _Noreturn
302 | # elif defined(__GNUC__) && __GNUC__ >= 2
303 | # define ossl_noreturn __attribute__((noreturn))
304 | # else
305 | # define ossl_noreturn
306 | # endif
307 |
308 | #ifdef __cplusplus
309 | }
310 | #endif
311 | #endif
312 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/include/openssl/lhash.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 | /*
11 | * Header for dynamic hash table routines Author - Eric Young
12 | */
13 |
14 | #ifndef HEADER_LHASH_H
15 | # define HEADER_LHASH_H
16 |
17 | # include
18 | # include
19 |
20 | #ifdef __cplusplus
21 | extern "C" {
22 | #endif
23 |
24 | typedef struct lhash_node_st OPENSSL_LH_NODE;
25 | typedef int (*OPENSSL_LH_COMPFUNC) (const void *, const void *);
26 | typedef unsigned long (*OPENSSL_LH_HASHFUNC) (const void *);
27 | typedef void (*OPENSSL_LH_DOALL_FUNC) (void *);
28 | typedef void (*OPENSSL_LH_DOALL_FUNCARG) (void *, void *);
29 | typedef struct lhash_st OPENSSL_LHASH;
30 |
31 | /*
32 | * Macros for declaring and implementing type-safe wrappers for LHASH
33 | * callbacks. This way, callbacks can be provided to LHASH structures without
34 | * function pointer casting and the macro-defined callbacks provide
35 | * per-variable casting before deferring to the underlying type-specific
36 | * callbacks. NB: It is possible to place a "static" in front of both the
37 | * DECLARE and IMPLEMENT macros if the functions are strictly internal.
38 | */
39 |
40 | /* First: "hash" functions */
41 | # define DECLARE_LHASH_HASH_FN(name, o_type) \
42 | unsigned long name##_LHASH_HASH(const void *);
43 | # define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
44 | unsigned long name##_LHASH_HASH(const void *arg) { \
45 | const o_type *a = arg; \
46 | return name##_hash(a); }
47 | # define LHASH_HASH_FN(name) name##_LHASH_HASH
48 |
49 | /* Second: "compare" functions */
50 | # define DECLARE_LHASH_COMP_FN(name, o_type) \
51 | int name##_LHASH_COMP(const void *, const void *);
52 | # define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
53 | int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
54 | const o_type *a = arg1; \
55 | const o_type *b = arg2; \
56 | return name##_cmp(a,b); }
57 | # define LHASH_COMP_FN(name) name##_LHASH_COMP
58 |
59 | /* Fourth: "doall_arg" functions */
60 | # define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
61 | void name##_LHASH_DOALL_ARG(void *, void *);
62 | # define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
63 | void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
64 | o_type *a = arg1; \
65 | a_type *b = arg2; \
66 | name##_doall_arg(a, b); }
67 | # define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
68 |
69 |
70 | # define LH_LOAD_MULT 256
71 |
72 | int OPENSSL_LH_error(OPENSSL_LHASH *lh);
73 | OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c);
74 | void OPENSSL_LH_free(OPENSSL_LHASH *lh);
75 | void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data);
76 | void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data);
77 | void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data);
78 | void OPENSSL_LH_doall(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNC func);
79 | void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg);
80 | unsigned long OPENSSL_LH_strhash(const char *c);
81 | unsigned long OPENSSL_LH_num_items(const OPENSSL_LHASH *lh);
82 | unsigned long OPENSSL_LH_get_down_load(const OPENSSL_LHASH *lh);
83 | void OPENSSL_LH_set_down_load(OPENSSL_LHASH *lh, unsigned long down_load);
84 |
85 | # ifndef OPENSSL_NO_STDIO
86 | void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp);
87 | void OPENSSL_LH_node_stats(const OPENSSL_LHASH *lh, FILE *fp);
88 | void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp);
89 | # endif
90 | void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
91 | void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
92 | void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
93 |
94 | # if OPENSSL_API_COMPAT < 0x10100000L
95 | # define _LHASH OPENSSL_LHASH
96 | # define LHASH_NODE OPENSSL_LH_NODE
97 | # define lh_error OPENSSL_LH_error
98 | # define lh_new OPENSSL_lh_new
99 | # define lh_free OPENSSL_LH_free
100 | # define lh_insert OPENSSL_LH_insert
101 | # define lh_delete OPENSSL_LH_delete
102 | # define lh_retrieve OPENSSL_LH_retrieve
103 | # define lh_doall OPENSSL_LH_doall
104 | # define lh_doall_arg OPENSSL_LH_doall_arg
105 | # define lh_strhash OPENSSL_LH_strhash
106 | # define lh_num_items OPENSSL_LH_num_items
107 | # ifndef OPENSSL_NO_STDIO
108 | # define lh_stats OPENSSL_LH_stats
109 | # define lh_node_stats OPENSSL_LH_node_stats
110 | # define lh_node_usage_stats OPENSSL_LH_node_usage_stats
111 | # endif
112 | # define lh_stats_bio OPENSSL_LH_stats_bio
113 | # define lh_node_stats_bio OPENSSL_LH_node_stats_bio
114 | # define lh_node_usage_stats_bio OPENSSL_LH_node_usage_stats_bio
115 | # endif
116 |
117 | /* Type checking... */
118 |
119 | # define LHASH_OF(type) struct lhash_st_##type
120 |
121 | # define DEFINE_LHASH_OF(type) \
122 | LHASH_OF(type) { union lh_##type##_dummy { void* d1; unsigned long d2; int d3; } dummy; }; \
123 | static ossl_inline LHASH_OF(type) * \
124 | lh_##type##_new(unsigned long (*hfn)(const type *), \
125 | int (*cfn)(const type *, const type *)) \
126 | { \
127 | return (LHASH_OF(type) *) \
128 | OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
129 | } \
130 | static ossl_inline void lh_##type##_free(LHASH_OF(type) *lh) \
131 | { \
132 | OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
133 | } \
134 | static ossl_inline type *lh_##type##_insert(LHASH_OF(type) *lh, type *d) \
135 | { \
136 | return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
137 | } \
138 | static ossl_inline type *lh_##type##_delete(LHASH_OF(type) *lh, const type *d) \
139 | { \
140 | return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
141 | } \
142 | static ossl_inline type *lh_##type##_retrieve(LHASH_OF(type) *lh, const type *d) \
143 | { \
144 | return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
145 | } \
146 | static ossl_inline int lh_##type##_error(LHASH_OF(type) *lh) \
147 | { \
148 | return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
149 | } \
150 | static ossl_inline unsigned long lh_##type##_num_items(LHASH_OF(type) *lh) \
151 | { \
152 | return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
153 | } \
154 | static ossl_inline void lh_##type##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
155 | { \
156 | OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); \
157 | } \
158 | static ossl_inline void lh_##type##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
159 | { \
160 | OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); \
161 | } \
162 | static ossl_inline void lh_##type##_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
163 | { \
164 | OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); \
165 | } \
166 | static ossl_inline unsigned long lh_##type##_get_down_load(LHASH_OF(type) *lh) \
167 | { \
168 | return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
169 | } \
170 | static ossl_inline void lh_##type##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) \
171 | { \
172 | OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
173 | } \
174 | static ossl_inline void lh_##type##_doall(LHASH_OF(type) *lh, \
175 | void (*doall)(type *)) \
176 | { \
177 | OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
178 | } \
179 | LHASH_OF(type)
180 |
181 | #define IMPLEMENT_LHASH_DOALL_ARG_CONST(type, argtype) \
182 | int_implement_lhash_doall(type, argtype, const type)
183 |
184 | #define IMPLEMENT_LHASH_DOALL_ARG(type, argtype) \
185 | int_implement_lhash_doall(type, argtype, type)
186 |
187 | #define int_implement_lhash_doall(type, argtype, cbargtype) \
188 | static ossl_inline void \
189 | lh_##type##_doall_##argtype(LHASH_OF(type) *lh, \
190 | void (*fn)(cbargtype *, argtype *), \
191 | argtype *arg) \
192 | { \
193 | OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNCARG)fn, (void *)arg); \
194 | } \
195 | LHASH_OF(type)
196 |
197 | DEFINE_LHASH_OF(OPENSSL_STRING);
198 | DEFINE_LHASH_OF(OPENSSL_CSTRING);
199 |
200 | #ifdef __cplusplus
201 | }
202 | #endif
203 |
204 | #endif
205 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/include/openssl/modes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008-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 | #ifdef __cplusplus
13 | extern "C" {
14 | #endif
15 | typedef void (*block128_f) (const unsigned char in[16],
16 | unsigned char out[16], const void *key);
17 |
18 | typedef void (*cbc128_f) (const unsigned char *in, unsigned char *out,
19 | size_t len, const void *key,
20 | unsigned char ivec[16], int enc);
21 |
22 | typedef void (*ctr128_f) (const unsigned char *in, unsigned char *out,
23 | size_t blocks, const void *key,
24 | const unsigned char ivec[16]);
25 |
26 | typedef void (*ccm128_f) (const unsigned char *in, unsigned char *out,
27 | size_t blocks, const void *key,
28 | const unsigned char ivec[16],
29 | unsigned char cmac[16]);
30 |
31 | void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
32 | size_t len, const void *key,
33 | unsigned char ivec[16], block128_f block);
34 | void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
35 | size_t len, const void *key,
36 | unsigned char ivec[16], block128_f block);
37 |
38 | void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
39 | size_t len, const void *key,
40 | unsigned char ivec[16],
41 | unsigned char ecount_buf[16], unsigned int *num,
42 | block128_f block);
43 |
44 | void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
45 | size_t len, const void *key,
46 | unsigned char ivec[16],
47 | unsigned char ecount_buf[16],
48 | unsigned int *num, ctr128_f ctr);
49 |
50 | void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
51 | size_t len, const void *key,
52 | unsigned char ivec[16], int *num,
53 | block128_f block);
54 |
55 | void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
56 | size_t len, const void *key,
57 | unsigned char ivec[16], int *num,
58 | int enc, block128_f block);
59 | void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
60 | size_t length, const void *key,
61 | unsigned char ivec[16], int *num,
62 | int enc, block128_f block);
63 | void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
64 | size_t bits, const void *key,
65 | unsigned char ivec[16], int *num,
66 | int enc, block128_f block);
67 |
68 | size_t CRYPTO_cts128_encrypt_block(const unsigned char *in,
69 | unsigned char *out, size_t len,
70 | const void *key, unsigned char ivec[16],
71 | block128_f block);
72 | size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
73 | size_t len, const void *key,
74 | unsigned char ivec[16], cbc128_f cbc);
75 | size_t CRYPTO_cts128_decrypt_block(const unsigned char *in,
76 | unsigned char *out, size_t len,
77 | const void *key, unsigned char ivec[16],
78 | block128_f block);
79 | size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
80 | size_t len, const void *key,
81 | unsigned char ivec[16], cbc128_f cbc);
82 |
83 | size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in,
84 | unsigned char *out, size_t len,
85 | const void *key,
86 | unsigned char ivec[16],
87 | block128_f block);
88 | size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,
89 | size_t len, const void *key,
90 | unsigned char ivec[16], cbc128_f cbc);
91 | size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in,
92 | unsigned char *out, size_t len,
93 | const void *key,
94 | unsigned char ivec[16],
95 | block128_f block);
96 | size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,
97 | size_t len, const void *key,
98 | unsigned char ivec[16], cbc128_f cbc);
99 |
100 | typedef struct gcm128_context GCM128_CONTEXT;
101 |
102 | GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block);
103 | void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block);
104 | void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
105 | size_t len);
106 | int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
107 | size_t len);
108 | int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
109 | const unsigned char *in, unsigned char *out,
110 | size_t len);
111 | int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
112 | const unsigned char *in, unsigned char *out,
113 | size_t len);
114 | int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
115 | const unsigned char *in, unsigned char *out,
116 | size_t len, ctr128_f stream);
117 | int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
118 | const unsigned char *in, unsigned char *out,
119 | size_t len, ctr128_f stream);
120 | int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
121 | size_t len);
122 | void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
123 | void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx);
124 |
125 | typedef struct ccm128_context CCM128_CONTEXT;
126 |
127 | void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
128 | unsigned int M, unsigned int L, void *key,
129 | block128_f block);
130 | int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce,
131 | size_t nlen, size_t mlen);
132 | void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad,
133 | size_t alen);
134 | int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
135 | unsigned char *out, size_t len);
136 | int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
137 | unsigned char *out, size_t len);
138 | int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
139 | unsigned char *out, size_t len,
140 | ccm128_f stream);
141 | int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
142 | unsigned char *out, size_t len,
143 | ccm128_f stream);
144 | size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
145 |
146 | typedef struct xts128_context XTS128_CONTEXT;
147 |
148 | int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
149 | const unsigned char iv[16],
150 | const unsigned char *inp, unsigned char *out,
151 | size_t len, int enc);
152 |
153 | size_t CRYPTO_128_wrap(void *key, const unsigned char *iv,
154 | unsigned char *out,
155 | const unsigned char *in, size_t inlen,
156 | block128_f block);
157 |
158 | size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,
159 | unsigned char *out,
160 | const unsigned char *in, size_t inlen,
161 | block128_f block);
162 | size_t CRYPTO_128_wrap_pad(void *key, const unsigned char *icv,
163 | unsigned char *out, const unsigned char *in,
164 | size_t inlen, block128_f block);
165 | size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
166 | unsigned char *out, const unsigned char *in,
167 | size_t inlen, block128_f block);
168 |
169 | #ifndef OPENSSL_NO_OCB
170 | typedef struct ocb128_context OCB128_CONTEXT;
171 |
172 | typedef void (*ocb128_f) (const unsigned char *in, unsigned char *out,
173 | size_t blocks, const void *key,
174 | size_t start_block_num,
175 | unsigned char offset_i[16],
176 | const unsigned char L_[][16],
177 | unsigned char checksum[16]);
178 |
179 | OCB128_CONTEXT *CRYPTO_ocb128_new(void *keyenc, void *keydec,
180 | block128_f encrypt, block128_f decrypt,
181 | ocb128_f stream);
182 | int CRYPTO_ocb128_init(OCB128_CONTEXT *ctx, void *keyenc, void *keydec,
183 | block128_f encrypt, block128_f decrypt,
184 | ocb128_f stream);
185 | int CRYPTO_ocb128_copy_ctx(OCB128_CONTEXT *dest, OCB128_CONTEXT *src,
186 | void *keyenc, void *keydec);
187 | int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv,
188 | size_t len, size_t taglen);
189 | int CRYPTO_ocb128_aad(OCB128_CONTEXT *ctx, const unsigned char *aad,
190 | size_t len);
191 | int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, const unsigned char *in,
192 | unsigned char *out, size_t len);
193 | int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, const unsigned char *in,
194 | unsigned char *out, size_t len);
195 | int CRYPTO_ocb128_finish(OCB128_CONTEXT *ctx, const unsigned char *tag,
196 | size_t len);
197 | int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len);
198 | void CRYPTO_ocb128_cleanup(OCB128_CONTEXT *ctx);
199 | #endif /* OPENSSL_NO_OCB */
200 |
201 | #ifdef __cplusplus
202 | }
203 | #endif
204 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 0x1010005fL
43 | # ifdef OPENSSL_FIPS
44 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0e-fips 16 Feb 2017"
45 | # else
46 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0e 16 Feb 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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/include/openssl/ossl_typ.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-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_OPENSSL_TYPES_H
11 | # define HEADER_OPENSSL_TYPES_H
12 |
13 | #include
14 |
15 | #ifdef __cplusplus
16 | extern "C" {
17 | #endif
18 |
19 | # include
20 |
21 | # ifdef NO_ASN1_TYPEDEFS
22 | # define ASN1_INTEGER ASN1_STRING
23 | # define ASN1_ENUMERATED ASN1_STRING
24 | # define ASN1_BIT_STRING ASN1_STRING
25 | # define ASN1_OCTET_STRING ASN1_STRING
26 | # define ASN1_PRINTABLESTRING ASN1_STRING
27 | # define ASN1_T61STRING ASN1_STRING
28 | # define ASN1_IA5STRING ASN1_STRING
29 | # define ASN1_UTCTIME ASN1_STRING
30 | # define ASN1_GENERALIZEDTIME ASN1_STRING
31 | # define ASN1_TIME ASN1_STRING
32 | # define ASN1_GENERALSTRING ASN1_STRING
33 | # define ASN1_UNIVERSALSTRING ASN1_STRING
34 | # define ASN1_BMPSTRING ASN1_STRING
35 | # define ASN1_VISIBLESTRING ASN1_STRING
36 | # define ASN1_UTF8STRING ASN1_STRING
37 | # define ASN1_BOOLEAN int
38 | # define ASN1_NULL int
39 | # else
40 | typedef struct asn1_string_st ASN1_INTEGER;
41 | typedef struct asn1_string_st ASN1_ENUMERATED;
42 | typedef struct asn1_string_st ASN1_BIT_STRING;
43 | typedef struct asn1_string_st ASN1_OCTET_STRING;
44 | typedef struct asn1_string_st ASN1_PRINTABLESTRING;
45 | typedef struct asn1_string_st ASN1_T61STRING;
46 | typedef struct asn1_string_st ASN1_IA5STRING;
47 | typedef struct asn1_string_st ASN1_GENERALSTRING;
48 | typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
49 | typedef struct asn1_string_st ASN1_BMPSTRING;
50 | typedef struct asn1_string_st ASN1_UTCTIME;
51 | typedef struct asn1_string_st ASN1_TIME;
52 | typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
53 | typedef struct asn1_string_st ASN1_VISIBLESTRING;
54 | typedef struct asn1_string_st ASN1_UTF8STRING;
55 | typedef struct asn1_string_st ASN1_STRING;
56 | typedef int ASN1_BOOLEAN;
57 | typedef int ASN1_NULL;
58 | # endif
59 |
60 | typedef struct asn1_object_st ASN1_OBJECT;
61 |
62 | typedef struct ASN1_ITEM_st ASN1_ITEM;
63 | typedef struct asn1_pctx_st ASN1_PCTX;
64 | typedef struct asn1_sctx_st ASN1_SCTX;
65 |
66 | # ifdef _WIN32
67 | # undef X509_NAME
68 | # undef X509_EXTENSIONS
69 | # undef PKCS7_ISSUER_AND_SERIAL
70 | # undef PKCS7_SIGNER_INFO
71 | # undef OCSP_REQUEST
72 | # undef OCSP_RESPONSE
73 | # endif
74 |
75 | # ifdef BIGNUM
76 | # undef BIGNUM
77 | # endif
78 | struct dane_st;
79 | typedef struct bio_st BIO;
80 | typedef struct bignum_st BIGNUM;
81 | typedef struct bignum_ctx BN_CTX;
82 | typedef struct bn_blinding_st BN_BLINDING;
83 | typedef struct bn_mont_ctx_st BN_MONT_CTX;
84 | typedef struct bn_recp_ctx_st BN_RECP_CTX;
85 | typedef struct bn_gencb_st BN_GENCB;
86 |
87 | typedef struct buf_mem_st BUF_MEM;
88 |
89 | typedef struct evp_cipher_st EVP_CIPHER;
90 | typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
91 | typedef struct evp_md_st EVP_MD;
92 | typedef struct evp_md_ctx_st EVP_MD_CTX;
93 | typedef struct evp_pkey_st EVP_PKEY;
94 |
95 | typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
96 |
97 | typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
98 | typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
99 |
100 | typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
101 |
102 | typedef struct hmac_ctx_st HMAC_CTX;
103 |
104 | typedef struct dh_st DH;
105 | typedef struct dh_method DH_METHOD;
106 |
107 | typedef struct dsa_st DSA;
108 | typedef struct dsa_method DSA_METHOD;
109 |
110 | typedef struct rsa_st RSA;
111 | typedef struct rsa_meth_st RSA_METHOD;
112 |
113 | typedef struct ec_key_st EC_KEY;
114 | typedef struct ec_key_method_st EC_KEY_METHOD;
115 |
116 | typedef struct rand_meth_st RAND_METHOD;
117 |
118 | typedef struct ssl_dane_st SSL_DANE;
119 | typedef struct x509_st X509;
120 | typedef struct X509_algor_st X509_ALGOR;
121 | typedef struct X509_crl_st X509_CRL;
122 | typedef struct x509_crl_method_st X509_CRL_METHOD;
123 | typedef struct x509_revoked_st X509_REVOKED;
124 | typedef struct X509_name_st X509_NAME;
125 | typedef struct X509_pubkey_st X509_PUBKEY;
126 | typedef struct x509_store_st X509_STORE;
127 | typedef struct x509_store_ctx_st X509_STORE_CTX;
128 |
129 | typedef struct x509_object_st X509_OBJECT;
130 | typedef struct x509_lookup_st X509_LOOKUP;
131 | typedef struct x509_lookup_method_st X509_LOOKUP_METHOD;
132 | typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM;
133 |
134 | typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
135 |
136 | typedef struct v3_ext_ctx X509V3_CTX;
137 | typedef struct conf_st CONF;
138 | typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS;
139 |
140 | typedef struct ui_st UI;
141 | typedef struct ui_method_st UI_METHOD;
142 |
143 | typedef struct engine_st ENGINE;
144 | typedef struct ssl_st SSL;
145 | typedef struct ssl_ctx_st SSL_CTX;
146 |
147 | typedef struct comp_ctx_st COMP_CTX;
148 | typedef struct comp_method_st COMP_METHOD;
149 |
150 | typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
151 | typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
152 | typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
153 | typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
154 |
155 | typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
156 | typedef struct DIST_POINT_st DIST_POINT;
157 | typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
158 | typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
159 |
160 | typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
161 |
162 | typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
163 | typedef struct ocsp_response_st OCSP_RESPONSE;
164 | typedef struct ocsp_responder_id_st OCSP_RESPID;
165 |
166 | typedef struct sct_st SCT;
167 | typedef struct sct_ctx_st SCT_CTX;
168 | typedef struct ctlog_st CTLOG;
169 | typedef struct ctlog_store_st CTLOG_STORE;
170 | typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX;
171 |
172 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
173 | defined(INTMAX_MAX) && defined(UINTMAX_MAX)
174 | typedef intmax_t ossl_intmax_t;
175 | typedef uintmax_t ossl_uintmax_t;
176 | #else
177 | /*
178 | * Not long long, because the C-library can only be expected to provide
179 | * strtoll(), strtoull() at the same time as intmax_t and strtoimax(),
180 | * strtoumax(). Since we use these for parsing arguments, we need the
181 | * conversion functions, not just the sizes.
182 | */
183 | typedef long ossl_intmax_t;
184 | typedef unsigned long ossl_uintmax_t;
185 | #endif
186 |
187 | #ifdef __cplusplus
188 | }
189 | #endif
190 | #endif /* def HEADER_OPENSSL_TYPES_H */
191 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/include/openssl/safestack.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_SAFESTACK_H
11 | # define HEADER_SAFESTACK_H
12 |
13 | # include
14 | # include
15 |
16 | #ifdef __cplusplus
17 | extern "C" {
18 | #endif
19 |
20 | # define STACK_OF(type) struct stack_st_##type
21 |
22 | # define SKM_DEFINE_STACK_OF(t1, t2, t3) \
23 | STACK_OF(t1); \
24 | typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 *const *b); \
25 | typedef void (*sk_##t1##_freefunc)(t3 *a); \
26 | typedef t3 * (*sk_##t1##_copyfunc)(const t3 *a); \
27 | static ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \
28 | { \
29 | return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
30 | } \
31 | static ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \
32 | { \
33 | return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
34 | } \
35 | static ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare) \
36 | { \
37 | return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
38 | } \
39 | static ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \
40 | { \
41 | return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
42 | } \
43 | static ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \
44 | { \
45 | OPENSSL_sk_free((OPENSSL_STACK *)sk); \
46 | } \
47 | static ossl_inline void sk_##t1##_zero(STACK_OF(t1) *sk) \
48 | { \
49 | OPENSSL_sk_zero((OPENSSL_STACK *)sk); \
50 | } \
51 | static ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \
52 | { \
53 | return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
54 | } \
55 | static ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \
56 | { \
57 | return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \
58 | (const void *)ptr); \
59 | } \
60 | static ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \
61 | { \
62 | return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
63 | } \
64 | static ossl_inline int sk_##t1##_unshift(STACK_OF(t1) *sk, t2 *ptr) \
65 | { \
66 | return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); \
67 | } \
68 | static ossl_inline t2 *sk_##t1##_pop(STACK_OF(t1) *sk) \
69 | { \
70 | return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \
71 | } \
72 | static ossl_inline t2 *sk_##t1##_shift(STACK_OF(t1) *sk) \
73 | { \
74 | return (t2 *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); \
75 | } \
76 | static ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc) \
77 | { \
78 | OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
79 | } \
80 | static ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx) \
81 | { \
82 | return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); \
83 | } \
84 | static ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \
85 | { \
86 | return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \
87 | } \
88 | static ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \
89 | { \
90 | return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
91 | } \
92 | static ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \
93 | { \
94 | return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); \
95 | } \
96 | static ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \
97 | { \
98 | OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
99 | } \
100 | static ossl_inline int sk_##t1##_is_sorted(const STACK_OF(t1) *sk) \
101 | { \
102 | return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); \
103 | } \
104 | static ossl_inline STACK_OF(t1) * sk_##t1##_dup(const STACK_OF(t1) *sk) \
105 | { \
106 | return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
107 | } \
108 | static ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(const STACK_OF(t1) *sk, \
109 | sk_##t1##_copyfunc copyfunc, \
110 | sk_##t1##_freefunc freefunc) \
111 | { \
112 | return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
113 | (OPENSSL_sk_copyfunc)copyfunc, \
114 | (OPENSSL_sk_freefunc)freefunc); \
115 | } \
116 | static ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \
117 | { \
118 | return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \
119 | }
120 |
121 | # define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2)
122 | # define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t)
123 | # define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2) \
124 | SKM_DEFINE_STACK_OF(t1, const t2, t2)
125 | # define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
126 |
127 | /*-
128 | * Strings are special: normally an lhash entry will point to a single
129 | * (somewhat) mutable object. In the case of strings:
130 | *
131 | * a) Instead of a single char, there is an array of chars, NUL-terminated.
132 | * b) The string may have be immutable.
133 | *
134 | * So, they need their own declarations. Especially important for
135 | * type-checking tools, such as Deputy.
136 | *
137 | * In practice, however, it appears to be hard to have a const
138 | * string. For now, I'm settling for dealing with the fact it is a
139 | * string at all.
140 | */
141 | typedef char *OPENSSL_STRING;
142 | typedef const char *OPENSSL_CSTRING;
143 |
144 | /*-
145 | * Confusingly, LHASH_OF(STRING) deals with char ** throughout, but
146 | * STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned
147 | * above, instead of a single char each entry is a NUL-terminated array of
148 | * chars. So, we have to implement STRING specially for STACK_OF. This is
149 | * dealt with in the autogenerated macros below.
150 | */
151 | DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
152 | DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char)
153 |
154 | /*
155 | * Similarly, we sometimes use a block of characters, NOT nul-terminated.
156 | * These should also be distinguished from "normal" stacks.
157 | */
158 | typedef void *OPENSSL_BLOCK;
159 | DEFINE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
160 |
161 | # ifdef __cplusplus
162 | }
163 | # endif
164 | #endif
165 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/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 |
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/lib/libcrypto.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/library/src/main/cpp/thirdparty/lib/libcrypto.a
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/lib/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/library/src/main/cpp/thirdparty/lib/libcurl.a
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/lib/libnghttp2.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/library/src/main/cpp/thirdparty/lib/libnghttp2.a
--------------------------------------------------------------------------------
/library/src/main/cpp/thirdparty/lib/libssl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/library/src/main/cpp/thirdparty/lib/libssl.a
--------------------------------------------------------------------------------
/library/src/main/java/io/github/lizhangqu/curl/Curl.java:
--------------------------------------------------------------------------------
1 | package io.github.lizhangqu.curl;
2 |
3 | /**
4 | * @version V1.0
5 | * @author: lizhangqu
6 | * @date: 2017-05-25 14:17
7 | */
8 | public class Curl {
9 | static {
10 | System.loadLibrary("curl-client");
11 | }
12 |
13 | public static native void test();
14 |
15 | public static native void dump(String url);
16 | }
17 |
--------------------------------------------------------------------------------
/library/src/main/obj/local/armeabi/objs/curl-client/native.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/CurlForAndroid/a6686af613b86a3c62928aad86221b030d8069a8/library/src/main/obj/local/armeabi/objs/curl-client/native.o
--------------------------------------------------------------------------------
/library/src/main/obj/local/armeabi/objs/curl-client/native.o.d:
--------------------------------------------------------------------------------
1 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/obj/local/armeabi/objs/curl-client/native.o: \
2 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/native.cpp \
3 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/native.h \
4 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/log.h \
5 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/curl.h \
6 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/curlver.h \
7 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/curlbuild.h \
8 | /Users/lizhangqu/AndroidSDK/ndk-bundle/sources/cxx-stl/llvm-libc++/include/inttypes.h \
9 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/curlrules.h \
10 | /Users/lizhangqu/AndroidSDK/ndk-bundle/sources/cxx-stl/llvm-libc++/include/stdio.h \
11 | /Users/lizhangqu/AndroidSDK/ndk-bundle/sources/android/support/include/time.h \
12 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/easy.h \
13 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/multi.h
14 |
15 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/native.h:
16 |
17 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/log.h:
18 |
19 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/curl.h:
20 |
21 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/curlver.h:
22 |
23 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/curlbuild.h:
24 |
25 | /Users/lizhangqu/AndroidSDK/ndk-bundle/sources/cxx-stl/llvm-libc++/include/inttypes.h:
26 |
27 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/curlrules.h:
28 |
29 | /Users/lizhangqu/AndroidSDK/ndk-bundle/sources/cxx-stl/llvm-libc++/include/stdio.h:
30 |
31 | /Users/lizhangqu/AndroidSDK/ndk-bundle/sources/android/support/include/time.h:
32 |
33 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/easy.h:
34 |
35 | /Users/lizhangqu/AndroidStudioProjects/CurlForAndroid/library/src/main/jni/../../../thirdparty/include/curl/multi.h:
36 |
--------------------------------------------------------------------------------
/library/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Library
3 |
4 |
--------------------------------------------------------------------------------
/library/src/test/java/io/github/lizhangqu/curl/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package io.github.lizhangqu.curl;
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() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':library'
2 |
--------------------------------------------------------------------------------