Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0b882d5
Add Dependabot config for Cargo and Actions
Copilot Sep 9, 2026
14ca51b
Merge pull request #1 from uurcan7/copilot/add-dependabot-config
uurcan7 Sep 9, 2026
61191a8
chore(deps): bump actions/cache from 4 to 6
dependabot[bot] Sep 9, 2026
e5a6344
chore(deps): bump serde_json from 1.0.149 to 1.0.151 in /rust
dependabot[bot] Sep 9, 2026
059f975
chore(deps): bump actions/checkout from 4 to 7
dependabot[bot] Sep 9, 2026
588aba7
chore(deps): bump base64 from 0.22.1 to 0.23.1 in /rust
dependabot[bot] Sep 9, 2026
0183dd1
chore(deps): bump actions/upload-artifact from 4 to 7
dependabot[bot] Sep 9, 2026
82cddf2
chore(deps): bump rand from 0.8.5 to 0.10.2 in /rust
dependabot[bot] Sep 9, 2026
70b8f7d
chore(deps): bump actions/download-artifact from 4 to 8
dependabot[bot] Sep 9, 2026
120e9d7
Merge pull request #9 from uurcan7/dependabot/github_actions/actions/…
uurcan7 Sep 9, 2026
267f963
Merge pull request #7 from uurcan7/dependabot/github_actions/actions/…
uurcan7 Sep 9, 2026
00387b6
Merge pull request #6 from uurcan7/dependabot/cargo/rust/base64-0.23.1
uurcan7 Sep 9, 2026
a82720b
Merge pull request #5 from uurcan7/dependabot/github_actions/actions/…
uurcan7 Sep 9, 2026
8545f66
chore(deps): bump rustls-webpki
dependabot[bot] Sep 9, 2026
2347784
Merge pull request #3 from uurcan7/dependabot/cargo/rust/serde_json-1…
uurcan7 Sep 9, 2026
82208bd
Merge pull request #2 from uurcan7/dependabot/github_actions/actions/…
uurcan7 Sep 9, 2026
62f1d02
chore(deps): bump nix from 0.29.0 to 0.31.1 in /rust
dependabot[bot] Sep 9, 2026
e2d43f9
Merge pull request #4 from uurcan7/dependabot/cargo/rust/nix-0.31.1
uurcan7 Sep 9, 2026
1938508
Merge pull request #11 from uurcan7/dependabot/cargo/rust/cargo-29c3c…
uurcan7 Sep 9, 2026
216e233
chore(deps): bump rcgen from 0.12.1 to 0.14.10 in /rust
dependabot[bot] Sep 9, 2026
9486579
Pin rand to 0.8 for rsa compatibility
Copilot Sep 9, 2026
96d3274
Changes before error encountered
Copilot Sep 9, 2026
6a31cc6
Merge pull request #8 from uurcan7/dependabot/cargo/rust/rand-0.10.2
uurcan7 Sep 9, 2026
7972757
Merge pull request #10 from uurcan7/dependabot/cargo/rust/rcgen-0.14.10
uurcan7 Sep 9, 2026
793111f
Initial plan
Copilot Sep 10, 2026
64d2d8f
Initial plan
Copilot Sep 10, 2026
9844aec
fix: set least-privilege workflow token permissions
Copilot Sep 10, 2026
e72e707
fix: set least-privilege GITHUB_TOKEN permission in build workflow
Copilot Sep 10, 2026
bdc9e6a
Merge pull request #13 from uurcan7/copilot/fix-code-scanning-alert-3
uurcan7 Sep 10, 2026
11e9b00
Merge pull request #12 from uurcan7/copilot/fix-code-scanning-alerts
uurcan7 Sep 10, 2026
547e94e
Fix signal handler function pointer cast warning
Copilot Sep 10, 2026
9a91d77
Merge pull request #14 from uurcan7/copilot/dependabot-review-changes
uurcan7 Sep 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/rust"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
23 changes: 13 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
- 'rust/**'
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -38,7 +41,7 @@ jobs:
abi: x86

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
submodules: recursive

Expand All @@ -52,7 +55,7 @@ jobs:
with:
targets: ${{ matrix.target }}

- uses: actions/cache@v4
- uses: actions/cache@v6
with:
path: |
~/.cargo/registry
Expand Down Expand Up @@ -109,7 +112,7 @@ jobs:
env:
TARGET: ${{ matrix.target }}

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: bin-${{ matrix.abi }}-${{ matrix.profile }}
path: rust/target/${{ matrix.target }}/${{ matrix.profile }}/ta-enhanced
Expand All @@ -119,12 +122,12 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
submodules: recursive

- name: Download build artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
path: artifacts

Expand Down Expand Up @@ -214,13 +217,13 @@ jobs:
mv release/*-debug.zip release/dbg/ 2>/dev/null || true
mv release/*.zip release/rel/ 2>/dev/null || true

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: ta-enhanced-release-zip
path: release/rel/*.zip
retention-days: 30

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: ta-enhanced-debug-zip
path: release/dbg/*.zip
Expand All @@ -233,20 +236,20 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Read version
id: ver
run: |
ver=$(grep '^version=' module.prop | cut -d= -f2)
echo "version=${ver}" >> "$GITHUB_OUTPUT"

- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v8
with:
name: ta-enhanced-release-zip
path: zips/release

- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v8
with:
name: ta-enhanced-debug-zip
path: zips/debug
Expand Down
53 changes: 36 additions & 17 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ edition = "2021"
[dependencies]
clap = { version = "= 4.5.57", features = ["derive"] }
serde = { version = "= 1.0.228", features = ["derive"] }
serde_json = "= 1.0.149"
serde_json = "= 1.0.151"
toml = "= 0.8.23"
tracing = { version = "= 0.1.44", features = ["log"] }
tracing-subscriber = { version = "= 0.3.22", features = ["env-filter"] }
anyhow = "= 1.0.101"
libc = "= 0.2.180"
ureq = { version = "= 2.12.1", features = ["tls"] }
quick-xml = { version = "= 0.37.2", features = ["serialize"] }
base64 = "= 0.22.1"
nix = { version = "= 0.29.0", features = ["signal", "process"] }
base64 = "= 0.23.1"
nix = { version = "= 0.31.1", features = ["signal", "process"] }
ring = "0.17"
x509-parser = "= 0.18.1"
rcgen = { version = "0.12", default-features = false, features = ["pem", "ring"] }
rcgen = { version = "0.14", default-features = false, features = ["pem", "ring"] }
rsa = { version = "0.9", default-features = false, features = ["std", "pem"] }
p256 = { version = "= 0.13.2", default-features = false, features = ["std", "pem", "pkcs8", "ecdsa"] }
p384 = { version = "= 0.13.1", default-features = false, features = ["std", "pem", "pkcs8", "ecdsa"] }
Expand Down
13 changes: 7 additions & 6 deletions rust/src/keybox/generate.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{Context, Result};
use rcgen::{Certificate, CertificateParams, DistinguishedName, DnType, PKCS_ECDSA_P256_SHA256};
use rcgen::{CertificateParams, DistinguishedName, DnType, KeyPair, PKCS_ECDSA_P256_SHA256};
use rsa::RsaPrivateKey;
use rsa::pkcs8::EncodePrivateKey;

Expand Down Expand Up @@ -33,15 +33,16 @@ pub fn generate_and_install() -> Result<()> {

fn generate() -> Result<String> {
let mut params = CertificateParams::default();
params.alg = &PKCS_ECDSA_P256_SHA256;
params.distinguished_name = DistinguishedName::new();
params.distinguished_name.push(DnType::CommonName, "Android Keybox");

let cert = Certificate::from_params(params)
let ec_key = KeyPair::generate_for(&PKCS_ECDSA_P256_SHA256)
.context("EC key generation failed")?;
let cert = params
.self_signed(&ec_key)
.context("EC cert generation failed")?;
let ec_pem = cert.serialize_private_key_pem();
let cert_pem = cert.serialize_pem()
.context("cert serialization failed")?;
let ec_pem = ec_key.serialize_pem();
let cert_pem = cert.pem();

let mut rng = rand::rngs::OsRng;
let rsa_key = RsaPrivateKey::new(&mut rng, 2048)
Expand Down
30 changes: 15 additions & 15 deletions rust/src/keybox/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,18 +767,18 @@ mod tests {

#[test]
fn ecdsa_p256_self_signed_link_verifies() {
use rcgen::{Certificate, CertificateParams, DistinguishedName, DnType, PKCS_ECDSA_P256_SHA256};
use rcgen::{CertificateParams, DistinguishedName, DnType, KeyPair, PKCS_ECDSA_P256_SHA256};

let mut params = CertificateParams::default();
params.alg = &PKCS_ECDSA_P256_SHA256;
params.distinguished_name = DistinguishedName::new();
params
.distinguished_name
.push(DnType::CommonName, "test-leaf");
let cert = Certificate::from_params(params).expect("rcgen build");
let der = cert.serialize_der().expect("rcgen serialize");
let key = KeyPair::generate_for(&PKCS_ECDSA_P256_SHA256).expect("rcgen key");
let cert = params.self_signed(&key).expect("rcgen build");
let der = cert.der();

let (_, parsed) = X509Certificate::from_der(&der).expect("x509 parse");
let (_, parsed) = X509Certificate::from_der(der.as_ref()).expect("x509 parse");
verify_link(&parsed, &parsed).expect("self-signed P-256 link verifies");
}

Expand Down Expand Up @@ -811,18 +811,18 @@ mod tests {

#[test]
fn lookup_revocation_finds_serial() {
use rcgen::{Certificate, CertificateParams, DistinguishedName, DnType, PKCS_ECDSA_P256_SHA256, SerialNumber};
use rcgen::{CertificateParams, DistinguishedName, DnType, KeyPair, PKCS_ECDSA_P256_SHA256, SerialNumber};

let mut params = CertificateParams::default();
params.alg = &PKCS_ECDSA_P256_SHA256;
params.serial_number = Some(SerialNumber::from(0xdead_beefu64));
params.distinguished_name = DistinguishedName::new();
params
.distinguished_name
.push(DnType::CommonName, "rev-test");
let cert = Certificate::from_params(params).expect("rcgen build");
let der = cert.serialize_der().expect("rcgen serialize");
let (_, parsed) = X509Certificate::from_der(&der).expect("x509 parse");
let key = KeyPair::generate_for(&PKCS_ECDSA_P256_SHA256).expect("rcgen key");
let cert = params.self_signed(&key).expect("rcgen build");
let der = cert.der();
let (_, parsed) = X509Certificate::from_der(der.as_ref()).expect("x509 parse");

let mut entries = serde_json::Map::new();
entries.insert(
Expand All @@ -839,16 +839,16 @@ mod tests {

#[test]
fn lookup_revocation_returns_none_when_clean() {
use rcgen::{Certificate, CertificateParams, DistinguishedName, DnType, PKCS_ECDSA_P256_SHA256, SerialNumber};
use rcgen::{CertificateParams, DistinguishedName, DnType, KeyPair, PKCS_ECDSA_P256_SHA256, SerialNumber};

let mut params = CertificateParams::default();
params.alg = &PKCS_ECDSA_P256_SHA256;
params.serial_number = Some(SerialNumber::from(0x1234u64));
params.distinguished_name = DistinguishedName::new();
params.distinguished_name.push(DnType::CommonName, "clean");
let cert = Certificate::from_params(params).expect("rcgen build");
let der = cert.serialize_der().expect("rcgen serialize");
let (_, parsed) = X509Certificate::from_der(&der).expect("x509 parse");
let key = KeyPair::generate_for(&PKCS_ECDSA_P256_SHA256).expect("rcgen key");
let cert = params.self_signed(&key).expect("rcgen build");
let der = cert.der();
let (_, parsed) = X509Certificate::from_der(der.as_ref()).expect("x509 parse");

let mut entries = serde_json::Map::new();
entries.insert(
Expand Down
2 changes: 1 addition & 1 deletion rust/src/platform/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub static SHUTDOWN: AtomicBool = AtomicBool::new(false);
pub fn register_shutdown_handler() {
unsafe {
let mut sa: libc::sigaction = std::mem::zeroed();
sa.sa_sigaction = shutdown_handler as usize;
sa.sa_sigaction = shutdown_handler as *const () as usize;
sa.sa_flags = libc::SA_RESTART;
libc::sigaction(libc::SIGTERM, &sa, std::ptr::null_mut());
libc::sigaction(libc::SIGINT, &sa, std::ptr::null_mut());
Expand Down