Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -21,8 +21,10 @@ test test-afl test-afl.data build/chrome/archive build/chrome/workdir-* -build/chrome/libcackey.a +build/chrome/lib build/chrome/cackey-chrome.o -build/chrome/cackey-chrome.pexe +build/chrome/cackey-chrome-init.o +build/chrome/cackey.pexe +build/chrome/cackey.nmf ADDED build/chrome/cackey.js Index: build/chrome/cackey.js ================================================================== --- /dev/null +++ build/chrome/cackey.js @@ -0,0 +1,47 @@ +/* + * CACKey ChromeOS chrome.certificateProvider Implementation + */ + +function onCertificatesRejected(rejectedCerts) { + // If certificates were rejected by the API, log an error, for example. + console.error(rejectedCerts.length + ' certificates were rejected.'); + return; +} + +function cackeyListCertificates(chromeCallback) { + var certificates = []; + + certificates.push( + { + certificate: new UInt8Array(), + supportedHashes: ['SHA1', 'SHA256'] + } + ); + + chromeCallback(certificates, + function(rejectedCerts) { + if (chrome.runtime.lastError) { + return; + } + + if (rejectedCerts.length !== 0) { + onCertificatesRejected(rejectedCerts); + } + + return; + } + ); + + return; +} + +function cackeySignMessage(signRequest, chromeCallback) { + /* XXX:TODO: Implement this */ + chromeCallback(); + + return; +} + +/* Register listeners with Chrome */ +chrome.certificateProvider.onCertificatesRequested.addListener(cackeyListCertificates); +chrome.certificateProvider.onSignDigestRequested.addListener(cackeySignMessage);