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/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c
          +++ new/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c
↓ open down ↓ 2025 lines elided ↑ open up ↑
2026 2026          X509 *xcert = NULL;
2027 2027          unsigned char *outbuf = NULL;
2028 2028          unsigned char *outbuf_p;
2029 2029          char *tmpstr = NULL;
2030 2030          int j;
2031 2031          int ext_index, nid, len;
2032 2032          BIO *mem = NULL;
2033 2033  #if OPENSSL_VERSION_NUMBER < 0x10000000L
2034 2034          STACK *emlst = NULL;
2035 2035  #else
2036      -        STACK_OF(OPENSSL_STRING) *emlst = NULL;
     2036 +        STACK_OF(OPENSSL_STRING) *emlst = NULL;
2037 2037  #endif
2038 2038          X509_EXTENSION *ex;
2039 2039          X509_CINF *ci;
2040 2040  
2041 2041          if (pcert == NULL || pcert->Data == NULL || pcert->Length == 0) {
2042 2042                  return (KMF_ERR_BAD_PARAMETER);
2043 2043          }
2044 2044  
2045 2045          /* copy cert data to outbuf */
2046 2046          outbuf = malloc(pcert->Length);
↓ open down ↓ 99 lines elided ↑ open up ↑
2146 2146                  break;
2147 2147  
2148 2148          case KMF_CERT_EMAIL:
2149 2149                  emlst = X509_get1_email(xcert);
2150 2150  #if OPENSSL_VERSION_NUMBER < 0x10000000L
2151 2151                  for (j = 0; j < sk_num(emlst); j++)
2152 2152                          (void) BIO_printf(mem, "%s\n", sk_value(emlst, j));
2153 2153  #else
2154 2154                  for (j = 0; j < sk_OPENSSL_STRING_num(emlst); j++)
2155 2155                          (void) BIO_printf(mem, "%s\n",
2156      -                            sk_OPENSSL_STRING_value(emlst, j));
     2156 +                            sk_OPENSSL_STRING_value(emlst, j));
2157 2157  #endif
2158 2158  
2159 2159                  len = BIO_gets(mem, resultStr, KMF_CERT_PRINTABLE_LEN);
2160 2160                  X509_email_free(emlst);
2161 2161                  break;
2162 2162          case KMF_X509_EXT_ISSUER_ALTNAME:
2163 2163          case KMF_X509_EXT_SUBJ_ALTNAME:
2164 2164          case KMF_X509_EXT_KEY_USAGE:
2165 2165          case KMF_X509_EXT_PRIV_KEY_USAGE_PERIOD:
2166 2166          case KMF_X509_EXT_CERT_POLICIES:
↓ open down ↓ 1604 lines elided ↑ open up ↑
3771 3771          if (attr != NULL) {
3772 3772                  int i;
3773 3773                  X509_ATTRIBUTE *a;
3774 3774                  for (i = 0;
3775 3775                      i < sk_X509_ATTRIBUTE_num(pkey->attributes); i++) {
3776 3776                          /* LINTED E_BAD_PTR_CASE_ALIGN */
3777 3777                          a = sk_X509_ATTRIBUTE_value(pkey->attributes, i);
3778 3778                          if (OBJ_obj2nid(a->object) == nid) {
3779 3779                                  X509_ATTRIBUTE_free(a);
3780 3780                                  /* LINTED E_BAD_PTR_CAST_ALIGN */
3781      -                                sk_X509_ATTRIBUTE_set(pkey->attributes,
     3781 +                                (void) sk_X509_ATTRIBUTE_set(pkey->attributes,
3782 3782                                      i, attr);
3783 3783                                  return (KMF_OK);
3784 3784                          }
3785 3785                  }
3786 3786                  if (sk_X509_ATTRIBUTE_push(pkey->attributes, attr) == NULL) {
3787 3787                          X509_ATTRIBUTE_free(attr);
3788 3788                          return (KMF_ERR_MEMORY);
3789 3789                  }
3790 3790          } else {
3791 3791                  return (KMF_ERR_MEMORY);
↓ open down ↓ 1806 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX