| 425 |
int method = SSH_AUTH_PASSWORD; |
int method = SSH_AUTH_PASSWORD; |
| 426 |
char FAR *password = |
char FAR *password = |
| 427 |
alloc_control_text(GetDlgItem(dlg, IDC_SSHPASSWORD)); |
alloc_control_text(GetDlgItem(dlg, IDC_SSHPASSWORD)); |
| 428 |
CRYPTKeyPair FAR *key_pair = NULL; |
Key *key_pair = NULL; |
| 429 |
|
|
| 430 |
if (IsDlgButtonChecked(dlg, IDC_SSHUSERSA)) { |
if (IsDlgButtonChecked(dlg, IDC_SSHUSERSA)) { |
| 431 |
method = SSH_AUTH_RSA; |
method = SSH_AUTH_RSA; |
| 1436 |
destroy_malloced_string(&pvar->auth_state.cur_cred.password); |
destroy_malloced_string(&pvar->auth_state.cur_cred.password); |
| 1437 |
destroy_malloced_string(&pvar->auth_state.cur_cred.rhosts_client_user); |
destroy_malloced_string(&pvar->auth_state.cur_cred.rhosts_client_user); |
| 1438 |
if (pvar->auth_state.cur_cred.key_pair != NULL) { |
if (pvar->auth_state.cur_cred.key_pair != NULL) { |
| 1439 |
CRYPT_free_key_pair(pvar->auth_state.cur_cred.key_pair); |
key_free(pvar->auth_state.cur_cred.key_pair); |
| 1440 |
pvar->auth_state.cur_cred.key_pair = NULL; |
pvar->auth_state.cur_cred.key_pair = NULL; |
| 1441 |
} |
} |
| 1442 |
} |
} |
| 1443 |
|
|
| 1444 |
static char FAR *get_auth_method_name(SSHAuthMethod auth) |
static const char *get_auth_method_name(SSHAuthMethod auth) |
| 1445 |
{ |
{ |
| 1446 |
switch (auth) { |
switch (auth) { |
| 1447 |
case SSH_AUTH_PASSWORD: |
case SSH_AUTH_PASSWORD: |
| 1463 |
|
|
| 1464 |
void AUTH_get_auth_info(PTInstVar pvar, char FAR * dest, int len) |
void AUTH_get_auth_info(PTInstVar pvar, char FAR * dest, int len) |
| 1465 |
{ |
{ |
| 1466 |
char *method = "unknown"; |
const char *method = "unknown"; |
| 1467 |
|
|
| 1468 |
if (pvar->auth_state.user == NULL) { |
if (pvar->auth_state.user == NULL) { |
| 1469 |
strncpy_s(dest, len, "None", _TRUNCATE); |
strncpy_s(dest, len, "None", _TRUNCATE); |
| 1490 |
|
|
| 1491 |
} else { |
} else { |
| 1492 |
if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) { |
if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) { |
| 1493 |
if (pvar->auth_state.cur_cred.key_pair->RSA_key != NULL) { |
method = key_type(pvar->auth_state.cur_cred.key_pair); |
|
method = "RSA"; |
|
|
} else if (pvar->auth_state.cur_cred.key_pair->DSA_key != NULL) { |
|
|
method = "DSA"; |
|
|
} |
|
| 1494 |
} |
} |
| 1495 |
else if (pvar->auth_state.cur_cred.method == SSH_AUTH_PAGEANT) { |
else if (pvar->auth_state.cur_cred.method == SSH_AUTH_PAGEANT) { |
| 1496 |
int len = get_uint32_MSBfirst(pvar->pageant_curkey + 4); |
int len = get_uint32_MSBfirst(pvar->pageant_curkey + 4); |
| 1497 |
char *s = (char *)malloc(len+1); |
char *s = (char *)malloc(len+1); |
| 1498 |
enum hostkey_type keytype; |
enum ssh_keytype keytype; |
| 1499 |
|
|
| 1500 |
memcpy(s, pvar->pageant_curkey+4+4, len); |
memcpy(s, pvar->pageant_curkey+4+4, len); |
| 1501 |
s[len] = '\0'; |
s[len] = '\0'; |