Skip to content

Commit

Permalink
Merge branch 'release/v1.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
quvox committed May 1, 2021
2 parents 151f6cf + d84b191 commit 73f8f4f
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 41 deletions.
22 changes: 1 addition & 21 deletions .circleci/config.yml
Expand Up @@ -2,13 +2,7 @@ version: 2.1
workflows:
build_and_deploy:
jobs:
- build:
filters:
tags:
only: /.*/
- test:
requires:
- build
filters:
tags:
only: /.*/
Expand All @@ -21,30 +15,17 @@ workflows:
branches:
ignore: /.*/
jobs:
build:
test:
docker:
- image: circleci/python:3.7
steps:
- checkout
- restore_cache:
key: v1-dependency-cache-{{ checksum "setup.py" }}
- run:
name: install python dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- save_cache:
key: v1-dependency-cache-{{ checksum "setup.py" }}
paths:
- "venv"
test:
docker:
- image: circleci/python:3.7
steps:
- checkout
- restore_cache:
key: v1-dependency-cache-{{ checksum "setup.py" }}
- run:
name: Perform test
command: |
Expand Down Expand Up @@ -87,7 +68,6 @@ jobs:
name: verify version
command: |
. venv/bin/activate
cd python/
python setup.py verify
- run:
name: init .pypirc
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,10 @@
Change log
======

## v1.5.1
* Fix problem regarding new version of gevent
* Fix codes in deprecated usage

## v1.5
* Support BBcAssetRaw and BBcAssetHash defined in py-bbclib v1.5 or later
* bug fix
Expand Down
3 changes: 1 addition & 2 deletions bbc1/core/bbc_config.py
Expand Up @@ -17,8 +17,7 @@
import os
import json
import copy
from threading import RLock
from collections import Mapping
from collections.abc import Mapping

import sys
sys.path.extend(["../../"])
Expand Down
2 changes: 1 addition & 1 deletion bbc1/core/bbc_core.py
Expand Up @@ -178,7 +178,7 @@ def __init__(self, p2p_port=None, core_port=None, use_domain0=False, ip4addr=Non
else:
self.logger.info("Failed to load ledger_subsystem module")

gevent.signal(signal.SIGINT, self.quit_program)
gevent.signal_handler(signal.SIGINT, self.quit_program)
if server_start:
self._start_server(core_port)

Expand Down
7 changes: 3 additions & 4 deletions bbc1/core/message_key_types.py
Expand Up @@ -19,7 +19,7 @@
import msgpack
import struct
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import _serialization, hashes
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
Expand Down Expand Up @@ -158,7 +158,7 @@ def get_ECDH_parameters():
"""Utility for initialization of ECDH parameters"""
global encryptors, decryptors
private_key = ec.generate_private_key(ec.SECP384R1(), default_backend())
serialized_pubkey = private_key.public_key().public_numbers().encode_point()
serialized_pubkey = private_key.public_key().public_bytes(_serialization.Encoding.X962, _serialization.PublicFormat.UncompressedPoint)
key_name = None
while key_name is None:
key_name = os.urandom(4)
Expand All @@ -171,8 +171,7 @@ def get_ECDH_parameters():

def derive_shared_key(private_key, serialized_pubkey, shared_info):
"""Utility for deriving shared key in ECDH procedure"""
deserialized_public_numbers = ec.EllipticCurvePublicNumbers.from_encoded_point(ec.SECP384R1(), serialized_pubkey)
deserialized_pubkey = deserialized_public_numbers.public_key(default_backend())
deserialized_pubkey = ec.EllipticCurvePublicKey.from_encoded_point(ec.SECP384R1(), serialized_pubkey)
shared_key = private_key.exchange(ec.ECDH(), deserialized_pubkey)
derived_key = HKDF(algorithm=hashes.SHA256(), length=32, salt=None,
info=shared_info, backend=default_backend()).derive(shared_key)
Expand Down
5 changes: 5 additions & 0 deletions renovate.json
@@ -0,0 +1,5 @@
{
"extends": [
"config:base"
]
}
41 changes: 30 additions & 11 deletions requirements.txt
@@ -1,11 +1,30 @@
pyOpenSSL>=16.2.0
jinja2>=2.8.1
requests>=2.12.4
gevent>=1.2.1
greenlet
cryptography>=2.1.4
pytest>=5.3.0
py-bbclib>=1.6
msgpack-python>=0.4.8
mysql-connector-python>=8.0.5
bson
attrs==20.3.0
bson==0.5.10
certifi==2020.12.5
cffi==1.14.5
chardet==4.0.0
cryptography==3.4.7
gevent==21.1.2
greenlet==1.0.0
idna==2.10
iniconfig==1.1.1
Jinja2==2.11.3
MarkupSafe==1.1.1
msgpack-python==0.5.6
mysql-connector-python==8.0.24
packaging==20.9
pluggy==0.13.1
protobuf==3.15.8
py==1.10.0
py-bbclib==1.6.1
pycparser==2.20
pyOpenSSL==20.0.1
pyparsing==2.4.7
pytest==6.2.3
python-dateutil==2.8.1
requests==2.25.1
six==1.15.0
toml==0.10.2
urllib3==1.26.4
zope.event==4.5.0
zope.interface==5.4.0
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -5,7 +5,7 @@
from setuptools import setup
from setuptools.command.install import install

VERSION = "1.5"
VERSION = "1.5.1"

here = path.abspath(path.dirname(__file__))

Expand Down
3 changes: 2 additions & 1 deletion tests/pytest.ini
@@ -1,4 +1,5 @@
[pytest]
addopts = --capture=no
markers =
register: exec register/unregister
register: exec register
unregister: exec unregister

0 comments on commit 73f8f4f

Please sign in to comment.