From b8905e0b2d995e46190c30f8c7525839036a92d5 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 19 Mar 2016 20:01:46 +0100 Subject: Support both CheckDigit and CheckDigits RFC 6030 is not clear about whether the attribute of ChallengeFormat and ResponseFormat should be the singular CheckDigit or the plural CheckDigits. This ensures that both forms are accepted. --- pskc/key.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pskc/key.py') diff --git a/pskc/key.py b/pskc/key.py index 3df4055..a971bdd 100644 --- a/pskc/key.py +++ b/pskc/key.py @@ -312,7 +312,9 @@ class Key(object): self.challenge_encoding = challenge_format.get('Encoding') self.challenge_min_length = getint(challenge_format, 'Min') self.challenge_max_length = getint(challenge_format, 'Max') - self.challenge_check = getbool(challenge_format, 'CheckDigits') + self.challenge_check = getbool( + challenge_format, 'CheckDigits', getbool( + challenge_format, 'CheckDigit')) response_format = find( key_package, @@ -320,7 +322,9 @@ class Key(object): if response_format is not None: self.response_encoding = response_format.get('Encoding') self.response_length = getint(response_format, 'Length') - self.response_check = getbool(response_format, 'CheckDigits') + self.response_check = getbool( + response_format, 'CheckDigits', getbool( + response_format, 'CheckDigit')) self.policy.parse(find(key_package, 'Key/Policy')) -- cgit v1.2.3