]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Unit tests: add test for SSL_CTX_use_Cryptoapi_certificate()
authorSelva Nair <selva.nair@gmail.com>
Sat, 18 Mar 2023 14:43:25 +0000 (10:43 -0400)
committerGert Doering <gert@greenie.muc.de>
Mon, 20 Mar 2023 17:23:50 +0000 (18:23 +0100)
commit85da9de524f34db3f6bd4ebc110b25c6bcbc273d
tree8b4c5746c31eaa331cb864b925ead7f4e708842d
parent2d17869f8d9d8e27f64f1a7cd1514fbbb768807b
Unit tests: add test for SSL_CTX_use_Cryptoapi_certificate()

- This is the only remaining function in cryptoapi.c that has no
  direct or indirect test.

  This test confirms that an SSL_CTX context gets a certificate and
  private key loaded into it and the public key in the certificate
  matches the private key. As signing with certificate/key pairs
  fetched from the store is independently tested by the 'cryptoapi_sign'
  test, signing is not re-tested here.

  The functions "setup_/teardown_cryptoapi_sign()" are renamed to
  "setup_/teardown_xkey_provider()" to better reflect their purpose.
  These are also reused for the new test.

  While touching this context, also fix a memory leak in
  test_cryptoapi_sign: X509_get_pubkey() -> X509_get0_pubkey()

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20230318144325.1316320-1-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26438.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
tests/unit_tests/openvpn/test_cryptoapi.c