Diff

Differences From Artifact [7c0a1742a0]:

To Artifact [7e2a70b757]:


9
10
11
12
13
14
15



16
17
18
19
20
21
22
#include <ppapi/cpp/instance.h>
#include <ppapi/cpp/module.h>
#include <ppapi/cpp/core.h>
#include <ppapi/cpp/var.h>
#include <ppapi/cpp/var_dictionary.h>
#include <ppapi/cpp/var_array.h>
#include <ppapi/cpp/var_array_buffer.h>




#include "pcsc-nacl.h"
#include "cackey-chrome.h"

class CACKeyInstance : public pp::Instance {
	private:
		pp::Core *corePointer;







>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <ppapi/cpp/instance.h>
#include <ppapi/cpp/module.h>
#include <ppapi/cpp/core.h>
#include <ppapi/cpp/var.h>
#include <ppapi/cpp/var_dictionary.h>
#include <ppapi/cpp/var_array.h>
#include <ppapi/cpp/var_array_buffer.h>

#include <string.h>
#include <stdlib.h>

#include "pcsc-nacl.h"
#include "cackey-chrome.h"

class CACKeyInstance : public pp::Instance {
	private:
		pp::Core *corePointer;
50
51
52
53
54
55
56
57
58
59
60


61
62
63
64
65
66
67
			/*
			 * Do the thing we are being asked to do
			 */
			reply = new pp::VarDictionary();

			if (command.AsString() == "init") {
				if (message->HasKey("smartcardManagerAppId")) {
					smartcardManagerAppId = message->Get("smartcardManagerAppId").AsString().c_str();
				}

				pcscNaClInit(this, corePointer, smartcardManagerAppId, "CACKey");



				reply->Set("status", "success");
			} else if (command.AsString() == "listcertificates") {
				numCertificates = cackey_chrome_listCertificates(&certificates);

				certificatesPPArray.SetLength(numCertificates);








|



>
>







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
			/*
			 * Do the thing we are being asked to do
			 */
			reply = new pp::VarDictionary();

			if (command.AsString() == "init") {
				if (message->HasKey("smartcardManagerAppId")) {
					smartcardManagerAppId = strdup(message->Get("smartcardManagerAppId").AsString().c_str());
				}

				pcscNaClInit(this, corePointer, smartcardManagerAppId, "CACKey");

				free((void *) smartcardManagerAppId);

				reply->Set("status", "success");
			} else if (command.AsString() == "listcertificates") {
				numCertificates = cackey_chrome_listCertificates(&certificates);

				certificatesPPArray.SetLength(numCertificates);