summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiod <>2014-05-12 19:14:14 +0000
committermiod <>2014-05-12 19:14:14 +0000
commitbb1f78b0976389edbc302ea662b80029cbf5ce5a (patch)
treef99b0c7d57d24dcda17ac624bffd72e594930568
parent9d93f27329372e68682819911c1e89467694ad93 (diff)
downloadopenbsd-bb1f78b0976389edbc302ea662b80029cbf5ce5a.tar.gz
openbsd-bb1f78b0976389edbc302ea662b80029cbf5ce5a.tar.bz2
openbsd-bb1f78b0976389edbc302ea662b80029cbf5ce5a.zip
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.
-rw-r--r--src/lib/libcrypto/crypto/Makefile7
-rw-r--r--src/lib/libcrypto/crypto/shlib_version4
-rw-r--r--src/lib/libcrypto/shlib_version4
-rw-r--r--src/lib/libssl/pqueue.c (renamed from src/lib/libcrypto/pqueue/pqueue.c)21
-rw-r--r--src/lib/libssl/pqueue.h (renamed from src/lib/libcrypto/pqueue/pqueue.h)1
-rw-r--r--src/lib/libssl/shlib_version2
-rw-r--r--src/lib/libssl/src/ssl/pqueue.c (renamed from src/lib/libssl/src/crypto/pqueue/pqueue.c)21
-rw-r--r--src/lib/libssl/src/ssl/pqueue.h (renamed from src/lib/libssl/src/crypto/pqueue/pqueue.h)1
-rw-r--r--src/lib/libssl/ssl/Makefile7
-rw-r--r--src/lib/libssl/ssl/shlib_version2
-rw-r--r--src/regress/lib/libcrypto/pqueue/Makefile8
-rw-r--r--src/regress/lib/libcrypto/pqueue/pq_test.c24
12 files changed, 40 insertions, 62 deletions
diff --git a/src/lib/libcrypto/crypto/Makefile b/src/lib/libcrypto/crypto/Makefile
index 5fefdb1cf0..ce04ac9e61 100644
--- a/src/lib/libcrypto/crypto/Makefile
+++ b/src/lib/libcrypto/crypto/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.31 2014/05/04 17:12:19 miod Exp $ 1# $OpenBSD: Makefile,v 1.32 2014/05/12 19:14:14 miod Exp $
2 2
3LIB= crypto 3LIB= crypto
4 4
@@ -198,9 +198,6 @@ SRCS+= p12_utl.c p12_npas.c pk12err.c p12_p8d.c p12_p8e.c
198SRCS+= pk7_asn1.c pk7_lib.c pkcs7err.c pk7_doit.c pk7_smime.c pk7_attr.c 198SRCS+= pk7_asn1.c pk7_lib.c pkcs7err.c pk7_doit.c pk7_smime.c pk7_attr.c
199SRCS+= pk7_mime.c bio_pk7.c 199SRCS+= pk7_mime.c bio_pk7.c
200 200
201# pqueue/
202SRCS+= pqueue.c
203
204# rand/ 201# rand/
205SRCS+= randfile.c rand_lib.c rand_err.c 202SRCS+= randfile.c rand_lib.c rand_err.c
206 203
@@ -304,7 +301,6 @@ SRCS+= v3_asid.c v3_addr.c
304 ${LCRYPTO_SRC}/perlasm \ 301 ${LCRYPTO_SRC}/perlasm \
305 ${LCRYPTO_SRC}/pkcs12 \ 302 ${LCRYPTO_SRC}/pkcs12 \
306 ${LCRYPTO_SRC}/pkcs7 \ 303 ${LCRYPTO_SRC}/pkcs7 \
307 ${LCRYPTO_SRC}/pqueue \
308 ${LCRYPTO_SRC}/rand \ 304 ${LCRYPTO_SRC}/rand \
309 ${LCRYPTO_SRC}/rc2 \ 305 ${LCRYPTO_SRC}/rc2 \
310 ${LCRYPTO_SRC}/rc4 \ 306 ${LCRYPTO_SRC}/rc4 \
@@ -367,7 +363,6 @@ HDRS=\
367 crypto/pem/pem2.h \ 363 crypto/pem/pem2.h \
368 crypto/pkcs12/pkcs12.h \ 364 crypto/pkcs12/pkcs12.h \
369 crypto/pkcs7/pkcs7.h \ 365 crypto/pkcs7/pkcs7.h \
370 crypto/pqueue/pqueue.h \
371 crypto/rand/rand.h \ 366 crypto/rand/rand.h \
372 crypto/rc2/rc2.h \ 367 crypto/rc2/rc2.h \
373 crypto/rc4/rc4.h \ 368 crypto/rc4/rc4.h \
diff --git a/src/lib/libcrypto/crypto/shlib_version b/src/lib/libcrypto/crypto/shlib_version
index 72168dfd16..54ef0c4cc0 100644
--- a/src/lib/libcrypto/crypto/shlib_version
+++ b/src/lib/libcrypto/crypto/shlib_version
@@ -1,2 +1,2 @@
1major=26 1major=27
2minor=1 2minor=0
diff --git a/src/lib/libcrypto/shlib_version b/src/lib/libcrypto/shlib_version
index 72168dfd16..54ef0c4cc0 100644
--- a/src/lib/libcrypto/shlib_version
+++ b/src/lib/libcrypto/shlib_version
@@ -1,2 +1,2 @@
1major=26 1major=27
2minor=1 2minor=0
diff --git a/src/lib/libcrypto/pqueue/pqueue.c b/src/lib/libssl/pqueue.c
index fc68ae19c3..99c118c3b6 100644
--- a/src/lib/libcrypto/pqueue/pqueue.c
+++ b/src/lib/libssl/pqueue.c
@@ -57,8 +57,7 @@
57 * 57 *
58 */ 58 */
59 59
60#include "cryptlib.h" 60#include <string.h>
61#include <openssl/bn.h>
62#include "pqueue.h" 61#include "pqueue.h"
63 62
64typedef struct _pqueue { 63typedef struct _pqueue {
@@ -175,7 +174,8 @@ pqueue_find(pqueue_s *pq, unsigned char *prio64be)
175 return NULL; 174 return NULL;
176 175
177 for (next = pq->items; next != NULL; next = next->next) { 176 for (next = pq->items; next != NULL; next = next->next) {
178 if (memcmp(next->priority, prio64be, 8) == 0) { 177 if (memcmp(next->priority, prio64be,
178 sizeof(next->priority)) == 0) {
179 found = next; 179 found = next;
180 break; 180 break;
181 } 181 }
@@ -187,21 +187,6 @@ pqueue_find(pqueue_s *pq, unsigned char *prio64be)
187 return found; 187 return found;
188} 188}
189 189
190void
191pqueue_print(pqueue_s *pq)
192{
193 pitem *item = pq->items;
194
195 while (item != NULL) {
196 printf("item\t%02x%02x%02x%02x%02x%02x%02x%02x\n",
197 item->priority[0], item->priority[1],
198 item->priority[2], item->priority[3],
199 item->priority[4], item->priority[5],
200 item->priority[6], item->priority[7]);
201 item = item->next;
202 }
203}
204
205pitem * 190pitem *
206pqueue_iterator(pqueue_s *pq) 191pqueue_iterator(pqueue_s *pq)
207{ 192{
diff --git a/src/lib/libcrypto/pqueue/pqueue.h b/src/lib/libssl/pqueue.h
index 729e9abaf2..6e7df8f35b 100644
--- a/src/lib/libcrypto/pqueue/pqueue.h
+++ b/src/lib/libssl/pqueue.h
@@ -87,7 +87,6 @@ pitem *pqueue_find(pqueue pq, unsigned char *prio64be);
87pitem *pqueue_iterator(pqueue pq); 87pitem *pqueue_iterator(pqueue pq);
88pitem *pqueue_next(piterator *iter); 88pitem *pqueue_next(piterator *iter);
89 89
90void pqueue_print(pqueue pq);
91int pqueue_size(pqueue pq); 90int pqueue_size(pqueue pq);
92 91
93#endif /* ! HEADER_PQUEUE_H */ 92#endif /* ! HEADER_PQUEUE_H */
diff --git a/src/lib/libssl/shlib_version b/src/lib/libssl/shlib_version
index 906022aa66..aa54cbb404 100644
--- a/src/lib/libssl/shlib_version
+++ b/src/lib/libssl/shlib_version
@@ -1,2 +1,2 @@
1major=24 1major=24
2minor=0 2minor=1
diff --git a/src/lib/libssl/src/crypto/pqueue/pqueue.c b/src/lib/libssl/src/ssl/pqueue.c
index fc68ae19c3..99c118c3b6 100644
--- a/src/lib/libssl/src/crypto/pqueue/pqueue.c
+++ b/src/lib/libssl/src/ssl/pqueue.c
@@ -57,8 +57,7 @@
57 * 57 *
58 */ 58 */
59 59
60#include "cryptlib.h" 60#include <string.h>
61#include <openssl/bn.h>
62#include "pqueue.h" 61#include "pqueue.h"
63 62
64typedef struct _pqueue { 63typedef struct _pqueue {
@@ -175,7 +174,8 @@ pqueue_find(pqueue_s *pq, unsigned char *prio64be)
175 return NULL; 174 return NULL;
176 175
177 for (next = pq->items; next != NULL; next = next->next) { 176 for (next = pq->items; next != NULL; next = next->next) {
178 if (memcmp(next->priority, prio64be, 8) == 0) { 177 if (memcmp(next->priority, prio64be,
178 sizeof(next->priority)) == 0) {
179 found = next; 179 found = next;
180 break; 180 break;
181 } 181 }
@@ -187,21 +187,6 @@ pqueue_find(pqueue_s *pq, unsigned char *prio64be)
187 return found; 187 return found;
188} 188}
189 189
190void
191pqueue_print(pqueue_s *pq)
192{
193 pitem *item = pq->items;
194
195 while (item != NULL) {
196 printf("item\t%02x%02x%02x%02x%02x%02x%02x%02x\n",
197 item->priority[0], item->priority[1],
198 item->priority[2], item->priority[3],
199 item->priority[4], item->priority[5],
200 item->priority[6], item->priority[7]);
201 item = item->next;
202 }
203}
204
205pitem * 190pitem *
206pqueue_iterator(pqueue_s *pq) 191pqueue_iterator(pqueue_s *pq)
207{ 192{
diff --git a/src/lib/libssl/src/crypto/pqueue/pqueue.h b/src/lib/libssl/src/ssl/pqueue.h
index 729e9abaf2..6e7df8f35b 100644
--- a/src/lib/libssl/src/crypto/pqueue/pqueue.h
+++ b/src/lib/libssl/src/ssl/pqueue.h
@@ -87,7 +87,6 @@ pitem *pqueue_find(pqueue pq, unsigned char *prio64be);
87pitem *pqueue_iterator(pqueue pq); 87pitem *pqueue_iterator(pqueue pq);
88pitem *pqueue_next(piterator *iter); 88pitem *pqueue_next(piterator *iter);
89 89
90void pqueue_print(pqueue pq);
91int pqueue_size(pqueue pq); 90int pqueue_size(pqueue pq);
92 91
93#endif /* ! HEADER_PQUEUE_H */ 92#endif /* ! HEADER_PQUEUE_H */
diff --git a/src/lib/libssl/ssl/Makefile b/src/lib/libssl/ssl/Makefile
index 737121fce4..8975572be8 100644
--- a/src/lib/libssl/ssl/Makefile
+++ b/src/lib/libssl/ssl/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.41 2014/05/05 15:03:22 tedu Exp $ 1# $OpenBSD: Makefile,v 1.42 2014/05/12 19:14:14 miod Exp $
2 2
3LIB= ssl 3LIB= ssl
4 4
@@ -19,10 +19,11 @@ SRCS=\
19 ssl_lib.c ssl_err2.c ssl_cert.c ssl_sess.c \ 19 ssl_lib.c ssl_err2.c ssl_cert.c ssl_sess.c \
20 ssl_ciph.c ssl_stat.c ssl_rsa.c \ 20 ssl_ciph.c ssl_stat.c ssl_rsa.c \
21 ssl_asn1.c ssl_txt.c ssl_algs.c \ 21 ssl_asn1.c ssl_txt.c ssl_algs.c \
22 bio_ssl.c ssl_err.c t1_reneg.c 22 bio_ssl.c ssl_err.c t1_reneg.c \
23 pqueue.c
23SRCS+= s3_cbc.c 24SRCS+= s3_cbc.c
24 25
25HDRS= srtp.h ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h kssl.h 26HDRS= srtp.h ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h kssl.h pqueue.h
26 27
27.PATH: ${LSSL_SRC} 28.PATH: ${LSSL_SRC}
28 29
diff --git a/src/lib/libssl/ssl/shlib_version b/src/lib/libssl/ssl/shlib_version
index 906022aa66..aa54cbb404 100644
--- a/src/lib/libssl/ssl/shlib_version
+++ b/src/lib/libssl/ssl/shlib_version
@@ -1,2 +1,2 @@
1major=24 1major=24
2minor=0 2minor=1
diff --git a/src/regress/lib/libcrypto/pqueue/Makefile b/src/regress/lib/libcrypto/pqueue/Makefile
index b817169a7f..8b2d27e052 100644
--- a/src/regress/lib/libcrypto/pqueue/Makefile
+++ b/src/regress/lib/libcrypto/pqueue/Makefile
@@ -1,11 +1,9 @@
1# $OpenBSD: Makefile,v 1.2 2014/05/06 20:40:26 miod Exp $ 1# $OpenBSD: Makefile,v 1.3 2014/05/12 19:14:14 miod Exp $
2 2
3PROG= pq_test 3PROG= pq_test
4CRYPTO= ${.CURDIR}/../../../../lib/libssl/src/crypto
5CFLAGS+= -I${CRYPTO}/pqueue
6 4
7LDADD= -lcrypto 5LDADD= -lssl -lcrypto
8DPADD= ${LIBCRYPTO} 6DPADD= ${LIBSSL} ${LIBCRYPTO}
9 7
10REGRESS_TARGETS= regress-pq_test 8REGRESS_TARGETS= regress-pq_test
11 9
diff --git a/src/regress/lib/libcrypto/pqueue/pq_test.c b/src/regress/lib/libcrypto/pqueue/pq_test.c
index 32c39cd507..fa78c8fa4c 100644
--- a/src/regress/lib/libcrypto/pqueue/pq_test.c
+++ b/src/regress/lib/libcrypto/pqueue/pq_test.c
@@ -57,13 +57,29 @@
57 * 57 *
58 */ 58 */
59 59
60#include "pqueue.h" 60#include <openssl/pqueue.h>
61 61
62/* remember to change expected.txt if you change these values */ 62/* remember to change expected.txt if you change these values */
63unsigned char prio1[8] = "supercal"; 63unsigned char prio1[8] = "supercal";
64unsigned char prio2[8] = "ifragili"; 64unsigned char prio2[8] = "ifragili";
65unsigned char prio3[8] = "sticexpi"; 65unsigned char prio3[8] = "sticexpi";
66 66
67static void
68pqueue_print(pqueue pq)
69{
70 pitem *iter, *item;
71
72 iter = pqueue_iterator(pq);
73 for (item = pqueue_next(&iter); item != NULL;
74 item = pqueue_next(&iter)) {
75 printf("item\t%02x%02x%02x%02x%02x%02x%02x%02x\n",
76 item->priority[0], item->priority[1],
77 item->priority[2], item->priority[3],
78 item->priority[4], item->priority[5],
79 item->priority[6], item->priority[7]);
80 }
81}
82
67int 83int
68main(void) 84main(void)
69{ 85{
@@ -82,13 +98,13 @@ main(void)
82 pqueue_insert(pq, item); 98 pqueue_insert(pq, item);
83 99
84 item = pqueue_find(pq, prio1); 100 item = pqueue_find(pq, prio1);
85 fprintf(stderr, "found %ld\n", item->priority); 101 fprintf(stderr, "found %p\n", item->priority);
86 102
87 item = pqueue_find(pq, prio2); 103 item = pqueue_find(pq, prio2);
88 fprintf(stderr, "found %ld\n", item->priority); 104 fprintf(stderr, "found %p\n", item->priority);
89 105
90 item = pqueue_find(pq, prio3); 106 item = pqueue_find(pq, prio3);
91 fprintf(stderr, "found %ld\n", item ? item->priority: 0); 107 fprintf(stderr, "found %p\n", item ? item->priority: 0);
92 108
93 pqueue_print(pq); 109 pqueue_print(pq);
94 110