mbed TLS upgraded to 2.6.0

Fork of mbedtls by Mark Radbourne

Committer:
markrad
Date:
Thu Jan 05 00:18:44 2017 +0000
Revision:
0:cdf462088d13
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
markrad 0:cdf462088d13 1
markrad 0:cdf462088d13 2 # Also see "include/mbedtls/config.h"
markrad 0:cdf462088d13 3
markrad 0:cdf462088d13 4 CFLAGS ?= -O2
markrad 0:cdf462088d13 5 WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement
markrad 0:cdf462088d13 6 LDFLAGS ?=
markrad 0:cdf462088d13 7
markrad 0:cdf462088d13 8 LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -D_FILE_OFFSET_BITS=64
markrad 0:cdf462088d13 9 LOCAL_LDFLAGS =
markrad 0:cdf462088d13 10
markrad 0:cdf462088d13 11 ifdef DEBUG
markrad 0:cdf462088d13 12 LOCAL_CFLAGS += -g3
markrad 0:cdf462088d13 13 endif
markrad 0:cdf462088d13 14
markrad 0:cdf462088d13 15 # MicroBlaze specific options:
markrad 0:cdf462088d13 16 # CFLAGS += -mno-xl-soft-mul -mxl-barrel-shift
markrad 0:cdf462088d13 17
markrad 0:cdf462088d13 18 # To compile on Plan9:
markrad 0:cdf462088d13 19 # CFLAGS += -D_BSD_EXTENSION
markrad 0:cdf462088d13 20
markrad 0:cdf462088d13 21 # if were running on Windows build for Windows
markrad 0:cdf462088d13 22 ifdef WINDOWS
markrad 0:cdf462088d13 23 WINDOWS_BUILD=1
markrad 0:cdf462088d13 24 endif
markrad 0:cdf462088d13 25
markrad 0:cdf462088d13 26 # To compile as a shared library:
markrad 0:cdf462088d13 27 ifdef SHARED
markrad 0:cdf462088d13 28 # all code is position-indep with mingw, avoid warning about useless flag
markrad 0:cdf462088d13 29 ifndef WINDOWS_BUILD
markrad 0:cdf462088d13 30 LOCAL_CFLAGS += -fPIC -fpic
markrad 0:cdf462088d13 31 endif
markrad 0:cdf462088d13 32 endif
markrad 0:cdf462088d13 33
markrad 0:cdf462088d13 34 SOEXT_TLS=so.10
markrad 0:cdf462088d13 35 SOEXT_X509=so.0
markrad 0:cdf462088d13 36 SOEXT_CRYPTO=so.0
markrad 0:cdf462088d13 37
markrad 0:cdf462088d13 38 DLEXT=so
markrad 0:cdf462088d13 39 # OSX shared library extension:
markrad 0:cdf462088d13 40 # DLEXT=dylib
markrad 0:cdf462088d13 41
markrad 0:cdf462088d13 42 # Windows shared library extension:
markrad 0:cdf462088d13 43 ifdef WINDOWS_BUILD
markrad 0:cdf462088d13 44 DLEXT=dll
markrad 0:cdf462088d13 45 endif
markrad 0:cdf462088d13 46
markrad 0:cdf462088d13 47 OBJS_CRYPTO= aes.o aesni.o arc4.o \
markrad 0:cdf462088d13 48 asn1parse.o asn1write.o base64.o \
markrad 0:cdf462088d13 49 bignum.o blowfish.o camellia.o \
markrad 0:cdf462088d13 50 ccm.o cipher.o cipher_wrap.o \
markrad 0:cdf462088d13 51 cmac.o ctr_drbg.o des.o \
markrad 0:cdf462088d13 52 dhm.o ecdh.o ecdsa.o \
markrad 0:cdf462088d13 53 ecjpake.o ecp.o \
markrad 0:cdf462088d13 54 ecp_curves.o entropy.o entropy_poll.o \
markrad 0:cdf462088d13 55 error.o gcm.o havege.o \
markrad 0:cdf462088d13 56 hmac_drbg.o md.o md2.o \
markrad 0:cdf462088d13 57 md4.o md5.o md_wrap.o \
markrad 0:cdf462088d13 58 memory_buffer_alloc.o oid.o \
markrad 0:cdf462088d13 59 padlock.o pem.o pk.o \
markrad 0:cdf462088d13 60 pk_wrap.o pkcs12.o pkcs5.o \
markrad 0:cdf462088d13 61 pkparse.o pkwrite.o platform.o \
markrad 0:cdf462088d13 62 ripemd160.o rsa.o sha1.o \
markrad 0:cdf462088d13 63 sha256.o sha512.o threading.o \
markrad 0:cdf462088d13 64 timing.o version.o \
markrad 0:cdf462088d13 65 version_features.o xtea.o
markrad 0:cdf462088d13 66
markrad 0:cdf462088d13 67 OBJS_X509= certs.o pkcs11.o x509.o \
markrad 0:cdf462088d13 68 x509_create.o x509_crl.o x509_crt.o \
markrad 0:cdf462088d13 69 x509_csr.o x509write_crt.o x509write_csr.o
markrad 0:cdf462088d13 70
markrad 0:cdf462088d13 71 OBJS_TLS= debug.o net_sockets.o \
markrad 0:cdf462088d13 72 ssl_cache.o ssl_ciphersuites.o \
markrad 0:cdf462088d13 73 ssl_cli.o ssl_cookie.o \
markrad 0:cdf462088d13 74 ssl_srv.o ssl_ticket.o \
markrad 0:cdf462088d13 75 ssl_tls.o
markrad 0:cdf462088d13 76
markrad 0:cdf462088d13 77 .SILENT:
markrad 0:cdf462088d13 78
markrad 0:cdf462088d13 79 .PHONY: all static shared clean
markrad 0:cdf462088d13 80
markrad 0:cdf462088d13 81 ifndef SHARED
markrad 0:cdf462088d13 82 all: static
markrad 0:cdf462088d13 83 else
markrad 0:cdf462088d13 84 all: shared static
markrad 0:cdf462088d13 85 endif
markrad 0:cdf462088d13 86
markrad 0:cdf462088d13 87 static: libmbedcrypto.a libmbedx509.a libmbedtls.a
markrad 0:cdf462088d13 88
markrad 0:cdf462088d13 89 shared: libmbedcrypto.$(DLEXT) libmbedx509.$(DLEXT) libmbedtls.$(DLEXT)
markrad 0:cdf462088d13 90
markrad 0:cdf462088d13 91 # tls
markrad 0:cdf462088d13 92 libmbedtls.a: $(OBJS_TLS)
markrad 0:cdf462088d13 93 echo " AR $@"
markrad 0:cdf462088d13 94 $(AR) -rc $@ $(OBJS_TLS)
markrad 0:cdf462088d13 95 echo " RL $@"
markrad 0:cdf462088d13 96 $(AR) -s $@
markrad 0:cdf462088d13 97
markrad 0:cdf462088d13 98 libmbedtls.$(SOEXT_TLS): $(OBJS_TLS) libmbedx509.so
markrad 0:cdf462088d13 99 echo " LD $@"
markrad 0:cdf462088d13 100 $(CC) -shared -Wl,-soname,$@ -L. -lmbedcrypto -lmbedx509 $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_TLS)
markrad 0:cdf462088d13 101
markrad 0:cdf462088d13 102 libmbedtls.so: libmbedtls.$(SOEXT_TLS)
markrad 0:cdf462088d13 103 echo " LN $@ -> $<"
markrad 0:cdf462088d13 104 ln -sf $< $@
markrad 0:cdf462088d13 105
markrad 0:cdf462088d13 106 libmbedtls.dylib: $(OBJS_TLS)
markrad 0:cdf462088d13 107 echo " LD $@"
markrad 0:cdf462088d13 108 $(CC) -dynamiclib $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_TLS)
markrad 0:cdf462088d13 109
markrad 0:cdf462088d13 110 libmbedtls.dll: $(OBJS_TLS) libmbedx509.dll
markrad 0:cdf462088d13 111 echo " LD $@"
markrad 0:cdf462088d13 112 $(CC) -shared -Wl,-soname,$@ -Wl,--out-implib,$@.a -o $@ $(OBJS_TLS) -lws2_32 -lwinmm -lgdi32 -L. -lmbedcrypto -lmbedx509 -static-libgcc $(LOCAL_LDFLAGS) $(LDFLAGS)
markrad 0:cdf462088d13 113
markrad 0:cdf462088d13 114 # x509
markrad 0:cdf462088d13 115 libmbedx509.a: $(OBJS_X509)
markrad 0:cdf462088d13 116 echo " AR $@"
markrad 0:cdf462088d13 117 $(AR) -rc $@ $(OBJS_X509)
markrad 0:cdf462088d13 118 echo " RL $@"
markrad 0:cdf462088d13 119 $(AR) -s $@
markrad 0:cdf462088d13 120
markrad 0:cdf462088d13 121 libmbedx509.$(SOEXT_X509): $(OBJS_X509) libmbedcrypto.so
markrad 0:cdf462088d13 122 echo " LD $@"
markrad 0:cdf462088d13 123 $(CC) -shared -Wl,-soname,$@ -L. -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_X509)
markrad 0:cdf462088d13 124
markrad 0:cdf462088d13 125 libmbedx509.so: libmbedx509.$(SOEXT_X509)
markrad 0:cdf462088d13 126 echo " LN $@ -> $<"
markrad 0:cdf462088d13 127 ln -sf $< $@
markrad 0:cdf462088d13 128
markrad 0:cdf462088d13 129 libmbedx509.dylib: $(OBJS_X509)
markrad 0:cdf462088d13 130 echo " LD $@"
markrad 0:cdf462088d13 131 $(CC) -dynamiclib $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_X509)
markrad 0:cdf462088d13 132
markrad 0:cdf462088d13 133 libmbedx509.dll: $(OBJS_X509) libmbedcrypto.dll
markrad 0:cdf462088d13 134 echo " LD $@"
markrad 0:cdf462088d13 135 $(CC) -shared -Wl,-soname,$@ -Wl,--out-implib,$@.a -o $@ $(OBJS_X509) -lws2_32 -lwinmm -lgdi32 -L. -lmbedcrypto -static-libgcc $(LOCAL_LDFLAGS) $(LDFLAGS)
markrad 0:cdf462088d13 136
markrad 0:cdf462088d13 137 # crypto
markrad 0:cdf462088d13 138 libmbedcrypto.a: $(OBJS_CRYPTO)
markrad 0:cdf462088d13 139 echo " AR $@"
markrad 0:cdf462088d13 140 $(AR) -rc $@ $(OBJS_CRYPTO)
markrad 0:cdf462088d13 141 echo " RL $@"
markrad 0:cdf462088d13 142 $(AR) -s $@
markrad 0:cdf462088d13 143
markrad 0:cdf462088d13 144 libmbedcrypto.$(SOEXT_CRYPTO): $(OBJS_CRYPTO)
markrad 0:cdf462088d13 145 echo " LD $@"
markrad 0:cdf462088d13 146 $(CC) -shared -Wl,-soname,$@ $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_CRYPTO)
markrad 0:cdf462088d13 147
markrad 0:cdf462088d13 148 libmbedcrypto.so: libmbedcrypto.$(SOEXT_CRYPTO)
markrad 0:cdf462088d13 149 echo " LN $@ -> $<"
markrad 0:cdf462088d13 150 ln -sf $< $@
markrad 0:cdf462088d13 151
markrad 0:cdf462088d13 152 libmbedcrypto.dylib: $(OBJS_CRYPTO)
markrad 0:cdf462088d13 153 echo " LD $@"
markrad 0:cdf462088d13 154 $(CC) -dynamiclib $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_CRYPTO)
markrad 0:cdf462088d13 155
markrad 0:cdf462088d13 156 libmbedcrypto.dll: $(OBJS_CRYPTO)
markrad 0:cdf462088d13 157 echo " LD $@"
markrad 0:cdf462088d13 158 $(CC) -shared -Wl,-soname,$@ -Wl,--out-implib,$@.a -o $@ $(OBJS_CRYPTO) -lws2_32 -lwinmm -lgdi32 -static-libgcc $(LOCAL_LDFLAGS) $(LDFLAGS)
markrad 0:cdf462088d13 159
markrad 0:cdf462088d13 160 .c.o:
markrad 0:cdf462088d13 161 echo " CC $<"
markrad 0:cdf462088d13 162 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $<
markrad 0:cdf462088d13 163
markrad 0:cdf462088d13 164 clean:
markrad 0:cdf462088d13 165 ifndef WINDOWS
markrad 0:cdf462088d13 166 rm -f *.o libmbed*
markrad 0:cdf462088d13 167 else
markrad 0:cdf462088d13 168 del /Q /F *.o libmbed*
markrad 0:cdf462088d13 169 endif