Check-in [1a6c58edd1]
Overview
SHA1:1a6c58edd1323c85a5116bd6f6f6252e0ecb85d0
Date: 2016-02-28 22:37:40
User: rkeene
Edited Comment: ChromeOS: Added basic UI page that shows certificates
Original Comment: Added basic UI page that shows certificates
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-02-29
04:32
[833f48f854] ChromeOS: Added certificate usage information to bare UI (user: rkeene, tags: trunk)
2016-02-28
22:37
[1a6c58edd1] ChromeOS: Added basic UI page that shows certificates (user: rkeene, tags: trunk)
22:12
[bdb2e8cfb1] ChromeOS: Delayed PCSC initialization even further until we receieved positive confirmation that initialization completed (user: rkeene, tags: trunk)
Changes

Modified .fossil-settings/ignore-glob from [4b8f0a7c61] to [3575c07556].

    30     30   build/chrome/cackey.pexe
    31     31   build/chrome/cackey.bc
    32     32   build/chrome/cackey.nmf
    33     33   build/chrome/cackey.zip
    34     34   build/chrome/test
    35     35   build/chrome/google-pcsc.js
    36     36   build/chrome/manifest.json
           37  +build/chrome/jsrsasign.js

Modified build/chrome/Makefile from [477397fafe] to [7468d6c1f8].

    28     28   ifeq (,${NACL_SDK_ROOT})
    29     29   $(error "Please set NACL_SDK_ROOT")
    30     30   endif
    31     31   export NACL_SDK_ROOT
    32     32   
    33     33   all: cackey.zip
    34     34   
    35         -cackey.zip: $(CACKEY_EXECUTABLES) cackey.nmf manifest.json cackey.js google-pcsc.js pin.html pin.js pin-icon.png icon.png ui.html
           35  +cackey.zip: $(CACKEY_EXECUTABLES) cackey.nmf manifest.json cackey.js google-pcsc.js pin.html pin.js pin-icon.png icon.png ui.html ui.js jsrsasign.js
    36     36   	rm -f cackey.zip
    37     37   	zip cackey.zip.new $^
    38     38   	mv cackey.zip.new cackey.zip
    39     39   
    40     40   cackey.bc: cackey-chrome-pkcs11.o cackey-chrome-plugin.o lib/libcackey.a lib/libpcsc.a lib/libz.a
    41     41   	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o cackey.bc.new cackey-chrome-pkcs11.o cackey-chrome-plugin.o $(LIBS)
    42     42   	mv cackey.bc.new cackey.bc
................................................................................
    85     85   	mv include/PCSC/pcsc-nacl.h.new include/PCSC/pcsc-nacl.h
    86     86   
    87     87   manifest.json: manifest.json.in ../../configure.ac
    88     88   	rm -f manifest.json.new
    89     89   	sed 's/@PACKAGE_VERSION@/$(shell sed '/^AC_INIT/ {s@.*, @@;s@[^0-9\.].@@g;p};d' ../../configure.ac)/g' manifest.json.in > manifest.json.new
    90     90   	mv manifest.json.new manifest.json
    91     91   
           92  +jsrsasign.js:
           93  +	wget --no-check-certificate -O jsrsasign.js.new 'https://github.com/kjur/jsrsasign/raw/2989e2cdc29219f5fb1743dffd9cee93b7090832/jsrsasign-latest-all-min.js'
           94  +	test "`openssl sha256 jsrsasign.js.new | sed 's@.*= *@@'`" = '99b041bccc846f03623ce52f5932bd3ff282a064e7077a4ad1c600fc70c1176b'
           95  +	mv jsrsasign.js.new jsrsasign.js
           96  +
    92     97   test: cackey-chrome-pkcs11.c cackey-chrome-test.c ../../cackey.c Makefile
    93     98   	gcc -g3 -ggdb3 -Wall -I. -I../../pkcs11 -I/opt/appfs/core.appfs.rkeene.org/zlib/platform/latest/include -I/opt/appfs/rkeene.org/pcsc-lite/platform/latest/include/PCSC -DHAVE_WINTYPES_H=1 -DHAVE_PCSCLITE_H=1 -DHAVE_WINSCARD_H=1 -DHAVE_STDINT_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_PTHREAD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_STDIO_H=1 -DHAVE_ZLIB_H -DHAVE_LIBZ -DCACKEY_DEBUG=1 -o test cackey-chrome-pkcs11.c cackey-chrome-test.c ../../cackey.c -L/opt/appfs/core.appfs.rkeene.org/zlib/platform/latest/lib -lz -L/opt/appfs/rkeene.org/pcsc-lite/platform/latest/lib -lpcsclite -L/opt/appfs/core.appfs.rkeene.org/glibc/platform/latest/lib -lc -lpthread -Wl,-R,/opt/appfs/core.appfs.rkeene.org/zlib/platform/latest/lib -Wl,-R,/opt/appfs/rkeene.org/pcsc-lite/platform/latest/lib -Wl,-R,/opt/appfs/core.appfs.rkeene.org/glibc/platform/latest/lib -Wl,-dynamic-linker,/opt/appfs/core.appfs.rkeene.org/glibc/platform/latest/lib/ld-linux-x86-64.so.2
    94     99   
    95    100   cackey-chrome-pkcs11.o: cackey-chrome-pkcs11.c cackey-chrome.h
    96    101   cackey-chrome-plugin.o: cackey-chrome-plugin.cc cackey-chrome.h include/PCSC/pcsc-nacl.h
    97    102   
    98    103   clean:
................................................................................
   106    111   	rm -f lib/libcackey.a lib/libpcsc.a lib/libz.a
   107    112   	-rmdir lib
   108    113   	rm -f include/PCSC/pcsc-nacl.h
   109    114   	-rmdir include/PCSC
   110    115   	-rmdir include
   111    116   	rm -f google-pcsc.js
   112    117   	rm -rf workdir-*
          118  +	rm -f jsrsasign.js jsrsasign.js.new
   113    119   
   114    120   .PHONY: all clean distclean

Modified build/chrome/ui.html from [b2f6c09e6c] to [22195d78ea].

     1      1   <html>
     2      2   	<head>
     3      3   		<title>CACKey</title>
            4  +		<script type="text/javascript" src="jsrsasign.js"></script>
            5  +		<script type="text/javascript" src="ui.js"></script>
     4      6   	</head>
     5      7   	<body>
     6      8   		<h1>CACKey for Chrome</h1>
     7         -		<div>Currently there is no UI for this application</div>
     8         -		<div>
     9         -			CACKey provides certificates to Chrome without further
    10         -			user interaction.  You may have to open the "Smartcard
    11         -			Manager App" or "Smartcard Connector" application and
    12         -			select an appropriate USB smartcard reader.
    13         -		</div>
            9  +		<div>Certificates: <span id="certificates"></span></div>
    14     10   	</body>
    15     11   </html>

Added build/chrome/ui.js version [f3ee58ea69].

            1  +var globalCerts = null;
            2  +
            3  +function displayCerts(htmlObject, certs) {
            4  +	var html = "";
            5  +	var idx;
            6  +	var cert;
            7  +	var certObj;
            8  +
            9  +	certObj = new X509;
           10  +
           11  +	html += "<ol>";
           12  +
           13  +	for (idx = 0; idx < certs.length; idx++) {
           14  +		cert = certs[idx];
           15  +
           16  +		certObj.hex = BAtohex(new Uint8Array(cert.certificate));
           17  +
           18  +		html += "\t<li>" + certObj.getSubjectString() + "</li>";
           19  +	}
           20  +
           21  +	html += "</ol>";
           22  +
           23  +	delete certObj;
           24  +
           25  +	htmlObject.innerHTML = html;
           26  +}
           27  +function updateCertificates(htmlObject) {
           28  +	var html = "";
           29  +
           30  +	if (globalCerts == null) {
           31  +		htmlObject.innerHTML = "<i>Updating...</i>";
           32  +	} else {
           33  +		displayCerts(htmlObject, globalCerts);
           34  +	}
           35  +
           36  +	parentWindow.cackeyListCertificates(function(certs) {
           37  +		globalCerts = certs;
           38  +
           39  +		displayCerts(htmlObject, certs);
           40  +	});
           41  +
           42  +	return;
           43  +}
           44  +
           45  +setTimeout(function() {
           46  +	updateCertificates(document.getElementById('certificates'));
           47  +}, 1);