DOC: Fix check of EVP_PKEY_fromdata{,_init} in examples
authorRichard Levitte <levitte@openssl.org>
Thu, 9 Jul 2020 05:47:12 +0000 (07:47 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 6 Sep 2020 18:53:57 +0000 (20:53 +0200)
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12389)

doc/man3/EVP_PKEY_fromdata.pod

index f488441b93c3e8507b3728336ca341fc5a5d8119..aaf545d648d2138919bfc2ab510490079a7ee62b 100644 (file)
@@ -110,8 +110,8 @@ TODO Write a set of cookbook documents and link to them.
      EVP_PKEY *pkey = NULL;
 
      if (ctx == NULL
-         || !EVP_PKEY_key_fromdata_init(ctx)
-         || !EVP_PKEY_fromdata(ctx, &pkey, params))
+         || EVP_PKEY_key_fromdata_init(ctx) <= 0
+         || EVP_PKEY_fromdata(ctx, &pkey, params) <= 0)
          exit(1);
 
      /* Do what you want with |pkey| */
@@ -173,8 +173,8 @@ TODO Write a set of cookbook documents and link to them.
      ctx = EVP_PKEY_CTX_new_from_name(NULL, "EC", NULL);
      if (ctx == NULL
          || params != NULL
-         || !EVP_PKEY_key_fromdata_init(ctx)
-         || !EVP_PKEY_fromdata(ctx, &pkey, params)) {
+         || EVP_PKEY_key_fromdata_init(ctx) <= 0
+         || EVP_PKEY_fromdata(ctx, &pkey, params) <= 0) {
          exitcode = 1;
      } else {
          /* Do what you want with |pkey| */