Browse Source
It was only used by handshake.c. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>json-streaming
Rusty Russell
6 years ago
committed by
Christian Decker
15 changed files with 34 additions and 76 deletions
@ -1,29 +0,0 @@ |
|||
#include <hsmd/client.h> |
|||
#include <hsmd/gen_hsm_client_wire.h> |
|||
#include <wire/wire_sync.h> |
|||
|
|||
static int hsm_fd = -1; |
|||
|
|||
void hsm_setup(int fd) |
|||
{ |
|||
hsm_fd = fd; |
|||
} |
|||
|
|||
bool hsm_do_ecdh(struct secret *ss, const struct pubkey *point) |
|||
{ |
|||
u8 *req = towire_hsm_ecdh_req(NULL, point), *resp; |
|||
|
|||
if (!wire_sync_write(hsm_fd, req)) |
|||
goto fail; |
|||
resp = wire_sync_read(req, hsm_fd); |
|||
if (!resp) |
|||
goto fail; |
|||
if (!fromwire_hsm_ecdh_resp(resp, ss)) |
|||
goto fail; |
|||
tal_free(req); |
|||
return true; |
|||
|
|||
fail: |
|||
tal_free(req); |
|||
return false; |
|||
} |
@ -1,17 +0,0 @@ |
|||
/* API to ask the HSM for things. */ |
|||
#ifndef LIGHTNING_HSMD_CLIENT_H |
|||
#define LIGHTNING_HSMD_CLIENT_H |
|||
#include "config.h" |
|||
#include <ccan/endian/endian.h> |
|||
#include <ccan/short_types/short_types.h> |
|||
#include <stdbool.h> |
|||
|
|||
struct pubkey; |
|||
struct secret; |
|||
|
|||
/* Setup communication to the HSM */ |
|||
void hsm_setup(int fd); |
|||
|
|||
/* Do ECDH using this node id secret. */ |
|||
bool hsm_do_ecdh(struct secret *ss, const struct pubkey *point); |
|||
#endif /* LIGHTNING_HSMD_CLIENT_H */ |
Loading…
Reference in new issue