| Top |
| GError * | fpi_sdcp_error_new_msg () |
| gboolean | fpi_sdcp_generate_host_key () |
| GBytes * | fpi_sdcp_generate_random () |
| gboolean | fpi_sdcp_verify_certificate () |
| GBytes * | fpi_sdcp_verify_connect () |
| gboolean | fpi_sdcp_verify_reconnect () |
| gboolean | fpi_sdcp_verify_identify () |
| GBytes * | fpi_sdcp_generate_enrollment_id () |
| GBytes * | fpi_sdcp_mac () |
GError * fpi_sdcp_error_new_msg (FpDeviceError error_code,const gchar *format,...);
Creates a new GError in the FP_DEVICE_ERROR domain with the given error_code
.
If there is a pending OpenSSL error, its string representation is appended to
format
; the OpenSSL error stack is drained unconditionally.
error_code |
The FpDeviceError code for the new error |
|
format |
A printf-style format string for the error message |
|
... |
Format arguments |
gboolean fpi_sdcp_generate_host_key (GBytes **private_key,GBytes **public_key,GError **error);
Function to generate a new ephemeral ECDH key pair for use with SDCP.
private_key |
The host private key (sk_h). |
[out][transfer full] |
public_key |
The host public key (pk_h). |
[out][transfer full] |
error |
GError in case the out values are |
[out] |
gboolean fpi_sdcp_verify_certificate (GBytes *x509_certificate,GResource *additional_ca_store,FpiDeviceSdcpVerificationFlags verification_flags,GError **error);
Verifies an X.509 certificate (DER-encoded) against the SDCP trust store.
x509_certificate |
An X.509 certificate in DER (ASN.1) format |
|
additional_ca_store |
An optional GResource containing
additional PEM certificates at the path |
[nullable] |
verification_flags |
Flags to control certificate verification behaviour. See FpiDeviceSdcpVerificationFlags for details. |
|
error |
GError on failure. |
[out] |
GBytes * fpi_sdcp_verify_connect (GBytes *host_private_key,GBytes *host_random,GBytes *device_random,FpiSdcpClaim *claim,GBytes *mac,GResource *additional_ca_store,FpiDeviceSdcpVerificationFlags verification_flags,GError **error);
High level function which internally handles the derivation of all necessary
SDCP-related keys and secrets from the device's ConnectResponse and derives
the application secret for use with all other SDCP-related functions.
The KDF and MAC labels used during key derivation are taken from the
claim
label fields; NULL fields fall back to the FPI_SDCP_DEFAULT_LABEL_*
constants.
This function will also perform a validation of the ConnectResponse MAC and
optionally perform additional verifications based on the provided
verification_flags
.
If any of these these validations fail then NULL will be returned,
indicating that the SDCP secure connection channel could not be established.
host_private_key |
Private key generated using |
|
host_random |
Random generated using |
|
device_random |
The random provided in the device's ConnectResponse (r_d) |
|
claim |
FpiSdcpClaim provided in the device's ConnectResponse (c) |
|
mac |
The MAC provided in the device's ConnectResponse (m) |
|
additional_ca_store |
An optional GResource containing additional
PEM certificates at the path |
[nullable] |
verification_flags |
Flags to control which verifications should be performed during the ConnectResponse validation. See FpiDeviceSdcpVerificationFlags for details. |
|
error |
GError in case the return value is |
[out] |
A new GBytes with the derived application secret
(s) of length FPI_SDCP_APPLICATION_SECRET_SIZE, or NULL on failure.
gboolean fpi_sdcp_verify_reconnect (GBytes *application_secret,const gchar *label,GBytes *random,GBytes *mac,GError **error);
Verifies the SDCP ReconnectResponse.
application_secret |
The host's derived application secret (s) |
|
label |
HMAC label, or |
|
random |
The host-generated random sent to the device's Reconnect command (r) |
|
mac |
The MAC provided in the device's ReconnectResponse (m) |
|
error |
GError in case the return value is |
[out] |
gboolean fpi_sdcp_verify_identify (GBytes *application_secret,const gchar *label,GBytes *nonce,GBytes *id,GBytes *mac,GError **error);
Verifies the SDCP AuthorizedIdentity.
application_secret |
The host's derived application secret (s) |
|
label |
HMAC label, or |
|
nonce |
The host-generated nonce sent to the device's Identify command (n) |
|
id |
The ID provided in the device's AuthorizedIdentity (id) |
|
mac |
The MAC provided in the device's AuthorizedIdentity (m) |
|
error |
GError in case the return value is |
[out] |
GBytes * fpi_sdcp_generate_enrollment_id (GBytes *application_secret,const gchar *label,GBytes *nonce,GError **error);
Generates a new id for use with the device's EnrollCommit command.
application_secret |
The host's derived application secret (s) |
|
label |
HMAC label, or |
|
nonce |
The nonce received from the device in response to the EnrollBegin command (n) |
|
error |
GError in case the return value is |
[out] |
GBytes * fpi_sdcp_mac (GBytes *application_secret,const gchar *label,GBytes *data_a,GBytes *data_b,GError **error);
Computes HMAC-SHA256(application_secret
, label
|| data_a
|| data_b
).
application_secret |
The application secret to use as the HMAC key |
|
label |
Label string (included with a trailing NUL byte), or |
|
data_a |
First data buffer, or |
|
data_b |
Second data buffer, or |
|
error |
GError in case the return value is |
[out] |