diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-11-21 06:55:57 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-11-21 06:55:57 +0000 |
commit | 439653559da3a7fe3edbc9cb86c3d40cff668b2b (patch) | |
tree | d1221bdc187664e154b794e7809694ea8a726f57 /src | |
parent | 47a2a2d5d1cf53b02d6fc724a0c7b60effc5dd4f (diff) | |
parent | c9ed57619837de53cf2fe4c2a24e4a2bcca4f8d5 (diff) | |
download | obnam2-439653559da3a7fe3edbc9cb86c3d40cff668b2b.tar.gz |
Merge branch 'audit' into 'main'
Prepare release 0.5.0
Closes #149 and #150
See merge request obnam/obnam!188
Diffstat (limited to 'src')
-rw-r--r-- | src/generation.rs | 10 | ||||
-rw-r--r-- | src/index.rs | 8 | ||||
-rw-r--r-- | src/passwords.rs | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/generation.rs b/src/generation.rs index de2ea10..33750ca 100644 --- a/src/generation.rs +++ b/src/generation.rs @@ -351,8 +351,8 @@ mod sql { } fn row_to_key_value(row: &Row) -> rusqlite::Result<(String, String)> { - let key: String = row.get(row.column_index("key")?)?; - let value: String = row.get(row.column_index("value")?)?; + let key: String = row.get("key")?; + let value: String = row.get("value")?; Ok((key, value)) } @@ -383,9 +383,9 @@ mod sql { } pub fn row_to_entry(row: &Row) -> rusqlite::Result<(FileId, String, String)> { - let fileno: FileId = row.get(row.column_index("fileno")?)?; - let json: String = row.get(row.column_index("json")?)?; - let reason: String = row.get(row.column_index("reason")?)?; + let fileno: FileId = row.get("fileno")?; + let json: String = row.get("json")?; + let reason: String = row.get("reason")?; Ok((fileno, json, reason)) } diff --git a/src/index.rs b/src/index.rs index 5d31068..d548396 100644 --- a/src/index.rs +++ b/src/index.rs @@ -262,20 +262,20 @@ mod sql { } fn row_to_meta(row: &Row) -> rusqlite::Result<ChunkMeta> { - let hash: String = row.get(row.column_index("sha256")?)?; + let hash: String = row.get("sha256")?; let sha256 = Checksum::sha256_from_str_unchecked(&hash); - let generation: i32 = row.get(row.column_index("generation")?)?; + let generation: i32 = row.get("generation")?; let meta = if generation == 0 { ChunkMeta::new(&sha256) } else { - let ended: String = row.get(row.column_index("ended")?)?; + let ended: String = row.get("ended")?; ChunkMeta::new_generation(&sha256, &ended) }; Ok(meta) } fn row_to_id(row: &Row) -> rusqlite::Result<ChunkId> { - let id: String = row.get(row.column_index("id")?)?; + let id: String = row.get("id")?; Ok(ChunkId::recreate(&id)) } } diff --git a/src/passwords.rs b/src/passwords.rs index a1cf42e..bc1a1d7 100644 --- a/src/passwords.rs +++ b/src/passwords.rs @@ -70,7 +70,7 @@ fn derive_password(passphrase: &str) -> String { let salt = SaltString::generate(&mut OsRng); Pbkdf2 - .hash_password_simple(passphrase.as_bytes(), salt.as_ref()) + .hash_password(passphrase.as_bytes(), salt.as_ref()) .unwrap() .to_string() } |