diff options
author | miod <> | 2014-05-12 19:14:14 +0000 |
---|---|---|
committer | miod <> | 2014-05-12 19:14:14 +0000 |
commit | bb1f78b0976389edbc302ea662b80029cbf5ce5a (patch) | |
tree | f99b0c7d57d24dcda17ac624bffd72e594930568 | |
parent | 9d93f27329372e68682819911c1e89467694ad93 (diff) | |
download | openbsd-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/Makefile | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/crypto/shlib_version | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/shlib_version | 4 | ||||
-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_version | 2 | ||||
-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/Makefile | 7 | ||||
-rw-r--r-- | src/lib/libssl/ssl/shlib_version | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/pqueue/Makefile | 8 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/pqueue/pq_test.c | 24 |
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 | ||
3 | LIB= crypto | 3 | LIB= crypto |
4 | 4 | ||
@@ -198,9 +198,6 @@ SRCS+= p12_utl.c p12_npas.c pk12err.c p12_p8d.c p12_p8e.c | |||
198 | SRCS+= pk7_asn1.c pk7_lib.c pkcs7err.c pk7_doit.c pk7_smime.c pk7_attr.c | 198 | SRCS+= pk7_asn1.c pk7_lib.c pkcs7err.c pk7_doit.c pk7_smime.c pk7_attr.c |
199 | SRCS+= pk7_mime.c bio_pk7.c | 199 | SRCS+= pk7_mime.c bio_pk7.c |
200 | 200 | ||
201 | # pqueue/ | ||
202 | SRCS+= pqueue.c | ||
203 | |||
204 | # rand/ | 201 | # rand/ |
205 | SRCS+= randfile.c rand_lib.c rand_err.c | 202 | SRCS+= 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 @@ | |||
1 | major=26 | 1 | major=27 |
2 | minor=1 | 2 | minor=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 @@ | |||
1 | major=26 | 1 | major=27 |
2 | minor=1 | 2 | minor=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 | ||
64 | typedef struct _pqueue { | 63 | typedef 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 | ||
190 | void | ||
191 | pqueue_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 | |||
205 | pitem * | 190 | pitem * |
206 | pqueue_iterator(pqueue_s *pq) | 191 | pqueue_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); | |||
87 | pitem *pqueue_iterator(pqueue pq); | 87 | pitem *pqueue_iterator(pqueue pq); |
88 | pitem *pqueue_next(piterator *iter); | 88 | pitem *pqueue_next(piterator *iter); |
89 | 89 | ||
90 | void pqueue_print(pqueue pq); | ||
91 | int pqueue_size(pqueue pq); | 90 | int 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 @@ | |||
1 | major=24 | 1 | major=24 |
2 | minor=0 | 2 | minor=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 | ||
64 | typedef struct _pqueue { | 63 | typedef 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 | ||
190 | void | ||
191 | pqueue_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 | |||
205 | pitem * | 190 | pitem * |
206 | pqueue_iterator(pqueue_s *pq) | 191 | pqueue_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); | |||
87 | pitem *pqueue_iterator(pqueue pq); | 87 | pitem *pqueue_iterator(pqueue pq); |
88 | pitem *pqueue_next(piterator *iter); | 88 | pitem *pqueue_next(piterator *iter); |
89 | 89 | ||
90 | void pqueue_print(pqueue pq); | ||
91 | int pqueue_size(pqueue pq); | 90 | int 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 | ||
3 | LIB= ssl | 3 | LIB= 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 | ||
23 | SRCS+= s3_cbc.c | 24 | SRCS+= s3_cbc.c |
24 | 25 | ||
25 | HDRS= srtp.h ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h kssl.h | 26 | HDRS= 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 @@ | |||
1 | major=24 | 1 | major=24 |
2 | minor=0 | 2 | minor=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 | ||
3 | PROG= pq_test | 3 | PROG= pq_test |
4 | CRYPTO= ${.CURDIR}/../../../../lib/libssl/src/crypto | ||
5 | CFLAGS+= -I${CRYPTO}/pqueue | ||
6 | 4 | ||
7 | LDADD= -lcrypto | 5 | LDADD= -lssl -lcrypto |
8 | DPADD= ${LIBCRYPTO} | 6 | DPADD= ${LIBSSL} ${LIBCRYPTO} |
9 | 7 | ||
10 | REGRESS_TARGETS= regress-pq_test | 8 | REGRESS_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 */ |
63 | unsigned char prio1[8] = "supercal"; | 63 | unsigned char prio1[8] = "supercal"; |
64 | unsigned char prio2[8] = "ifragili"; | 64 | unsigned char prio2[8] = "ifragili"; |
65 | unsigned char prio3[8] = "sticexpi"; | 65 | unsigned char prio3[8] = "sticexpi"; |
66 | 66 | ||
67 | static void | ||
68 | pqueue_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 | |||
67 | int | 83 | int |
68 | main(void) | 84 | main(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 | ||