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 b82978e..90ccbc8 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 26cf1eb..cb6739b 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 bb2f1de..152810b 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 821c9cc..1256f9e 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 a991132..9efaf54 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 269f542..a4278b2 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 897c8f2..2c447ee 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 3bba098..bf0a205 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 5f6b6a9..66b5e1d 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 a61c0ce..e38f142 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 0afad6d..03b8745 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 41d938a..2d6c2a6 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 86d261f..3d19265 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 9a5ec2b..e8293f7 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 1d0a268..999ca57 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 0a27c63..abb001e 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 };