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

Fix Remote Bolus OTP validation on Authy #19

Merged
merged 1 commit into from
May 2, 2022

Conversation

gestrich
Copy link

Remote bolus OTP validation was failing on Authy and possibly some other OTP clients. I was specifying the SHA512 algorithm for generating a QR code. The Google Authenticator spec, which I think these OTP standards were derived from, allows either {sha1, sha256, sha512}. However, it seems that Authy only supports SHA1. Some more background is here. Apparently this issue has been around for a long time.

@@ -70,7 +70,8 @@ public class OTPManager {

private var secretStore: OTPSecretStore
private var nowDateSource: () -> Date
Copy link
Author

@gestrich gestrich Apr 16, 2022

Choose a reason for hiding this comment

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

The fix: Changing SHA512 -> SHA1
Also adding "Issuer" as a property for reuse.

@@ -143,7 +144,7 @@ public class OTPManager {
}

let generator = Generator(factor: .timer(period: TimeInterval(self.tokenPeriod)), secret: secretKeyData, algorithm: algorithm, digits: passwordDigitCount)!
Copy link
Author

Choose a reason for hiding this comment

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

Use property and get rid of unnecessary string interpolation.

@gestrich gestrich force-pushed the bugfix/2022-04/bg/authy-algorithm branch from ddeb09f to 4bcc0a3 Compare April 16, 2022 00:58
@ps2 ps2 merged commit 20289c3 into ps2:dev May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants