diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-05-12 19:14:15 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-05-12 19:14:15 +0000 |
commit | 97c0b738a3a087600fe0e1b9a9a61b6213096276 (patch) | |
tree | be91984761e3fc5fb17718e9402c724b716db9fd /regress/lib | |
parent | 74442a9380130318b2589077567fc5246e7a9bfb (diff) |
Move the `pqueue' part of libcrypto, which is a glorified sorted linked list
of 64-bit data, and only used by DTLS, to libssl where it belongs.
Remove pqueue_print() which is a debugging interface and serves no useful
purpose, except for the regress test, which grows its own pqueue_print()
routine.
Bump libcrypto major and libssl minor.
WARNING: do not update your tree right now, more changes are coming, which
will ride the libcrypto major bump.
Diffstat (limited to 'regress/lib')
-rw-r--r-- | regress/lib/libcrypto/pqueue/Makefile | 8 | ||||
-rw-r--r-- | regress/lib/libcrypto/pqueue/pq_test.c | 24 |
2 files changed, 23 insertions, 9 deletions
diff --git a/regress/lib/libcrypto/pqueue/Makefile b/regress/lib/libcrypto/pqueue/Makefile index b817169a7fa..8b2d27e0525 100644 --- a/regress/lib/libcrypto/pqueue/Makefile +++ b/regress/lib/libcrypto/pqueue/Makefile @@ -1,11 +1,9 @@ -# $OpenBSD: Makefile,v 1.2 2014/05/06 20:40:26 miod Exp $ +# $OpenBSD: Makefile,v 1.3 2014/05/12 19:14:14 miod Exp $ PROG= pq_test -CRYPTO= ${.CURDIR}/../../../../lib/libssl/src/crypto -CFLAGS+= -I${CRYPTO}/pqueue -LDADD= -lcrypto -DPADD= ${LIBCRYPTO} +LDADD= -lssl -lcrypto +DPADD= ${LIBSSL} ${LIBCRYPTO} REGRESS_TARGETS= regress-pq_test diff --git a/regress/lib/libcrypto/pqueue/pq_test.c b/regress/lib/libcrypto/pqueue/pq_test.c index 32c39cd5074..fa78c8fa4c9 100644 --- a/regress/lib/libcrypto/pqueue/pq_test.c +++ b/regress/lib/libcrypto/pqueue/pq_test.c @@ -57,13 +57,29 @@ * */ -#include "pqueue.h" +#include <openssl/pqueue.h> /* remember to change expected.txt if you change these values */ unsigned char prio1[8] = "supercal"; unsigned char prio2[8] = "ifragili"; unsigned char prio3[8] = "sticexpi"; +static void +pqueue_print(pqueue pq) +{ + pitem *iter, *item; + + iter = pqueue_iterator(pq); + for (item = pqueue_next(&iter); item != NULL; + item = pqueue_next(&iter)) { + printf("item\t%02x%02x%02x%02x%02x%02x%02x%02x\n", + item->priority[0], item->priority[1], + item->priority[2], item->priority[3], + item->priority[4], item->priority[5], + item->priority[6], item->priority[7]); + } +} + int main(void) { @@ -82,13 +98,13 @@ main(void) pqueue_insert(pq, item); item = pqueue_find(pq, prio1); - fprintf(stderr, "found %ld\n", item->priority); + fprintf(stderr, "found %p\n", item->priority); item = pqueue_find(pq, prio2); - fprintf(stderr, "found %ld\n", item->priority); + fprintf(stderr, "found %p\n", item->priority); item = pqueue_find(pq, prio3); - fprintf(stderr, "found %ld\n", item ? item->priority: 0); + fprintf(stderr, "found %p\n", item ? item->priority: 0); pqueue_print(pq); |