Major refactor on resident keys.
Now, credential ids have shorter and fixed length (40) to avoid issues with some servers, which have maximum credential id length constraints. Fixes #184 Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -58,6 +58,7 @@ typedef struct Credential {
|
||||
|
||||
#define CRED_PROTO_21_S "\xf1\xd0\x02\x01"
|
||||
#define CRED_PROTO_22_S "\xf1\xd0\x02\x02"
|
||||
#define CRED_PROTO_23_S "\xf1\xd0\x02\x03"
|
||||
|
||||
#define CRED_PROTO CRED_PROTO_22_S
|
||||
|
||||
@@ -66,6 +67,11 @@ typedef struct Credential {
|
||||
#define CRED_TAG_LEN 16
|
||||
#define CRED_SILENT_TAG_LEN 16
|
||||
|
||||
#define CRED_PROTO_RESIDENT CRED_PROTO_23_S
|
||||
#define CRED_PROTO_RESIDENT_LEN 4
|
||||
#define CRED_RESIDENT_HEADER_LEN (CRED_PROTO_RESIDENT_LEN + 4)
|
||||
#define CRED_RESIDENT_LEN (CRED_RESIDENT_HEADER_LEN + 32)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CRED_PROTO_21 = 0x01,
|
||||
@@ -94,5 +100,7 @@ extern int credential_derive_hmac_key(const uint8_t *cred_id, size_t cred_id_len
|
||||
extern int credential_derive_large_blob_key(const uint8_t *cred_id,
|
||||
size_t cred_id_len,
|
||||
uint8_t *outk);
|
||||
extern int credential_derive_resident(const uint8_t *cred_id, size_t cred_id_len, uint8_t *outk);
|
||||
extern bool credential_is_resident(const uint8_t *cred_id, size_t cred_id_len);
|
||||
|
||||
#endif // _CREDENTIAL_H_
|
||||
|
||||
Reference in New Issue
Block a user