summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-02-24 11:55:46 +1100
committerDamien Miller <djm@mindrot.org>2003-02-24 11:55:46 +1100
commitb7df3af154d035be480b9d9f433f440f1c66e1bd (patch)
treec65e09bdaff201141b6fa243ac67631fcdf89991 /monitor.c
parent386f1f3e6c5c3ea72970fcce4d939b2d4eb1bf3e (diff)
- markus@cvs.openbsd.org 2003/02/04 09:33:22
[monitor.c monitor_wrap.c] skey/bsdauth: use 0 to indicate failure instead of -1, because the buffer API only supports unsigned ints.
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/monitor.c b/monitor.c
index b91cfdeda..07d1728ec 100644
--- a/monitor.c
+++ b/monitor.c
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: monitor.c,v 1.30 2002/11/05 19:45:20 markus Exp $"); 28RCSID("$OpenBSD: monitor.c,v 1.31 2003/02/04 09:33:22 markus Exp $");
29 29
30#include <openssl/dh.h> 30#include <openssl/dh.h>
31 31
@@ -634,20 +634,20 @@ mm_answer_bsdauthquery(int socket, Buffer *m)
634 u_int numprompts; 634 u_int numprompts;
635 u_int *echo_on; 635 u_int *echo_on;
636 char **prompts; 636 char **prompts;
637 int res; 637 u_int success;
638 638
639 res = bsdauth_query(authctxt, &name, &infotxt, &numprompts, 639 success = bsdauth_query(authctxt, &name, &infotxt, &numprompts,
640 &prompts, &echo_on); 640 &prompts, &echo_on) < 0 ? 0 : 1;
641 641
642 buffer_clear(m); 642 buffer_clear(m);
643 buffer_put_int(m, res); 643 buffer_put_int(m, success);
644 if (res != -1) 644 if (success)
645 buffer_put_cstring(m, prompts[0]); 645 buffer_put_cstring(m, prompts[0]);
646 646
647 debug3("%s: sending challenge res: %d", __func__, res); 647 debug3("%s: sending challenge success: %u", __func__, success);
648 mm_request_send(socket, MONITOR_ANS_BSDAUTHQUERY, m); 648 mm_request_send(socket, MONITOR_ANS_BSDAUTHQUERY, m);
649 649
650 if (res != -1) { 650 if (success) {
651 xfree(name); 651 xfree(name);
652 xfree(infotxt); 652 xfree(infotxt);
653 xfree(prompts); 653 xfree(prompts);
@@ -691,16 +691,16 @@ mm_answer_skeyquery(int socket, Buffer *m)
691{ 691{
692 struct skey skey; 692 struct skey skey;
693 char challenge[1024]; 693 char challenge[1024];
694 int res; 694 u_int success;
695 695
696 res = skeychallenge(&skey, authctxt->user, challenge); 696 success = skeychallenge(&skey, authctxt->user, challenge) < 0 ? 0 : 1;
697 697
698 buffer_clear(m); 698 buffer_clear(m);
699 buffer_put_int(m, res); 699 buffer_put_int(m, success);
700 if (res != -1) 700 if (success)
701 buffer_put_cstring(m, challenge); 701 buffer_put_cstring(m, challenge);
702 702
703 debug3("%s: sending challenge res: %d", __func__, res); 703 debug3("%s: sending challenge success: %u", __func__, success);
704 mm_request_send(socket, MONITOR_ANS_SKEYQUERY, m); 704 mm_request_send(socket, MONITOR_ANS_SKEYQUERY, m);
705 705
706 return (0); 706 return (0);