Hi all,
I'm trying to integrate the SE050 to be used in a node.js webserver. I successfully compiled the middleware including the OpenSSL provider and also got the ssscli to work.
With ssscli I created a keypair, injected it into the SE and created a refpem key. I also adapted the openssl.cnf of the system to match the one in simwtop/demos/linux/common/openssl30_sss_se050.cnf.
But any TLS connection to the server fails in the handshake as OpenSSL uses the reference to the key slot as actual private key instead of calling the SE050 provider.
I also tried to get it to work with OpenSSL CLI, i.e., openssl s_server. I can get a connection using the nxp:<slot> scheme but not using the refpem key file.
The following command leads to the error:
openssl s_server -accept 12345 -cert server.pem -key server.refpem.key -CAfile root.pem
Error:
SSL3 alert read:fatal:decrypt error
SSL_accept:error in error
ERROR
20203CA4FFFF0000:error:1B80006E:lib(55):ossl_parse_query:trailing characters:../openssl-3.0.13/crypto/property/property_parse.c:454:HERE-->/usr/lib/libsssProvider.so
20203CA4FFFF0000:error:0A00041B:SSL routines:ssl3_read_bytes:tlsv1 alert decrypt error:../openssl-3.0.13/ssl/record/rec_layer_s3.c:1590:SSL alert number 51
shutting down SSL
If I use the nxp url scheme, though, I can successfully connect to the server.
openssl s_server -accept 12345 -cert server.pem -key nxp:0x6789ABCD -CAfile root.pem
However, I can't specify the nxp:0x6789ABCD key reference in the node.js code but have to use the refpem file. Is there anyway to do that?
I also tried to make OpenSSL prioritize the SE050 provider over the default one by specifiying a propquery in the config file. But no luck so far.
# Relevant parts from openssl.cnf
[openssl_init]
providers = provider_sect
alg_section = evp_properties
[provider_sect]
default = default_sect
nxp_prov = nxp_prov_sec
[default_sect]
activate = 1
[nxp_prov_sec]
identity = nxp_prov
module = /usr/local/lib/libsssProvider.so
activate = 1
[evp_properties]
default_properties = ?provider=nxp_prov
Any help would be highly appreciated!