mirror of
https://github.com/clearml/dropbear
synced 2025-05-14 00:30:39 +00:00
rename PubkeyList to SignKeyList for clarity
--HG-- extra : convert_revision : 838e354daf3ae9a1dce710526c37fec9859ee6d1
This commit is contained in:
parent
109b87d2a3
commit
fb1fd7f6f4
2
TODO
2
TODO
@ -2,6 +2,8 @@ Current:
|
|||||||
|
|
||||||
Things which might need doing:
|
Things which might need doing:
|
||||||
|
|
||||||
|
- default private dbclient keys
|
||||||
|
|
||||||
- Make options.h generated from configure perhaps?
|
- Make options.h generated from configure perhaps?
|
||||||
|
|
||||||
- Improved queueing of unauthed connections
|
- Improved queueing of unauthed connections
|
||||||
|
8
auth.h
8
auth.h
@ -84,13 +84,13 @@ struct AuthState {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PubkeyList;
|
struct SignKeyList;
|
||||||
/* A singly linked list of pubkeys */
|
/* A singly linked list of signing keys */
|
||||||
struct PubkeyList {
|
struct SignKeyList {
|
||||||
|
|
||||||
sign_key *key;
|
sign_key *key;
|
||||||
int type; /* The type of key */
|
int type; /* The type of key */
|
||||||
struct PubkeyList *next;
|
struct SignKeyList *next;
|
||||||
/* filename? or the buffer? for encrypted keys, so we can later get
|
/* filename? or the buffer? for encrypted keys, so we can later get
|
||||||
* the private key portion */
|
* the private key portion */
|
||||||
|
|
||||||
|
@ -38,29 +38,29 @@ static void send_msg_userauth_pubkey(sign_key *key, int type, int realsign);
|
|||||||
* We use it to remove the key we tried from the list */
|
* We use it to remove the key we tried from the list */
|
||||||
void cli_pubkeyfail() {
|
void cli_pubkeyfail() {
|
||||||
|
|
||||||
struct PubkeyList *keyitem;
|
struct SignKeyList *keyitem;
|
||||||
struct PubkeyList **previtem;
|
struct SignKeyList **previtem;
|
||||||
|
|
||||||
TRACE(("enter cli_pubkeyfail"))
|
TRACE(("enter cli_pubkeyfail"))
|
||||||
previtem = &cli_opts.pubkeys;
|
previtem = &cli_opts.privkeys;
|
||||||
|
|
||||||
/* Find the key we failed with, and remove it */
|
/* Find the key we failed with, and remove it */
|
||||||
for (keyitem = cli_opts.pubkeys; keyitem != NULL; keyitem = keyitem->next) {
|
for (keyitem = cli_opts.privkeys; keyitem != NULL; keyitem = keyitem->next) {
|
||||||
if (keyitem == cli_ses.lastpubkey) {
|
if (keyitem == cli_ses.lastprivkey) {
|
||||||
*previtem = keyitem->next;
|
*previtem = keyitem->next;
|
||||||
}
|
}
|
||||||
previtem = &keyitem;
|
previtem = &keyitem;
|
||||||
}
|
}
|
||||||
|
|
||||||
sign_key_free(cli_ses.lastpubkey->key); /* It won't be used again */
|
sign_key_free(cli_ses.lastprivkey->key); /* It won't be used again */
|
||||||
m_free(cli_ses.lastpubkey);
|
m_free(cli_ses.lastprivkey);
|
||||||
|
|
||||||
TRACE(("leave cli_pubkeyfail"))
|
TRACE(("leave cli_pubkeyfail"))
|
||||||
}
|
}
|
||||||
|
|
||||||
void recv_msg_userauth_pk_ok() {
|
void recv_msg_userauth_pk_ok() {
|
||||||
|
|
||||||
struct PubkeyList *keyitem;
|
struct SignKeyList *keyitem;
|
||||||
buffer* keybuf;
|
buffer* keybuf;
|
||||||
char* algotype = NULL;
|
char* algotype = NULL;
|
||||||
unsigned int algolen;
|
unsigned int algolen;
|
||||||
@ -80,7 +80,7 @@ void recv_msg_userauth_pk_ok() {
|
|||||||
|
|
||||||
/* Iterate through our keys, find which one it was that matched, and
|
/* Iterate through our keys, find which one it was that matched, and
|
||||||
* send a real request with that key */
|
* send a real request with that key */
|
||||||
for (keyitem = cli_opts.pubkeys; keyitem != NULL; keyitem = keyitem->next) {
|
for (keyitem = cli_opts.privkeys; keyitem != NULL; keyitem = keyitem->next) {
|
||||||
|
|
||||||
if (keyitem->type != keytype) {
|
if (keyitem->type != keytype) {
|
||||||
/* Types differed */
|
/* Types differed */
|
||||||
@ -172,11 +172,11 @@ int cli_auth_pubkey() {
|
|||||||
|
|
||||||
TRACE(("enter cli_auth_pubkey"))
|
TRACE(("enter cli_auth_pubkey"))
|
||||||
|
|
||||||
if (cli_opts.pubkeys != NULL) {
|
if (cli_opts.privkeys != NULL) {
|
||||||
/* Send a trial request */
|
/* Send a trial request */
|
||||||
send_msg_userauth_pubkey(cli_opts.pubkeys->key,
|
send_msg_userauth_pubkey(cli_opts.privkeys->key,
|
||||||
cli_opts.pubkeys->type, 0);
|
cli_opts.privkeys->type, 0);
|
||||||
cli_ses.lastpubkey = cli_opts.pubkeys;
|
cli_ses.lastprivkey = cli_opts.privkeys;
|
||||||
TRACE(("leave cli_auth_pubkey-success"))
|
TRACE(("leave cli_auth_pubkey-success"))
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -89,7 +89,7 @@ void cli_getopts(int argc, char ** argv) {
|
|||||||
cli_opts.cmd = NULL;
|
cli_opts.cmd = NULL;
|
||||||
cli_opts.wantpty = 9; /* 9 means "it hasn't been touched", gets set later */
|
cli_opts.wantpty = 9; /* 9 means "it hasn't been touched", gets set later */
|
||||||
#ifdef ENABLE_CLI_PUBKEY_AUTH
|
#ifdef ENABLE_CLI_PUBKEY_AUTH
|
||||||
cli_opts.pubkeys = NULL;
|
cli_opts.privkeys = NULL;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_CLI_LOCALTCPFWD
|
#ifdef ENABLE_CLI_LOCALTCPFWD
|
||||||
cli_opts.localfwds = NULL;
|
cli_opts.localfwds = NULL;
|
||||||
@ -271,7 +271,7 @@ void cli_getopts(int argc, char ** argv) {
|
|||||||
#ifdef ENABLE_CLI_PUBKEY_AUTH
|
#ifdef ENABLE_CLI_PUBKEY_AUTH
|
||||||
static void loadidentityfile(const char* filename) {
|
static void loadidentityfile(const char* filename) {
|
||||||
|
|
||||||
struct PubkeyList * nextkey;
|
struct SignKeyList * nextkey;
|
||||||
sign_key *key;
|
sign_key *key;
|
||||||
int keytype;
|
int keytype;
|
||||||
|
|
||||||
@ -284,11 +284,11 @@ static void loadidentityfile(const char* filename) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
nextkey = (struct PubkeyList*)m_malloc(sizeof(struct PubkeyList));
|
nextkey = (struct SignKeyList*)m_malloc(sizeof(struct SignKeyList));
|
||||||
nextkey->key = key;
|
nextkey->key = key;
|
||||||
nextkey->next = cli_opts.pubkeys;
|
nextkey->next = cli_opts.privkeys;
|
||||||
nextkey->type = keytype;
|
nextkey->type = keytype;
|
||||||
cli_opts.pubkeys = nextkey;
|
cli_opts.privkeys = nextkey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -126,7 +126,7 @@ static void cli_session_init() {
|
|||||||
specific exit status */
|
specific exit status */
|
||||||
|
|
||||||
/* Auth */
|
/* Auth */
|
||||||
cli_ses.lastpubkey = NULL;
|
cli_ses.lastprivkey = NULL;
|
||||||
cli_ses.lastauthtype = 0;
|
cli_ses.lastauthtype = 0;
|
||||||
|
|
||||||
/* For printing "remote host closed" for the user */
|
/* For printing "remote host closed" for the user */
|
||||||
|
@ -95,7 +95,7 @@ typedef struct cli_runopts {
|
|||||||
char *cmd;
|
char *cmd;
|
||||||
int wantpty;
|
int wantpty;
|
||||||
#ifdef ENABLE_CLI_PUBKEY_AUTH
|
#ifdef ENABLE_CLI_PUBKEY_AUTH
|
||||||
struct PubkeyList *pubkeys; /* Keys to use for public-key auth */
|
struct SignKeyList *privkeys; /* Keys to use for public-key auth */
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_CLI_REMOTETCPFWD
|
#ifdef ENABLE_CLI_REMOTETCPFWD
|
||||||
struct TCPFwdList * remotefwds;
|
struct TCPFwdList * remotefwds;
|
||||||
|
@ -211,7 +211,6 @@ struct clientsession {
|
|||||||
mp_int *dh_e, *dh_x; /* Used during KEX */
|
mp_int *dh_e, *dh_x; /* Used during KEX */
|
||||||
cli_kex_state kex_state; /* Used for progressing KEX */
|
cli_kex_state kex_state; /* Used for progressing KEX */
|
||||||
cli_state state; /* Used to progress auth/channelsession etc */
|
cli_state state; /* Used to progress auth/channelsession etc */
|
||||||
int something; /* XXX */
|
|
||||||
unsigned donefirstkex : 1; /* Set when we set sentnewkeys, never reset */
|
unsigned donefirstkex : 1; /* Set when we set sentnewkeys, never reset */
|
||||||
|
|
||||||
int tty_raw_mode; /* Whether we're in raw mode (and have to clean up) */
|
int tty_raw_mode; /* Whether we're in raw mode (and have to clean up) */
|
||||||
@ -227,7 +226,7 @@ struct clientsession {
|
|||||||
|
|
||||||
int lastauthtype; /* either AUTH_TYPE_PUBKEY or AUTH_TYPE_PASSWORD,
|
int lastauthtype; /* either AUTH_TYPE_PUBKEY or AUTH_TYPE_PASSWORD,
|
||||||
for the last type of auth we tried */
|
for the last type of auth we tried */
|
||||||
struct PubkeyList *lastpubkey;
|
struct SignKeyList *lastprivkey;
|
||||||
|
|
||||||
int retval; /* What the command exit status was - we emulate it */
|
int retval; /* What the command exit status was - we emulate it */
|
||||||
#if 0
|
#if 0
|
||||||
|
Loading…
Reference in New Issue
Block a user