Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2714908 authored by Nikita Iashchenko's avatar Nikita Iashchenko Committed by Automerger Merge Worker
Browse files

Merge "Import TLS handshake atom for Conscrypt" am: 97f35bbb am: bce02088 am: d5cad5b3

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1484136

Change-Id: I34e7639f6fb4aa3516302d6d63fc74fd632dbcea
parents a6fdffee d5cad5b3
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enu
import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
import "frameworks/base/core/proto/android/stats/tls/enums.proto";
import "frameworks/base/core/proto/android/telecomm/enums.proto";
import "frameworks/base/core/proto/android/telephony/enums.proto";
import "frameworks/base/core/proto/android/view/enums.proto";
@@ -485,6 +486,7 @@ message Atom {
        NetworkTetheringReported  network_tethering_reported =
            303 [(module) = "network_tethering"];
        ImeTouchReported ime_touch_reported = 304 [(module) = "sysui"];
        TlsHandshakeReported tls_handshake_reported = 317 [(module) = "conscrypt"];

        MediametricsMediaParserReported mediametrics_mediaparser_reported = 316;

@@ -11262,3 +11264,19 @@ message BlobInfo {
    // List of leasees of this Blob
    optional BlobLeaseeListProto leasees = 5;
}

/**
  * Pushes TLS handshake counters from Conscrypt.
  * Pulled from:
  *   external/conscrypt/common/src/main/java/org/conscrypt/ConscryptEngineSocket.java
  *   external/conscrypt/common/src/main/java/org/conscrypt/ConscryptFileDescriptorSocket.java
  */
  message TlsHandshakeReported {
    optional bool success = 1;

    optional android.stats.tls.Protocol protocol = 2;

    optional android.stats.tls.CipherSuite cipher_suite = 3;

    optional int32 handshake_duration_millis = 4;
}
+69 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
syntax = "proto2";
package android.stats.tls;

// Keep in sync with
// external/conscrypt/{android,platform}/src/main/java/org/conscrypt/Platform.java
enum Protocol {
    UNKNOWN_PROTO = 0;
    SSL_V3 = 1;
    TLS_V1 = 2;
    TLS_V1_1 = 3;
    TLS_V1_2 = 4;
    TLS_V1_3 = 5;
}

// Cipher suites' ids are based on IANA's database:
// https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4
//
// If you add new cipher suite, make sure id is the same as in  IANA's database (see link above)
//
// Keep in sync with
// external/conscrypt/{android,platform}/src/main/java/org/conscrypt/Platform.java
enum CipherSuite {
    UNKNOWN_CIPHER_SUITE = 0x0000;

    TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A;
    TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014;
    TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035;
    TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009;
    TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013;
    TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F;
    TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A;

    // TLSv1.2 cipher suites
    TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C;
    TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D;
    TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F;
    TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030;
    TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B;
    TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C;
    TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA9;
    TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA8;

    // Pre-Shared Key (PSK) cipher suites
    TLS_PSK_WITH_AES_128_CBC_SHA = 0x008C;
    TLS_PSK_WITH_AES_256_CBC_SHA = 0x008D;
    TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA = 0xC035;
    TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA = 0xC036;
    TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAC;

    // TLS 1.3 cipher suites
    TLS_AES_128_GCM_SHA256 = 0x1301;
    TLS_AES_256_GCM_SHA384 = 0x1302;
    TLS_CHACHA20_POLY1305_SHA256 = 0x1303;
}
 No newline at end of file