Hi @Kan_Li,
Thanks for your quick reply.
I tried the code sent by you but I think something doesn’t work properly.
First of all, when I tried to generate a reference key, there is no validation that the key pair already exists, so a reference key is generated even if the pair of keys does not exist.
When I tried to use the reference key to validate a CSR, the verification fails.
Commands used to test:
#seTool genRsa 2048 0x00000020 /dev/i2c-1
#seTool getRsaRef 2048 0x00000020 server.key /dev/i2c-1
#openssl req -config device.cnf -key server.key -new -sha256 -out server.csr -batch
#openssl req -text -noout -verify -in server.csr
verify failure
But when I tried the same thing using just openssl everthing works fine.
#openssl genrsa -out server2.key 2048
#openssl req -config device.cnf -key server2.key -new -sha256 -out server2.csr -batch
#openssl req -text -noout -verify -in server2.csr
verify OK
When I compare the piece of code used to generate the RSA reference key with the code used to generate the ECC reference key, the ECC uses it's public key, but not in the RSA. Also in the python code used to generate the RSA reference key uses the public key (generate_openssl_rsa_refkey - pycli/src/sss/util.py). I think this part is missing.
Thanks in advance,
Cristiane Bellenzier Piaia