chore(qa): format code and configure clippy lints
This commit is contained in:
@@ -792,13 +792,7 @@ fn test_m05_deniability_schema_equality_standard_vs_hidden() {
|
||||
|
||||
let db_std = Database::open(&path_std).expect("Open std db");
|
||||
db_std
|
||||
.init_schema(
|
||||
&salt_std,
|
||||
&kdf_params,
|
||||
&wrapped_std,
|
||||
&nonce_std,
|
||||
&tag_std,
|
||||
)
|
||||
.init_schema(&salt_std, &kdf_params, &wrapped_std, &nonce_std, &tag_std)
|
||||
.expect("Init std schema");
|
||||
db_std.checkpoint().unwrap();
|
||||
|
||||
@@ -842,25 +836,26 @@ fn test_m05_deniability_schema_equality_standard_vs_hidden() {
|
||||
let conn_std = rusqlite::Connection::open(&path_std).unwrap();
|
||||
let conn_hidden = rusqlite::Connection::open(&path_hidden).unwrap();
|
||||
|
||||
let get_schema_elements = |conn: &rusqlite::Connection| -> Vec<(String, String, Option<String>)> {
|
||||
let mut stmt = conn
|
||||
.prepare(
|
||||
"SELECT type, name, sql FROM sqlite_master
|
||||
let get_schema_elements =
|
||||
|conn: &rusqlite::Connection| -> Vec<(String, String, Option<String>)> {
|
||||
let mut stmt = conn
|
||||
.prepare(
|
||||
"SELECT type, name, sql FROM sqlite_master
|
||||
WHERE type IN ('table', 'index') AND name NOT LIKE 'sqlite_%'
|
||||
ORDER BY type, name",
|
||||
)
|
||||
.unwrap();
|
||||
let rows = stmt
|
||||
.query_map([], |row| {
|
||||
Ok((
|
||||
row.get::<_, String>(0)?,
|
||||
row.get::<_, String>(1)?,
|
||||
row.get::<_, Option<String>>(2)?,
|
||||
))
|
||||
})
|
||||
.unwrap();
|
||||
rows.map(|r| r.unwrap()).collect()
|
||||
};
|
||||
)
|
||||
.unwrap();
|
||||
let rows = stmt
|
||||
.query_map([], |row| {
|
||||
Ok((
|
||||
row.get::<_, String>(0)?,
|
||||
row.get::<_, String>(1)?,
|
||||
row.get::<_, Option<String>>(2)?,
|
||||
))
|
||||
})
|
||||
.unwrap();
|
||||
rows.map(|r| r.unwrap()).collect()
|
||||
};
|
||||
|
||||
let schema_std = get_schema_elements(&conn_std);
|
||||
let schema_hidden = get_schema_elements(&conn_hidden);
|
||||
@@ -872,22 +867,25 @@ fn test_m05_deniability_schema_equality_standard_vs_hidden() {
|
||||
|
||||
// Spalten- und Typinformationen vergleichen
|
||||
for table in &["meta", "nodes", "chunks"] {
|
||||
let get_table_info = |conn: &rusqlite::Connection| -> Vec<(i64, String, String, i64, Option<String>, i64)> {
|
||||
let mut stmt = conn.prepare(&format!("PRAGMA table_info({});", table)).unwrap();
|
||||
let rows = stmt
|
||||
.query_map([], |row| {
|
||||
Ok((
|
||||
row.get::<_, i64>(0)?,
|
||||
row.get::<_, String>(1)?,
|
||||
row.get::<_, String>(2)?,
|
||||
row.get::<_, i64>(3)?,
|
||||
row.get::<_, Option<String>>(4)?,
|
||||
row.get::<_, i64>(5)?,
|
||||
))
|
||||
})
|
||||
.unwrap();
|
||||
rows.map(|r| r.unwrap()).collect()
|
||||
};
|
||||
let get_table_info =
|
||||
|conn: &rusqlite::Connection| -> Vec<(i64, String, String, i64, Option<String>, i64)> {
|
||||
let mut stmt = conn
|
||||
.prepare(&format!("PRAGMA table_info({});", table))
|
||||
.unwrap();
|
||||
let rows = stmt
|
||||
.query_map([], |row| {
|
||||
Ok((
|
||||
row.get::<_, i64>(0)?,
|
||||
row.get::<_, String>(1)?,
|
||||
row.get::<_, String>(2)?,
|
||||
row.get::<_, i64>(3)?,
|
||||
row.get::<_, Option<String>>(4)?,
|
||||
row.get::<_, i64>(5)?,
|
||||
))
|
||||
})
|
||||
.unwrap();
|
||||
rows.map(|r| r.unwrap()).collect()
|
||||
};
|
||||
|
||||
let cols_std = get_table_info(&conn_std);
|
||||
let cols_hidden = get_table_info(&conn_hidden);
|
||||
@@ -925,4 +923,3 @@ fn test_m05_deniability_schema_equality_standard_vs_hidden() {
|
||||
let _ = std::fs::remove_file(&path_std);
|
||||
let _ = std::fs::remove_file(&path_hidden);
|
||||
}
|
||||
|
||||
|
||||
@@ -1798,10 +1798,7 @@ fn test_m02_release_profile_enables_overflow_checks() {
|
||||
.split("[profile.release]")
|
||||
.nth(1)
|
||||
.expect("Must have [profile.release] section");
|
||||
let release_block = release_section
|
||||
.split('[')
|
||||
.next()
|
||||
.unwrap_or(release_section);
|
||||
let release_block = release_section.split('[').next().unwrap_or(release_section);
|
||||
assert!(
|
||||
release_block.contains("overflow-checks = true"),
|
||||
"M-02: [profile.release] must explicitly set overflow-checks = true to prevent integer overflow vulnerabilities"
|
||||
|
||||
@@ -309,6 +309,3 @@ async fn test_z04_webdav_quota_report() {
|
||||
drop(db);
|
||||
let _ = std::fs::remove_file(&container_path);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1187,5 +1187,3 @@ fn test_s09_pull_backup_and_update_conflict_safety() {
|
||||
|
||||
let _ = fs::remove_dir_all(&temp_root);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -704,9 +704,7 @@ fn test_k01_metadata_tampering_detected_by_verify() {
|
||||
.unwrap();
|
||||
|
||||
// Knoten anlegen
|
||||
let node = db
|
||||
.create_node(1, "secret_financials.xlsx", false)
|
||||
.unwrap();
|
||||
let node = db.create_node(1, "secret_financials.xlsx", false).unwrap();
|
||||
db.update_node_size_and_time(node.id, 50000, 1000).unwrap();
|
||||
db.checkpoint().unwrap();
|
||||
|
||||
@@ -773,7 +771,8 @@ fn test_k01_metadata_tampering_detected_by_verify() {
|
||||
#[test]
|
||||
fn test_k01_upgrade_format_v2_to_v3() {
|
||||
let temp_dir = std::env::temp_dir();
|
||||
let db_path: PathBuf = temp_dir.join(format!("test_k01_upgrade_{}.sanctum", std::process::id()));
|
||||
let db_path: PathBuf =
|
||||
temp_dir.join(format!("test_k01_upgrade_{}.sanctum", std::process::id()));
|
||||
if db_path.exists() {
|
||||
let _ = std::fs::remove_file(&db_path);
|
||||
}
|
||||
@@ -996,5 +995,3 @@ async fn test_k02_chunk_replay_detected_by_vfs_and_crypto() {
|
||||
|
||||
let _ = std::fs::remove_file(&db_path);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -98,10 +98,7 @@ trusted comment: timestamp:1789750897\tfile:test_payload.txt\thashed\n\
|
||||
assert!(sig_line.starts_with("RU"));
|
||||
sig_line.replace_range(0..2, "RW");
|
||||
|
||||
let legacy_sig_text = format!(
|
||||
"{}\n{}\n{}\n{}\n",
|
||||
lines[0], sig_line, lines[2], lines[3]
|
||||
);
|
||||
let legacy_sig_text = format!("{}\n{}\n{}\n{}\n", lines[0], sig_line, lines[2], lines[3]);
|
||||
|
||||
let res = verify_minisign_signature(payload, &legacy_sig_text, SANCTUM_RELEASE_PUBKEY);
|
||||
assert!(
|
||||
@@ -194,5 +191,3 @@ zjZAS4uy1PH+0S9KQ0EU435lpBczU3lULyS5SkWf093iCEBc1ULiscwE5gWkEkex3ecPdRugopT+fKaZ
|
||||
"Weder Primär- noch Backup-Schlüssel dürfen manipulierte Nutzdaten akzeptieren"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user