Overview
Comment: | ChromeOS: Updated to forget PINs that have not been used recently |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a7016d70847c6590fa7d8f98dcd5426b |
User & Date: | rkeene on 2016-03-01 03:10:25 |
Other Links: | manifest | tags |
Context
2016-03-08
| ||
21:02 | ChromeOS: Added support for informing the user if we are a certificate provider or not check-in: 188c4d598f user: rkeene tags: trunk | |
2016-03-01
| ||
03:10 | ChromeOS: Updated to forget PINs that have not been used recently check-in: a7016d7084 user: rkeene tags: trunk | |
00:53 | ChromeOS: Release 7 check-in: aeca5bf8e3 user: rkeene tags: trunk | |
Changes
Modified build/chrome/cackey.js from [3273b79cbc] to [6f10afa9df].
︙ | |||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | + | */ var cackeyMessagesToRetry = []; /* * Stored PIN for a given certificate */ var cackeyCertificateToPINMap = {}; var cackeyCertificateToPINMapLastUsedRunner = false; /* * Callbacks to perform after PCSC comes online */ cackeyCallbackAfterInit = []; /* |
︙ | |||
105 106 107 108 109 110 111 112 113 114 115 116 117 118 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | payload = message.signedData; chromeCallback(payload); return; } /* * Update the time a PIN was last used for a certificate */ function cackeyCertificateToPINMapUpdateLastUsed(id) { if (id != null) { cackeyCertificateToPINMap[id].lastUsed = (new Date()).getTime(); } if (!cackeyCertificateToPINMapLastUsedRunner) { cackeyCertificateToPINMapLastUsedRunner = true; setTimeout(function() { var currentTime; var certificates, certificate; var idx; currentTime = (new Date()).getTime(); certificates = Object.keys(cackeyCertificateToPINMap); console.log("Looking for PINs to clear"); for (idx = 0; idx < certificates.length; idx++) { certificate = certificates[idx]; if ((cackeyCertificateToPINMap[certificate].lastUsed + 900000) > currentTime) { continue; } console.log("Deleteting " + certificate); delete cackeyCertificateToPINMap[certificate]; } certificates = Object.keys(cackeyCertificateToPINMap); cackeyCertificateToPINMapLastUsedRunner = false; if (certificates.length == 0) { return; } cackeyCertificateToPINMapUpdateLastUsed(null); }, 900000); } } /* * Handle an incoming message from the NaCl side and pass it off to * one of the handlers above for actual formatting and passing to * the callback * * If an error occured, invoke the callback with no arguments. |
︙ | |||
244 245 246 247 248 249 250 | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | - + + + + | tmpMessageEvent.data.status = "error"; tmpMessageEvent.data.error = "PIN window closed without a PIN being provided"; cackeyMessageIncoming(tmpMessageEvent); } else { tmpMessageEvent.data.originalrequest.pin = pinWindowPINValue; |
︙ | |||
405 406 407 408 409 410 411 | 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 | - - + + + + | 'id': callbackId, 'certificate': signRequest.certificate, 'data': digest.buffer }; certificateId = cackeyCertificateToPINID(command.certificate); |
︙ |