Changeset 3502
- Timestamp:
- 04/28/08 09:57:03 (4 months ago)
- Location:
- trunk/src/libopensc
- Files:
-
- 12 modified
-
card-akis.c (modified) (2 diffs)
-
card-asepcos.c (modified) (2 diffs)
-
card-atrust-acos.c (modified) (6 diffs)
-
card-incrypto34.c (modified) (1 diff)
-
card-muscle.c (modified) (8 diffs)
-
card-oberthur.c (modified) (2 diffs)
-
card-piv.c (modified) (1 diff)
-
card-tcos.c (modified) (1 diff)
-
p15card-helper.c (modified) (2 diffs)
-
pkcs15-gemsafeV1.c (modified) (1 diff)
-
pkcs15-tcos.c (modified) (4 diffs)
-
reader-pcsc.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libopensc/card-akis.c
r3278 r3502 336 336 { 337 337 if (data->cmd == SC_PIN_CMD_VERIFY) { 338 / / ISO7816 implementation works338 /* ISO7816 implementation works */ 339 339 return iso_ops->pin_cmd(card, data, tries_left); 340 340 } 341 341 342 342 if (data->cmd == SC_PIN_CMD_CHANGE) { 343 / / This is AKIS specific343 /* This is AKIS specific */ 344 344 int r; 345 345 sc_apdu_t apdu; … … 527 527 akis_ops.match_card = akis_match_card; 528 528 akis_ops.init = akis_init; 529 / / read_binary: ISO7816 implementation works530 / / write_binary: ISO7816 implementation works531 / / update_binary: ISO7816 implementation works532 / / erase_binary: Untested533 / / read_record: Untested534 / / write_record: Untested535 / / append_record: Untested536 / / update_record: Untested529 /* read_binary: ISO7816 implementation works */ 530 /* write_binary: ISO7816 implementation works */ 531 /* update_binary: ISO7816 implementation works */ 532 /* erase_binary: Untested */ 533 /* read_record: Untested */ 534 /* write_record: Untested */ 535 /* append_record: Untested */ 536 /* update_record: Untested */ 537 537 akis_ops.select_file = akis_select_file; 538 / / get_response: ISO7816 implementation works539 / / get_challenge: ISO7816 implementation works538 /* get_response: ISO7816 implementation works */ 539 /* get_challenge: ISO7816 implementation works */ 540 540 akis_ops.logout = akis_logout; 541 / / restore_security_env: Untested541 /* restore_security_env: Untested */ 542 542 akis_ops.set_security_env = akis_set_security_env; 543 / / decipher: Untested544 / / compute_signature: ISO7816 implementation works543 /* decipher: Untested */ 544 /* compute_signature: ISO7816 implementation works */ 545 545 akis_ops.create_file = akis_create_file; 546 546 akis_ops.delete_file = akis_delete_file; 547 547 akis_ops.list_files = akis_list_files; 548 / / check_sw: ISO7816 implementation works548 /* check_sw: ISO7816 implementation works */ 549 549 akis_ops.card_ctl = akis_card_ctl; 550 550 akis_ops.process_fci = akis_process_fci; 551 / / construct_fci: Not needed551 /* construct_fci: Not needed */ 552 552 akis_ops.pin_cmd = akis_pin_cmd; 553 553 akis_ops.get_data = akis_get_data; 554 / / put_data: Not implemented555 / / delete_record: Not implemented554 /* put_data: Not implemented */ 555 /* delete_record: Not implemented */ 556 556 557 557 return &akis_drv; -
trunk/src/libopensc/card-asepcos.c
r3277 r3502 185 185 if (r != SC_SUCCESS) 186 186 return r; 187 tlen += 2 + p[4]; / / FIXME187 tlen += 2 + p[4]; /* FIXME */ 188 188 } else if (p[3] == 0xAF && len >= 4U + p[4]) { 189 189 /* TODO: support AND expressions */ … … 191 191 if (r != SC_SUCCESS) 192 192 return r; 193 tlen += 2 + p[4]; / / FIXME193 tlen += 2 + p[4]; /* FIXME */ 194 194 } else { 195 195 sc_error(card->ctx, "invalid security condition"); -
trunk/src/libopensc/card-atrust-acos.c
r3318 r3502 40 40 }; 41 41 42 / / sequence and number has to match atr table !42 /* sequence and number has to match atr table ! */ 43 43 static const char *atrust_acos_names[] = { 44 44 ACOS_EMV_A03, … … 81 81 if (sc_hex_to_bin(atrp, defatr, &len)) 82 82 continue; 83 / / we may only verify part of ATR since84 / / part of the hist chars is variable83 /* we may only verify part of ATR since */ 84 /* part of the hist chars is variable */ 85 85 if (len > card->atr_len) 86 86 continue; … … 156 156 if (buflen < 2) 157 157 return SC_ERROR_INTERNAL; 158 if (buf[0] != 0x6f) / / FCI template158 if (buf[0] != 0x6f) /* FCI template */ 159 159 return SC_ERROR_INVALID_DATA; 160 160 len = (size_t)buf[1]; … … 170 170 file->size = 0; 171 171 172 / / get file size172 /* get file size */ 173 173 tag = sc_asn1_find_tag(ctx, p, len, 0x80, &taglen); 174 174 if (tag != NULL && taglen >= 2) { … … 179 179 } 180 180 181 / / get file type181 /* get file type */ 182 182 tag = sc_asn1_find_tag(ctx, p, len, 0x82, &taglen); 183 183 if (tag != NULL) { … … 822 822 } 823 823 824 / / iso error824 /* iso error */ 825 825 return iso_ops->check_sw(card, sw1, sw2); 826 826 } -
trunk/src/libopensc/card-incrypto34.c
r3177 r3502 196 196 SC_TEST_RET(card->ctx, r, "APDU transmit failed"); 197 197 if (apdu.sw1 == 0x6a && apdu.sw2 == 0x82) 198 goto end; / / no more files198 goto end; /* no more files */ 199 199 200 200 r = sc_check_sw(card, apdu.sw1, apdu.sw2); -
trunk/src/libopensc/card-muscle.c
r3180 r3502 179 179 file = &fs->cache.array[fs->currentFileIndex]; 180 180 objectId = file->objectId; 181 // memcpy(objectId.id, file->objectId.id, 4); 181 /* memcpy(objectId.id, file->objectId.id, 4); */ 182 182 if(!file->ef) { 183 183 oid[0] = oid[2]; … … 202 202 203 203 objectId = file->objectId; 204 / /memcpy(objectId.id, file->objectId.id, 4);204 /* memcpy(objectId.id, file->objectId.id, 4); */ 205 205 if(!file->ef) { 206 206 oid[0] = oid[2]; … … 230 230 r = msc_update_object(card, objectId, idx, buf, count); 231 231 } 232 / /mscfs_clear_cache(fs);232 /* mscfs_clear_cache(fs); */ 233 233 return r; 234 234 } … … 269 269 oid[1] = oid[3]; 270 270 oid[2] = oid[3] = 0; 271 / / ??? objectId = objectId >> 16;271 /* ??? objectId = objectId >> 16; */ 272 272 } 273 273 if((0 == memcmp(oid, "\x3F\x00\x00\x00", 4)) … … 308 308 { 309 309 int key; 310 / / Everybody by default....310 /* Everybody by default.... */ 311 311 sc_file_add_acl_entry(file, operation, SC_AC_NONE, 0); 312 312 if(acl == 0xFFFF) { … … 585 585 /* CURRENTLY DONT SUPPOT EXTRACTING PRIVATE KEYS... */ 586 586 switch(info->keyType) { 587 case 1: / / RSA587 case 1: /* RSA */ 588 588 return msc_extract_rsa_public_key(card, 589 589 info->keyLocation, … … 601 601 /* CURRENTLY DONT SUPPOT EXTRACTING PRIVATE KEYS... */ 602 602 switch(info->keyType) { 603 case 0x02: / / RSA_PRIVATE604 case 0x03: / / RSA_PRIVATE_CRT603 case 0x02: /* RSA_PRIVATE */ 604 case 0x03: /* RSA_PRIVATE_CRT */ 605 605 return msc_import_key(card, 606 606 info->keyLocation, … … 676 676 return SC_ERROR_NOT_SUPPORTED; 677 677 } 678 / /if (env->flags & SC_SEC_ENV_FILE_REF_PRESENT)679 //if (memcmp(env->file_ref.value, "\x00\x12", 2) != 0) {680 //sc_error(card->ctx, "File reference is not 0012.\n");681 //return SC_ERROR_NOT_SUPPORTED;682 // }678 /* if (env->flags & SC_SEC_ENV_FILE_REF_PRESENT) 679 if (memcmp(env->file_ref.value, "\x00\x12", 2) != 0) { 680 sc_error(card->ctx, "File reference is not 0012.\n"); 681 return SC_ERROR_NOT_SUPPORTED; 682 } */ 683 683 priv->env = *env; 684 684 return 0; -
trunk/src/libopensc/card-oberthur.c
r3405 r3502 182 182 sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0xA4, 0x04, 0x0C); 183 183 apdu.lc = sizeof(cm); 184 // apdu.le = sizeof(cm)+4; 184 /* apdu.le = sizeof(cm)+4; */ 185 185 apdu.le = 0; 186 186 apdu.data = cm; … … 2058 2058 auth_current_ef->magic, auth_current_ef->ef_structure); 2059 2059 2060 / / _auth_print_acls(card, auth_current_ef);2060 /* _auth_print_acls(card, auth_current_ef); */ 2061 2061 2062 2062 #ifndef NOT_YET -
trunk/src/libopensc/card-piv.c
r3405 r3502 1717 1717 priv->selected_obj = -1; 1718 1718 priv->max_recv_size = 256; 1719 / /priv->max_recv_size = card->max_recv_size;1719 /* priv->max_recv_size = card->max_recv_size; */ 1720 1720 priv->max_send_size = card->max_send_size; 1721 1721 card->max_recv_size = 0xffff; /* must force pkcs15 read_binary in one call */ -
trunk/src/libopensc/card-tcos.c
r3309 r3502 521 521 else sc_debug(ctx, "Key-Reference %02X (len=%d)\n", env->key_ref[0], env->key_ref_len); 522 522 } 523 / / Key-Reference 0x80 ??523 /* Key-Reference 0x80 ?? */ 524 524 default_key= !(env->flags & SC_SEC_ENV_KEY_REF_PRESENT) || (env->key_ref_len==1 && env->key_ref[0]==0x80); 525 525 if(ctx->debug>=3){ -
trunk/src/libopensc/p15card-helper.c
r3405 r3502 133 133 } 134 134 135 / /int default_cert_handle(sc_pkcs15_card_t *p15card, p15data_items* items, cdata* cert, u8* data, size_t length) {135 /* int default_cert_handle(sc_pkcs15_card_t *p15card, p15data_items* items, cdata* cert, u8* data, size_t length) { */ 136 136 CERT_HANDLE_FUNCTION(default_cert_handle) { 137 137 /* Certificate data exists, parse it */ … … 171 171 172 172 modulus_len = 8 * BN_num_bytes(pkey->pkey.rsa->n); /* converting to bits */ 173 / /printf("Key Size: %d bits\n\n", modulus_len);174 / /cached_cert->modulusLength = modulus_len;173 /* printf("Key Size: %d bits\n\n", modulus_len); */ 174 /* cached_cert->modulusLength = modulus_len; */ 175 175 176 176 if(key->label) { -
trunk/src/libopensc/pkcs15-gemsafeV1.c
r3430 r3502 494 494 #endif 495 495 496 / /SC_IMPLEMENT_DRIVER_VERSION("0.9.4")496 /* SC_IMPLEMENT_DRIVER_VERSION("0.9.4") */ -
trunk/src/libopensc/pkcs15-tcos.c
r3405 r3502 65 65 } 66 66 67 / / some certificates are prefixed by an OID67 /* some certificates are prefixed by an OID */ 68 68 if(cert[4]==0x06 && cert[5]<10 && cert[6+cert[5]]==0x30 && cert[7+cert[5]]==0x82){ 69 69 cert_info.path.index=6+cert[5]; … … 255 255 char dir[10], *c_auth; 256 256 257 / / NKS-Applikation ?257 /* NKS-Applikation ? */ 258 258 p.len=7; p.type=SC_PATH_TYPE_DF_NAME; 259 259 memcpy(p.value, "\xD2\x76\x00\x00\x03\x01\x02", p.len=7); … … 307 307 ); 308 308 309 / / SigG-Applikation ?309 /* SigG-Applikation ? */ 310 310 p.len=7; p.type=SC_PATH_TYPE_DF_NAME; 311 311 memcpy(p.value, "\xD2\x76\x00\x00\x66\x01", p.len=6); … … 438 438 int i, r; 439 439 440 / / check if we have the correct card OS unless SC_PKCS15EMU_FLAGS_NO_CHECK440 /* check if we have the correct card OS unless SC_PKCS15EMU_FLAGS_NO_CHECK */ 441 441 i=(opts && (opts->flags & SC_PKCS15EMU_FLAGS_NO_CHECK)); 442 442 if (!i && card->type!=SC_CARD_TYPE_TCOS_V2 && card->type!=SC_CARD_TYPE_TCOS_V3) return SC_ERROR_WRONG_CARD; 443 443 444 / / get the card serial number444 /* get the card serial number */ 445 445 r = sc_card_ctl(card, SC_CARDCTL_GET_SERIALNR, &serialnr); 446 446 if (r < 0) { -
trunk/src/libopensc/reader-pcsc.c
r3455 r3502 1206 1206 1207 1207 SC_TEST_RET(reader->ctx, r, "Part 10: block transmit failed!"); 1208 / / finish the call if it was a two-phase operation1208 /* finish the call if it was a two-phase operation */ 1209 1209 if ((ioctl == pslot->verify_ioctl_start) 1210 1210 || (ioctl == pslot->modify_ioctl_start)) {
