Make the PACKET/WPACKET code available to both libcrypto and libssl
authorMatt Caswell <matt@openssl.org>
Fri, 7 Jun 2019 15:32:49 +0000 (16:32 +0100)
committerPauli <paul.dale@oracle.com>
Thu, 11 Jul 2019 20:26:46 +0000 (06:26 +1000)
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9111)

17 files changed:
crypto/build.info
crypto/packet.c [moved from ssl/packet.c with 99% similarity]
include/internal/packet.h [moved from ssl/packet_locl.h with 100% similarity]
ssl/build.info
ssl/record/rec_layer_d1.c
ssl/record/rec_layer_s3.c
ssl/ssl_locl.h
ssl/ssl_rsa.c
test/asynciotest.c
test/bad_dtls_test.c
test/build.info
test/clienthellotest.c
test/packettest.c
test/servername_test.c
test/sslbuffertest.c
test/tls13ccstest.c
test/wpackettest.c

index b82978e1c7618ba6a8b02d50ca375473138a0c98..90ccbc8b543a84649112d454076e6d617220bd15 100644 (file)
@@ -75,7 +75,7 @@ SOURCE[../libcrypto]=$UTIL_COMMON \
         mem.c mem_sec.c mem_str.c mem_dbg.c \
         cversion.c info.c cpt_err.c ebcdic.c uid.c o_time.c o_dir.c \
         o_fopen.c getenv.c o_init.c o_fips.c init.c trace.c provider.c \
-        asn1_dsa.c $UPLINKSRC
+        asn1_dsa.c packet.c $UPLINKSRC
 DEFINE[../libcrypto]=$UTIL_DEFINE $UPLINKDEF
 SOURCE[../providers/fips]=$UTIL_COMMON
 DEFINE[../providers/fips]=$UTIL_DEFINE
similarity index 99%
rename from ssl/packet.c
rename to crypto/packet.c
index 26cf1eb496831984ab9f402c58901b3fd84dfbe3..cb6739b85b558f25771846d1bde579cfba64e8ee 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "packet_locl.h"
+#include "internal/packet.h"
 #include <openssl/sslerr.h>
 
 #define DEFAULT_BUF_SIZE    256
similarity index 100%
rename from ssl/packet_locl.h
rename to include/internal/packet.h
index bb2f1deb530066a7aae8c3e71e079975b446b74c..152810ba2519424ba4bf71f4b3aeef3f49181020 100644 (file)
@@ -1,6 +1,10 @@
 LIBS=../libssl
+#TODO: For now we just include the libcrypto packet.c in libssl as well. We
+#      could either continue to do it like this, or export all the WPACKET
+#      symbols so that libssl can use them like any other. Probably would do
+#      this privately so it does not become part of the public API.
 SOURCE[../libssl]=\
-        pqueue.c packet.c \
+        pqueue.c ../crypto/packet.c \
         statem/statem_srvr.c statem/statem_clnt.c  s3_lib.c  s3_enc.c record/rec_layer_s3.c \
         statem/statem_lib.c statem/extensions.c statem/extensions_srvr.c \
         statem/extensions_clnt.c statem/extensions_cust.c s3_cbc.c s3_msg.c \
index 821c9cc5ebe8d1813ccc125987eba567f82de422..1256f9e0c95d39e8aca41caf9723360f76223dfb 100644 (file)
@@ -13,7 +13,7 @@
 #include <openssl/evp.h>
 #include <openssl/buffer.h>
 #include "record_locl.h"
-#include "../packet_locl.h"
+#include "internal/packet.h"
 #include "internal/cryptlib.h"
 
 int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl)
index a9911328e61df39d736db4d083368f72f2cfaeec..9efaf54be29ada14ce9680042cca75f6b06673a8 100644 (file)
@@ -15,7 +15,7 @@
 #include <openssl/buffer.h>
 #include <openssl/rand.h>
 #include "record_locl.h"
-#include "../packet_locl.h"
+#include "internal/packet.h"
 
 #if     defined(OPENSSL_SMALL_FOOTPRINT) || \
         !(      defined(AES_ASM) &&     ( \
index 269f542f2aee245ceed6d6236f3fff03f6311e1f..a4278b21013b67b1e409eb8ea6b126b9454e4ec8 100644 (file)
@@ -30,7 +30,7 @@
 # include <openssl/ct.h>
 # include "record/record.h"
 # include "statem/statem.h"
-# include "packet_locl.h"
+# include "internal/packet.h"
 # include "internal/dane.h"
 # include "internal/refcount.h"
 # include "internal/tsan_assist.h"
index 897c8f2e772b515fb98a2cdeb09393b8ed78d069..2c447eea3e612d6d507c6a905a607e1332b51348 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include "ssl_locl.h"
-#include "packet_locl.h"
+#include "internal/packet.h"
 #include <openssl/bio.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
index 3bba098ad7a7f8975fbbd2e1537b5daf5e2b755d..bf0a20561e7a5ec3655362db617236bd7c5c0cb9 100644 (file)
@@ -13,7 +13,7 @@
 #include <openssl/bio.h>
 #include <openssl/err.h>
 
-#include "../ssl/packet_locl.h"
+#include "internal/packet.h"
 
 #include "ssltestlib.h"
 #include "testutil.h"
index 5f6b6a9a9da8928818c185eb895a3077633f9564..66b5e1d2eda8f21c8bd5ae7524eabef5f3fd2472 100644 (file)
@@ -37,7 +37,7 @@
 #include <openssl/err.h>
 #include <openssl/rand.h>
 #include <openssl/kdf.h>
-#include "../ssl/packet_locl.h"
+#include "internal/packet.h"
 #include "internal/nelem.h"
 #include "testutil.h"
 
index a61c0ce2befa123c881e545217ecd1f6caff85f4..e38f1422591b9634cd96b3fd3a69be2bf180ec8c 100644 (file)
@@ -587,7 +587,7 @@ IF[{- !$disabled{tests} -}]
   IF[{- !$disabled{shared} -}]
     PROGRAMS{noinst}=tls13secretstest
     SOURCE[tls13secretstest]=tls13secretstest.c
-    SOURCE[tls13secretstest]= ../ssl/tls13_enc.c ../ssl/packet.c
+    SOURCE[tls13secretstest]= ../ssl/tls13_enc.c ../crypto/packet.c
     INCLUDE[tls13secretstest]=.. ../include ../apps/include
     DEPEND[tls13secretstest]=../libcrypto ../libssl libtestutil.a
   ENDIF
index 0afad6dbd609db9fe0d93eda4bddf631a99c8af0..03b8745595b26c76c19c8afa3543316e893b9c22 100644 (file)
@@ -17,7 +17,7 @@
 #include <openssl/err.h>
 #include <time.h>
 
-#include "../ssl/packet_locl.h"
+#include "internal/packet.h"
 
 #include "testutil.h"
 
index 41d938a68ab281b08934892e6b17a266f8845b19..2d6c2a6ef99f5c749277de6afff4dca26e5265d9 100644 (file)
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "../ssl/packet_locl.h"
+#include "internal/packet.h"
 #include "testutil.h"
 
 #define BUF_LEN 255
index 86d261f375a0504fa550a21173cb40c1ec9edce7..3d19265db93b1f98f9e33e16442fed2fabc21f04 100644 (file)
@@ -18,7 +18,7 @@
 #include <openssl/err.h>
 #include <time.h>
 
-#include "../ssl/packet_locl.h"
+#include "internal/packet.h"
 
 #include "testutil.h"
 #include "internal/nelem.h"
index 9a5ec2b9582a036aee43f396294c2c6eee02a5fe..e8293f7defc70eb2dc3269e4753f57c650009c08 100644 (file)
@@ -13,7 +13,7 @@
 #include <openssl/bio.h>
 #include <openssl/err.h>
 
-#include "../ssl/packet_locl.h"
+#include "internal/packet.h"
 
 #include "ssltestlib.h"
 #include "testutil.h"
index 1d0a268615c783cc7c33ba5212de1f5067b5a08c..999ca5700a25d3a18232ae2a08b55a07fa4d2d9c 100644 (file)
@@ -11,7 +11,7 @@
 #include <string.h>
 #include "ssltestlib.h"
 #include "testutil.h"
-#include "../ssl/packet_locl.h"
+#include "internal/packet.h"
 
 static char *cert = NULL;
 static char *privkey = NULL;
index 0a27c639eacd6ecd30887a1c5c9be72185726173..abb001ea14228aaa48e66d81148875b79a4d96ad 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <string.h>
 #include <openssl/buffer.h>
-#include "../ssl/packet_locl.h"
+#include "internal/packet.h"
 #include "testutil.h"
 
 static const unsigned char simple1[] = { 0xff };