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 | |
parent | 960fd45a6d997d9ecb662a6f7224dfa1170821b1 (diff) |
__FUNCTION__ -> __func__
-rw-r--r-- | usr.bin/ssh/cipher.c | 26 | ||||
-rw-r--r-- | usr.bin/ssh/monitor.c | 142 | ||||
-rw-r--r-- | usr.bin/ssh/monitor_fdpass.c | 12 | ||||
-rw-r--r-- | usr.bin/ssh/monitor_mm.c | 8 | ||||
-rw-r--r-- | usr.bin/ssh/monitor_wrap.c | 124 |
5 files changed, 156 insertions, 156 deletions
diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c index fa7910581b2..11d2b41663b 100644 --- a/usr.bin/ssh/cipher.c +++ b/usr.bin/ssh/cipher.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher.c,v 1.57 2002/05/30 08:07:31 markus Exp $"); +RCSID("$OpenBSD: cipher.c,v 1.58 2002/06/04 23:05:49 markus Exp $"); #include "xmalloc.h" #include "log.h" @@ -552,7 +552,7 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len) if (evplen == 0) return; if (evplen != len) - fatal("%s: wrong iv length %d != %d", __FUNCTION__, + fatal("%s: wrong iv length %d != %d", __func__, evplen, len); #if OPENSSL_VERSION_NUMBER < 0x00907000L @@ -561,7 +561,7 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len) aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (aesc == NULL) - fatal("%s: no rijndael context", __FUNCTION__); + fatal("%s: no rijndael context", __func__); civ = aesc->r_iv; } else #endif @@ -572,18 +572,18 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len) case SSH_CIPHER_3DES: { struct ssh1_3des_ctx *desc; if (len != 24) - fatal("%s: bad 3des iv length: %d", __FUNCTION__, len); + fatal("%s: bad 3des iv length: %d", __func__, len); desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (desc == NULL) - fatal("%s: no 3des context", __FUNCTION__); - debug3("%s: Copying 3DES IV", __FUNCTION__); + fatal("%s: no 3des context", __func__); + debug3("%s: Copying 3DES IV", __func__); memcpy(iv, desc->k1.iv, 8); memcpy(iv + 8, desc->k2.iv, 8); memcpy(iv + 16, desc->k3.iv, 8); return; } default: - fatal("%s: bad cipher %d", __FUNCTION__, c->number); + fatal("%s: bad cipher %d", __func__, c->number); } memcpy(iv, civ, len); } @@ -609,7 +609,7 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv) aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (aesc == NULL) - fatal("%s: no rijndael context", __FUNCTION__); + fatal("%s: no rijndael context", __func__); div = aesc->r_iv; } else #endif @@ -621,15 +621,15 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv) struct ssh1_3des_ctx *desc; desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (desc == NULL) - fatal("%s: no 3des context", __FUNCTION__); - debug3("%s: Installed 3DES IV", __FUNCTION__); + fatal("%s: no 3des context", __func__); + debug3("%s: Installed 3DES IV", __func__); memcpy(desc->k1.iv, iv, 8); memcpy(desc->k2.iv, iv + 8, 8); memcpy(desc->k3.iv, iv + 16, 8); return; } default: - fatal("%s: bad cipher %d", __FUNCTION__, c->number); + fatal("%s: bad cipher %d", __func__, c->number); } memcpy(div, iv, evplen); } @@ -652,7 +652,7 @@ cipher_get_keycontext(CipherContext *cc, u_char *dat) struct ssh1_3des_ctx *desc; desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (desc == NULL) - fatal("%s: no 3des context", __FUNCTION__); + fatal("%s: no 3des context", __func__); plen = EVP_X_STATE_LEN(desc->k1); if (dat == NULL) return (3*plen); @@ -681,7 +681,7 @@ cipher_set_keycontext(CipherContext *cc, u_char *dat) struct ssh1_3des_ctx *desc; desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); if (desc == NULL) - fatal("%s: no 3des context", __FUNCTION__); + fatal("%s: no 3des context", __func__); plen = EVP_X_STATE_LEN(desc->k1); memcpy(EVP_X_STATE(desc->k1), dat, plen); memcpy(EVP_X_STATE(desc->k2), dat + plen, plen); diff --git a/usr.bin/ssh/monitor.c b/usr.bin/ssh/monitor.c index 7aa8935d360..d0479d00bc1 100644 --- a/usr.bin/ssh/monitor.c +++ b/usr.bin/ssh/monitor.c @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor.c,v 1.13 2002/06/04 19:53:40 markus Exp $"); +RCSID("$OpenBSD: monitor.c,v 1.14 2002/06/04 23:05:49 markus Exp $"); #include <openssl/dh.h> @@ -256,7 +256,7 @@ monitor_child_preauth(struct monitor *pmonitor) if (authenticated) { if (!(ent->flags & MON_AUTHDECIDE)) fatal("%s: unexpected authentication from %d", - __FUNCTION__, ent->type); + __func__, ent->type); if (authctxt->pw->pw_uid == 0 && !auth_root_allowed(auth_method)) authenticated = 0; @@ -271,10 +271,10 @@ monitor_child_preauth(struct monitor *pmonitor) } if (!authctxt->valid) - fatal("%s: authenticated invalid user", __FUNCTION__); + fatal("%s: authenticated invalid user", __func__); debug("%s: %s has been authenticated by privileged process", - __FUNCTION__, authctxt->user); + __func__, authctxt->user); mm_get_keystate(pmonitor); @@ -325,7 +325,7 @@ monitor_read(struct monitor *pmonitor, struct mon_table *ent, mm_request_receive(pmonitor->m_sendfd, &m); type = buffer_get_char(&m); - debug3("%s: checking request %d", __FUNCTION__, type); + debug3("%s: checking request %d", __func__, type); while (ent->f != NULL) { if (ent->type == type) @@ -335,14 +335,14 @@ monitor_read(struct monitor *pmonitor, struct mon_table *ent, if (ent->f != NULL) { if (!(ent->flags & MON_PERMIT)) - fatal("%s: unpermitted request %d", __FUNCTION__, + fatal("%s: unpermitted request %d", __func__, type); ret = (*ent->f)(pmonitor->m_sendfd, &m); buffer_free(&m); /* The child may use this request only once, disable it */ if (ent->flags & MON_ONCE) { - debug2("%s: %d used once, disabling now", __FUNCTION__, + debug2("%s: %d used once, disabling now", __func__, type); ent->flags &= ~MON_PERMIT; } @@ -353,7 +353,7 @@ monitor_read(struct monitor *pmonitor, struct mon_table *ent, return ret; } - fatal("%s: unsupported request: %d", __FUNCTION__, type); + fatal("%s: unsupported request: %d", __func__, type); /* NOTREACHED */ return (-1); @@ -398,11 +398,11 @@ mm_answer_moduli(int socket, Buffer *m) max = buffer_get_int(m); debug3("%s: got parameters: %d %d %d", - __FUNCTION__, min, want, max); + __func__, min, want, max); /* We need to check here, too, in case the child got corrupted */ if (max < min || want < min || max < want) fatal("%s: bad parameters: %d %d %d", - __FUNCTION__, min, want, max); + __func__, min, want, max); buffer_clear(m); @@ -431,13 +431,13 @@ mm_answer_sign(int socket, Buffer *m) u_int siglen, datlen; int keyid; - debug3("%s", __FUNCTION__); + debug3("%s", __func__); keyid = buffer_get_int(m); p = buffer_get_string(m, &datlen); if (datlen != 20) - fatal("%s: data length incorrect: %d", __FUNCTION__, datlen); + fatal("%s: data length incorrect: %d", __func__, datlen); /* save session id, it will be passed on the first call */ if (session_id2_len == 0) { @@ -447,11 +447,11 @@ mm_answer_sign(int socket, Buffer *m) } if ((key = get_hostkey_by_index(keyid)) == NULL) - fatal("%s: no hostkey from index %d", __FUNCTION__, keyid); + fatal("%s: no hostkey from index %d", __func__, keyid); if (key_sign(key, &signature, &siglen, p, datlen) < 0) - fatal("%s: key_sign failed", __FUNCTION__); + fatal("%s: key_sign failed", __func__); - debug3("%s: signature %p(%d)", __FUNCTION__, signature, siglen); + debug3("%s: signature %p(%d)", __func__, signature, siglen); buffer_clear(m); buffer_put_string(m, signature, siglen); @@ -476,10 +476,10 @@ mm_answer_pwnamallow(int socket, Buffer *m) struct passwd *pwent; int allowed = 0; - debug3("%s", __FUNCTION__); + debug3("%s", __func__); if (authctxt->attempt++ != 0) - fatal("%s: multiple attempts for getpwnam", __FUNCTION__); + fatal("%s: multiple attempts for getpwnam", __func__); login = buffer_get_string(m, NULL); @@ -510,7 +510,7 @@ mm_answer_pwnamallow(int socket, Buffer *m) buffer_put_cstring(m, pwent->pw_shell); out: - debug3("%s: sending MONITOR_ANS_PWNAM: %d", __FUNCTION__, allowed); + debug3("%s: sending MONITOR_ANS_PWNAM: %d", __func__, allowed); mm_request_send(socket, MONITOR_ANS_PWNAM, m); /* For SSHv1 allow authentication now */ @@ -549,7 +549,7 @@ mm_answer_authserv(int socket, Buffer *m) authctxt->service = buffer_get_string(m, NULL); authctxt->style = buffer_get_string(m, NULL); debug3("%s: service=%s, style=%s", - __FUNCTION__, authctxt->service, authctxt->style); + __func__, authctxt->service, authctxt->style); if (strlen(authctxt->style) == 0) { xfree(authctxt->style); @@ -576,7 +576,7 @@ mm_answer_authpassword(int socket, Buffer *m) buffer_clear(m); buffer_put_int(m, authenticated); - debug3("%s: sending result %d", __FUNCTION__, authenticated); + debug3("%s: sending result %d", __func__, authenticated); mm_request_send(socket, MONITOR_ANS_AUTHPASSWORD, m); call_count++; @@ -607,7 +607,7 @@ mm_answer_bsdauthquery(int socket, Buffer *m) if (res != -1) buffer_put_cstring(m, prompts[0]); - debug3("%s: sending challenge res: %d", __FUNCTION__, res); + debug3("%s: sending challenge res: %d", __func__, res); mm_request_send(socket, MONITOR_ANS_BSDAUTHQUERY, m); if (res != -1) { @@ -627,19 +627,19 @@ mm_answer_bsdauthrespond(int socket, Buffer *m) int authok; if (authctxt->as == 0) - fatal("%s: no bsd auth session", __FUNCTION__); + fatal("%s: no bsd auth session", __func__); response = buffer_get_string(m, NULL); authok = options.challenge_response_authentication && auth_userresponse(authctxt->as, response, 0); authctxt->as = NULL; - debug3("%s: <%s> = <%d>", __FUNCTION__, response, authok); + debug3("%s: <%s> = <%d>", __func__, response, authok); xfree(response); buffer_clear(m); buffer_put_int(m, authok); - debug3("%s: sending authenticated: %d", __FUNCTION__, authok); + debug3("%s: sending authenticated: %d", __func__, authok); mm_request_send(socket, MONITOR_ANS_BSDAUTHRESPOND, m); auth_method = "bsdauth"; @@ -663,7 +663,7 @@ mm_answer_skeyquery(int socket, Buffer *m) if (res != -1) buffer_put_cstring(m, challenge); - debug3("%s: sending challenge res: %d", __FUNCTION__, res); + debug3("%s: sending challenge res: %d", __func__, res); mm_request_send(socket, MONITOR_ANS_SKEYQUERY, m); return (0); @@ -687,7 +687,7 @@ mm_answer_skeyrespond(int socket, Buffer *m) buffer_clear(m); buffer_put_int(m, authok); - debug3("%s: sending authenticated: %d", __FUNCTION__, authok); + debug3("%s: sending authenticated: %d", __func__, authok); mm_request_send(socket, MONITOR_ANS_SKEYRESPOND, m); auth_method = "skey"; @@ -700,7 +700,7 @@ static void mm_append_debug(Buffer *m) { if (auth_debug_init && buffer_len(&auth_debug)) { - debug3("%s: Appending debug messages for child", __FUNCTION__); + debug3("%s: Appending debug messages for child", __func__); buffer_append(m, buffer_ptr(&auth_debug), buffer_len(&auth_debug)); buffer_clear(&auth_debug); @@ -716,7 +716,7 @@ mm_answer_keyallowed(int socket, Buffer *m) enum mm_keytype type = 0; int allowed = 0; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); type = buffer_get_int(m); cuser = buffer_get_string(m, NULL); @@ -727,9 +727,9 @@ mm_answer_keyallowed(int socket, Buffer *m) if ((compat20 && type == MM_RSAHOSTKEY) || (!compat20 && type != MM_RSAHOSTKEY)) - fatal("%s: key type and protocol mismatch", __FUNCTION__); + fatal("%s: key type and protocol mismatch", __func__); - debug3("%s: key_from_blob: %p", __FUNCTION__, key); + debug3("%s: key_from_blob: %p", __func__, key); if (key != NULL && authctxt->pw != NULL) { switch(type) { @@ -749,7 +749,7 @@ mm_answer_keyallowed(int socket, Buffer *m) cuser, chost, key); break; default: - fatal("%s: unknown key type %d", __FUNCTION__, type); + fatal("%s: unknown key type %d", __func__, type); break; } key_free(key); @@ -768,7 +768,7 @@ mm_answer_keyallowed(int socket, Buffer *m) } debug3("%s: key %p is %s", - __FUNCTION__, key, allowed ? "allowed" : "disallowed"); + __func__, key, allowed ? "allowed" : "disallowed"); buffer_clear(m); buffer_put_int(m, allowed); @@ -910,11 +910,11 @@ mm_answer_keyverify(int socket, Buffer *m) if (hostbased_cuser == NULL || hostbased_chost == NULL || !monitor_allowed_key(blob, bloblen)) - fatal("%s: bad key, not previously allowed", __FUNCTION__); + fatal("%s: bad key, not previously allowed", __func__); key = key_from_blob(blob, bloblen); if (key == NULL) - fatal("%s: bad public key blob", __FUNCTION__); + fatal("%s: bad public key blob", __func__); switch (key_blobtype) { case MM_USERKEY: @@ -929,11 +929,11 @@ mm_answer_keyverify(int socket, Buffer *m) break; } if (!valid_data) - fatal("%s: bad signature data blob", __FUNCTION__); + fatal("%s: bad signature data blob", __func__); verified = key_verify(key, signature, signaturelen, data, datalen); debug3("%s: key %p signature %s", - __FUNCTION__, key, verified ? "verified" : "unverified"); + __func__, key, verified ? "verified" : "unverified"); key_free(key); xfree(blob); @@ -979,9 +979,9 @@ mm_record_login(Session *s, struct passwd *pw) static void mm_session_close(Session *s) { - debug3("%s: session %d pid %d", __FUNCTION__, s->self, s->pid); + debug3("%s: session %d pid %d", __func__, s->self, s->pid); if (s->ttyfd != -1) { - debug3("%s: tty %s ptyfd %d", __FUNCTION__, s->tty, s->ptyfd); + debug3("%s: tty %s ptyfd %d", __func__, s->tty, s->ptyfd); fatal_remove_cleanup(session_pty_cleanup2, (void *)s); session_pty_cleanup2(s); } @@ -995,7 +995,7 @@ mm_answer_pty(int socket, Buffer *m) Session *s; int res, fd0; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); buffer_clear(m); s = session_new(); @@ -1019,7 +1019,7 @@ mm_answer_pty(int socket, Buffer *m) /* We need to trick ttyslot */ if (dup2(s->ttyfd, 0) == -1) - fatal("%s: dup2", __FUNCTION__); + fatal("%s: dup2", __func__); mm_record_login(s, authctxt->pw); @@ -1028,9 +1028,9 @@ mm_answer_pty(int socket, Buffer *m) /* make sure nothing uses fd 0 */ if ((fd0 = open(_PATH_DEVNULL, O_RDONLY)) < 0) - fatal("%s: open(/dev/null): %s", __FUNCTION__, strerror(errno)); + fatal("%s: open(/dev/null): %s", __func__, strerror(errno)); if (fd0 != 0) - error("%s: fd0 %d != 0", __FUNCTION__, fd0); + error("%s: fd0 %d != 0", __func__, fd0); /* slave is not needed */ close(s->ttyfd); @@ -1038,7 +1038,7 @@ mm_answer_pty(int socket, Buffer *m) /* no need to dup() because nobody closes ptyfd */ s->ptymaster = s->ptyfd; - debug3("%s: tty %s ptyfd %d", __FUNCTION__, s->tty, s->ttyfd); + debug3("%s: tty %s ptyfd %d", __func__, s->tty, s->ttyfd); return (0); @@ -1056,7 +1056,7 @@ mm_answer_pty_cleanup(int socket, Buffer *m) Session *s; char *tty; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); tty = buffer_get_string(m, NULL); if ((s = session_by_tty(tty)) != NULL) @@ -1076,7 +1076,7 @@ mm_answer_sesskey(int socket, Buffer *m) monitor_permit(mon_dispatch, MONITOR_REQ_SESSKEY, 1); if ((p = BN_new()) == NULL) - fatal("%s: BN_new", __FUNCTION__); + fatal("%s: BN_new", __func__); buffer_get_bignum2(m, p); @@ -1101,10 +1101,10 @@ mm_answer_sessid(int socket, Buffer *m) { int i; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); if (buffer_len(m) != 16) - fatal("%s: bad ssh1 session id", __FUNCTION__); + fatal("%s: bad ssh1 session id", __func__); for (i = 0; i < 16; i++) session_id[i] = buffer_get_char(m); @@ -1123,11 +1123,11 @@ mm_answer_rsa_keyallowed(int socket, Buffer *m) u_int blen = 0; int allowed = 0; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); if (options.rsa_authentication && authctxt->valid) { if ((client_n = BN_new()) == NULL) - fatal("%s: BN_new", __FUNCTION__); + fatal("%s: BN_new", __func__); buffer_get_bignum2(m, client_n); allowed = auth_rsa_key_allowed(authctxt->pw, client_n, &key); BN_clear_free(client_n); @@ -1141,7 +1141,7 @@ mm_answer_rsa_keyallowed(int socket, Buffer *m) if (allowed && key != NULL) { key->type = KEY_RSA; /* 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__); buffer_put_string(m, blob, blen); /* Save temporarily for comparison in verify */ @@ -1167,17 +1167,17 @@ mm_answer_rsa_challenge(int socket, Buffer *m) u_char *blob; u_int blen; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); if (!authctxt->valid) - fatal("%s: authctxt not valid", __FUNCTION__); + fatal("%s: authctxt not valid", __func__); blob = buffer_get_string(m, &blen); if (!monitor_allowed_key(blob, blen)) - fatal("%s: bad key, not previously allowed", __FUNCTION__); + fatal("%s: bad key, not previously allowed", __func__); if (key_blobtype != MM_RSAUSERKEY && key_blobtype != MM_RSAHOSTKEY) - fatal("%s: key type mismatch", __FUNCTION__); + fatal("%s: key type mismatch", __func__); if ((key = key_from_blob(blob, blen)) == NULL) - fatal("%s: received bad key", __FUNCTION__); + fatal("%s: received bad key", __func__); if (ssh1_challenge) BN_clear_free(ssh1_challenge); @@ -1186,7 +1186,7 @@ mm_answer_rsa_challenge(int socket, Buffer *m) buffer_clear(m); buffer_put_bignum2(m, ssh1_challenge); - debug3("%s sending reply", __FUNCTION__); + debug3("%s sending reply", __func__); mm_request_send(socket, MONITOR_ANS_RSACHALLENGE, m); monitor_permit(mon_dispatch, MONITOR_REQ_RSARESPONSE, 1); @@ -1201,23 +1201,23 @@ mm_answer_rsa_response(int socket, Buffer *m) u_int blen, len; int success; - debug3("%s entering", __FUNCTION__); + debug3("%s entering", __func__); if (!authctxt->valid) - fatal("%s: authctxt not valid", __FUNCTION__); + fatal("%s: authctxt not valid", __func__); if (ssh1_challenge == NULL) - fatal("%s: no ssh1_challenge", __FUNCTION__); + fatal("%s: no ssh1_challenge", __func__); blob = buffer_get_string(m, &blen); if (!monitor_allowed_key(blob, blen)) - fatal("%s: bad key, not previously allowed", __FUNCTION__); + fatal("%s: bad key, not previously allowed", __func__); if (key_blobtype != MM_RSAUSERKEY && key_blobtype != MM_RSAHOSTKEY) - fatal("%s: key type mismatch: %d", __FUNCTION__, key_blobtype); + fatal("%s: key type mismatch: %d", __func__, key_blobtype); if ((key = key_from_blob(blob, blen)) == NULL) - fatal("%s: received bad key", __FUNCTION__); + fatal("%s: received bad key", __func__); response = buffer_get_string(m, &len); if (len != 16) - fatal("%s: received bad response to challenge", __FUNCTION__); + fatal("%s: received bad response to challenge", __func__); success = auth_rsa_verify_response(key, ssh1_challenge, response); key_free(key); @@ -1243,7 +1243,7 @@ mm_answer_term(int socket, Buffer *req) extern struct monitor *pmonitor; int res, status; - debug3("%s: tearing down sessions", __FUNCTION__); + debug3("%s: tearing down sessions", __func__); /* The child is terminating */ session_destroy_all(&mm_session_close); @@ -1351,7 +1351,7 @@ mm_get_keystate(struct monitor *pmonitor) u_char *blob, *p; u_int bloblen, plen; - debug3("%s: Waiting for new keys", __FUNCTION__); + debug3("%s: Waiting for new keys", __func__); buffer_init(&m); mm_request_receive_expect(pmonitor->m_sendfd, MONITOR_REQ_KEYEXPORT, &m); @@ -1371,7 +1371,7 @@ mm_get_keystate(struct monitor *pmonitor) current_keys[MODE_OUT] = mm_newkeys_from_blob(blob, bloblen); xfree(blob); - debug3("%s: Waiting for second key", __FUNCTION__); + debug3("%s: Waiting for second key", __func__); blob = buffer_get_string(&m, &bloblen); current_keys[MODE_IN] = mm_newkeys_from_blob(blob, bloblen); xfree(blob); @@ -1385,22 +1385,22 @@ mm_get_keystate(struct monitor *pmonitor) child_state.keyout = buffer_get_string(&m, &child_state.keyoutlen); child_state.keyin = buffer_get_string(&m, &child_state.keyinlen); - debug3("%s: Getting compression state", __FUNCTION__); + debug3("%s: Getting compression state", __func__); /* Get compression state */ p = buffer_get_string(&m, &plen); if (plen != sizeof(child_state.outgoing)) - fatal("%s: bad request size", __FUNCTION__); + fatal("%s: bad request size", __func__); memcpy(&child_state.outgoing, p, sizeof(child_state.outgoing)); xfree(p); p = buffer_get_string(&m, &plen); if (plen != sizeof(child_state.incoming)) - fatal("%s: bad request size", __FUNCTION__); + fatal("%s: bad request size", __func__); memcpy(&child_state.incoming, p, sizeof(child_state.incoming)); xfree(p); /* Network I/O buffers */ - debug3("%s: Getting Network I/O buffers", __FUNCTION__); + debug3("%s: Getting Network I/O buffers", __func__); child_state.input = buffer_get_string(&m, &child_state.ilen); child_state.output = buffer_get_string(&m, &child_state.olen); @@ -1448,7 +1448,7 @@ static void monitor_socketpair(int *pair) { if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) - fatal("%s: socketpair", __FUNCTION__); + fatal("%s: socketpair", __func__); FD_CLOSEONEXEC(pair[0]); FD_CLOSEONEXEC(pair[1]); } diff --git a/usr.bin/ssh/monitor_fdpass.c b/usr.bin/ssh/monitor_fdpass.c index 0628b5a8e64..9696c869e79 100644 --- a/usr.bin/ssh/monitor_fdpass.c +++ b/usr.bin/ssh/monitor_fdpass.c @@ -24,7 +24,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_fdpass.c,v 1.2 2002/03/24 17:53:16 stevesk Exp $"); +RCSID("$OpenBSD: monitor_fdpass.c,v 1.3 2002/06/04 23:05:49 markus Exp $"); #include <sys/uio.h> @@ -56,11 +56,11 @@ mm_send_fd(int socket, int fd) msg.msg_iovlen = 1; if ((n = sendmsg(socket, &msg, 0)) == -1) - fatal("%s: sendmsg(%d): %s", __FUNCTION__, fd, + fatal("%s: sendmsg(%d): %s", __func__, fd, strerror(errno)); if (n != 1) fatal("%s: sendmsg: expected sent 1 got %d", - __FUNCTION__, n); + __func__, n); } int @@ -82,14 +82,14 @@ mm_receive_fd(int socket) msg.msg_controllen = sizeof(tmp); if ((n = recvmsg(socket, &msg, 0)) == -1) - fatal("%s: recvmsg: %s", __FUNCTION__, strerror(errno)); + fatal("%s: recvmsg: %s", __func__, strerror(errno)); if (n != 1) fatal("%s: recvmsg: expected received 1 got %d", - __FUNCTION__, n); + __func__, n); cmsg = CMSG_FIRSTHDR(&msg); if (cmsg->cmsg_type != SCM_RIGHTS) - fatal("%s: expected type %d got %d", __FUNCTION__, + fatal("%s: expected type %d got %d", __func__, SCM_RIGHTS, cmsg->cmsg_type); fd = (*(int *)CMSG_DATA(cmsg)); return fd; diff --git a/usr.bin/ssh/monitor_mm.c b/usr.bin/ssh/monitor_mm.c index cdd259e02eb..c6ea2085011 100644 --- a/usr.bin/ssh/monitor_mm.c +++ b/usr.bin/ssh/monitor_mm.c @@ -24,7 +24,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_mm.c,v 1.5 2002/05/28 16:45:27 stevesk Exp $"); +RCSID("$OpenBSD: monitor_mm.c,v 1.6 2002/06/04 23:05:49 markus Exp $"); #include <sys/mman.h> @@ -139,7 +139,7 @@ mm_xmalloc(struct mm_master *mm, size_t size) address = mm_malloc(mm, size); if (address == NULL) - fatal("%s: mm_malloc(%lu)", __FUNCTION__, (u_long)size); + fatal("%s: mm_malloc(%lu)", __func__, (u_long)size); return (address); } @@ -288,7 +288,7 @@ mm_share_sync(struct mm_master **pmm, struct mm_master **pmmalloc) struct mm_master *mmold; struct mmtree rb_free, rb_allocated; - debug3("%s: Share sync", __FUNCTION__); + debug3("%s: Share sync", __func__); mm = *pmm; mmold = mm->mmalloc; @@ -313,7 +313,7 @@ mm_share_sync(struct mm_master **pmm, struct mm_master **pmmalloc) *pmm = mm; *pmmalloc = mmalloc; - debug3("%s: Share sync end", __FUNCTION__); + debug3("%s: Share sync end", __func__); } void 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); |