Script started on Tue Mar 3 07:35:34 2015
doctor.nl2k.ab.ca//usr/source/openssh-SNAP-20150304$ make tests
[ -d `pwd`/regress ] || mkdir -p `pwd`/regress
[ -d `pwd`/regress/unittests ] || mkdir -p `pwd`/regress/unittests
[ -d `pwd`/regress/unittests/test_helper ] || mkdir -p
`pwd`/regress/unittests/test_helper
[ -d `pwd`/regress/unittests/sshbuf ] || mkdir -p
`pwd`/regress/unittests/sshbuf
[ -d `pwd`/regress/unittests/sshkey ] || mkdir -p
`pwd`/regress/unittests/sshkey
[ -d `pwd`/regress/unittests/bitmap ] || mkdir -p
`pwd`/regress/unittests/bitmap
[ -d `pwd`/regress/unittests/hostkeys ] || mkdir -p
`pwd`/regress/unittests/hostkeys
[ -d `pwd`/regress/unittests/kex ] || mkdir -p `pwd`/regress/unittests/kex
[ -f `pwd`/regress/Makefile ] || ln -s `cd . && pwd`/regress/Makefile
`pwd`/regress/Makefile
(cd openbsd-compat && make)
/usr/bin/gcc -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o
sshconnect1.o sshconnect2.o mux.o roaming_common.o roaming_client.o -L.
-Lopenbsd-compat/ -L/usr/contrib//lib -Wl,-z,relro -Wl,-z,now
-Wl,-z,noexecstack -lssh -lopenbsd-compat -lcrypto -ldl -lutil -lz
/usr/bin/gcc -o sshd sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o
audit.o audit-bsm.o audit-linux.o platform.o sshpty.o sshlogin.o servconf.o
serverloop.o auth.o auth1.o auth2.o auth-options.o session.o auth-chall.o
auth2-chall.o groupaccess.o auth-skey.o auth-bsdauth.o auth2-hostbased.o
auth2-kbdint.o auth2-none.o auth2-passwd.o auth2-pubkey.o monitor_mm.o
monitor.o monitor_wrap.o auth-krb5.o auth2-gss.o gss-serv.o gss-serv-krb5.o
loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o sftp-server.o
sftp-common.o roaming_common.o roaming_serv.o sandbox-null.o sandbox-rlimit.o
sandbox-systrace.o sandbox-darwin.o sandbox-seccomp-filter.o sandbox-capsicum.o
-L. -Lopenbsd-compat/ -L/usr/contrib//lib -Wl,-z,relro -Wl,-z,now
-Wl,-z,noexecstack -lssh -lopenbsd-compat -lcrypto -ldl -lutil -lz
/usr/bin/gcc -o ssh-add ssh-add.o -L. -Lopenbsd-compat/ -L/usr/contrib//lib
-Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -lssh -lopenbsd-compat -lcrypto -ldl
-lutil -lz
/usr/bin/gcc -o ssh-keygen ssh-keygen.o -L. -Lopenbsd-compat/
-L/usr/contrib//lib -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -lssh
-lopenbsd-compat -lcrypto -ldl -lutil -lz
/usr/bin/gcc -o ssh-keyscan ssh-keyscan.o roaming_dummy.o -L. -Lopenbsd-compat/
-L/usr/contrib//lib -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -lssh
-lopenbsd-compat -lssh -lcrypto -ldl -lutil -lz
/usr/bin/gcc -o ssh-keysign ssh-keysign.o readconf.o roaming_dummy.o -L.
-Lopenbsd-compat/ -L/usr/contrib//lib -Wl,-z,relro -Wl,-z,now
-Wl,-z,noexecstack -lssh -lopenbsd-compat -lcrypto -ldl -lutil -lz
/usr/bin/gcc -o ssh-pkcs11-helper ssh-pkcs11-helper.o ssh-pkcs11.o -L.
-Lopenbsd-compat/ -L/usr/contrib//lib -Wl,-z,relro -Wl,-z,now
-Wl,-z,noexecstack -lssh -lopenbsd-compat -lssh -lopenbsd-compat -lcrypto -ldl
-lutil -lz
/usr/bin/gcc -o ssh-agent ssh-agent.o ssh-pkcs11-client.o -L. -Lopenbsd-compat/
-L/usr/contrib//lib -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -lssh
-lopenbsd-compat -lcrypto -ldl -lutil -lz
/usr/bin/gcc -o scp scp.o progressmeter.o bufaux.o -L. -Lopenbsd-compat/
-L/usr/contrib//lib -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -lssh
-lopenbsd-compat -lcrypto -ldl -lutil -lz
/usr/bin/gcc -o sftp-server sftp-server.o sftp-common.o sftp-server-main.o -L.
-Lopenbsd-compat/ -L/usr/contrib//lib -Wl,-z,relro -Wl,-z,now
-Wl,-z,noexecstack -lssh -lopenbsd-compat -lcrypto -ldl -lutil -lz
/usr/bin/gcc -o sftp progressmeter.o sftp.o sftp-client.o sftp-common.o
sftp-glob.o -L. -Lopenbsd-compat/ -L/usr/contrib//lib -Wl,-z,relro -Wl,-z,now
-Wl,-z,noexecstack -lssh -lopenbsd-compat -lcrypto -ldl -lutil -lz
/usr/bin/gcc -g -O2 -Wall -Wall -Wpointer-arith -Wuninitialized -Wsign-compare
-Wformat-security -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -fno-builtin-memset
-I. -I. -I/usr/contrib//include -DSSHDIR=\"/etc\"
-D_PATH_SSH_PROGRAM=\"/usr/contrib/bin/ssh\"
-D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/contrib/libexec/ssh-askpass\"
-D_PATH_SFTP_SERVER=\"/usr/contrib/libexec/sftp-server\"
-D_PATH_SSH_KEY_SIGN=\"/usr/contrib/libexec/ssh-keysign\"
-D_PATH_SSH_PKCS11_HELPER=\"/usr/contrib/libexec/ssh-pkcs11-helper\"
-D_PATH_SSH_PIDDIR=\"/var/run\"
-D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -DHAVE_CONFIG_H -c
regress/unittests/test_helper/test_helper.c -o
regress/unittests/test_helper/test_helper.o
regress/unittests/test_helper/test_helper.c: In function `test_data_file':
regress/unittests/test_helper/test_helper.c:177: warning: implicit declaration
of function `strlcpy'
regress/unittests/test_helper/test_helper.c: At top level:
regress/unittests/test_helper/test_helper.c:196: parse error before
"__unused"
*** Error code 1
Stop.
doctor.nl2k.ab.ca//usr/source/openssh-SNAP-20150304$ less regress/unittests/test
_helper/test_helper.c
[?1h=[67;1H[K/* $OpenBSD: test_helper.c,v 1.5 2015/02/16 22:20:50 djm Exp $
*/
/*
* Copyright (c) 2011 Damien Miller <djm at mindrot.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* Utility functions/framework for regress tests */
#include "includes.h"
#include <sys/types.h>
#include <sys/param.h>
#include <sys/uio.h>
#include <fcntl.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <signal.h>
#include <openssl/bn.h>
#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) &&
!defined(BROKEN_STRNVIS)
# include <vis.h>
#endif
#include "test_helper.h"
#include "atomicio.h"
#define TEST_CHECK_INT(r, pred) do { \
switch (pred) { \
case TEST_EQ: \
if (r == 0) \
return; \
break; \
case TEST_NE: \
if (r != 0) \
return; \
break; \
case TEST_LT: \
if (r < 0) \
return; \
break; \
case TEST_LE: \
if (r <= 0) \
return; \
break; \
case TEST_GT: \
if (r > 0) \
return; \
[67;1H[Kregress/unittests/test_helper/test_helper.c[67;1H[67;1H[K
break; \
case TEST_GE: \
if (r >= 0) \
return; \
break; \
default: \
abort(); \
} \
} while (0)
#define TEST_CHECK(x1, x2, pred) do { \
switch (pred) { \
case TEST_EQ: \
if (x1 == x2) \
return; \
break; \
case TEST_NE: \
if (x1 != x2) \
return; \
break; \
case TEST_LT: \
if (x1 < x2) \
return; \
break; \
case TEST_LE: \
if (x1 <= x2) \
return; \
break; \
case TEST_GT: \
if (x1 > x2) \
return; \
break; \
case TEST_GE: \
if (x1 >= x2) \
return; \
break; \
default: \
abort(); \
} \
} while (0)
extern char *__progname;
static int verbose_mode = 0;
static int quiet_mode = 0;
static char *active_test_name = NULL;
static u_int test_number = 0;
static test_onerror_func_t *test_onerror = NULL;
static void *onerror_ctx = NULL;
static const char *data_dir = NULL;
static char subtest_info[512];
int
main(int argc, char **argv)
{
int ch;
/* Handle systems without __progname */
if (__progname == NULL) {
__progname = strrchr(argv[0], '/');
if (__progname == NULL || __progname[1] == '\0')
__progname = argv[0];
else
__progname++;
if ((__progname = strdup(__progname)) == NULL) {
fprintf(stderr, "strdup failed\n");
[67;1H[K:[67;1H[67;1H[K exit(1);
}
}
while ((ch = getopt(argc, argv, "vqd:")) != -1) {
switch (ch) {
case 'd':
data_dir = optarg;
break;
case 'q':
verbose_mode = 0;
quiet_mode = 1;
break;
case 'v':
verbose_mode = 1;
quiet_mode = 0;
break;
default:
fprintf(stderr, "Unrecognised command line
option\n");
fprintf(stderr, "Usage: %s [-v]\n",
__progname);
exit(1);
}
}
setvbuf(stdout, NULL, _IONBF, 0);
if (!quiet_mode)
printf("%s: ", __progname);
if (verbose_mode)
printf("\n");
tests();
if (!quiet_mode)
printf(" %u tests ok\n", test_number);
return 0;
}
const char *
test_data_file(const char *name)
{
static char ret[PATH_MAX];
if (data_dir != NULL)
snprintf(ret, sizeof(ret), "%s/%s", data_dir, name);
else
strlcpy(ret, name, sizeof(ret));
if (access(ret, F_OK) != 0) {
fprintf(stderr, "Cannot access data file %s: %s\n",
ret, strerror(errno));
exit(1);
}
return ret;
}
void
test_info(char *s, size_t len)
{
snprintf(s, len, "In test %u: \"%s\"%s%s\n",
test_number,
active_test_name == NULL ? "<none>" :
active_test_name,
*subtest_info != '\0' ? " - " : "",
subtest_info);
}
#ifdef SIGINFO
static void
siginfo(int unused __unused)
{
char buf[256];
[67;1H[K:[67;1H[67;1H[K
test_info(buf, sizeof(buf));
atomicio(vwrite, STDERR_FILENO, buf, strlen(buf));
}
#endif
void
test_start(const char *n)
{
assert(active_test_name == NULL);
assert((active_test_name = strdup(n)) != NULL);
*subtest_info = '\0';
if (verbose_mode)
printf("test %u - \"%s\": ", test_number,
active_test_name);
test_number++;
#ifdef SIGINFO
signal(SIGINFO, siginfo);
#endif
}
void
set_onerror_func(test_onerror_func_t *f, void *ctx)
{
test_onerror = f;
onerror_ctx = ctx;
}
void
test_done(void)
{
*subtest_info = '\0';
assert(active_test_name != NULL);
free(active_test_name);
active_test_name = NULL;
if (verbose_mode)
printf("OK\n");
else if (!quiet_mode) {
printf(".");
fflush(stdout);
}
}
void
test_subtest_info(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vsnprintf(subtest_info, sizeof(subtest_info), fmt, ap);
va_end(ap);
}
void
ssl_err_check(const char *file, int line)
{
long openssl_error = ERR_get_error();
if (openssl_error == 0)
return;
fprintf(stderr, "\n%s:%d: uncaught OpenSSL error: %s",
file, line, ERR_error_string(openssl_error, NULL));
abort();
}
static const char *
[67;1H[K:[67;1H[67;1H[Kpred_name(enum test_predicate p)
{
switch (p) {
case TEST_EQ:
return "EQ";
case TEST_NE:
return "NE";
case TEST_LT:
return "LT";
case TEST_LE:
return "LE";
case TEST_GT:
return "GT";
case TEST_GE:
return "GE";
default:
return "UNKNOWN";
}
}
static void
test_die(void)
{
if (test_onerror != NULL)
test_onerror(onerror_ctx);
abort();
}
static void
test_header(const char *file, int line, const char *a1, const char *a2,
const char *name, enum test_predicate pred)
{
fprintf(stderr, "\n%s:%d test #%u \"%s\"%s%s\n",
file, line, test_number, active_test_name,
*subtest_info != '\0' ? " - " : "",
subtest_info);
fprintf(stderr, "ASSERT_%s_%s(%s%s%s) failed:\n",
name, pred_name(pred), a1,
a2 != NULL ? ", " : "", a2 != NULL ? a2 :
"");
}
void
assert_bignum(const char *file, int line, const char *a1, const char *a2,
const BIGNUM *aa1, const BIGNUM *aa2, enum test_predicate pred)
{
int r = BN_cmp(aa1, aa2);
TEST_CHECK_INT(r, pred);
test_header(file, line, a1, a2, "BIGNUM", pred);
fprintf(stderr, "%12s = 0x%s\n", a1, BN_bn2hex(aa1));
fprintf(stderr, "%12s = 0x%s\n", a2, BN_bn2hex(aa2));
test_die();
}
void
assert_string(const char *file, int line, const char *a1, const char *a2,
const char *aa1, const char *aa2, enum test_predicate pred)
{
int r;
/* Verify pointers are not NULL */
assert_ptr(file, line, a1, "NULL", aa1, NULL, TEST_NE);
assert_ptr(file, line, a2, "NULL", aa2, NULL, TEST_NE);
r = strcmp(aa1, aa2);
TEST_CHECK_INT(r, pred);
test_header(file, line, a1, a2, "STRING", pred);
[67;1H[K:[67;1H[67;1H[K fprintf(stderr, "%12s = %s (len
%zu)\n", a1, aa1, strlen(aa1));
fprintf(stderr, "%12s = %s (len %zu)\n", a2, aa2,
strlen(aa2));
test_die();
}
static char *
tohex(const void *_s, size_t l)
{
u_int8_t *s = (u_int8_t *)_s;
size_t i, j;
const char *hex = "0123456789abcdef";
char *r = malloc((l * 2) + 1);
assert(r != NULL);
for (i = j = 0; i < l; i++) {
r[j++] = hex[(s[i] >> 4) & 0xf];
r[j++] = hex[s[i] & 0xf];
}
r[j] = '\0';
return r;
}
void
assert_mem(const char *file, int line, const char *a1, const char *a2,
const void *aa1, const void *aa2, size_t l, enum test_predicate pred)
{
int r;
if (l == 0)
return;
/* If length is >0, then verify pointers are not NULL */
assert_ptr(file, line, a1, "NULL", aa1, NULL, TEST_NE);
assert_ptr(file, line, a2, "NULL", aa2, NULL, TEST_NE);
r = memcmp(aa1, aa2, l);
TEST_CHECK_INT(r, pred);
test_header(file, line, a1, a2, "STRING", pred);
fprintf(stderr, "%12s = %s (len %zu)\n", a1, tohex(aa1, MIN(l,
256)), l)
;
fprintf(stderr, "%12s = %s (len %zu)\n", a2, tohex(aa2, MIN(l,
256)), l)
;
test_die();
}
static int
memvalcmp(const u_int8_t *s, u_char v, size_t l, size_t *where)
{
size_t i;
for (i = 0; i < l; i++) {
if (s[i] != v) {
*where = i;
return 1;
}
}
return 0;
}
void
assert_mem_filled(const char *file, int line, const char *a1,
const void *aa1, u_char v, size_t l, enum test_predicate pred)
{
size_t where = -1;
int r;
char tmp[64];
[67;1H[K:[67;1H[K[?1l>You have new mail in /var/mail/doctor
doctor.nl2k.ab.ca//usr/source/openssh-SNAP-20150304$ exit
exit
Script done on Tue Mar 3 07:36:47 2015
--
Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
God,Queen and country!Never Satan President Republic!Beware AntiChrist rising!
http://www.fullyfollow.me/rootnl2k Look at Psalms 14 and 53 on Atheism
You know everybody is ignorant, only on different subjects. -Will Rogers