Fixed
Created: May 26, 2023
Updated: Dec 13, 2023
Resolved Date: Dec 13, 2023
Found In Version: 10.23.30.1
Fix Version: 10.23.30.4
Severity: Standard
Applicable for: Wind River Linux LTS 23
Component/s: Userspace
Build an image with python3-service-identity ptest, and boot up a target device. Run the following command:
root@intel-x86-64:/usr/lib64/python3-service-identity/ptest# ./run-ptest
Some test cases are passed, but the following error is shown:
_______________ TestExtractIDs.test_cn_ids_are_used_as_fallback ________________
self = <tests.test_pyopenssl.TestExtractIDs object at 0x7f9474736090>
def test_cn_ids_are_used_as_fallback(self):
"""
CNs are returned as DNSPattern if no other IDs are present
and a warning is raised.
"""
with pytest.warns(SubjectAltNameWarning) as ws:
> rv = extract_ids(CERT_CN_ONLY)
tests/test_pyopenssl.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../python3.11/site-packages/service_identity/pyopenssl.py:97: in extract_ids
if ext.get_short_name() == b"subjectAltName":
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <OpenSSL.crypto.X509Extension object at 0x7f94747d61d0>
def get_short_name(self) -> bytes:
"""
Returns the short type name of this X.509 extension.
The result is a byte string such as :py:const:`b"basicConstraints"`.
:return: The short type name.
:rtype: :py:data:`bytes`
.. versionadded:: 0.12
"""
obj = _lib.X509_EXTENSION_get_object(self._extension)
nid = _lib.OBJ_obj2nid(obj)
> return _ffi.string(_lib.OBJ_nid2sn(nid))
E RuntimeError: cannot use string() on <cdata 'char *' NULL>
../../python3.11/site-packages/OpenSSL/crypto.py:907: RuntimeError
1) git clone --depth 1 --branch WRLINUX_10_23_LTS git://pek-git.wrs.com/wrlinux-x
2) wrlinux-10/setup.sh --machine intel-x86-64 --dl-layers=1 --distro wrlinux --templates feature/xfce feature/busybox feature/ipv6 feature/lttng feature/mariadb feature/network-bond-libteam feature/nftables feature/package-management feature/podman feature/ptest feature/snmp feature/selinux feature/valgrind feature/virt-host --layers meta-filesystems meta-security-compliance meta-virtualization --dl-layers=1
3). ./environment-setup-x86_64-wrlinuxsdk-linux
4) . ./oe-init-build-env build_test
5) vim conf/local.conf
IMAGE_INSTALL:append = " python3-service-identity"
6) bitbake wrlinux-image-std
7)boot the target and run commands per problem description
cd /usr/lib64/python3-service-identity/ptest/
./run-ptest