Check-in [3efa328414]
Overview
Comment:Fixed bug where DoD certs were overwriting random parts of memory causing strange bugs, fixes [b9306c2b35]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3efa3284148f7689f5dc82af3e8e7c84f31cf5e0
User & Date: rkeene on 2012-07-27 18:27:13
Original Comment: Fixed bug where DoD certs were overwriting random parts of memory causing strange bugs
Other Links: manifest | tags
References
2018-08-13
16:57 Closed ticket [b9306c2b35]: CACKey 0.6.7 causes applications to hang and crash plus 3 other changes artifact: 499af008d8 user: rkeene
2012-07-27
18:35 Fixed ticket [b9306c2b35]. artifact: 6bacdba8e5 user: rkeene
Context
2012-07-27
18:29
Removed extraneous parameter of cackey_read_dod_identities() check-in: e491e4b5f9 user: rkeene tags: trunk
18:27
Fixed bug where DoD certs were overwriting random parts of memory causing strange bugs, fixes [b9306c2b35] check-in: 3efa328414 user: rkeene tags: trunk
2012-07-25
14:14
Fixed typo in Mac OS X package LICENSE. check-in: e716dafc55 user: kvanals tags: trunk
Changes

Modified cackey.c from [0661f619de] to [2007da4548].

3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
	if (getenv("CACKEY_NO_EXTRA_CERTS") != NULL) {
		num_dod_certs = 0;
	} else {
		num_dod_certs = sizeof(extra_certs) / sizeof(extra_certs[0]);
	}

	if (slot->internal) {
		num_ids = num_dod_certs;

		if (num_ids != 0) {
			identities = malloc(num_ids * sizeof(*identities));

			cackey_read_dod_identities(identities, 0, num_dod_certs);
		} else {
			identities = NULL;
		}

		*ids_found = num_ids;

		return(identities);
	}

	pcsc_identities = cackey_read_certs(slot, NULL, &num_certs);
	if (pcsc_identities != NULL) {
		/* Convert number of Certs to number of objects */
		num_ids = (CKO_PRIVATE_KEY - CKO_CERTIFICATE + 1) * num_certs;

		if (include_extra_certs) {
			num_ids += num_dod_certs;
		}

		identities = malloc(num_ids * sizeof(*identities));

		/* Add certificates, public keys, and private keys from the smartcard */
		id_idx = 0;
		for (cert_idx = 0; cert_idx < num_certs; cert_idx++) {







|




















|







3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
	if (getenv("CACKEY_NO_EXTRA_CERTS") != NULL) {
		num_dod_certs = 0;
	} else {
		num_dod_certs = sizeof(extra_certs) / sizeof(extra_certs[0]);
	}

	if (slot->internal) {
		num_ids = num_dod_certs * 3;

		if (num_ids != 0) {
			identities = malloc(num_ids * sizeof(*identities));

			cackey_read_dod_identities(identities, 0, num_dod_certs);
		} else {
			identities = NULL;
		}

		*ids_found = num_ids;

		return(identities);
	}

	pcsc_identities = cackey_read_certs(slot, NULL, &num_certs);
	if (pcsc_identities != NULL) {
		/* Convert number of Certs to number of objects */
		num_ids = (CKO_PRIVATE_KEY - CKO_CERTIFICATE + 1) * num_certs;

		if (include_extra_certs) {
			num_ids += num_dod_certs * 3;
		}

		identities = malloc(num_ids * sizeof(*identities));

		/* Add certificates, public keys, and private keys from the smartcard */
		id_idx = 0;
		for (cert_idx = 0; cert_idx < num_certs; cert_idx++) {