NaCl libpcsc

Check-in [3dc3a3b281]
Login

Check-in [3dc3a3b281]

Overview
Comment:More work towards something possibly usable one day
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3dc3a3b2818eae0c8b3470a4142d243bd85ae526
User & Date: rkeene on 2016-04-14 02:28:56
Other Links: manifest | tags
Context
2016-04-14
02:45
Added an install target and an empty javascript file for now check-in: 179983e00b user: rkeene tags: trunk
02:28
More work towards something possibly usable one day check-in: 3dc3a3b281 user: rkeene tags: trunk
00:54
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 check-in: 6d016db860 user: rkeene tags: trunk
Changes

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

19
20
21
22
23
24
25
26
27
28
29
30
31
32








33
34
35
36
37
38
39
40

41
42
43
44
45
46
47

## Set some CFLAGS that the compiler fails to internally set
CFLAGS       := -I${NACL_SDK_ROOT}/include
CXXFLAGS     := $(CFLAGS)
CPPFLAGS     := $(CFLAGS)
export CFLAGS CXXFLAGS CPPFLAGS

all: libpcsc.a

libpcsc.a: pcsc/Makefile pcsc/pcsc-nacl.h pcsc/pcsc_nacl_init.cc $(shell find pcsc/src -type f) boost
	$(MAKE) -C pcsc BOOST_DIR='$(shell pwd)/boost'
	cp pcsc/libpcsc.a libpcsc.a.new
	mv libpcsc.a.new libpcsc.a









boost: build-boost
	rm -rf boost
	./build-boost

clean:
	$(MAKE) -C pcsc clean
	rm -f libpcsc.a
	rm -f libpcsc.a.new

	rm -rf workdir-*
	rm -rf boost.new

distclean: clean
	rm -rf boost
	$(MAKE) -C pcsc distclean








|

|




>
>
>
>
>
>
>
>






|
|
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

## Set some CFLAGS that the compiler fails to internally set
CFLAGS       := -I${NACL_SDK_ROOT}/include
CXXFLAGS     := $(CFLAGS)
CPPFLAGS     := $(CFLAGS)
export CFLAGS CXXFLAGS CPPFLAGS

all: libpcsc.a libpcsc.h libpcsc.js

libpcsc.a: pcsc/Makefile pcsc/pcsc_nacl_init.cc $(shell find pcsc/src -type f) boost
	$(MAKE) -C pcsc BOOST_DIR='$(shell pwd)/boost'
	cp pcsc/libpcsc.a libpcsc.a.new
	mv libpcsc.a.new libpcsc.a

libpcsc.h: pcsc/libpcsc.h
	cp pcsc/libpcsc.h libpcsc.h.new
	mv libpcsc.h.new libpcsc.h

libpcsc.js: pcsc/libpcsc.js
	cp pcsc/libpcsc.js libpcsc.js.new
	mv libpcsc.js.new libpcsc.js

boost: build-boost
	rm -rf boost
	./build-boost

clean:
	$(MAKE) -C pcsc clean
	rm -f libpcsc.a libpcsc.a.new
	rm -f libpcsc.h libpcsc.h.new
	rm -f libpcsc.js libpcsc.js.new
	rm -rf workdir-*
	rm -rf boost.new

distclean: clean
	rm -rf boost
	$(MAKE) -C pcsc distclean

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
2
3
4
5
6
7
8
9
10
11
12
13
14
BOOST_DIR := /usr/include/boost
CFLAGS    += -Wall -std=gnu11 -g3 -ggdb3
CXXFLAGS  += -Wall -std=gnu++11 -g3 -ggdb3
CPPFLAGS  += -Isrc/include/PCSC -isystem $(BOOST_DIR)/include -Isrc -isystem $(NACL_SDK_ROOT)/include

OBJS += 
# pcsc_nacl_init.o

all: libpcsc.a

include Makefile.deps

libpcsc.a: $(OBJS)
	rm -f libpcsc.a





<
|







1
2
3
4
5

6
7
8
9
10
11
12
13
BOOST_DIR := /usr/include/boost
CFLAGS    += -Wall -std=gnu11 -g3 -ggdb3
CXXFLAGS  += -Wall -std=gnu++11 -g3 -ggdb3
CPPFLAGS  += -Isrc/include/PCSC -isystem $(BOOST_DIR)/include -Isrc -isystem $(NACL_SDK_ROOT)/include


OBJS += pcsc_nacl_init.o

all: libpcsc.a

include Makefile.deps

libpcsc.a: $(OBJS)
	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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

39
40
41
42
43
#include <ppapi/cpp/core.h>
#include <ppapi/cpp/instance.h>

#include <unistd.h>

#include "pcsc_nacl_global.h"
#include "dom_requests_manager.h"
#include "pcsc_nacl.h"

static DomRequestsManager *pcscNaClDRM = NULL;

void pcscNaClInit(pp::Instance *instance, pp::Core *core, const char *smartcardManagerAppId, const char *clientId) {
	DomRequestsManager::PpDelegateImpl *drmDelegateImpl;
	PcscNacl *pcsc_nacl;

	if (smartcardManagerAppId == NULL) {
		smartcardManagerAppId = "khpfeaanjngmcnplbdlpegiifgpfgdco";
	}

	if (clientId == NULL) {
		clientId = "UNKNOWN";
	}

	if (pcscNaClDRM == NULL) {
		drmDelegateImpl = new DomRequestsManager::PpDelegateImpl(instance, core);
	
		pcscNaClDRM = new DomRequestsManager("pcsc-nacl", drmDelegateImpl);
	}

	pcsc_nacl = new PcscNacl(pcscNaClDRM, smartcardManagerAppId, clientId);

	if (!pcsc_nacl->Initialize()) {
		return;
	}

	SetPcscNaclGlobalInstance(pcsc_nacl);

	return;

}

bool pcscNaClHandleMessage(const pp::Var &message) {
	return(pcscNaClDRM->HandleMessage(message));
}


<
<
<
<
<
|

|


<
<
|
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
|
<
|
<
>



|

1
2





3
4
5
6
7


8


9














10
11
12

13

14
15
16
17
18
19
#include <ppapi/cpp/core.h>
#include <ppapi/cpp/instance.h>





#include "global.h"

static google_smart_card::TypedMessageRouter tmr;

void pcscNaClInit(pp::Instance *instance, pp::Core *core, const char *smartcardManagerAppId, const char *clientId) {


	new google_smart_card::PcscLiteOverRequesterGlobal(&tmr, instance, core);

















	return;

	/* UNREACH: These are no longer used */

	smartcardManagerAppId = smartcardManagerAppId;

	clientId = clientId;
}

bool pcscNaClHandleMessage(const pp::Var &message) {
	return(tmr.OnMessageReceived(message));
}