STORE: Distinguish public keys from private keys
authorRichard Levitte <levitte@openssl.org>
Thu, 30 Jul 2020 08:09:43 +0000 (10:09 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 20 Aug 2020 10:37:35 +0000 (12:37 +0200)
commit2274d22d39fd65b83c9c969cba86c8f03b3e0bec
treedd86a9ea759bc5d2d1bd541afe0d28a929018e6d
parent6cc1dfca88c565ddacd9ea9aa8261ef9c0c37335
STORE: Distinguish public keys from private keys

While public keys and private keys use the same type (EVP_PKEY), just
with different contents, callers still need to distinguish between the
two to be able to know what functions to call with them (for example,
to be able to choose between EVP_PKEY_print_private() and
EVP_PKEY_print_public()).
The OSSL_STORE backend knows what it loaded, so it has the capacity to
inform.

Note that the same as usual still applies, that a private key EVP_PKEY
contains the public parts, but not necessarily the other way around.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12673)
13 files changed:
apps/include/apps.h
apps/lib/apps.c
apps/storeutl.c
crypto/err/openssl.txt
crypto/store/loader_file.c
crypto/store/store_err.c
crypto/store/store_lib.c
crypto/store/store_local.h
crypto/store/store_strings.c
doc/man3/OSSL_STORE_INFO.pod
include/openssl/store.h
include/openssl/storeerr.h
util/libcrypto.num