Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ and [Argon2id](https://en.wikipedia.org/wiki/Argon2) for key derivation.
It also uses [AES-GCM](https://docs.rs/aes-gcm/latest/aes_gcm/) to import from encrypted Aegis backups.


## Cross Plaform
## Cross Platform

cotp should be easily compiled on the most used platforms, but it is mostly tested on Linux, Windows and macOS.

Expand Down
2 changes: 1 addition & 1 deletion src/interface/handlers/main_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fn handle_counter_switch(app: &mut App, increment: bool) {
if let Some(selected) = app.table.state.selected() {
if let Some(element) = app.database.mut_element(selected) {
if element.type_ == OTPType::Hotp {
// safe to unwrap becouse the element type is HOTP
// safe to unwrap because the element type is HOTP
let counter = element.counter.unwrap();
element.counter = if increment {
Some(counter.checked_add(1).unwrap_or(u64::MAX))
Expand Down
8 changes: 4 additions & 4 deletions src/otp/algorithms/yandex_otp_maker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::otp::otp_error::OtpError;
use super::hotp_maker::hotp_hash;

const EN_ALPHABET_LENGTH: u64 = 26;
const SECRET_LENGHT: usize = 16;
const SECRET_LENGTH: usize = 16;

pub fn yandex(
secret: &str,
Expand Down Expand Up @@ -70,13 +70,13 @@ where
Err(e) => return Err(OtpError::SecretEncoding(e.kind, e.position)),
};

if decoded_secret.len() < SECRET_LENGHT {
if decoded_secret.len() < SECRET_LENGTH {
return Err(OtpError::ShortSecret);
}

let parsed_secret = &decoded_secret.as_slice()[0..SECRET_LENGHT];
let parsed_secret = &decoded_secret.as_slice()[0..SECRET_LENGTH];

let mut pin_with_secret: Vec<u8> = Vec::with_capacity(pin.len() + SECRET_LENGHT);
let mut pin_with_secret: Vec<u8> = Vec::with_capacity(pin.len() + SECRET_LENGTH);

pin_with_secret.append(&mut pin.as_bytes().to_vec());
pin_with_secret.append(&mut parsed_secret.to_vec());
Expand Down
Loading