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

Diff for /src/usr.bin/ssh/monitor_wrap.c between version 1.5.2.2 and 1.5.2.3

version 1.5.2.2, 2002/05/18 04:50:38 version 1.5.2.3, 2002/06/26 15:30:38
Line 65 
Line 65 
         u_char buf[5];          u_char buf[5];
         u_int mlen = buffer_len(m);          u_int mlen = buffer_len(m);
   
         debug3("%s entering: type %d", __FUNCTION__, type);          debug3("%s entering: type %d", __func__, type);
   
         PUT_32BIT(buf, mlen + 1);          PUT_32BIT(buf, mlen + 1);
         buf[4] = (u_char) type;         /* 1st byte of payload is mesg-type */          buf[4] = (u_char) type;         /* 1st byte of payload is mesg-type */
         if (atomicio(write, socket, buf, sizeof(buf)) != sizeof(buf))          if (atomicio(write, socket, buf, sizeof(buf)) != sizeof(buf))
                 fatal("%s: write", __FUNCTION__);                  fatal("%s: write", __func__);
         if (atomicio(write, socket, buffer_ptr(m), mlen) != mlen)          if (atomicio(write, socket, buffer_ptr(m), mlen) != mlen)
                 fatal("%s: write", __FUNCTION__);                  fatal("%s: write", __func__);
 }  }
   
 void  void
Line 82 
Line 82 
         ssize_t res;          ssize_t res;
         u_int msg_len;          u_int msg_len;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         res = atomicio(read, socket, buf, sizeof(buf));          res = atomicio(read, socket, buf, sizeof(buf));
         if (res != sizeof(buf)) {          if (res != sizeof(buf)) {
                 if (res == 0)                  if (res == 0)
                         fatal_cleanup();                          fatal_cleanup();
                 fatal("%s: read: %ld", __FUNCTION__, (long)res);                  fatal("%s: read: %ld", __func__, (long)res);
         }          }
         msg_len = GET_32BIT(buf);          msg_len = GET_32BIT(buf);
         if (msg_len > 256 * 1024)          if (msg_len > 256 * 1024)
                 fatal("%s: read: bad msg_len %d", __FUNCTION__, msg_len);                  fatal("%s: read: bad msg_len %d", __func__, msg_len);
         buffer_clear(m);          buffer_clear(m);
         buffer_append_space(m, msg_len);          buffer_append_space(m, msg_len);
         res = atomicio(read, socket, buffer_ptr(m), msg_len);          res = atomicio(read, socket, buffer_ptr(m), msg_len);
         if (res != msg_len)          if (res != msg_len)
                 fatal("%s: read: %ld != msg_len", __FUNCTION__, (long)res);                  fatal("%s: read: %ld != msg_len", __func__, (long)res);
 }  }
   
 void  void
Line 105 
Line 105 
 {  {
         u_char rtype;          u_char rtype;
   
         debug3("%s entering: type %d", __FUNCTION__, type);          debug3("%s entering: type %d", __func__, type);
   
         mm_request_receive(socket, m);          mm_request_receive(socket, m);
         rtype = buffer_get_char(m);          rtype = buffer_get_char(m);
         if (rtype != type)          if (rtype != type)
                 fatal("%s: read: rtype %d != type %d", __FUNCTION__,                  fatal("%s: read: rtype %d != type %d", __func__,
                     rtype, type);                      rtype, type);
 }  }
   
Line 128 
Line 128 
   
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_MODULI, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_MODULI, &m);
   
         debug3("%s: waiting for MONITOR_ANS_MODULI", __FUNCTION__);          debug3("%s: waiting for MONITOR_ANS_MODULI", __func__);
         mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_MODULI, &m);          mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_MODULI, &m);
   
         success = buffer_get_char(&m);          success = buffer_get_char(&m);
         if (success == 0)          if (success == 0)
                 fatal("%s: MONITOR_ANS_MODULI failed", __FUNCTION__);                  fatal("%s: MONITOR_ANS_MODULI failed", __func__);
   
         if ((p = BN_new()) == NULL)          if ((p = BN_new()) == NULL)
                 fatal("%s: BN_new failed", __FUNCTION__);                  fatal("%s: BN_new failed", __func__);
         if ((g = BN_new()) == NULL)          if ((g = BN_new()) == NULL)
                 fatal("%s: BN_new failed", __FUNCTION__);                  fatal("%s: BN_new failed", __func__);
         buffer_get_bignum2(&m, p);          buffer_get_bignum2(&m, p);
         buffer_get_bignum2(&m, g);          buffer_get_bignum2(&m, g);
   
         debug3("%s: remaining %d", __FUNCTION__, buffer_len(&m));          debug3("%s: remaining %d", __func__, buffer_len(&m));
         buffer_free(&m);          buffer_free(&m);
   
         return (dh_new_group(g, p));          return (dh_new_group(g, p));
Line 154 
Line 154 
         Kex *kex = *pmonitor->m_pkex;          Kex *kex = *pmonitor->m_pkex;
         Buffer m;          Buffer m;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         buffer_init(&m);          buffer_init(&m);
         buffer_put_int(&m, kex->host_key_index(key));          buffer_put_int(&m, kex->host_key_index(key));
Line 162 
Line 162 
   
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SIGN, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SIGN, &m);
   
         debug3("%s: waiting for MONITOR_ANS_SIGN", __FUNCTION__);          debug3("%s: waiting for MONITOR_ANS_SIGN", __func__);
         mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SIGN, &m);          mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SIGN, &m);
         *sigp  = buffer_get_string(&m, lenp);          *sigp  = buffer_get_string(&m, lenp);
         buffer_free(&m);          buffer_free(&m);
Line 177 
Line 177 
         struct passwd *pw;          struct passwd *pw;
         u_int pwlen;          u_int pwlen;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         buffer_init(&m);          buffer_init(&m);
         buffer_put_cstring(&m, login);          buffer_put_cstring(&m, login);
   
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PWNAM, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PWNAM, &m);
   
         debug3("%s: waiting for MONITOR_ANS_PWNAM", __FUNCTION__);          debug3("%s: waiting for MONITOR_ANS_PWNAM", __func__);
         mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PWNAM, &m);          mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PWNAM, &m);
   
         if (buffer_get_char(&m) == 0) {          if (buffer_get_char(&m) == 0) {
Line 193 
Line 193 
         }          }
         pw = buffer_get_string(&m, &pwlen);          pw = buffer_get_string(&m, &pwlen);
         if (pwlen != sizeof(struct passwd))          if (pwlen != sizeof(struct passwd))
                 fatal("%s: struct passwd size mismatch", __FUNCTION__);                  fatal("%s: struct passwd size mismatch", __func__);
         pw->pw_name = buffer_get_string(&m, NULL);          pw->pw_name = buffer_get_string(&m, NULL);
         pw->pw_passwd = buffer_get_string(&m, NULL);          pw->pw_passwd = buffer_get_string(&m, NULL);
         pw->pw_gecos = buffer_get_string(&m, NULL);          pw->pw_gecos = buffer_get_string(&m, NULL);
Line 210 
Line 210 
         Buffer m;          Buffer m;
         char *banner;          char *banner;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         buffer_init(&m);          buffer_init(&m);
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTH2_READ_BANNER, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTH2_READ_BANNER, &m);
Line 219 
Line 219 
         mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTH2_READ_BANNER, &m);          mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTH2_READ_BANNER, &m);
         banner = buffer_get_string(&m, NULL);          banner = buffer_get_string(&m, NULL);
         buffer_free(&m);          buffer_free(&m);
   
         return (banner);          return (banner);
 }  }
   
Line 230 
Line 230 
 {  {
         Buffer m;          Buffer m;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         buffer_init(&m);          buffer_init(&m);
         buffer_put_cstring(&m, service);          buffer_put_cstring(&m, service);
Line 248 
Line 248 
         Buffer m;          Buffer m;
         int authenticated = 0;          int authenticated = 0;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         buffer_init(&m);          buffer_init(&m);
         buffer_put_cstring(&m, password);          buffer_put_cstring(&m, password);
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHPASSWORD, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHPASSWORD, &m);
   
         debug3("%s: waiting for MONITOR_ANS_AUTHPASSWORD", __FUNCTION__);          debug3("%s: waiting for MONITOR_ANS_AUTHPASSWORD", __func__);
         mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTHPASSWORD, &m);          mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTHPASSWORD, &m);
   
         authenticated = buffer_get_int(&m);          authenticated = buffer_get_int(&m);
Line 262 
Line 262 
         buffer_free(&m);          buffer_free(&m);
   
         debug3("%s: user %sauthenticated",          debug3("%s: user %sauthenticated",
             __FUNCTION__, authenticated ? "" : "not ");              __func__, authenticated ? "" : "not ");
         return (authenticated);          return (authenticated);
 }  }
   
Line 298 
Line 298 
   
         while (buffer_len(m)) {          while (buffer_len(m)) {
                 msg = buffer_get_string(m, NULL);                  msg = buffer_get_string(m, NULL);
                 debug3("%s: Sending debug: %s", __FUNCTION__, msg);                  debug3("%s: Sending debug: %s", __func__, msg);
                 packet_send_debug("%s", msg);                  packet_send_debug("%s", msg);
                 xfree(msg);                  xfree(msg);
         }          }
Line 312 
Line 312 
         u_int len;          u_int len;
         int allowed = 0;          int allowed = 0;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         /* Convert the key to a blob and the pass it over */          /* Convert the key to a blob and the pass it over */
         if (!key_to_blob(key, &blob, &len))          if (!key_to_blob(key, &blob, &len))
Line 327 
Line 327 
   
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYALLOWED, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYALLOWED, &m);
   
         debug3("%s: waiting for MONITOR_ANS_KEYALLOWED", __FUNCTION__);          debug3("%s: waiting for MONITOR_ANS_KEYALLOWED", __func__);
         mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KEYALLOWED, &m);          mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KEYALLOWED, &m);
   
         allowed = buffer_get_int(&m);          allowed = buffer_get_int(&m);
Line 354 
Line 354 
         u_int len;          u_int len;
         int verified = 0;          int verified = 0;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         /* Convert the key to a blob and the pass it over */          /* Convert the key to a blob and the pass it over */
         if (!key_to_blob(key, &blob, &len))          if (!key_to_blob(key, &blob, &len))
Line 368 
Line 368 
   
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYVERIFY, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYVERIFY, &m);
   
         debug3("%s: waiting for MONITOR_ANS_KEYVERIFY", __FUNCTION__);          debug3("%s: waiting for MONITOR_ANS_KEYVERIFY", __func__);
         mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KEYVERIFY, &m);          mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KEYVERIFY, &m);
   
         verified = buffer_get_int(&m);          verified = buffer_get_int(&m);
Line 389 
Line 389 
         Mac *mac;          Mac *mac;
         Comp *comp;          Comp *comp;
   
         debug3("%s: %p(%d)", __FUNCTION__, blob, blen);          debug3("%s: %p(%d)", __func__, blob, blen);
 #ifdef DEBUG_PK  #ifdef DEBUG_PK
         dump_base64(stderr, blob, blen);          dump_base64(stderr, blob, blen);
 #endif  #endif
Line 409 
Line 409 
         enc->key = buffer_get_string(&b, &enc->key_len);          enc->key = buffer_get_string(&b, &enc->key_len);
         enc->iv = buffer_get_string(&b, &len);          enc->iv = buffer_get_string(&b, &len);
         if (len != enc->block_size)          if (len != enc->block_size)
                 fatal("%s: bad ivlen: expected %d != %d", __FUNCTION__,                  fatal("%s: bad ivlen: expected %d != %d", __func__,
                     enc->block_size, len);                      enc->block_size, len);
   
         if (enc->name == NULL || cipher_by_name(enc->name) != enc->cipher)          if (enc->name == NULL || cipher_by_name(enc->name) != enc->cipher)
                 fatal("%s: bad cipher name %s or pointer %p", __FUNCTION__,                  fatal("%s: bad cipher name %s or pointer %p", __func__,
                     enc->name, enc->cipher);                      enc->name, enc->cipher);
   
         /* Mac structure */          /* Mac structure */
         mac->name = buffer_get_string(&b, NULL);          mac->name = buffer_get_string(&b, NULL);
         if (mac->name == NULL || mac_init(mac, mac->name) == -1)          if (mac->name == NULL || mac_init(mac, mac->name) == -1)
                 fatal("%s: can not init mac %s", __FUNCTION__, mac->name);                  fatal("%s: can not init mac %s", __func__, mac->name);
         mac->enabled = buffer_get_int(&b);          mac->enabled = buffer_get_int(&b);
         mac->key = buffer_get_string(&b, &len);          mac->key = buffer_get_string(&b, &len);
         if (len > mac->key_len)          if (len > mac->key_len)
                 fatal("%s: bad mac key lenght: %d > %d", __FUNCTION__, len,                  fatal("%s: bad mac key length: %d > %d", __func__, len,
                     mac->key_len);                      mac->key_len);
         mac->key_len = len;          mac->key_len = len;
   
Line 450 
Line 450 
         Comp *comp;          Comp *comp;
         Newkeys *newkey = newkeys[mode];          Newkeys *newkey = newkeys[mode];
   
         debug3("%s: converting %p", __FUNCTION__, newkey);          debug3("%s: converting %p", __func__, newkey);
   
         if (newkey == NULL) {          if (newkey == NULL) {
                 error("%s: newkey == NULL", __FUNCTION__);                  error("%s: newkey == NULL", __func__);
                 return 0;                  return 0;
         }          }
         enc = &newkey->enc;          enc = &newkey->enc;
Line 518 
Line 518 
   
         if (!compat20) {          if (!compat20) {
                 u_char iv[24];                  u_char iv[24];
                 int ivlen;                  u_char *key;
                   u_int ivlen, keylen;
   
                 buffer_put_int(&m, packet_get_protocol_flags());                  buffer_put_int(&m, packet_get_protocol_flags());
   
                 buffer_put_int(&m, packet_get_ssh1_cipher());                  buffer_put_int(&m, packet_get_ssh1_cipher());
   
                 debug3("%s: Sending ssh1 IV", __FUNCTION__);                  debug3("%s: Sending ssh1 KEY+IV", __func__);
                   keylen = packet_get_encryption_key(NULL);
                   key = xmalloc(keylen+1);        /* add 1 if keylen == 0 */
                   keylen = packet_get_encryption_key(key);
                   buffer_put_string(&m, key, keylen);
                   memset(key, 0, keylen);
                   xfree(key);
   
                 ivlen = packet_get_keyiv_len(MODE_OUT);                  ivlen = packet_get_keyiv_len(MODE_OUT);
                 packet_get_keyiv(MODE_OUT, iv, ivlen);                  packet_get_keyiv(MODE_OUT, iv, ivlen);
                 buffer_put_string(&m, iv, ivlen);                  buffer_put_string(&m, iv, ivlen);
Line 538 
Line 546 
         }          }
   
         debug3("%s: Sending new keys: %p %p",          debug3("%s: Sending new keys: %p %p",
             __FUNCTION__, newkeys[MODE_OUT], newkeys[MODE_IN]);              __func__, newkeys[MODE_OUT], newkeys[MODE_IN]);
   
         /* Keys from Kex */          /* Keys from Kex */
         if (!mm_newkeys_to_blob(MODE_OUT, &blob, &bloblen))          if (!mm_newkeys_to_blob(MODE_OUT, &blob, &bloblen))
                 fatal("%s: conversion of newkeys failed", __FUNCTION__);                  fatal("%s: conversion of newkeys failed", __func__);
   
         buffer_put_string(&m, blob, bloblen);          buffer_put_string(&m, blob, bloblen);
         xfree(blob);          xfree(blob);
   
         if (!mm_newkeys_to_blob(MODE_IN, &blob, &bloblen))          if (!mm_newkeys_to_blob(MODE_IN, &blob, &bloblen))
                 fatal("%s: conversion of newkeys failed", __FUNCTION__);                  fatal("%s: conversion of newkeys failed", __func__);
   
         buffer_put_string(&m, blob, bloblen);          buffer_put_string(&m, blob, bloblen);
         xfree(blob);          xfree(blob);
Line 556 
Line 564 
         buffer_put_int(&m, packet_get_seqnr(MODE_OUT));          buffer_put_int(&m, packet_get_seqnr(MODE_OUT));
         buffer_put_int(&m, packet_get_seqnr(MODE_IN));          buffer_put_int(&m, packet_get_seqnr(MODE_IN));
   
         debug3("%s: New keys have been sent", __FUNCTION__);          debug3("%s: New keys have been sent", __func__);
  skip:   skip:
         /* More key context */          /* More key context */
         plen = packet_get_keycontext(MODE_OUT, NULL);          plen = packet_get_keycontext(MODE_OUT, NULL);
Line 572 
Line 580 
         xfree(p);          xfree(p);
   
         /* Compression state */          /* Compression state */
         debug3("%s: Sending compression state", __FUNCTION__);          debug3("%s: Sending compression state", __func__);
         buffer_put_string(&m, &outgoing_stream, sizeof(outgoing_stream));          buffer_put_string(&m, &outgoing_stream, sizeof(outgoing_stream));
         buffer_put_string(&m, &incoming_stream, sizeof(incoming_stream));          buffer_put_string(&m, &incoming_stream, sizeof(incoming_stream));
   
Line 581 
Line 589 
         buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output));          buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output));
   
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m);
         debug3("%s: Finished sending state", __FUNCTION__);          debug3("%s: Finished sending state", __func__);
   
         buffer_free(&m);          buffer_free(&m);
 }  }
Line 596 
Line 604 
         buffer_init(&m);          buffer_init(&m);
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTY, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTY, &m);
   
         debug3("%s: waiting for MONITOR_ANS_PTY", __FUNCTION__);          debug3("%s: waiting for MONITOR_ANS_PTY", __func__);
         mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PTY, &m);          mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PTY, &m);
   
         success = buffer_get_int(&m);          success = buffer_get_int(&m);
         if (success == 0) {          if (success == 0) {
                 debug3("%s: pty alloc failed", __FUNCTION__);                  debug3("%s: pty alloc failed", __func__);
                 buffer_free(&m);                  buffer_free(&m);
                 return (0);                  return (0);
         }          }
Line 675 
Line 683 
 mm_chall_setup(char **name, char **infotxt, u_int *numprompts,  mm_chall_setup(char **name, char **infotxt, u_int *numprompts,
     char ***prompts, u_int **echo_on)      char ***prompts, u_int **echo_on)
 {  {
         *name       = xstrdup("");          *name = xstrdup("");
         *infotxt    = xstrdup("");          *infotxt = xstrdup("");
         *numprompts = 1;          *numprompts = 1;
         *prompts = xmalloc(*numprompts * sizeof(char*));          *prompts = xmalloc(*numprompts * sizeof(char*));
         *echo_on = xmalloc(*numprompts * sizeof(u_int));          *echo_on = xmalloc(*numprompts * sizeof(u_int));
Line 691 
Line 699 
         int res;          int res;
         char *challenge;          char *challenge;
   
         debug3("%s: entering", __FUNCTION__);          debug3("%s: entering", __func__);
   
         buffer_init(&m);          buffer_init(&m);
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHQUERY, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHQUERY, &m);
Line 700 
Line 708 
             &m);              &m);
         res = buffer_get_int(&m);          res = buffer_get_int(&m);
         if (res == -1) {          if (res == -1) {
                 debug3("%s: no challenge", __FUNCTION__);                  debug3("%s: no challenge", __func__);
                 buffer_free(&m);                  buffer_free(&m);
                 return (-1);                  return (-1);
         }          }
Line 712 
Line 720 
         mm_chall_setup(name, infotxt, numprompts, prompts, echo_on);          mm_chall_setup(name, infotxt, numprompts, prompts, echo_on);
         (*prompts)[0] = challenge;          (*prompts)[0] = challenge;
   
         debug3("%s: received challenge: %s", __FUNCTION__, challenge);          debug3("%s: received challenge: %s", __func__, challenge);
   
         return (0);          return (0);
 }  }
Line 723 
Line 731 
         Buffer m;          Buffer m;
         int authok;          int authok;
   
         debug3("%s: entering", __FUNCTION__);          debug3("%s: entering", __func__);
         if (numresponses != 1)          if (numresponses != 1)
                 return (-1);                  return (-1);
   
Line 748 
Line 756 
         int len, res;          int len, res;
         char *p, *challenge;          char *p, *challenge;
   
         debug3("%s: entering", __FUNCTION__);          debug3("%s: entering", __func__);
   
         buffer_init(&m);          buffer_init(&m);
         mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SKEYQUERY, &m);          mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SKEYQUERY, &m);
Line 757 
Line 765 
             &m);              &m);
         res = buffer_get_int(&m);          res = buffer_get_int(&m);
         if (res == -1) {          if (res == -1) {
                 debug3("%s: no challenge", __FUNCTION__);                  debug3("%s: no challenge", __func__);
                 buffer_free(&m);                  buffer_free(&m);
                 return (-1);                  return (-1);
         }          }
Line 766 
Line 774 
         challenge  = buffer_get_string(&m, NULL);          challenge  = buffer_get_string(&m, NULL);
         buffer_free(&m);          buffer_free(&m);
   
         debug3("%s: received challenge: %s", __FUNCTION__, challenge);          debug3("%s: received challenge: %s", __func__, challenge);
   
         mm_chall_setup(name, infotxt, numprompts, prompts, echo_on);          mm_chall_setup(name, infotxt, numprompts, prompts, echo_on);
   
Line 786 
Line 794 
         Buffer m;          Buffer m;
         int authok;          int authok;
   
         debug3("%s: entering", __FUNCTION__);          debug3("%s: entering", __func__);
         if (numresponses != 1)          if (numresponses != 1)
                 return (-1);                  return (-1);
   
Line 809 
Line 817 
         Buffer m;          Buffer m;
         int i;          int i;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         buffer_init(&m);          buffer_init(&m);
         for (i = 0; i < 16; i++)          for (i = 0; i < 16; i++)
Line 828 
Line 836 
         u_int blen;          u_int blen;
         int allowed = 0;          int allowed = 0;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         buffer_init(&m);          buffer_init(&m);
         buffer_put_bignum2(&m, client_n);          buffer_put_bignum2(&m, client_n);
Line 841 
Line 849 
         if (allowed && rkey != NULL) {          if (allowed && rkey != NULL) {
                 blob = buffer_get_string(&m, &blen);                  blob = buffer_get_string(&m, &blen);
                 if ((key = key_from_blob(blob, blen)) == NULL)                  if ((key = key_from_blob(blob, blen)) == NULL)
                         fatal("%s: key_from_blob failed", __FUNCTION__);                          fatal("%s: key_from_blob failed", __func__);
                 *rkey = key;                  *rkey = key;
                 xfree(blob);                  xfree(blob);
         }          }
Line 859 
Line 867 
         u_char *blob;          u_char *blob;
         u_int blen;          u_int blen;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         if ((challenge = BN_new()) == NULL)          if ((challenge = BN_new()) == NULL)
                 fatal("%s: BN_new failed", __FUNCTION__);                  fatal("%s: BN_new failed", __func__);
   
         key->type = KEY_RSA;    /* XXX cheat for key_to_blob */          key->type = KEY_RSA;    /* XXX cheat for key_to_blob */
         if (key_to_blob(key, &blob, &blen) == 0)          if (key_to_blob(key, &blob, &blen) == 0)
                 fatal("%s: key_to_blob failed", __FUNCTION__);                  fatal("%s: key_to_blob failed", __func__);
         key->type = KEY_RSA1;          key->type = KEY_RSA1;
   
         buffer_init(&m);          buffer_init(&m);
Line 890 
Line 898 
         u_int blen;          u_int blen;
         int success = 0;          int success = 0;
   
         debug3("%s entering", __FUNCTION__);          debug3("%s entering", __func__);
   
         key->type = KEY_RSA;    /* XXX cheat for key_to_blob */          key->type = KEY_RSA;    /* XXX cheat for key_to_blob */
         if (key_to_blob(key, &blob, &blen) == 0)          if (key_to_blob(key, &blob, &blen) == 0)
                 fatal("%s: key_to_blob failed", __FUNCTION__);                  fatal("%s: key_to_blob failed", __func__);
         key->type = KEY_RSA1;          key->type = KEY_RSA1;
   
         buffer_init(&m);          buffer_init(&m);

Legend:
Removed from v.1.5.2.2  
changed lines
  Added in v.1.5.2.3