|
@@ -67,7 +67,7 @@ discard block |
|
|
block discarded – undo |
|
67
|
67
|
public function __construct($appId, $attestDir = null) |
|
68
|
68
|
{ |
|
69
|
69
|
if (OPENSSL_VERSION_NUMBER < 0x10000000) { |
|
70
|
|
- throw new U2fError('OpenSSL has to be at least version 1.0.0, this is ' . OPENSSL_VERSION_TEXT, U2fError::ERR_OLD_OPENSSL); |
|
|
70
|
+ throw new U2fError('OpenSSL has to be at least version 1.0.0, this is '.OPENSSL_VERSION_TEXT, U2fError::ERR_OLD_OPENSSL); |
|
71
|
71
|
} |
|
72
|
72
|
$this->appId = $appId; |
|
73
|
73
|
$this->attestDir = $attestDir; |
|
@@ -84,7 +84,7 @@ discard block |
|
|
block discarded – undo |
|
84
|
84
|
public function doRegister(RegisterRequestInterface $request, RegisterResponseInterface $response, $includeCert = true) |
|
85
|
85
|
{ |
|
86
|
86
|
if ($response->getErrorCode() !== null && $response->getErrorCode() !== 0) { |
|
87
|
|
- throw new U2fError('User-agent returned error. Error code: ' . $response->getErrorCode(), U2fError::ERR_BAD_UA_RETURNING); |
|
|
87
|
+ throw new U2fError('User-agent returned error. Error code: '.$response->getErrorCode(), U2fError::ERR_BAD_UA_RETURNING); |
|
88
|
88
|
} |
|
89
|
89
|
|
|
90
|
90
|
if (!is_bool($includeCert)) { |
|
@@ -167,7 +167,7 @@ discard block |
|
|
block discarded – undo |
|
167
|
167
|
public function doAuthenticate(array $requests, array $registrations, AuthenticationResponseInterface $response) |
|
168
|
168
|
{ |
|
169
|
169
|
if ($response->getErrorCode() != null) { |
|
170
|
|
- throw new U2fError('User-agent returned error. Error code: ' . $response->getErrorCode(), U2fError::ERR_BAD_UA_RETURNING); |
|
|
170
|
+ throw new U2fError('User-agent returned error. Error code: '.$response->getErrorCode(), U2fError::ERR_BAD_UA_RETURNING); |
|
171
|
171
|
} |
|
172
|
172
|
|
|
173
|
173
|
$clientData = $this->base64u_decode($response->getClientData()); |
|
@@ -287,7 +287,7 @@ discard block |
|
|
block discarded – undo |
|
287
|
287
|
*/ |
|
288
|
288
|
$der = "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01"; |
|
289
|
289
|
$der .= "\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42"; |
|
290
|
|
- $der .= "\0" . $key; |
|
|
290
|
+ $der .= "\0".$key; |
|
291
|
291
|
|
|
292
|
292
|
$pem = "-----BEGIN PUBLIC KEY-----\r\n"; |
|
293
|
293
|
$pem .= chunk_split(base64_encode($der), 64); |