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:
@@ -52,5 +52,6 @@ fp_dbg_hex_dump_gbytes (const gchar *log_domain,
|
||||
{
|
||||
gsize len = 0;
|
||||
const guint8 *buf = g_bytes_get_data (gbytes, &len);
|
||||
|
||||
fp_dbg_hex_dump_bytes (log_domain, buf, len);
|
||||
}
|
||||
|
||||
@@ -343,6 +343,7 @@ fpi_sdcp_device_open_complete (FpSdcpDevice *self,
|
||||
GError *error)
|
||||
{
|
||||
FpSdcpDeviceClass *cls = FP_SDCP_DEVICE_GET_CLASS (self);
|
||||
|
||||
g_autoptr(GBytes) application_secret = NULL;
|
||||
|
||||
if (!error)
|
||||
@@ -482,6 +483,7 @@ fpi_sdcp_device_connect_complete (FpSdcpDevice *self,
|
||||
{
|
||||
FpSdcpDevicePrivate *priv = fp_sdcp_device_get_instance_private (self);
|
||||
FpSdcpDeviceClass *cls = FP_SDCP_DEVICE_GET_CLASS (self);
|
||||
|
||||
g_autoptr(GBytes) application_secret = NULL;
|
||||
FpiDeviceAction action;
|
||||
|
||||
@@ -506,8 +508,8 @@ fpi_sdcp_device_connect_complete (FpSdcpDevice *self,
|
||||
}
|
||||
|
||||
if (!device_random || !claim || !mac ||
|
||||
(!claim->model_certificate || !claim->device_public_key || !claim->firmware_public_key
|
||||
|| !claim->firmware_hash || !claim->model_signature || !claim->device_signature))
|
||||
(!claim->model_certificate || !claim->device_public_key || !claim->firmware_public_key ||
|
||||
!claim->firmware_hash || !claim->model_signature || !claim->device_signature))
|
||||
{
|
||||
fp_dbg ("Driver did not provide all required information to callback; returning error instead.");
|
||||
g_clear_pointer (&device_random, g_bytes_unref);
|
||||
@@ -563,6 +565,7 @@ fpi_sdcp_device_reconnect_complete (FpSdcpDevice *self,
|
||||
GError *error)
|
||||
{
|
||||
FpSdcpDevicePrivate *priv = fp_sdcp_device_get_instance_private (self);
|
||||
|
||||
g_autoptr(GBytes) application_secret = NULL;
|
||||
FpiDeviceAction action;
|
||||
|
||||
@@ -687,6 +690,7 @@ fpi_sdcp_device_enroll_commit (FpSdcpDevice *self,
|
||||
GError *error)
|
||||
{
|
||||
FpSdcpDeviceClass *cls = FP_SDCP_DEVICE_GET_CLASS (self);
|
||||
|
||||
g_autoptr(GBytes) application_secret = NULL;
|
||||
GBytes *id = NULL;
|
||||
FpPrint *print;
|
||||
@@ -804,6 +808,7 @@ fpi_sdcp_device_identify_complete (FpSdcpDevice *self,
|
||||
GError *error)
|
||||
{
|
||||
FpSdcpDevicePrivate *priv = fp_sdcp_device_get_instance_private (self);
|
||||
|
||||
g_autoptr(GBytes) application_secret = NULL;
|
||||
FpPrint *identified_print;
|
||||
FpiDeviceAction action;
|
||||
@@ -822,8 +827,8 @@ fpi_sdcp_device_identify_complete (FpSdcpDevice *self,
|
||||
}
|
||||
|
||||
/* No error and no valid id/mac provided means that there was no match from the device */
|
||||
if (!id || !mac || g_bytes_get_size (id) != SDCP_ENROLLMENT_ID_SIZE
|
||||
|| g_bytes_get_size (mac) != SDCP_MAC_SIZE)
|
||||
if (!id || !mac || g_bytes_get_size (id) != SDCP_ENROLLMENT_ID_SIZE ||
|
||||
g_bytes_get_size (mac) != SDCP_MAC_SIZE)
|
||||
{
|
||||
g_clear_pointer (&priv->identify_nonce, g_bytes_unref);
|
||||
if (action == FPI_DEVICE_ACTION_VERIFY)
|
||||
|
||||
@@ -44,6 +44,7 @@ static void
|
||||
print_openssl_errors (void)
|
||||
{
|
||||
gulong e = 0;
|
||||
|
||||
e = ERR_get_error ();
|
||||
while (e != 0)
|
||||
{
|
||||
@@ -90,16 +91,20 @@ fpi_sdcp_verify_signature (EVP_PKEY *pkey,
|
||||
goto out_error;
|
||||
|
||||
if (data_a)
|
||||
{
|
||||
if (!EVP_DigestVerifyUpdate (mdctx,
|
||||
g_bytes_get_data (data_a, NULL),
|
||||
g_bytes_get_size (data_a)))
|
||||
goto out_error;
|
||||
}
|
||||
|
||||
if (data_b)
|
||||
{
|
||||
if (!EVP_DigestVerifyUpdate (mdctx,
|
||||
g_bytes_get_data (data_b, NULL),
|
||||
g_bytes_get_size (data_b)))
|
||||
goto out_error;
|
||||
}
|
||||
|
||||
if (!EVP_DigestVerifyUpdate (mdctx,
|
||||
g_bytes_get_data (signature, NULL),
|
||||
|
||||
@@ -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,8 +19,7 @@
|
||||
|
||||
#include "test-sdcp-utils.h"
|
||||
|
||||
static const guint8 from_hex_map[] =
|
||||
{
|
||||
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
|
||||
@@ -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