NaCl libpcsc

Check-in [3dc3a3b281]
Login
Overview
SHA1:3dc3a3b2818eae0c8b3470a4142d243bd85ae526
Date: 2016-04-14 02:28:56
User: rkeene
Comment:More work towards something possibly usable one day
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-04-14
02:45
[179983e00b] Added an install target and an empty javascript file for now (user: rkeene, tags: trunk)
02:28
[3dc3a3b281] More work towards something possibly usable one day (user: rkeene, tags: trunk)
00:54
[6d016db860] We now build a mostly complete libpcsc.a, though with no way to initialize it (since we have not discovered how to do that in this release of Google's code yet (user: rkeene, tags: trunk)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified Makefile from [5d97a5aa96] to [d47cbcccc4].

    19     19   
    20     20   ## Set some CFLAGS that the compiler fails to internally set
    21     21   CFLAGS       := -I${NACL_SDK_ROOT}/include
    22     22   CXXFLAGS     := $(CFLAGS)
    23     23   CPPFLAGS     := $(CFLAGS)
    24     24   export CFLAGS CXXFLAGS CPPFLAGS
    25     25   
    26         -all: libpcsc.a
           26  +all: libpcsc.a libpcsc.h libpcsc.js
    27     27   
    28         -libpcsc.a: pcsc/Makefile pcsc/pcsc-nacl.h pcsc/pcsc_nacl_init.cc $(shell find pcsc/src -type f) boost
           28  +libpcsc.a: pcsc/Makefile pcsc/pcsc_nacl_init.cc $(shell find pcsc/src -type f) boost
    29     29   	$(MAKE) -C pcsc BOOST_DIR='$(shell pwd)/boost'
    30     30   	cp pcsc/libpcsc.a libpcsc.a.new
    31     31   	mv libpcsc.a.new libpcsc.a
    32     32   
           33  +libpcsc.h: pcsc/libpcsc.h
           34  +	cp pcsc/libpcsc.h libpcsc.h.new
           35  +	mv libpcsc.h.new libpcsc.h
           36  +
           37  +libpcsc.js: pcsc/libpcsc.js
           38  +	cp pcsc/libpcsc.js libpcsc.js.new
           39  +	mv libpcsc.js.new libpcsc.js
           40  +
    33     41   boost: build-boost
    34     42   	rm -rf boost
    35     43   	./build-boost
    36     44   
    37     45   clean:
    38     46   	$(MAKE) -C pcsc clean
    39         -	rm -f libpcsc.a
    40         -	rm -f libpcsc.a.new
           47  +	rm -f libpcsc.a libpcsc.a.new
           48  +	rm -f libpcsc.h libpcsc.h.new
           49  +	rm -f libpcsc.js libpcsc.js.new
    41     50   	rm -rf workdir-*
    42     51   	rm -rf boost.new
    43     52   
    44     53   distclean: clean
    45     54   	rm -rf boost
    46     55   	$(MAKE) -C pcsc distclean
    47     56   
    48     57   mrproper: distclean
    49     58   	rm -rf pcsc/src
    50     59   
    51     60   .PHONY: all

Added archive/google-chrome-smart-card-apps-20160317-nobinaries.zip version [8fad5c5ada].

cannot compute difference between binary files

Modified pcsc/Makefile from [9eb3eea2a6] to [9b3e7f9baf].

     1      1   BOOST_DIR := /usr/include/boost
     2      2   CFLAGS    += -Wall -std=gnu11 -g3 -ggdb3
     3      3   CXXFLAGS  += -Wall -std=gnu++11 -g3 -ggdb3
     4      4   CPPFLAGS  += -Isrc/include/PCSC -isystem $(BOOST_DIR)/include -Isrc -isystem $(NACL_SDK_ROOT)/include
     5      5   
     6         -OBJS += 
     7         -# pcsc_nacl_init.o
            6  +OBJS += pcsc_nacl_init.o
     8      7   
     9      8   all: libpcsc.a
    10      9   
    11     10   include Makefile.deps
    12     11   
    13     12   libpcsc.a: $(OBJS)
    14     13   	rm -f libpcsc.a

Name change from pcsc/pcsc-nacl.h to pcsc/libpcsc.h.


Modified pcsc/pcsc_nacl_init.cc from [683a161fcd] to [f3e792cf0d].

     1      1   #include <ppapi/cpp/core.h>
     2      2   #include <ppapi/cpp/instance.h>
     3         -
     4         -#include <unistd.h>
            3  +#include "global.h"
     5      4   
     6         -#include "pcsc_nacl_global.h"
     7         -#include "dom_requests_manager.h"
     8         -#include "pcsc_nacl.h"
     9         -
    10         -static DomRequestsManager *pcscNaClDRM = NULL;
            5  +static google_smart_card::TypedMessageRouter tmr;
    11      6   
    12      7   void pcscNaClInit(pp::Instance *instance, pp::Core *core, const char *smartcardManagerAppId, const char *clientId) {
    13         -	DomRequestsManager::PpDelegateImpl *drmDelegateImpl;
    14         -	PcscNacl *pcsc_nacl;
    15         -
    16         -	if (smartcardManagerAppId == NULL) {
    17         -		smartcardManagerAppId = "khpfeaanjngmcnplbdlpegiifgpfgdco";
    18         -	}
    19         -
    20         -	if (clientId == NULL) {
    21         -		clientId = "UNKNOWN";
    22         -	}
    23         -
    24         -	if (pcscNaClDRM == NULL) {
    25         -		drmDelegateImpl = new DomRequestsManager::PpDelegateImpl(instance, core);
    26         -	
    27         -		pcscNaClDRM = new DomRequestsManager("pcsc-nacl", drmDelegateImpl);
    28         -	}
    29         -
    30         -	pcsc_nacl = new PcscNacl(pcscNaClDRM, smartcardManagerAppId, clientId);
    31         -
    32         -	if (!pcsc_nacl->Initialize()) {
    33         -		return;
    34         -	}
    35         -
    36         -	SetPcscNaclGlobalInstance(pcsc_nacl);
            8  +	new google_smart_card::PcscLiteOverRequesterGlobal(&tmr, instance, core);
    37      9   
    38     10   	return;
           11  +
           12  +	/* UNREACH: These are no longer used */
           13  +	smartcardManagerAppId = smartcardManagerAppId;
           14  +	clientId = clientId;
    39     15   }
    40     16   
    41     17   bool pcscNaClHandleMessage(const pp::Var &message) {
    42         -	return(pcscNaClDRM->HandleMessage(message));
           18  +	return(tmr.OnMessageReceived(message));
    43     19   }