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>

*** 2497,2507 **** return (NULL); keyhash = id->value.byKey->data; /* Calculate hash of each key and compare */ for (i = 0; i < sk_X509_num(certs); i++) { - /* LINTED E_BAD_PTR_CAST_ALIGN */ X509 *x = sk_X509_value(certs, i); /* Use pubkey_digest to get the key ID value */ (void) X509_pubkey_digest(x, EVP_sha1(), tmphash, NULL); if (!memcmp(keyhash, tmphash, SHA_DIGEST_LENGTH)) return (x); --- 2497,2506 ----
*** 3637,3647 **** rv = KMF_ERR_MEMORY; goto err; } for (i = 0; i < sk_X509_INFO_num(x509_info_stack); i++) { - /* LINTED E_BAD_PTR_CAST_ALIGN */ cert_infos[ncerts] = sk_X509_INFO_value(x509_info_stack, i); ncerts++; } if (ncerts == 0) { --- 3636,3645 ----
*** 3719,3729 **** *priv_key = pkey; err: /* Cleanup the stack of X509 info records */ for (i = 0; i < sk_X509_INFO_num(x509_info_stack); i++) { - /* LINTED E_BAD_PTR_CAST_ALIGN */ info = (X509_INFO *)sk_X509_INFO_value(x509_info_stack, i); X509_INFO_free(info); } if (x509_info_stack) sk_X509_INFO_free(x509_info_stack); --- 3717,3726 ----
*** 3740,3750 **** { KMF_RETURN ret; int i; for (i = 0; i < sk_PKCS12_SAFEBAG_num(bags); i++) { - /* LINTED E_BAD_PTR_CAST_ALIGN */ PKCS12_SAFEBAG *bag = sk_PKCS12_SAFEBAG_value(bags, i); ret = openssl_parse_bag(bag, pin, (pin ? strlen(pin) : 0), keys, certs); if (ret != KMF_OK) --- 3737,3746 ----
*** 3771,3786 **** if (attr != NULL) { int i; X509_ATTRIBUTE *a; for (i = 0; i < sk_X509_ATTRIBUTE_num(pkey->attributes); i++) { - /* LINTED E_BAD_PTR_CASE_ALIGN */ a = sk_X509_ATTRIBUTE_value(pkey->attributes, i); if (OBJ_obj2nid(a->object) == nid) { X509_ATTRIBUTE_free(a); ! /* LINTED E_BAD_PTR_CAST_ALIGN */ ! sk_X509_ATTRIBUTE_set(pkey->attributes, i, attr); return (KMF_OK); } } if (sk_X509_ATTRIBUTE_push(pkey->attributes, attr) == NULL) { --- 3767,3780 ---- if (attr != NULL) { int i; X509_ATTRIBUTE *a; for (i = 0; i < sk_X509_ATTRIBUTE_num(pkey->attributes); i++) { a = sk_X509_ATTRIBUTE_value(pkey->attributes, i); if (OBJ_obj2nid(a->object) == nid) { X509_ATTRIBUTE_free(a); ! (void) sk_X509_ATTRIBUTE_set(pkey->attributes, i, attr); return (KMF_OK); } } if (sk_X509_ATTRIBUTE_push(pkey->attributes, attr) == NULL) {
*** 3953,3963 **** if ((asafes = PKCS12_unpack_authsafes(p12)) == NULL) return (KMF_ERR_PKCS12_FORMAT); for (i = 0; ret == KMF_OK && i < sk_PKCS7_num(asafes); i++) { bags = NULL; - /* LINTED E_BAD_PTR_CAST_ALIGN */ p7 = sk_PKCS7_value(asafes, i); bagnid = OBJ_obj2nid(p7->type); if (bagnid == NID_pkcs7_data) { bags = PKCS12_unpack_p7data(p7); --- 3947,3956 ----
*** 4231,4241 **** if (attrs == NULL) return (NULL); for (i = 0; i < sk_X509_ATTRIBUTE_num(attrs); i++) { - /* LINTED E_BAD_PTR_CAST_ALIGN */ a = sk_X509_ATTRIBUTE_value(attrs, i); if (OBJ_obj2nid(a->object) == nid) return (a); } return (NULL); --- 4224,4233 ----
*** 4272,4282 **** attr = find_attr(pkey->attributes, NID_friendlyName); if (attr != NULL) { ASN1_TYPE *ty = NULL; int numattr = sk_ASN1_TYPE_num(attr->value.set); if (attr->single == 0 && numattr > 0) { - /* LINTED E_BAD_PTR_CAST_ALIGN */ ty = sk_ASN1_TYPE_value(attr->value.set, 0); } if (ty != NULL) { #if OPENSSL_VERSION_NUMBER < 0x10000000L key->label = uni2asc(ty->value.bmpstring->data, --- 4264,4273 ----
*** 4296,4306 **** attr = find_attr(pkey->attributes, NID_localKeyID); if (attr != NULL) { ASN1_TYPE *ty = NULL; int numattr = sk_ASN1_TYPE_num(attr->value.set); if (attr->single == 0 && numattr > 0) { - /* LINTED E_BAD_PTR_CAST_ALIGN */ ty = sk_ASN1_TYPE_value(attr->value.set, 0); } key->id.Data = (uchar_t *)malloc( ty->value.octet_string->length); if (key->id.Data == NULL) --- 4287,4296 ----
*** 4327,4337 **** KMF_RETURN rv = KMF_OK; KMF_RAW_KEY_DATA key; int i; for (i = 0; sslkeys != NULL && i < sk_EVP_PKEY_num(sslkeys); i++) { - /* LINTED E_BAD_PTR_CAST_ALIGN */ EVP_PKEY *pkey = sk_EVP_PKEY_value(sslkeys, i); rv = convertToRawKey(pkey, &key); if (rv == KMF_OK) rv = add_key_to_list(keylist, &key, nkeys); --- 4317,4326 ----
*** 4339,4349 **** return (rv); } /* Now add the certificate to the certlist */ for (i = 0; sslcert != NULL && i < sk_X509_num(sslcert); i++) { - /* LINTED E_BAD_PTR_CAST_ALIGN */ X509 *cert = sk_X509_value(sslcert, i); rv = add_cert_to_list(kmfh, cert, certlist, ncerts); if (rv != KMF_OK) return (rv); } --- 4328,4337 ----
*** 4355,4365 **** * sk_X509_value() is macro that embeds a cast to (X509 *). * Here it translates into ((X509 *)sk_value((ca), (i))). * Lint is complaining about the embedded casting, and * to fix it, you need to fix openssl header files. */ - /* LINTED E_BAD_PTR_CAST_ALIGN */ c = sk_X509_value(sslcacerts, i); /* Now add the ca cert to the certlist */ rv = add_cert_to_list(kmfh, c, certlist, ncerts); if (rv != KMF_OK) --- 4343,4352 ----
*** 5422,5432 **** ret = KMF_ERR_EMPTY_CRL; goto end; } for (i = 0; i < sk_X509_REVOKED_num(revoke_stack); i++) { - /* LINTED E_BAD_PTR_CAST_ALIGN */ revoke = sk_X509_REVOKED_value(revoke_stack, i); if (ASN1_INTEGER_cmp(xcert->cert_info->serialNumber, revoke->serialNumber) == 0) { break; } --- 5409,5418 ----