diff --git a/.circleci/config.yml b/.circleci/config.yml index c7ab408..532b022 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,9 +2,9 @@ version: 2.1 jobs: - build-and-test-39: &template + build-and-test-310: &template docker: - - image: circleci/python:3.9 + - image: circleci/python:3.10 steps: - checkout - run: @@ -25,6 +25,10 @@ jobs: - run: command: codecov name: Send coverage + build-and-test-39: + <<: *template + docker: + - image: circleci/python:3.9 build-and-test-38: <<: *template docker: @@ -40,6 +44,7 @@ jobs: workflows: main: jobs: + - build-and-test-310 - build-and-test-39 - build-and-test-38 - build-and-test-37 diff --git a/README.md b/README.md index 82fb137..a037b6b 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,10 @@ The current development version can be found at ## History +### Ver. 0.5.0 (2022-01-18) +- Upgrade dependency (`cryptography==36.0.1`) +- Fix file handle leakage + ### Ver. 0.4.5 (2020-12-03) - Fix import path issue (thanks to [Gyong1211](https://github.com/Gyong1211)) diff --git a/pypinksign/pypinksign.py b/pypinksign/pypinksign.py index 8a27482..2b3a11e 100644 --- a/pypinksign/pypinksign.py +++ b/pypinksign/pypinksign.py @@ -188,7 +188,8 @@ def _load_prikey_with_decrypted_data(self, decrypted_prikey_data: bytes) -> None def load_p12(self, p12_data: bytes = None) -> None: """Load key information from P12(PKCS12, Usually pfx)""" if p12_data is None: - p12_data = open(self.p12_path, 'rb').read() + with open(self.p12_path, 'rb') as f: + p12_data = f.read() pubkey_data, prikey_data = separate_p12_into_npki(p12_data, self.prikey_password) self.load_pubkey(pubkey_data=pubkey_data) diff --git a/setup.py b/setup.py index 8019a04..4abc32e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ PROJECT = 'pypinksign' -VERSION = '0.4.5' +VERSION = '0.5.0' URL = 'http://github.com/bandoche/PyPinkSign' AUTHOR = 'Sangjun Jung' AUTHOR_EMAIL = 'spamcoffee+pypinksign@gmail.com' @@ -28,9 +28,9 @@ zip_safe=False, install_requires=[ 'pyasn1==0.4.8', - 'cryptography==3.3.2', + 'cryptography==36.0.1', ], - keywords='npki 공인인증서 korean pki certificate', + keywords='npki 공인인증서 공동인증서 korean pki certificate', platforms='OS Independent', classifiers=[ 'Development Status :: 4 - Beta',