Google Authenticator fails if the algorithm is not uppercase.

https://fedorahosted.org/freeipa/ticket/5047
From 2d266d7f17ca5450253d7bcc2a2fe5cf4a5ed327 Mon Sep 17 00:00:00 2001
From: Nathaniel McCallum <npmccal...@redhat.com>
Date: Wed, 17 Jun 2015 10:21:55 -0400
Subject: [PATCH] Fix OTP token URI generation

Google Authenticator fails if the algorithm is not uppercase.

https://fedorahosted.org/freeipa/ticket/5047
---
 ipalib/plugins/otptoken.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipalib/plugins/otptoken.py b/ipalib/plugins/otptoken.py
index 867659ec2a867b2dba79922a4e98b7b6254e81bf..294c1c54afdfa6a13d37766d6851affa44ece60c 100644
--- a/ipalib/plugins/otptoken.py
+++ b/ipalib/plugins/otptoken.py
@@ -325,7 +325,7 @@ class otptoken_add(LDAPCreate):
         args['issuer'] = issuer
         args['secret'] = base64.b32encode(entry_attrs['ipatokenotpkey'])
         args['digits'] = entry_attrs['ipatokenotpdigits']
-        args['algorithm'] = entry_attrs['ipatokenotpalgorithm']
+        args['algorithm'] = entry_attrs['ipatokenotpalgorithm'].upper()
         if options['type'] == 'totp':
             args['period'] = entry_attrs['ipatokentotptimestep']
         elif options['type'] == 'hotp':
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to