Skip to content
Snippets Groups Projects
Commit e24df79c authored by Dmitry Shachnev's avatar Dmitry Shachnev :penguin:
Browse files

New upstream version 3.3.1

parent ce355925
No related branches found
No related tags found
No related merge requests found
Metadata-Version: 2.1
Name: SecretStorage
Version: 3.3.0
Version: 3.3.1
Summary: Python bindings to FreeDesktop.org Secret Service API
Home-page: https://github.com/mitya57/secretstorage
Author: Dmitry Shachnev
Author-email: mitya57@gmail.com
License: BSD 3-Clause License
Description: .. image:: https://api.travis-ci.org/mitya57/secretstorage.svg
:target: https://travis-ci.org/mitya57/secretstorage
:alt: Travis CI status
Description: .. image:: https://github.com/mitya57/secretstorage/workflows/tests/badge.svg
:target: https://github.com/mitya57/secretstorage/actions
:alt: GitHub Actions status
.. image:: https://codecov.io/gh/mitya57/secretstorage/branch/master/graph/badge.svg
:target: https://codecov.io/gh/mitya57/secretstorage
:alt: Coverage status
......
.. image:: https://api.travis-ci.org/mitya57/secretstorage.svg
:target: https://travis-ci.org/mitya57/secretstorage
:alt: Travis CI status
.. image:: https://github.com/mitya57/secretstorage/workflows/tests/badge.svg
:target: https://github.com/mitya57/secretstorage/actions
:alt: GitHub Actions status
.. image:: https://codecov.io/gh/mitya57/secretstorage/branch/master/graph/badge.svg
:target: https://codecov.io/gh/mitya57/secretstorage
:alt: Coverage status
......
Metadata-Version: 2.1
Name: SecretStorage
Version: 3.3.0
Version: 3.3.1
Summary: Python bindings to FreeDesktop.org Secret Service API
Home-page: https://github.com/mitya57/secretstorage
Author: Dmitry Shachnev
Author-email: mitya57@gmail.com
License: BSD 3-Clause License
Description: .. image:: https://api.travis-ci.org/mitya57/secretstorage.svg
:target: https://travis-ci.org/mitya57/secretstorage
:alt: Travis CI status
Description: .. image:: https://github.com/mitya57/secretstorage/workflows/tests/badge.svg
:target: https://github.com/mitya57/secretstorage/actions
:alt: GitHub Actions status
.. image:: https://codecov.io/gh/mitya57/secretstorage/branch/master/graph/badge.svg
:target: https://codecov.io/gh/mitya57/secretstorage
:alt: Coverage status
......
......@@ -23,6 +23,7 @@ secretstorage/defines.py
secretstorage/dhcrypto.py
secretstorage/exceptions.py
secretstorage/item.py
secretstorage/py.typed
secretstorage/util.py
tests/__init__.py
tests/cleanup_test_items.py
......
SecretStorage 3.3.1, 2021-02-09
===============================
* Fixed a deprecation warning from cryptography module.
Thanks to Jante Jomppanen for the pull request!
* Added a :PEP:`561` ``py.typed`` file to declare typing support.
SecretStorage 3.3.0, 2020-11-24
===============================
......
......@@ -24,7 +24,7 @@ master_doc = 'index'
# General information about the project.
project = 'SecretStorage'
copyright = '2020, Dmitry Shachnev'
copyright = '2021, Dmitry Shachnev'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
......@@ -33,7 +33,7 @@ copyright = '2020, Dmitry Shachnev'
# The short X.Y version.
version = '3.3'
# The full version, including alpha/beta/rc tags.
release = '3.3.0'
release = '3.3.1'
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
......
......@@ -19,7 +19,7 @@ from secretstorage.exceptions import SecretStorageException, \
ItemNotFoundException, PromptDismissedException
from secretstorage.util import add_match_rules
__version_tuple__ = (3, 3, 0)
__version_tuple__ = (3, 3, 1)
__version__ = '.'.join(map(str, __version_tuple__))
__all__ = [
......
......@@ -13,7 +13,6 @@ import os
from hashlib import sha256
from typing import Optional # Needed for mypy
from cryptography.utils import int_from_bytes
# A standard 1024 bits (128 bytes) prime number for use in Diffie-Hellman exchange
DH_PRIME_1024_BYTES = (
......@@ -30,7 +29,7 @@ DH_PRIME_1024_BYTES = (
def int_to_bytes(number: int) -> bytes:
return number.to_bytes(math.ceil(number.bit_length() / 8), 'big')
DH_PRIME_1024 = int_from_bytes(DH_PRIME_1024_BYTES, 'big')
DH_PRIME_1024 = int.from_bytes(DH_PRIME_1024_BYTES, 'big')
class Session(object):
def __init__(self) -> None:
......@@ -38,13 +37,13 @@ class Session(object):
self.aes_key = None # type: Optional[bytes]
self.encrypted = True
# 128-bytes-long strong random number
self.my_private_key = int_from_bytes(os.urandom(0x80), 'big')
self.my_private_key = int.from_bytes(os.urandom(0x80), 'big')
self.my_public_key = pow(2, self.my_private_key, DH_PRIME_1024)
def set_server_public_key(self, server_public_key: int) -> None:
common_secret = pow(server_public_key, self.my_private_key,
common_secret_int = pow(server_public_key, self.my_private_key,
DH_PRIME_1024)
common_secret = int_to_bytes(common_secret)
common_secret = int_to_bytes(common_secret_int)
# Prepend NULL bytes if needed
common_secret = b'\x00' * (0x80 - len(common_secret)) + common_secret
# HKDF with null salt, empty info and SHA-256 hash
......
......@@ -22,7 +22,6 @@ from secretstorage.exceptions import ItemNotFoundException, \
SecretServiceNotAvailableException
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from cryptography.utils import int_from_bytes
BUS_NAME = 'org.freedesktop.secrets'
SERVICE_IFACE = SS_PREFIX + 'Service'
......@@ -88,7 +87,7 @@ def open_session(connection: DBusConnection) -> Session:
else:
signature, value = output
assert signature == 'ay'
key = int_from_bytes(value, 'big')
key = int.from_bytes(value, 'big')
session.set_server_public_key(key)
session.object_path = result
return session
......
[metadata]
name = SecretStorage
version = 3.3.0
version = 3.3.1
description = Python bindings to FreeDesktop.org Secret Service API
long_description = file: README.rst
long_description_content_type = text/x-rst
......@@ -27,6 +27,9 @@ packages = secretstorage
python_requires = >=3.6
install_requires = cryptography>=2.0; jeepney>=0.6
[options.package_data]
secretstorage = py.typed
[egg_info]
tag_build =
tag_date = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment