mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
sdcp: uncrustify
This commit is contained in:
@@ -96,6 +96,7 @@ static void
|
||||
fpi_sdcp_device_fake_reconnect (FpSdcpDevice *sdcp_device)
|
||||
{
|
||||
FpiSdcpDeviceFake *fake_device = FPI_SDCP_DEVICE_FAKE (sdcp_device);
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GBytes) random = NULL;
|
||||
g_autoptr(GBytes) reconnect_mac = g_bytes_from_hex (reconnect_mac_hex);
|
||||
|
||||
@@ -19,12 +19,11 @@
|
||||
|
||||
#include "test-sdcp-utils.h"
|
||||
|
||||
static const guint8 from_hex_map[] =
|
||||
{
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, // 01234567
|
||||
0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 89:;<=>?
|
||||
0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, // @abcdef
|
||||
};
|
||||
static const guint8 from_hex_map[] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, // 01234567
|
||||
0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 89:;<=>?
|
||||
0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, // @abcdef
|
||||
};
|
||||
|
||||
GBytes *
|
||||
g_bytes_from_hex (const gchar *hex)
|
||||
@@ -36,9 +35,9 @@ g_bytes_from_hex (const gchar *hex)
|
||||
|
||||
for (int i = 0; i < strlen (hex) - 1; i += 2)
|
||||
{
|
||||
b0 = ((guint8)hex[i+0] & 0x1F) ^ 0x10;
|
||||
b1 = ((guint8)hex[i+1] & 0x1F) ^ 0x10;
|
||||
bytes[i/2] = (guint8)(from_hex_map[b0] << 4) | from_hex_map[b1];
|
||||
b0 = ((guint8) hex[i + 0] & 0x1F) ^ 0x10;
|
||||
b1 = ((guint8) hex[i + 1] & 0x1F) ^ 0x10;
|
||||
bytes[i / 2] = (guint8) (from_hex_map[b0] << 4) | from_hex_map[b1];
|
||||
}
|
||||
|
||||
res = g_bytes_new_take (bytes, bytes_len);
|
||||
@@ -50,6 +49,7 @@ FpiSdcpClaim *
|
||||
sdcp_test_claim (void)
|
||||
{
|
||||
FpiSdcpClaim *claim = g_new0 (FpiSdcpClaim, 1);
|
||||
|
||||
claim->model_certificate = g_bytes_from_hex (model_certificate_hex);
|
||||
claim->device_public_key = g_bytes_from_hex (device_public_key_hex);
|
||||
claim->firmware_public_key = g_bytes_from_hex (firmware_public_key_hex);
|
||||
|
||||
Reference in New Issue
Block a user