diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2002-06-04 23:05:50 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2002-06-04 23:05:50 +0000 |
commit | 6613340987333692dc6247e1b7745fffc9fa4246 (patch) | |
tree | df3eb5043c7425433a6d6362f6f21a7ffc67e745 /usr.bin/ssh/monitor_wrap.c | |
parent | 960fd45a6d997d9ecb662a6f7224dfa1170821b1 (diff) |
__FUNCTION__ -> __func__
Diffstat (limited to 'usr.bin/ssh/monitor_wrap.c')
-rw-r--r-- | usr.bin/ssh/monitor_wrap.c | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/usr.bin/ssh/monitor_wrap.c b/usr.bin/ssh/monitor_wrap.c index ea8b1624c3d..bcb92178abb 100644 --- a/usr.bin/ssh/monitor_wrap.c +++ b/usr.bin/ssh/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); @@ -210,7 +210,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); @@ -230,7 +230,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); @@ -248,13 +248,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); @@ -262,7 +262,7 @@ mm_auth_password(Authctxt *authctxt, char *password) buffer_free(&m); debug3("%s: user %sauthenticated", - __FUNCTION__, authenticated ? "" : "not "); + __func__, authenticated ? "" : "not "); return (authenticated); } @@ -298,7 +298,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); } @@ -312,7 +312,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)) @@ -327,7 +327,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); @@ -354,7 +354,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)) @@ -368,7 +368,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); @@ -389,7 +389,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 @@ -409,21 +409,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; @@ -450,10 +450,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; @@ -524,7 +524,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); @@ -538,17 +538,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); @@ -556,7 +556,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); @@ -572,7 +572,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)); @@ -581,7 +581,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); } @@ -596,12 +596,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); } @@ -691,7 +691,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); @@ -700,7 +700,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); } @@ -712,7 +712,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); } @@ -723,7 +723,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); @@ -748,7 +748,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); @@ -757,7 +757,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); } @@ -766,7 +766,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); @@ -786,7 +786,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); @@ -809,7 +809,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++) @@ -828,7 +828,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); @@ -841,7 +841,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); } @@ -859,14 +859,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); @@ -890,11 +890,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); |