[openssl] master update

Richard Levitte levitte at openssl.org
Tue Mar 19 06:08:53 UTC 2019


The branch master has been updated
       via  16bfe6cee0853bd340e270f2deda6000ea6eeaa9 (commit)
      from  529586085e38487d45974817d4f3ff40f30e19f6 (commit)


- Log -----------------------------------------------------------------
commit 16bfe6cee0853bd340e270f2deda6000ea6eeaa9
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Mar 19 06:52:15 2019 +0100

    doc/man3/OSSL_PARAM_TYPE.pod: modify Example 2 to allow unspecified params
    
    A parameter requestor is never obligated to ask for all available
    parameters on an object.  Unfortunately, Example 2 showed a code
    pattern that introduced such an obligation, and therefore needed a
    small adjustment.
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/8523)

-----------------------------------------------------------------------

Summary of changes:
 doc/man3/OSSL_PARAM_TYPE.pod | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/doc/man3/OSSL_PARAM_TYPE.pod b/doc/man3/OSSL_PARAM_TYPE.pod
index c4ca37a..2842eae 100644
--- a/doc/man3/OSSL_PARAM_TYPE.pod
+++ b/doc/man3/OSSL_PARAM_TYPE.pod
@@ -272,7 +272,9 @@ This example is for setting parameters on some object:
 
 =head2 Example 2
 
-This example is for requesting parameters on some object:
+This example is for requesting parameters on some object, and also
+demonstrates that the requestor isn't obligated to request all
+available parameters:
 
     const char *foo = NULL;
     size_t foo_l;
@@ -289,8 +291,14 @@ could fill in the parameters like this:
 
     /* const OSSL_PARAM *params */
 
-    OSSL_PARAM_set_utf8_ptr(OSSL_PARAM_locate(params, "foo"), "foo value");
-    OSSL_PARAM_set_utf8_string(OSSL_PARAM_locate(params, "bar"), "bar value");
+    const OSSL_PARAM *p;
+
+    if ((p = OSSL_PARAM_locate(params, "foo")) == NULL)
+        OSSL_PARAM_set_utf8_ptr(p, "foo value");
+    if ((p = OSSL_PARAM_locate(params, "bar")) == NULL)
+        OSSL_PARAM_set_utf8_ptr(p, "bar value");
+    if ((p = OSSL_PARAM_locate(params, "cookie")) == NULL)
+        OSSL_PARAM_set_utf8_ptr(p, "cookie value");
 
 =head1 SEE ALSO
 


More information about the openssl-commits mailing list