Skip to content

Commit

Permalink
Change "message" to "data" from new sk-api.h
Browse files Browse the repository at this point in the history
  • Loading branch information
madaster97 committed Aug 9, 2022
1 parent 123ac4c commit 747b831
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/sk-api.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: sk-api.h,v 1.11 2020/09/09 03:08:01 djm Exp $ */
/* $OpenBSD: sk-api.h,v 1.14 2021/11/02 22:56:40 djm Exp $ */
/*
* Copyright (c) 2019 Google LLC
*
Expand Down Expand Up @@ -39,6 +39,7 @@
#define SSH_SK_ERR_DEVICE_NOT_FOUND -4

struct sk_enroll_response {
uint8_t flags;
uint8_t *public_key;
size_t public_key_len;
uint8_t *key_handle;
Expand Down Expand Up @@ -66,6 +67,8 @@ struct sk_resident_key {
char *application;
struct sk_enroll_response key;
uint8_t flags;
uint8_t *user_id;
size_t user_id_len;
};

struct sk_option {
Expand All @@ -86,7 +89,7 @@ int sk_enroll(uint32_t alg, const uint8_t *challenge, size_t challenge_len,
struct sk_option **options, struct sk_enroll_response **enroll_response);

/* Sign a challenge */
int sk_sign(uint32_t alg, const uint8_t *message, size_t message_len,
int sk_sign(uint32_t alg, const uint8_t *data, size_t data_len,
const char *application, const uint8_t *key_handle, size_t key_handle_len,
uint8_t flags, const char *pin, struct sk_option **options,
struct sk_sign_response **sign_response);
Expand All @@ -95,4 +98,4 @@ int sk_sign(uint32_t alg, const uint8_t *message, size_t message_len,
int sk_load_resident_keys(const char *pin, struct sk_option **options,
struct sk_resident_key ***rks, size_t *nrks);

#endif /* _SK_API_H */
#endif /* _SK_API_H */
4 changes: 2 additions & 2 deletions src/winhello.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ static int pack_sig(uint32_t alg, BYTE *sign, size_t len, struct sk_sign_respons
}

/* Sign a challenge */
int sk_sign(uint32_t alg, const uint8_t *message, size_t message_len, const char *application, const uint8_t *key_handle, size_t key_handle_len, uint8_t flags, const char *pin, struct sk_option **options, struct sk_sign_response **sign_response)
int sk_sign(uint32_t alg, const uint8_t *data, size_t data_len, const char *application, const uint8_t *key_handle, size_t key_handle_len, uint8_t flags, const char *pin, struct sk_option **options, struct sk_sign_response **sign_response)
{
struct sk_sign_response *response = NULL;
int ret = SSH_SK_ERR_GENERAL;
Expand Down Expand Up @@ -515,7 +515,7 @@ int sk_sign(uint32_t alg, const uint8_t *message, size_t message_len, const char
goto out;
}

WEBAUTHN_CLIENT_DATA WebAuthNClientData = {WEBAUTHN_CLIENT_DATA_CURRENT_VERSION, message_len, (uint8_t *)message, WEBAUTHN_HASH_ALGORITHM_SHA_256};
WEBAUTHN_CLIENT_DATA WebAuthNClientData = {WEBAUTHN_CLIENT_DATA_CURRENT_VERSION, data_len, (uint8_t *)data, WEBAUTHN_HASH_ALGORITHM_SHA_256};

BOOL pbU2fAppId = FALSE;
WEBAUTHN_CREDENTIAL credential = {WEBAUTHN_CREDENTIAL_CURRENT_VERSION, key_handle_len, (uint8_t *)key_handle, WEBAUTHN_CREDENTIAL_TYPE_PUBLIC_KEY};
Expand Down

0 comments on commit 747b831

Please sign in to comment.