diff options
author | Damien Miller <djm@mindrot.org> | 2002-09-27 13:25:58 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-09-27 13:25:58 +1000 |
commit | d94e549ea8c622c8a75023b649a5d4c051aacf7f (patch) | |
tree | 84b39347f655ba0e33b7a9b6c3d23011a5befdad /monitor_wrap.c | |
parent | d27a76de65d557e36420046e44a014d3190f89cb (diff) |
- markus@cvs.openbsd.org 2002/09/26 11:38:43
[auth1.c auth.h auth-krb4.c monitor.c monitor.h monitor_wrap.c]
[monitor_wrap.h]
krb4 + privsep; ok dugsong@, deraadt@
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r-- | monitor_wrap.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c index 5d11a6593..4c53bfd13 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c | |||
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | RCSID("$OpenBSD: monitor_wrap.c,v 1.18 2002/09/09 14:54:15 markus Exp $"); | 28 | RCSID("$OpenBSD: monitor_wrap.c,v 1.19 2002/09/26 11:38:43 markus Exp $"); |
29 | 29 | ||
30 | #include <openssl/bn.h> | 30 | #include <openssl/bn.h> |
31 | #include <openssl/dh.h> | 31 | #include <openssl/dh.h> |
@@ -937,6 +937,42 @@ mm_auth_rsa_verify_response(Key *key, BIGNUM *p, u_char response[16]) | |||
937 | return (success); | 937 | return (success); |
938 | } | 938 | } |
939 | 939 | ||
940 | #ifdef KRB4 | ||
941 | int | ||
942 | mm_auth_krb4(Authctxt *authctxt, void *_auth, char **client, void *_reply) | ||
943 | { | ||
944 | KTEXT auth, reply; | ||
945 | Buffer m; | ||
946 | u_int rlen; | ||
947 | int success = 0; | ||
948 | char *p; | ||
949 | |||
950 | debug3("%s entering", __func__); | ||
951 | auth = _auth; | ||
952 | reply = _reply; | ||
953 | |||
954 | buffer_init(&m); | ||
955 | buffer_put_string(&m, auth->dat, auth->length); | ||
956 | |||
957 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KRB4, &m); | ||
958 | mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KRB4, &m); | ||
959 | |||
960 | success = buffer_get_int(&m); | ||
961 | if (success) { | ||
962 | *client = buffer_get_string(&m, NULL); | ||
963 | p = buffer_get_string(&m, &rlen); | ||
964 | if (rlen >= MAX_KTXT_LEN) | ||
965 | fatal("%s: reply from monitor too large", __func__); | ||
966 | reply->length = rlen; | ||
967 | memcpy(reply->dat, p, rlen); | ||
968 | memset(p, 0, rlen); | ||
969 | xfree(p); | ||
970 | } | ||
971 | buffer_free(&m); | ||
972 | return (success); | ||
973 | } | ||
974 | #endif | ||
975 | |||
940 | #ifdef KRB5 | 976 | #ifdef KRB5 |
941 | int | 977 | int |
942 | mm_auth_krb5(void *ctx, void *argp, char **userp, void *resp) | 978 | mm_auth_krb5(void *ctx, void *argp, char **userp, void *resp) |