Overview
Comment: | ChromeOS: Made JavaScript talking to PCSC more robust |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
455296a053b280807ba1149ffe231e21 |
User & Date: | rkeene on 2016-02-28 21:18:17 |
Other Links: | manifest | tags |
Context
2016-02-28
| ||
21:22 | ChromeOS: Improved cleanup after crash check-in: 789f3b2324 user: rkeene tags: trunk | |
21:18 | ChromeOS: Made JavaScript talking to PCSC more robust check-in: 455296a053 user: rkeene tags: trunk | |
2016-02-26
| ||
21:40 | ChromeOS: Deal with CACKey crashing by restarting check-in: f631a1ccb2 user: rkeene tags: trunk | |
Changes
Modified build/chrome/cackey.js from [fda208ef5f] to [84d3b8d4ee].
︙ | |||
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | + | } /* * Handle for the CACKey NaCl Target */ var cackeyHandle = null; var cackeyPCSCHandle = null; var cackeyPCSCHandleUsable = false; /* * Handle and ID for outstanding callbacks */ var cackeyOutstandingCallbacks = {} var cackeyOutstandingCallbackCounter = -1; |
︙ | |||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | + + + + + | var cackeyMessagesToRetry = []; /* * Stored PIN for a given certificate */ var cackeyCertificateToPINMap = {}; /* * Callbacks to perform after PCSC comes online */ cackeyCallbackAfterInit = [] /* * Compute a text-based handle for a certificate to be hashed by */ function cackeyCertificateToPINID(certificate) { var id; var certificateArray; |
︙ | |||
65 66 67 68 69 70 71 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | - + + + + + | var idx; var certificates = []; for (idx = 0; idx < message.certificates.length; idx++) { certificates.push( { certificate: message.certificates[idx], |
︙ | |||
227 228 229 230 231 232 233 | 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | + - + + | cackeyMessageIncoming(tmpMessageEvent); } else { tmpMessageEvent.data.originalrequest.pin = pinWindowPINValue; cackeyCertificateToPINMap[cackeyCertificateToPINID(tmpMessageEvent.data.originalrequest.certificate)] = pinWindowPINValue; cackeyInitPCSC(function() { |
︙ | |||
297 298 299 300 301 302 303 | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | + - - - - - - - + + + + + + + - - + + - - - + + + + | if (GoogleSmartCard.IS_DEBUG_BUILD) { console.log("[cackey] Asked to provide a list of certificates -- throwing that request over to the NaCl side... "); } callbackId = cackeyOutstandingCallbackCounter + 1; cackeyInitPCSC(function() { |
︙ | |||
371 372 373 374 375 376 377 | 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | + - + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - + + + - - + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + | certificateId = cackeyCertificateToPINID(command.certificate); if (cackeyCertificateToPINMap[certificateId]) { command.pin = cackeyCertificateToPINMap[certificateId]; } cackeyInitPCSC(function() { |
︙ | |||
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /* * Force the browser to load the element * by requesting its position */ forceLoadElement = cackeyHandle.offsetTop; console.log("[cackey] cackeyInit(): Completed. Returning."); return; } /* * Initialize the CACKey Chrome Application */ function cackeyAppInit() { var oldOnPortDisconnectedFunction; var oldPCSCInitializationCallback; /* * Create a handler for starting the application UI */ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('ui.html', { "id": "cackeyUI", "focused": true, "innerBounds": { "width": 350, "minWidth": 350, "height": 135, "minHeight": 135 } }); }); /* * Register a handler for dealing with the PCSC port being disconnected */ oldOnPortDisconnectedFunction = GoogleSmartCard.Pcsc.prototype.onPortDisconnected_; GoogleSmartCard.Pcsc.prototype.onPortDisconnected_ = function() { oldOnPortDisconnectedFunction.apply(this); cackeyRestart(); return; }; /* * Register a handler for dealing with the PCSC port being available */ oldPCSCInitializationCallback = GoogleSmartCard.PcscNacl.prototype.pcscInitializationCallback_; GoogleSmartCard.PcscNacl.prototype.pcscInitializationCallback_ = function(requestId, instanceId, instance, error) { oldPCSCInitializationCallback.apply(this, [requestId, instanceId, instance, error]); cackeyInitPCSCCompleted(); return; }; return; } /* Initialize CACKey */ cackeyAppInit(); cackeyInit(); |