chore(i18n): finish translating code comments and scripts to English
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
Completes the English-only standardization for code, comments, scripts and CI templates (UI/CLI-facing strings stay bilingual pt-BR/en, untouched). Covers the remaining crates/, apps/gui/ui/ and apps/gui/src-tauri/ comments, .gitea/ workflow and template comments, .githooks/ hooks, and the scripts/ source comments for the files already renamed in a prior commit (check.sh, generate-logo.py, install-hooks.sh). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
This commit is contained in:
1 parent
da212e6926
commit
6328220c60
129 files changed
+1961
-1834
No files matched your search
@@ -1,8 +1,8 @@
|
||||
//! Cifras de disco (somente leitura) e desbloqueio de volumes cifrados.
|
||||
//! Read-only disk ciphers and encrypted volume unlocking.
|
||||
//!
|
||||
//! An unlocked volume is exposed as a standard `Source`: the rest of Guará
|
||||
//! (scanning, recovery) sees the plaintext filesystem transparently.
|
||||
//!
|
||||
//! O volume desbloqueado é exposto como uma `Source` comum: o restante do Guará
|
||||
//! (varredura, recuperação) enxerga o sistema de arquivos em claro, sem saber
|
||||
//! que existe cifra por baixo.
|
||||
|
||||
pub mod bitlocker;
|
||||
pub mod filevault;
|
||||
@@ -14,7 +14,7 @@ use aes::{Aes128, Aes192, Aes256};
|
||||
use std::io;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// AES com tamanho de chave escolhido em tempo de execução.
|
||||
/// AES cipher with runtime key size selection.
|
||||
#[derive(Clone)]
|
||||
pub enum AesAny {
|
||||
A128(Aes128),
|
||||
@@ -55,21 +55,21 @@ fn xor16(a: &mut [u8; 16], b: &[u8]) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Como o vetor de inicialização de cada setor é calculado.
|
||||
/// Sector initialization vector (IV) generation mode.
|
||||
#[derive(Clone)]
|
||||
pub enum Iv {
|
||||
/// Número do setor (de 512 bytes) em 64 bits little-endian.
|
||||
/// 512-byte sector number as 64-bit little-endian.
|
||||
Plain64,
|
||||
/// Número do setor em 32 bits little-endian.
|
||||
/// Sector number as 32-bit little-endian.
|
||||
Plain32,
|
||||
Plain64Be,
|
||||
/// ESSIV: AES(SHA-256(chave), setor).
|
||||
/// ESSIV: AES(SHA-256(key), sector).
|
||||
Essiv(AesAny),
|
||||
/// Número da unidade de dados (setor de `usize` bytes) em 64 bits little-endian.
|
||||
/// Data unit number (`usize`-byte sector) as 64-bit little-endian.
|
||||
Unit(u64),
|
||||
/// BitLocker (Windows 10 1511+): AES(chave, offset em bytes).
|
||||
/// BitLocker (Windows 10 1511+): AES(key, byte offset).
|
||||
Eboiv(AesAny),
|
||||
/// BitLocker CBC com difusor Elephant: IV = AES(chave, offset em bytes).
|
||||
/// BitLocker CBC with Elephant diffuser: IV = AES(key, byte offset).
|
||||
Bitlocker(AesAny),
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ impl Iv {
|
||||
}
|
||||
}
|
||||
|
||||
/// Cifra aplicada setor a setor.
|
||||
/// Sector-level disk cipher.
|
||||
#[derive(Clone)]
|
||||
pub enum SectorCipher {
|
||||
Xts {
|
||||
@@ -106,7 +106,7 @@ pub enum SectorCipher {
|
||||
key: AesAny,
|
||||
iv: Iv,
|
||||
},
|
||||
/// BitLocker AES-CBC com difusor Elephant (chave de dados + chave de ajuste).
|
||||
/// BitLocker AES-CBC with Elephant diffuser (data key + tweak key).
|
||||
Elephant {
|
||||
key: AesAny,
|
||||
tweak: AesAny,
|
||||
@@ -126,8 +126,8 @@ fn gf_double(t: &mut [u8; 16]) {
|
||||
}
|
||||
|
||||
impl SectorCipher {
|
||||
/// Decifra um setor no lugar. `sector_512` conta setores de 512 bytes; `byte_off` é a posição
|
||||
/// em bytes relativa ao início dos dados cifrados.
|
||||
/// Decrypts a sector in place. `sector_512` is the 512-byte sector index; `byte_off` is the
|
||||
/// byte offset relative to the start of the encrypted payload.
|
||||
pub fn decrypt_sector(&self, buf: &mut [u8], sector_512: u64, byte_off: u64) {
|
||||
match self {
|
||||
SectorCipher::Xts { k1, k2, iv } => {
|
||||
@@ -178,33 +178,33 @@ pub fn cbc_encrypt(key: &AesAny, iv: &[u8; 16], buf: &mut [u8]) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Volume cifrado visto em claro: `len` bytes que começam em `data_offset` na origem.
|
||||
/// Plaintext view of an encrypted volume: `len` bytes starting at `data_offset` in the source.
|
||||
pub struct CryptSource {
|
||||
inner: Arc<dyn Source>,
|
||||
cipher: SectorCipher,
|
||||
data_offset: u64,
|
||||
len: u64,
|
||||
sector: u64,
|
||||
/// Setores antes deste limite estão em claro (BitLocker parcialmente cifrado) ou
|
||||
/// são cobertos por uma cópia (os primeiros setores do BitLocker).
|
||||
/// Sectors before this threshold are either unencrypted (partially encrypted BitLocker) or
|
||||
/// redirected to a backup copy (BitLocker relocated boot sectors).
|
||||
patches: Vec<Patch>,
|
||||
/// A partir deste byte (relativo aos dados) o conteúdo ainda não foi cifrado.
|
||||
/// Bytes at or past this payload-relative offset are still unencrypted.
|
||||
plain_from: u64,
|
||||
/// Somado ao número do setor no cálculo do IV (iv_tweak do LUKS2).
|
||||
/// Added to the sector index when computing the IV (LUKS2 `iv_tweak`).
|
||||
iv_tweak: u64,
|
||||
}
|
||||
|
||||
/// Trecho do volume lido de outro lugar da origem (BitLocker move o início do volume).
|
||||
/// Volume range redirected to another offset on the source (BitLocker relocated header sectors).
|
||||
#[derive(Clone)]
|
||||
pub struct Patch {
|
||||
/// Início no volume em claro.
|
||||
/// Start offset in the logical plaintext volume.
|
||||
pub at: u64,
|
||||
pub len: u64,
|
||||
/// Onde estão os dados, na origem, já em claro.
|
||||
/// Source offset where the data resides.
|
||||
pub from: u64,
|
||||
/// Se os bytes de origem precisam ser decifrados (usando a posição `from_crypt`).
|
||||
/// Whether the source bytes must be decrypted (using cipher offset `from_crypt`).
|
||||
pub decrypt_from: Option<u64>,
|
||||
/// Devolve zeros (áreas de metadados do BitLocker).
|
||||
/// Returns zeros (BitLocker metadata regions masked out by the OS).
|
||||
pub zero: bool,
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ impl CryptSource {
|
||||
}
|
||||
|
||||
fn read_sector_plain(&self, rel: u64, out: &mut [u8]) -> io::Result<()> {
|
||||
// `rel` alinhado ao setor; `out.len() == sector`.
|
||||
// `rel` is sector-aligned; `out.len() == sector`.
|
||||
for p in &self.patches {
|
||||
if rel >= p.at && rel < p.at + p.len {
|
||||
if p.zero {
|
||||
@@ -292,15 +292,15 @@ impl Source for CryptSource {
|
||||
}
|
||||
}
|
||||
|
||||
/// Algo que o usuário fornece para abrir um volume.
|
||||
/// User-supplied credential for unlocking an encrypted volume.
|
||||
#[derive(Clone)]
|
||||
pub enum Secret {
|
||||
Password(String),
|
||||
/// Chave de recuperação numérica do BitLocker (8 grupos de 6 dígitos).
|
||||
/// BitLocker numeric recovery password (8 groups of 6 digits).
|
||||
RecoveryKey(String),
|
||||
/// Conteúdo de um arquivo de chave (.BEK do BitLocker, keyfile do LUKS).
|
||||
/// Raw contents of a key file (BitLocker .BEK, LUKS keyfile).
|
||||
KeyFile(Vec<u8>),
|
||||
/// Chave do volume já conhecida (FVEK/master key).
|
||||
/// Known volume master key (FVEK / LUKS master key).
|
||||
VolumeKey(Vec<u8>),
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ impl std::fmt::Debug for Secret {
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum UnlockError {
|
||||
/// Nenhuma das senhas/chaves abriu o volume.
|
||||
/// None of the supplied passwords or keys unlocked the volume.
|
||||
WrongSecret,
|
||||
Unsupported(String),
|
||||
Corrupt(String),
|
||||
@@ -339,11 +339,11 @@ impl From<UnlockError> for crate::Error {
|
||||
}
|
||||
}
|
||||
|
||||
/// Volume aberto.
|
||||
/// Unlocked encrypted volume.
|
||||
pub struct Unlocked {
|
||||
pub source: Arc<dyn Source>,
|
||||
pub description: String,
|
||||
/// Chave do volume (para reabrir sem a senha, se o usuário permitir guardá-la).
|
||||
/// Volume master key (can be saved in the session to reopen without a password if permitted).
|
||||
pub volume_key: Option<Vec<u8>>,
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user