From b5edf00d57a02853b2ac4a2587dcfdc12ebbf7fe Mon Sep 17 00:00:00 2001 From: Akim Juillerat Date: Fri, 22 Dec 2017 11:27:31 +0100 Subject: [PATCH] Ensure no special chars are passed to totp.provisioning_uri --- auth_totp/__openerp__.py | 2 +- auth_totp/wizards/res_users_authenticator_create.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auth_totp/__openerp__.py b/auth_totp/__openerp__.py index d0ba987a7..4357abb41 100644 --- a/auth_totp/__openerp__.py +++ b/auth_totp/__openerp__.py @@ -5,7 +5,7 @@ { 'name': 'MFA Support', 'summary': 'Allows users to enable MFA and add optional trusted devices', - 'version': '9.0.1.0.0', + 'version': '9.0.1.0.1', 'category': 'Extra Tools', 'website': 'https://laslabs.com/', 'author': 'LasLabs, Odoo Community Association (OCA)', diff --git a/auth_totp/wizards/res_users_authenticator_create.py b/auth_totp/wizards/res_users_authenticator_create.py index e7c1203c3..2c7972d53 100644 --- a/auth_totp/wizards/res_users_authenticator_create.py +++ b/auth_totp/wizards/res_users_authenticator_create.py @@ -74,7 +74,7 @@ class ResUsersAuthenticatorCreate(models.TransientModel): totp = pyotp.TOTP(record.secret_key) provisioning_uri = totp.provisioning_uri( - record.user_id.display_name, + record.user_id.display_name.encode('utf-8'), issuer_name=record.user_id.company_id.display_name, ) provisioning_uri = urllib.quote(provisioning_uri)