Print this page
4853 illumos-gate is not lint-clean when built with openssl 1.0
Reviewed by Keith Wesolowski <keith.wesolowski@joyent.com>
Reviewed by Alexander Eremin <alexander.eremin@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/p12split.c
          +++ new/usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/p12split.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2002-2003 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   27  #include <stdio.h>
  30   28  #include <libintl.h>
  31   29  #include <locale.h>
  32   30  #include <sys/types.h>
  33   31  #include <sys/stat.h>
  34   32  #include <sys/wanboot_impl.h>
  35   33  #include <unistd.h>
  36   34  #include <string.h>
  37   35  #include <libinetutil.h>
  38   36  #include <wanbootutil.h>
↓ open down ↓ 216 lines elided ↑ open up ↑
 255  253  
 256  254                          (void) sunw_print_times(stdout, PRNT_BOTH, NULL,
 257  255                              xcert_in);
 258  256                  }
 259  257  
 260  258                  if (ta_in != NULL) {
 261  259                          X509 *x;
 262  260                          int i;
 263  261  
 264  262                          for (i = 0; i < sk_X509_num(ta_in); i++) {
 265      -                                /* LINTED */
 266  263                                  x = sk_X509_value(ta_in, i);
 267  264                                  (void) printf(
 268  265                                      gettext("\nTrust Anchor cert %d:\n"), i);
 269  266  
 270  267                                  /*
 271  268                                   * sunw_subject_attrs() returns a pointer to
 272  269                                   * memory allocated on our behalf. We get the
 273  270                                   * same behavior from sunw_issuer_attrs().
 274  271                                   */
 275  272                                  bufp = sunw_subject_attrs(x, NULL, 0);
↓ open down ↓ 4 lines elided ↑ open up ↑
 280  277                                  }
 281  278  
 282  279                                  bufp = sunw_issuer_attrs(x, NULL, 0);
 283  280                                  if (bufp != NULL) {
 284  281                                          (void) printf(
 285  282                                              gettext("  Issuer: %s\n"), bufp);
 286  283                                          OPENSSL_free(bufp);
 287  284                                  }
 288  285  
 289  286                                  (void) sunw_print_times(stdout, PRNT_BOTH,
 290      -                                        NULL, x);
      287 +                                    NULL, x);
 291  288                          }
 292  289                  }
 293  290          }
 294  291  
 295  292          check_certs(ta_in, &xcert_in);
 296  293          if (xcert_in != NULL && pkey_in != NULL) {
 297  294                  if (sunw_check_keys(xcert_in, pkey_in) == 0) {
 298  295                          wbku_printerr("warning: key and certificate do "
 299  296                              "not match\n");
 300  297                  }
↓ open down ↓ 68 lines elided ↑ open up ↑
 369  366                          (void) fprintf(stderr, gettext("  Removing cert\n"));
 370  367                          X509_free(*c_in);
 371  368                          *c_in = NULL;
 372  369                  }
 373  370          }
 374  371  
 375  372          if (ta_in == NULL)
 376  373                  return;
 377  374  
 378  375          for (i = 0; i < sk_X509_num(ta_in); ) {
 379      -                /* LINTED */
 380  376                  curr = sk_X509_value(ta_in, i);
 381  377                  ret = time_check_print(curr);
 382  378                  if ((ret != CHK_TIME_OK && ret != CHK_TIME_IS_BEFORE) &&
 383  379                      del_expired) {
 384  380                          (void) fprintf(stderr, gettext("  Removing cert\n"));
 385      -                        /* LINTED */
 386  381                          curr = sk_X509_delete(ta_in, i);
 387  382                          X509_free(curr);
 388  383                          continue;
 389  384                  }
 390  385                  i++;
 391  386          }
 392  387  }
 393  388  
 394  389  static time_errs_t
 395  390  time_check_print(X509 *cert)
↓ open down ↓ 183 lines elided ↑ open up ↑
 579  574          (void) fclose(fp);
 580  575          if (p12 != NULL)
 581  576                  PKCS12_free(p12);
 582  577          /*
 583  578           * Put the cert and pkey off of the stack so that they won't
 584  579           * be freed two times.  (If they get left in the stack then
 585  580           * they will be freed with the stack.)
 586  581           */
 587  582          if (clist != NULL) {
 588  583                  if (cert != NULL && sk_X509_num(clist) == 1) {
 589      -                        /* LINTED */
 590  584                          (void) sk_X509_delete(clist, 0);
 591  585                  }
 592  586                  sk_X509_pop_free(clist, X509_free);
 593  587          }
 594  588          if (klist != NULL) {
 595  589                  if (pkey != NULL && sk_EVP_PKEY_num(klist) == 1) {
 596      -                        /* LINTED */
 597  590                          (void) sk_EVP_PKEY_delete(klist, 0);
 598  591                  }
 599  592                  sk_EVP_PKEY_pop_free(klist, sunw_evp_pkey_free);
 600  593          }
 601  594  
 602  595          return (ret);
 603  596  }
 604  597  
 605  598  static void
 606  599  usage(void)
↓ open down ↓ 51 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX