diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-06-06 21:40:51 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-06-06 21:40:51 +0000 |
commit | 7d9c38f37ae608265c3f7fa2f87795419afe6069 (patch) | |
tree | 621c8078e155f13b2251f7bc0df2b36333314128 /monitor_wrap.c | |
parent | 3dca4f55f20cb62c8cfc5d050027a49bf3590b55 (diff) |
- markus@cvs.openbsd.org 2002/06/04 23:05:49
[cipher.c monitor.c monitor_fdpass.c monitor_mm.c monitor_wrap.c]
__FUNCTION__ -> __func__
NOTE: This includes all portable references also.
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r-- | monitor_wrap.c | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c index c5e3fb98..fca5ffe5 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_wrap.c,v 1.7 2002/05/15 15:47:49 mouring Exp $"); +RCSID("$OpenBSD: monitor_wrap.c,v 1.8 2002/06/04 23:05:49 markus Exp $"); #include <openssl/bn.h> #include <openssl/dh.h> @@ -65,14 +65,14 @@ mm_request_send(int socket, enum monitor_reqtype type, Buffer *m) u_char buf[5]; 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); buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */ 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) - fatal("%s: write", __FUNCTION__); + fatal("%s: write", __func__); } void @@ -82,22 +82,22 @@ mm_request_receive(int socket, Buffer *m) ssize_t res; u_int msg_len; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); res = atomicio(read, socket, buf, sizeof(buf)); if (res != sizeof(buf)) { if (res == 0) fatal_cleanup(); - fatal("%s: read: %ld", __FUNCTION__, (long)res); + fatal("%s: read: %ld", __func__, (long)res); } msg_len = GET_32BIT(buf); 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_append_space(m, msg_len); res = atomicio(read, socket, buffer_ptr(m), 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 @@ -105,12 +105,12 @@ mm_request_receive_expect(int socket, enum monitor_reqtype type, Buffer *m) { u_char rtype; - debug3("%s entering: type %d", __FUNCTION__, type); + debug3("%s entering: type %d", __func__, type); mm_request_receive(socket, m); rtype = buffer_get_char(m); if (rtype != type) - fatal("%s: read: rtype %d != type %d", __FUNCTION__, + fatal("%s: read: rtype %d != type %d", __func__, rtype, type); } @@ -128,21 +128,21 @@ mm_choose_dh(int min, int nbits, int max) 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); success = buffer_get_char(&m); if (success == 0) - fatal("%s: MONITOR_ANS_MODULI failed", __FUNCTION__); + fatal("%s: MONITOR_ANS_MODULI failed", __func__); if ((p = BN_new()) == NULL) - fatal("%s: BN_new failed", __FUNCTION__); + fatal("%s: BN_new failed", __func__); 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, g); - debug3("%s: remaining %d", __FUNCTION__, buffer_len(&m)); + debug3("%s: remaining %d", __func__, buffer_len(&m)); buffer_free(&m); return (dh_new_group(g, p)); @@ -154,7 +154,7 @@ mm_key_sign(Key *key, u_char **sigp, u_int *lenp, u_char *data, u_int datalen) Kex *kex = *pmonitor->m_pkex; Buffer m; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); buffer_init(&m); buffer_put_int(&m, kex->host_key_index(key)); @@ -162,7 +162,7 @@ mm_key_sign(Key *key, u_char **sigp, u_int *lenp, u_char *data, u_int datalen) 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); *sigp = buffer_get_string(&m, lenp); buffer_free(&m); @@ -177,14 +177,14 @@ mm_getpwnamallow(const char *login) struct passwd *pw; u_int pwlen; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); buffer_init(&m); buffer_put_cstring(&m, login); 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); if (buffer_get_char(&m) == 0) { @@ -193,7 +193,7 @@ mm_getpwnamallow(const char *login) } pw = buffer_get_string(&m, &pwlen); 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_passwd = buffer_get_string(&m, NULL); pw->pw_gecos = buffer_get_string(&m, NULL); @@ -212,7 +212,7 @@ char* mm_auth2_read_banner(void) Buffer m; char *banner; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); buffer_init(&m); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTH2_READ_BANNER, &m); @@ -232,7 +232,7 @@ mm_inform_authserv(char *service, char *style) { Buffer m; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); buffer_init(&m); buffer_put_cstring(&m, service); @@ -250,13 +250,13 @@ mm_auth_password(Authctxt *authctxt, char *password) Buffer m; int authenticated = 0; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); buffer_init(&m); buffer_put_cstring(&m, password); 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); authenticated = buffer_get_int(&m); @@ -264,7 +264,7 @@ mm_auth_password(Authctxt *authctxt, char *password) buffer_free(&m); debug3("%s: user %sauthenticated", - __FUNCTION__, authenticated ? "" : "not "); + __func__, authenticated ? "" : "not "); return (authenticated); } @@ -300,7 +300,7 @@ mm_send_debug(Buffer *m) while (buffer_len(m)) { 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); xfree(msg); } @@ -314,7 +314,7 @@ mm_key_allowed(enum mm_keytype type, char *user, char *host, Key *key) u_int len; int allowed = 0; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); /* Convert the key to a blob and the pass it over */ if (!key_to_blob(key, &blob, &len)) @@ -329,7 +329,7 @@ mm_key_allowed(enum mm_keytype type, char *user, char *host, Key *key) 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); allowed = buffer_get_int(&m); @@ -356,7 +356,7 @@ mm_key_verify(Key *key, u_char *sig, u_int siglen, u_char *data, u_int datalen) u_int len; int verified = 0; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); /* Convert the key to a blob and the pass it over */ if (!key_to_blob(key, &blob, &len)) @@ -370,7 +370,7 @@ mm_key_verify(Key *key, u_char *sig, u_int siglen, u_char *data, u_int datalen) 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); verified = buffer_get_int(&m); @@ -391,7 +391,7 @@ mm_newkeys_from_blob(u_char *blob, int blen) Mac *mac; Comp *comp; - debug3("%s: %p(%d)", __FUNCTION__, blob, blen); + debug3("%s: %p(%d)", __func__, blob, blen); #ifdef DEBUG_PK dump_base64(stderr, blob, blen); #endif @@ -411,21 +411,21 @@ mm_newkeys_from_blob(u_char *blob, int blen) enc->key = buffer_get_string(&b, &enc->key_len); enc->iv = buffer_get_string(&b, &len); 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); 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); /* Mac structure */ mac->name = buffer_get_string(&b, NULL); 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->key = buffer_get_string(&b, &len); if (len > mac->key_len) - fatal("%s: bad mac key lenght: %d > %d", __FUNCTION__, len, + fatal("%s: bad mac key lenght: %d > %d", __func__, len, mac->key_len); mac->key_len = len; @@ -452,10 +452,10 @@ mm_newkeys_to_blob(int mode, u_char **blobp, u_int *lenp) Comp *comp; Newkeys *newkey = newkeys[mode]; - debug3("%s: converting %p", __FUNCTION__, newkey); + debug3("%s: converting %p", __func__, newkey); if (newkey == NULL) { - error("%s: newkey == NULL", __FUNCTION__); + error("%s: newkey == NULL", __func__); return 0; } enc = &newkey->enc; @@ -526,7 +526,7 @@ mm_send_keystate(struct monitor *pmonitor) buffer_put_int(&m, packet_get_ssh1_cipher()); - debug3("%s: Sending ssh1 IV", __FUNCTION__); + debug3("%s: Sending ssh1 IV", __func__); ivlen = packet_get_keyiv_len(MODE_OUT); packet_get_keyiv(MODE_OUT, iv, ivlen); buffer_put_string(&m, iv, ivlen); @@ -540,17 +540,17 @@ mm_send_keystate(struct monitor *pmonitor) } debug3("%s: Sending new keys: %p %p", - __FUNCTION__, newkeys[MODE_OUT], newkeys[MODE_IN]); + __func__, newkeys[MODE_OUT], newkeys[MODE_IN]); /* Keys from Kex */ 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); xfree(blob); 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); xfree(blob); @@ -558,7 +558,7 @@ mm_send_keystate(struct monitor *pmonitor) buffer_put_int(&m, packet_get_seqnr(MODE_OUT)); 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: /* More key context */ plen = packet_get_keycontext(MODE_OUT, NULL); @@ -574,7 +574,7 @@ mm_send_keystate(struct monitor *pmonitor) xfree(p); /* 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, &incoming_stream, sizeof(incoming_stream)); @@ -583,7 +583,7 @@ mm_send_keystate(struct monitor *pmonitor) buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output)); 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); } @@ -598,12 +598,12 @@ mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) buffer_init(&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); success = buffer_get_int(&m); if (success == 0) { - debug3("%s: pty alloc failed", __FUNCTION__); + debug3("%s: pty alloc failed", __func__); buffer_free(&m); return (0); } @@ -647,7 +647,7 @@ mm_start_pam(char *user) { Buffer m; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); buffer_init(&m); buffer_put_cstring(&m, user); @@ -710,7 +710,7 @@ mm_bsdauth_query(void *ctx, char **name, char **infotxt, int res; char *challenge; - debug3("%s: entering", __FUNCTION__); + debug3("%s: entering", __func__); buffer_init(&m); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHQUERY, &m); @@ -719,7 +719,7 @@ mm_bsdauth_query(void *ctx, char **name, char **infotxt, &m); res = buffer_get_int(&m); if (res == -1) { - debug3("%s: no challenge", __FUNCTION__); + debug3("%s: no challenge", __func__); buffer_free(&m); return (-1); } @@ -731,7 +731,7 @@ mm_bsdauth_query(void *ctx, char **name, char **infotxt, mm_chall_setup(name, infotxt, numprompts, prompts, echo_on); (*prompts)[0] = challenge; - debug3("%s: received challenge: %s", __FUNCTION__, challenge); + debug3("%s: received challenge: %s", __func__, challenge); return (0); } @@ -742,7 +742,7 @@ mm_bsdauth_respond(void *ctx, u_int numresponses, char **responses) Buffer m; int authok; - debug3("%s: entering", __FUNCTION__); + debug3("%s: entering", __func__); if (numresponses != 1) return (-1); @@ -767,7 +767,7 @@ mm_skey_query(void *ctx, char **name, char **infotxt, int len, res; char *p, *challenge; - debug3("%s: entering", __FUNCTION__); + debug3("%s: entering", __func__); buffer_init(&m); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SKEYQUERY, &m); @@ -776,7 +776,7 @@ mm_skey_query(void *ctx, char **name, char **infotxt, &m); res = buffer_get_int(&m); if (res == -1) { - debug3("%s: no challenge", __FUNCTION__); + debug3("%s: no challenge", __func__); buffer_free(&m); return (-1); } @@ -785,7 +785,7 @@ mm_skey_query(void *ctx, char **name, char **infotxt, challenge = buffer_get_string(&m, NULL); 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); @@ -805,7 +805,7 @@ mm_skey_respond(void *ctx, u_int numresponses, char **responses) Buffer m; int authok; - debug3("%s: entering", __FUNCTION__); + debug3("%s: entering", __func__); if (numresponses != 1) return (-1); @@ -828,7 +828,7 @@ mm_ssh1_session_id(u_char session_id[16]) Buffer m; int i; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); buffer_init(&m); for (i = 0; i < 16; i++) @@ -847,7 +847,7 @@ mm_auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) u_int blen; int allowed = 0; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); buffer_init(&m); buffer_put_bignum2(&m, client_n); @@ -860,7 +860,7 @@ mm_auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) if (allowed && rkey != NULL) { blob = buffer_get_string(&m, &blen); if ((key = key_from_blob(blob, blen)) == NULL) - fatal("%s: key_from_blob failed", __FUNCTION__); + fatal("%s: key_from_blob failed", __func__); *rkey = key; xfree(blob); } @@ -878,14 +878,14 @@ mm_auth_rsa_generate_challenge(Key *key) u_char *blob; u_int blen; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); 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 */ 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; buffer_init(&m); @@ -909,11 +909,11 @@ mm_auth_rsa_verify_response(Key *key, BIGNUM *p, u_char response[16]) u_int blen; int success = 0; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); key->type = KEY_RSA; /* XXX cheat for key_to_blob */ 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; buffer_init(&m); |