Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/auth.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4304 by maya, Mon Feb 14 09:09:07 2011 UTC revision 4307 by maya, Tue Feb 15 09:00:01 2011 UTC
# Line 425  static BOOL end_auth_dlg(PTInstVar pvar, Line 425  static BOOL end_auth_dlg(PTInstVar pvar,
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;
# Line 1436  void AUTH_destroy_cur_cred(PTInstVar pva Line 1436  void AUTH_destroy_cur_cred(PTInstVar pva
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:
# Line 1463  static char FAR *get_auth_method_name(SS Line 1463  static char FAR *get_auth_method_name(SS
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);
# Line 1490  void AUTH_get_auth_info(PTInstVar pvar, Line 1490  void AUTH_get_auth_info(PTInstVar pvar,
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';

Legend:
Removed from v.4304  
changed lines
  Added in v.4307

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26