Move Record layer methods code into a sub-directory
authorMatt Caswell <matt@openssl.org>
Tue, 19 Apr 2022 16:15:54 +0000 (17:15 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 18 Aug 2022 15:38:12 +0000 (16:38 +0100)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

ssl/build.info
ssl/record/build.info [new file with mode: 0644]
ssl/record/methods/build.info [new file with mode: 0644]
ssl/record/methods/tlsrecord.c [moved from ssl/record/tlsrecord.c with 99% similarity]

index 70b22954d314ab48b821736105be01916ccf36c8..8cde8b7e53bd00d91afe00fc30e5f4f450b77985 100644 (file)
@@ -1,19 +1,11 @@
+SUBDIRS=record
+
 LIBS=../libssl
 
 IF[{- !$disabled{quic} -}]
   SUBDIRS=quic
 ENDIF
 
-#Needed for the multiblock code in rec_layer_s3.c
-IF[{- !$disabled{asm} -}]
-  $AESDEF_x86=AES_ASM
-  $AESDEF_x86_64=AES_ASM
-
-  IF[$AESDEF_{- $target{asm_arch} -}]
-    $AESDEF=$AESDEF_{- $target{asm_arch} -}
-  ENDIF
-ENDIF
-
 $KTLSSRC=
 IF[{- !$disabled{ktls} -}]
   $KTLSSRC=ktls.c
@@ -21,22 +13,21 @@ ENDIF
 
 SOURCE[../libssl]=\
         pqueue.c time.c \
-        statem/statem_srvr.c statem/statem_clnt.c  s3_lib.c  s3_enc.c record/rec_layer_s3.c \
+        statem/statem_srvr.c statem/statem_clnt.c  s3_lib.c  s3_enc.c \
         statem/statem_lib.c statem/extensions.c statem/extensions_srvr.c \
         statem/extensions_clnt.c statem/extensions_cust.c s3_msg.c \
-        methods.c   t1_lib.c  t1_enc.c tls13_enc.c \
-        d1_lib.c  record/rec_layer_d1.c d1_msg.c \
+        methods.c t1_lib.c  t1_enc.c tls13_enc.c \
+        d1_lib.c d1_msg.c \
         statem/statem_dtls.c d1_srtp.c \
         ssl_lib.c ssl_cert.c ssl_sess.c \
         ssl_ciph.c ssl_stat.c ssl_rsa.c \
         ssl_asn1.c ssl_txt.c ssl_init.c ssl_conf.c  ssl_mcnf.c \
         bio_ssl.c ssl_err.c ssl_err_legacy.c tls_srp.c t1_trce.c ssl_utst.c \
-        record/ssl3_buffer.c record/ssl3_record.c record/dtls1_bitmap.c \
-        statem/statem.c record/ssl3_record_tls13.c record/tlsrecord.c\
+        statem/statem.c \
         tls_depr.c $KTLSSRC
 # For shared builds we need to include the libcrypto packet.c and sources
-# needed in providers (s3_cbc.c and record/tls_pad.c) in libssl as well.
-SHARED_SOURCE[../libssl]=record/tls_pad.c ../crypto/packet.c ../crypto/quic_vlint.c
+# needed in providers (s3_cbc.c) in libssl as well.
+SHARED_SOURCE[../libssl]=../crypto/packet.c ../crypto/quic_vlint.c
 IF[{- !$disabled{'deprecated-3.0'} -}]
   SHARED_SOURCE[../libssl]=s3_cbc.c
   SOURCE[../libssl]=ssl_rsa_legacy.c
@@ -46,7 +37,4 @@ IF[{- !$disabled{quic} -}]
   SOURCE[../libssl]=priority_queue.c event_queue.c
 ENDIF
 
-DEFINE[../libssl]=$AESDEF
-
-SOURCE[../providers/libcommon.a]=record/tls_pad.c
 SOURCE[../providers/libdefault.a ../providers/libfips.a]=s3_cbc.c
diff --git a/ssl/record/build.info b/ssl/record/build.info
new file mode 100644 (file)
index 0000000..3786669
--- /dev/null
@@ -0,0 +1,24 @@
+SUBDIRS=methods
+
+#Needed for the multiblock code in rec_layer_s3.c
+IF[{- !$disabled{asm} -}]
+  $AESDEF_x86=AES_ASM
+  $AESDEF_x86_64=AES_ASM
+
+  IF[$AESDEF_{- $target{asm_arch} -}]
+    $AESDEF=$AESDEF_{- $target{asm_arch} -}
+  ENDIF
+ENDIF
+
+SOURCE[../../libssl]=\
+        rec_layer_s3.c rec_layer_d1.c ssl3_buffer.c  ssl3_record.c \
+        dtls1_bitmap.c ssl3_record_tls13.c
+
+# For shared builds we need to include the sources needed in providers
+# (tls_pad.c) in libssl as well.
+SHARED_SOURCE[../../libssl]=tls_pad.c
+
+SOURCE[../../providers/libcommon.a]=tls_pad.c
+
+DEFINE[../../libssl]=$AESDEF
+
diff --git a/ssl/record/methods/build.info b/ssl/record/methods/build.info
new file mode 100644 (file)
index 0000000..430a3a1
--- /dev/null
@@ -0,0 +1,4 @@
+LIBS=../libssl
+
+SOURCE[../../../libssl]=\
+        tlsrecord.c
similarity index 99%
rename from ssl/record/tlsrecord.c
rename to ssl/record/methods/tlsrecord.c
index a286aac29115286fef490cb66d02acb068ac91a9..691dd12ca57d0c38c10dd30c62f7f1a76cc952f9 100644 (file)
@@ -14,8 +14,8 @@
 #include <openssl/rand.h>
 #include "internal/e_os.h"
 #include "internal/packet.h"
-#include "../ssl_local.h"
-#include "record_local.h"
+#include "../../ssl_local.h"
+#include "../record_local.h"
 
 /* Protocol version specific function pointers */
 struct record_functions_st