[BACK]Return to auth2.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/auth2.c between version 1.1 and 1.2

version 1.1, 2000/04/26 21:28:32 version 1.2, 2000/04/27 08:01:25
Line 237 
Line 237 
         }          }
         pkblob = packet_get_string(&blen);          pkblob = packet_get_string(&blen);
         key = dsa_key_from_blob(pkblob, blen);          key = dsa_key_from_blob(pkblob, blen);
           if (key != NULL) {
         if (have_sig && key != NULL) {                  if (have_sig) {
                 sig = packet_get_string(&slen);                          sig = packet_get_string(&slen);
                 packet_done();                          packet_done();
                 buffer_init(&b);                          buffer_init(&b);
                 buffer_append(&b, session_id2, session_id2_len);                          buffer_append(&b, session_id2, session_id2_len);
                 buffer_put_char(&b, SSH2_MSG_USERAUTH_REQUEST);                          buffer_put_char(&b, SSH2_MSG_USERAUTH_REQUEST);
                 if (slen + 4 > rlen)                          if (slen + 4 > rlen)
                         fatal("bad rlen/slen");                                  fatal("bad rlen/slen");
                 buffer_append(&b, raw, rlen - slen - 4);                          buffer_append(&b, raw, rlen - slen - 4);
 #ifdef DEBUG_DSS  #ifdef DEBUG_DSS
                 buffer_dump(&b);                          buffer_dump(&b);
 #endif  #endif
                 /* test for correct signature */                          /* test for correct signature */
                 if (user_dsa_key_allowed(pw, key) &&                          if (user_dsa_key_allowed(pw, key) &&
                     dsa_verify(key, sig, slen, buffer_ptr(&b), buffer_len(&b)) == 1)                              dsa_verify(key, sig, slen, buffer_ptr(&b), buffer_len(&b)) == 1)
                         authenticated = 1;                                  authenticated = 1;
                 buffer_clear(&b);                          buffer_clear(&b);
                 xfree(sig);                          xfree(sig);
         } else if (!have_sig && key != NULL) {                  } else {
                 packet_done();                          packet_done();
                 debug("test key...");                          debug("test key...");
                 /* test whether pkalg/pkblob are acceptable */                          /* test whether pkalg/pkblob are acceptable */
                 /* XXX fake reply and always send PK_OK ? */                          /* XXX fake reply and always send PK_OK ? */
                 if (user_dsa_key_allowed(pw, key)) {                          if (user_dsa_key_allowed(pw, key)) {
                         packet_start(SSH2_MSG_USERAUTH_PK_OK);                                  packet_start(SSH2_MSG_USERAUTH_PK_OK);
                         packet_put_string(pkalg, alen);                                  packet_put_string(pkalg, alen);
                         packet_put_string(pkblob, blen);                                  packet_put_string(pkblob, blen);
                         packet_send();                                  packet_send();
                         packet_write_wait();                                  packet_write_wait();
                         authenticated = -1;                                  authenticated = -1;
                           }
                 }                  }
                   key_free(key);
         }          }
         xfree(pkalg);          xfree(pkalg);
         xfree(pkblob);          xfree(pkblob);

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2