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

Commit 8cb1c86e authored by maheshkkv's avatar maheshkkv Committed by Mahesh KKV
Browse files

Add PASN comeback cookie for secure ranging

Flag: com.android.wifi.flags.secure_ranging
Bug: 364722301
Test: atest com.android.server.wifi
Change-Id: Id061c399d11a278de34879134b3fe8e7fd41b4bd
parent 2733768b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -71,4 +71,6 @@ parcelable RttResult {
  long baseAkm;
  long cipherSuite;
  int secureHeLtfProtocolVersion;
  long pasnComebackAfterMillis;
  @nullable byte[] pasnComebackCookie;
}
+1 −0
Original line number Diff line number Diff line
@@ -37,4 +37,5 @@ parcelable RttSecureConfig {
  android.hardware.wifi.PasnConfig pasnConfig;
  boolean enableSecureHeLtf;
  boolean enableRangingFrameProtection;
  byte[] pasnComebackCookie;
}
+15 −0
Original line number Diff line number Diff line
@@ -234,4 +234,19 @@ parcelable RttResult {
     * Secure HE-LTF protocol version used.
     */
    int secureHeLtfProtocolVersion;
    /**
     * When an AP receives a large volume of initial PASN Authentication frames, it can use the
     * comeback after field in the PASN Parameters element to indicate a deferral time and
     * optionally provide a comeback cookie which is an opaque sequence of octets. This field is
     * set to 0 to indicate that the subsequent ranging request can be retried with the
     * |pasnComebackCookie|.
     */
    long pasnComebackAfterMillis;
    /**
     * Comeback cookie is an opaque sequence of octects sent by the AP when PASN authentication
     * needs to be deferred. The same cookie needs to be passed in |RttSecureConfig| when the
     * station has to range with the AP after |RttResult.pasnComebackAfterMillis|. Maximum size of
     * cookie is 255 bytes. Refer IEEE Std 802.11az‐2022, section 9.4.2.303 PASN Parameters element.
     */
    @nullable byte[] pasnComebackCookie;
}
+4 −0
Original line number Diff line number Diff line
@@ -35,4 +35,8 @@ parcelable RttSecureConfig {
     * Enable Ranging frame protection.
     */
    boolean enableRangingFrameProtection;
    /**
     * Comeback cookie is an opaque sequence of octets retrieved from |RttResult|.
     */
    byte[] pasnComebackCookie;
}
+9 −1
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ typedef enum {

#define RTT_SECURITY_MAX_PASSPHRASE_LEN 63
#define PMKID_LEN 16
#define RTT_MAX_COOKIE_LEN 255

typedef struct {
    wifi_rtt_akm base_akm;  // Base Authentication and Key Management (AKM) protocol used for PASN
@@ -111,7 +112,9 @@ typedef struct {
    u32 pmkid_len;
    u8 pmkid[PMKID_LEN];  // PMKID corresponding to the cached PMK from the base AKM. PMKID can be
                          // null if no cached PMK is present.

    u8 comeback_cookie_len;  // Comeback cookie length. If the length is 0, it indicates there is no
                             // cookie.
    u8 comeback_cookie[RTT_MAX_COOKIE_LEN];  // Comeback cookie indicated over wifi_rtt_result_v4.
} wifi_rtt_pasn_config;

typedef struct {
@@ -261,6 +264,11 @@ typedef struct {
    wifi_rtt_akm base_akm;
    wifi_rtt_cipher_suite cipher_suite;
    int secure_he_ltf_protocol_version;
    u16 pasn_comeback_after_millis;  // The time in milliseconds after which the non-AP STA is
                                     // requested to retry the PASN authentication.
    u8 pasn_comeback_cookie_len;  // Comeback cookie length. If the length is 0, it indicates there
                                  // is no cookie.
    u8 pasn_comeback_cookie[RTT_MAX_COOKIE_LEN];  // Comeback cookie octets.
} wifi_rtt_result_v4;

/* RTT result callbacks */