Installing certificates with the same subject name.

This patch enables the way for installing different CA certificates with
the same subject name which could be the use case. The problem is OpenSSL
requires certificates file name to be consisted of the certificate
subject name hash (as name base) and integer number (as name extension),
e.g. "9d66eef0.0":
https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/reference/ssl__context/add_verify_path.html
https://www.openssl.org/docs/man1.0.2/man3/SSL_CTX_load_verify_locations.html
But finally OpenSSL allows to use many CA certificatates with the same subject
name but handling certificate file name extension (e.g. must be
consecutive integers numbers) is needed. Current implementation
hardcodes name extension to 0. So this patch is about handling
certificate file name extension properly.

Tested by installing, deleting and replacing a few CA certificates
with the same subject name and checking whether authentication based
on them works:
 - install a few CA certificates and check whether authentication based
on them works,
 - delete single CA certificate and check whether authentication based
on the rest works and based on the deleted one do not work,
 - replace single CA certificate and check whether authentication based
on the rest and the new one works and based on the replaced one do not
work.

Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
Change-Id: I95b8e77559a9e64f0e6cb95dac60dbad32fbcb86
2 files changed
tree: 481ff70cfa7c9d69197d5e21800fd2364cc7c912
  1. test/
  2. .clang-format
  3. .gitignore
  4. argument.cpp
  5. argument.hpp
  6. bootstrap.sh
  7. certificate.cpp
  8. certificate.hpp
  9. certs_manager.cpp
  10. certs_manager.hpp
  11. configure.ac
  12. csr.cpp
  13. csr.hpp
  14. LICENSE
  15. mainapp.cpp
  16. MAINTAINERS
  17. Makefile.am
  18. README.md
  19. watch.cpp
  20. watch.hpp
README.md

phosphor-certificate-manager

Certificate management allows to replace the existing certificate and private key file with another (possibly CA signed) Certificate key file. Certificate management allows the user to install both the server and client certificates.

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To clean the repository run `./bootstrap.sh clean`.