summaryrefslogtreecommitdiff
path: root/libfprint/fp-sdcp-device-private.h
blob: 249c33c92066d0daef8b90a6c4e44a812c715f72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * FpSdcpDevice - A base class for SDCP enabled devices
 * Copyright (C) 2020 Benjamin Berg <bberg@redhat.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#pragma once

#include "fpi-sdcp-device.h"

#include <nss.h>
#include <keyhi.h>
#include <keythi.h>
#include <pk11pub.h>

typedef struct
{
  GError *enroll_pre_commit_error;

  /* XXX: Do we want a separate SDCP session object?
   */

  GPtrArray *intermediate_cas;

  /* Host random for the connection */
  guint8            host_random[32];

  NSSInitContext   *nss_init_context;
  PK11SlotInfo     *slot;
  SECKEYPrivateKey *host_key_private;
  SECKEYPublicKey  *host_key_public;

  /* Master secret is required for reconnects.
   * TODO: We probably want to serialize this to disk so it can survive
   *       fprintd idle shutdown. */
  PK11SymKey *master_secret;
  PK11SymKey *mac_secret;

} FpSdcpDevicePrivate;

void fpi_sdcp_device_connect (FpSdcpDevice *self);
void fpi_sdcp_device_reconnect (FpSdcpDevice *self);

void fpi_sdcp_device_enroll (FpSdcpDevice *self);
void fpi_sdcp_device_identify (FpSdcpDevice *self);