Merge "Import upstream fixes to type-safety flaws in rust-openssl" into main
diff --git a/.cargo/config.toml b/.cargo/config.toml
index 278afcd..77327b7 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -1,2 +1,2 @@
 [patch.crates-io]
-bssl-ffi = { package = "bssl-sys", version = "0.1.0", path = "../../../boringssl/src/rust/bssl-sys", optional=true }
+bssl-sys = { version = "0.1.0", path = "../../../boringssl/src/rust/bssl-sys", optional=true }
diff --git a/Android.bp b/Android.bp
index c650f2e..dce55fb 100644
--- a/Android.bp
+++ b/Android.bp
@@ -10,7 +10,7 @@
 //
 // Even if upstreamed, cargo2android.py will likely never run correctly on
 // this package without modification because boringssl does not intend to
-// publish "bssl-ffi" on crates.io, since it needs to match the exact local
+// publish "bssl-sys" on crates.io, since it needs to match the exact local
 // version of boringssl.
 
 package {
@@ -60,7 +60,7 @@
     ],
     rustlibs: [
         "libbitflags-1.3.2",
-        "libbssl_ffi",
+        "libbssl_sys",
         "libcfg_if",
         "libforeign_types",
         "liblibc",
@@ -95,7 +95,7 @@
         "libonce_cell",
     ],
     rlibs: [
-        "libbssl_ffi_static",
+        "libbssl_sys_static",
     ],
     proc_macros: ["libopenssl_macros"],
 }
diff --git a/Cargo.lock b/Cargo.lock
index f0b6a60..ad61be1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -60,8 +60,6 @@
 [[package]]
 name = "bssl-sys"
 version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "312d12393c060384f2e6ed14c7b4be37b3dd90249857485613c1a91b9a1abb5c"
 
 [[package]]
 name = "cc"
diff --git a/cargo_embargo.json b/cargo_embargo.json
index 16df1d0..d09e89f 100644
--- a/cargo_embargo.json
+++ b/cargo_embargo.json
@@ -17,7 +17,7 @@
     {
       "module_name_overrides": {
         "libbitflags": "libbitflags-1.3.2",
-        "libopenssl_sys": "libbssl_ffi"
+        "libopenssl_sys": "libbssl_sys"
       }
     },
     {
diff --git a/patches/0001-cfgs.diff b/patches/0001-cfgs.diff
index ae6ba11..6cc5f29 100644
--- a/patches/0001-cfgs.diff
+++ b/patches/0001-cfgs.diff
@@ -5,7 +5,7 @@
 +++ b/.cargo/config.toml
 @@ -0,0 +1,2 @@
 +[patch.crates-io]
-+bssl-ffi = { package = "bssl-sys", version = "0.1.0", path = "../../../boringssl/src/rust/bssl-sys", optional=true }
++bssl-sys = { version = "0.1.0", path = "../../../boringssl/src/rust/bssl-sys", optional=true }
 diff --git a/src/cipher.rs b/src/cipher.rs
 index ab5f49d..84a8265 100644
 --- a/src/cipher.rs
@@ -71,7 +71,7 @@
  #![warn(rust_2018_idioms)]
  
 +#[cfg(all(soong, boringssl))]
-+extern crate bssl_ffi as ffi;
++extern crate bssl_sys as ffi;
 +
  #[doc(inline)]
  pub use ffi::init;
diff --git a/patches/Android.bp.diff b/patches/Android.bp.diff
index b9f0654..808329d 100644
--- a/patches/Android.bp.diff
+++ b/patches/Android.bp.diff
@@ -9,7 +9,7 @@
 -        "libopenssl_sys",
 +    ],
 +    rlibs: [
-+        "libbssl_ffi_static",
++        "libbssl_sys_static",
      ],
      proc_macros: ["libopenssl_macros"],
  }
diff --git a/src/lib.rs b/src/lib.rs
index cfc6efc..a5d3523 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -121,7 +121,7 @@
 #![warn(rust_2018_idioms)]
 
 #[cfg(all(soong, boringssl))]
-extern crate bssl_ffi as ffi;
+extern crate bssl_sys as ffi;
 
 #[doc(inline)]
 pub use ffi::init;