Commit a7a8173c authored by Derek Konigsberg's avatar Derek Konigsberg

Add functions to expose fields contained within a scannable fingerprint

parent 2670a1d0
......@@ -549,6 +549,36 @@ complete:
return result;
}
uint32_t scannable_fingerprint_get_version(scannable_fingerprint *scannable)
{
assert(scannable);
return scannable->version;
}
const char *scannable_fingerprint_get_local_stable_identifier(scannable_fingerprint *scannable)
{
assert(scannable);
return scannable->local_stable_identifier;
}
ec_public_key *scannable_fingerprint_get_local_identity_key(scannable_fingerprint *scannable)
{
assert(scannable);
return scannable->local_identity_key;
}
const char *scannable_fingerprint_get_remote_stable_identifier(scannable_fingerprint *scannable)
{
assert(scannable);
return scannable->remote_stable_identifier;
}
ec_public_key *scannable_fingerprint_get_remote_identity_key(scannable_fingerprint *scannable)
{
assert(scannable);
return scannable->remote_identity_key;
}
int scannable_fingerprint_compare(scannable_fingerprint *scannable, const scannable_fingerprint *other_scannable)
{
if(!other_scannable->remote_identity_key || !other_scannable->local_identity_key ||
......
......@@ -60,6 +60,11 @@ int scannable_fingerprint_create(scannable_fingerprint **scannable,
int scannable_fingerprint_serialize(axolotl_buffer **buffer, const scannable_fingerprint *scannable);
int scannable_fingerprint_deserialize(scannable_fingerprint **scannable, const uint8_t *data, size_t len, axolotl_context *global_context);
uint32_t scannable_fingerprint_get_version(scannable_fingerprint *scannable);
const char *scannable_fingerprint_get_local_stable_identifier(scannable_fingerprint *scannable);
ec_public_key *scannable_fingerprint_get_local_identity_key(scannable_fingerprint *scannable);
const char *scannable_fingerprint_get_remote_stable_identifier(scannable_fingerprint *scannable);
ec_public_key *scannable_fingerprint_get_remote_identity_key(scannable_fingerprint *scannable);
/**
* Compare a scanned QR code with what we expect.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment