Skip to content

engine bug? #293

@JumboJa

Description

@JumboJa

Unable to create certificate using TPM+openssl generated cert request.

Whatever scheme was used (pkcs1, pss, rsa_pss_saltlen:32 or rsa_pss_saltlen:-1), when feeding cert request file (pem) to the CA, ALWAYS getting error:

Check that the request matches the signature
Signature did not match the certificate request

STEPS WERE:

  1. create primary (OK)
  2. create daughter AIK (OK)
  3. load context as key.ctx (OK)
  4. persist key.ctx as 0x81010001 (OK)
  5. get pubkey from key.ctx as PEM (OK)
  6. openssl req -engine libtpm2tss -keyform engine -new -key 0x81010001 -passin pass:000000 -config openssl.cnf -out csr.pem -sigopt rsa_padding_mode:pkcs1
    (btw, can't load -key key.ctx, only -key 0x81010001 works) (but I suppose it's OK)
  7. check (just in case) openssl req -in csr.pem -text -noout (OK)
  8. transfer csr file to CA
  9. CHECK AGAIN openssl req -in csr.pem -text -noout (SAME OUTPUT, seems ALSO OK)
  10. openssl ca -config CA/CA.cnf -extensions v3_ca -days 365 -notext -md sha256 -in csr.pem -out enduser.crt -sigopt rsa_padding_mode:pkcs1
Check that the request matches the signature
Signature did not match the certificate request
4027FC2EE27F0000:error:02000068:rsa routines:ossl_rsa_verify:bad signature:../crypto/rsa/rsa_sign.c:430:
4027FC2EE27F0000:error:1C880004:Provider routines:rsa_verify:RSA lib:../providers/implementations/signature/rsa_sig.c:774:
4027FC2EE27F0000:error:06880006:asn1 encoding routines:ASN1_item_verify_ctx:EVP lib:../crypto/asn1/a_verify.c:217:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions