Skip to content

Commit

Permalink
Prepare 0.3.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
dainnilsson committed Apr 13, 2018
1 parent 8f70d0e commit 176c828
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
5 changes: 3 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
* Version 0.2.3 (unreleased)
** Bugfix: Don't use TimeoutError which isn't available on Python 2.
* Version 0.3.0 (released 2018-04-13)
** Add conversion between string/int keys for AttestationObject.
** Replace internal Exceptions with built-in types.
** Bugfix: Don't use TimeoutError which isn't available on Python 2.

* Version 0.2.2 (released 2018-04-11)
** Bugfix: Better handling of unplugged devices on MacOS and avoid leaking threads.
Expand Down
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python-fido2 (0.2.3~dev) xenial; urgency=low
python-fido2 (0.3.0) xenial; urgency=low

* Build for ppa

Expand Down
2 changes: 1 addition & 1 deletion fido2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ class ABC(object):
abc.abstractclassmethod = abc.abstractmethod


__version__ = '0.2.3-dev0'
__version__ = '0.3.0'
24 changes: 24 additions & 0 deletions fido2/cose.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,27 @@ def from_cryptography_key(cls, public_key):
-1: int2bytes(pn.n),
-2: int2bytes(pn.e)
})


class PS256(CoseKey):
ALGORITHM = -37

def verify(self, message, signature):
rsa.RSAPublicNumbers(
bytes2int(self[-2]), bytes2int(self[-1])
).public_key(default_backend()).verify(
signature, message, padding.PSS(
mgf=padding.MGF1(hashes.SHA256()),
salt_length=padding.PSS.MAX_LENGTH
), hashes.SHA256()
)

@classmethod
def from_cryptography_key(cls, public_key):
pn = public_key.public_numbers()
return cls({
1: 3,
3: cls.ALGORITHM,
-1: int2bytes(pn.n),
-2: int2bytes(pn.e)
})

0 comments on commit 176c828

Please sign in to comment.