83 lines
2.8 KiB
Diff
83 lines
2.8 KiB
Diff
--- u2f-server/core.c 2018-01-04 09:21:38.000000000 -0500
|
|
+++ u2f-server/core.c 2020-05-31 11:24:48.986906605 -0400
|
|
@@ -32,6 +32,7 @@
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
#include <json.h>
|
|
+#include <stdbool.h>
|
|
#include "crypto.h"
|
|
#include "b64/cencode.h"
|
|
#include "b64/cdecode.h"
|
|
@@ -41,7 +42,7 @@
|
|
#define u2fs_json_object_object_get(obj, key, value) json_object_object_get_ex(obj, key, &value)
|
|
#else
|
|
typedef int json_bool;
|
|
-#define u2fs_json_object_object_get(obj, key, value) (value = json_object_object_get(obj, key)) == NULL ? (json_bool)FALSE : (json_bool)TRUE
|
|
+#define u2fs_json_object_object_get(obj, key, value) (value = json_object_object_get(obj, key)) == NULL ? (json_bool)false : (json_bool)true
|
|
#endif
|
|
|
|
static u2fs_rc encode_b64u(const char *data, size_t data_len, char *output)
|
|
@@ -477,7 +478,7 @@
|
|
if (jo == NULL)
|
|
return U2FS_JSON_ERROR;
|
|
|
|
- if (u2fs_json_object_object_get(jo, "challenge", k) == FALSE)
|
|
+ if (u2fs_json_object_object_get(jo, "challenge", k) == false)
|
|
return U2FS_JSON_ERROR;
|
|
|
|
p = json_object_get_string(k);
|
|
@@ -488,7 +489,7 @@
|
|
if (*challenge == NULL)
|
|
return U2FS_MEMORY_ERROR;
|
|
|
|
- if (u2fs_json_object_object_get(jo, "origin", k) == FALSE)
|
|
+ if (u2fs_json_object_object_get(jo, "origin", k) == false)
|
|
return U2FS_JSON_ERROR;
|
|
|
|
p = json_object_get_string(k);
|
|
@@ -520,7 +521,7 @@
|
|
if (jo == NULL)
|
|
return U2FS_JSON_ERROR;
|
|
|
|
- if (u2fs_json_object_object_get(jo, "registrationData", k) == FALSE)
|
|
+ if (u2fs_json_object_object_get(jo, "registrationData", k) == false)
|
|
return U2FS_JSON_ERROR;
|
|
p = json_object_get_string(k);
|
|
if (p == NULL)
|
|
@@ -529,7 +530,7 @@
|
|
if (*registrationData == NULL)
|
|
return U2FS_MEMORY_ERROR;
|
|
|
|
- if (u2fs_json_object_object_get(jo, "clientData", k) == FALSE)
|
|
+ if (u2fs_json_object_object_get(jo, "clientData", k) == false)
|
|
return U2FS_JSON_ERROR;
|
|
p = json_object_get_string(k);
|
|
if (p == NULL)
|
|
@@ -1125,7 +1126,7 @@
|
|
if (jo == NULL)
|
|
return U2FS_JSON_ERROR;
|
|
|
|
- if (u2fs_json_object_object_get(jo, "signatureData", k) == FALSE)
|
|
+ if (u2fs_json_object_object_get(jo, "signatureData", k) == false)
|
|
return U2FS_JSON_ERROR;
|
|
p = json_object_get_string(k);
|
|
if (p == NULL)
|
|
@@ -1134,7 +1135,7 @@
|
|
if (*signatureData == NULL)
|
|
return U2FS_MEMORY_ERROR;
|
|
|
|
- if (u2fs_json_object_object_get(jo, "clientData", k) == FALSE)
|
|
+ if (u2fs_json_object_object_get(jo, "clientData", k) == false)
|
|
return U2FS_JSON_ERROR;
|
|
p = json_object_get_string(k);
|
|
if (p == NULL)
|
|
@@ -1143,7 +1144,7 @@
|
|
if (*clientData == NULL)
|
|
return U2FS_MEMORY_ERROR;
|
|
|
|
- if (u2fs_json_object_object_get(jo, "keyHandle", k) == FALSE)
|
|
+ if (u2fs_json_object_object_get(jo, "keyHandle", k) == false)
|
|
return U2FS_JSON_ERROR;
|
|
p = json_object_get_string(k);
|
|
if (p == NULL)
|