Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix typos #104

Merged
merged 1 commit into from
Jan 7, 2024
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 internal/security/otp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestGenerateOTPCode_NonPaddedHashes(t *testing.T) {
}
}

func TestGenerateOTPCode_InvaidPadding(t *testing.T) {
func TestGenerateOTPCode_InvalidPadding(t *testing.T) {
input := "a6mr*&^&*%*&ylj|'[lbufszudtjdt42nh5by"
table := map[time.Time]string{
time.Date(1970, 1, 1, 0, 0, 59, 0, time.UTC): "",
Expand Down
2 changes: 1 addition & 1 deletion internal/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type Storage struct {
Namespaces []*Namespace
}

// DecryptV1 tries to decrypt the original unsecure SHA1 storage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this wasn't actually a typo, thats literally what the function is named

https://github.com/yitsushi/totp-cli/blob/main/internal/security/unsecure.go

(Whether that function name was a typo is another question)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, and with the new wording it implies the storage itself was SHA1 "encrypted" (which is not an encryption, it's a hashing algo). But in all cases, this comment is not valid at all. It does not try to "decrypt the original unsecure SHA1 storage", it tries to decrypt using the old method (UnsecureSHA1) of hashish of the password. :/

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should make it a bit more clear: #111

// DecryptV1 tries to decrypt the original insecure SHA1 storage.
func (s *Storage) DecryptV1() error {
encryptedData, err := os.ReadFile(s.File)
if err != nil {
Expand Down