Frågar efter pin på skärmen trots att man använder handelsbankens läsare med knappar
Uppgradera opensc till 0.12.x eller redigera /etc/opensc.conf och sätt enable_pinpad = true;
enable_pinpad = true;
Här är kod som jag klippte direkt ur debug-fönstret (indenteringen flög någon annanstans), på rad 46 - 53 sätts inte NexusUtils._isExist för att x-personal-signer saknas, och på rad 54-59 sätts inre NexusUtils._isExist410 för att NexusUtils._isExist ej är satt. Jag har ingen överblick över koden, så jag har ingen koll på de konsekvenser de får.
1 var GeneralUtil = {
2 isMSIE: function() {
3 return navigator.appName.indexOf("Explorer") != -1;
4 },
5
6 spCheck: function() {
7 var str = navigator.appMinorVersion.toLowerCase();
8 return str.charAt(str.indexOf('sp') + 2);
9 },
10
11 setCookie: function(name, value, expires, path, secure)
12 {
13 var domain = location.hostname;
14 var pos = domain.lastIndexOf('.');
15 if(pos != -1) {
16 pos = domain.lastIndexOf('.', pos - 1);
17 }
18 if(pos != -1) {
19 domain = domain.substring(pos);
20 }
21 document.cookie = name + "=" + escape(value) +
22 ((expires) ? "; expires=" + expires : "") +
23 ((path) ? "; path=" + path : "") +
24 ((domain) ? "; domain=" + domain : "") +
25 ((secure) ? "; secure" : "");
26 }
27};
28
29var NexusUtil = {
30 _isInit: false,
31 _isExist: false,
32 _isExist410: false,
33
34 _exist: function() {
35 if(GeneralUtil.isMSIE()) {
36 try {
37 NexusUtil._isExist =
38 typeof(new ActiveXObject("Nexus.VersionCtl")) !== 'undefined' &&
39 typeof(new ActiveXObject("Nexus.SignerCtl")) !== 'undefined';
40 NexusUtil._isExist410 =
41 NexusUtil._isExist &&
42 typeof(new ActiveXObject("Nexus.AuthenticationCtl")) !== 'undefined' &&
43 typeof(new ActiveXObject("Nexus.SignerV2Ctl")) !== 'undefined';
44 } catch(e) {}
45 } else {
46 NexusUtil._isExist =
47 navigator.plugins &&
48 navigator.plugins.length > 0 &&
49 navigator.mimeTypes &&
50 navigator.mimeTypes["application/x-personal-version"] &&
51 navigator.mimeTypes["application/x-personal-version"].enabledPlugin &&
52 navigator.mimeTypes["application/x-personal-signer"] &&
53 navigator.mimeTypes["application/x-personal-signer"].enabledPlugin;
54 NexusUtil._isExist410 =
55 NexusUtil._isExist &&
56 navigator.mimeTypes["application/x-personal-authentication"] &&
57 navigator.mimeTypes["application/x-personal-authentication"].enabledPlugin &&
58 navigator.mimeTypes["application/x-personal-signer2"] &&
59 navigator.mimeTypes["application/x-personal-signer2"].enabledPlugin;
60 }
61 },
62
63 _init: function() {
64 if(NexusUtil._isInit) {
65 return;
66 }
67 NexusUtil._exist();
68 if(NexusUtil._isExist) {
69 var html = '';
70 if((GeneralUtil.isMSIE())) {
71 html += "<OBJECT id='NexusPluginVersion' CLASSID='CLSID:E5C324CC-4029-43CA-8D57-4A10480B9016'></OBJECT>";
72 html += "<OBJECT id='NexusPluginSigner1' CLASSID='CLSID:6969E7D5-223A-4982-9B79-CC4FAC2D5E5E'></OBJECT>";
73 if(NexusUtil._isExist410) {
74 html += "<OBJECT ID='NexusPluginAuth' CLASSID='CLSID:DD137900-E4D7-4b86-92CC-2E968F846047'></OBJECT>";
75 html += "<OBJECT ID='NexusPluginSigner2' CLASSID='CLSID:FB25B6FD-2119-4CEF-A915-A056184C565E'></OBJECT>";
76 }
77 } else {
78 html += "<OBJECT DECLARE id='NexusPluginVersion' type='application/x-personal-version' length=0 height=0></OBJECT>";
79 html += "<OBJECT DECLARE id='NexusPluginSigner1' type='application/x-personal-signer' length=0 height=0></OBJECT>";
80 if(NexusUtil._isExist410) {
81 html += "<OBJECT DECLARE id='NexusPluginAuth' type='application/x-personal-authentication' length=0 height=0></OBJECT>";
82 html += "<OBJECT DECLARE id='NexusPluginSigner2' type='application/x-personal-signer2'></OBJECT>";
83 }
84 }
85 document.getElementById('NexusPluginHolder').innerHTML = html;
86 }
87 NexusUtil.isInit = true;
88 },
89
90 getVersion: function() {
91 NexusUtil._init();
92 if(NexusUtil._isExist) {
93 try {
94 var ver = document.getElementById('NexusPluginVersion').GetVersion();
95 ver = ver.toLowerCase();
96 var start = ver.indexOf('personal=');
97 if(start != -1) {
98 start += 9;
99 var end = ver.indexOf('&', start);
100 if(end == -1) {
101 end = ver.length;
102 }
103 return ver.substring(start, end);
104 }
105 } catch(e) {
106 return 'UNK';
107 }
108 } else {
109 return 'UNK';
110 }
111 }
112};
113
114var PreLogonUtil = {
115 init: function() {
116 },
117
118 _setCookies: function(forceVer) {
119 var ver = forceVer;
120 if(ver === undefined) {
121 ver = NexusUtil.getVersion();
122 }
123 var jvm = navigator.javaEnabled()?'true':'false';
124 var sp = GeneralUtil.isMSIE()?GeneralUtil.spCheck():'';
125 GeneralUtil.setCookie('HB_info', jvm + ';' + sp + ';' + ver, '', '/', true);
126 if((null != location.href.match(/^[0-9A-Za-z|:|&|\.|\?|\/|=]+$/)) && (null != location.href.match(/id=/))) {
127 GeneralUtil.setCookie('prelogonurl', location.href, '', '/', true);
128 }
129 if(/handelsbanken.com$/i.test(location.hostname)) {
130 var cnty = location.href.match(/logoffsite=../i);
131 if(cnty) {
132 cnty = ('' + cnty).substring(11).toLowerCase();
133 if(/dk|fi|no|at|ee|fr|de|lv|lt|cn|us|pl|lu|nl|ch/.test(cnty)) {
134 GeneralUtil.setCookie('HB_Country', 'www.handelsbanken.' + cnty, '', '/', false);
135 } else if(/uk/.test(cnty)) {
136 GeneralUtil.setCookie('HB_Country', 'www.handelsbanken.co.' + cnty, '', '/', false);
137 } else if(/sg|hk/.test(cnty)) {
138 GeneralUtil.setCookie('HB_Country', 'www.svenskahandelsbanken.com.' + cnty, '', '/', false);
139 } else if(/ru/.test(cnty)) {
140 GeneralUtil.setCookie('HB_Country', 'www.svenskahandelsbanken.' + cnty, '', '/', false);
141 }
142 }
143 }
144 },
145
146 doLogon: function(type, url, isOpen) {
147 if(isOpen) {
148 if(type == 'otp') {
149 PreLogonUtil._setCookies('USID');
150 } else if(type == 'cap') {
151 PreLogonUtil._setCookies('CAP');
152 } else {
153 PreLogonUtil._setCookies(undefined);
154 }
155 html = '<form id="postform" method="post" action="' + url + '">';
156 if(window.origReq !== undefined) {
157 html += '<input type="hidden" name="orig" value = "' + origReq + '"/>';
158 html += '<input type="hidden" name="origHash" value = "' + origReqHash + '"/>';
159 }
160 html += '</form>';
161 document.getElementById('postformdiv').innerHTML = html;
162 document.getElementById('postform').submit();
163 } else {
164 PreLogonUtil.modalShow(TEXTS['CloseForLogonTitle'], TEXTS['CloseForLogonContent'], true, '');
165 }
166 },
167
168 doCms: function(url) {
169 if(doCmsNewWin) {
170 window.open(url).focus();
171 } else {
172 window.location.href = url;
173 }
174 },
175
176
177 _modalActionOnCancel: '',
178
179 _modalIsActive: function() {
180 return document.getElementById('lrmodal').style.visibility === 'visible';
181 },
182
183 modalShow: function(title, text, showCancel, actionOnCancel)
184 {
185 PreLogonUtil.modalResizeOpacityLayer();
186 PreLogonUtil._modalActionOnCancel = actionOnCancel;
187 document.getElementById('modaltitle').innerHTML = title;
188 document.getElementById('modaltxt').innerHTML = text;
189 if(showCancel) {
190 document.getElementById('modalbtn').style.visibility = 'visible';
191 } else {
192 document.getElementById('modalbtn').style.visibility = 'hidden';
193 }
194 document.getElementById('lrmodal').style.visibility = 'visible';
195 document.getElementById('lropacity').style.visibility = 'visible';
196 },
197
198 modalHide: function() {
199 if(PreLogonUtil._modalActionOnCancel) {
200 eval(PreLogonUtil._modalActionOnCancel);
201 }
202 document.getElementById('lrmodal').style.visibility = 'hidden';
203 document.getElementById('lropacity').style.visibility = 'hidden';
204 document.getElementById('modalbtn').style.visibility = 'hidden';
205 },
206
207 modalResizeOpacityLayer: function() {
208 document.getElementById('lropacity').style.height = Math.max(450, document.body.clientHeight - 80);
209 }
210};