shithub: riscv

Download patch

ref: 44cbb293088840d5813a69c6dc850b0444c4e27b
parent: c3c726a5d062fb11c84ec84a6028d02592ae8585
author: cinap_lenrek <[email protected]>
date: Sun Apr 10 16:23:18 EDT 2016

libsec: make #include headers consistent

--- a/sys/src/libsec/mkfile
+++ b/sys/src/libsec/mkfile
@@ -33,9 +33,9 @@
 	for(objtype in $CPUS) mk $MKFLAGS install
 
 everything:V:
-	rm -f */*.[012456789kqv]
+	rm -f */*.[$OS]
 	for(objtype in $CPUS)@{
 		echo $objtype
 		mk $MKFLAGS install
 	}
-	rm -f */*.[012456789kqv]
+	rm -f */*.[$OS]
--- a/sys/src/libsec/port/aes.c
+++ b/sys/src/libsec/port/aes.c
@@ -28,9 +28,7 @@
  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#include <u.h>
-#include <libc.h>
-#include <mp.h>
+#include "os.h"
 #include <libsec.h>
 
 typedef uchar	u8;
--- a/sys/src/libsec/port/aes_gcm.c
+++ b/sys/src/libsec/port/aes_gcm.c
@@ -1,6 +1,4 @@
-#include <u.h>
-#include <libc.h>
-#include <mp.h>
+#include "os.h"
 #include <libsec.h>
 
 static void
--- a/sys/src/libsec/port/aes_xts.c
+++ b/sys/src/libsec/port/aes_xts.c
@@ -1,7 +1,6 @@
 // Author Taru Karttunen <[email protected]>
 // This file can be used as both Public Domain or Creative Commons CC0.
-#include <u.h>
-#include <libc.h>
+#include "os.h"
 #include <libsec.h>
 
 #define AesBlockSize 16
--- a/sys/src/libsec/port/aesgcmtest.c
+++ b/sys/src/libsec/port/aesgcmtest.c
@@ -1,7 +1,7 @@
 #include <u.h>
 #include <libc.h>
-#include <libsec.h>
 #include <mp.h>
+#include <libsec.h>
 
 typedef struct Test Test;
 struct Test
--- a/sys/src/libsec/port/blowfish.c
+++ b/sys/src/libsec/port/blowfish.c
@@ -1,5 +1,4 @@
 #include "os.h"
-#include <mp.h>
 #include <libsec.h>
 
 // Blowfish block cipher.  See:
--- a/sys/src/libsec/port/ccpoly.c
+++ b/sys/src/libsec/port/ccpoly.c
@@ -1,5 +1,4 @@
-#include <u.h>
-#include <libc.h>
+#include "os.h"
 #include <libsec.h>
 
 static void
--- a/sys/src/libsec/port/chacha.c
+++ b/sys/src/libsec/port/chacha.c
@@ -7,8 +7,7 @@
 and including the changes to block number and nonce defined in RFC7539
 */
 
-#include <u.h>
-#include <libc.h>
+#include "os.h"
 #include <libsec.h>
 
 enum{
--- a/sys/src/libsec/port/curve25519.c
+++ b/sys/src/libsec/port/curve25519.c
@@ -45,8 +45,7 @@
  * uses many of the tricks described therein. Only the crecip function is taken
  * from the sample implementation.
  */
-#include <u.h>
-#include <libc.h>
+#include "os.h"
 #include <libsec.h>
 
 typedef vlong felem;
--- a/sys/src/libsec/port/decodepem.c
+++ b/sys/src/libsec/port/decodepem.c
@@ -1,6 +1,4 @@
-#include <u.h>
-#include <libc.h>
-#include <mp.h>
+#include "os.h"
 #include <libsec.h>
 
 #define STRLEN(s)	(sizeof(s)-1)
--- a/sys/src/libsec/port/des3CBC.c
+++ b/sys/src/libsec/port/des3CBC.c
@@ -1,5 +1,4 @@
 #include "os.h"
-#include <mp.h>
 #include <libsec.h>
 
 // Because of the way that non multiple of 8
--- a/sys/src/libsec/port/des3ECB.c
+++ b/sys/src/libsec/port/des3ECB.c
@@ -1,5 +1,4 @@
 #include "os.h"
-#include <mp.h>
 #include <libsec.h>
 
 // I wasn't sure what to do when the buffer was not
--- a/sys/src/libsec/port/desCBC.c
+++ b/sys/src/libsec/port/desCBC.c
@@ -1,5 +1,4 @@
 #include "os.h"
-#include <mp.h>
 #include <libsec.h>
 
 // Because of the way that non multiple of 8
--- a/sys/src/libsec/port/desECB.c
+++ b/sys/src/libsec/port/desECB.c
@@ -1,5 +1,4 @@
 #include "os.h"
-#include <mp.h>
 #include <libsec.h>
 
 // I wasn't sure what to do when the buffer was not
--- a/sys/src/libsec/port/fastrand.c
+++ b/sys/src/libsec/port/fastrand.c
@@ -1,6 +1,5 @@
-#include	<u.h>
-#include	<libc.h>
-#include	<libsec.h>
+#include "os.h"
+#include <libsec.h>
 
 /* 
  *  use the X917 random number generator to create random
--- a/sys/src/libsec/port/genrandom.c
+++ b/sys/src/libsec/port/genrandom.c
@@ -1,5 +1,4 @@
 #include "os.h"
-#include <mp.h>
 #include <libsec.h>
 
 typedef struct State{
--- a/sys/src/libsec/port/hkdf.c
+++ b/sys/src/libsec/port/hkdf.c
@@ -1,5 +1,4 @@
 #include "os.h"
-#include <mp.h>
 #include <libsec.h>
 
 /* rfc5869 */
--- a/sys/src/libsec/port/mkfile
+++ b/sys/src/libsec/port/mkfile
@@ -51,8 +51,7 @@
 </sys/src/cmd/mksyslib
 
 %.c:D:	%.mp
-	echo '#include <u.h>' > $target
-	echo '#include <libc.h>' >> $target
+	echo '#include "os.h"' > $target
 	echo '#include <mp.h>' >> $target
 	mpc $prereq >> $target
 	
--- a/sys/src/libsec/port/nfastrand.c
+++ b/sys/src/libsec/port/nfastrand.c
@@ -1,5 +1,4 @@
-#include <u.h>
-#include <libc.h>
+#include "os.h"
 #include <libsec.h>
 
 #define Maxrand	((1UL<<31)-1)
--- a/sys/src/libsec/port/pbkdf2.c
+++ b/sys/src/libsec/port/pbkdf2.c
@@ -1,5 +1,4 @@
 #include "os.h"
-#include <mp.h>
 #include <libsec.h>
 
 /* rfc2898 */
--- a/sys/src/libsec/port/poly1305.c
+++ b/sys/src/libsec/port/poly1305.c
@@ -1,5 +1,4 @@
-#include <u.h>
-#include <libc.h>
+#include "os.h"
 #include <libsec.h>
 
 /*
--- a/sys/src/libsec/port/prng.c
+++ b/sys/src/libsec/port/prng.c
@@ -1,5 +1,4 @@
 #include "os.h"
-#include <mp.h>
 #include <libsec.h>
 
 //
--- a/sys/src/libsec/port/readcert.c
+++ b/sys/src/libsec/port/readcert.c
@@ -1,7 +1,4 @@
-#include <u.h>
-#include <libc.h>
-#include <auth.h>
-#include <mp.h>
+#include "os.h"
 #include <libsec.h>
 
 static char*
--- a/sys/src/libsec/port/salsa.c
+++ b/sys/src/libsec/port/salsa.c
@@ -1,5 +1,4 @@
-#include <u.h>
-#include <libc.h>
+#include "os.h"
 #include <libsec.h>
 
 enum{
--- a/sys/src/libsec/port/thumb.c
+++ b/sys/src/libsec/port/thumb.c
@@ -1,8 +1,5 @@
-#include <u.h>
-#include <libc.h>
+#include "os.h"
 #include <bio.h>
-#include <auth.h>
-#include <mp.h>
 #include <libsec.h>
 
 enum{ ThumbTab = 1<<10 };
--- a/sys/src/libsec/port/tlshand.c
+++ b/sys/src/libsec/port/tlshand.c
@@ -2563,7 +2563,7 @@
 	memmove(sec->crandom, crandom, RandomSize);
 	sec->clientVers = cvers;
 
-	put32(sec->srandom, time(0));
+	put32(sec->srandom, time(nil));
 	genrandom(sec->srandom+4, RandomSize-4);
 	memmove(srandom, sec->srandom, RandomSize);
 
@@ -2626,7 +2626,7 @@
 {
 	TlsSec *sec = emalloc(sizeof(*sec));
 	sec->clientVers = cvers;
-	put32(sec->crandom, time(0));
+	put32(sec->crandom, time(nil));
 	genrandom(sec->crandom+4, RandomSize-4);
 	memmove(crandom, sec->crandom, RandomSize);
 	return sec;
--- a/sys/src/libsec/port/tsmemcmp.c
+++ b/sys/src/libsec/port/tsmemcmp.c
@@ -1,5 +1,4 @@
-#include <u.h>
-#include <libc.h>
+#include "os.h"
 #include <libsec.h>
 
 /*