|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/Makefile.in.audit3 openssh-5.9p0/Makefile.in
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/Makefile.in.audit3 2011-08-05 22:15:18.000000000 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/Makefile.in 2011-09-03 19:28:53.226036039 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -71,7 +71,7 @@ LIBSSH_OBJS=acss.o authfd.o authfile.o b
|
|
Jan F. Chadima |
69dd72 |
monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \
|
|
Jan F. Chadima |
69dd72 |
kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \
|
|
Jan F. Chadima |
69dd72 |
msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o jpake.o \
|
|
Jan F. Chadima |
69dd72 |
- schnorr.o ssh-pkcs11.o
|
|
Jan F. Chadima |
69dd72 |
+ schnorr.o ssh-pkcs11.o auditstub.o
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \
|
|
Jan F. Chadima |
69dd72 |
sshconnect.o sshconnect1.o sshconnect2.o mux.o \
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/audit-bsm.c.audit3 openssh-5.9p0/audit-bsm.c
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/audit-bsm.c.audit3 2011-09-03 19:28:51.922034646 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/audit-bsm.c 2011-09-03 19:28:53.475151642 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -396,4 +396,16 @@ audit_event(ssh_audit_event_t event)
|
|
Jan F. Chadima |
69dd72 |
debug("%s: unhandled event %d", __func__, event);
|
|
Jan F. Chadima |
69dd72 |
}
|
|
Jan F. Chadima |
69dd72 |
}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+audit_unsupported_body(int what)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+ /* not implemented */
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+audit_kex_body(int ctos, char *enc, char *mac, char *compress, pid_t pid, uid_t uid)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+ /* not implemented */
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
#endif /* BSM */
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/audit-linux.c.audit3 openssh-5.9p0/audit-linux.c
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/audit-linux.c.audit3 2011-09-03 19:28:52.053030306 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/audit-linux.c 2011-09-03 19:28:53.583026470 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -40,6 +40,8 @@
|
|
Jan F. Chadima |
69dd72 |
#include "auth.h"
|
|
Jan F. Chadima |
69dd72 |
#include "servconf.h"
|
|
Jan F. Chadima |
69dd72 |
#include "canohost.h"
|
|
Jan F. Chadima |
69dd72 |
+#include "packet.h"
|
|
Jan F. Chadima |
69dd72 |
+#include "cipher.h"
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
#define AUDIT_LOG_SIZE 128
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
@@ -269,4 +271,56 @@ audit_event(ssh_audit_event_t event)
|
|
Jan F. Chadima |
69dd72 |
}
|
|
Jan F. Chadima |
69dd72 |
}
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+audit_unsupported_body(int what)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+#ifdef AUDIT_CRYPTO_SESSION
|
|
Jan F. Chadima |
69dd72 |
+ char buf[AUDIT_LOG_SIZE];
|
|
Jan F. Chadima |
69dd72 |
+ const static char *name[] = { "cipher", "mac", "comp" };
|
|
Jan F. Chadima |
69dd72 |
+ int audit_fd;
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ snprintf(buf, sizeof(buf), "op=unsupported-%s direction=? cipher=? ksize=? rport=%d laddr=%s lport=%d ",
|
|
Jan F. Chadima |
69dd72 |
+ name[what], get_remote_port(), get_local_ipaddr(packet_get_connection_in()),
|
|
Jan F. Chadima |
69dd72 |
+ get_local_port());
|
|
Jan F. Chadima |
69dd72 |
+ audit_fd = audit_open();
|
|
Jan F. Chadima |
69dd72 |
+ if (audit_fd < 0)
|
|
Jan F. Chadima |
69dd72 |
+ /* no problem, the next instruction will be fatal() */
|
|
Jan F. Chadima |
69dd72 |
+ return;
|
|
Jan F. Chadima |
69dd72 |
+ audit_log_user_message(audit_fd, AUDIT_CRYPTO_SESSION,
|
|
Jan F. Chadima |
69dd72 |
+ buf, NULL, get_remote_ipaddr(), NULL, 0);
|
|
Jan F. Chadima |
69dd72 |
+ audit_close(audit_fd);
|
|
Jan F. Chadima |
69dd72 |
+#endif
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+audit_kex_body(int ctos, char *enc, char *mac, char *compress, pid_t pid,
|
|
Jan F. Chadima |
69dd72 |
+ uid_t uid)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+#ifdef AUDIT_CRYPTO_SESSION
|
|
Jan F. Chadima |
69dd72 |
+ char buf[AUDIT_LOG_SIZE];
|
|
Jan F. Chadima |
69dd72 |
+ int audit_fd, audit_ok;
|
|
Jan F. Chadima |
69dd72 |
+ const static char *direction[] = { "from-server", "from-client", "both" };
|
|
Jan F. Chadima |
69dd72 |
+ Cipher *cipher = cipher_by_name(enc);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ snprintf(buf, sizeof(buf), "op=start direction=%s cipher=%s ksize=%d spid=%jd suid=%jd rport=%d laddr=%s lport=%d ",
|
|
Jan F. Chadima |
69dd72 |
+ direction[ctos], enc, cipher ? 8 * cipher->key_len : 0,
|
|
Jan F. Chadima |
69dd72 |
+ (intmax_t)pid, (intmax_t)uid,
|
|
Jan F. Chadima |
69dd72 |
+ get_remote_port(), get_local_ipaddr(packet_get_connection_in()), get_local_port());
|
|
Jan F. Chadima |
69dd72 |
+ audit_fd = audit_open();
|
|
Jan F. Chadima |
69dd72 |
+ if (audit_fd < 0) {
|
|
Jan F. Chadima |
69dd72 |
+ if (errno == EINVAL || errno == EPROTONOSUPPORT ||
|
|
Jan F. Chadima |
69dd72 |
+ errno == EAFNOSUPPORT)
|
|
Jan F. Chadima |
69dd72 |
+ return; /* No audit support in kernel */
|
|
Jan F. Chadima |
69dd72 |
+ else
|
|
Jan F. Chadima |
69dd72 |
+ fatal("cannot open audit"); /* Must prevent login */
|
|
Jan F. Chadima |
69dd72 |
+ }
|
|
Jan F. Chadima |
69dd72 |
+ audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_SESSION,
|
|
Jan F. Chadima |
69dd72 |
+ buf, NULL, get_remote_ipaddr(), NULL, 1);
|
|
Jan F. Chadima |
69dd72 |
+ audit_close(audit_fd);
|
|
Jan F. Chadima |
69dd72 |
+ /* do not abort if the error is EPERM and sshd is run as non root user */
|
|
Jan F. Chadima |
69dd72 |
+ if ((audit_ok < 0) && ((audit_ok != -1) || (getuid() == 0)))
|
|
Jan F. Chadima |
69dd72 |
+ fatal("cannot write into audit"); /* Must prevent login */
|
|
Jan F. Chadima |
69dd72 |
+#endif
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
#endif /* USE_LINUX_AUDIT */
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/audit.c.audit3 openssh-5.9p0/audit.c
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/audit.c.audit3 2011-09-03 19:28:52.166026259 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/audit.c 2011-09-03 19:28:53.673151432 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -28,6 +28,7 @@
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
#include <stdarg.h>
|
|
Jan F. Chadima |
69dd72 |
#include <string.h>
|
|
Jan F. Chadima |
69dd72 |
+#include <unistd.h>
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
#ifdef SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
@@ -36,6 +37,8 @@
|
|
Jan F. Chadima |
69dd72 |
#include "key.h"
|
|
Jan F. Chadima |
69dd72 |
#include "hostfile.h"
|
|
Jan F. Chadima |
69dd72 |
#include "auth.h"
|
|
Jan F. Chadima |
69dd72 |
+#include "ssh-gss.h"
|
|
Jan F. Chadima |
69dd72 |
+#include "monitor_wrap.h"
|
|
Jan F. Chadima |
69dd72 |
#include "xmalloc.h"
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
/*
|
|
Jan F. Chadima |
69dd72 |
@@ -128,6 +131,18 @@ audit_key(int host_user, int *rv, const
|
|
Jan F. Chadima |
69dd72 |
xfree(fp);
|
|
Jan F. Chadima |
69dd72 |
}
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+audit_unsupported(int what)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+ PRIVSEP(audit_unsupported_body(what));
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+audit_kex(int ctos, char *enc, char *mac, char *comp)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+ PRIVSEP(audit_kex_body(ctos, enc, mac, comp, getpid(), getuid()));
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
# ifndef CUSTOM_SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
/*
|
|
Jan F. Chadima |
69dd72 |
* Null implementations of audit functions.
|
|
Jan F. Chadima |
69dd72 |
@@ -238,5 +253,26 @@ audit_keyusage(int host_user, const char
|
|
Jan F. Chadima |
69dd72 |
host_user ? "pubkey" : "hostbased", geteuid(), audit_username(), type, bits,
|
|
Jan F. Chadima |
69dd72 |
key_fingerprint_prefix(), fp, rv);
|
|
Jan F. Chadima |
69dd72 |
}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+/*
|
|
Jan F. Chadima |
69dd72 |
+ * This will be called when the protocol negotiation fails.
|
|
Jan F. Chadima |
69dd72 |
+ */
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+audit_unsupported_body(int what)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+ debug("audit unsupported protocol euid %d type %d", geteuid(), what);
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+/*
|
|
Jan F. Chadima |
69dd72 |
+ * This will be called on succesfull protocol negotiation.
|
|
Jan F. Chadima |
69dd72 |
+ */
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+audit_kex_body(int ctos, char *enc, char *mac, char *compress, pid_t pid,
|
|
Jan F. Chadima |
69dd72 |
+ uid_t uid)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+ debug("audit protocol negotiation euid %d direction %d cipher %s mac %s compresion %s from pid %ld uid %u",
|
|
Jan F. Chadima |
69dd72 |
+ (unsigned)geteuid(), ctos, enc, mac, compress, (long)pid,
|
|
Jan F. Chadima |
69dd72 |
+ (unsigned)uid);
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
# endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */
|
|
Jan F. Chadima |
69dd72 |
#endif /* SSH_AUDIT_EVENTS */
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/audit.h.audit3 openssh-5.9p0/audit.h
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/audit.h.audit3 2011-09-03 19:28:52.286024211 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/audit.h 2011-09-03 19:28:53.783027870 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -58,5 +58,9 @@ void audit_end_command(int, const char
|
|
Jan F. Chadima |
69dd72 |
ssh_audit_event_t audit_classify_auth(const char *);
|
|
Jan F. Chadima |
69dd72 |
int audit_keyusage(int, const char *, unsigned, char *, int);
|
|
Jan F. Chadima |
69dd72 |
void audit_key(int, int *, const Key *);
|
|
Jan F. Chadima |
69dd72 |
+void audit_unsupported(int);
|
|
Jan F. Chadima |
69dd72 |
+void audit_kex(int, char *, char *, char *);
|
|
Jan F. Chadima |
69dd72 |
+void audit_unsupported_body(int);
|
|
Jan F. Chadima |
69dd72 |
+void audit_kex_body(int, char *, char *, char *, pid_t, uid_t);
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
#endif /* _SSH_AUDIT_H */
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/auditstub.c.audit3 openssh-5.9p0/auditstub.c
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/auditstub.c.audit3 2011-09-03 19:28:53.879026270 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/auditstub.c 2011-09-03 19:28:53.882025491 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -0,0 +1,39 @@
|
|
Jan F. Chadima |
69dd72 |
+/* $Id: auditstub.c,v 1.1 jfch Exp $ */
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+/*
|
|
Jan F. Chadima |
69dd72 |
+ * Copyright 2010 Red Hat, Inc. All rights reserved.
|
|
Jan F. Chadima |
69dd72 |
+ * Use is subject to license terms.
|
|
Jan F. Chadima |
69dd72 |
+ *
|
|
Jan F. Chadima |
69dd72 |
+ * Redistribution and use in source and binary forms, with or without
|
|
Jan F. Chadima |
69dd72 |
+ * modification, are permitted provided that the following conditions
|
|
Jan F. Chadima |
69dd72 |
+ * are met:
|
|
Jan F. Chadima |
69dd72 |
+ * 1. Redistributions of source code must retain the above copyright
|
|
Jan F. Chadima |
69dd72 |
+ * notice, this list of conditions and the following disclaimer.
|
|
Jan F. Chadima |
69dd72 |
+ * 2. Redistributions in binary form must reproduce the above copyright
|
|
Jan F. Chadima |
69dd72 |
+ * notice, this list of conditions and the following disclaimer in the
|
|
Jan F. Chadima |
69dd72 |
+ * documentation and/or other materials provided with the distribution.
|
|
Jan F. Chadima |
69dd72 |
+ *
|
|
Jan F. Chadima |
69dd72 |
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
Jan F. Chadima |
69dd72 |
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
Jan F. Chadima |
69dd72 |
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
Jan F. Chadima |
69dd72 |
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
Jan F. Chadima |
69dd72 |
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
Jan F. Chadima |
69dd72 |
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
Jan F. Chadima |
69dd72 |
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
Jan F. Chadima |
69dd72 |
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
Jan F. Chadima |
69dd72 |
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
Jan F. Chadima |
69dd72 |
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Jan F. Chadima |
69dd72 |
+ *
|
|
Jan F. Chadima |
69dd72 |
+ * Red Hat author: Jan F. Chadima <jchadima@redhat.com>
|
|
Jan F. Chadima |
69dd72 |
+ */
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+audit_unsupported(int n)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+audit_kex(int ctos, char *enc, char *mac, char *comp)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/cipher.c.audit3 openssh-5.9p0/cipher.c
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/cipher.c.audit3 2011-08-30 10:34:01.000000000 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/cipher.c 2011-09-03 19:28:53.966162869 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -60,15 +60,7 @@ extern void ssh1_3des_iv(EVP_CIPHER_CTX
|
|
Jan F. Chadima |
69dd72 |
extern const EVP_CIPHER *evp_aes_128_ctr(void);
|
|
Jan F. Chadima |
69dd72 |
extern void ssh_aes_ctr_iv(EVP_CIPHER_CTX *, int, u_char *, u_int);
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
-struct Cipher {
|
|
Jan F. Chadima |
69dd72 |
- char *name;
|
|
Jan F. Chadima |
69dd72 |
- int number; /* for ssh1 only */
|
|
Jan F. Chadima |
69dd72 |
- u_int block_size;
|
|
Jan F. Chadima |
69dd72 |
- u_int key_len;
|
|
Jan F. Chadima |
69dd72 |
- u_int discard_len;
|
|
Jan F. Chadima |
69dd72 |
- u_int cbc_mode;
|
|
Jan F. Chadima |
69dd72 |
- const EVP_CIPHER *(*evptype)(void);
|
|
Jan F. Chadima |
69dd72 |
-} ciphers[] = {
|
|
Jan F. Chadima |
69dd72 |
+struct Cipher ciphers[] = {
|
|
Jan F. Chadima |
69dd72 |
{ "none", SSH_CIPHER_NONE, 8, 0, 0, 0, EVP_enc_null },
|
|
Jan F. Chadima |
69dd72 |
{ "des", SSH_CIPHER_DES, 8, 8, 0, 1, EVP_des_cbc },
|
|
Jan F. Chadima |
69dd72 |
{ "3des", SSH_CIPHER_3DES, 8, 16, 0, 1, evp_ssh1_3des },
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/cipher.h.audit3 openssh-5.9p0/cipher.h
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/cipher.h.audit3 2009-01-28 06:38:41.000000000 +0100
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/cipher.h 2011-09-03 19:28:54.068070077 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -61,7 +61,16 @@
|
|
Jan F. Chadima |
69dd72 |
typedef struct Cipher Cipher;
|
|
Jan F. Chadima |
69dd72 |
typedef struct CipherContext CipherContext;
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
-struct Cipher;
|
|
Jan F. Chadima |
69dd72 |
+struct Cipher {
|
|
Jan F. Chadima |
69dd72 |
+ char *name;
|
|
Jan F. Chadima |
69dd72 |
+ int number; /* for ssh1 only */
|
|
Jan F. Chadima |
69dd72 |
+ u_int block_size;
|
|
Jan F. Chadima |
69dd72 |
+ u_int key_len;
|
|
Jan F. Chadima |
69dd72 |
+ u_int discard_len;
|
|
Jan F. Chadima |
69dd72 |
+ u_int cbc_mode;
|
|
Jan F. Chadima |
69dd72 |
+ const EVP_CIPHER *(*evptype)(void);
|
|
Jan F. Chadima |
69dd72 |
+};
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
struct CipherContext {
|
|
Jan F. Chadima |
69dd72 |
int plaintext;
|
|
Jan F. Chadima |
69dd72 |
EVP_CIPHER_CTX evp;
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/kex.c.audit3 openssh-5.9p0/kex.c
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/kex.c.audit3 2010-09-24 14:11:14.000000000 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/kex.c 2011-09-03 19:28:54.177212272 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -49,6 +49,7 @@
|
|
Jan F. Chadima |
69dd72 |
#include "dispatch.h"
|
|
Jan F. Chadima |
69dd72 |
#include "monitor.h"
|
|
Jan F. Chadima |
69dd72 |
#include "roaming.h"
|
|
Jan F. Chadima |
69dd72 |
+#include "audit.h"
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
|
|
Jan F. Chadima |
69dd72 |
# if defined(HAVE_EVP_SHA256)
|
|
Jan F. Chadima |
69dd72 |
@@ -286,9 +287,13 @@ static void
|
|
Jan F. Chadima |
69dd72 |
choose_enc(Enc *enc, char *client, char *server)
|
|
Jan F. Chadima |
69dd72 |
{
|
|
Jan F. Chadima |
69dd72 |
char *name = match_list(client, server, NULL);
|
|
Jan F. Chadima |
69dd72 |
- if (name == NULL)
|
|
Jan F. Chadima |
69dd72 |
+ if (name == NULL) {
|
|
Jan F. Chadima |
69dd72 |
+#ifdef SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
+ audit_unsupported(0);
|
|
Jan F. Chadima |
69dd72 |
+#endif
|
|
Jan F. Chadima |
69dd72 |
fatal("no matching cipher found: client %s server %s",
|
|
Jan F. Chadima |
69dd72 |
client, server);
|
|
Jan F. Chadima |
69dd72 |
+ }
|
|
Jan F. Chadima |
69dd72 |
if ((enc->cipher = cipher_by_name(name)) == NULL)
|
|
Jan F. Chadima |
69dd72 |
fatal("matching cipher is not supported: %s", name);
|
|
Jan F. Chadima |
69dd72 |
enc->name = name;
|
|
Jan F. Chadima |
69dd72 |
@@ -303,9 +308,13 @@ static void
|
|
Jan F. Chadima |
69dd72 |
choose_mac(Mac *mac, char *client, char *server)
|
|
Jan F. Chadima |
69dd72 |
{
|
|
Jan F. Chadima |
69dd72 |
char *name = match_list(client, server, NULL);
|
|
Jan F. Chadima |
69dd72 |
- if (name == NULL)
|
|
Jan F. Chadima |
69dd72 |
+ if (name == NULL) {
|
|
Jan F. Chadima |
69dd72 |
+#ifdef SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
+ audit_unsupported(1);
|
|
Jan F. Chadima |
69dd72 |
+#endif
|
|
Jan F. Chadima |
69dd72 |
fatal("no matching mac found: client %s server %s",
|
|
Jan F. Chadima |
69dd72 |
client, server);
|
|
Jan F. Chadima |
69dd72 |
+ }
|
|
Jan F. Chadima |
69dd72 |
if (mac_setup(mac, name) < 0)
|
|
Jan F. Chadima |
69dd72 |
fatal("unsupported mac %s", name);
|
|
Jan F. Chadima |
69dd72 |
/* truncate the key */
|
|
Jan F. Chadima |
69dd72 |
@@ -320,8 +329,12 @@ static void
|
|
Jan F. Chadima |
69dd72 |
choose_comp(Comp *comp, char *client, char *server)
|
|
Jan F. Chadima |
69dd72 |
{
|
|
Jan F. Chadima |
69dd72 |
char *name = match_list(client, server, NULL);
|
|
Jan F. Chadima |
69dd72 |
- if (name == NULL)
|
|
Jan F. Chadima |
69dd72 |
+ if (name == NULL) {
|
|
Jan F. Chadima |
69dd72 |
+#ifdef SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
+ audit_unsupported(2);
|
|
Jan F. Chadima |
69dd72 |
+#endif
|
|
Jan F. Chadima |
69dd72 |
fatal("no matching comp found: client %s server %s", client, server);
|
|
Jan F. Chadima |
69dd72 |
+ }
|
|
Jan F. Chadima |
69dd72 |
if (strcmp(name, "zlib@openssh.com") == 0) {
|
|
Jan F. Chadima |
69dd72 |
comp->type = COMP_DELAYED;
|
|
Jan F. Chadima |
69dd72 |
} else if (strcmp(name, "zlib") == 0) {
|
|
Jan F. Chadima |
69dd72 |
@@ -446,6 +459,9 @@ kex_choose_conf(Kex *kex)
|
|
Jan F. Chadima |
69dd72 |
newkeys->enc.name,
|
|
Jan F. Chadima |
69dd72 |
newkeys->mac.name,
|
|
Jan F. Chadima |
69dd72 |
newkeys->comp.name);
|
|
Jan F. Chadima |
69dd72 |
+#ifdef SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
+ audit_kex(ctos, newkeys->enc.name, newkeys->mac.name, newkeys->comp.name);
|
|
Jan F. Chadima |
69dd72 |
+#endif
|
|
Jan F. Chadima |
69dd72 |
}
|
|
Jan F. Chadima |
69dd72 |
choose_kex(kex, cprop[PROPOSAL_KEX_ALGS], sprop[PROPOSAL_KEX_ALGS]);
|
|
Jan F. Chadima |
69dd72 |
choose_hostkeyalg(kex, cprop[PROPOSAL_SERVER_HOST_KEY_ALGS],
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/monitor.c.audit3 openssh-5.9p0/monitor.c
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/monitor.c.audit3 2011-09-03 19:28:52.851088094 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/monitor.c 2011-09-03 19:28:54.298087612 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -97,6 +97,7 @@
|
|
Jan F. Chadima |
69dd72 |
#include "ssh2.h"
|
|
Jan F. Chadima |
69dd72 |
#include "jpake.h"
|
|
Jan F. Chadima |
69dd72 |
#include "roaming.h"
|
|
Jan F. Chadima |
69dd72 |
+#include "audit.h"
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
#ifdef GSSAPI
|
|
Jan F. Chadima |
69dd72 |
static Gssctxt *gsscontext = NULL;
|
|
Jan F. Chadima |
69dd72 |
@@ -187,6 +188,8 @@ int mm_answer_gss_checkmic(int, Buffer *
|
|
Jan F. Chadima |
69dd72 |
int mm_answer_audit_event(int, Buffer *);
|
|
Jan F. Chadima |
69dd72 |
int mm_answer_audit_command(int, Buffer *);
|
|
Jan F. Chadima |
69dd72 |
int mm_answer_audit_end_command(int, Buffer *);
|
|
Jan F. Chadima |
69dd72 |
+int mm_answer_audit_unsupported_body(int, Buffer *);
|
|
Jan F. Chadima |
69dd72 |
+int mm_answer_audit_kex_body(int, Buffer *);
|
|
Jan F. Chadima |
69dd72 |
#endif
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
static int monitor_read_log(struct monitor *);
|
|
Jan F. Chadima |
69dd72 |
@@ -237,6 +240,8 @@ struct mon_table mon_dispatch_proto20[]
|
|
Jan F. Chadima |
69dd72 |
#endif
|
|
Jan F. Chadima |
69dd72 |
#ifdef SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
{MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event},
|
|
Jan F. Chadima |
69dd72 |
+ {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body},
|
|
Jan F. Chadima |
69dd72 |
+ {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body},
|
|
Jan F. Chadima |
69dd72 |
#endif
|
|
Jan F. Chadima |
69dd72 |
#ifdef BSD_AUTH
|
|
Jan F. Chadima |
69dd72 |
{MONITOR_REQ_BSDAUTHQUERY, MON_ISAUTH, mm_answer_bsdauthquery},
|
|
Jan F. Chadima |
69dd72 |
@@ -275,6 +280,8 @@ struct mon_table mon_dispatch_postauth20
|
|
Jan F. Chadima |
69dd72 |
{MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event},
|
|
Jan F. Chadima |
69dd72 |
{MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command},
|
|
Jan F. Chadima |
69dd72 |
{MONITOR_REQ_AUDIT_END_COMMAND, MON_PERMIT, mm_answer_audit_end_command},
|
|
Jan F. Chadima |
69dd72 |
+ {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body},
|
|
Jan F. Chadima |
69dd72 |
+ {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body},
|
|
Jan F. Chadima |
69dd72 |
#endif
|
|
Jan F. Chadima |
69dd72 |
{0, 0, NULL}
|
|
Jan F. Chadima |
69dd72 |
};
|
|
Jan F. Chadima |
69dd72 |
@@ -306,6 +313,8 @@ struct mon_table mon_dispatch_proto15[]
|
|
Jan F. Chadima |
69dd72 |
#endif
|
|
Jan F. Chadima |
69dd72 |
#ifdef SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
{MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event},
|
|
Jan F. Chadima |
69dd72 |
+ {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body},
|
|
Jan F. Chadima |
69dd72 |
+ {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body},
|
|
Jan F. Chadima |
69dd72 |
#endif
|
|
Jan F. Chadima |
69dd72 |
{0, 0, NULL}
|
|
Jan F. Chadima |
69dd72 |
};
|
|
Jan F. Chadima |
69dd72 |
@@ -318,6 +327,8 @@ struct mon_table mon_dispatch_postauth15
|
|
Jan F. Chadima |
69dd72 |
{MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event},
|
|
Jan F. Chadima |
69dd72 |
{MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT|MON_ONCE, mm_answer_audit_command},
|
|
Jan F. Chadima |
69dd72 |
{MONITOR_REQ_AUDIT_END_COMMAND, MON_PERMIT, mm_answer_audit_end_command},
|
|
Jan F. Chadima |
69dd72 |
+ {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body},
|
|
Jan F. Chadima |
69dd72 |
+ {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body},
|
|
Jan F. Chadima |
69dd72 |
#endif
|
|
Jan F. Chadima |
69dd72 |
{0, 0, NULL}
|
|
Jan F. Chadima |
69dd72 |
};
|
|
Jan F. Chadima |
69dd72 |
@@ -2380,3 +2391,44 @@ mm_answer_jpake_check_confirm(int sock,
|
|
Jan F. Chadima |
69dd72 |
}
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
#endif /* JPAKE */
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+#ifdef SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
+int
|
|
Jan F. Chadima |
69dd72 |
+mm_answer_audit_unsupported_body(int sock, Buffer *m)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+ int what;
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ what = buffer_get_int(m);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ audit_unsupported_body(what);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ buffer_clear(m);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ mm_request_send(sock, MONITOR_ANS_AUDIT_UNSUPPORTED, m);
|
|
Jan F. Chadima |
69dd72 |
+ return 0;
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+int
|
|
Jan F. Chadima |
69dd72 |
+mm_answer_audit_kex_body(int sock, Buffer *m)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+ int ctos, len;
|
|
Jan F. Chadima |
69dd72 |
+ char *cipher, *mac, *compress;
|
|
Jan F. Chadima |
69dd72 |
+ pid_t pid;
|
|
Jan F. Chadima |
69dd72 |
+ uid_t uid;
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ ctos = buffer_get_int(m);
|
|
Jan F. Chadima |
69dd72 |
+ cipher = buffer_get_string(m, &len;;
|
|
Jan F. Chadima |
69dd72 |
+ mac = buffer_get_string(m, &len;;
|
|
Jan F. Chadima |
69dd72 |
+ compress = buffer_get_string(m, &len;;
|
|
Jan F. Chadima |
69dd72 |
+ pid = buffer_get_int64(m);
|
|
Jan F. Chadima |
69dd72 |
+ uid = buffer_get_int64(m);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ audit_kex_body(ctos, cipher, mac, compress, pid, uid);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ buffer_clear(m);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ mm_request_send(sock, MONITOR_ANS_AUDIT_KEX, m);
|
|
Jan F. Chadima |
69dd72 |
+ return 0;
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+#endif /* SSH_AUDIT_EVENTS */
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/monitor.h.audit3 openssh-5.9p0/monitor.h
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/monitor.h.audit3 2011-09-03 19:28:51.000000000 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/monitor.h 2011-09-03 19:29:52.565211520 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -61,6 +61,8 @@ enum monitor_reqtype {
|
|
Jan F. Chadima |
69dd72 |
MONITOR_REQ_PAM_FREE_CTX, MONITOR_ANS_PAM_FREE_CTX,
|
|
Jan F. Chadima |
69dd72 |
MONITOR_REQ_AUDIT_EVENT, MONITOR_REQ_AUDIT_COMMAND,
|
|
Jan F. Chadima |
69dd72 |
MONITOR_ANS_AUDIT_COMMAND, MONITOR_REQ_AUDIT_END_COMMAND,
|
|
Jan F. Chadima |
69dd72 |
+ MONITOR_REQ_AUDIT_UNSUPPORTED, MONITOR_ANS_AUDIT_UNSUPPORTED,
|
|
Jan F. Chadima |
69dd72 |
+ MONITOR_REQ_AUDIT_KEX, MONITOR_ANS_AUDIT_KEX,
|
|
Jan F. Chadima |
69dd72 |
MONITOR_REQ_TERM,
|
|
Jan F. Chadima |
69dd72 |
MONITOR_REQ_JPAKE_STEP1, MONITOR_ANS_JPAKE_STEP1,
|
|
Jan F. Chadima |
69dd72 |
MONITOR_REQ_JPAKE_GET_PWDATA, MONITOR_ANS_JPAKE_GET_PWDATA,
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/monitor_wrap.c.audit3 openssh-5.9p0/monitor_wrap.c
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/monitor_wrap.c.audit3 2011-09-03 19:28:52.963088596 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/monitor_wrap.c 2011-09-03 19:28:54.602024893 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -1505,3 +1505,41 @@ mm_jpake_check_confirm(const BIGNUM *k,
|
|
Jan F. Chadima |
69dd72 |
return success;
|
|
Jan F. Chadima |
69dd72 |
}
|
|
Jan F. Chadima |
69dd72 |
#endif /* JPAKE */
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+#ifdef SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+mm_audit_unsupported_body(int what)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+ Buffer m;
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ buffer_init(&m);
|
|
Jan F. Chadima |
69dd72 |
+ buffer_put_int(&m, what);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_UNSUPPORTED, &m);
|
|
Jan F. Chadima |
69dd72 |
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUDIT_UNSUPPORTED,
|
|
Jan F. Chadima |
69dd72 |
+ &m);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ buffer_free(&m);
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+void
|
|
Jan F. Chadima |
69dd72 |
+mm_audit_kex_body(int ctos, char *cipher, char *mac, char *compress, pid_t pid,
|
|
Jan F. Chadima |
69dd72 |
+ uid_t uid)
|
|
Jan F. Chadima |
69dd72 |
+{
|
|
Jan F. Chadima |
69dd72 |
+ Buffer m;
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ buffer_init(&m);
|
|
Jan F. Chadima |
69dd72 |
+ buffer_put_int(&m, ctos);
|
|
Jan F. Chadima |
69dd72 |
+ buffer_put_cstring(&m, cipher);
|
|
Jan F. Chadima |
69dd72 |
+ buffer_put_cstring(&m, mac);
|
|
Jan F. Chadima |
69dd72 |
+ buffer_put_cstring(&m, compress);
|
|
Jan F. Chadima |
69dd72 |
+ buffer_put_int64(&m, pid);
|
|
Jan F. Chadima |
69dd72 |
+ buffer_put_int64(&m, uid);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_KEX, &m);
|
|
Jan F. Chadima |
69dd72 |
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUDIT_KEX,
|
|
Jan F. Chadima |
69dd72 |
+ &m);
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
+ buffer_free(&m);
|
|
Jan F. Chadima |
69dd72 |
+}
|
|
Jan F. Chadima |
69dd72 |
+#endif /* SSH_AUDIT_EVENTS */
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/monitor_wrap.h.audit3 openssh-5.9p0/monitor_wrap.h
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/monitor_wrap.h.audit3 2011-09-03 19:28:53.069087341 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/monitor_wrap.h 2011-09-03 19:28:54.704055439 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -78,6 +78,8 @@ void mm_sshpam_free_ctx(void *);
|
|
Jan F. Chadima |
69dd72 |
void mm_audit_event(ssh_audit_event_t);
|
|
Jan F. Chadima |
69dd72 |
int mm_audit_run_command(const char *);
|
|
Jan F. Chadima |
69dd72 |
void mm_audit_end_command(int, const char *);
|
|
Jan F. Chadima |
69dd72 |
+void mm_audit_unsupported_body(int);
|
|
Jan F. Chadima |
69dd72 |
+void mm_audit_kex_body(int, char *, char *, char *, pid_t, uid_t);
|
|
Jan F. Chadima |
69dd72 |
#endif
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
struct Session;
|
|
Jan F. Chadima |
69dd72 |
diff -up openssh-5.9p0/sshd.c.audit3 openssh-5.9p0/sshd.c
|
|
Jan F. Chadima |
69dd72 |
--- openssh-5.9p0/sshd.c.audit3 2011-09-03 19:28:51.758025429 +0200
|
|
Jan F. Chadima |
69dd72 |
+++ openssh-5.9p0/sshd.c 2011-09-03 19:28:54.835049403 +0200
|
|
Jan F. Chadima |
69dd72 |
@@ -118,6 +118,7 @@
|
|
Jan F. Chadima |
69dd72 |
#endif
|
|
Jan F. Chadima |
69dd72 |
#include "monitor_wrap.h"
|
|
Jan F. Chadima |
69dd72 |
#include "roaming.h"
|
|
Jan F. Chadima |
69dd72 |
+#include "audit.h"
|
|
Jan F. Chadima |
69dd72 |
#include "ssh-sandbox.h"
|
|
Jan F. Chadima |
69dd72 |
#include "version.h"
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
@@ -2204,6 +2205,10 @@ do_ssh1_kex(void)
|
|
Jan F. Chadima |
69dd72 |
if (cookie[i] != packet_get_char())
|
|
Jan F. Chadima |
69dd72 |
packet_disconnect("IP Spoofing check bytes do not match.");
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
+#ifdef SSH_AUDIT_EVENTS
|
|
Jan F. Chadima |
69dd72 |
+ audit_kex(2, cipher_name(cipher_type), "crc", "none");
|
|
Jan F. Chadima |
69dd72 |
+#endif
|
|
Jan F. Chadima |
69dd72 |
+
|
|
Jan F. Chadima |
69dd72 |
debug("Encryption type: %.200s", cipher_name(cipher_type));
|
|
Jan F. Chadima |
69dd72 |
|
|
Jan F. Chadima |
69dd72 |
/* Get the encrypted integer. */
|