mirror of
https://github.com/openwrt/packages.git
synced 2026-06-17 19:10:30 +04:00
python-pyopenssl: bump to 26.2.0
Refresh sha256 from PyPI sdist. pyOpenSSL 26.2.0 dropped EC support from the legacy crypto.PKey API (the call surfaces as "OpenSSL.crypto.Error: No such key type"); drop the EC-key arm of test.sh accordingly. Upstream points at the cryptography package for EC key generation. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
committed by
Alexandru Ardelean
parent
f0ce6e6cfd
commit
e4bf8904fb
@@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=python-pyopenssl
|
||||
PKG_VERSION:=26.0.0
|
||||
PKG_VERSION:=26.2.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PYPI_NAME:=pyOpenSSL
|
||||
PYPI_SOURCE_NAME:=pyopenssl
|
||||
PKG_HASH:=f293934e52936f2e3413b89c6ce36df66a0b34ae1ea3a053b8c5020ff2f513fc
|
||||
PKG_HASH:=8c6fcecd1183a7fc897548dfe388b0cdb7f37e018200d8409cf33959dbe35387
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -16,7 +16,7 @@ if version != "$2":
|
||||
|
||||
from OpenSSL import SSL, crypto
|
||||
from OpenSSL.crypto import (
|
||||
PKey, TYPE_RSA, TYPE_EC,
|
||||
PKey, TYPE_RSA,
|
||||
X509, X509Req, X509Store, X509StoreContext,
|
||||
dump_certificate, dump_privatekey, load_certificate, load_privatekey,
|
||||
dump_certificate_request,
|
||||
@@ -24,16 +24,15 @@ from OpenSSL.crypto import (
|
||||
)
|
||||
|
||||
# --- Key generation ---
|
||||
# pyOpenSSL 26.2.0 dropped EC support from the legacy crypto.PKey API
|
||||
# ("OpenSSL.crypto.Error: No such key type"). For EC keys, the upstream
|
||||
# recommendation is to use the cryptography package directly.
|
||||
|
||||
rsa_key = PKey()
|
||||
rsa_key.generate_key(TYPE_RSA, 2048)
|
||||
assert rsa_key.bits() == 2048
|
||||
assert rsa_key.type() == TYPE_RSA
|
||||
|
||||
ec_key = PKey()
|
||||
ec_key.generate_key(TYPE_EC, 256)
|
||||
assert ec_key.type() == TYPE_EC
|
||||
|
||||
# --- Self-signed certificate ---
|
||||
|
||||
cert = X509()
|
||||
|
||||
Reference in New Issue
Block a user