000013570 - What input checking does MES do for R_SSL_CTX_use_certificate_ASN1()  R_SSL_CTX_use_PrivateKey_ASN1()  R_SSL_CTX_check_private_key()?

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 22, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000013570
Applies ToRSA BSAFE Micro Edition Suite
IssueWhat input checking does MES do for R_SSL_CTX_use_certificate_ASN1(), R_SSL_CTX_use_PrivateKey_ASN1(),  R_SSL_CTX_check_private_key()?

What input checking does MES do for these functions?

  R_SSL_CTX_use_certificate_ASN1
  R_SSL_CTX_use_PrivateKey_ASN1
  R_SSL_CTX_check_private_key

What if the data is ASN.1 but not X.509 format?

Resolution1. R_SSL_CTX_use_certificate_ASN1() calls R_CERT_from_binary().  If the certificate is not a valid binary X.509 certificate (e.g. if it is valid ASN.1 but not an X.509 certificate, if it is an X.509 certificate but not in binary format, or if it different data such as a Word document), then it will log an SSL error on the error stack.

If you run the sample program cert.c with "-inform bin", then R_CERT_read() also calls R_CERT_from_binary().  You can use this to test the behavior of R_CERT_from_binary().

If NO_WTLS_CERT is not defined, then a WTLS certificate may also be used.


2. R_SSL_CTX_use_PrivateKey_ASN1() calls R_PKEY_from_binary().  The key should be a binary RSA, DSA, or Diffie-Hellman private key, and may be in PKCS #8 format.  If it is not in a valid binary format, then it will log an SSL error on the error stack.

If you run the sample program pkey.c with "-inform bin", then it also also calls R_PKEY_from_binary().  You can use this to test the behavior of R_PKEY_from_binary().


3. R_SSL_CTX_check_private_key(SSL_CTX *ctx) checks that the default certificate and private key of the SSL_CTX structure match by calling R_CERT_is_matching_private_key().  This compares the public key in the certificate to the public key component of the private key to see whether they match.

Legacy Article IDa42054

Attachments

    Outcomes