Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when DEBUG_SK is on and Unify variable names in sk part #225

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sk-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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 Down
6 changes: 5 additions & 1 deletion sk-usbhid.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,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 Down Expand Up @@ -990,6 +990,10 @@ sk_sign(uint32_t alg, const uint8_t *data, size_t datalen,
skdebug(__func__, "hash message failed");
goto out;
}
#ifdef DEBUG_SK
fprintf(stderr, "%s: hashed message:\n", __func__);
sshbuf_dump_data(message, sizeof(message), stderr);
#endif
if (device != NULL)
sk = sk_open(device);
else if (pin != NULL || (flags & SSH_SK_USER_VERIFICATION_REQD))
Expand Down
6 changes: 2 additions & 4 deletions ssh-sk.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct sshsk_provider {
struct sk_enroll_response **enroll_response);

/* Sign a challenge */
int (*sk_sign)(int alg, const uint8_t *message, size_t message_len,
int (*sk_sign)(int 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 **opts,
Expand All @@ -75,7 +75,7 @@ int ssh_sk_enroll(int alg, const uint8_t *challenge,
size_t challenge_len, const char *application, uint8_t flags,
const char *pin, struct sk_option **opts,
struct sk_enroll_response **enroll_response);
int ssh_sk_sign(int alg, const uint8_t *message, size_t message_len,
int ssh_sk_sign(int 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 **opts,
Expand Down Expand Up @@ -694,8 +694,6 @@ sshsk_sign(const char *provider_path, struct sshkey *key,
#ifdef DEBUG_SK
fprintf(stderr, "%s: sig_flags = 0x%02x, sig_counter = %u\n",
__func__, resp->flags, resp->counter);
fprintf(stderr, "%s: hashed message:\n", __func__);
sshbuf_dump_data(message, sizeof(message), stderr);
fprintf(stderr, "%s: sigbuf:\n", __func__);
sshbuf_dump(sig, stderr);
#endif
Expand Down