Fix OTP token URI generation

Google Authenticator fails if the algorithm is not uppercase.

https://fedorahosted.org/freeipa/ticket/5047

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Nathaniel McCallum
2015-06-17 10:21:55 -04:00
committed by Petr Vobornik
parent 69607250b9
commit 4dfa23256d

View File

@@ -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':