Simo Sorce e9a0511
From 504427eb5f32108dd64ff7858012863fe47b369b Mon Sep 17 00:00:00 2001
Simo Sorce e9a0511
From: Simo Sorce <simo@redhat.com>
Simo Sorce e9a0511
Date: Thu, 10 Nov 2022 16:58:28 -0500
Simo Sorce e9a0511
Subject: [PATCH 2/3] Update documentation for keymgmt export utils
Simo Sorce e9a0511
Simo Sorce e9a0511
Change function prototypes and explain how to use the selection
Simo Sorce e9a0511
argument.
Simo Sorce e9a0511
Simo Sorce e9a0511
Signed-off-by: Simo Sorce <simo@redhat.com>
Simo Sorce e9a0511
Simo Sorce e9a0511
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Simo Sorce e9a0511
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Simo Sorce e9a0511
(Merged from https://github.com/openssl/openssl/pull/19648)
Simo Sorce e9a0511
Simo Sorce e9a0511
diff --git a/doc/internal/man3/evp_keymgmt_util_export_to_provider.pod b/doc/internal/man3/evp_keymgmt_util_export_to_provider.pod
Simo Sorce e9a0511
index 1fee9f6ff9..7099e44964 100644
Simo Sorce e9a0511
--- a/doc/internal/man3/evp_keymgmt_util_export_to_provider.pod
Simo Sorce e9a0511
+++ b/doc/internal/man3/evp_keymgmt_util_export_to_provider.pod
Simo Sorce e9a0511
@@ -20,12 +20,14 @@ OP_CACHE_ELEM
Simo Sorce e9a0511
 
Simo Sorce e9a0511
  int evp_keymgmt_util_export(const EVP_PKEY *pk, int selection,
Simo Sorce e9a0511
                              OSSL_CALLBACK *export_cb, void *export_cbarg);
Simo Sorce e9a0511
- void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt);
Simo Sorce e9a0511
+ void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
Simo Sorce e9a0511
+                                           int selection);
Simo Sorce e9a0511
  OP_CACHE_ELEM *evp_keymgmt_util_find_operation_cache(EVP_PKEY *pk,
Simo Sorce e9a0511
-                                                      EVP_KEYMGMT *keymgmt);
Simo Sorce e9a0511
+                                                      EVP_KEYMGMT *keymgmt,
Simo Sorce e9a0511
+                                                      int selection);
Simo Sorce e9a0511
  int evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk, int locking);
Simo Sorce e9a0511
- int evp_keymgmt_util_cache_keydata(EVP_PKEY *pk,
Simo Sorce e9a0511
-                                    EVP_KEYMGMT *keymgmt, void *keydata);
Simo Sorce e9a0511
+ int evp_keymgmt_util_cache_keydata(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
Simo Sorce e9a0511
+                                    void *keydata, int selection);
Simo Sorce e9a0511
  void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk);
Simo Sorce e9a0511
  void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
Simo Sorce e9a0511
                                  int selection, const OSSL_PARAM params[]);
Simo Sorce e9a0511
@@ -65,6 +67,11 @@ evp_keymgmt_util_fromdata() can be used to add key object data to a
Simo Sorce e9a0511
 given key I<target> via a B<EVP_KEYMGMT> interface.  This is used as a
Simo Sorce e9a0511
 helper for L<EVP_PKEY_fromdata(3)>.
Simo Sorce e9a0511
 
Simo Sorce e9a0511
+In all functions that take a I<selection> argument, the selection is used to
Simo Sorce e9a0511
+constraint the information requested on export. It is also used in the cache
Simo Sorce e9a0511
+so that key data is guaranteed to contain all the information requested in
Simo Sorce e9a0511
+the selection.
Simo Sorce e9a0511
+
Simo Sorce e9a0511
 =head1 RETURN VALUES
Simo Sorce e9a0511
 
Simo Sorce e9a0511
 evp_keymgmt_export_to_provider() and evp_keymgmt_util_fromdata()
Simo Sorce e9a0511
-- 
Simo Sorce e9a0511
2.38.1
Simo Sorce e9a0511