Check-in [1578fc80e7]
Overview
Comment:Added start of Chrome javascript module
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1578fc80e774f2dbb6d2da5b207a6121b95fb997
User & Date: rkeene on 2016-02-04 18:23:40
Other Links: manifest | tags
Context
2016-02-04
22:51
More work towards a prototypical CACKey JavaScript file check-in: 7fc78ce33e user: rkeene tags: trunk
18:23
Added start of Chrome javascript module check-in: 1578fc80e7 user: rkeene tags: trunk
18:07
Create a native manifest for CACKey on Chrome and other fixups check-in: b0a1326758 user: rkeene tags: trunk
Changes

Modified .fossil-settings/ignore-glob from [b482ef6532] to [b9df6af430].

    19     19   libcackey.syms
    20     20   build/certs
    21     21   test
    22     22   test-afl
    23     23   test-afl.data
    24     24   build/chrome/archive
    25     25   build/chrome/workdir-*
    26         -build/chrome/libcackey.a
           26  +build/chrome/lib
    27     27   build/chrome/cackey-chrome.o
    28         -build/chrome/cackey-chrome.pexe
           28  +build/chrome/cackey-chrome-init.o
           29  +build/chrome/cackey.pexe
           30  +build/chrome/cackey.nmf

Added build/chrome/cackey.js version [dc0fd6eff0].

            1  +/*
            2  + * CACKey ChromeOS chrome.certificateProvider Implementation
            3  + */
            4  +
            5  +function onCertificatesRejected(rejectedCerts) {
            6  +	// If certificates were rejected by the API, log an error, for example.
            7  +	console.error(rejectedCerts.length + ' certificates were rejected.');
            8  +	return;
            9  +}
           10  +
           11  +function cackeyListCertificates(chromeCallback) {
           12  +	var certificates = [];
           13  +
           14  +	certificates.push(
           15  +		{
           16  +			certificate: new UInt8Array(),
           17  +			supportedHashes: ['SHA1', 'SHA256']
           18  +		}
           19  +	);
           20  +
           21  +	chromeCallback(certificates,
           22  +		function(rejectedCerts) {
           23  +			if (chrome.runtime.lastError) {
           24  +				return;
           25  +			}
           26  +
           27  +			if (rejectedCerts.length !== 0) {
           28  +				onCertificatesRejected(rejectedCerts);
           29  +			}
           30  +
           31  +			return;
           32  +		}
           33  +	);
           34  +
           35  +	return;
           36  +}
           37  +
           38  +function cackeySignMessage(signRequest, chromeCallback) {
           39  +	/* XXX:TODO: Implement this */
           40  +	chromeCallback();
           41  +
           42  +	return;
           43  +}
           44  +
           45  +/* Register listeners with Chrome */
           46  +chrome.certificateProvider.onCertificatesRequested.addListener(cackeyListCertificates);
           47  +chrome.certificateProvider.onSignDigestRequested.addListener(cackeySignMessage);