1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_ANDROID_LEGACY_OPENSSL_H
6 #define NET_ANDROID_LEGACY_OPENSSL_H
8 // This file contains a replica of the Android system OpenSSL ABI shipped in
9 // Android 4.1.x (API level 16). The ABI may not necessarily be compatible with
10 // the copy of OpenSSL shipped in Chromium. This is used to implement
11 // RSA_private_encrypt in one of the legacy client auth codepaths.
13 // See https://android.googlesource.com/platform/external/openssl/+/android-4.1.2_r2.1
19 ANDROID_EVP_PKEY_RSA
= 6,
23 ANDROID_RSA_PKCS1_PADDING
= 1,
24 ANDROID_RSA_SSLV23_PADDING
= 2,
25 ANDROID_RSA_NO_PADDING
= 3,
26 ANDROID_RSA_PKCS1_OAEP_PADDING
= 4,
27 ANDROID_X931_PADDING
= 5,
28 ANDROID_PKCS1_PSS_PADDING
= 6,
31 struct AndroidEVP_PKEY_ASN1_METHOD
;
32 struct AndroidRSA_METHOD
;
35 struct AndroidCRYPTO_EX_DATA
{
40 struct AndroidENGINE
{
42 // Remaining fields intentionally omitted.
48 const AndroidRSA_METHOD
* meth
;
49 AndroidENGINE
* engine
;
50 // Remaining fields intentionally omitted.
53 struct AndroidRSA_METHOD
{
55 int (*rsa_pub_enc
)(int flen
,
56 const unsigned char* from
,
60 int (*rsa_pub_dec
)(int flen
,
61 const unsigned char* from
,
65 int (*rsa_priv_enc
)(int flen
,
66 const unsigned char* from
,
70 int (*rsa_priv_dec
)(int flen
,
71 const unsigned char* from
,
75 // Remaining fields intentionally omitted.
78 struct AndroidEVP_PKEY
{
81 // Note: this value must NOT be modified using Chromium's CRYPTO_add
82 // function. That may not necessarily use the same locking implementation as
85 const AndroidEVP_PKEY_ASN1_METHOD
* ameth
;
86 AndroidENGINE
* engine
;
92 AndroidSTACK
* attributes
;
95 } // namespace android
98 #endif // NET_ANDROID_LEGACY_OPENSSL_H