From 8f5cd9885746aba7cdd0132af6f69f22d7e5a66e Mon Sep 17 00:00:00 2001 From: Tiago Duarte Date: Fri, 12 Feb 2016 10:23:23 +0100 Subject: [PATCH 001/192] Added tvos target to the xcode project --- IDE/iOS/wolfssl.xcodeproj/project.pbxproj | 454 ++++++++++++++++++++++ 1 file changed, 454 insertions(+) diff --git a/IDE/iOS/wolfssl.xcodeproj/project.pbxproj b/IDE/iOS/wolfssl.xcodeproj/project.pbxproj index ab88276a0..df541be3b 100644 --- a/IDE/iOS/wolfssl.xcodeproj/project.pbxproj +++ b/IDE/iOS/wolfssl.xcodeproj/project.pbxproj @@ -7,6 +7,156 @@ objects = { /* Begin PBXBuildFile section */ + 30B060541C6DDB2B00D46008 /* crl.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646011A89928E0062516A /* crl.c */; }; + 30B060551C6DDB2B00D46008 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646021A89928E0062516A /* internal.c */; }; + 30B060561C6DDB2B00D46008 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646031A89928E0062516A /* io.c */; }; + 30B060571C6DDB2B00D46008 /* keys.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646041A89928E0062516A /* keys.c */; }; + 30B060581C6DDB2B00D46008 /* ocsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646051A89928E0062516A /* ocsp.c */; }; + 30B060591C6DDB2B00D46008 /* sniffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646061A89928E0062516A /* sniffer.c */; }; + 30B0605A1C6DDB2B00D46008 /* ssl.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646071A89928E0062516A /* ssl.c */; }; + 30B0605B1C6DDB2B00D46008 /* tls.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646081A89928E0062516A /* tls.c */; }; + 30B0605C1C6DDB2B00D46008 /* aes.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646111A8992CC0062516A /* aes.c */; }; + 30B0605D1C6DDB2B00D46008 /* arc4.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646121A8992CC0062516A /* arc4.c */; }; + 30B0605E1C6DDB2B00D46008 /* asn.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646131A8992CC0062516A /* asn.c */; }; + 30B0605F1C6DDB2B00D46008 /* blake2b.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646141A8992CC0062516A /* blake2b.c */; }; + 30B060601C6DDB2B00D46008 /* camellia.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646151A8992CC0062516A /* camellia.c */; }; + 30B060611C6DDB2B00D46008 /* chacha.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646161A8992CC0062516A /* chacha.c */; }; + 30B060621C6DDB2B00D46008 /* coding.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646171A8992CC0062516A /* coding.c */; }; + 30B060631C6DDB2B00D46008 /* des3.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646181A8992CC0062516A /* des3.c */; }; + 30B060641C6DDB2B00D46008 /* dh.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646191A8992CC0062516A /* dh.c */; }; + 30B060651C6DDB2B00D46008 /* dsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216461A1A8992CC0062516A /* dsa.c */; }; + 30B060661C6DDB2B00D46008 /* ecc.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216461B1A8992CC0062516A /* ecc.c */; }; + 30B060671C6DDB2B00D46008 /* error.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216461C1A8992CC0062516A /* error.c */; }; + 30B060681C6DDB2B00D46008 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 525BE5331B3869110054BBCD /* hash.c */; }; + 30B060691C6DDB2B00D46008 /* hc128.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216461D1A8992CC0062516A /* hc128.c */; }; + 30B0606A1C6DDB2B00D46008 /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216461E1A8992CC0062516A /* hmac.c */; }; + 30B0606B1C6DDB2B00D46008 /* integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216461F1A8992CC0062516A /* integer.c */; }; + 30B0606C1C6DDB2B00D46008 /* logging.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646201A8992CC0062516A /* logging.c */; }; + 30B0606D1C6DDB2B00D46008 /* md2.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646211A8992CC0062516A /* md2.c */; }; + 30B0606E1C6DDB2B00D46008 /* md4.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646221A8992CC0062516A /* md4.c */; }; + 30B0606F1C6DDB2B00D46008 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646231A8992CC0062516A /* md5.c */; }; + 30B060701C6DDB2B00D46008 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646241A8992CC0062516A /* memory.c */; }; + 30B060711C6DDB2B00D46008 /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646251A8992CC0062516A /* misc.c */; }; + 30B060721C6DDB2B00D46008 /* pkcs7.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646261A8992CC0062516A /* pkcs7.c */; }; + 30B060731C6DDB2B00D46008 /* poly1305.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646271A8992CC0062516A /* poly1305.c */; }; + 30B060741C6DDB2B00D46008 /* pwdbased.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646281A8992CC0062516A /* pwdbased.c */; }; + 30B060751C6DDB2B00D46008 /* rabbit.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646291A8992CC0062516A /* rabbit.c */; }; + 30B060761C6DDB2B00D46008 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216462A1A8992CC0062516A /* random.c */; }; + 30B060771C6DDB2B00D46008 /* ripemd.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216462B1A8992CC0062516A /* ripemd.c */; }; + 30B060781C6DDB2B00D46008 /* rsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216462C1A8992CC0062516A /* rsa.c */; }; + 30B060791C6DDB2B00D46008 /* sha.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216462D1A8992CC0062516A /* sha.c */; }; + 30B0607A1C6DDB2B00D46008 /* sha256.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216462E1A8992CC0062516A /* sha256.c */; }; + 30B0607B1C6DDB2B00D46008 /* sha512.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216462F1A8992CC0062516A /* sha512.c */; }; + 30B0607C1C6DDB2B00D46008 /* tfm.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646301A8992CC0062516A /* tfm.c */; }; + 30B0607D1C6DDB2B00D46008 /* wc_encrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 522DBE0C1B7926FB0031F454 /* wc_encrypt.c */; }; + 30B0607E1C6DDB2B00D46008 /* wc_port.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646311A8992CC0062516A /* wc_port.c */; }; + 30B0607F1C6DDB4600D46008 /* callbacks.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646531A8993290062516A /* callbacks.h */; }; + 30B060801C6DDB4600D46008 /* certs_test.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646541A8993290062516A /* certs_test.h */; }; + 30B060811C6DDB4600D46008 /* crl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646551A8993290062516A /* crl.h */; }; + 30B060821C6DDB4600D46008 /* error-ssl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646561A8993290062516A /* error-ssl.h */; }; + 30B060831C6DDB4600D46008 /* internal.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646571A8993290062516A /* internal.h */; }; + 30B060841C6DDB4600D46008 /* ocsp.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646581A8993290062516A /* ocsp.h */; }; + 30B060851C6DDB4600D46008 /* ssl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216465B1A8993290062516A /* ssl.h */; }; + 30B060861C6DDB4600D46008 /* test.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216465C1A8993290062516A /* test.h */; }; + 30B060871C6DDB4600D46008 /* version.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216465D1A8993290062516A /* version.h */; }; + 30B0608B1C6DDB6200D46008 /* aes.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216465E1A8993770062516A /* aes.h */; }; + 30B0608C1C6DDB6200D46008 /* arc4.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216465F1A8993770062516A /* arc4.h */; }; + 30B0608D1C6DDB6200D46008 /* asn_public.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646601A8993770062516A /* asn_public.h */; }; + 30B0608E1C6DDB6200D46008 /* asn.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646611A8993770062516A /* asn.h */; }; + 30B0608F1C6DDB6200D46008 /* blake2-impl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646621A8993770062516A /* blake2-impl.h */; }; + 30B060901C6DDB6200D46008 /* blake2-int.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646631A8993770062516A /* blake2-int.h */; }; + 30B060911C6DDB6200D46008 /* blake2.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646641A8993770062516A /* blake2.h */; }; + 30B060921C6DDB6200D46008 /* camellia.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646651A8993770062516A /* camellia.h */; }; + 30B060931C6DDB6200D46008 /* chacha.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646661A8993770062516A /* chacha.h */; }; + 30B060941C6DDB6200D46008 /* coding.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646671A8993770062516A /* coding.h */; }; + 30B060951C6DDB6200D46008 /* compress.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646681A8993770062516A /* compress.h */; }; + 30B060961C6DDB6200D46008 /* des3.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646691A8993770062516A /* des3.h */; }; + 30B060971C6DDB6200D46008 /* dh.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216466A1A8993770062516A /* dh.h */; }; + 30B060981C6DDB6200D46008 /* dsa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216466B1A8993770062516A /* dsa.h */; }; + 30B060991C6DDB6200D46008 /* ecc.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216466C1A8993770062516A /* ecc.h */; }; + 30B0609A1C6DDB6200D46008 /* error-crypt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216466D1A8993770062516A /* error-crypt.h */; }; + 30B0609B1C6DDB6200D46008 /* fips_test.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216466E1A8993770062516A /* fips_test.h */; }; + 30B0609C1C6DDB6200D46008 /* hash.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 525BE5351B3869430054BBCD /* hash.h */; }; + 30B0609D1C6DDB6200D46008 /* hc128.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216466F1A8993770062516A /* hc128.h */; }; + 30B0609E1C6DDB6200D46008 /* hmac.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646701A8993770062516A /* hmac.h */; }; + 30B0609F1C6DDB6200D46008 /* integer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646721A8993770062516A /* integer.h */; }; + 30B060A01C6DDB6200D46008 /* logging.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646731A8993770062516A /* logging.h */; }; + 30B060A11C6DDB6200D46008 /* md2.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646741A8993770062516A /* md2.h */; }; + 30B060A21C6DDB6200D46008 /* md4.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646751A8993770062516A /* md4.h */; }; + 30B060A31C6DDB6200D46008 /* md5.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646761A8993770062516A /* md5.h */; }; + 30B060A41C6DDB6200D46008 /* memory.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646771A8993770062516A /* memory.h */; }; + 30B060A51C6DDB6200D46008 /* misc.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646781A8993770062516A /* misc.h */; }; + 30B060A61C6DDB6200D46008 /* mpi_class.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646791A8993770062516A /* mpi_class.h */; }; + 30B060A71C6DDB6200D46008 /* mpi_superclass.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216467A1A8993770062516A /* mpi_superclass.h */; }; + 30B060A81C6DDB6200D46008 /* pkcs7.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216467B1A8993770062516A /* pkcs7.h */; }; + 30B060A91C6DDB6200D46008 /* poly1305.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216467C1A8993770062516A /* poly1305.h */; }; + 30B060AA1C6DDB6200D46008 /* pwdbased.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216467D1A8993770062516A /* pwdbased.h */; }; + 30B060AB1C6DDB6200D46008 /* rabbit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216467E1A8993770062516A /* rabbit.h */; }; + 30B060AC1C6DDB6200D46008 /* random.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216467F1A8993770062516A /* random.h */; }; + 30B060AD1C6DDB6200D46008 /* ripemd.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646801A8993770062516A /* ripemd.h */; }; + 30B060AE1C6DDB6200D46008 /* rsa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646811A8993770062516A /* rsa.h */; }; + 30B060AF1C6DDB6200D46008 /* settings.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646821A8993770062516A /* settings.h */; }; + 30B060B01C6DDB6200D46008 /* sha.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646831A8993770062516A /* sha.h */; }; + 30B060B11C6DDB6200D46008 /* sha256.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646841A8993770062516A /* sha256.h */; }; + 30B060B21C6DDB6200D46008 /* sha512.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646851A8993770062516A /* sha512.h */; }; + 30B060B31C6DDB6200D46008 /* tfm.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646861A8993770062516A /* tfm.h */; }; + 30B060B41C6DDB6200D46008 /* types.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646871A8993770062516A /* types.h */; }; + 30B060B51C6DDB6200D46008 /* visibility.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646881A8993770062516A /* visibility.h */; }; + 30B060B61C6DDB6200D46008 /* wc_encrypt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 522DBE0E1B7927290031F454 /* wc_encrypt.h */; }; + 30B060B71C6DDB6200D46008 /* wc_port.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646891A8993770062516A /* wc_port.h */; }; + 30B060B81C6DDB7D00D46008 /* callbacks.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216468A1A8993BB0062516A /* callbacks.h */; }; + 30B060B91C6DDB7D00D46008 /* certs_test.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216468B1A8993BB0062516A /* certs_test.h */; }; + 30B060BA1C6DDB7D00D46008 /* crl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216468C1A8993BB0062516A /* crl.h */; }; + 30B060BB1C6DDB7D00D46008 /* error-ssl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216468D1A8993BB0062516A /* error-ssl.h */; }; + 30B060BC1C6DDB7D00D46008 /* internal.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216468E1A8993BB0062516A /* internal.h */; }; + 30B060BD1C6DDB7D00D46008 /* ocsp.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216468F1A8993BB0062516A /* ocsp.h */; }; + 30B060BE1C6DDB7D00D46008 /* ssl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646921A8993BB0062516A /* ssl.h */; }; + 30B060BF1C6DDB7D00D46008 /* test.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646931A8993BB0062516A /* test.h */; }; + 30B060C01C6DDB7D00D46008 /* version.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646941A8993BB0062516A /* version.h */; }; + 30B060C11C6DDB9800D46008 /* aes.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646951A8993F50062516A /* aes.h */; }; + 30B060C21C6DDB9800D46008 /* arc4.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646961A8993F50062516A /* arc4.h */; }; + 30B060C31C6DDB9800D46008 /* asn_public.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646971A8993F50062516A /* asn_public.h */; }; + 30B060C41C6DDB9800D46008 /* asn.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646981A8993F50062516A /* asn.h */; }; + 30B060C51C6DDB9800D46008 /* blake2-impl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646991A8993F50062516A /* blake2-impl.h */; }; + 30B060C61C6DDB9800D46008 /* blake2-int.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216469A1A8993F50062516A /* blake2-int.h */; }; + 30B060C71C6DDB9800D46008 /* blake2.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216469B1A8993F50062516A /* blake2.h */; }; + 30B060C81C6DDB9800D46008 /* camellia.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216469C1A8993F50062516A /* camellia.h */; }; + 30B060C91C6DDB9800D46008 /* chacha.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216469D1A8993F50062516A /* chacha.h */; }; + 30B060CA1C6DDB9800D46008 /* coding.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216469E1A8993F50062516A /* coding.h */; }; + 30B060CB1C6DDB9800D46008 /* compress.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5216469F1A8993F50062516A /* compress.h */; }; + 30B060CC1C6DDB9800D46008 /* des3.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646A01A8993F50062516A /* des3.h */; }; + 30B060CD1C6DDB9800D46008 /* dh.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646A11A8993F50062516A /* dh.h */; }; + 30B060CE1C6DDB9800D46008 /* dsa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646A21A8993F50062516A /* dsa.h */; }; + 30B060CF1C6DDB9800D46008 /* ecc.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646A31A8993F50062516A /* ecc.h */; }; + 30B060D01C6DDB9800D46008 /* error-crypt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646A41A8993F50062516A /* error-crypt.h */; }; + 30B060D11C6DDB9800D46008 /* fips_test.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646A51A8993F50062516A /* fips_test.h */; }; + 30B060D21C6DDB9800D46008 /* hc128.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646A61A8993F50062516A /* hc128.h */; }; + 30B060D31C6DDB9800D46008 /* hmac.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646A71A8993F50062516A /* hmac.h */; }; + 30B060D41C6DDB9800D46008 /* integer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646A81A8993F50062516A /* integer.h */; }; + 30B060D51C6DDB9800D46008 /* logging.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646A91A8993F50062516A /* logging.h */; }; + 30B060D61C6DDB9800D46008 /* md2.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646AA1A8993F50062516A /* md2.h */; }; + 30B060D71C6DDB9800D46008 /* md4.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646AB1A8993F50062516A /* md4.h */; }; + 30B060D81C6DDB9800D46008 /* md5.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646AC1A8993F50062516A /* md5.h */; }; + 30B060D91C6DDB9800D46008 /* memory.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646AD1A8993F50062516A /* memory.h */; }; + 30B060DA1C6DDB9800D46008 /* misc.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646AE1A8993F50062516A /* misc.h */; }; + 30B060DB1C6DDB9800D46008 /* mpi_class.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646AF1A8993F50062516A /* mpi_class.h */; }; + 30B060DC1C6DDB9800D46008 /* mpi_superclass.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646B01A8993F50062516A /* mpi_superclass.h */; }; + 30B060DD1C6DDB9800D46008 /* pkcs7.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646B11A8993F50062516A /* pkcs7.h */; }; + 30B060DE1C6DDB9800D46008 /* poly1305.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646B21A8993F50062516A /* poly1305.h */; }; + 30B060DF1C6DDB9800D46008 /* pwdbased.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646B31A8993F50062516A /* pwdbased.h */; }; + 30B060E01C6DDB9800D46008 /* rabbit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646B41A8993F50062516A /* rabbit.h */; }; + 30B060E11C6DDB9800D46008 /* random.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646B51A8993F50062516A /* random.h */; }; + 30B060E21C6DDB9800D46008 /* ripemd.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646B61A8993F50062516A /* ripemd.h */; }; + 30B060E31C6DDB9800D46008 /* rsa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646B71A8993F50062516A /* rsa.h */; }; + 30B060E41C6DDB9800D46008 /* settings_comp.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646B81A8993F50062516A /* settings_comp.h */; }; + 30B060E51C6DDB9800D46008 /* settings.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646B91A8993F50062516A /* settings.h */; }; + 30B060E61C6DDB9800D46008 /* sha.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646BA1A8993F50062516A /* sha.h */; }; + 30B060E71C6DDB9800D46008 /* sha256.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646BB1A8993F50062516A /* sha256.h */; }; + 30B060E81C6DDB9800D46008 /* sha512.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646BC1A8993F50062516A /* sha512.h */; }; + 30B060E91C6DDB9800D46008 /* tfm.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646BD1A8993F50062516A /* tfm.h */; }; + 30B060EA1C6DDB9800D46008 /* types.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646BE1A8993F50062516A /* types.h */; }; + 30B060EB1C6DDB9800D46008 /* visibility.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646BF1A8993F50062516A /* visibility.h */; }; + 30B060EC1C6DDB9800D46008 /* wc_port.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 521646C01A8993F50062516A /* wc_port.h */; }; 521646091A89928E0062516A /* crl.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646011A89928E0062516A /* crl.c */; }; 5216460A1A89928E0062516A /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646021A89928E0062516A /* internal.c */; }; 5216460B1A89928E0062516A /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646031A89928E0062516A /* io.c */; }; @@ -310,6 +460,149 @@ /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ + 30B060491C6DDAEA00D46008 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = include/wolfssl; + dstSubfolderSpec = 7; + files = ( + 30B0607F1C6DDB4600D46008 /* callbacks.h in CopyFiles */, + 30B060801C6DDB4600D46008 /* certs_test.h in CopyFiles */, + 30B060811C6DDB4600D46008 /* crl.h in CopyFiles */, + 30B060821C6DDB4600D46008 /* error-ssl.h in CopyFiles */, + 30B060831C6DDB4600D46008 /* internal.h in CopyFiles */, + 30B060841C6DDB4600D46008 /* ocsp.h in CopyFiles */, + 30B060851C6DDB4600D46008 /* ssl.h in CopyFiles */, + 30B060861C6DDB4600D46008 /* test.h in CopyFiles */, + 30B060871C6DDB4600D46008 /* version.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 30B060881C6DDB5200D46008 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = include/wolfssl/wolfcrypt; + dstSubfolderSpec = 7; + files = ( + 30B0608B1C6DDB6200D46008 /* aes.h in CopyFiles */, + 30B0608C1C6DDB6200D46008 /* arc4.h in CopyFiles */, + 30B0608D1C6DDB6200D46008 /* asn_public.h in CopyFiles */, + 30B0608E1C6DDB6200D46008 /* asn.h in CopyFiles */, + 30B0608F1C6DDB6200D46008 /* blake2-impl.h in CopyFiles */, + 30B060901C6DDB6200D46008 /* blake2-int.h in CopyFiles */, + 30B060911C6DDB6200D46008 /* blake2.h in CopyFiles */, + 30B060921C6DDB6200D46008 /* camellia.h in CopyFiles */, + 30B060931C6DDB6200D46008 /* chacha.h in CopyFiles */, + 30B060941C6DDB6200D46008 /* coding.h in CopyFiles */, + 30B060951C6DDB6200D46008 /* compress.h in CopyFiles */, + 30B060961C6DDB6200D46008 /* des3.h in CopyFiles */, + 30B060971C6DDB6200D46008 /* dh.h in CopyFiles */, + 30B060981C6DDB6200D46008 /* dsa.h in CopyFiles */, + 30B060991C6DDB6200D46008 /* ecc.h in CopyFiles */, + 30B0609A1C6DDB6200D46008 /* error-crypt.h in CopyFiles */, + 30B0609B1C6DDB6200D46008 /* fips_test.h in CopyFiles */, + 30B0609C1C6DDB6200D46008 /* hash.h in CopyFiles */, + 30B0609D1C6DDB6200D46008 /* hc128.h in CopyFiles */, + 30B0609E1C6DDB6200D46008 /* hmac.h in CopyFiles */, + 30B0609F1C6DDB6200D46008 /* integer.h in CopyFiles */, + 30B060A01C6DDB6200D46008 /* logging.h in CopyFiles */, + 30B060A11C6DDB6200D46008 /* md2.h in CopyFiles */, + 30B060A21C6DDB6200D46008 /* md4.h in CopyFiles */, + 30B060A31C6DDB6200D46008 /* md5.h in CopyFiles */, + 30B060A41C6DDB6200D46008 /* memory.h in CopyFiles */, + 30B060A51C6DDB6200D46008 /* misc.h in CopyFiles */, + 30B060A61C6DDB6200D46008 /* mpi_class.h in CopyFiles */, + 30B060A71C6DDB6200D46008 /* mpi_superclass.h in CopyFiles */, + 30B060A81C6DDB6200D46008 /* pkcs7.h in CopyFiles */, + 30B060A91C6DDB6200D46008 /* poly1305.h in CopyFiles */, + 30B060AA1C6DDB6200D46008 /* pwdbased.h in CopyFiles */, + 30B060AB1C6DDB6200D46008 /* rabbit.h in CopyFiles */, + 30B060AC1C6DDB6200D46008 /* random.h in CopyFiles */, + 30B060AD1C6DDB6200D46008 /* ripemd.h in CopyFiles */, + 30B060AE1C6DDB6200D46008 /* rsa.h in CopyFiles */, + 30B060AF1C6DDB6200D46008 /* settings.h in CopyFiles */, + 30B060B01C6DDB6200D46008 /* sha.h in CopyFiles */, + 30B060B11C6DDB6200D46008 /* sha256.h in CopyFiles */, + 30B060B21C6DDB6200D46008 /* sha512.h in CopyFiles */, + 30B060B31C6DDB6200D46008 /* tfm.h in CopyFiles */, + 30B060B41C6DDB6200D46008 /* types.h in CopyFiles */, + 30B060B51C6DDB6200D46008 /* visibility.h in CopyFiles */, + 30B060B61C6DDB6200D46008 /* wc_encrypt.h in CopyFiles */, + 30B060B71C6DDB6200D46008 /* wc_port.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 30B060891C6DDB5400D46008 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = include/cyassl; + dstSubfolderSpec = 7; + files = ( + 30B060B81C6DDB7D00D46008 /* callbacks.h in CopyFiles */, + 30B060B91C6DDB7D00D46008 /* certs_test.h in CopyFiles */, + 30B060BA1C6DDB7D00D46008 /* crl.h in CopyFiles */, + 30B060BB1C6DDB7D00D46008 /* error-ssl.h in CopyFiles */, + 30B060BC1C6DDB7D00D46008 /* internal.h in CopyFiles */, + 30B060BD1C6DDB7D00D46008 /* ocsp.h in CopyFiles */, + 30B060BE1C6DDB7D00D46008 /* ssl.h in CopyFiles */, + 30B060BF1C6DDB7D00D46008 /* test.h in CopyFiles */, + 30B060C01C6DDB7D00D46008 /* version.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 30B0608A1C6DDB5500D46008 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = include/cyassl/ctaocrypt; + dstSubfolderSpec = 7; + files = ( + 30B060C11C6DDB9800D46008 /* aes.h in CopyFiles */, + 30B060C21C6DDB9800D46008 /* arc4.h in CopyFiles */, + 30B060C31C6DDB9800D46008 /* asn_public.h in CopyFiles */, + 30B060C41C6DDB9800D46008 /* asn.h in CopyFiles */, + 30B060C51C6DDB9800D46008 /* blake2-impl.h in CopyFiles */, + 30B060C61C6DDB9800D46008 /* blake2-int.h in CopyFiles */, + 30B060C71C6DDB9800D46008 /* blake2.h in CopyFiles */, + 30B060C81C6DDB9800D46008 /* camellia.h in CopyFiles */, + 30B060C91C6DDB9800D46008 /* chacha.h in CopyFiles */, + 30B060CA1C6DDB9800D46008 /* coding.h in CopyFiles */, + 30B060CB1C6DDB9800D46008 /* compress.h in CopyFiles */, + 30B060CC1C6DDB9800D46008 /* des3.h in CopyFiles */, + 30B060CD1C6DDB9800D46008 /* dh.h in CopyFiles */, + 30B060CE1C6DDB9800D46008 /* dsa.h in CopyFiles */, + 30B060CF1C6DDB9800D46008 /* ecc.h in CopyFiles */, + 30B060D01C6DDB9800D46008 /* error-crypt.h in CopyFiles */, + 30B060D11C6DDB9800D46008 /* fips_test.h in CopyFiles */, + 30B060D21C6DDB9800D46008 /* hc128.h in CopyFiles */, + 30B060D31C6DDB9800D46008 /* hmac.h in CopyFiles */, + 30B060D41C6DDB9800D46008 /* integer.h in CopyFiles */, + 30B060D51C6DDB9800D46008 /* logging.h in CopyFiles */, + 30B060D61C6DDB9800D46008 /* md2.h in CopyFiles */, + 30B060D71C6DDB9800D46008 /* md4.h in CopyFiles */, + 30B060D81C6DDB9800D46008 /* md5.h in CopyFiles */, + 30B060D91C6DDB9800D46008 /* memory.h in CopyFiles */, + 30B060DA1C6DDB9800D46008 /* misc.h in CopyFiles */, + 30B060DB1C6DDB9800D46008 /* mpi_class.h in CopyFiles */, + 30B060DC1C6DDB9800D46008 /* mpi_superclass.h in CopyFiles */, + 30B060DD1C6DDB9800D46008 /* pkcs7.h in CopyFiles */, + 30B060DE1C6DDB9800D46008 /* poly1305.h in CopyFiles */, + 30B060DF1C6DDB9800D46008 /* pwdbased.h in CopyFiles */, + 30B060E01C6DDB9800D46008 /* rabbit.h in CopyFiles */, + 30B060E11C6DDB9800D46008 /* random.h in CopyFiles */, + 30B060E21C6DDB9800D46008 /* ripemd.h in CopyFiles */, + 30B060E31C6DDB9800D46008 /* rsa.h in CopyFiles */, + 30B060E41C6DDB9800D46008 /* settings_comp.h in CopyFiles */, + 30B060E51C6DDB9800D46008 /* settings.h in CopyFiles */, + 30B060E61C6DDB9800D46008 /* sha.h in CopyFiles */, + 30B060E71C6DDB9800D46008 /* sha256.h in CopyFiles */, + 30B060E81C6DDB9800D46008 /* sha512.h in CopyFiles */, + 30B060E91C6DDB9800D46008 /* tfm.h in CopyFiles */, + 30B060EA1C6DDB9800D46008 /* types.h in CopyFiles */, + 30B060EB1C6DDB9800D46008 /* visibility.h in CopyFiles */, + 30B060EC1C6DDB9800D46008 /* wc_port.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 521646C11A8A7B380062516A /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -599,6 +892,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 30B0604B1C6DDAEA00D46008 /* libwolfssl_tvos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libwolfssl_tvos.a; sourceTree = BUILT_PRODUCTS_DIR; }; 521646011A89928E0062516A /* crl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = crl.c; path = ../../src/crl.c; sourceTree = ""; }; 521646021A89928E0062516A /* internal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = internal.c; path = ../../src/internal.c; sourceTree = ""; }; 521646031A89928E0062516A /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = io.c; path = ../../src/io.c; sourceTree = ""; }; @@ -755,6 +1049,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 30B060481C6DDAEA00D46008 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 52B1344A16F3C9E800C07B32 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -999,6 +1300,7 @@ children = ( 52B1344D16F3C9E800C07B32 /* libwolfssl_ios.a */, A4F318EE1BC58B1700FDF2BB /* libwolfssl_osx.a */, + 30B0604B1C6DDAEA00D46008 /* libwolfssl_tvos.a */, ); name = Products; sourceTree = ""; @@ -1006,6 +1308,26 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 30B0604A1C6DDAEA00D46008 /* wolfssl_tvos */ = { + isa = PBXNativeTarget; + buildConfigurationList = 30B060531C6DDAEA00D46008 /* Build configuration list for PBXNativeTarget "wolfssl_tvos" */; + buildPhases = ( + 30B060471C6DDAEA00D46008 /* Sources */, + 30B060481C6DDAEA00D46008 /* Frameworks */, + 30B060491C6DDAEA00D46008 /* CopyFiles */, + 30B060881C6DDB5200D46008 /* CopyFiles */, + 30B060891C6DDB5400D46008 /* CopyFiles */, + 30B0608A1C6DDB5500D46008 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = wolfssl_tvos; + productName = wolfssl_tvos; + productReference = 30B0604B1C6DDAEA00D46008 /* libwolfssl_tvos.a */; + productType = "com.apple.product-type.library.static"; + }; 52B1344C16F3C9E800C07B32 /* wolfssl_ios */ = { isa = PBXNativeTarget; buildConfigurationList = 52B1347216F3C9E800C07B32 /* Build configuration list for PBXNativeTarget "wolfssl_ios" */; @@ -1054,6 +1376,11 @@ attributes = { LastUpgradeCheck = 0460; ORGANIZATIONNAME = "wolfSSL Inc"; + TargetAttributes = { + 30B0604A1C6DDAEA00D46008 = { + CreatedOnToolsVersion = 7.2.1; + }; + }; }; buildConfigurationList = 52B1344816F3C9E800C07B32 /* Build configuration list for PBXProject "wolfssl" */; compatibilityVersion = "Xcode 3.2"; @@ -1069,11 +1396,62 @@ targets = ( 52B1344C16F3C9E800C07B32 /* wolfssl_ios */, A4F3184E1BC58B1700FDF2BB /* wolfssl_osx */, + 30B0604A1C6DDAEA00D46008 /* wolfssl_tvos */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ + 30B060471C6DDAEA00D46008 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 30B060541C6DDB2B00D46008 /* crl.c in Sources */, + 30B060551C6DDB2B00D46008 /* internal.c in Sources */, + 30B060561C6DDB2B00D46008 /* io.c in Sources */, + 30B060571C6DDB2B00D46008 /* keys.c in Sources */, + 30B060581C6DDB2B00D46008 /* ocsp.c in Sources */, + 30B060591C6DDB2B00D46008 /* sniffer.c in Sources */, + 30B0605A1C6DDB2B00D46008 /* ssl.c in Sources */, + 30B0605B1C6DDB2B00D46008 /* tls.c in Sources */, + 30B0605C1C6DDB2B00D46008 /* aes.c in Sources */, + 30B0605D1C6DDB2B00D46008 /* arc4.c in Sources */, + 30B0605E1C6DDB2B00D46008 /* asn.c in Sources */, + 30B0605F1C6DDB2B00D46008 /* blake2b.c in Sources */, + 30B060601C6DDB2B00D46008 /* camellia.c in Sources */, + 30B060611C6DDB2B00D46008 /* chacha.c in Sources */, + 30B060621C6DDB2B00D46008 /* coding.c in Sources */, + 30B060631C6DDB2B00D46008 /* des3.c in Sources */, + 30B060641C6DDB2B00D46008 /* dh.c in Sources */, + 30B060651C6DDB2B00D46008 /* dsa.c in Sources */, + 30B060661C6DDB2B00D46008 /* ecc.c in Sources */, + 30B060671C6DDB2B00D46008 /* error.c in Sources */, + 30B060681C6DDB2B00D46008 /* hash.c in Sources */, + 30B060691C6DDB2B00D46008 /* hc128.c in Sources */, + 30B0606A1C6DDB2B00D46008 /* hmac.c in Sources */, + 30B0606B1C6DDB2B00D46008 /* integer.c in Sources */, + 30B0606C1C6DDB2B00D46008 /* logging.c in Sources */, + 30B0606D1C6DDB2B00D46008 /* md2.c in Sources */, + 30B0606E1C6DDB2B00D46008 /* md4.c in Sources */, + 30B0606F1C6DDB2B00D46008 /* md5.c in Sources */, + 30B060701C6DDB2B00D46008 /* memory.c in Sources */, + 30B060711C6DDB2B00D46008 /* misc.c in Sources */, + 30B060721C6DDB2B00D46008 /* pkcs7.c in Sources */, + 30B060731C6DDB2B00D46008 /* poly1305.c in Sources */, + 30B060741C6DDB2B00D46008 /* pwdbased.c in Sources */, + 30B060751C6DDB2B00D46008 /* rabbit.c in Sources */, + 30B060761C6DDB2B00D46008 /* random.c in Sources */, + 30B060771C6DDB2B00D46008 /* ripemd.c in Sources */, + 30B060781C6DDB2B00D46008 /* rsa.c in Sources */, + 30B060791C6DDB2B00D46008 /* sha.c in Sources */, + 30B0607A1C6DDB2B00D46008 /* sha256.c in Sources */, + 30B0607B1C6DDB2B00D46008 /* sha512.c in Sources */, + 30B0607C1C6DDB2B00D46008 /* tfm.c in Sources */, + 30B0607D1C6DDB2B00D46008 /* wc_encrypt.c in Sources */, + 30B0607E1C6DDB2B00D46008 /* wc_port.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 52B1344916F3C9E800C07B32 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1177,6 +1555,74 @@ /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ + 30B060511C6DDAEA00D46008 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + HEADER_SEARCH_PATHS = ( + $SRCROOT, + $PROJECT_DIR/../.., + ); + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TVOS_DEPLOYMENT_TARGET = 9.1; + USER_HEADER_SEARCH_PATHS = "wolfssl/wolfcrypt wolfssl"; + }; + name = Debug; + }; + 30B060521C6DDAEA00D46008 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + HEADER_SEARCH_PATHS = ( + $SRCROOT, + $PROJECT_DIR/../.., + ); + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TVOS_DEPLOYMENT_TARGET = 9.1; + USER_HEADER_SEARCH_PATHS = "wolfssl/wolfcrypt wolfssl"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; 52B1347016F3C9E800C07B32 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1337,6 +1783,14 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 30B060531C6DDAEA00D46008 /* Build configuration list for PBXNativeTarget "wolfssl_tvos" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 30B060511C6DDAEA00D46008 /* Debug */, + 30B060521C6DDAEA00D46008 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 52B1344816F3C9E800C07B32 /* Build configuration list for PBXProject "wolfssl" */ = { isa = XCConfigurationList; buildConfigurations = ( From 3fe5ee1a7c37d8e54a370104adee74d7662bdc4b Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 18 Feb 2016 22:42:15 -0800 Subject: [PATCH 002/192] Refactor of the DER buffer handling. Added new DerBuffer struct that includes the type and heap ptr. Added new InitDer, AllocDer and FreeDer functions. Cleanup of some missing "heap" args on XMALLOC/XFREE. In FreeDer uses ForceZero if type is private key. --- src/crl.c | 17 +- src/internal.c | 103 ++++---- src/ssl.c | 603 ++++++++++++++++++++++++-------------------- wolfcrypt/src/asn.c | 16 +- wolfssl/internal.h | 40 ++- 5 files changed, 414 insertions(+), 365 deletions(-) diff --git a/src/crl.c b/src/crl.c index 0143dd789..b39e2e77f 100644 --- a/src/crl.c +++ b/src/crl.c @@ -263,20 +263,23 @@ int BufferLoadCRL(WOLFSSL_CRL* crl, const byte* buff, long sz, int type) { int ret = SSL_SUCCESS; const byte* myBuffer = buff; /* if DER ok, otherwise switch */ - buffer der; + DerBuffer der; #ifdef WOLFSSL_SMALL_STACK DecodedCRL* dcrl; #else DecodedCRL dcrl[1]; #endif - der.buffer = NULL; - WOLFSSL_ENTER("BufferLoadCRL"); if (crl == NULL || buff == NULL || sz == 0) return BAD_FUNC_ARG; + ret = InitDer(&der); + if (ret < 0) { + return ret; + } + if (type == SSL_FILETYPE_PEM) { int eccKey = 0; /* not used */ EncryptedInfo info; @@ -289,6 +292,7 @@ int BufferLoadCRL(WOLFSSL_CRL* crl, const byte* buff, long sz, int type) } else { WOLFSSL_MSG("Pem to Der failed"); + FreeDer(&der); return -1; } } @@ -296,9 +300,7 @@ int BufferLoadCRL(WOLFSSL_CRL* crl, const byte* buff, long sz, int type) #ifdef WOLFSSL_SMALL_STACK dcrl = (DecodedCRL*)XMALLOC(sizeof(DecodedCRL), NULL, DYNAMIC_TYPE_TMP_BUFFER); if (dcrl == NULL) { - if (der.buffer) - XFREE(der.buffer, NULL, DYNAMIC_TYPE_CRL); - + FreeDer(&der); return MEMORY_E; } #endif @@ -321,8 +323,7 @@ int BufferLoadCRL(WOLFSSL_CRL* crl, const byte* buff, long sz, int type) XFREE(dcrl, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif - if (der.buffer) - XFREE(der.buffer, NULL, DYNAMIC_TYPE_CRL); + FreeDer(&der); return ret ? ret : SSL_SUCCESS; /* convert 0 to SSL_SUCCESS */ } diff --git a/src/internal.c b/src/internal.c index 0dca6aaec..ecc6272fa 100644 --- a/src/internal.c +++ b/src/internal.c @@ -566,9 +566,9 @@ void SSL_CtxResourceFree(WOLFSSL_CTX* ctx) #endif #ifndef NO_CERTS - XFREE(ctx->privateKey.buffer, ctx->heap, DYNAMIC_TYPE_KEY); - XFREE(ctx->certificate.buffer, ctx->heap, DYNAMIC_TYPE_CERT); - XFREE(ctx->certChain.buffer, ctx->heap, DYNAMIC_TYPE_CERT); + FreeDer(&ctx->privateKey); + FreeDer(&ctx->certificate); + FreeDer(&ctx->certChain); wolfSSL_CertManagerFree(ctx->cm); #endif @@ -1643,7 +1643,7 @@ void InitX509(WOLFSSL_X509* x509, int dynamicFlag) x509->version = 0; x509->pubKey.buffer = NULL; x509->sig.buffer = NULL; - x509->derCert.buffer = NULL; + InitDer(&x509->derCert); x509->altNames = NULL; x509->altNamesNext = NULL; x509->dynamicMemory = (byte)dynamicFlag; @@ -1687,7 +1687,7 @@ void FreeX509(WOLFSSL_X509* x509) FreeX509Name(&x509->subject); if (x509->pubKey.buffer) XFREE(x509->pubKey.buffer, NULL, DYNAMIC_TYPE_PUBLIC_KEY); - XFREE(x509->derCert.buffer, NULL, DYNAMIC_TYPE_SUBJECT_CN); + FreeDer(&x509->derCert); XFREE(x509->sig.buffer, NULL, DYNAMIC_TYPE_SIGNATURE); #ifdef OPENSSL_EXTRA XFREE(x509->authKeyId, NULL, DYNAMIC_TYPE_X509_EXT); @@ -1859,9 +1859,9 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx) #ifndef NO_CERTS /* ctx still owns certificate, certChain, key, dh, and cm */ - ssl->buffers.certificate = ctx->certificate; - ssl->buffers.certChain = ctx->certChain; - ssl->buffers.key = ctx->privateKey; + XMEMCPY(&ssl->buffers.certificate, &ctx->certificate, sizeof(DerBuffer)); + XMEMCPY(&ssl->buffers.certChain, &ctx->certChain, sizeof(DerBuffer)); + XMEMCPY(&ssl->buffers.key, &ctx->privateKey, sizeof(DerBuffer)); #endif #ifdef HAVE_CAVIUM @@ -2129,17 +2129,7 @@ void SSL_ResourceFree(WOLFSSL* ssl) } #endif #ifndef NO_CERTS - if (ssl->buffers.weOwnCert) - XFREE(ssl->buffers.certificate.buffer, ssl->heap, DYNAMIC_TYPE_CERT); - if (ssl->buffers.weOwnCertChain) - XFREE(ssl->buffers.certChain.buffer, ssl->heap, DYNAMIC_TYPE_CERT); - if (ssl->buffers.weOwnKey) { - if (ssl->buffers.key.buffer) { - ForceZero(ssl->buffers.key.buffer, ssl->buffers.key.length); - } - XFREE(ssl->buffers.key.buffer, ssl->heap, DYNAMIC_TYPE_KEY); - ssl->buffers.key.buffer = NULL; - } + wolfSSL_UnloadCertsKeys(ssl); #endif #ifndef NO_RSA if (ssl->peerRsaKey) { @@ -2335,21 +2325,7 @@ void FreeHandshakeResources(WOLFSSL* ssl) } #endif #ifndef NO_CERTS - if (ssl->buffers.weOwnCert) { - XFREE(ssl->buffers.certificate.buffer, ssl->heap, DYNAMIC_TYPE_CERT); - ssl->buffers.certificate.buffer = NULL; - } - if (ssl->buffers.weOwnCertChain) { - XFREE(ssl->buffers.certChain.buffer, ssl->heap, DYNAMIC_TYPE_CERT); - ssl->buffers.certChain.buffer = NULL; - } - if (ssl->buffers.weOwnKey) { - if (ssl->buffers.key.buffer) { - ForceZero(ssl->buffers.key.buffer, ssl->buffers.key.length); - } - XFREE(ssl->buffers.key.buffer, ssl->heap, DYNAMIC_TYPE_KEY); - ssl->buffers.key.buffer = NULL; - } + wolfSSL_UnloadCertsKeys(ssl); #endif #ifdef HAVE_PK_CALLBACKS #ifdef HAVE_ECC @@ -4493,14 +4469,8 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert) } /* store cert for potential retrieval */ - x509->derCert.buffer = (byte*)XMALLOC(dCert->maxIdx, NULL, - DYNAMIC_TYPE_CERT); - if (x509->derCert.buffer == NULL) { - ret = MEMORY_E; - } - else { + if (AllocDer(&x509->derCert, dCert->maxIdx, CERT_TYPE, NULL) == 0) { XMEMCPY(x509->derCert.buffer, dCert->source, dCert->maxIdx); - x509->derCert.length = dCert->maxIdx; } x509->altNames = dCert->altNames; @@ -4561,7 +4531,7 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert) static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, - word32 size) + word32 size) { word32 listSz; word32 begin = *inOutIdx; @@ -4569,7 +4539,7 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, int anyError = 0; int totalCerts = 0; /* number of certs in certs buffer */ int count; - buffer certs[MAX_CHAIN_DEPTH]; + DerBuffer certs[MAX_CHAIN_DEPTH]; #ifdef WOLFSSL_SMALL_STACK char* domain = NULL; @@ -4616,6 +4586,10 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, if ((*inOutIdx - begin) + certSz > size) return BUFFER_ERROR; + ret = InitDer(&certs[totalCerts]); + if (ret < 0) { + return 0; + } certs[totalCerts].length = certSz; certs[totalCerts].buffer = input + *inOutIdx; @@ -4649,7 +4623,7 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, /* verify up to peer's first */ while (count > 1) { - buffer myCert = certs[count - 1]; + DerBuffer myCert = certs[count - 1]; byte* subjectHash; InitDecodedCert(dCert, myCert.buffer, myCert.length, ssl->heap); @@ -4668,18 +4642,24 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, WOLFSSL_MSG("Chain cert not verified by option, not adding as CA"); } else if (ret == 0 && !AlreadySigner(ssl->ctx->cm, subjectHash)) { - buffer add; - add.length = myCert.length; - add.buffer = (byte*)XMALLOC(myCert.length, ssl->heap, - DYNAMIC_TYPE_CA); + DerBuffer add; + ret = InitDer(&add); + if (ret == 0) { + ret = AllocDer(&add, myCert.length, CA_TYPE, ssl->heap); + } + if (ret < 0) { + #ifdef WOLFSSL_SMALL_STACK + XFREE(dCert, NULL, DYNAMIC_TYPE_TMP_BUFFER); + #endif + return ret; + } + WOLFSSL_MSG("Adding CA from chain"); - if (add.buffer == NULL) - return MEMORY_E; XMEMCPY(add.buffer, myCert.buffer, myCert.length); /* already verified above */ - ret = AddCA(ssl->ctx->cm, add, WOLFSSL_CHAIN_CA, 0); + ret = AddCA(ssl->ctx->cm, &add, WOLFSSL_CHAIN_CA, 0); if (ret == 1) ret = 0; /* SSL_SUCCESS for external */ } else if (ret != 0) { @@ -4735,7 +4715,7 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, /* peer's, may not have one if blank client cert sent by TLSv1.2 */ if (count) { - buffer myCert = certs[0]; + DerBuffer myCert = certs[0]; int fatal = 0; WOLFSSL_MSG("Verifying Peer's cert"); @@ -4833,10 +4813,10 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, #ifdef KEEP_PEER_CERT if (fatal == 0) { - /* set X509 format for peer cert even if fatal */ - int copyRet = CopyDecodedToX509(&ssl->peerCert, dCert); - if (copyRet == MEMORY_E) - fatal = 1; + /* set X509 format for peer cert even if fatal */ + int copyRet = CopyDecodedToX509(&ssl->peerCert, dCert); + if (copyRet == MEMORY_E) + fatal = 1; } #endif @@ -8717,7 +8697,7 @@ int SendCertificateStatus(WOLFSSL* ssl) return 0; if (!request || ssl->buffers.weOwnCert) { - buffer der = ssl->buffers.certificate; + DerBuffer der = ssl->buffers.certificate; #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; #else @@ -8814,7 +8794,7 @@ int SendCertificateStatus(WOLFSSL* ssl) return 0; if (!request || ssl->buffers.weOwnCert) { - buffer der = ssl->buffers.certificate; + DerBuffer der = ssl->buffers.certificate; #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; #else @@ -8887,7 +8867,7 @@ int SendCertificateStatus(WOLFSSL* ssl) if (ret == 0 && (!ssl->ctx->chainOcspRequest[0] || ssl->buffers.weOwnCertChain)) { - buffer der = {NULL, 0}; + DerBuffer der; word32 idx = 0; #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; @@ -8895,6 +8875,11 @@ int SendCertificateStatus(WOLFSSL* ssl) DecodedCert cert[1]; #endif + ret = InitDer(&der); + if (ret < 0) { + return ret; + } + #ifdef WOLFSSL_SMALL_STACK cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), NULL, DYNAMIC_TYPE_TMP_BUFFER); diff --git a/src/ssl.c b/src/ssl.c index 4973ac80a..c2762ffdb 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -1635,6 +1635,60 @@ int wolfSSL_GetHmacSize(WOLFSSL* ssl) #ifndef NO_CERTS +int InitDer(DerBuffer* der) +{ + int ret = BAD_FUNC_ARG; + if (der) { + XMEMSET(der, 0, sizeof(DerBuffer)); + ret = 0; + } + return ret; +} + +int AllocDer(DerBuffer* der, word32 length, int type, void* heap) +{ + int ret = BAD_FUNC_ARG; + if (der) { + int dynType = 0; + + /* Determine dynamic type */ + switch (type) { + case CA_TYPE: dynType = DYNAMIC_TYPE_CA; break; + case CERT_TYPE: dynType = DYNAMIC_TYPE_CERT; break; + case CRL_TYPE: dynType = DYNAMIC_TYPE_CRL; break; + case DSA_TYPE: dynType = DYNAMIC_TYPE_DSA; break; + case ECC_TYPE: dynType = DYNAMIC_TYPE_ECC; break; + case RSA_TYPE: dynType = DYNAMIC_TYPE_RSA; break; + default: dynType = DYNAMIC_TYPE_KEY; break; + } + + /* Setup new buffer */ + der->type = type; + der->dynType = dynType; + der->heap = heap; + der->buffer = (byte*)XMALLOC(length, heap, dynType); + if (!der->buffer) { + return MEMORY_ERROR; + } + der->length = length; + ret = 0; /* Success */ + } + return ret; +} + +void FreeDer(DerBuffer* der) +{ + if (der && der->buffer) { + /* ForceZero private keys */ + if (der->type == PRIVATEKEY_TYPE) { + ForceZero(der->buffer, der->length); + } + XFREE(der->buffer, der->heap, der->dynType); + der->buffer = NULL; + der->length = 0; + } +} + WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew(void) { WOLFSSL_CERT_MANAGER* cm = NULL; @@ -1709,7 +1763,7 @@ int wolfSSL_CertPemToDer(const unsigned char* pem, int pemSz, { int eccKey = 0; int ret; - buffer der; + DerBuffer der; #ifdef WOLFSSL_SMALL_STACK EncryptedInfo* info = NULL; #else @@ -1728,6 +1782,11 @@ int wolfSSL_CertPemToDer(const unsigned char* pem, int pemSz, return BAD_FUNC_ARG; } + ret = InitDer(&der); + if (ret < 0) { + return ret; + } + #ifdef WOLFSSL_SMALL_STACK info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -1738,7 +1797,6 @@ int wolfSSL_CertPemToDer(const unsigned char* pem, int pemSz, info->set = 0; info->ctx = NULL; info->consumed = 0; - der.buffer = NULL; ret = PemToDer(pem, pemSz, type, &der, NULL, info, &eccKey); @@ -1760,8 +1818,7 @@ int wolfSSL_CertPemToDer(const unsigned char* pem, int pemSz, } } - XFREE(der.buffer, NULL, DYNAMIC_TYPE_KEY); - + FreeDer(&der); return ret; } @@ -1810,7 +1867,7 @@ int wolfSSL_KeyPemToDer(const unsigned char* pem, int pemSz, { int eccKey = 0; int ret; - buffer der; + DerBuffer der; #ifdef WOLFSSL_SMALL_STACK EncryptedInfo* info = NULL; #else @@ -1824,6 +1881,11 @@ int wolfSSL_KeyPemToDer(const unsigned char* pem, int pemSz, return BAD_FUNC_ARG; } + ret = InitDer(&der); + if (ret < 0) { + return ret; + } + #ifdef WOLFSSL_SMALL_STACK info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -1834,7 +1896,6 @@ int wolfSSL_KeyPemToDer(const unsigned char* pem, int pemSz, info->set = 0; info->ctx = NULL; info->consumed = 0; - der.buffer = NULL; #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) if (pass) { @@ -1876,7 +1937,7 @@ int wolfSSL_KeyPemToDer(const unsigned char* pem, int pemSz, } } - XFREE(der.buffer, NULL, DYNAMIC_TYPE_KEY); + FreeDer(&der); return ret; } @@ -2187,7 +2248,7 @@ Signer* GetCAByName(void* vp, byte* hash) /* owns der, internal now uses too */ /* type flag ids from user or from chain received during verify don't allow chain ones to be added w/o isCA extension */ -int AddCA(WOLFSSL_CERT_MANAGER* cm, buffer der, int type, int verify) +int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int type, int verify) { int ret; Signer* signer = 0; @@ -2208,7 +2269,7 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, buffer der, int type, int verify) return MEMORY_E; #endif - InitDecodedCert(cert, der.buffer, der.length, cm->heap); + InitDecodedCert(cert, der->buffer, der->length, cm->heap); ret = ParseCert(cert, CA_TYPE, verify, cm); WOLFSSL_MSG(" Parsed new CA"); @@ -2277,7 +2338,7 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, buffer der, int type, int verify) cm->caTable[row] = signer; /* takes ownership */ UnLockMutex(&cm->caLock); if (cm->caCacheCallback) - cm->caCacheCallback(der.buffer, (int)der.length, type); + cm->caCacheCallback(der->buffer, (int)der->length, type); } else { WOLFSSL_MSG(" CA Mutex Lock failed"); @@ -2293,7 +2354,7 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, buffer der, int type, int verify) XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif WOLFSSL_MSG(" Freeing der CA"); - XFREE(der.buffer, cm->heap, DYNAMIC_TYPE_CA); + FreeDer(der); WOLFSSL_MSG(" OK Freeing der CA"); WOLFSSL_LEAVE("AddCA", ret); @@ -2411,7 +2472,7 @@ int wolfSSL_Init(void) #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) /* SSL_SUCCESS if ok, <= 0 else */ -static int wolfssl_decrypt_buffer_key(buffer* der, byte* password, +static int wolfssl_decrypt_buffer_key(DerBuffer* der, byte* password, int passwordSz, EncryptedInfo* info) { int ret = SSL_BAD_FILE; @@ -2569,7 +2630,7 @@ static int wolfssl_encrypt_buffer_key(byte* der, word32 derSz, byte* password, /* Remove PEM header/footer, convert to ASN1, store any encrypted data info->consumed tracks of PEM bytes consumed in case multiple parts */ int PemToDer(const unsigned char* buff, long longSz, int type, - buffer* der, void* heap, EncryptedInfo* info, int* eccKey) + DerBuffer* der, void* heap, EncryptedInfo* info, int* eccKey) { const char* header = NULL; const char* footer = NULL; @@ -2579,13 +2640,9 @@ int PemToDer(const unsigned char* buff, long longSz, int type, char* bufferEnd = (char*)(buff + longSz); long neededSz; int ret = 0; - int dynamicType = 0; int sz = (int)longSz; int encrypted_key = 0; - (void)dynamicType; - (void)heap; - WOLFSSL_ENTER("PemToDer"); switch (type) { @@ -2601,16 +2658,6 @@ int PemToDer(const unsigned char* buff, long longSz, int type, default: header=BEGIN_RSA_PRIV; footer=END_RSA_PRIV; break; } - switch (type) { - case CA_TYPE: dynamicType = DYNAMIC_TYPE_CA; break; - case CERT_TYPE: dynamicType = DYNAMIC_TYPE_CERT; break; - case CRL_TYPE: dynamicType = DYNAMIC_TYPE_CRL; break; - case DSA_TYPE: dynamicType = DYNAMIC_TYPE_DSA; break; - case ECC_TYPE: dynamicType = DYNAMIC_TYPE_ECC; break; - case RSA_TYPE: dynamicType = DYNAMIC_TYPE_RSA; break; - default: dynamicType = DYNAMIC_TYPE_KEY; break; - } - /* find header */ for (;;) { headerEnd = XSTRNSTR((char*)buff, header, sz); @@ -2731,11 +2778,10 @@ int PemToDer(const unsigned char* buff, long longSz, int type, if (neededSz > sz || neededSz < 0) return SSL_BAD_FILE; - der->buffer = (byte*)XMALLOC(neededSz, heap, dynamicType); - if (!der->buffer) - return MEMORY_ERROR; - - der->length = (word32)neededSz; + ret = AllocDer(der, (word32)neededSz, type, heap); + if (ret < 0) { + return ret; + } if (Base64_Decode((byte*)headerEnd, (word32)neededSz, der->buffer, &der->length) < 0) @@ -2763,7 +2809,7 @@ int PemToDer(const unsigned char* buff, long longSz, int type, return SSL_BAD_FILE; /* no callback error */ #ifdef WOLFSSL_SMALL_STACK - password = (char*)XMALLOC(80, NULL, DYNAMIC_TYPE_TMP_BUFFER); + password = (char*)XMALLOC(80, heap, DYNAMIC_TYPE_TMP_BUFFER); if (password == NULL) return MEMORY_E; #endif @@ -2777,7 +2823,7 @@ int PemToDer(const unsigned char* buff, long longSz, int type, XFREE(password, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif if (ret < 0) { - XFREE(der->buffer, heap, dynamicType); + FreeDer(der); return ret; } @@ -2788,10 +2834,10 @@ int PemToDer(const unsigned char* buff, long longSz, int type, ret = wolfssl_decrypt_buffer_key(der, (byte*)password, passwordSz, info); #ifdef WOLFSSL_SMALL_STACK - XFREE(password, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(password, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif if (ret != SSL_SUCCESS) { - XFREE(der->buffer, heap, dynamicType); + FreeDer(der); return ret; } } @@ -2809,9 +2855,8 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, long sz, int format, int type, WOLFSSL* ssl, long* used, int userChain) { - buffer der; /* holds DER or RAW (for NTRU) */ + DerBuffer der; /* holds DER or RAW (for NTRU) */ int ret; - int dynamicType = 0; int eccKey = 0; int rsaKey = 0; void* heap = ctx ? ctx->heap : NULL; @@ -2821,7 +2866,6 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, EncryptedInfo info[1]; #endif - (void)dynamicType; (void)rsaKey; if (used) @@ -2834,15 +2878,13 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, if (ctx == NULL && ssl == NULL) return BAD_FUNC_ARG; - if (type == CA_TYPE) - dynamicType = DYNAMIC_TYPE_CA; - else if (type == CERT_TYPE) - dynamicType = DYNAMIC_TYPE_CERT; - else - dynamicType = DYNAMIC_TYPE_KEY; + ret = InitDer(&der); + if (ret < 0) { + return ret; + } #ifdef WOLFSSL_SMALL_STACK - info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, + info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), heap, DYNAMIC_TYPE_TMP_BUFFER); if (info == NULL) return MEMORY_E; @@ -2851,7 +2893,6 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, info->set = 0; info->ctx = ctx; info->consumed = 0; - der.buffer = 0; if (format == SSL_FILETYPE_PEM) { ret = PemToDer(buff, sz, type, &der, heap, info, &eccKey); @@ -2861,9 +2902,9 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, if (ret < 0) { #ifdef WOLFSSL_SMALL_STACK - XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(info, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif - XFREE(der.buffer, heap, dynamicType); + FreeDer(&der); return ret; } @@ -2875,8 +2916,6 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, byte staticBuffer[FILE_BUFFER_SIZE]; /* tmp chain buffer */ #endif byte* chainBuffer = staticBuffer; - byte* shrinked = NULL; /* shrinked to size chainBuffer - * or staticBuffer */ int dynamicBuffer = 0; word32 bufferSz = sizeof(staticBuffer); long consumed = info->consumed; @@ -2890,9 +2929,9 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, chainBuffer = (byte*)XMALLOC(bufferSz, heap, DYNAMIC_TYPE_FILE); if (chainBuffer == NULL) { #ifdef WOLFSSL_SMALL_STACK - XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(info, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif - XFREE(der.buffer, heap, dynamicType); + FreeDer(&der); return MEMORY_E; } dynamicBuffer = 1; @@ -2900,31 +2939,31 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, WOLFSSL_MSG("Processing Cert Chain"); while (consumed < sz) { - buffer part; + DerBuffer part; info->consumed = 0; - part.buffer = 0; - - ret = PemToDer(buff + consumed, sz - consumed, type, &part, - heap, info, &eccKey); + ret = InitDer(&part); if (ret == 0) { - gotOne = 1; - if ( (idx + part.length) > bufferSz) { - WOLFSSL_MSG(" Cert Chain bigger than buffer"); - ret = BUFFER_E; - } - else { - c32to24(part.length, &chainBuffer[idx]); - idx += CERT_HEADER_SZ; - XMEMCPY(&chainBuffer[idx], part.buffer,part.length); - idx += part.length; - consumed += info->consumed; - if (used) - *used += info->consumed; + ret = PemToDer(buff + consumed, sz - consumed, type, &part, + heap, info, &eccKey); + if (ret == 0) { + gotOne = 1; + if ( (idx + part.length) > bufferSz) { + WOLFSSL_MSG(" Cert Chain bigger than buffer"); + ret = BUFFER_E; + } + else { + c32to24(part.length, &chainBuffer[idx]); + idx += CERT_HEADER_SZ; + XMEMCPY(&chainBuffer[idx], part.buffer,part.length); + idx += part.length; + consumed += info->consumed; + if (used) + *used += info->consumed; + } } + FreeDer(&part); } - XFREE(part.buffer, heap, dynamicType); - if (ret == SSL_NO_PEM_HEADER && gotOne) { WOLFSSL_MSG("We got one good PEM so stuff at end ok"); break; @@ -2935,9 +2974,9 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, if (dynamicBuffer) XFREE(chainBuffer, heap, DYNAMIC_TYPE_FILE); #ifdef WOLFSSL_SMALL_STACK - XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(info, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif - XFREE(der.buffer, heap, dynamicType); + FreeDer(&der); return ret; } WOLFSSL_MSG(" Consumed another Cert in Chain"); @@ -2945,50 +2984,48 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, WOLFSSL_MSG("Finished Processing Cert Chain"); /* only retain actual size used */ - if (idx > 0) /* clang thinks it can be zero, let's help analysis */ - shrinked = (byte*)XMALLOC(idx, heap, dynamicType); - if (shrinked) { + ret = 0; + if (idx > 0) { if (ssl) { - if (ssl->buffers.certChain.buffer && - ssl->buffers.weOwnCertChain) { - XFREE(ssl->buffers.certChain.buffer, heap, dynamicType); + if (ssl->buffers.weOwnCertChain) { + FreeDer(&ssl->buffers.certChain); + } + ret = AllocDer(&ssl->buffers.certChain, idx, type, heap); + if (ret == 0) { + XMEMCPY(ssl->buffers.certChain.buffer, chainBuffer, idx); + ssl->buffers.weOwnCertChain = 1; } - ssl->buffers.certChain.buffer = shrinked; - ssl->buffers.certChain.length = idx; - XMEMCPY(ssl->buffers.certChain.buffer, chainBuffer,idx); - ssl->buffers.weOwnCertChain = 1; } else if (ctx) { - if (ctx->certChain.buffer) - XFREE(ctx->certChain.buffer, heap, dynamicType); - ctx->certChain.buffer = shrinked; - ctx->certChain.length = idx; - XMEMCPY(ctx->certChain.buffer, chainBuffer, idx); + FreeDer(&ctx->certChain); + ret = AllocDer(&ctx->certChain, idx, type, heap); + if (ret == 0) { + XMEMCPY(ctx->certChain.buffer, chainBuffer, idx); + } } } if (dynamicBuffer) XFREE(chainBuffer, heap, DYNAMIC_TYPE_FILE); - if (idx > 0 && shrinked == NULL) { + if (ret < 0) { #ifdef WOLFSSL_SMALL_STACK - XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(info, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif - XFREE(der.buffer, heap, dynamicType); - return MEMORY_E; + FreeDer(&der); + return ret; } } } else { /* ASN1 (DER) or RAW (NTRU) */ - der.buffer = (byte*) XMALLOC(sz, heap, dynamicType); - if (!der.buffer) { + ret = AllocDer(&der, (word32)sz, type, heap); + if (ret < 0) { #ifdef WOLFSSL_SMALL_STACK - XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(info, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif - return MEMORY_ERROR; + return ret; } XMEMCPY(der.buffer, buff, sz); - der.length = (word32)sz; } #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) @@ -3003,7 +3040,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, #endif #ifdef WOLFSSL_SMALL_STACK - password = (char*)XMALLOC(80, NULL, DYNAMIC_TYPE_TMP_BUFFER); + password = (char*)XMALLOC(80, heap, DYNAMIC_TYPE_TMP_BUFFER); if (password == NULL) ret = MEMORY_E; else @@ -3021,61 +3058,63 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, } #ifdef WOLFSSL_SMALL_STACK - XFREE(password, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(password, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif if (ret != SSL_SUCCESS) { #ifdef WOLFSSL_SMALL_STACK - XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(info, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif - XFREE(der.buffer, heap, dynamicType); + FreeDer(&der); return ret; } } #endif /* OPENSSL_EXTRA || HAVE_WEBSERVER */ #ifdef WOLFSSL_SMALL_STACK - XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(info, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif + /* Handle DER owner */ if (type == CA_TYPE) { if (ctx == NULL) { WOLFSSL_MSG("Need context for CA load"); - XFREE(der.buffer, heap, dynamicType); + FreeDer(&der); return BAD_FUNC_ARG; } /* verify CA unless user set to no verify */ - return AddCA(ctx->cm, der, WOLFSSL_USER_CA, !ctx->verifyNone); - /* takes der over */ + return AddCA(ctx->cm, &der, WOLFSSL_USER_CA, !ctx->verifyNone); } else if (type == CERT_TYPE) { if (ssl) { - if (ssl->buffers.weOwnCert && ssl->buffers.certificate.buffer) - XFREE(ssl->buffers.certificate.buffer, heap, dynamicType); - ssl->buffers.certificate = der; + /* Make sure previous is free'd */ + if (ssl->buffers.weOwnCert) { + FreeDer(&ssl->buffers.certificate); + } + XMEMCPY(&ssl->buffers.certificate, &der, sizeof(der)); ssl->buffers.weOwnCert = 1; } else if (ctx) { - if (ctx->certificate.buffer) - XFREE(ctx->certificate.buffer, heap, dynamicType); - ctx->certificate = der; /* takes der over */ + FreeDer(&ctx->certificate); /* Make sure previous is free'd */ + XMEMCPY(&ctx->certificate, &der, sizeof(der)); } } else if (type == PRIVATEKEY_TYPE) { if (ssl) { - if (ssl->buffers.weOwnKey && ssl->buffers.key.buffer) - XFREE(ssl->buffers.key.buffer, heap, dynamicType); - ssl->buffers.key = der; + /* Make sure previous is free'd */ + if (ssl->buffers.weOwnKey) { + FreeDer(&ssl->buffers.key); + } + XMEMCPY(&ssl->buffers.key, &der, sizeof(der)); ssl->buffers.weOwnKey = 1; } else if (ctx) { - if (ctx->privateKey.buffer) - XFREE(ctx->privateKey.buffer, heap, dynamicType); - ctx->privateKey = der; /* takes der over */ + FreeDer(&ctx->privateKey); + XMEMCPY(&ctx->privateKey, &der, sizeof(der)); } } else { - XFREE(der.buffer, heap, dynamicType); + FreeDer(&der); return SSL_BAD_CERTTYPE; } @@ -3091,7 +3130,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, #endif #ifdef WOLFSSL_SMALL_STACK - key = (RsaKey*)XMALLOC(sizeof(RsaKey), NULL, + key = (RsaKey*)XMALLOC(sizeof(RsaKey), heap, DYNAMIC_TYPE_TMP_BUFFER); if (key == NULL) return MEMORY_E; @@ -3116,7 +3155,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, wc_FreeRsaKey(key); #ifdef WOLFSSL_SMALL_STACK - XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(key, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif if (ret != 0) @@ -3151,7 +3190,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, #endif #ifdef WOLFSSL_SMALL_STACK - cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), NULL, + cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), heap, DYNAMIC_TYPE_TMP_BUFFER); if (cert == NULL) return MEMORY_E; @@ -3163,7 +3202,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, if (DecodeToKey(cert, 0) < 0) { WOLFSSL_MSG("Decode to key failed"); #ifdef WOLFSSL_SMALL_STACK - XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(cert, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif return SSL_BAD_FILE; } @@ -3208,7 +3247,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, FreeDecodedCert(cert); #ifdef WOLFSSL_SMALL_STACK - XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(cert, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif } @@ -3383,7 +3422,7 @@ int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, const byte* buff, long sz, int format) { int ret = 0; - buffer der; + DerBuffer der; #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; #else @@ -3392,16 +3431,18 @@ int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, const byte* buff, WOLFSSL_ENTER("wolfSSL_CertManagerVerifyBuffer"); + ret = InitDer(&der); + if (ret < 0) { + return ret; + } + #ifdef WOLFSSL_SMALL_STACK - cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), NULL, + cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), cm->heap, DYNAMIC_TYPE_TMP_BUFFER); if (cert == NULL) return MEMORY_E; #endif - der.buffer = NULL; - der.length = 0; - if (format == SSL_FILETYPE_PEM) { int eccKey = 0; /* not used */ #ifdef WOLFSSL_SMALL_STACK @@ -3411,10 +3452,10 @@ int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, const byte* buff, #endif #ifdef WOLFSSL_SMALL_STACK - info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, + info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), cm->heap, DYNAMIC_TYPE_TMP_BUFFER); if (info == NULL) { - XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(cert, cm->heap, DYNAMIC_TYPE_TMP_BUFFER); return MEMORY_E; } #endif @@ -3427,7 +3468,7 @@ int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, const byte* buff, InitDecodedCert(cert, der.buffer, der.length, cm->heap); #ifdef WOLFSSL_SMALL_STACK - XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(info, cm->heap, DYNAMIC_TYPE_TMP_BUFFER); #endif } else @@ -3442,10 +3483,9 @@ int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, const byte* buff, #endif FreeDecodedCert(cert); - - XFREE(der.buffer, cm->heap, DYNAMIC_TYPE_CERT); + FreeDer(&der); #ifdef WOLFSSL_SMALL_STACK - XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(cert, cm->heap, DYNAMIC_TYPE_TMP_BUFFER); #endif return ret == 0 ? SSL_SUCCESS : ret; @@ -4200,12 +4240,13 @@ int wolfSSL_PemCertToDer(const char* fileName, unsigned char* derBuf, int derSz) int ecc = 0; long sz = 0; XFILE file = XFOPEN(fileName, "rb"); - buffer converted; + DerBuffer converted; WOLFSSL_ENTER("wolfSSL_PemCertToDer"); - if (file == XBADFILE) + if (file == XBADFILE) { ret = SSL_BAD_FILE; + } else { XFSEEK(file, 0, XSEEK_END); sz = XFTELL(file); @@ -4221,39 +4262,41 @@ int wolfSSL_PemCertToDer(const char* fileName, unsigned char* derBuf, int derSz) else dynamic = 1; } - - converted.buffer = 0; - + if (ret == 0) { - if ( (ret = (int)XFREAD(fileBuf, sz, 1, file)) < 0) - ret = SSL_BAD_FILE; - else { - #ifdef WOLFSSL_SMALL_STACK - info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (info == NULL) - ret = MEMORY_E; - else - #endif - { - ret = PemToDer(fileBuf, sz, CA_TYPE, &converted, - 0, info, &ecc); - #ifdef WOLFSSL_SMALL_STACK - XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - } - } - + ret = InitDer(&converted); if (ret == 0) { - if (converted.length < (word32)derSz) { - XMEMCPY(derBuf, converted.buffer, converted.length); - ret = converted.length; + if ( (ret = (int)XFREAD(fileBuf, sz, 1, file)) < 0) { + ret = SSL_BAD_FILE; + } + else { + #ifdef WOLFSSL_SMALL_STACK + info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, + DYNAMIC_TYPE_TMP_BUFFER); + if (info == NULL) + ret = MEMORY_E; + else + #endif + { + ret = PemToDer(fileBuf, sz, CA_TYPE, &converted, + 0, info, &ecc); + #ifdef WOLFSSL_SMALL_STACK + XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); + #endif + } } - else - ret = BUFFER_E; - } - XFREE(converted.buffer, 0, DYNAMIC_TYPE_CA); + if (ret == 0) { + if (converted.length < (word32)derSz) { + XMEMCPY(derBuf, converted.buffer, converted.length); + ret = converted.length; + } + else + ret = BUFFER_E; + } + + FreeDer(&converted); + } } XFCLOSE(file); @@ -4282,12 +4325,13 @@ int wolfSSL_PemPubKeyToDer(const char* fileName, int ret = 0; long sz = 0; XFILE file = XFOPEN(fileName, "rb"); - buffer converted; + DerBuffer converted; WOLFSSL_ENTER("wolfSSL_PemPubKeyToDer"); - if (file == XBADFILE) + if (file == XBADFILE) { ret = SSL_BAD_FILE; + } else { XFSEEK(file, 0, XSEEK_END); sz = XFTELL(file); @@ -4303,26 +4347,26 @@ int wolfSSL_PemPubKeyToDer(const char* fileName, else dynamic = 1; } - - converted.buffer = 0; - if (ret == 0) { - if ( (ret = (int)XFREAD(fileBuf, sz, 1, file)) < 0) - ret = SSL_BAD_FILE; - else - ret = PemToDer(fileBuf, sz, PUBLICKEY_TYPE, &converted, - 0, NULL, NULL); - + ret = InitDer(&converted); if (ret == 0) { - if (converted.length < (word32)derSz) { - XMEMCPY(derBuf, converted.buffer, converted.length); - ret = converted.length; - } + if ( (ret = (int)XFREAD(fileBuf, sz, 1, file)) < 0) + ret = SSL_BAD_FILE; else - ret = BUFFER_E; - } + ret = PemToDer(fileBuf, sz, PUBLICKEY_TYPE, &converted, + 0, NULL, NULL); - XFREE(converted.buffer, 0, DYNAMIC_TYPE_CA); + if (ret == 0) { + if (converted.length < (word32)derSz) { + XMEMCPY(derBuf, converted.buffer, converted.length); + ret = converted.length; + } + else + ret = BUFFER_E; + } + + FreeDer(&converted); + } } XFCLOSE(file); @@ -4339,7 +4383,7 @@ int wolfSSL_PubKeyPemToDer(const unsigned char* pem, int pemSz, unsigned char* buff, int buffSz) { int ret; - buffer der; + DerBuffer der; WOLFSSL_ENTER("wolfSSL_PubKeyPemToDer"); @@ -4348,7 +4392,10 @@ int wolfSSL_PubKeyPemToDer(const unsigned char* pem, int pemSz, return BAD_FUNC_ARG; } - der.buffer = NULL; + ret = InitDer(&der); + if (ret < 0) { + return ret; + } ret = PemToDer(pem, pemSz, PUBLICKEY_TYPE, &der, NULL, NULL, NULL); if (ret < 0) { @@ -4365,7 +4412,7 @@ int wolfSSL_PubKeyPemToDer(const unsigned char* pem, int pemSz, } } - XFREE(der.buffer, NULL, DYNAMIC_TYPE_KEY); + FreeDer(&der); return ret; } @@ -7349,7 +7396,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) const unsigned char* buf, long sz, int format) { - buffer der; + DerBuffer der; int ret = 0; int weOwnDer = 0; word32 pSz = MAX_DH_SIZE; @@ -7383,9 +7430,12 @@ int wolfSSL_set_compression(WOLFSSL* ssl) ret = SSL_BAD_FILETYPE; else { if (format == SSL_FILETYPE_PEM) { - der.buffer = NULL; - ret = PemToDer(buf, sz, DH_PARAM_TYPE, &der, ctx->heap, NULL,NULL); - weOwnDer = 1; + ret = InitDer(&der); + if (ret == 0) { + ret = PemToDer(buf, sz, DH_PARAM_TYPE, &der, ctx->heap, + NULL, NULL); + weOwnDer = 1; + } } if (ret == 0) { @@ -7399,7 +7449,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) } if (weOwnDer) - XFREE(der.buffer, ctx->heap, DYNAMIC_TYPE_KEY); + FreeDer(&der); #ifdef WOLFSSL_SMALL_STACK XFREE(p, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -7468,29 +7518,20 @@ int wolfSSL_set_compression(WOLFSSL* ssl) if (ssl->buffers.weOwnCert) { WOLFSSL_MSG("Unloading cert"); - XFREE(ssl->buffers.certificate.buffer, ssl->heap,DYNAMIC_TYPE_CERT); + FreeDer(&ssl->buffers.certificate); ssl->buffers.weOwnCert = 0; - ssl->buffers.certificate.length = 0; - ssl->buffers.certificate.buffer = NULL; } if (ssl->buffers.weOwnCertChain) { WOLFSSL_MSG("Unloading cert chain"); - XFREE(ssl->buffers.certChain.buffer, ssl->heap,DYNAMIC_TYPE_CERT); + FreeDer(&ssl->buffers.certChain); ssl->buffers.weOwnCertChain = 0; - ssl->buffers.certChain.length = 0; - ssl->buffers.certChain.buffer = NULL; } if (ssl->buffers.weOwnKey) { WOLFSSL_MSG("Unloading key"); - if (ssl->buffers.key.buffer) { - ForceZero(ssl->buffers.key.buffer, ssl->buffers.key.length); - } - XFREE(ssl->buffers.key.buffer, ssl->heap, DYNAMIC_TYPE_KEY); + FreeDer(&ssl->buffers.key); ssl->buffers.weOwnKey = 0; - ssl->buffers.key.length = 0; - ssl->buffers.key.buffer = NULL; } return SSL_SUCCESS; @@ -9952,7 +9993,7 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) XFILE file; WOLFSSL_X509* x509 = NULL; - buffer der; + DerBuffer der; WOLFSSL_ENTER("wolfSSL_X509_load_certificate"); @@ -9961,6 +10002,11 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM)) return NULL; + ret = InitDer(&der); + if (ret < 0) { + return NULL; + } + file = XFOPEN(fname, "rb"); if (file == XBADFILE) return NULL; @@ -9992,9 +10038,6 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) XFCLOSE(file); - der.buffer = NULL; - der.length = 0; - if (format == SSL_FILETYPE_PEM) { int ecc = 0; #ifdef WOLFSSL_SMALL_STACK @@ -10005,7 +10048,7 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) #ifdef WOLFSSL_SMALL_STACK info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, - DYNAMIC_TYPE_TMP_BUFFER); + DYNAMIC_TYPE_TMP_BUFFER); if (info == NULL) { if (dynamic) XFREE(fileBuffer, NULL, DYNAMIC_TYPE_FILE); @@ -10018,15 +10061,8 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) info->ctx = NULL; info->consumed = 0; - if (PemToDer(fileBuffer, sz, CERT_TYPE, &der, NULL, info, &ecc) != 0) - { - /* Only time this should fail, and leave `der` with a buffer - is when the Base64 Decode fails. Release `der.buffer` in - that case. */ - if (der.buffer != NULL) { - XFREE(der.buffer, NULL, DYNAMIC_TYPE_CERT); - der.buffer = NULL; - } + if (PemToDer(fileBuffer, sz, CERT_TYPE, &der, NULL, info, &ecc) != 0) { + FreeDer(&der); } #ifdef WOLFSSL_SMALL_STACK @@ -10034,10 +10070,9 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) #endif } else { - der.buffer = (byte*)XMALLOC(sz, NULL, DYNAMIC_TYPE_CERT); - if (der.buffer != NULL) { + ret = AllocDer(&der, (word32)sz, CERT_TYPE, NULL); + if (ret == 0) { XMEMCPY(der.buffer, fileBuffer, sz); - der.length = (word32)sz; } } @@ -10078,7 +10113,7 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) #endif } - XFREE(der.buffer, NULL, DYNAMIC_TYPE_CERT); + FreeDer(&der); } return x509; @@ -10847,20 +10882,27 @@ int wolfSSL_X509_STORE_add_cert(WOLFSSL_X509_STORE* store, WOLFSSL_X509* x509) WOLFSSL_ENTER("wolfSSL_X509_STORE_add_cert"); if (store != NULL && store->cm != NULL && x509 != NULL) { - buffer derCert; - derCert.buffer = (byte*)XMALLOC(x509->derCert.length, - NULL, DYNAMIC_TYPE_CERT); - if (derCert.buffer != NULL) { - derCert.length = x509->derCert.length; + DerBuffer derCert; + + result = InitDer(&derCert); + if (result == 0) { + result = AllocDer(&derCert, x509->derCert.length, + x509->derCert.type, NULL); + if (result == 0) { /* AddCA() frees the buffer. */ - XMEMCPY(derCert.buffer, + XMEMCPY(derCert.buffer, x509->derCert.buffer, x509->derCert.length); - result = AddCA(store->cm, derCert, WOLFSSL_USER_CA, 1); - if (result != SSL_SUCCESS) result = SSL_FATAL_ERROR; + result = AddCA(store->cm, &derCert, WOLFSSL_USER_CA, 1); + } } } WOLFSSL_LEAVE("wolfSSL_X509_STORE_add_cert", result); + + if (result != SSL_SUCCESS) { + result = SSL_FATAL_ERROR; + } + return result; } @@ -11419,11 +11461,15 @@ int wolfSSL_cmp_peer_cert_to_file(WOLFSSL* ssl, const char *fname) XFILE file = XBADFILE; long sz = 0; int eccKey = 0; - WOLFSSL_CTX* ctx = ssl->ctx; - WOLFSSL_X509* peer_cert = &ssl->peerCert; - buffer fileDer; + WOLFSSL_CTX* ctx = ssl->ctx; + WOLFSSL_X509* peer_cert = &ssl->peerCert; + DerBuffer fileDer; + + ret = InitDer(&fileDer); + if (ret < 0) { + return ret; + } - fileDer.buffer = 0; file = XFOPEN(fname, "rb"); if (file == XBADFILE) return SSL_BAD_FILE; @@ -11468,7 +11514,8 @@ int wolfSSL_cmp_peer_cert_to_file(WOLFSSL* ssl, const char *fname) #endif } - XFREE(fileDer.buffer, ctx->heap, DYNAMIC_TYPE_CERT); + FreeDer(&fileDer); + if (dynamic) XFREE(myBuffer, ctx->heap, DYNAMIC_TYPE_FILE); @@ -14090,7 +14137,7 @@ int wolfSSL_PEM_write_mem_RSAPrivateKey(RSA* rsa, const EVP_CIPHER* cipher, unsigned char* passwd, int passwdSz, unsigned char **pem, int *plen) { - byte *der, *tmp, *cipherInfo = NULL; + byte *derBuf, *tmp, *cipherInfo = NULL; int der_max_len = 0, derSz = 0; WOLFSSL_ENTER("wolfSSL_PEM_write_mem_RSAPrivateKey"); @@ -14114,17 +14161,17 @@ int wolfSSL_PEM_write_mem_RSAPrivateKey(RSA* rsa, const EVP_CIPHER* cipher, */ der_max_len = 5 * wolfSSL_RSA_size(rsa) + AES_BLOCK_SIZE; - der = (byte*)XMALLOC(der_max_len, NULL, DYNAMIC_TYPE_TMP_BUFFER); - if (der == NULL) { + derBuf = (byte*)XMALLOC(der_max_len, NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (derBuf == NULL) { WOLFSSL_MSG("malloc failed"); return SSL_FAILURE; } /* Key to DER */ - derSz = wc_RsaKeyToDer((RsaKey*)rsa->internal, der, der_max_len); + derSz = wc_RsaKeyToDer((RsaKey*)rsa->internal, derBuf, der_max_len); if (derSz < 0) { WOLFSSL_MSG("wc_RsaKeyToDer failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); return SSL_FAILURE; } @@ -14132,11 +14179,11 @@ int wolfSSL_PEM_write_mem_RSAPrivateKey(RSA* rsa, const EVP_CIPHER* cipher, if (passwd != NULL && passwdSz > 0 && cipher != NULL) { int ret; - ret = EncryptDerKey(der, &derSz, cipher, + ret = EncryptDerKey(derBuf, &derSz, cipher, passwd, passwdSz, &cipherInfo); if (ret != SSL_SUCCESS) { WOLFSSL_MSG("EncryptDerKey failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); return ret; } @@ -14150,23 +14197,23 @@ int wolfSSL_PEM_write_mem_RSAPrivateKey(RSA* rsa, const EVP_CIPHER* cipher, tmp = (byte*)XMALLOC(*plen, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (tmp == NULL) { WOLFSSL_MSG("malloc failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (cipherInfo != NULL) XFREE(cipherInfo, NULL, DYNAMIC_TYPE_TMP_BUFFER); return SSL_FAILURE; } /* DER to PEM */ - *plen = wc_DerToPemEx(der, derSz, tmp, *plen, cipherInfo, PRIVATEKEY_TYPE); + *plen = wc_DerToPemEx(derBuf, derSz, tmp, *plen, cipherInfo, PRIVATEKEY_TYPE); if (*plen <= 0) { WOLFSSL_MSG("wc_DerToPemEx failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(tmp, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (cipherInfo != NULL) XFREE(cipherInfo, NULL, DYNAMIC_TYPE_TMP_BUFFER); return SSL_FAILURE; } - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (cipherInfo != NULL) XFREE(cipherInfo, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -15473,7 +15520,7 @@ int wolfSSL_PEM_write_mem_ECPrivateKey(WOLFSSL_EC_KEY* ecc, unsigned char* passwd, int passwdSz, unsigned char **pem, int *plen) { - byte *der, *tmp, *cipherInfo = NULL; + byte *derBuf, *tmp, *cipherInfo = NULL; int der_max_len = 0, derSz = 0; WOLFSSL_MSG("wolfSSL_PEM_write_mem_ECPrivateKey"); @@ -15496,17 +15543,17 @@ int wolfSSL_PEM_write_mem_ECPrivateKey(WOLFSSL_EC_KEY* ecc, */ der_max_len = 4 * wc_ecc_size((ecc_key*)ecc->internal) + AES_BLOCK_SIZE; - der = (byte*)XMALLOC(der_max_len, NULL, DYNAMIC_TYPE_TMP_BUFFER); - if (der == NULL) { + derBuf = (byte*)XMALLOC(der_max_len, NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (derBuf == NULL) { WOLFSSL_MSG("malloc failed"); return SSL_FAILURE; } /* Key to DER */ - derSz = wc_EccKeyToDer((ecc_key*)ecc->internal, der, der_max_len); + derSz = wc_EccKeyToDer((ecc_key*)ecc->internal, derBuf, der_max_len); if (derSz < 0) { WOLFSSL_MSG("wc_DsaKeyToDer failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); return SSL_FAILURE; } @@ -15514,11 +15561,11 @@ int wolfSSL_PEM_write_mem_ECPrivateKey(WOLFSSL_EC_KEY* ecc, if (passwd != NULL && passwdSz > 0 && cipher != NULL) { int ret; - ret = EncryptDerKey(der, &derSz, cipher, + ret = EncryptDerKey(derBuf, &derSz, cipher, passwd, passwdSz, &cipherInfo); if (ret != SSL_SUCCESS) { WOLFSSL_MSG("EncryptDerKey failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); return ret; } @@ -15532,23 +15579,23 @@ int wolfSSL_PEM_write_mem_ECPrivateKey(WOLFSSL_EC_KEY* ecc, tmp = (byte*)XMALLOC(*plen, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (tmp == NULL) { WOLFSSL_MSG("malloc failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (cipherInfo != NULL) XFREE(cipherInfo, NULL, DYNAMIC_TYPE_TMP_BUFFER); return SSL_FAILURE; } /* DER to PEM */ - *plen = wc_DerToPemEx(der, derSz, tmp, *plen, cipherInfo, ECC_PRIVATEKEY_TYPE); + *plen = wc_DerToPemEx(derBuf, derSz, tmp, *plen, cipherInfo, ECC_PRIVATEKEY_TYPE); if (*plen <= 0) { WOLFSSL_MSG("wc_DerToPemEx failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(tmp, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (cipherInfo != NULL) XFREE(cipherInfo, NULL, DYNAMIC_TYPE_TMP_BUFFER); return SSL_FAILURE; } - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (cipherInfo != NULL) XFREE(cipherInfo, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -15648,7 +15695,7 @@ int wolfSSL_PEM_write_mem_DSAPrivateKey(WOLFSSL_DSA* dsa, unsigned char* passwd, int passwdSz, unsigned char **pem, int *plen) { - byte *der, *tmp, *cipherInfo = NULL; + byte *derBuf, *tmp, *cipherInfo = NULL; int der_max_len = 0, derSz = 0; WOLFSSL_MSG("wolfSSL_PEM_write_mem_DSAPrivateKey"); @@ -15671,17 +15718,17 @@ int wolfSSL_PEM_write_mem_DSAPrivateKey(WOLFSSL_DSA* dsa, */ der_max_len = 4 * wolfSSL_BN_num_bytes(dsa->g) + AES_BLOCK_SIZE; - der = (byte*)XMALLOC(der_max_len, NULL, DYNAMIC_TYPE_TMP_BUFFER); - if (der == NULL) { + derBuf = (byte*)XMALLOC(der_max_len, NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (derBuf == NULL) { WOLFSSL_MSG("malloc failed"); return SSL_FAILURE; } /* Key to DER */ - derSz = wc_DsaKeyToDer((DsaKey*)dsa->internal, der, der_max_len); + derSz = wc_DsaKeyToDer((DsaKey*)dsa->internal, derBuf, der_max_len); if (derSz < 0) { WOLFSSL_MSG("wc_DsaKeyToDer failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); return SSL_FAILURE; } @@ -15689,11 +15736,11 @@ int wolfSSL_PEM_write_mem_DSAPrivateKey(WOLFSSL_DSA* dsa, if (passwd != NULL && passwdSz > 0 && cipher != NULL) { int ret; - ret = EncryptDerKey(der, &derSz, cipher, + ret = EncryptDerKey(derBuf, &derSz, cipher, passwd, passwdSz, &cipherInfo); if (ret != SSL_SUCCESS) { WOLFSSL_MSG("EncryptDerKey failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); return ret; } @@ -15707,23 +15754,23 @@ int wolfSSL_PEM_write_mem_DSAPrivateKey(WOLFSSL_DSA* dsa, tmp = (byte*)XMALLOC(*plen, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (tmp == NULL) { WOLFSSL_MSG("malloc failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (cipherInfo != NULL) XFREE(cipherInfo, NULL, DYNAMIC_TYPE_TMP_BUFFER); return SSL_FAILURE; } /* DER to PEM */ - *plen = wc_DerToPemEx(der, derSz, tmp, *plen, cipherInfo, DSA_PRIVATEKEY_TYPE); + *plen = wc_DerToPemEx(derBuf, derSz, tmp, *plen, cipherInfo, DSA_PRIVATEKEY_TYPE); if (*plen <= 0) { WOLFSSL_MSG("wc_DerToPemEx failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(tmp, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (cipherInfo != NULL) XFREE(cipherInfo, NULL, DYNAMIC_TYPE_TMP_BUFFER); return SSL_FAILURE; } - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(derBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (cipherInfo != NULL) XFREE(cipherInfo, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -15887,19 +15934,19 @@ int wolfSSL_PEM_write_RSA_PUBKEY(FILE *fp, WOLFSSL_RSA *x) #endif /* NO_FILESYSTEM */ /* return SSL_SUCCESS if success, SSL_FATAL_ERROR if error */ -int wolfSSL_RSA_LoadDer(WOLFSSL_RSA* rsa, const unsigned char* der, int derSz) +int wolfSSL_RSA_LoadDer(WOLFSSL_RSA* rsa, const unsigned char* derBuf, int derSz) { word32 idx = 0; int ret; WOLFSSL_ENTER("wolfSSL_RSA_LoadDer"); - if (rsa == NULL || rsa->internal == NULL || der == NULL || derSz <= 0) { + if (rsa == NULL || rsa->internal == NULL || derBuf == NULL || derSz <= 0) { WOLFSSL_MSG("Bad function arguments"); return SSL_FATAL_ERROR; } - ret = wc_RsaPrivateKeyDecode(der, &idx, (RsaKey*)rsa->internal, derSz); + ret = wc_RsaPrivateKeyDecode(derBuf, &idx, (RsaKey*)rsa->internal, derSz); if (ret < 0) { WOLFSSL_MSG("RsaPrivateKeyDecode failed"); return SSL_FATAL_ERROR; @@ -15919,19 +15966,19 @@ int wolfSSL_RSA_LoadDer(WOLFSSL_RSA* rsa, const unsigned char* der, int derSz) #ifndef NO_DSA /* return SSL_SUCCESS if success, SSL_FATAL_ERROR if error */ -int wolfSSL_DSA_LoadDer(WOLFSSL_DSA* dsa, const unsigned char* der, int derSz) +int wolfSSL_DSA_LoadDer(WOLFSSL_DSA* dsa, const unsigned char* derBuf, int derSz) { word32 idx = 0; int ret; WOLFSSL_ENTER("wolfSSL_DSA_LoadDer"); - if (dsa == NULL || dsa->internal == NULL || der == NULL || derSz <= 0) { + if (dsa == NULL || dsa->internal == NULL || derBuf == NULL || derSz <= 0) { WOLFSSL_MSG("Bad function arguments"); return SSL_FATAL_ERROR; } - ret = DsaPrivateKeyDecode(der, &idx, (DsaKey*)dsa->internal, derSz); + ret = DsaPrivateKeyDecode(derBuf, &idx, (DsaKey*)dsa->internal, derSz); if (ret < 0) { WOLFSSL_MSG("DsaPrivateKeyDecode failed"); return SSL_FATAL_ERROR; @@ -15951,19 +15998,19 @@ int wolfSSL_DSA_LoadDer(WOLFSSL_DSA* dsa, const unsigned char* der, int derSz) #ifdef HAVE_ECC /* return SSL_SUCCESS if success, SSL_FATAL_ERROR if error */ int wolfSSL_EC_KEY_LoadDer(WOLFSSL_EC_KEY* key, - const unsigned char* der, int derSz) + const unsigned char* derBuf, int derSz) { word32 idx = 0; int ret; WOLFSSL_ENTER("wolfSSL_EC_KEY_LoadDer"); - if (key == NULL || key->internal == NULL || der == NULL || derSz <= 0) { + if (key == NULL || key->internal == NULL || derBuf == NULL || derSz <= 0) { WOLFSSL_MSG("Bad function arguments"); return SSL_FATAL_ERROR; } - ret = wc_EccPrivateKeyDecode(der, &idx, (ecc_key*)key->internal, derSz); + ret = wc_EccPrivateKeyDecode(derBuf, &idx, (ecc_key*)key->internal, derSz); if (ret < 0) { WOLFSSL_MSG("wc_EccPrivateKeyDecode failed"); return SSL_FATAL_ERROR; diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 567f26820..ebe7637ed 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -7668,7 +7668,7 @@ int wc_SetSubjectKeyId(Cert *cert, const char* file) if (cert == NULL || file == NULL) return BAD_FUNC_ARG; - der = (byte*)XMALLOC(MAX_PUBLIC_KEY_SZ, NULL, DYNAMIC_TYPE_TMP_BUFFER); + der = (byte*)XMALLOC(MAX_PUBLIC_KEY_SZ, NULL, DYNAMIC_TYPE_CERT); if (der == NULL) { WOLFSSL_MSG("wc_SetSubjectKeyId memory Problem"); return MEMORY_E; @@ -7684,14 +7684,14 @@ int wc_SetSubjectKeyId(Cert *cert, const char* file) /* Load PubKey in internal structure */ rsakey = (RsaKey*) XMALLOC(sizeof(RsaKey), NULL, DYNAMIC_TYPE_RSA); if (rsakey == NULL) { - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(der, NULL, DYNAMIC_TYPE_CERT); return MEMORY_E; } if (wc_InitRsaKey(rsakey, NULL) != 0) { WOLFSSL_MSG("wc_InitRsaKey failure"); XFREE(rsakey, NULL, DYNAMIC_TYPE_RSA); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(der, NULL, DYNAMIC_TYPE_CERT); return MEMORY_E; } @@ -7706,7 +7706,7 @@ int wc_SetSubjectKeyId(Cert *cert, const char* file) /* Check to load ecc public key */ eckey = (ecc_key*) XMALLOC(sizeof(ecc_key), NULL, DYNAMIC_TYPE_ECC); if (eckey == NULL) { - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(der, NULL, DYNAMIC_TYPE_CERT); return MEMORY_E; } @@ -7714,7 +7714,7 @@ int wc_SetSubjectKeyId(Cert *cert, const char* file) WOLFSSL_MSG("wc_ecc_init failure"); wc_ecc_free(eckey); XFREE(eckey, NULL, DYNAMIC_TYPE_ECC); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(der, NULL, DYNAMIC_TYPE_CERT); return MEMORY_E; } @@ -7722,17 +7722,17 @@ int wc_SetSubjectKeyId(Cert *cert, const char* file) ret = wc_EccPublicKeyDecode(der, &idx, eckey, derSz); if (ret != 0) { WOLFSSL_MSG("wc_EccPublicKeyDecode failed"); - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(der, NULL, DYNAMIC_TYPE_CERT); wc_ecc_free(eckey); return PUBLIC_KEY_E; } #else - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(der, NULL, DYNAMIC_TYPE_CERT); return PUBLIC_KEY_E; #endif /* HAVE_ECC */ } - XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(der, NULL, DYNAMIC_TYPE_CERT); ret = wc_SetSubjectKeyIdFromPublicKey(cert, rsakey, eckey); diff --git a/wolfssl/internal.h b/wolfssl/internal.h index bb835db98..f214d8383 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1211,6 +1211,17 @@ typedef struct buffer { word32 length; } buffer; +#ifndef NO_CERTS + /* wolfSSL DER buffer */ + typedef struct DerBuffer { + byte* buffer; + void* heap; + word32 length; + int type; /* enum CertType */ + int dynType; /* DYNAMIC_TYPE_* */ + } DerBuffer; +#endif /* !NO_CERTS */ + enum { FORCED_FREE = 1, @@ -1807,10 +1818,10 @@ struct WOLFSSL_CTX { buffer serverDH_G; #endif #ifndef NO_CERTS - buffer certificate; - buffer certChain; + DerBuffer certificate; + DerBuffer certChain; /* chain after self, in DER, with leading size for each cert */ - buffer privateKey; + DerBuffer privateKey; WOLFSSL_CERT_MANAGER* cm; /* our cert manager, ctx owns SSL will use */ #endif Suites* suites; /* make dynamic, user may not need/set */ @@ -1920,7 +1931,7 @@ int ProcessOldClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx, word32 inSz, word16 sz); #ifndef NO_CERTS WOLFSSL_LOCAL - int AddCA(WOLFSSL_CERT_MANAGER* ctx, buffer der, int type, int verify); + int AddCA(WOLFSSL_CERT_MANAGER* ctx, DerBuffer* der, int type, int verify); WOLFSSL_LOCAL int AlreadySigner(WOLFSSL_CERT_MANAGER* cm, byte* hash); #endif @@ -2182,9 +2193,9 @@ typedef struct Buffers { buffer serverDH_Priv; #endif #ifndef NO_CERTS - buffer certificate; /* WOLFSSL_CTX owns, unless we own */ - buffer key; /* WOLFSSL_CTX owns, unless we own */ - buffer certChain; /* WOLFSSL_CTX owns, unless we own */ + DerBuffer certificate; /* WOLFSSL_CTX owns, unless we own */ + DerBuffer key; /* WOLFSSL_CTX owns, unless we own */ + DerBuffer certChain; /* WOLFSSL_CTX owns, unless we own */ /* chain after self, in DER, with leading size for each cert */ #endif #ifdef WOLFSSL_DTLS @@ -2358,7 +2369,7 @@ struct WOLFSSL_X509 { #ifdef HAVE_ECC word32 pkCurveOID; #endif /* HAVE_ECC */ - buffer derCert; /* may need */ + DerBuffer derCert; /* may need */ DNS_entry* altNames; /* alt names list */ DNS_entry* altNamesNext; /* hint for retrieval */ byte dynamicMemory; /* dynamic memory flag */ @@ -2680,8 +2691,13 @@ typedef struct EncryptedInfo { #ifndef NO_CERTS + + WOLFSSL_LOCAL int InitDer(DerBuffer* der); + WOLFSSL_LOCAL int AllocDer(DerBuffer* der, word32 length, int type, void* heap); + WOLFSSL_LOCAL void FreeDer(DerBuffer* der); + WOLFSSL_LOCAL int PemToDer(const unsigned char* buff, long sz, int type, - buffer* der, void* heap, EncryptedInfo* info, + DerBuffer* der, void* heap, EncryptedInfo* info, int* eccKey); WOLFSSL_LOCAL int ProcessFile(WOLFSSL_CTX* ctx, const char* fname, int format, @@ -2784,9 +2800,9 @@ WOLFSSL_LOCAL int ProcessReply(WOLFSSL*); WOLFSSL_LOCAL int SetCipherSpecs(WOLFSSL*); WOLFSSL_LOCAL int MakeMasterSecret(WOLFSSL*); -WOLFSSL_LOCAL int AddSession(WOLFSSL*); -WOLFSSL_LOCAL int DeriveKeys(WOLFSSL* ssl); -WOLFSSL_LOCAL int StoreKeys(WOLFSSL* ssl, const byte* keyData); +WOLFSSL_LOCAL int AddSession(WOLFSSL*); +WOLFSSL_LOCAL int DeriveKeys(WOLFSSL* ssl); +WOLFSSL_LOCAL int StoreKeys(WOLFSSL* ssl, const byte* keyData); WOLFSSL_LOCAL int IsTLS(const WOLFSSL* ssl); WOLFSSL_LOCAL int IsAtLeastTLSv1_2(const WOLFSSL* ssl); From 953a3bd01d5c826d666c78ca8c5a882b9fb48360 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 19 Feb 2016 13:52:06 -0800 Subject: [PATCH 003/192] Fixes build error with NO_FILESYSTEM and !NO_CERTS where the wolfssl/test.h load_buffer() function is passing non-existent enum value. Was renamed from CYASSL_ to WOLFSSL_. --- examples/echoclient/echoclient.c | 2 +- examples/echoserver/echoserver.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/echoclient/echoclient.c b/examples/echoclient/echoclient.c index 37670f20e..04bbf0374 100644 --- a/examples/echoclient/echoclient.c +++ b/examples/echoclient/echoclient.c @@ -132,7 +132,7 @@ void echoclient_test(void* args) #endif #elif !defined(NO_CERTS) if (!doPSK) - load_buffer(ctx, caCert, CYASSL_CA); + load_buffer(ctx, caCert, WOLFSSL_CA); #endif #if defined(CYASSL_SNIFFER) diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index 25e6cd5c0..76bf3e57a 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -191,8 +191,8 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) } /* doPSK */ #elif !defined(NO_CERTS) if (!doPSK) { - load_buffer(ctx, svrCert, CYASSL_CERT); - load_buffer(ctx, svrKey, CYASSL_KEY); + load_buffer(ctx, svrCert, WOLFSSL_CERT); + load_buffer(ctx, svrKey, WOLFSSL_KEY); } #endif From 46ade8f03ff2a53a710beacc438f875dd3610969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moise=CC=81s=20Guimara=CC=83es?= Date: Sun, 21 Feb 2016 20:54:45 -0300 Subject: [PATCH 004/192] fixes ocsp dependency check on asn during configure. --- configure.ac | 80 +++++++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 45 deletions(-) diff --git a/configure.ac b/configure.ac index b99a9de1d..ff961d687 100644 --- a/configure.ac +++ b/configure.ac @@ -1430,35 +1430,6 @@ fi AM_CONDITIONAL([BUILD_INLINE], [test "x$ENABLED_INLINE" = "xyes"]) -# OCSP -AC_ARG_ENABLE([ocsp], - [ --enable-ocsp Enable OCSP (default: disabled)], - [ ENABLED_OCSP=$enableval ], - [ ENABLED_OCSP=no ], - ) - -if test "$ENABLED_OCSP" = "yes" -then - AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP" -fi - -AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"]) - - -if test "$ENABLED_OCSP" = "yes" -then - # check openssl command tool for testing ocsp - AC_CHECK_PROG([HAVE_OPENSSL_CMD],[openssl],[yes],[no]) - - if test "$HAVE_OPENSSL_CMD" = "yes" - then - AM_CFLAGS="$AM_CFLAGS -DHAVE_OPENSSL_CMD" - else - AC_MSG_WARN([openssl command line tool not available for testing ocsp]) - fi -fi - - # Certificate Status Request : a.k.a. OCSP Stapling AC_ARG_ENABLE([ocspstapling], [AS_HELP_STRING([--enable-ocspstapling],[Enable OCSP Stapling (default: disabled)])], @@ -1469,18 +1440,11 @@ AC_ARG_ENABLE([ocspstapling], if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xyes" then AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST" - - # Requires OCSP make sure on - if test "x$ENABLED_OCSP" = "xno" - then - ENABLED_OCSP="yes" - AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP" - AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"]) - fi fi AM_CONDITIONAL([BUILD_OCSP_STAPLING], [test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xyes"]) + # Certificate Status Request v2 : a.k.a. OCSP stapling v2 AC_ARG_ENABLE([ocspstapling2], [AS_HELP_STRING([--enable-ocspstapling2],[Enable OCSP Stapling v2 (default: disabled)])], @@ -1491,18 +1455,44 @@ AC_ARG_ENABLE([ocspstapling2], if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xyes" then AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST_V2" - - # Requires OCSP make sure on - if test "x$ENABLED_OCSP" = "xno" - then - ENABLED_OCSP="yes" - AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP" - AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"]) - fi fi AM_CONDITIONAL([BUILD_OCSP_STAPLING_V2], [test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xyes"]) + +# OCSP +AC_ARG_ENABLE([ocsp], + [AS_HELP_STRING([--enable-ocsp],[Enable OCSP (default: disabled)])], + [ ENABLED_OCSP=$enableval ], + [ ENABLED_OCSP=no ], + ) + +AS_IF([test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xyes"], [ENABLED_OCSP="yes"]) +AS_IF([test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xyes"], [ENABLED_OCSP="yes"]) + +if test "$ENABLED_OCSP" = "yes" +then + AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP" + + # check openssl command tool for testing ocsp + AC_CHECK_PROG([HAVE_OPENSSL_CMD],[openssl],[yes],[no]) + + if test "$HAVE_OPENSSL_CMD" = "yes" + then + AM_CFLAGS="$AM_CFLAGS -DHAVE_OPENSSL_CMD" + else + AC_MSG_WARN([openssl command line tool not available for testing ocsp]) + fi + + if test "x$ENABLED_ASN" = "xno" + then + AC_MSG_ERROR([please enable asn if enabling ocsp.]) + fi +fi + +AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"]) + + # CRL AC_ARG_ENABLE([crl], [ --enable-crl Enable CRL (default: disabled)], From f6fafe67387a5e44445bcda8a089689065b5bb8d Mon Sep 17 00:00:00 2001 From: John Safranek Date: Sun, 21 Feb 2016 21:52:38 -0800 Subject: [PATCH 005/192] for DTLS, retain the handshake resources until peer sends application data record --- src/internal.c | 8 +++++++- src/ssl.c | 22 ++++++++++++++++++++-- wolfssl/internal.h | 3 +++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/internal.c b/src/internal.c index f1cbab102..c13f127e4 100644 --- a/src/internal.c +++ b/src/internal.c @@ -7689,6 +7689,12 @@ int ProcessReply(WOLFSSL* ssl) case application_data: WOLFSSL_MSG("got app DATA"); + #ifdef WOLFSSL_DTLS + if (ssl->options.dtls && ssl->options.dtlsHsRetain) { + FreeHandshakeResources(ssl); + ssl->options.dtlsHsRetain = 0; + } + #endif if ((ret = DoApplicationData(ssl, ssl->buffers.inputBuffer.buffer, &ssl->buffers.inputBuffer.idx)) @@ -7819,7 +7825,7 @@ int SendChangeCipher(WOLFSSL* ssl) if (ssl->options.groupMessages) return 0; - #ifdef WOLFSSL_DTLS + #if defined(WOLFSSL_DTLS) && !defined(WOLFSSL_DEBUG_DTLS) else if (ssl->options.dtls) { /* If using DTLS, force the ChangeCipherSpec message to be in the * same datagram as the finished message. */ diff --git a/src/ssl.c b/src/ssl.c index c9ec2c951..a5eaa9565 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -5985,7 +5985,16 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl, } } #endif /* NO_HANDSHAKE_DONE_CB */ - FreeHandshakeResources(ssl); + + if (!ssl->options.dtls) { + FreeHandshakeResources(ssl); + } +#ifdef WOLFSSL_DTLS + else { + ssl->options.dtlsHsRetain = 1; + } +#endif /* WOLFSSL_DTLS */ + WOLFSSL_LEAVE("SSL_connect()", SSL_SUCCESS); return SSL_SUCCESS; @@ -6259,7 +6268,16 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl, } } #endif /* NO_HANDSHAKE_DONE_CB */ - FreeHandshakeResources(ssl); + + if (!ssl->options.dtls) { + FreeHandshakeResources(ssl); + } +#ifdef WOLFSSL_DTLS + else { + ssl->options.dtlsHsRetain = 1; + } +#endif /* WOLFSSL_DTLS */ + WOLFSSL_LEAVE("SSL_accept()", SSL_SUCCESS); return SSL_SUCCESS; diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 5ecfd6858..110285d4c 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -2255,6 +2255,9 @@ typedef struct Options { word16 createTicket:1; /* Server to create new Ticket */ word16 useTicket:1; /* Use Ticket not session cache */ #endif +#ifdef WOLFSSL_DTLS + word16 dtlsHsRetain:1; /* DTLS retaining HS data */ +#endif /* need full byte values for this section */ byte processReply; /* nonblocking resume */ From 731e13ecf2f7a074bd0b313f16ebd16cb0c09a3e Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 22 Feb 2016 16:46:13 +0100 Subject: [PATCH 006/192] Fixes issue with building crypt benchmark with only ED/Curve25519 enabled with static rng missing. --- wolfcrypt/benchmark/benchmark.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index c3e875460..12883c462 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -199,7 +199,8 @@ static int OpenNitroxDevice(int dma_mode,int dev_id) #endif #if !defined(NO_RSA) || !defined(NO_DH) \ - || defined(WOLFSSL_KEYGEN) || defined(HAVE_ECC) + || defined(WOLFSSL_KEYGEN) || defined(HAVE_ECC) \ + || defined(HAVE_CURVE25519) || defined(HAVE_ED25519) #define HAVE_LOCAL_RNG static WC_RNG rng; #endif From f621f81fa205d103a4e1259d10c3d5f439fcf61c Mon Sep 17 00:00:00 2001 From: John Safranek Date: Mon, 22 Feb 2016 14:08:35 -0800 Subject: [PATCH 007/192] 1. Some DTLS code was missing an ifdef. 2. If receiving a handshake message that's already been processed, retransmit the previous message flight. --- src/internal.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index c13f127e4..5df7821be 100644 --- a/src/internal.c +++ b/src/internal.c @@ -6101,7 +6101,7 @@ static int DoDtlsHandShakeMsg(WOLFSSL* ssl, byte* input, word32* inOutIdx, *inOutIdx += fragSz; if(type == finished ) *inOutIdx += ssl->keys.padSz; - ret = 0; + ret = DtlsPoolSend(ssl); } else if (fragSz < size) { /* Since this branch is in order, but fragmented, dtls_msg_list will be @@ -7612,6 +7612,7 @@ int ProcessReply(WOLFSSL* ssl) } #endif +#ifdef WOLFSSL_DTLS /* Check for duplicate CCS message in DTLS mode. * DTLS allows for duplicate messages, and it should be * skipped. */ @@ -7619,6 +7620,10 @@ int ProcessReply(WOLFSSL* ssl) ssl->msgsReceived.got_change_cipher) { WOLFSSL_MSG("Duplicate ChangeCipher msg"); + ret = DtlsPoolSend(ssl); + if (ret != 0) + return ret; + if (ssl->curSize != 1) { WOLFSSL_MSG("Malicious or corrupted" " duplicate ChangeCipher msg"); @@ -7627,6 +7632,7 @@ int ProcessReply(WOLFSSL* ssl) ssl->buffers.inputBuffer.idx++; break; } +#endif ret = SanityCheckMsgReceived(ssl, change_cipher_hs); if (ret != 0) From 69e00a3f97251e686835d09b49930d446833003d Mon Sep 17 00:00:00 2001 From: John Safranek Date: Mon, 22 Feb 2016 21:13:05 -0800 Subject: [PATCH 008/192] allow dtls timeout to be 0 in the recvfrom callback, set to 0 if the handshake is done --- src/io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/io.c b/src/io.c index 026c66e7a..c710754ae 100644 --- a/src/io.c +++ b/src/io.c @@ -404,7 +404,10 @@ int EmbedReceiveFrom(WOLFSSL *ssl, char *buf, int sz, void *ctx) WOLFSSL_ENTER("EmbedReceiveFrom()"); - if (!wolfSSL_get_using_nonblock(ssl) && dtls_timeout != 0) { + if (ssl->options.handShakeDone) + dtls_timeout = 0; + + if (!wolfSSL_get_using_nonblock(ssl)) { #ifdef USE_WINDOWS_API DWORD timeout = dtls_timeout * 1000; #else From a92d2d582f2659a5e042ba2ef02fe290713a3f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moise=CC=81s=20Guimara=CC=83es?= Date: Tue, 23 Feb 2016 14:13:52 -0300 Subject: [PATCH 009/192] Revert "fixes ocsp dependency check on asn during configure." This reverts commit 46ade8f03ff2a53a710beacc438f875dd3610969. --- configure.ac | 80 +++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/configure.ac b/configure.ac index ff961d687..b99a9de1d 100644 --- a/configure.ac +++ b/configure.ac @@ -1430,6 +1430,35 @@ fi AM_CONDITIONAL([BUILD_INLINE], [test "x$ENABLED_INLINE" = "xyes"]) +# OCSP +AC_ARG_ENABLE([ocsp], + [ --enable-ocsp Enable OCSP (default: disabled)], + [ ENABLED_OCSP=$enableval ], + [ ENABLED_OCSP=no ], + ) + +if test "$ENABLED_OCSP" = "yes" +then + AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP" +fi + +AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"]) + + +if test "$ENABLED_OCSP" = "yes" +then + # check openssl command tool for testing ocsp + AC_CHECK_PROG([HAVE_OPENSSL_CMD],[openssl],[yes],[no]) + + if test "$HAVE_OPENSSL_CMD" = "yes" + then + AM_CFLAGS="$AM_CFLAGS -DHAVE_OPENSSL_CMD" + else + AC_MSG_WARN([openssl command line tool not available for testing ocsp]) + fi +fi + + # Certificate Status Request : a.k.a. OCSP Stapling AC_ARG_ENABLE([ocspstapling], [AS_HELP_STRING([--enable-ocspstapling],[Enable OCSP Stapling (default: disabled)])], @@ -1440,11 +1469,18 @@ AC_ARG_ENABLE([ocspstapling], if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xyes" then AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST" + + # Requires OCSP make sure on + if test "x$ENABLED_OCSP" = "xno" + then + ENABLED_OCSP="yes" + AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP" + AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"]) + fi fi AM_CONDITIONAL([BUILD_OCSP_STAPLING], [test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xyes"]) - # Certificate Status Request v2 : a.k.a. OCSP stapling v2 AC_ARG_ENABLE([ocspstapling2], [AS_HELP_STRING([--enable-ocspstapling2],[Enable OCSP Stapling v2 (default: disabled)])], @@ -1455,44 +1491,18 @@ AC_ARG_ENABLE([ocspstapling2], if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xyes" then AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST_V2" + + # Requires OCSP make sure on + if test "x$ENABLED_OCSP" = "xno" + then + ENABLED_OCSP="yes" + AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP" + AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"]) + fi fi AM_CONDITIONAL([BUILD_OCSP_STAPLING_V2], [test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xyes"]) - -# OCSP -AC_ARG_ENABLE([ocsp], - [AS_HELP_STRING([--enable-ocsp],[Enable OCSP (default: disabled)])], - [ ENABLED_OCSP=$enableval ], - [ ENABLED_OCSP=no ], - ) - -AS_IF([test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xyes"], [ENABLED_OCSP="yes"]) -AS_IF([test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xyes"], [ENABLED_OCSP="yes"]) - -if test "$ENABLED_OCSP" = "yes" -then - AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP" - - # check openssl command tool for testing ocsp - AC_CHECK_PROG([HAVE_OPENSSL_CMD],[openssl],[yes],[no]) - - if test "$HAVE_OPENSSL_CMD" = "yes" - then - AM_CFLAGS="$AM_CFLAGS -DHAVE_OPENSSL_CMD" - else - AC_MSG_WARN([openssl command line tool not available for testing ocsp]) - fi - - if test "x$ENABLED_ASN" = "xno" - then - AC_MSG_ERROR([please enable asn if enabling ocsp.]) - fi -fi - -AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"]) - - # CRL AC_ARG_ENABLE([crl], [ --enable-crl Enable CRL (default: disabled)], From 143b9fda1b8e68e4ad431d1600ca5aa2ba2724b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moise=CC=81s=20Guimara=CC=83es?= Date: Tue, 23 Feb 2016 15:19:04 -0300 Subject: [PATCH 010/192] adds build dependency check for OCSP --- configure.ac | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b99a9de1d..b598e4d90 100644 --- a/configure.ac +++ b/configure.ac @@ -2501,13 +2501,21 @@ AM_CONDITIONAL([BUILD_MCAPI], [test "x$ENABLED_MCAPI" = "xyes"]) # check if PSK was enabled for conditionally running psk.test script AM_CONDITIONAL([BUILD_PSK], [test "x$ENABLED_PSK" = "xyes"]) -# Check for build-type conflicts +################################################################################ +# Check for build-type conflicts # +################################################################################ + AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \ test "x$ENABLED_LEANPSK" = "xyes"], [AC_MSG_ERROR([Cannot use Max Strength and Lean PSK at the same time.])]) +AS_IF([test "x$ENABLED_ASN" = "xno"], + [AC_MSG_ERROR([please enable asn if enabling ocsp.])]) + +################################################################################ +# Update CFLAGS based on options # +################################################################################ -# Update CFLAGS based on options AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MAX_STRENGTH"]) @@ -2520,6 +2528,7 @@ AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \ test "x$ENABLED_SSLV3" = "xyes"], [AC_MSG_ERROR([Cannot use Max Strength and SSLv3 at the same time.])]) +################################################################################ # OPTIMIZE FLAGS if test "$GCC" = "yes" From dcfec3d2fafe6c78eca4b8c7f13173603f08d092 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 23 Feb 2016 17:03:52 -0700 Subject: [PATCH 011/192] check for RSA and ECC before testing RSA signed ECC cert --- tests/suites.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/suites.c b/tests/suites.c index 4a16770e6..365cf1704 100644 --- a/tests/suites.c +++ b/tests/suites.c @@ -473,7 +473,7 @@ int SuiteTest(void) cipherSuiteCtx = wolfSSL_CTX_new(wolfTLSv1_2_client_method()); if (cipherSuiteCtx == NULL) { printf("can't get cipher suite ctx\n"); - exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* default case */ @@ -482,7 +482,7 @@ int SuiteTest(void) test_harness(&args); if (args.return_code != 0) { printf("error from script %d\n", args.return_code); - exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* any extra cases will need another argument */ @@ -499,6 +499,7 @@ int SuiteTest(void) } #endif #ifndef WC_STRICT_SIG +#if !defined(NO_RSA) && defined(HAVE_ECC) /* testing mixed ECC/RSA cert */ /* add extra signature test suites */ strcpy(argv0[1], "tests/test-sig.conf"); printf("starting sig extra cipher suite tests\n"); @@ -507,7 +508,8 @@ int SuiteTest(void) printf("error from script %d\n", args.return_code); exit(EXIT_FAILURE); } -#endif +#endif /* HAVE_RSA and HAVE_ECC */ +#endif /* !WC_STRICT_SIG */ #ifdef HAVE_QSH /* add QSH extra suites */ strcpy(argv0[1], "tests/test-qsh.conf"); From 1227db4e44451512846398de312e52a8adc0af8f Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 24 Feb 2016 07:04:03 +0100 Subject: [PATCH 012/192] Fixed issue with not properly returning memory error in CopyDecodedToX509 after DER refactor. --- src/internal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index ecc6272fa..4788dc501 100644 --- a/src/internal.c +++ b/src/internal.c @@ -4469,7 +4469,8 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert) } /* store cert for potential retrieval */ - if (AllocDer(&x509->derCert, dCert->maxIdx, CERT_TYPE, NULL) == 0) { + ret = AllocDer(&x509->derCert, dCert->maxIdx, CERT_TYPE, NULL); + if (ret == 0) { XMEMCPY(x509->derCert.buffer, dCert->source, dCert->maxIdx); } From 1824a494d1e5746ab93988c54e15756232cb0929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moise=CC=81s=20Guimara=CC=83es?= Date: Wed, 24 Feb 2016 16:45:07 -0300 Subject: [PATCH 013/192] adds missing ENABLED_OCSP test --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b598e4d90..2a36c3ab3 100644 --- a/configure.ac +++ b/configure.ac @@ -2509,7 +2509,8 @@ AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \ test "x$ENABLED_LEANPSK" = "xyes"], [AC_MSG_ERROR([Cannot use Max Strength and Lean PSK at the same time.])]) -AS_IF([test "x$ENABLED_ASN" = "xno"], +AS_IF([test "x$ENABLED_OCSP" = "xyes" && \ + test "x$ENABLED_ASN" = "xno"], [AC_MSG_ERROR([please enable asn if enabling ocsp.])]) ################################################################################ From 6ee3c0ae597d28bb339c8d13fb436a7e440525c1 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 24 Feb 2016 13:55:44 -0700 Subject: [PATCH 014/192] argument peer can be NULL when macro INADDR_ANY is NULL --- wolfssl/test.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfssl/test.h b/wolfssl/test.h index 43ddae1db..851663e20 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -521,8 +521,8 @@ static INLINE void build_addr(SOCKADDR_IN_T* addr, const char* peer, (void)useLookup; (void)udp; - if (addr == NULL || peer == NULL) - err_sys("invalid arguments to build_addr, addr or peer is NULL"); + if (addr == NULL) + err_sys("invalid argument to build_addr, addr is NULL"); memset(addr, 0, sizeof(SOCKADDR_IN_T)); From 4858a6598419bce0773aef401bf40d68ab7e237f Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Wed, 24 Feb 2016 14:42:07 -0700 Subject: [PATCH 015/192] Always execute wc_InitRsaKey if we are always going to execute wc_FreeRsaKey --- wolfcrypt/src/asn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 567f26820..b7ff7855f 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -3590,7 +3590,8 @@ static int ConfirmSignature(const byte* buf, word32 bufSz, if (sigSz > MAX_ENCODED_SIG_SZ) { WOLFSSL_MSG("Verify Signature is too big"); } - else if (wc_InitRsaKey(pubKey, heap) != 0) { + + if (wc_InitRsaKey(pubKey, heap) != 0) { WOLFSSL_MSG("InitRsaKey failed"); } else if (wc_RsaPublicKeyDecode(key, &idx, pubKey, keySz) < 0) { From fb9697bda6ff807e097fcb47925e7538ece5e2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moise=CC=81s=20Guimara=CC=83es?= Date: Wed, 24 Feb 2016 18:57:16 -0300 Subject: [PATCH 016/192] adds check for missing rsa and ecc at the same time --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 2a36c3ab3..2301a64ce 100644 --- a/configure.ac +++ b/configure.ac @@ -2513,6 +2513,11 @@ AS_IF([test "x$ENABLED_OCSP" = "xyes" && \ test "x$ENABLED_ASN" = "xno"], [AC_MSG_ERROR([please enable asn if enabling ocsp.])]) +AS_IF([test "x$ENABLED_OCSP" = "xyes" && \ + test "x$ENABLED_RSA" = "xno" && \ + test "x$ENABLED_ECC" = "xno"], + [AC_MSG_ERROR([please enable rsa or ecc if enabling ocsp.])]) + ################################################################################ # Update CFLAGS based on options # ################################################################################ From 16dac5597f79819713072fccb9d32fde18c0efa3 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Wed, 24 Feb 2016 16:08:54 -0700 Subject: [PATCH 017/192] prevent buffer overflows if sigSz > MAX_ENCODED_SIG_SZ --- wolfcrypt/src/asn.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index b7ff7855f..6f0520555 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -3586,14 +3586,12 @@ static int ConfirmSignature(const byte* buf, word32 bufSz, break; /* not confirmed */ } #endif - - if (sigSz > MAX_ENCODED_SIG_SZ) { - WOLFSSL_MSG("Verify Signature is too big"); - } - if (wc_InitRsaKey(pubKey, heap) != 0) { WOLFSSL_MSG("InitRsaKey failed"); } + else if (sigSz > MAX_ENCODED_SIG_SZ) { + WOLFSSL_MSG("Verify Signature is too big"); + } else if (wc_RsaPublicKeyDecode(key, &idx, pubKey, keySz) < 0) { WOLFSSL_MSG("ASN Key decode error RSA"); } From a46fd6612bd7656c6292687cfcb59c70ee776362 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 25 Feb 2016 14:35:54 +0100 Subject: [PATCH 018/192] Changed CopyDecodedToX509 AllocDer error code handing to return MEMORY_E, since that is an explicitly handled case. Also resolves the issue with "warning: Value stored to 'ret' is never read". --- src/internal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 4788dc501..10aa7349a 100644 --- a/src/internal.c +++ b/src/internal.c @@ -4469,10 +4469,12 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert) } /* store cert for potential retrieval */ - ret = AllocDer(&x509->derCert, dCert->maxIdx, CERT_TYPE, NULL); - if (ret == 0) { + if (AllocDer(&x509->derCert, dCert->maxIdx, CERT_TYPE, NULL) == 0) { XMEMCPY(x509->derCert.buffer, dCert->source, dCert->maxIdx); } + else { + ret = MEMORY_E; + } x509->altNames = dCert->altNames; dCert->weOwnAltNames = 0; From 79ef8e232bf086e0046adf48d107d54d7a118f3b Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 26 Feb 2016 15:39:30 +0100 Subject: [PATCH 019/192] Fixes build error with new DerBuffer with ASN, ECC and RSA disabled. --- wolfssl/internal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfssl/internal.h b/wolfssl/internal.h index f214d8383..fa513da99 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -2369,7 +2369,9 @@ struct WOLFSSL_X509 { #ifdef HAVE_ECC word32 pkCurveOID; #endif /* HAVE_ECC */ - DerBuffer derCert; /* may need */ + #ifndef NO_CERTS + DerBuffer derCert; /* may need */ + #endif DNS_entry* altNames; /* alt names list */ DNS_entry* altNamesNext; /* hint for retrieval */ byte dynamicMemory; /* dynamic memory flag */ From d4734527694a0165b9b12abf5fbd4722a06b2b5c Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Tue, 1 Mar 2016 16:21:03 -0700 Subject: [PATCH 020/192] avoid dereference of null pointer if args is null --- wolfssl/test.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/wolfssl/test.h b/wolfssl/test.h index 851663e20..da96ae238 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -834,6 +834,7 @@ static INLINE void tcp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd, { SOCKADDR_IN_T client; socklen_t client_len = sizeof(client); + tcp_ready* ready = NULL; if (udp) { udp_accept(sockfd, clientfd, useAnyAddr, port, args); @@ -846,7 +847,8 @@ static INLINE void tcp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd, #if defined(_POSIX_THREADS) && defined(NO_MAIN_DRIVER) && !defined(__MINGW32__) /* signal ready to tcp_accept */ { - tcp_ready* ready = args->signal; + if (args) + ready = args->signal; if (ready) { pthread_mutex_lock(&ready->mutex); ready->ready = 1; @@ -857,15 +859,18 @@ static INLINE void tcp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd, } #elif defined (WOLFSSL_TIRTOS) /* Need mutex? */ - tcp_ready* ready = args->signal; - ready->ready = 1; - ready->port = port; + if (args) + ready = args->signal; + if (ready) { + ready->ready = 1; + ready->port = port; + } #endif if (ready_file) { #ifndef NO_FILESYSTEM FILE* srf = NULL; - tcp_ready* ready = args ? args->signal : NULL; + ready = args ? args->signal : NULL; if (ready) { srf = fopen(ready->srfName, "w"); From d15dac04b849b85f4c6852643853e975c497ae70 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Tue, 1 Mar 2016 16:33:47 -0700 Subject: [PATCH 021/192] remove unnecessary NULL assignment --- wolfssl/test.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wolfssl/test.h b/wolfssl/test.h index da96ae238..4731132c0 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -870,7 +870,8 @@ static INLINE void tcp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd, if (ready_file) { #ifndef NO_FILESYSTEM FILE* srf = NULL; - ready = args ? args->signal : NULL; + if (args) + ready = args->signal; if (ready) { srf = fopen(ready->srfName, "w"); From 1f4ddb20df8cc221044e441b7ff833f6cd0fc43e Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Tue, 1 Mar 2016 17:00:27 -0700 Subject: [PATCH 022/192] Move assignment to after the null check --- src/internal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index 0dca6aaec..417841ad4 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1764,12 +1764,13 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx) byte havePSK = 0; byte haveAnon = 0; byte haveRSA = 0; - byte newSSL = ssl->ctx == NULL; (void) haveAnon; /* Squash unused var warnings */ if(!ssl || !ctx || ssl->suites == NULL) return BAD_FUNC_ARG; + byte newSSL = ssl->ctx == NULL; /* Assign after null check */ + #ifndef NO_PSK if (ctx->server_hint[0] && ssl->arrays == NULL) { return BAD_FUNC_ARG; /* needed for copy below */ From 7df22ee21095ddb5e95145438eef269c125c7efd Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 24 Feb 2016 15:51:29 -0700 Subject: [PATCH 023/192] Trusted peer certificate use --- examples/server/server.c | 6 + src/ssl.c | 309 ++++++++++++++++++++++++++++++++- wolfcrypt/src/asn.c | 78 ++++++++- wolfssl/internal.h | 21 +++ wolfssl/ssl.h | 11 ++ wolfssl/wolfcrypt/asn.h | 30 +++- wolfssl/wolfcrypt/asn_public.h | 3 +- 7 files changed, 454 insertions(+), 4 deletions(-) diff --git a/examples/server/server.c b/examples/server/server.c index 0bea91863..a8320733b 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -685,6 +685,12 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) SSL_VERIFY_FAIL_IF_NO_PEER_CERT),0); if (SSL_CTX_load_verify_locations(ctx, verifyCert, 0) != SSL_SUCCESS) err_sys("can't load ca file, Please run from wolfSSL home dir"); + #ifdef WOLFSSL_TRUST_PEER_CERT + if ((ret = wolfSSL_CTX_trust_peer_cert(ctx, + "./certs/client-cert.pem", SSL_FILETYPE_PEM)) != SSL_SUCCESS) { + err_sys("can't load trusted peer cert file"); + } + #endif /* WOLFSSL_TRUST_PEER_CERT */ } #endif diff --git a/src/ssl.c b/src/ssl.c index c2762ffdb..f16934157 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -1705,6 +1705,14 @@ WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew(void) wolfSSL_CertManagerFree(cm); return NULL; } + + #ifdef WOLFSSL_TRUST_PEER_CERT + if (InitMutex(&cm->tpLock) != 0) { + WOLFSSL_MSG("Bad mutex init"); + wolfSSL_CertManagerFree(cm); + return NULL; + } + #endif } return cm; @@ -1731,6 +1739,12 @@ void wolfSSL_CertManagerFree(WOLFSSL_CERT_MANAGER* cm) #endif FreeSignerTable(cm->caTable, CA_TABLE_SIZE, NULL); FreeMutex(&cm->caLock); + + #ifdef WOLFSSL_TRUST_PEER_CERT + FreeTrustedPeerTable(cm->tpTable, TP_TABLE_SIZE, NULL); + FreeMutex(&cm->tpLock); + #endif + XFREE(cm, NULL, DYNAMIC_TYPE_CERT_MANAGER); } @@ -1757,6 +1771,27 @@ int wolfSSL_CertManagerUnloadCAs(WOLFSSL_CERT_MANAGER* cm) } +#ifdef WOLFSSL_TRUST_PEER_CERT +int wolfSSL_CertManagerUnload_trust_peers(WOLFSSL_CERT_MANAGER* cm) +{ + WOLFSSL_ENTER("wolfSSL_CertManagerUnload_trust_peers"); + + if (cm == NULL) + return BAD_FUNC_ARG; + + if (LockMutex(&cm->tpLock) != 0) + return BAD_MUTEX_E; + + FreeTrustedPeerTable(cm->tpTable, TP_TABLE_SIZE, NULL); + + UnLockMutex(&cm->tpLock); + + + return SSL_SUCCESS; +} +#endif /* WOLFSSL_TRUST_PEER_CERT */ + + /* Return bytes written to buff or < 0 for error */ int wolfSSL_CertPemToDer(const unsigned char* pem, int pemSz, unsigned char* buff, int buffSz, int type) @@ -2179,6 +2214,95 @@ int AlreadySigner(WOLFSSL_CERT_MANAGER* cm, byte* hash) } +#ifdef WOLFSSL_TRUST_PEER_CERT +/* does trusted peer already exist on signer list */ +int AlreadyTrustedPeer(WOLFSSL_CERT_MANAGER* cm, byte* hash) +{ + TrustedPeerCert* tp; + int ret = 0; + word32 row = HashSigner(hash); + + if (LockMutex(&cm->tpLock) != 0) + return ret; + tp = cm->tpTable[row]; + while (tp) { + byte* subjectHash; + #ifndef NO_SKID + subjectHash = tp->subjectKeyIdHash; + #else + subjectHash = tp->subjectNameHash; + #endif + if (XMEMCMP(hash, subjectHash, SIGNER_DIGEST_SIZE) == 0) { + ret = 1; + break; + } + tp = tp->next; + } + UnLockMutex(&cm->tpLock); + + return ret; +} + + +/* return Trusted Peer if found, otherwise NULL */ +TrustedPeerCert* GetTrustedPeer(void* vp, byte* hash) +{ + WOLFSSL_CERT_MANAGER* cm = (WOLFSSL_CERT_MANAGER*)vp; + TrustedPeerCert* ret = NULL; + TrustedPeerCert* tp = NULL; + word32 row; + + if (cm == NULL || hash == NULL) + return NULL; + + row = HashSigner(hash); + + if (LockMutex(&cm->tpLock) != 0) + return ret; + + tp = cm->tpTable[row]; + while (tp) { + byte* subjectHash; + #ifndef NO_SKID + subjectHash = tp->subjectKeyIdHash; + #else + subjectHash = tp->subjectNameHash; + #endif + if (XMEMCMP(hash, subjectHash, SIGNER_DIGEST_SIZE) == 0) { + ret = tp; + break; + } + tp = tp->next; + } + UnLockMutex(&cm->tpLock); + + return ret; +} + + +int MatchTrustedPeer(TrustedPeerCert* tp, DecodedCert* cert) +{ + if (tp == NULL || cert == NULL) + return BAD_FUNC_ARG; + + /* subject key id or subject hash has been compared when searching + tpTable for the cert from function GetTrustedPeer */ + + /* compare signatures */ + if (tp->sigLen == cert->sigLength) { + /* compare first four before comparing all */ + if (XMEMCMP(tp->sig, cert->signature, cert->sigLength)) { + return SSL_FAILURE; + } + } + else { + return SSL_FAILURE; + } + + return SSL_SUCCESS; +} +#endif /* WOLFSSL_TRUST_PEER_CERT */ + /* return CA if found, otherwise NULL */ Signer* GetCA(void* vp, byte* hash) { @@ -2245,6 +2369,123 @@ Signer* GetCAByName(void* vp, byte* hash) #endif +#ifdef WOLFSSL_TRUST_PEER_CERT +/* add a trusted peer cert to linked list */ +int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int verify) +{ + int ret, row; + TrustedPeerCert* peerCert; + DecodedCert* cert = NULL; + byte* subjectHash = NULL; + + WOLFSSL_MSG("Adding a Trusted Peer Cert"); + + cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), NULL, + DYNAMIC_TYPE_TMP_BUFFER); + if (cert == NULL) + return MEMORY_E; + + InitDecodedCert(cert, der->buffer, der->length, cm->heap); + if ((ret = ParseCert(cert, TRUSTED_PEER_TYPE, verify, cm)) != 0) { + XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); + return ret; + } + WOLFSSL_MSG(" Parsed new trusted peer cert"); + + peerCert = (TrustedPeerCert*)XMALLOC(sizeof(TrustedPeerCert), NULL, + DYNAMIC_TYPE_CERT); + if (peerCert == NULL) { + FreeDecodedCert(cert); + XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); + return MEMORY_E; + } + XMEMSET(peerCert, 0, sizeof(TrustedPeerCert)); + +#ifndef NO_SKID + subjectHash = cert->extSubjKeyId; +#else + subjectHash = cert->subjectHash; +#endif + + #ifndef IGNORE_NAME_CONSTRAINTS + if (peerCert->permittedNames) + FreeNameSubtrees(peerCert->permittedNames, cm->heap); + if (peerCert->excludedNames) + FreeNameSubtrees(peerCert->excludedNames, cm->heap); + #endif + + if (AlreadyTrustedPeer(cm, subjectHash)) { + WOLFSSL_MSG(" Already have this CA, not adding again"); + (void)ret; + } + else { + /* add trusted peer signature */ + peerCert->sigLen = cert->sigLength; + peerCert->sig = XMALLOC(cert->sigLength, cm->heap, + DYNAMIC_TYPE_SIGNATURE); + if (peerCert->sig == NULL) { + FreeDecodedCert(cert); + XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); + FreeTrustedPeer(peerCert, cm->heap); + return MEMORY_E; + } + XMEMCPY(peerCert->sig, cert->signature, cert->sigLength); + + /* add trusted peer name */ + peerCert->nameLen = cert->subjectCNLen; + peerCert->name = cert->subjectCN; + #ifndef IGNORE_NAME_CONSTRAINTS + peerCert->permittedNames = cert->permittedNames; + peerCert->excludedNames = cert->excludedNames; + #endif + + /* add SKID when available and hash of name */ + #ifndef NO_SKID + XMEMCPY(peerCert->subjectKeyIdHash, cert->extSubjKeyId, + SIGNER_DIGEST_SIZE); + #endif + XMEMCPY(peerCert->subjectNameHash, cert->subjectHash, + SIGNER_DIGEST_SIZE); + peerCert->next = NULL; /* If Key Usage not set, all uses valid. */ + cert->subjectCN = 0; + #ifndef IGNORE_NAME_CONSTRAINTS + cert->permittedNames = NULL; + cert->excludedNames = NULL; + #endif + + #ifndef NO_SKID + row = HashSigner(peerCert->subjectKeyIdHash); + #else + row = HashSigner(peerCert->subjectNameHash); + #endif + + if (LockMutex(&cm->tpLock) == 0) { + peerCert->next = cm->tpTable[row]; + cm->tpTable[row] = peerCert; /* takes ownership */ + UnLockMutex(&cm->tpLock); + } + else { + WOLFSSL_MSG(" Trusted Peer Cert Mutex Lock failed"); + FreeDecodedCert(cert); + XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); + FreeTrustedPeer(peerCert, cm->heap); + return BAD_MUTEX_E; + } + } + + WOLFSSL_MSG(" Freeing parsed trusted peer cert"); + FreeDecodedCert(cert); + XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); + WOLFSSL_MSG(" Freeing der trusted peer cert"); + FreeDer(der); + WOLFSSL_MSG(" OK Freeing der trusted peer cert"); + WOLFSSL_LEAVE("AddTrustedPeer", ret); + + return SSL_SUCCESS; +} +#endif /* WOLFSSL_TRUST_PEER_CERT */ + + /* owns der, internal now uses too */ /* type flag ids from user or from chain received during verify don't allow chain ones to be added w/o isCA extension */ @@ -2647,6 +2888,7 @@ int PemToDer(const unsigned char* buff, long longSz, int type, switch (type) { case CA_TYPE: /* same as below */ + case TRUSTED_PEER_TYPE: case CERT_TYPE: header=BEGIN_CERT; footer=END_CERT; break; case CRL_TYPE: header=BEGIN_X509_CRL; footer=END_X509_CRL; break; case DH_PARAM_TYPE: header=BEGIN_DH_PARAM; footer=END_DH_PARAM; break; @@ -3085,6 +3327,17 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, /* verify CA unless user set to no verify */ return AddCA(ctx->cm, &der, WOLFSSL_USER_CA, !ctx->verifyNone); } +#ifdef WOLFSSL_TRUST_PEER_CERT + else if (type == TRUSTED_PEER_TYPE) { + if (ctx == NULL) { + WOLFSSL_MSG("Need context for trusted peer cert load"); + XFREE(der.buffer, heap, dynamicType); + return BAD_FUNC_ARG; + } + /* add trusted peer cert */ + return AddTrustedPeer(ctx->cm, &der, !ctx->verifyNone); + } +#endif /* WOLFSSL_TRUST_PEER_CERT */ else if (type == CERT_TYPE) { if (ssl) { /* Make sure previous is free'd */ @@ -3817,7 +4070,8 @@ int ProcessFile(WOLFSSL_CTX* ctx, const char* fname, int format, int type, if ( (ret = (int)XFREAD(myBuffer, sz, 1, file)) < 0) ret = SSL_BAD_FILE; else { - if (type == CA_TYPE && format == SSL_FILETYPE_PEM) + if ((type == CA_TYPE || type == TRUSTED_PEER_TYPE) + && format == SSL_FILETYPE_PEM) ret = ProcessChainBuffer(ctx, myBuffer, sz, format, type, ssl); #ifdef HAVE_CRL else if (type == CRL_TYPE) @@ -3947,6 +4201,31 @@ int wolfSSL_CTX_load_verify_locations(WOLFSSL_CTX* ctx, const char* file, } +#ifdef WOLFSSL_TRUST_PEER_CERT +/* Used to specify a peer cert to match when connecting + ctx : the ctx structure to load in peer cert + file: the string name of cert file + type: type of format such as PEM/DER + */ +int wolfSSL_CTX_trust_peer_cert(WOLFSSL_CTX* ctx, const char* file, int type) +{ + int ret; + + WOLFSSL_ENTER("wolfSSL_CTX_trust_peer_cert"); + + if (ctx == NULL || file == NULL) { + return SSL_FAILURE; + } + + if ((ret = ProcessFile(ctx, file, type, TRUSTED_PEER_TYPE, NULL, 0, NULL)) + == SSL_SUCCESS) { + } + + return ret; +} +#endif /* WOLFSSL_TRUST_PEER_CERT */ + + /* Verify the certificate, SSL_SUCCESS for ok, < 0 for error */ int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER* cm, const char* fname, int format) @@ -7364,6 +7643,22 @@ int wolfSSL_set_compression(WOLFSSL* ssl) } +#ifdef WOLFSSL_TRUST_PEER_CERT + int wolfSSL_CTX_trust_peer_buffer(WOLFSSL_CTX* ctx, + const unsigned char* in, + long sz, int format) + { + WOLFSSL_ENTER("wolfSSL_CTX_trust_peer_buffer"); + if (format == SSL_FILETYPE_PEM) + return ProcessChainBuffer(ctx, in, sz, format, + TRUSTED_PEER_TYPE, NULL); + else + return ProcessBuffer(ctx, in, sz, format, TRUSTED_PEER_TYPE, + NULL,NULL,0); + } +#endif /* WOLFSSL_TRUST_PEER_CERT */ + + int wolfSSL_CTX_use_certificate_buffer(WOLFSSL_CTX* ctx, const unsigned char* in, long sz, int format) { @@ -7548,6 +7843,18 @@ int wolfSSL_set_compression(WOLFSSL* ssl) return wolfSSL_CertManagerUnloadCAs(ctx->cm); } + +#ifdef WOLFSSL_TRUST_PEER_CERT + int wolfSSL_CTX_Unload_trust_peers(WOLFSSL_CTX* ctx) + { + WOLFSSL_ENTER("wolfSSL_CTX_Unload_trust_peers"); + + if (ctx == NULL) + return BAD_FUNC_ARG; + + return wolfSSL_CertManagerUnload_trust_peers(ctx->cm); + } +#endif /* WOLFSSL_TRUST_PEER_CERT */ /* old NO_FILESYSTEM end */ #endif /* !NO_CERTS */ diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 4bb809e23..5cf59418d 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4905,6 +4905,10 @@ int ParseCert(DecodedCert* cert, int type, int verify, void* cm) extern "C" { #endif WOLFSSL_LOCAL Signer* GetCA(void* signers, byte* hash); +#ifdef WOLFSSL_TRUST_PEER_CERT + WOLFSSL_LOCAL TrustedPeerCert* GetTrustedPeer(void* signers, byte* hash); + WOLFSSL_LOCAL int MatchTrustedPeer(TrustedPeerCert* tp, DecodedCert* cert); +#endif /* WOLFSSL_TRUST_PEER_CERT */ #ifndef NO_SKID WOLFSSL_LOCAL Signer* GetCAByName(void* signers, byte* hash); #endif @@ -4999,7 +5003,7 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm) } #endif - if (verify && type != CA_TYPE) { + if (verify && type != CA_TYPE && type != TRUSTED_PEER_TYPE) { Signer* ca = NULL; #ifndef NO_SKID if (cert->extAuthKeyIdSet) @@ -5011,6 +5015,36 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm) #endif /* NO SKID */ WOLFSSL_MSG("About to verify certificate signature"); +#ifdef WOLFSSL_TRUST_PEER_CERT + /* check for trusted peer cert */ + { + TrustedPeerCert* tp = NULL; + #ifndef NO_SKID + if (cert->extAuthKeyIdSet) + tp = GetTrustedPeer(cm, cert->extAuthKeyId); + #else /* NO_SKID */ + tp = GetTrustedPeer(cm, cert->issuerHash); + #endif /* NO SKID */ + WOLFSSL_MSG("Checking for trusted peer cert"); + + if (tp == NULL) { + /* no trusted peer cert */ + WOLFSSL_MSG("No matching trusted peer cert checking CAs"); + } else if (MatchTrustedPeer(tp, cert)){ + WOLFSSL_MSG("Found matching trusted peer cert"); + if (badDate != 0) + return badDate; + + if (criticalExt != 0) + return criticalExt; + + return 0; + } else { + WOLFSSL_MSG("No matching trusted peer cert"); + } + } +#endif /* WOLFSSL_TRUST_PEER_CERT */ + if (ca) { #ifdef HAVE_OCSP /* Need the ca's public key hash for OCSP */ @@ -5115,6 +5149,48 @@ void FreeSignerTable(Signer** table, int rows, void* heap) } } +#ifdef WOLFSSL_TRUST_PEER_CERT +/* Free an individual trusted peer cert */ +void FreeTrustedPeer(TrustedPeerCert* tp, void* heap) +{ + if (tp == NULL) { + return; + } + + if (tp->name) { + XFREE(tp->name, heap, DYNAMIC_TYPE_SUBJECT_CN); + } + + if (tp->sig) { + XFREE(tp->sig, heap, DYNAMIC_TYPE_SIGNATURE); + } + #ifndef IGNORE_NAME_CONSTRAINTS + if (tp->permittedNames) + FreeNameSubtrees(tp->permittedNames, heap); + if (tp->excludedNames) + FreeNameSubtrees(tp->excludedNames, heap); + #endif + XFREE(tp, heap, DYNAMIC_TYPE_CERT); + + (void)heap; +} + +/* Free the whole Trusted Peer linked list */ +void FreeTrustedPeerTable(TrustedPeerCert** table, int rows, void* heap) +{ + int i; + + for (i = 0; i < rows; i++) { + TrustedPeerCert* tp = table[i]; + while (tp) { + TrustedPeerCert* next = tp->next; + FreeTrustedPeer(tp, heap); + tp = next; + } + table[i] = NULL; + } +} +#endif /* WOLFSSL_TRUST_PEER_CERT */ WOLFSSL_LOCAL int SetMyVersion(word32 version, byte* output, int header) { diff --git a/wolfssl/internal.h b/wolfssl/internal.h index fa513da99..1a5b68cf6 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1435,17 +1435,27 @@ struct WOLFSSL_CRL { #ifdef NO_ASN typedef struct Signer Signer; +#ifdef WOLFSSL_TRUST_PEER_CERT + typedef struct TrustedPeerCert TrustedPeerCert; +#endif #endif #ifndef CA_TABLE_SIZE #define CA_TABLE_SIZE 11 #endif +#ifdef WOLFSSL_TRUST_PEER_CERT + #define TP_TABLE_SIZE 11 +#endif /* wolfSSL Certificate Manager */ struct WOLFSSL_CERT_MANAGER { Signer* caTable[CA_TABLE_SIZE]; /* the CA signer table */ void* heap; /* heap helper */ +#ifdef WOLFSSL_TRUST_PEER_CERT + TrustedPeerCert* tpTable[TP_TABLE_SIZE]; /* table of trusted peer certs */ + wolfSSL_Mutex tpLock; /* trusted peer list lock */ +#endif WOLFSSL_CRL* crl; /* CRL checker */ WOLFSSL_OCSP* ocsp; /* OCSP checker */ #if !defined(NO_WOLFSSL_SEVER) && (defined(HAVE_CERTIFICATE_STATUS_REQUEST) \ @@ -1934,6 +1944,12 @@ int ProcessOldClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx, int AddCA(WOLFSSL_CERT_MANAGER* ctx, DerBuffer* der, int type, int verify); WOLFSSL_LOCAL int AlreadySigner(WOLFSSL_CERT_MANAGER* cm, byte* hash); +#ifdef WOLFSSL_TRUST_PEER_CERT + WOLFSSL_LOCAL + int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int verify); + WOLFSSL_LOCAL + int AlreadyTrustedPeer(WOLFSSL_CERT_MANAGER* cm, byte* hash); +#endif #endif /* All cipher suite related info */ @@ -2820,6 +2836,11 @@ WOLFSSL_LOCAL int VerifyClientSuite(WOLFSSL* ssl); const byte* plain, word32 plainSz, RsaKey* key); #endif + #ifdef WOLFSSL_TRUST_PEER_CERT + WOLFSSL_LOCAL TrustedPeerCert* GetTrustedPeer(void* vp, byte* hash); + WOLFSSL_LOCAL int MatchTrustedPeer(TrustedPeerCert* tp, + DecodedCert* cert); + #endif WOLFSSL_LOCAL Signer* GetCA(void* cm, byte* hash); #ifndef NO_SKID WOLFSSL_LOCAL Signer* GetCAByName(void* cm, byte* hash); diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 6e965561e..ea9ba0801 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -229,6 +229,9 @@ WOLFSSL_API int wolfSSL_CTX_use_certificate_file(WOLFSSL_CTX*, const char*, int) WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_file(WOLFSSL_CTX*, const char*, int); WOLFSSL_API int wolfSSL_CTX_load_verify_locations(WOLFSSL_CTX*, const char*, const char*); +#ifdef WOLFSSL_TRUST_PEER_CERT +WOLFSSL_API int wolfSSL_CTX_trust_peer_cert(WOLFSSL_CTX*, const char*, int); +#endif WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_file(WOLFSSL_CTX *, const char *file); WOLFSSL_API int wolfSSL_CTX_use_RSAPrivateKey_file(WOLFSSL_CTX*, const char*, int); @@ -968,6 +971,11 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL*, void* key, unsigned int len, #ifndef NO_CERTS /* SSL_CTX versions */ WOLFSSL_API int wolfSSL_CTX_UnloadCAs(WOLFSSL_CTX*); +#ifdef WOLFSSL_TRUST_PEER_CERT + WOLFSSL_API int wolfSSL_CTX_Unload_trust_peers(WOLFSSL_CTX*); + WOLFSSL_API int wolfSSL_CTX_trust_peer_buffer(WOLFSSL_CTX*, + const unsigned char*, long, int); +#endif WOLFSSL_API int wolfSSL_CTX_load_verify_buffer(WOLFSSL_CTX*, const unsigned char*, long, int); WOLFSSL_API int wolfSSL_CTX_use_certificate_buffer(WOLFSSL_CTX*, @@ -1247,6 +1255,9 @@ WOLFSSL_API void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl); WOLFSSL_API int wolfSSL_CertManagerLoadCABuffer(WOLFSSL_CERT_MANAGER*, const unsigned char* in, long sz, int format); WOLFSSL_API int wolfSSL_CertManagerUnloadCAs(WOLFSSL_CERT_MANAGER* cm); +#ifdef WOLFSSL_TRUST_PEER_CERT + WOLFSSL_API int wolfSSL_CertManagerUnload_trust_peers(WOLFSSL_CERT_MANAGER* cm); +#endif WOLFSSL_API int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER*, const char* f, int format); WOLFSSL_API int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index fbf4db2e4..c7a4e340b 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -365,6 +365,9 @@ struct DecodedName { typedef struct DecodedCert DecodedCert; typedef struct DecodedName DecodedName; typedef struct Signer Signer; +#ifdef WOLFSSL_TRUST_PEER_CERT +typedef struct TrustedPeerCert TrustedPeerCert; +#endif /* WOLFSSL_TRUST_PEER_CERT */ struct DecodedCert { @@ -554,6 +557,28 @@ struct Signer { }; +#ifdef WOLFSSL_TRUST_PEER_CERT +/* used for having trusted peer certs rather then CA */ +struct TrustedPeerCert { + int nameLen; + char* name; /* common name */ + #ifndef IGNORE_NAME_CONSTRAINTS + Base_entry* permittedNames; + Base_entry* excludedNames; + #endif /* IGNORE_NAME_CONSTRAINTS */ + byte subjectNameHash[SIGNER_DIGEST_SIZE]; + /* sha hash of names in certificate */ + #ifndef NO_SKID + byte subjectKeyIdHash[SIGNER_DIGEST_SIZE]; + /* sha hash of names in certificate */ + #endif + word32 sigLen; + byte* sig; + struct TrustedPeerCert* next; +}; +#endif /* WOLFSSL_TRUST_PEER_CERT */ + + /* not for public consumption but may use for testing sometimes */ #ifdef WOLFSSL_TEST_CERT #define WOLFSSL_TEST_API WOLFSSL_API @@ -575,7 +600,10 @@ WOLFSSL_LOCAL int DecodeToKey(DecodedCert*, int verify); WOLFSSL_LOCAL Signer* MakeSigner(void*); WOLFSSL_LOCAL void FreeSigner(Signer*, void*); WOLFSSL_LOCAL void FreeSignerTable(Signer**, int, void*); - +#ifdef WOLFSSL_TRUST_PEER_CERT +WOLFSSL_LOCAL void FreeTrustedPeer(TrustedPeerCert*, void*); +WOLFSSL_LOCAL void FreeTrustedPeerTable(TrustedPeerCert**, int, void*); +#endif /* WOLFSSL_TRUST_PEER_CERT */ WOLFSSL_LOCAL int ToTraditional(byte* buffer, word32 length); WOLFSSL_LOCAL int ToTraditionalEnc(byte* buffer, word32 length,const char*,int); diff --git a/wolfssl/wolfcrypt/asn_public.h b/wolfssl/wolfcrypt/asn_public.h index fee49760f..f450e4784 100644 --- a/wolfssl/wolfcrypt/asn_public.h +++ b/wolfssl/wolfcrypt/asn_public.h @@ -50,7 +50,8 @@ enum CertType { RSA_TYPE, PUBLICKEY_TYPE, RSA_PUBLICKEY_TYPE, - ECC_PUBLICKEY_TYPE + ECC_PUBLICKEY_TYPE, + TRUSTED_PEER_TYPE }; From 01cd43c3198e8f94fa108eebc5dbbf5b6cdf3f18 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Wed, 2 Mar 2016 11:31:08 -0700 Subject: [PATCH 024/192] Seperate declaration and assignment per c99 standards --- src/internal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index 417841ad4..3fb10d708 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1763,13 +1763,14 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx) { byte havePSK = 0; byte haveAnon = 0; + byte newSSL; byte haveRSA = 0; (void) haveAnon; /* Squash unused var warnings */ if(!ssl || !ctx || ssl->suites == NULL) return BAD_FUNC_ARG; - byte newSSL = ssl->ctx == NULL; /* Assign after null check */ + newSSL = ssl->ctx == NULL; /* Assign after null check */ #ifndef NO_PSK if (ctx->server_hint[0] && ssl->arrays == NULL) { From 05d2cec7c10d8ba370181ae0869eda7a4674bf2f Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 29 Feb 2016 11:02:18 -0700 Subject: [PATCH 025/192] addition to api tests and refactor location of trusted peer cert check --- examples/client/client.c | 6 +++++ examples/server/server.c | 4 ++-- src/internal.c | 43 +++++++++++++++++++++++++++++++++ src/ssl.c | 10 ++------ tests/api.c | 52 ++++++++++++++++++++++++++++++++++++++++ wolfcrypt/src/asn.c | 30 ----------------------- 6 files changed, 105 insertions(+), 40 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 021e97958..417b3267f 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -977,6 +977,12 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) if (wolfSSL_CTX_load_verify_locations(ctx, eccCert, 0) != SSL_SUCCESS) err_sys("can't load ecc ca file, Please run from wolfSSL home dir"); #endif /* HAVE_ECC */ +#ifdef WOLFSSL_TRUST_PEER_CERT + if ((ret = wolfSSL_CTX_trust_peer_cert(ctx, svrCert, SSL_FILETYPE_PEM)) + != SSL_SUCCESS) { + err_sys("can't load trusted peer cert file"); + } +#endif /* WOLFSSL_TRUST_PEER_CERT */ } #endif /* !NO_FILESYSTEM && !NO_CERTS */ #if !defined(NO_CERTS) diff --git a/examples/server/server.c b/examples/server/server.c index a8320733b..adfb895a3 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -686,8 +686,8 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) if (SSL_CTX_load_verify_locations(ctx, verifyCert, 0) != SSL_SUCCESS) err_sys("can't load ca file, Please run from wolfSSL home dir"); #ifdef WOLFSSL_TRUST_PEER_CERT - if ((ret = wolfSSL_CTX_trust_peer_cert(ctx, - "./certs/client-cert.pem", SSL_FILETYPE_PEM)) != SSL_SUCCESS) { + if ((ret = wolfSSL_CTX_trust_peer_cert(ctx, cliCert, SSL_FILETYPE_PEM)) + != SSL_SUCCESS) { err_sys("can't load trusted peer cert file"); } #endif /* WOLFSSL_TRUST_PEER_CERT */ diff --git a/src/internal.c b/src/internal.c index 10aa7349a..523daf1e2 100644 --- a/src/internal.c +++ b/src/internal.c @@ -4554,6 +4554,10 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, WOLFSSL_X509_STORE_CTX store[1]; #endif +#ifdef WOLFSSL_TRUST_PEER_CERT + byte haveTrustPeer = 0; /* was cert verified by loaded trusted peer cert */ +#endif + #ifdef WOLFSSL_CALLBACKS if (ssl->hsInfoOn) AddPacketName("Certificate", &ssl->handShakeInfo); if (ssl->toInfoOn) AddLateName("Certificate", &ssl->timeoutInfo); @@ -4624,6 +4628,34 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, return MEMORY_E; #endif +#ifdef WOLFSSL_TRUST_PEER_CERT + /* if using trusted peer certs check before verify chain and CA test */ + if (count > 0) { + TrustedPeerCert* tp = NULL; + + InitDecodedCert(dCert, certs[0].buffer, certs[0].length, ssl->heap); + ret = ParseCertRelative(dCert, CERT_TYPE, 0, ssl->ctx->cm); + #ifndef NO_SKID + if (dCert->extAuthKeyIdSet) + tp = GetTrustedPeer(ssl->ctx->cm, dCert->extSubjKeyId); + #else /* NO_SKID */ + tp = GetTrustedPeer(ssl->ctx->cm, dCert->issuerHash); + #endif /* NO SKID */ + WOLFSSL_MSG("Checking for trusted peer cert"); + + if (tp == NULL) { + /* no trusted peer cert */ + WOLFSSL_MSG("No matching trusted peer cert. Checking CAs"); + } else if (MatchTrustedPeer(tp, dCert)){ + WOLFSSL_MSG("Found matching trusted peer cert"); + haveTrustPeer = 1; + } else { + WOLFSSL_MSG("Trusted peer cert did not match!"); + } + } + if (!haveTrustPeer) { /* do not verify chain if trusted peer cert found */ +#endif /* WOLFSSL_TRUST_PEER_CERT */ + /* verify up to peer's first */ while (count > 1) { DerBuffer myCert = certs[count - 1]; @@ -4716,6 +4748,10 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, count--; } +#ifdef WOLFSSL_TRUST_PEER_CERT + } /* end of if (haveTrustPeer) -- a check for if already verified */ +#endif + /* peer's, may not have one if blank client cert sent by TLSv1.2 */ if (count) { DerBuffer myCert = certs[0]; @@ -4723,9 +4759,16 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, WOLFSSL_MSG("Verifying Peer's cert"); +#ifdef WOLFSSL_TRUST_PEER_CERT + if (!haveTrustPeer) { /* do not parse again if previously verified */ +#endif InitDecodedCert(dCert, myCert.buffer, myCert.length, ssl->heap); ret = ParseCertRelative(dCert, CERT_TYPE, !ssl->options.verifyNone, ssl->ctx->cm); +#ifdef WOLFSSL_TRUST_PEER_CERT + } +#endif + if (ret == 0) { WOLFSSL_MSG("Verified Peer's cert"); fatal = 0; diff --git a/src/ssl.c b/src/ssl.c index f16934157..22ed142fd 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2290,7 +2290,6 @@ int MatchTrustedPeer(TrustedPeerCert* tp, DecodedCert* cert) /* compare signatures */ if (tp->sigLen == cert->sigLength) { - /* compare first four before comparing all */ if (XMEMCMP(tp->sig, cert->signature, cert->sigLength)) { return SSL_FAILURE; } @@ -2303,6 +2302,7 @@ int MatchTrustedPeer(TrustedPeerCert* tp, DecodedCert* cert) } #endif /* WOLFSSL_TRUST_PEER_CERT */ + /* return CA if found, otherwise NULL */ Signer* GetCA(void* vp, byte* hash) { @@ -4209,19 +4209,13 @@ int wolfSSL_CTX_load_verify_locations(WOLFSSL_CTX* ctx, const char* file, */ int wolfSSL_CTX_trust_peer_cert(WOLFSSL_CTX* ctx, const char* file, int type) { - int ret; - WOLFSSL_ENTER("wolfSSL_CTX_trust_peer_cert"); if (ctx == NULL || file == NULL) { return SSL_FAILURE; } - if ((ret = ProcessFile(ctx, file, type, TRUSTED_PEER_TYPE, NULL, 0, NULL)) - == SSL_SUCCESS) { - } - - return ret; + return ProcessFile(ctx, file, type, TRUSTED_PEER_TYPE, NULL, 0, NULL); } #endif /* WOLFSSL_TRUST_PEER_CERT */ diff --git a/tests/api.c b/tests/api.c index f2340c224..83b77ea3c 100644 --- a/tests/api.c +++ b/tests/api.c @@ -211,6 +211,57 @@ static void test_wolfSSL_CTX_use_PrivateKey_file(void) } +/* test both file and buffer versions along with unloading trusted peer certs */ +static void test_wolfSSL_CTX_trust_peer_cert(void) +{ +#if !defined(NO_CERTS) && defined(WOLFSSL_TRUST_PEER_CERT) + WOLFSSL_CTX *ctx; + + AssertNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method())); + +#if !defined(NO_FILESYSTEM) + /* invalid file */ + assert(wolfSSL_CTX_trust_peer_cert(ctx, NULL, + SSL_FILETYPE_PEM) != SSL_SUCCESS); + assert(wolfSSL_CTX_trust_peer_cert(ctx, bogusFile, + SSL_FILETYPE_PEM) != SSL_SUCCESS); + assert(wolfSSL_CTX_trust_peer_cert(ctx, cliCert, + SSL_FILETYPE_ASN1) != SSL_SUCCESS); + + /* success */ + assert(wolfSSL_CTX_trust_peer_cert(ctx, cliCert, SSL_FILETYPE_PEM) + == SSL_SUCCESS); + + /* unload cert */ + assert(wolfSSL_CTX_Unload_trust_peers(NULL) != SSL_SUCCESS); + assert(wolfSSL_CTX_Unload_trust_peers(ctx) == SSL_SUCCESS); +#endif + + /* Test of loading certs from buffers */ + + /* invalid ca buffer */ + assert(wolfSSL_CTX_trust_peer_buffer(ctx, NULL, -1, + SSL_FILETYPE_ASN1) != SSL_SUCCESS); + + /* success */ +#ifdef USE_CERT_BUFFERS_1024 + assert(wolfSSL_CTX_trust_peer_buffer(ctx, client_cert_der_1024, + sizeof_client_cert_der_1024, SSL_FILETYPE_ASN1) == SSL_SUCCESS); +#endif +#ifdef USE_CERT_BUFFERS_2048 + assert(wolfSSL_CTX_trust_peer_buffer(ctx, client_cert_der_2048, + sizeof_client_cert_der_2048, SSL_FILETYPE_ASN1) == SSL_SUCCESS); +#endif + + /* unload cert */ + assert(wolfSSL_CTX_Unload_trust_peers(NULL) != SSL_SUCCESS); + assert(wolfSSL_CTX_Unload_trust_peers(ctx) == SSL_SUCCESS); + + wolfSSL_CTX_free(ctx); +#endif +} + + static void test_wolfSSL_CTX_load_verify_locations(void) { #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) @@ -1599,6 +1650,7 @@ void ApiTest(void) test_wolfSSL_CTX_use_certificate_file(); test_wolfSSL_CTX_use_PrivateKey_file(); test_wolfSSL_CTX_load_verify_locations(); + test_wolfSSL_CTX_trust_peer_cert(); test_wolfSSL_CTX_SetTmpDH_file(); test_wolfSSL_CTX_SetTmpDH_buffer(); test_server_wolfSSL_new(); diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 5cf59418d..a8e2bcc2b 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -5015,36 +5015,6 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm) #endif /* NO SKID */ WOLFSSL_MSG("About to verify certificate signature"); -#ifdef WOLFSSL_TRUST_PEER_CERT - /* check for trusted peer cert */ - { - TrustedPeerCert* tp = NULL; - #ifndef NO_SKID - if (cert->extAuthKeyIdSet) - tp = GetTrustedPeer(cm, cert->extAuthKeyId); - #else /* NO_SKID */ - tp = GetTrustedPeer(cm, cert->issuerHash); - #endif /* NO SKID */ - WOLFSSL_MSG("Checking for trusted peer cert"); - - if (tp == NULL) { - /* no trusted peer cert */ - WOLFSSL_MSG("No matching trusted peer cert checking CAs"); - } else if (MatchTrustedPeer(tp, cert)){ - WOLFSSL_MSG("Found matching trusted peer cert"); - if (badDate != 0) - return badDate; - - if (criticalExt != 0) - return criticalExt; - - return 0; - } else { - WOLFSSL_MSG("No matching trusted peer cert"); - } - } -#endif /* WOLFSSL_TRUST_PEER_CERT */ - if (ca) { #ifdef HAVE_OCSP /* Need the ca's public key hash for OCSP */ From 85215cc1748b388eceba2b501b064ef6e3fb01c3 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Wed, 2 Mar 2016 11:39:34 -0700 Subject: [PATCH 026/192] clean up braces left over from local declaration of ready --- wolfssl/test.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/wolfssl/test.h b/wolfssl/test.h index 4731132c0..1a8386541 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -846,7 +846,6 @@ static INLINE void tcp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd, #if defined(_POSIX_THREADS) && defined(NO_MAIN_DRIVER) && !defined(__MINGW32__) /* signal ready to tcp_accept */ - { if (args) ready = args->signal; if (ready) { @@ -856,7 +855,6 @@ static INLINE void tcp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd, pthread_cond_signal(&ready->cond); pthread_mutex_unlock(&ready->mutex); } - } #elif defined (WOLFSSL_TIRTOS) /* Need mutex? */ if (args) From d969e2ba1152767d74e8d38e876f58c396bc6ff4 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 1 Mar 2016 16:35:32 -0700 Subject: [PATCH 027/192] automated test for trusted peer certs --- configure.ac | 12 +++ examples/client/client.c | 23 ++++- examples/server/server.c | 23 ++++- scripts/include.am | 4 + scripts/trusted_peer.test | 210 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 264 insertions(+), 8 deletions(-) create mode 100755 scripts/trusted_peer.test diff --git a/configure.ac b/configure.ac index 2301a64ce..6c5041040 100644 --- a/configure.ac +++ b/configure.ac @@ -2501,6 +2501,18 @@ AM_CONDITIONAL([BUILD_MCAPI], [test "x$ENABLED_MCAPI" = "xyes"]) # check if PSK was enabled for conditionally running psk.test script AM_CONDITIONAL([BUILD_PSK], [test "x$ENABLED_PSK" = "xyes"]) + +# check if should run the trusted peer certs test +case $C_EXTRA_FLAGS in + *WOLFSSL_TRUST_PEER_CERT*) + have_tp=yes + break;; + *) + have_tp=no ;; +esac +AM_CONDITIONAL([BUILD_TRUST_PEER_CERT], [test "x$have_tp" = "xyes"]) + + ################################################################################ # Check for build-type conflicts # ################################################################################ diff --git a/examples/client/client.c b/examples/client/client.c index 417b3267f..32e4edc07 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -380,6 +380,9 @@ static void Usage(void) #ifdef HAVE_CRL printf("-C Disable CRL\n"); #endif +#ifdef WOLFSSL_TRUST_PEER_CERT + printf("-T Path to load trusted peer cert\n"); +#endif } THREAD_RETURN WOLFSSL_THREAD client_test(void* args) @@ -438,6 +441,10 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) const char* ourCert = cliCert; const char* ourKey = cliKey; +#ifdef WOLFSSL_TRUST_PEER_CERT + const char* trustCert = NULL; +#endif + #ifdef HAVE_SNI char* sniHostName = NULL; #endif @@ -490,7 +497,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) #ifndef WOLFSSL_VXWORKS while ((ch = mygetopt(argc, argv, - "?gdeDusmNrwRitfxXUPCVh:p:v:l:A:c:k:Z:b:zS:F:L:ToO:aB:W:")) != -1) { + "?gdeDusmNrwRitfxXUPCVh:p:v:l:A:c:k:Z:b:zS:F:L:ToO:aB:W:E:")) != -1) { switch (ch) { case '?' : Usage(); @@ -532,6 +539,12 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) #endif break; + #ifdef WOLFSSL_TRUST_PEER_CERT + case 'E' : + trustCert = myoptarg; + break; + #endif + case 'm' : matchName = 1; break; @@ -978,9 +991,11 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) err_sys("can't load ecc ca file, Please run from wolfSSL home dir"); #endif /* HAVE_ECC */ #ifdef WOLFSSL_TRUST_PEER_CERT - if ((ret = wolfSSL_CTX_trust_peer_cert(ctx, svrCert, SSL_FILETYPE_PEM)) - != SSL_SUCCESS) { - err_sys("can't load trusted peer cert file"); + if (trustCert) { + if ((ret = wolfSSL_CTX_trust_peer_cert(ctx, trustCert, + SSL_FILETYPE_PEM)) != SSL_SUCCESS) { + err_sys("can't load trusted peer cert file"); + } } #endif /* WOLFSSL_TRUST_PEER_CERT */ } diff --git a/examples/server/server.c b/examples/server/server.c index adfb895a3..d3ab1cb95 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -238,6 +238,9 @@ static void Usage(void) printf("-n Use NTRU key (needed for NTRU suites)\n"); #endif printf("-B Benchmark throughput using bytes and print stats\n"); +#ifdef WOLFSSL_TRUST_PEER_CERT + printf("-E Path to load trusted peer cert\n"); +#endif } THREAD_RETURN CYASSL_THREAD server_test(void* args) @@ -288,6 +291,10 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) int argc = ((func_args*)args)->argc; char** argv = ((func_args*)args)->argv; +#ifdef WOLFSSL_TRUST_PEER_CERT + const char* trustCert = NULL; +#endif + #ifndef NO_PSK int sendPskIdentityHint = 1; #endif @@ -330,7 +337,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #ifdef WOLFSSL_VXWORKS useAnyAddr = 1; #else - while ((ch = mygetopt(argc, argv, "?dbstnNufrawPIR:p:v:l:A:c:k:Z:S:oO:D:L:ieB:j")) + while ((ch = mygetopt(argc, argv, "?dbstnNufrawPIR:p:v:l:A:c:k:Z:S:oO:D:L:ieB:j:E:")) != -1) { switch (ch) { case '?' : @@ -507,6 +514,12 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) } break; + #ifdef WOLFSSL_TRUST_PEER_CERT + case 'E' : + trustCert = myoptarg; + break; + #endif + default: Usage(); exit(MY_EX_USAGE); @@ -686,9 +699,11 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) if (SSL_CTX_load_verify_locations(ctx, verifyCert, 0) != SSL_SUCCESS) err_sys("can't load ca file, Please run from wolfSSL home dir"); #ifdef WOLFSSL_TRUST_PEER_CERT - if ((ret = wolfSSL_CTX_trust_peer_cert(ctx, cliCert, SSL_FILETYPE_PEM)) - != SSL_SUCCESS) { - err_sys("can't load trusted peer cert file"); + if (trustCert) { + if ((ret = wolfSSL_CTX_trust_peer_cert(ctx, trustCert, + SSL_FILETYPE_PEM)) != SSL_SUCCESS) { + err_sys("can't load trusted peer cert file"); + } } #endif /* WOLFSSL_TRUST_PEER_CERT */ } diff --git a/scripts/include.am b/scripts/include.am index 5866a554e..2d9ea0346 100644 --- a/scripts/include.am +++ b/scripts/include.am @@ -51,6 +51,10 @@ if BUILD_PSK dist_noinst_SCRIPTS+= scripts/psk.test endif +if BUILD_TRUST_PEER_CERT +dist_noinst_SCRIPTS+= scripts/trusted_peer.test +endif + EXTRA_DIST += scripts/testsuite.pcap # leave openssl.test as extra until non bash works EXTRA_DIST += scripts/openssl.test diff --git a/scripts/trusted_peer.test b/scripts/trusted_peer.test new file mode 100755 index 000000000..a07836280 --- /dev/null +++ b/scripts/trusted_peer.test @@ -0,0 +1,210 @@ +#!/bin/sh + +# trusted_peer.test +# copyright wolfSSL 2016 + +# getting unique port is modeled after resume.test script +# need a unique port since may run the same time as testsuite +# use server port zero hack to get one +port=0 +no_pid=-1 +server_pid=$no_pid +counter=0 +# let's use absolute path to a local dir (make distcheck may be in sub dir) +# also let's add some randomness by adding pid in case multiple 'make check's +# per source tree +ready_file=`pwd`/wolfssl_tp_ready$$ + +echo "ready file $ready_file" + +create_port() { + while [ ! -s $ready_file -a "$counter" -lt 20 ]; do + echo -e "waiting for ready file..." + sleep 0.1 + counter=$((counter+ 1)) + done + + if test -e $ready_file; then + echo -e "found ready file, starting client..." + + # get created port 0 ephemeral port + port=`cat $ready_file` + else + echo -e "NO ready file ending test..." + do_cleanup + fi +} + +remove_ready_file() { + if test -e $ready_file; then + echo -e "removing existing ready file" + rm $ready_file + fi +} + +do_cleanup() { + echo "in cleanup" + + if [ $server_pid != $no_pid ] + then + echo "killing server" + kill -9 $server_pid + fi + remove_ready_file +} + +do_trap() { + echo "got trap" + do_cleanup + exit -1 +} + +trap do_trap INT TERM + +[ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1 + +# Test for trusted peer certs build +echo "" +echo "Checking built with trusted peer certs " +echo "-----------------------------------------------------" +port=0 +./examples/server/server -E certs/client-cert.pem -R $ready_file -p $port & +server_pid=$! +create_port +./examples/client/client -p $port +RESULT=$? +remove_ready_file +# if fail here then is a settings issue so return 0 +if [ $RESULT -ne 0 ]; then + echo -e "\n\nTrusted peer certs not enabled \"WOLFSSL_TRUST_PEER_CERT\"" + do_cleanup + exit 0 +fi +echo "" + +# Test that using no CA's and only trusted peer certs works +echo "Server and Client relying on trusted peer cert loaded" +echo "-----------------------------------------------------" +port=0 +./examples/server/server -A certs/wolfssl-website-ca.pem -E certs/client-cert.pem -c certs/server-cert.pem -R $ready_file -p $port & +server_pid=$! +create_port +./examples/client/client -A certs/wolfssl-website-ca.pem -E certs/server-cert.pem -c certs/client-cert.pem -p $port +RESULT=$? +remove_ready_file +if [ $RESULT -ne 0 ]; then + echo -e "\nServer and Client trusted peer cert failed!" + do_cleanup + exit 1 +fi +echo "" + +# Test that using server trusted peer certs works +echo "Server relying on trusted peer cert loaded" +echo "-----------------------------------------------------" +port=0 +./examples/server/server -A certs/wolfssl-website-ca.pem -E certs/client-cert.pem -c certs/server-cert.pem -R $ready_file -p $port & +server_pid=$! +create_port +./examples/client/client -c certs/client-cert.pem -p $port +RESULT=$? +remove_ready_file +if [ $RESULT -ne 0 ]; then + echo -e "\nServer trusted peer cert test failed!" + do_cleanup + exit 1 +fi +echo "" + +# Test that using client trusted peer certs works +echo "Client relying on trusted peer cert loaded" +echo "-----------------------------------------------------" +port=0 +./examples/server/server -c certs/server-cert.pem -R $ready_file -p $port & +server_pid=$! +create_port +./examples/client/client -E certs/server-cert.pem -p $port +RESULT=$? +remove_ready_file +if [ $RESULT -ne 0 ]; then + echo -e "\nClient trusted peer cert test failed!" + do_cleanup + exit 1 +fi +echo "" + +# Test that client fall through to CA works +echo "Client fall through to loaded CAs" +echo "-----------------------------------------------------" +port=0 +./examples/server/server -R $ready_file -p $port & +server_pid=$! +create_port +./examples/client/client -E certs/server-revoked-cert.pem -p $port +RESULT=$? +remove_ready_file +if [ $RESULT -ne 0 ]; then + echo -e "\nClient trusted peer cert fall through to CA test failed!" + do_cleanup + exit 1 +fi +echo "" + +# Test that client can fail +echo "Client wrong CA and wrong trusted peer cert loaded" +echo "-----------------------------------------------------" +port=0 +./examples/server/server -R $ready_file -p $port & +server_pid=$! +create_port +./examples/client/client -A certs/wolfssl-website-ca.pem -E certs/server-revoked-cert.pem -p $port +RESULT=$? +remove_ready_file +if [ $RESULT -eq 0 ]; then + echo -e "\nClient trusted peer cert test failed!" + do_cleanup + exit 1 +fi +echo "" + +# Test that server can fail +echo "Server wrong CA and wrong trusted peer cert loaded" +echo "-----------------------------------------------------" +port=0 +./examples/server/server -A certs/wolfssl-website-ca.pem -E certs/server-revoked-cert.pem -R $ready_file -p $port & +server_pid=$! +create_port +./examples/client/client -p $port +RESULT=$? +remove_ready_file +if [ $RESULT -eq 0 ]; then + echo -e "\nServer trusted peer cert test failed!" + do_cleanup + exit 1 +fi +echo "" + +# Test that server fall through to CA works +echo "Server fall through to loaded CAs" +echo "-----------------------------------------------------" +port=0 +./examples/server/server -E certs/server-revoked-cert.pem -R $ready_file -p $port & +server_pid=$! +create_port +./examples/client/client -p $port +RESULT=$? +remove_ready_file +if [ $RESULT -ne 0 ]; then + echo -e "\nServer trusted peer cert fall through to CA test failed!" + do_cleanup + exit 1 +fi +echo "" + +echo "-----------------------------------------------------" +echo "ALL TESTS PASSED" +echo "-----------------------------------------------------" + +exit 0 + + From 267dc48d955b60b49569a8ab1c20f27fe1bbad7c Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 2 Mar 2016 15:23:50 -0700 Subject: [PATCH 028/192] fixs after testing : hash table, using NO_SKID, sanity check, and freeing dCert --- src/internal.c | 40 +++++++++++++++++++++------------------- src/ssl.c | 20 ++++++++++++++++---- tests/api.c | 2 +- 3 files changed, 38 insertions(+), 24 deletions(-) diff --git a/src/internal.c b/src/internal.c index 523daf1e2..b5f24fcc7 100644 --- a/src/internal.c +++ b/src/internal.c @@ -4631,27 +4631,29 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, #ifdef WOLFSSL_TRUST_PEER_CERT /* if using trusted peer certs check before verify chain and CA test */ if (count > 0) { - TrustedPeerCert* tp = NULL; + TrustedPeerCert* tp = NULL; - InitDecodedCert(dCert, certs[0].buffer, certs[0].length, ssl->heap); - ret = ParseCertRelative(dCert, CERT_TYPE, 0, ssl->ctx->cm); - #ifndef NO_SKID - if (dCert->extAuthKeyIdSet) - tp = GetTrustedPeer(ssl->ctx->cm, dCert->extSubjKeyId); - #else /* NO_SKID */ - tp = GetTrustedPeer(ssl->ctx->cm, dCert->issuerHash); - #endif /* NO SKID */ - WOLFSSL_MSG("Checking for trusted peer cert"); + InitDecodedCert(dCert, certs[0].buffer, certs[0].length, ssl->heap); + ret = ParseCertRelative(dCert, CERT_TYPE, 0, ssl->ctx->cm); + #ifndef NO_SKID + if (dCert->extAuthKeyIdSet) + tp = GetTrustedPeer(ssl->ctx->cm, dCert->extSubjKeyId); + #else /* NO_SKID */ + tp = GetTrustedPeer(ssl->ctx->cm, dCert->subjectHash); + #endif /* NO SKID */ + WOLFSSL_MSG("Checking for trusted peer cert"); - if (tp == NULL) { - /* no trusted peer cert */ - WOLFSSL_MSG("No matching trusted peer cert. Checking CAs"); - } else if (MatchTrustedPeer(tp, dCert)){ - WOLFSSL_MSG("Found matching trusted peer cert"); - haveTrustPeer = 1; - } else { - WOLFSSL_MSG("Trusted peer cert did not match!"); - } + if (tp == NULL) { + /* no trusted peer cert */ + WOLFSSL_MSG("No matching trusted peer cert. Checking CAs"); + FreeDecodedCert(dCert); + } else if (MatchTrustedPeer(tp, dCert)){ + WOLFSSL_MSG("Found matching trusted peer cert"); + haveTrustPeer = 1; + } else { + WOLFSSL_MSG("Trusted peer cert did not match!"); + FreeDecodedCert(dCert); + } } if (!haveTrustPeer) { /* do not verify chain if trusted peer cert found */ #endif /* WOLFSSL_TRUST_PEER_CERT */ diff --git a/src/ssl.c b/src/ssl.c index 22ed142fd..e896f0be8 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2215,12 +2215,18 @@ int AlreadySigner(WOLFSSL_CERT_MANAGER* cm, byte* hash) #ifdef WOLFSSL_TRUST_PEER_CERT +/* hash is the SHA digest of name, just use first 32 bits as hash */ +static INLINE word32 TrustedPeerHashSigner(const byte* hash) +{ + return MakeWordFromHash(hash) % TP_TABLE_SIZE; +} + /* does trusted peer already exist on signer list */ int AlreadyTrustedPeer(WOLFSSL_CERT_MANAGER* cm, byte* hash) { TrustedPeerCert* tp; int ret = 0; - word32 row = HashSigner(hash); + word32 row = TrustedPeerHashSigner(hash); if (LockMutex(&cm->tpLock) != 0) return ret; @@ -2255,7 +2261,7 @@ TrustedPeerCert* GetTrustedPeer(void* vp, byte* hash) if (cm == NULL || hash == NULL) return NULL; - row = HashSigner(hash); + row = TrustedPeerHashSigner(hash); if (LockMutex(&cm->tpLock) != 0) return ret; @@ -2454,9 +2460,9 @@ int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int verify) #endif #ifndef NO_SKID - row = HashSigner(peerCert->subjectKeyIdHash); + row = TrustedPeerHashSigner(peerCert->subjectKeyIdHash); #else - row = HashSigner(peerCert->subjectNameHash); + row = TrustedPeerHashSigner(peerCert->subjectNameHash); #endif if (LockMutex(&cm->tpLock) == 0) { @@ -7643,6 +7649,12 @@ int wolfSSL_set_compression(WOLFSSL* ssl) long sz, int format) { WOLFSSL_ENTER("wolfSSL_CTX_trust_peer_buffer"); + + /* sanity check on arguments */ + if (sz < 0 || in == NULL || ctx == NULL) { + return BAD_FUNC_ARG; + } + if (format == SSL_FILETYPE_PEM) return ProcessChainBuffer(ctx, in, sz, format, TRUSTED_PEER_TYPE, NULL); diff --git a/tests/api.c b/tests/api.c index 83b77ea3c..59fcb4d51 100644 --- a/tests/api.c +++ b/tests/api.c @@ -239,7 +239,7 @@ static void test_wolfSSL_CTX_trust_peer_cert(void) /* Test of loading certs from buffers */ - /* invalid ca buffer */ + /* invalid buffer */ assert(wolfSSL_CTX_trust_peer_buffer(ctx, NULL, -1, SSL_FILETYPE_ASN1) != SSL_SUCCESS); From aab44eb26b016a6454911ced4d5169a43eefac6b Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 2 Mar 2016 15:43:17 -0700 Subject: [PATCH 029/192] adjest example server PSK plus flag --- examples/server/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/server/server.c b/examples/server/server.c index d3ab1cb95..d4937d280 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -337,7 +337,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #ifdef WOLFSSL_VXWORKS useAnyAddr = 1; #else - while ((ch = mygetopt(argc, argv, "?dbstnNufrawPIR:p:v:l:A:c:k:Z:S:oO:D:L:ieB:j:E:")) + while ((ch = mygetopt(argc, argv, "?jdbstnNufrawPIR:p:v:l:A:c:k:Z:S:oO:D:L:ieB:E:")) != -1) { switch (ch) { case '?' : From 7a599c13098f5d8ba506f38601a1153602571585 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Wed, 2 Mar 2016 16:31:58 -0700 Subject: [PATCH 030/192] Account for not used case --- wolfssl/test.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wolfssl/test.h b/wolfssl/test.h index 1a8386541..1b1db4575 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -836,6 +836,8 @@ static INLINE void tcp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd, socklen_t client_len = sizeof(client); tcp_ready* ready = NULL; + (void) ready; /* Account for case when "ready" is not used */ + if (udp) { udp_accept(sockfd, clientfd, useAnyAddr, port, args); return; From 112cf1f0c92a1137581532a25e70a2ec448284cc Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 2 Mar 2016 16:51:57 -0700 Subject: [PATCH 031/192] fix example client help print out --- examples/client/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/client/client.c b/examples/client/client.c index 32e4edc07..1614ecdf9 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -381,7 +381,7 @@ static void Usage(void) printf("-C Disable CRL\n"); #endif #ifdef WOLFSSL_TRUST_PEER_CERT - printf("-T Path to load trusted peer cert\n"); + printf("-E Path to load trusted peer cert\n"); #endif } From c98c457b9bfffdd8cd2b847caedbac135ccee84e Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 3 Mar 2016 14:35:39 -0700 Subject: [PATCH 032/192] update wolfssl-ntru vs project and fix warnings --- src/internal.c | 4 +++- src/tls.c | 22 ++++++++++++---------- wolfssl-ntru.vcproj | 6 ++++++ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/internal.c b/src/internal.c index 3affa2fde..2d4b9fbc1 100644 --- a/src/internal.c +++ b/src/internal.c @@ -13970,11 +13970,13 @@ int DoSessionTicket(WOLFSSL* ssl, int SendServerKeyExchange(WOLFSSL* ssl) { int ret = 0; + #ifdef HAVE_QSH + word32 qshSz = 0; + #endif (void)ssl; #define ERROR_OUT(err, eLabel) do { ret = err; goto eLabel; } while(0) #ifdef HAVE_QSH - word32 qshSz = 0; if (ssl->peerQSHKeyPresent && ssl->options.haveQSH) { qshSz = QSH_KeyGetSize(ssl); } diff --git a/src/tls.c b/src/tls.c index 7356aff06..b66041f37 100644 --- a/src/tls.c +++ b/src/tls.c @@ -3400,13 +3400,13 @@ static void TLSX_QSHAgreement(TLSX** extensions) { TLSX* extension = TLSX_Find(*extensions, TLSX_QUANTUM_SAFE_HYBRID); QSHScheme* format = NULL; - QSHScheme* delete = NULL; + QSHScheme* del = NULL; QSHScheme* prev = NULL; if (extension == NULL) return; - format = extension->data; + format = (QSHScheme*)extension->data; while (format) { if (format->PKLen == 0) { /* case of head */ @@ -3415,10 +3415,10 @@ static void TLSX_QSHAgreement(TLSX** extensions) } if (prev) prev->next = format->next; - delete = format; + del = format; format = format->next; - XFREE(delete, 0, DYNAMIC_TYPE_TMP_ARRAY); - delete = NULL; + XFREE(del, 0, DYNAMIC_TYPE_TMP_ARRAY); + del = NULL; } else { prev = format; format = format->next; @@ -3866,7 +3866,7 @@ void TLSX_FreeAll(TLSX* list) break; case TLSX_QUANTUM_SAFE_HYBRID: - QSH_FREE_ALL(extension->data); + QSH_FREE_ALL((QSHScheme*)extension->data); break; case TLSX_APPLICATION_LAYER_PROTOCOL: @@ -3941,7 +3941,7 @@ static word16 TLSX_GetSize(TLSX* list, byte* semaphore, byte isRequest) break; case TLSX_QUANTUM_SAFE_HYBRID: - length += QSH_GET_SIZE(extension->data, isRequest); + length += QSH_GET_SIZE((QSHScheme*)extension->data, isRequest); break; case TLSX_APPLICATION_LAYER_PROTOCOL: @@ -4023,9 +4023,9 @@ static word16 TLSX_Write(TLSX* list, byte* output, byte* semaphore, case TLSX_QUANTUM_SAFE_HYBRID: if (isRequest) { - offset += QSH_WRITE(extension->data, output + offset); + offset += QSH_WRITE((QSHScheme*)extension->data, output + offset); } - offset += QSHPK_WRITE(extension->data, output + offset); + offset += QSHPK_WRITE((QSHScheme*)extension->data, output + offset); offset += QSH_SERREQ(output + offset, isRequest); break; @@ -4102,6 +4102,8 @@ static int TLSX_CreateQSHKey(WOLFSSL* ssl, int type) static int TLSX_AddQSHKey(QSHKey** list, QSHKey* key) { + QSHKey* current; + if (key == NULL) return BAD_FUNC_ARG; @@ -4110,7 +4112,7 @@ static int TLSX_AddQSHKey(QSHKey** list, QSHKey* key) return 0; /* first element to be added to the list */ - QSHKey* current = *list; + current = *list; if (current == NULL) { *list = key; return 0; diff --git a/wolfssl-ntru.vcproj b/wolfssl-ntru.vcproj index 84a6feac8..b427e9c0a 100755 --- a/wolfssl-ntru.vcproj +++ b/wolfssl-ntru.vcproj @@ -177,6 +177,7 @@ + @@ -268,6 +269,7 @@ + @@ -316,6 +318,10 @@ RelativePath=".\src\tls.c" > + + Date: Mon, 7 Mar 2016 13:40:25 -0800 Subject: [PATCH 033/192] Fixed bug with ASN.1 X509V3 Certificate Policy extension parsing. Bug had to do with parsing when OID contains multiple items such as example 2 below. The wolfssl.com server key now contains a URL in the certificate policy "https://secure.comodo.com/CPS0", which wasn't being parsed over correctly. Also cleanup to use loop instead of duplicate code. Example 1: 30 12 30 06 06 04 55 1D 20 00 30 08 06 06 67 81 0C 01 02 01 Result: 2.5.29.32.0 2.23.140.1.2.1 Example 2: 30 46 30 3A 06 0B 2B 06 01 04 01 B2 31 01 02 02 07 30 2B 30 29 06 08 2B 06 01 05 05 07 02 01 16 1D 68 74 74 70 73 3A 2F 2F 73 65 63 75 72 65 2E 63 6F 6D 6F 64 6F 2E 63 6F 6D 2F 43 50 53 30 08 06 06 67 81 0C 01 02 01 Result: 1.3.6.1.4.1.6449.1.2.2.7 2.23.140.1.2.1 --- wolfcrypt/src/asn.c | 107 ++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 64 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 4bb809e23..29ce32f32 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4596,87 +4596,64 @@ static int DecodePolicyOID(char *out, word32 outSz, byte *in, word32 inSz) #endif /* WOLFSSL_CERT_EXT && !WOLFSSL_SEP */ #if defined(WOLFSSL_SEP) || defined(WOLFSSL_CERT_EXT) + /* Reference: https://tools.ietf.org/html/rfc5280#section-4.2.1.4 */ static int DecodeCertPolicy(byte* input, int sz, DecodedCert* cert) { word32 idx = 0; - int total_length = 0, length = 0; + int total_length = 0, policy_length = 0, length = 0; WOLFSSL_ENTER("DecodeCertPolicy"); - /* Unwrap certificatePolicies */ if (GetSequence(input, &idx, &total_length, sz) < 0) { - WOLFSSL_MSG("\tdeviceType isn't OID"); + WOLFSSL_MSG("\tGet CertPolicy total seq failed"); return ASN_PARSE_E; } - if (GetSequence(input, &idx, &length, sz) < 0) { - WOLFSSL_MSG("\tdeviceType isn't OID"); - return ASN_PARSE_E; - } - total_length -= (length+1); - - if (input[idx++] != ASN_OBJECT_ID) { - WOLFSSL_MSG("\tdeviceType isn't OID"); - return ASN_PARSE_E; - } - total_length--; - - if (GetLength(input, &idx, &length, sz) < 0) { - WOLFSSL_MSG("\tCouldn't read length of deviceType"); - return ASN_PARSE_E; - } - - if (length > 0) { -#if defined(WOLFSSL_SEP) - cert->deviceType = (byte*)XMALLOC(length, cert->heap, - DYNAMIC_TYPE_X509_EXT); - if (cert->deviceType == NULL) { - WOLFSSL_MSG("\tCouldn't alloc memory for deviceType"); - return MEMORY_E; - } - cert->deviceTypeSz = length; - XMEMCPY(cert->deviceType, input + idx, length); -#elif defined(WOLFSSL_CERT_EXT) - /* decode cert policy */ - if (DecodePolicyOID(cert->extCertPolicies[0], MAX_CERTPOL_SZ, - input+idx, length) != 0) { - WOLFSSL_MSG("\tCouldn't read Policy OID 1"); + /* Unwrap certificatePolicies */ + do { + if (GetSequence(input, &idx, &policy_length, sz) < 0) { + WOLFSSL_MSG("\tGet CertPolicy seq failed"); return ASN_PARSE_E; } - cert->extCertPoliciesNb++; - /* check if we have a second value */ - if (total_length) { - idx += length; + if (input[idx++] != ASN_OBJECT_ID) { + WOLFSSL_MSG("\tCertPolicy isn't OID"); + return ASN_PARSE_E; + } + policy_length--; - if (GetSequence(input, &idx, &length, sz) < 0) { - WOLFSSL_MSG("\tdeviceType isn't OID"); - return ASN_PARSE_E; + if (GetLength(input, &idx, &length, sz) < 0) { + WOLFSSL_MSG("\tGet CertPolicy length failed"); + return ASN_PARSE_E; + } + policy_length--; + + if (length > 0) { + #if defined(WOLFSSL_SEP) + cert->deviceType = (byte*)XMALLOC(length, cert->heap, + DYNAMIC_TYPE_X509_EXT); + if (cert->deviceType == NULL) { + WOLFSSL_MSG("\tCouldn't alloc memory for deviceType"); + return MEMORY_E; } - - if (input[idx++] != ASN_OBJECT_ID) { - WOLFSSL_MSG("\tdeviceType isn't OID"); - return ASN_PARSE_E; - } - - if (GetLength(input, &idx, &length, sz) < 0) { - WOLFSSL_MSG("\tCouldn't read length of deviceType"); - return ASN_PARSE_E; - } - + cert->deviceTypeSz = length; + XMEMCPY(cert->deviceType, input + idx, length); + break; + #elif defined(WOLFSSL_CERT_EXT) /* decode cert policy */ - if (DecodePolicyOID(cert->extCertPolicies[1], MAX_CERTPOL_SZ, - input+idx, length) != 0) { - WOLFSSL_MSG("\tCouldn't read Policy OID 2"); + if (DecodePolicyOID(cert->extCertPolicies[cert->extCertPoliciesNb], MAX_CERTPOL_SZ, + input + idx, length) != 0) { + WOLFSSL_MSG("\tCouldn't decode CertPolicy"); return ASN_PARSE_E; } cert->extCertPoliciesNb++; + #else + WOLFSSL_LEAVE("DecodeCertPolicy : unsupported mode", 0); + return 0; + #endif } -#else - WOLFSSL_LEAVE("DecodeCertPolicy : unsupported mode", 0); - return 0; -#endif - } + idx += policy_length; + } while((int)idx < total_length && cert->extCertPoliciesNb < MAX_CERTPOL_NB); WOLFSSL_LEAVE("DecodeCertPolicy", 0); return 0; @@ -4802,7 +4779,6 @@ static int DecodeCertExtensions(DecodedCert* cert) break; case CERT_POLICY_OID: - WOLFSSL_MSG("Certificate Policy extension not supported yet."); #ifdef WOLFSSL_SEP #ifdef OPENSSL_EXTRA cert->extCertPolicySet = 1; @@ -4810,8 +4786,11 @@ static int DecodeCertExtensions(DecodedCert* cert) #endif #endif #if defined(WOLFSSL_SEP) || defined(WOLFSSL_CERT_EXT) - if (DecodeCertPolicy(&input[idx], length, cert) < 0) - return ASN_PARSE_E; + if (DecodeCertPolicy(&input[idx], length, cert) < 0) { + return ASN_PARSE_E; + } + #else + WOLFSSL_MSG("Certificate Policy extension not supported yet."); #endif break; From 9b79d8643e8ca821597aa56c1553c11e9c1a8361 Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 7 Mar 2016 14:20:37 -0800 Subject: [PATCH 034/192] Added checks for total length and the cert policy OID len to make sure they don't exceed buffer. --- wolfcrypt/src/asn.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 29ce32f32..45664d696 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4608,6 +4608,12 @@ static int DecodePolicyOID(char *out, word32 outSz, byte *in, word32 inSz) WOLFSSL_MSG("\tGet CertPolicy total seq failed"); return ASN_PARSE_E; } + + /* Validate total length (2 is the CERT_POLICY_OID+SEQ) */ + if ((total_length + 2) != sz) { + WOLFSSL_MSG("\tCertPolicy length mismatch"); + return ASN_PARSE_E; + } /* Unwrap certificatePolicies */ do { @@ -4629,6 +4635,12 @@ static int DecodePolicyOID(char *out, word32 outSz, byte *in, word32 inSz) policy_length--; if (length > 0) { + /* Verify length won't overrun buffer */ + if (length > (sz - (int)idx)) { + WOLFSSL_MSG("\tCertPolicy length exceeds input buffer"); + return ASN_PARSE_E; + } + #if defined(WOLFSSL_SEP) cert->deviceType = (byte*)XMALLOC(length, cert->heap, DYNAMIC_TYPE_X509_EXT); From 05fb6487477790f1e3199191f723cfc4e580971e Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 7 Mar 2016 14:33:22 -0800 Subject: [PATCH 035/192] Remove white-space. --- wolfcrypt/src/asn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 45664d696..879a8adb1 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4608,7 +4608,7 @@ static int DecodePolicyOID(char *out, word32 outSz, byte *in, word32 inSz) WOLFSSL_MSG("\tGet CertPolicy total seq failed"); return ASN_PARSE_E; } - + /* Validate total length (2 is the CERT_POLICY_OID+SEQ) */ if ((total_length + 2) != sz) { WOLFSSL_MSG("\tCertPolicy length mismatch"); From b549c813377f15b70a61af05d31e32d8c39cdacc Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 7 Mar 2016 14:49:24 -0800 Subject: [PATCH 036/192] Fix the WOLFSSL_SEP (--enable-sep) build scenario where extCertPoliciesNb is not available. --- wolfcrypt/src/asn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 879a8adb1..d63806f5b 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4665,7 +4665,11 @@ static int DecodePolicyOID(char *out, word32 outSz, byte *in, word32 inSz) #endif } idx += policy_length; - } while((int)idx < total_length && cert->extCertPoliciesNb < MAX_CERTPOL_NB); + } while((int)idx < total_length + #if defined(WOLFSSL_CERT_EXT) + && cert->extCertPoliciesNb < MAX_CERTPOL_NB + #endif + ); WOLFSSL_LEAVE("DecodeCertPolicy", 0); return 0; From 8e8ee458284983282716b0e35dd84095ac213784 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 12 Feb 2016 14:30:26 -0800 Subject: [PATCH 037/192] LeanTLS: Fixed issue with GetCA, GetCAByName and PickHashSigAlgo with HAVE_ECC, NO_RSA and NO_CERTS defined. Added new "--enable-leantls" option, which enables TLS 1.2 client only with ECC256, AES128 and SHA256 (no RSA, DH, DSA, MD4, MD5, SHA, PSK, PWD, CERTS, DES3, Error Strings, ARC4, Coding, Memory or File System). --- configure.ac | 90 ++++++++++++++++++++++++--------------------- src/internal.c | 7 ++-- wolfcrypt/src/asn.c | 4 +- 3 files changed, 53 insertions(+), 48 deletions(-) diff --git a/configure.ac b/configure.ac index 2301a64ce..4150b8439 100644 --- a/configure.ac +++ b/configure.ac @@ -256,6 +256,21 @@ fi AM_CONDITIONAL([BUILD_LEANPSK], [test "x$ENABLED_LEANPSK" = "xyes"]) +# lean TLS build (TLS 1.2 client only (no client auth), ECC256, AES128 and SHA256 w/o Shamir) +AC_ARG_ENABLE([leantls], + [ --enable-leantls Enable Lean TLS build (default: disabled)], + [ ENABLED_LEANTLS=$enableval ], + [ ENABLED_LEANTLS=no ] + ) + +if test "$ENABLED_LEANTLS" = "yes" +then + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LEANTLS -DNO_FILESYSTEM -DNO_WRITEV -DHAVE_ECC -DTFM_ECC256 -DECC_USER_CURVES -DNO_WOLFSSL_SERVER -DNO_RABBIT -DNO_RSA -DNO_DSA -DNO_DH -DNO_CERTS -DNO_PWDBASED -DNO_DES3 -DNO_MD5 -DNO_ERROR_STRINGS -DNO_OLD_TLS -DNO_RC4 -DNO_SESSION_CACHE -DNO_SHA -DUSE_SLOW_SHA -DUSE_SLOW_SHA2 -DNO_PSK -DNO_WOLFSSL_MEMORY -DNO_CODING" +fi + +AM_CONDITIONAL([BUILD_LEANTLS], [test "x$ENABLED_LEANTLS" = "xyes"]) + + # big cache AC_ARG_ENABLE([bigcache], [ --enable-bigcache Enable big session cache (default: disabled)], @@ -354,7 +369,7 @@ AC_ARG_ENABLE([sniffer], [ ENABLED_SNIFFER=no ] ) -# sniffer does't work in maxstrength mode +# sniffer doesn't work in maxstrength mode if test "$ENABLED_SNIFFER" = "yes" && test "$ENABLED_MAXSTRENGTH" = "yes" then AC_MSG_ERROR([cannot enable maxstrength in sniffer mode.]) @@ -380,8 +395,8 @@ AC_ARG_ENABLE([aesgcm], [ ENABLED_AESGCM=yes ] ) -# lean psk does't need gcm -if test "$ENABLED_LEANPSK" = "yes" +# leanpsk and leantls don't need gcm +if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then ENABLED_AESGCM=no fi @@ -566,8 +581,8 @@ AC_ARG_ENABLE([sha512], [ ENABLED_SHA512=$SHA512_DEFAULT ] ) -# lean psk does't need sha512 -if test "$ENABLED_LEANPSK" = "yes" +# leanpsk and leantls don't need sha512 +if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then ENABLED_SHA512=no fi @@ -723,7 +738,7 @@ AC_ARG_ENABLE([ecc], [ ENABLED_ECC=$ECC_DEFAULT ] ) -# lean psk does't need ecc +# lean psk doesn't need ecc if test "$ENABLED_LEANPSK" = "yes" then ENABLED_ECC=no @@ -742,12 +757,6 @@ fi AM_CONDITIONAL([BUILD_ECC], [test "x$ENABLED_ECC" = "xyes"]) -if test "$ENABLED_ECC" = "yes" && test "$ENABLED_SMALL" = "yes" -then - AC_MSG_ERROR([cannot enable ecc and small, ecc requires TLS which small turns off.]) -fi - - # for using memory optimization setting on both curve25519 and ed25519 ENABLED_CURVED25519_SMALL=no @@ -874,8 +883,8 @@ if test "$ENABLED_ERROR_STRINGS" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_STRINGS" else - # turn off error strings if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off error strings if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_STRINGS" ENABLED_ERROR_STRINGS=no @@ -894,8 +903,8 @@ if test "$ENABLED_OLD_TLS" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS" else - # turn off old if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off old if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS" ENABLED_OLD_TLS=no @@ -942,8 +951,8 @@ if test "$ENABLED_MEMORY" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_WOLFSSL_MEMORY" else - # turn off memory cb if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off memory cb if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then # but don't turn on NO_WOLFSSL_MEMORY because using own ENABLED_MEMORY=no @@ -964,8 +973,8 @@ if test "$ENABLED_RSA" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_RSA" else - # turn off RSA if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off RSA if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_RSA" ENABLED_RSA=no @@ -991,8 +1000,8 @@ if test "$ENABLED_DH" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_DH" else - # turn off DH if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off DH if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_DH" ENABLED_DH=no @@ -1115,8 +1124,8 @@ if test "$ENABLED_CODING" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_CODING" else - # turn off CODING if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off CODING if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_CODING" ENABLED_CODING=no @@ -1137,8 +1146,8 @@ if test "$ENABLED_DES3" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_DES3" else - # turn off DES3 if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off DES3 if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_DES3" ENABLED_DES3=no @@ -1180,8 +1189,8 @@ if test "$ENABLED_ARC4" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_RC4" else - # turn off ARC4 if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off ARC4 if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_RC4" ENABLED_ARC4=no @@ -1202,8 +1211,8 @@ if test "$ENABLED_MD5" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_MD5 -DNO_OLD_TLS" else - # turn off MD5 if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off MD5 if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_MD5 -DNO_OLD_TLS" ENABLED_MD5=no @@ -1224,8 +1233,8 @@ if test "$ENABLED_SHA" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS" else - # turn off SHA if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off SHA if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS" ENABLED_SHA=no @@ -1332,8 +1341,8 @@ AC_ARG_ENABLE([poly1305], [ ENABLED_POLY1305=$POLY1305_DEFAULT] ) -# lean psk does't need poly1305 -if test "$ENABLED_LEANPSK" = "yes" +# leanpsk and leantls don't need poly1305 +if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then ENABLED_POLY1305=no fi @@ -1361,8 +1370,8 @@ AC_ARG_ENABLE([chacha], [ ENABLED_CHACHA=$CHACHA_DEFAULT] ) -# lean psk does't need chacha -if test "$ENABLED_LEANPSK" = "yes" +# leanpsk and leantls don't need chacha +if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then ENABLED_CHACHA=no fi @@ -1406,8 +1415,8 @@ if test "$ENABLED_FILESYSTEM" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM" else - # turn off filesystem if leanpsk on - if test "$ENABLED_LEANPSK" = "yes" + # turn off filesystem if leanpsk or leantls on + if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM" ENABLED_FILESYSTEM=no @@ -1636,10 +1645,6 @@ AC_ARG_WITH([ntru], AM_CONDITIONAL([BUILD_NTRU], [test "x$ENABLED_NTRU" = "xyes"]) -if test "$ENABLED_NTRU" = "yes" && test "$ENABLED_SMALL" = "yes" -then - AC_MSG_ERROR([cannot enable ntru and small, ntru requires TLS which small turns off.]) -fi # SNI AC_ARG_ENABLE([sni], @@ -2759,6 +2764,7 @@ echo " * MD4: $ENABLED_MD4" echo " * PSK: $ENABLED_PSK" echo " * Poly1305: $ENABLED_POLY1305" echo " * LEANPSK: $ENABLED_LEANPSK" +echo " * LEANTLS: $ENABLED_LEANTLS" echo " * RSA: $ENABLED_RSA" echo " * DSA: $ENABLED_DSA" echo " * DH: $ENABLED_DH" diff --git a/src/internal.c b/src/internal.c index 7cebc84d4..b5023a9f9 100644 --- a/src/internal.c +++ b/src/internal.c @@ -142,10 +142,9 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz, #ifndef NO_CERTS static int BuildCertHashes(WOLFSSL* ssl, Hashes* hashes); -#endif - static void PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz); +#endif #ifdef HAVE_QSH int QSH_Init(WOLFSSL* ssl); @@ -10594,7 +10593,7 @@ int SetCipherList(Suites* suites, const char* list) return ret; } - +#ifndef NO_CERTS static void PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz) { @@ -10630,7 +10629,7 @@ static void PickHashSigAlgo(WOLFSSL* ssl, } } } - +#endif #ifdef WOLFSSL_CALLBACKS diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index d63806f5b..c65e3c713 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4908,7 +4908,7 @@ int ParseCert(DecodedCert* cert, int type, int verify, void* cm) #endif -#ifdef WOLFCRYPT_ONLY +#if defined(WOLFCRYPT_ONLY) || defined(NO_CERTS) /* dummy functions, not using wolfSSL so don't need actual ones */ Signer* GetCA(void* signers, byte* hash) @@ -4927,7 +4927,7 @@ Signer* GetCAByName(void* signers, byte* hash) } #endif /* NO_SKID */ -#endif /* WOLFCRYPT_ONLY */ +#endif /* WOLFCRYPT_ONLY || NO_CERTS */ #ifndef NO_ASN_TIME int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm) From 2891939098cb8e8999a2c85256242a990863257d Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 22 Feb 2016 10:11:41 +0100 Subject: [PATCH 038/192] Remove NO_CERT and NO_CODING. Enable building of the client with leantls. --- configure.ac | 10 +++++----- examples/client/client.c | 13 ++++++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 4150b8439..ba5d74147 100644 --- a/configure.ac +++ b/configure.ac @@ -265,7 +265,7 @@ AC_ARG_ENABLE([leantls], if test "$ENABLED_LEANTLS" = "yes" then - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LEANTLS -DNO_FILESYSTEM -DNO_WRITEV -DHAVE_ECC -DTFM_ECC256 -DECC_USER_CURVES -DNO_WOLFSSL_SERVER -DNO_RABBIT -DNO_RSA -DNO_DSA -DNO_DH -DNO_CERTS -DNO_PWDBASED -DNO_DES3 -DNO_MD5 -DNO_ERROR_STRINGS -DNO_OLD_TLS -DNO_RC4 -DNO_SESSION_CACHE -DNO_SHA -DUSE_SLOW_SHA -DUSE_SLOW_SHA2 -DNO_PSK -DNO_WOLFSSL_MEMORY -DNO_CODING" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LEANTLS -DNO_WRITEV -DHAVE_ECC -DTFM_ECC256 -DECC_USER_CURVES -DNO_WOLFSSL_SERVER -DNO_RABBIT -DNO_RSA -DNO_DSA -DNO_DH -DNO_PWDBASED -DNO_DES3 -DNO_MD5 -DNO_ERROR_STRINGS -DNO_OLD_TLS -DNO_RC4 -DNO_SESSION_CACHE -DNO_SHA -DUSE_SLOW_SHA -DUSE_SLOW_SHA2 -DNO_PSK -DNO_WOLFSSL_MEMORY" fi AM_CONDITIONAL([BUILD_LEANTLS], [test "x$ENABLED_LEANTLS" = "xyes"]) @@ -1124,8 +1124,8 @@ if test "$ENABLED_CODING" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_CODING" else - # turn off CODING if leanpsk or leantls on - if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" + # turn off CODING if leanpsk on + if test "$ENABLED_LEANPSK" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_CODING" ENABLED_CODING=no @@ -1415,8 +1415,8 @@ if test "$ENABLED_FILESYSTEM" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM" else - # turn off filesystem if leanpsk or leantls on - if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" + # turn off filesystem if leanpsk on + if test "$ENABLED_LEANPSK" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM" ENABLED_FILESYSTEM=no diff --git a/examples/client/client.c b/examples/client/client.c index 021e97958..57f0a212d 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -148,11 +148,16 @@ int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, /* time passed in number of connects give average */ int times = benchmark; int loops = resumeSession ? 2 : 1; - int i = 0; + int i = 0; +#ifndef NO_SESSION_CACHE WOLFSSL_SESSION* benchSession = NULL; +#endif + (void)resumeSession; while (loops--) { + #ifndef NO_SESSION_CACHE int benchResume = resumeSession && loops == 0; + #endif double start = current_time(), avg; for (i = 0; i < times; i++) { @@ -163,25 +168,31 @@ int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, tcp_connect(&sockfd, host, port, doDTLS, ssl); + #ifndef NO_SESSION_CACHE if (benchResume) wolfSSL_set_session(ssl, benchSession); + #endif wolfSSL_set_fd(ssl, sockfd); if (wolfSSL_connect(ssl) != SSL_SUCCESS) err_sys("SSL_connect failed"); wolfSSL_shutdown(ssl); + #ifndef NO_SESSION_CACHE if (i == (times-1) && resumeSession) { benchSession = wolfSSL_get_session(ssl); } + #endif wolfSSL_free(ssl); CloseSocket(sockfd); } avg = current_time() - start; avg /= times; avg *= 1000; /* milliseconds */ + #ifndef NO_SESSION_CACHE if (benchResume) printf("wolfSSL_resume avg took: %8.3f milliseconds\n", avg); else + #endif printf("wolfSSL_connect avg took: %8.3f milliseconds\n", avg); } From 0ed26ad26233b17dcb9f358e1264d74b8cde11f7 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 26 Feb 2016 15:30:11 +0100 Subject: [PATCH 039/192] Updated build for "leantls" to support building only the client, by splitting BUILD_EXAMPLES into 3 parts (BUILD_EXAPLE_SERVERS, BUILD_EXAMPLE_CLIENTS and BUILD_TESTS). This allows the make check to perform the external tests to validate the client only "leantls" configuration option. --- configure.ac | 4 +++- examples/client/include.am | 2 +- examples/echoclient/include.am | 2 +- examples/echoserver/include.am | 2 +- examples/server/include.am | 2 +- scripts/include.am | 16 +++++++++------- tests/include.am | 2 +- testsuite/include.am | 2 +- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index ba5d74147..1bf5b8eb2 100644 --- a/configure.ac +++ b/configure.ac @@ -2242,7 +2242,9 @@ AC_ARG_ENABLE([examples], AS_IF([test "x$ENABLED_FILESYSTEM" = "xno"], [ENABLED_EXAMPLES="no"]) AS_IF([test "x$ENABLED_INLINE" = "xno"], [ENABLED_EXAMPLES="no"]) AS_IF([test "x$ENABLED_CRYPTONLY" = "xyes"], [ENABLED_EXAMPLES="no"]) -AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$ENABLED_EXAMPLES" = "xyes"]) +AM_CONDITIONAL([BUILD_EXAMPLE_SERVERS], [test "x$ENABLED_EXAMPLES" = "xyes" && test "x$ENABLED_LEANTLS" = "xno"]) +AM_CONDITIONAL([BUILD_EXAMPLE_CLIENTS], [test "x$ENABLED_EXAMPLES" = "xyes"]) +AM_CONDITIONAL([BUILD_TESTS], [test "x$ENABLED_EXAMPLES" = "xyes" && test "x$ENABLED_LEANTLS" = "xno"]) # Enable wolfCrypt test and benchmark AC_ARG_ENABLE([crypttests], diff --git a/examples/client/include.am b/examples/client/include.am index 862cdfa08..876f6a28e 100644 --- a/examples/client/include.am +++ b/examples/client/include.am @@ -1,7 +1,7 @@ # vim:ft=automake # All paths should be given relative to the root -if BUILD_EXAMPLES +if BUILD_EXAMPLE_CLIENTS noinst_PROGRAMS += examples/client/client noinst_HEADERS += examples/client/client.h examples_client_client_SOURCES = examples/client/client.c diff --git a/examples/echoclient/include.am b/examples/echoclient/include.am index f0d5868c2..7f0bc47d1 100644 --- a/examples/echoclient/include.am +++ b/examples/echoclient/include.am @@ -3,7 +3,7 @@ # All paths should be given relative to the root -if BUILD_EXAMPLES +if BUILD_EXAMPLE_CLIENTS noinst_PROGRAMS += examples/echoclient/echoclient noinst_HEADERS += examples/echoclient/echoclient.h examples_echoclient_echoclient_SOURCES = examples/echoclient/echoclient.c diff --git a/examples/echoserver/include.am b/examples/echoserver/include.am index 767da6c46..516c40441 100644 --- a/examples/echoserver/include.am +++ b/examples/echoserver/include.am @@ -3,7 +3,7 @@ # All paths should be given relative to the root -if BUILD_EXAMPLES +if BUILD_EXAMPLE_SERVERS noinst_PROGRAMS += examples/echoserver/echoserver noinst_HEADERS += examples/echoserver/echoserver.h examples_echoserver_echoserver_SOURCES = examples/echoserver/echoserver.c diff --git a/examples/server/include.am b/examples/server/include.am index f42490591..8a3d75119 100644 --- a/examples/server/include.am +++ b/examples/server/include.am @@ -3,7 +3,7 @@ # All paths should be given relative to the root -if BUILD_EXAMPLES +if BUILD_EXAMPLE_SERVERS noinst_PROGRAMS += examples/server/server noinst_HEADERS += examples/server/server.h examples_server_server_SOURCES = examples/server/server.c diff --git a/scripts/include.am b/scripts/include.am index 5866a554e..19e05feaf 100644 --- a/scripts/include.am +++ b/scripts/include.am @@ -8,7 +8,7 @@ if BUILD_SNIFFTEST dist_noinst_SCRIPTS+= scripts/sniffer-testsuite.test endif -if BUILD_EXAMPLES +if BUILD_EXAMPLE_SERVERS dist_noinst_SCRIPTS+= scripts/resume.test EXTRA_DIST+= scripts/benchmark.test @@ -19,12 +19,6 @@ dist_noinst_SCRIPTS+= scripts/crl-revoked.test scripts/crl-revoked.log: scripts/resume.log endif -if !BUILD_IPV6 -dist_noinst_SCRIPTS+= scripts/external.test -dist_noinst_SCRIPTS+= scripts/google.test -#dist_noinst_SCRIPTS+= scripts/openssl.test -endif - if BUILD_OCSP dist_noinst_SCRIPTS+= scripts/ocsp.test endif @@ -47,6 +41,14 @@ endif endif +if BUILD_EXAMPLE_CLIENTS +if !BUILD_IPV6 +dist_noinst_SCRIPTS+= scripts/external.test +dist_noinst_SCRIPTS+= scripts/google.test +#dist_noinst_SCRIPTS+= scripts/openssl.test +endif +endif + if BUILD_PSK dist_noinst_SCRIPTS+= scripts/psk.test endif diff --git a/tests/include.am b/tests/include.am index e0a82a405..63768e663 100644 --- a/tests/include.am +++ b/tests/include.am @@ -3,7 +3,7 @@ # All paths should be given relative to the root -if BUILD_EXAMPLES +if BUILD_TESTS check_PROGRAMS += tests/unit.test noinst_PROGRAMS += tests/unit.test tests_unit_test_SOURCES = \ diff --git a/testsuite/include.am b/testsuite/include.am index 86b6f9784..ed2604427 100644 --- a/testsuite/include.am +++ b/testsuite/include.am @@ -3,7 +3,7 @@ # All paths should be given relative to the root -if BUILD_EXAMPLES +if BUILD_TESTS check_PROGRAMS += testsuite/testsuite.test noinst_PROGRAMS += testsuite/testsuite.test testsuite_testsuite_test_SOURCES = \ From daa1cd634ea38b29f1cc322d21424af349827ca6 Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 7 Mar 2016 15:01:07 -0800 Subject: [PATCH 040/192] Fixes scan-build warning with "--enable-opensslextra --disable-memory". Problem was different #if defines on the InitX509 and FreeX509, which caused the static analyzer to think the "x509->dynamicMemory" was always true. --- src/internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 7cebc84d4..91caeeb3f 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1923,7 +1923,7 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx) ssl->buffers.outputBuffer.buffer = ssl->buffers.outputBuffer.staticBuffer; ssl->buffers.outputBuffer.bufferSize = STATIC_BUFFER_LEN; -#ifdef KEEP_PEER_CERT +#if defined(KEEP_PEER_CERT) || defined(GOAHEAD_WS) InitX509(&ssl->peerCert, 0); #endif @@ -2204,7 +2204,7 @@ void SSL_ResourceFree(WOLFSSL* ssl) nx_packet_release(ssl->nxCtx.nxPacket); #endif #if defined(KEEP_PEER_CERT) || defined(GOAHEAD_WS) - FreeX509(&(ssl->peerCert)); /* clang thinks this frees ssl itslef */ + FreeX509(&ssl->peerCert); #endif } From ce9f14f71354d3c17c40e1e8a8e20e03acd35ed3 Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 7 Mar 2016 17:02:12 -0800 Subject: [PATCH 041/192] Refactor of DerBuffer, so WOLFSSL object doesn't have to grow as a result of additional functionality. Removed InitDer. Changed all DerBuffers to use pointer and pass pointer to DerBuffer* to AllocDer and FreeDer. Result is more efficient code and reduced WOLFSSL object size. AllocDer uses first part of the allocated buffer for the actual DerBuffer. --- src/crl.c | 11 +- src/internal.c | 123 ++++++++-------- src/ssl.c | 339 ++++++++++++++++++++------------------------- wolfssl/internal.h | 23 ++- 4 files changed, 223 insertions(+), 273 deletions(-) diff --git a/src/crl.c b/src/crl.c index b39e2e77f..dde30a28e 100644 --- a/src/crl.c +++ b/src/crl.c @@ -263,7 +263,7 @@ int BufferLoadCRL(WOLFSSL_CRL* crl, const byte* buff, long sz, int type) { int ret = SSL_SUCCESS; const byte* myBuffer = buff; /* if DER ok, otherwise switch */ - DerBuffer der; + DerBuffer* der = NULL; #ifdef WOLFSSL_SMALL_STACK DecodedCRL* dcrl; #else @@ -275,11 +275,6 @@ int BufferLoadCRL(WOLFSSL_CRL* crl, const byte* buff, long sz, int type) if (crl == NULL || buff == NULL || sz == 0) return BAD_FUNC_ARG; - ret = InitDer(&der); - if (ret < 0) { - return ret; - } - if (type == SSL_FILETYPE_PEM) { int eccKey = 0; /* not used */ EncryptedInfo info; @@ -287,8 +282,8 @@ int BufferLoadCRL(WOLFSSL_CRL* crl, const byte* buff, long sz, int type) ret = PemToDer(buff, sz, CRL_TYPE, &der, NULL, &info, &eccKey); if (ret == 0) { - myBuffer = der.buffer; - sz = der.length; + myBuffer = der->buffer; + sz = der->length; } else { WOLFSSL_MSG("Pem to Der failed"); diff --git a/src/internal.c b/src/internal.c index 7cebc84d4..eadc88134 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1643,7 +1643,7 @@ void InitX509(WOLFSSL_X509* x509, int dynamicFlag) x509->version = 0; x509->pubKey.buffer = NULL; x509->sig.buffer = NULL; - InitDer(&x509->derCert); + x509->derCert = NULL; x509->altNames = NULL; x509->altNamesNext = NULL; x509->dynamicMemory = (byte)dynamicFlag; @@ -1861,9 +1861,9 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx) #ifndef NO_CERTS /* ctx still owns certificate, certChain, key, dh, and cm */ - XMEMCPY(&ssl->buffers.certificate, &ctx->certificate, sizeof(DerBuffer)); - XMEMCPY(&ssl->buffers.certChain, &ctx->certChain, sizeof(DerBuffer)); - XMEMCPY(&ssl->buffers.key, &ctx->privateKey, sizeof(DerBuffer)); + ssl->buffers.certificate = ctx->certificate; + ssl->buffers.certChain = ctx->certChain; + ssl->buffers.key = ctx->privateKey; #endif #ifdef HAVE_CAVIUM @@ -1898,7 +1898,8 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx) /* make sure server has cert and key unless using PSK or Anon * This should be true even if just switching ssl ctx */ if (ssl->options.side == WOLFSSL_SERVER_END && !havePSK && !haveAnon) - if (!ssl->buffers.certificate.buffer || !ssl->buffers.key.buffer) { + if (!ssl->buffers.certificate || !ssl->buffers.certificate->buffer || + !ssl->buffers.key || !ssl->buffers.key->buffer) { WOLFSSL_MSG("Server missing certificate and/or private key"); return NO_PRIVATE_KEY; } @@ -4472,7 +4473,7 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert) /* store cert for potential retrieval */ if (AllocDer(&x509->derCert, dCert->maxIdx, CERT_TYPE, NULL) == 0) { - XMEMCPY(x509->derCert.buffer, dCert->source, dCert->maxIdx); + XMEMCPY(x509->derCert->buffer, dCert->source, dCert->maxIdx); } else { ret = MEMORY_E; @@ -4544,7 +4545,7 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, int anyError = 0; int totalCerts = 0; /* number of certs in certs buffer */ int count; - DerBuffer certs[MAX_CHAIN_DEPTH]; + buffer certs[MAX_CHAIN_DEPTH]; #ifdef WOLFSSL_SMALL_STACK char* domain = NULL; @@ -4591,10 +4592,6 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, if ((*inOutIdx - begin) + certSz > size) return BUFFER_ERROR; - ret = InitDer(&certs[totalCerts]); - if (ret < 0) { - return 0; - } certs[totalCerts].length = certSz; certs[totalCerts].buffer = input + *inOutIdx; @@ -4628,7 +4625,7 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, /* verify up to peer's first */ while (count > 1) { - DerBuffer myCert = certs[count - 1]; + buffer myCert = certs[count - 1]; byte* subjectHash; InitDecodedCert(dCert, myCert.buffer, myCert.length, ssl->heap); @@ -4647,11 +4644,8 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, WOLFSSL_MSG("Chain cert not verified by option, not adding as CA"); } else if (ret == 0 && !AlreadySigner(ssl->ctx->cm, subjectHash)) { - DerBuffer add; - ret = InitDer(&add); - if (ret == 0) { - ret = AllocDer(&add, myCert.length, CA_TYPE, ssl->heap); - } + DerBuffer* add = NULL; + ret = AllocDer(&add, myCert.length, CA_TYPE, ssl->heap); if (ret < 0) { #ifdef WOLFSSL_SMALL_STACK XFREE(dCert, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -4661,7 +4655,7 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, WOLFSSL_MSG("Adding CA from chain"); - XMEMCPY(add.buffer, myCert.buffer, myCert.length); + XMEMCPY(add->buffer, myCert.buffer, myCert.length); /* already verified above */ ret = AddCA(ssl->ctx->cm, &add, WOLFSSL_CHAIN_CA, 0); @@ -4720,7 +4714,7 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, /* peer's, may not have one if blank client cert sent by TLSv1.2 */ if (count) { - DerBuffer myCert = certs[0]; + buffer myCert = certs[0]; int fatal = 0; WOLFSSL_MSG("Verifying Peer's cert"); @@ -8281,15 +8275,19 @@ int SendCertificate(WOLFSSL* ssl) listSz = 0; } else { - certSz = ssl->buffers.certificate.length; + if (!ssl->buffers.certificate) { + WOLFSSL_MSG("Send Cert missing certificate buffer"); + return BUFFER_ERROR; + } + certSz = ssl->buffers.certificate->length; headerSz = 2 * CERT_HEADER_SZ; /* list + cert size */ length = certSz + headerSz; listSz = certSz + CERT_HEADER_SZ; /* may need to send rest of chain, already has leading size(s) */ - if (certSz) { - certChainSz = ssl->buffers.certChain.length; + if (certSz && ssl->buffers.certChain) { + certChainSz = ssl->buffers.certChain->length; length += certChainSz; listSz += certChainSz; } @@ -8399,9 +8397,9 @@ int SendCertificate(WOLFSSL* ssl) fragSz -= CERT_HEADER_SZ; if (!IsEncryptionOn(ssl, 1)) { - HashOutputRaw(ssl, ssl->buffers.certificate.buffer, certSz); + HashOutputRaw(ssl, ssl->buffers.certificate->buffer, certSz); if (certChainSz) - HashOutputRaw(ssl, ssl->buffers.certChain.buffer, + HashOutputRaw(ssl, ssl->buffers.certChain->buffer, certChainSz); } } @@ -8423,7 +8421,7 @@ int SendCertificate(WOLFSSL* ssl) if (certSz && ssl->fragOffset < certSz) { word32 copySz = min(certSz - ssl->fragOffset, fragSz); XMEMCPY(output + i, - ssl->buffers.certificate.buffer + ssl->fragOffset, copySz); + ssl->buffers.certificate->buffer + ssl->fragOffset, copySz); i += copySz; ssl->fragOffset += copySz; length -= copySz; @@ -8432,7 +8430,7 @@ int SendCertificate(WOLFSSL* ssl) if (certChainSz && fragSz) { word32 copySz = min(certChainSz + certSz - ssl->fragOffset, fragSz); XMEMCPY(output + i, - ssl->buffers.certChain.buffer + ssl->fragOffset - certSz, + ssl->buffers.certChain->buffer + ssl->fragOffset - certSz, copySz); i += copySz; ssl->fragOffset += copySz; @@ -8714,7 +8712,7 @@ int SendCertificateStatus(WOLFSSL* ssl) return 0; if (!request || ssl->buffers.weOwnCert) { - DerBuffer der = ssl->buffers.certificate; + DerBuffer* der = ssl->buffers.certificate; #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; #else @@ -8722,7 +8720,7 @@ int SendCertificateStatus(WOLFSSL* ssl) #endif /* unable to fetch status. skip. */ - if (der.buffer == NULL || der.length == 0) + if (der->buffer == NULL || der->length == 0) return 0; #ifdef WOLFSSL_SMALL_STACK @@ -8732,7 +8730,7 @@ int SendCertificateStatus(WOLFSSL* ssl) return MEMORY_E; #endif - InitDecodedCert(cert, der.buffer, der.length, NULL); + InitDecodedCert(cert, der->buffer, der->length, NULL); if ((ret = ParseCertRelative(cert, CERT_TYPE, VERIFY, ssl->ctx->cm)) != 0) { @@ -8811,7 +8809,7 @@ int SendCertificateStatus(WOLFSSL* ssl) return 0; if (!request || ssl->buffers.weOwnCert) { - DerBuffer der = ssl->buffers.certificate; + DerBuffer* der = ssl->buffers.certificate; #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; #else @@ -8819,7 +8817,7 @@ int SendCertificateStatus(WOLFSSL* ssl) #endif /* unable to fetch status. skip. */ - if (der.buffer == NULL || der.length == 0) + if (der->buffer == NULL || der->length == 0) return 0; #ifdef WOLFSSL_SMALL_STACK @@ -8829,7 +8827,7 @@ int SendCertificateStatus(WOLFSSL* ssl) return MEMORY_E; #endif - InitDecodedCert(cert, der.buffer, der.length, NULL); + InitDecodedCert(cert, der->buffer, der->length, NULL); if ((ret = ParseCertRelative(cert, CERT_TYPE, VERIFY, ssl->ctx->cm)) != 0) { @@ -8884,7 +8882,7 @@ int SendCertificateStatus(WOLFSSL* ssl) if (ret == 0 && (!ssl->ctx->chainOcspRequest[0] || ssl->buffers.weOwnCertChain)) { - DerBuffer der; + DerBuffer* der = NULL; word32 idx = 0; #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; @@ -8892,11 +8890,6 @@ int SendCertificateStatus(WOLFSSL* ssl) DecodedCert cert[1]; #endif - ret = InitDer(&der); - if (ret < 0) { - return ret; - } - #ifdef WOLFSSL_SMALL_STACK cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -8904,17 +8897,17 @@ int SendCertificateStatus(WOLFSSL* ssl) return MEMORY_E; #endif - while (idx + OPAQUE24_LEN < ssl->buffers.certChain.length) { - c24to32(ssl->buffers.certChain.buffer + idx, &der.length); + while (idx + OPAQUE24_LEN < ssl->buffers.certChain->length) { + c24to32(ssl->buffers.certChain->buffer + idx, &der->length); idx += OPAQUE24_LEN; - der.buffer = ssl->buffers.certChain.buffer + idx; - idx += der.length; + der->buffer = ssl->buffers.certChain->buffer + idx; + idx += der->length; - if (idx > ssl->buffers.certChain.length) + if (idx > ssl->buffers.certChain->length) break; - InitDecodedCert(cert, der.buffer, der.length, NULL); + InitDecodedCert(cert, der->buffer, der->length, NULL); if ((ret = ParseCertRelative(cert, CERT_TYPE, VERIFY, ssl->ctx->cm)) != 0) { @@ -11351,7 +11344,8 @@ static void PickHashSigAlgo(WOLFSSL* ssl, /* don't send client cert or cert verify if user hasn't provided cert and private key */ - if (ssl->buffers.certificate.buffer && ssl->buffers.key.buffer) + if (ssl->buffers.certificate && ssl->buffers.certificate->buffer && + ssl->buffers.key && ssl->buffers.key->buffer) ssl->options.sendVerify = SEND_CERT; else if (IsTLS(ssl)) ssl->options.sendVerify = SEND_BLANK_CERT; @@ -13433,8 +13427,8 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) ret = wc_InitRsaKey(&key, ssl->heap); if (ret == 0) initRsaKey = 1; if (ret == 0) - ret = wc_RsaPrivateKeyDecode(ssl->buffers.key.buffer, &idx, &key, - ssl->buffers.key.length); + ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &idx, &key, + ssl->buffers.key->length); if (ret == 0) sigOutSz = wc_RsaEncryptSize(&key); else @@ -13442,10 +13436,15 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) { #ifdef HAVE_ECC WOLFSSL_MSG("Trying ECC client cert, RSA didn't work"); + + if (ssl->buffers.key == NULL) { + WOLFSSL_MSG("ECC Key missing"); + return NO_PRIVATE_KEY; + } idx = 0; - ret = wc_EccPrivateKeyDecode(ssl->buffers.key.buffer, &idx, &eccKey, - ssl->buffers.key.length); + ret = wc_EccPrivateKeyDecode(ssl->buffers.key->buffer, &idx, &eccKey, + ssl->buffers.key->length); if (ret == 0) { WOLFSSL_MSG("Using ECC client cert"); usingEcc = 1; @@ -14521,7 +14520,7 @@ int DoSessionTicket(WOLFSSL* ssl, /* sig length */ length += LENGTH_SZ; - if (!ssl->buffers.key.buffer) { + if (!ssl->buffers.key || !ssl->buffers.key->buffer) { #ifndef NO_RSA wc_FreeRsaKey(&rsaKey); #endif @@ -14533,8 +14532,8 @@ int DoSessionTicket(WOLFSSL* ssl, if (ssl->specs.sig_algo == rsa_sa_algo) { /* rsa sig size */ word32 i = 0; - ret = wc_RsaPrivateKeyDecode(ssl->buffers.key.buffer, &i, - &rsaKey, ssl->buffers.key.length); + ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &i, + &rsaKey, ssl->buffers.key->length); if (ret != 0) { goto done_a; } @@ -14545,8 +14544,8 @@ int DoSessionTicket(WOLFSSL* ssl, if (ssl->specs.sig_algo == ecc_dsa_sa_algo) { /* ecdsa sig size */ word32 i = 0; - ret = wc_EccPrivateKeyDecode(ssl->buffers.key.buffer, &i, - &dsaKey, ssl->buffers.key.length); + ret = wc_EccPrivateKeyDecode(ssl->buffers.key->buffer, &i, + &dsaKey, ssl->buffers.key->length); if (ret != 0) { goto done_a; } @@ -15183,12 +15182,12 @@ int DoSessionTicket(WOLFSSL* ssl, /* sig length */ length += LENGTH_SZ; - if (!ssl->buffers.key.buffer) { + if (!ssl->buffers.key || !ssl->buffers.key->buffer) { return NO_PRIVATE_KEY; } - ret = wc_RsaPrivateKeyDecode(ssl->buffers.key.buffer, &i, - &rsaKey, ssl->buffers.key.length); + ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &i, + &rsaKey, ssl->buffers.key->length); if (ret == 0) { sigSz = wc_RsaEncryptSize(&rsaKey); length += sigSz; @@ -16984,12 +16983,12 @@ int DoSessionTicket(WOLFSSL* ssl, return ret; } - if (!ssl->buffers.key.buffer) { + if (!ssl->buffers.key || !ssl->buffers.key->buffer) { return NO_PRIVATE_KEY; } - ret = wc_RsaPrivateKeyDecode(ssl->buffers.key.buffer, &idx, - &key, ssl->buffers.key.length); + ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &idx, + &key, ssl->buffers.key->length); if (ret == 0) { length = wc_RsaEncryptSize(&key); @@ -17271,8 +17270,8 @@ int DoSessionTicket(WOLFSSL* ssl, word32 i = 0; wc_ecc_init(&staticKey); - ret = wc_EccPrivateKeyDecode(ssl->buffers.key.buffer, &i, - &staticKey, ssl->buffers.key.length); + ret = wc_EccPrivateKeyDecode(ssl->buffers.key->buffer, &i, + &staticKey, ssl->buffers.key->length); if (ret == 0) { ret = wc_ecc_shared_secret(&staticKey, ssl->peerEccKey, diff --git a/src/ssl.c b/src/ssl.c index 8e788a4bf..1f4aaca08 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -1635,21 +1635,12 @@ int wolfSSL_GetHmacSize(WOLFSSL* ssl) #ifndef NO_CERTS -int InitDer(DerBuffer* der) +int AllocDer(DerBuffer** pDer, word32 length, int type, void* heap) { int ret = BAD_FUNC_ARG; - if (der) { - XMEMSET(der, 0, sizeof(DerBuffer)); - ret = 0; - } - return ret; -} - -int AllocDer(DerBuffer* der, word32 length, int type, void* heap) -{ - int ret = BAD_FUNC_ARG; - if (der) { + if (pDer) { int dynType = 0; + DerBuffer* der; /* Determine dynamic type */ switch (type) { @@ -1663,29 +1654,37 @@ int AllocDer(DerBuffer* der, word32 length, int type, void* heap) } /* Setup new buffer */ - der->type = type; - der->dynType = dynType; - der->heap = heap; - der->buffer = (byte*)XMALLOC(length, heap, dynType); - if (!der->buffer) { + *pDer = (DerBuffer*)XMALLOC(sizeof(DerBuffer) + length, heap, dynType); + if (*pDer == NULL) { return MEMORY_ERROR; } + + der = *pDer; + der->type = type; + der->dynType = dynType; /* Cache this for FreeDer */ + der->heap = heap; + der->buffer = (byte*)der + sizeof(DerBuffer); der->length = length; ret = 0; /* Success */ } return ret; } -void FreeDer(DerBuffer* der) +void FreeDer(DerBuffer** pDer) { - if (der && der->buffer) { + if (pDer && *pDer) + { + DerBuffer* der = (DerBuffer*)*pDer; + /* ForceZero private keys */ if (der->type == PRIVATEKEY_TYPE) { ForceZero(der->buffer, der->length); } - XFREE(der->buffer, der->heap, der->dynType); der->buffer = NULL; der->length = 0; + XFREE(der, der->heap, der->dynType); + + *pDer = NULL; } } @@ -1763,7 +1762,7 @@ int wolfSSL_CertPemToDer(const unsigned char* pem, int pemSz, { int eccKey = 0; int ret; - DerBuffer der; + DerBuffer* der = NULL; #ifdef WOLFSSL_SMALL_STACK EncryptedInfo* info = NULL; #else @@ -1782,11 +1781,6 @@ int wolfSSL_CertPemToDer(const unsigned char* pem, int pemSz, return BAD_FUNC_ARG; } - ret = InitDer(&der); - if (ret < 0) { - return ret; - } - #ifdef WOLFSSL_SMALL_STACK info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -1808,9 +1802,9 @@ int wolfSSL_CertPemToDer(const unsigned char* pem, int pemSz, WOLFSSL_MSG("Bad Pem To Der"); } else { - if (der.length <= (word32)buffSz) { - XMEMCPY(buff, der.buffer, der.length); - ret = der.length; + if (der->length <= (word32)buffSz) { + XMEMCPY(buff, der->buffer, der->length); + ret = der->length; } else { WOLFSSL_MSG("Bad der length"); @@ -1867,7 +1861,7 @@ int wolfSSL_KeyPemToDer(const unsigned char* pem, int pemSz, { int eccKey = 0; int ret; - DerBuffer der; + DerBuffer* der = NULL; #ifdef WOLFSSL_SMALL_STACK EncryptedInfo* info = NULL; #else @@ -1881,11 +1875,6 @@ int wolfSSL_KeyPemToDer(const unsigned char* pem, int pemSz, return BAD_FUNC_ARG; } - ret = InitDer(&der); - if (ret < 0) { - return ret; - } - #ifdef WOLFSSL_SMALL_STACK info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -1927,9 +1916,9 @@ int wolfSSL_KeyPemToDer(const unsigned char* pem, int pemSz, WOLFSSL_MSG("Bad Pem To Der"); } else { - if (der.length <= (word32)buffSz) { - XMEMCPY(buff, der.buffer, der.length); - ret = der.length; + if (der->length <= (word32)buffSz) { + XMEMCPY(buff, der->buffer, der->length); + ret = der->length; } else { WOLFSSL_MSG("Bad der length"); @@ -2248,7 +2237,7 @@ Signer* GetCAByName(void* vp, byte* hash) /* owns der, internal now uses too */ /* type flag ids from user or from chain received during verify don't allow chain ones to be added w/o isCA extension */ -int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int type, int verify) +int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify) { int ret; Signer* signer = 0; @@ -2259,6 +2248,7 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int type, int verify) #else DecodedCert cert[1]; #endif + DerBuffer* der = *pDer; WOLFSSL_MSG("Adding a CA"); @@ -2354,7 +2344,7 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int type, int verify) XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif WOLFSSL_MSG(" Freeing der CA"); - FreeDer(der); + FreeDer(pDer); WOLFSSL_MSG(" OK Freeing der CA"); WOLFSSL_LEAVE("AddCA", ret); @@ -2630,7 +2620,7 @@ static int wolfssl_encrypt_buffer_key(byte* der, word32 derSz, byte* password, /* Remove PEM header/footer, convert to ASN1, store any encrypted data info->consumed tracks of PEM bytes consumed in case multiple parts */ int PemToDer(const unsigned char* buff, long longSz, int type, - DerBuffer* der, void* heap, EncryptedInfo* info, int* eccKey) + DerBuffer** pDer, void* heap, EncryptedInfo* info, int* eccKey) { const char* header = NULL; const char* footer = NULL; @@ -2642,6 +2632,7 @@ int PemToDer(const unsigned char* buff, long longSz, int type, int ret = 0; int sz = (int)longSz; int encrypted_key = 0; + DerBuffer* der; WOLFSSL_ENTER("PemToDer"); @@ -2778,10 +2769,11 @@ int PemToDer(const unsigned char* buff, long longSz, int type, if (neededSz > sz || neededSz < 0) return SSL_BAD_FILE; - ret = AllocDer(der, (word32)neededSz, type, heap); + ret = AllocDer(pDer, (word32)neededSz, type, heap); if (ret < 0) { return ret; } + der = *pDer; if (Base64_Decode((byte*)headerEnd, (word32)neededSz, der->buffer, &der->length) < 0) @@ -2823,7 +2815,6 @@ int PemToDer(const unsigned char* buff, long longSz, int type, XFREE(password, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif if (ret < 0) { - FreeDer(der); return ret; } @@ -2837,7 +2828,6 @@ int PemToDer(const unsigned char* buff, long longSz, int type, XFREE(password, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif if (ret != SSL_SUCCESS) { - FreeDer(der); return ret; } } @@ -2855,7 +2845,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, long sz, int format, int type, WOLFSSL* ssl, long* used, int userChain) { - DerBuffer der; /* holds DER or RAW (for NTRU) */ + DerBuffer* der = NULL; /* holds DER or RAW (for NTRU) */ int ret; int eccKey = 0; int rsaKey = 0; @@ -2878,11 +2868,6 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, if (ctx == NULL && ssl == NULL) return BAD_FUNC_ARG; - ret = InitDer(&der); - if (ret < 0) { - return ret; - } - #ifdef WOLFSSL_SMALL_STACK info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), heap, DYNAMIC_TYPE_TMP_BUFFER); @@ -2939,30 +2924,28 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, WOLFSSL_MSG("Processing Cert Chain"); while (consumed < sz) { - DerBuffer part; + DerBuffer* part = NULL; info->consumed = 0; - ret = InitDer(&part); + + ret = PemToDer(buff + consumed, sz - consumed, type, &part, + heap, info, &eccKey); if (ret == 0) { - ret = PemToDer(buff + consumed, sz - consumed, type, &part, - heap, info, &eccKey); - if (ret == 0) { - gotOne = 1; - if ( (idx + part.length) > bufferSz) { - WOLFSSL_MSG(" Cert Chain bigger than buffer"); - ret = BUFFER_E; - } - else { - c32to24(part.length, &chainBuffer[idx]); - idx += CERT_HEADER_SZ; - XMEMCPY(&chainBuffer[idx], part.buffer,part.length); - idx += part.length; - consumed += info->consumed; - if (used) - *used += info->consumed; - } + gotOne = 1; + if ( (idx + part->length) > bufferSz) { + WOLFSSL_MSG(" Cert Chain bigger than buffer"); + ret = BUFFER_E; + } + else { + c32to24(part->length, &chainBuffer[idx]); + idx += CERT_HEADER_SZ; + XMEMCPY(&chainBuffer[idx], part->buffer, part->length); + idx += part->length; + consumed += info->consumed; + if (used) + *used += info->consumed; } - FreeDer(&part); } + FreeDer(&part); if (ret == SSL_NO_PEM_HEADER && gotOne) { WOLFSSL_MSG("We got one good PEM so stuff at end ok"); @@ -2992,14 +2975,14 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, } ret = AllocDer(&ssl->buffers.certChain, idx, type, heap); if (ret == 0) { - XMEMCPY(ssl->buffers.certChain.buffer, chainBuffer, idx); + XMEMCPY(ssl->buffers.certChain->buffer, chainBuffer, idx); ssl->buffers.weOwnCertChain = 1; } } else if (ctx) { FreeDer(&ctx->certChain); ret = AllocDer(&ctx->certChain, idx, type, heap); if (ret == 0) { - XMEMCPY(ctx->certChain.buffer, chainBuffer, idx); + XMEMCPY(ctx->certChain->buffer, chainBuffer, idx); } } } @@ -3025,7 +3008,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, return ret; } - XMEMCPY(der.buffer, buff, sz); + XMEMCPY(der->buffer, buff, sz); } #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) @@ -3053,7 +3036,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, 0, ctx->userdata); /* decrypt the key */ - ret = wolfssl_decrypt_buffer_key(&der, (byte*)password, + ret = wolfssl_decrypt_buffer_key(der, (byte*)password, passwordSz, info); } @@ -3138,7 +3121,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, ret = wc_InitRsaKey(key, 0); if (ret == 0) { - if (wc_RsaPrivateKeyDecode(der.buffer, &idx, key, der.length) + if (wc_RsaPrivateKeyDecode(der->buffer, &idx, key, der->length) != 0) { #ifdef HAVE_ECC /* could have DER ECC (or pkcs8 ecc), no easy way to tell */ @@ -3169,7 +3152,8 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, ecc_key key; wc_ecc_init(&key); - if (wc_EccPrivateKeyDecode(der.buffer,&idx,&key,der.length) != 0) { + if (wc_EccPrivateKeyDecode(der->buffer, &idx, &key, + der->length) != 0) { wc_ecc_free(&key); return SSL_BAD_FILE; } @@ -3197,7 +3181,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, #endif WOLFSSL_MSG("Checking cert signature type"); - InitDecodedCert(cert, der.buffer, der.length, heap); + InitDecodedCert(cert, der->buffer, der->length, heap); if (DecodeToKey(cert, 0) < 0) { WOLFSSL_MSG("Decode to key failed"); @@ -3422,7 +3406,7 @@ int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, const byte* buff, long sz, int format) { int ret = 0; - DerBuffer der; + DerBuffer* der = NULL; #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; #else @@ -3431,11 +3415,6 @@ int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, const byte* buff, WOLFSSL_ENTER("wolfSSL_CertManagerVerifyBuffer"); - ret = InitDer(&der); - if (ret < 0) { - return ret; - } - #ifdef WOLFSSL_SMALL_STACK cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), cm->heap, DYNAMIC_TYPE_TMP_BUFFER); @@ -3465,7 +3444,7 @@ int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, const byte* buff, info->consumed = 0; ret = PemToDer(buff, sz, CERT_TYPE, &der, cm->heap, info, &eccKey); - InitDecodedCert(cert, der.buffer, der.length, cm->heap); + InitDecodedCert(cert, der->buffer, der->length, cm->heap); #ifdef WOLFSSL_SMALL_STACK XFREE(info, cm->heap, DYNAMIC_TYPE_TMP_BUFFER); @@ -4240,7 +4219,7 @@ int wolfSSL_PemCertToDer(const char* fileName, unsigned char* derBuf, int derSz) int ecc = 0; long sz = 0; XFILE file = XFOPEN(fileName, "rb"); - DerBuffer converted; + DerBuffer* converted = NULL; WOLFSSL_ENTER("wolfSSL_PemCertToDer"); @@ -4264,39 +4243,36 @@ int wolfSSL_PemCertToDer(const char* fileName, unsigned char* derBuf, int derSz) } if (ret == 0) { - ret = InitDer(&converted); - if (ret == 0) { - if ( (ret = (int)XFREAD(fileBuf, sz, 1, file)) < 0) { - ret = SSL_BAD_FILE; - } - else { - #ifdef WOLFSSL_SMALL_STACK - info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (info == NULL) - ret = MEMORY_E; - else - #endif - { - ret = PemToDer(fileBuf, sz, CA_TYPE, &converted, - 0, info, &ecc); - #ifdef WOLFSSL_SMALL_STACK - XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - } - } - - if (ret == 0) { - if (converted.length < (word32)derSz) { - XMEMCPY(derBuf, converted.buffer, converted.length); - ret = converted.length; - } - else - ret = BUFFER_E; - } - - FreeDer(&converted); + if ( (ret = (int)XFREAD(fileBuf, sz, 1, file)) < 0) { + ret = SSL_BAD_FILE; } + else { + #ifdef WOLFSSL_SMALL_STACK + info = (EncryptedInfo*)XMALLOC(sizeof(EncryptedInfo), NULL, + DYNAMIC_TYPE_TMP_BUFFER); + if (info == NULL) + ret = MEMORY_E; + else + #endif + { + ret = PemToDer(fileBuf, sz, CA_TYPE, &converted, + 0, info, &ecc); + #ifdef WOLFSSL_SMALL_STACK + XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); + #endif + } + } + + if (ret == 0) { + if (converted->length < (word32)derSz) { + XMEMCPY(derBuf, converted->buffer, converted->length); + ret = converted->length; + } + else + ret = BUFFER_E; + } + + FreeDer(&converted); } XFCLOSE(file); @@ -4325,7 +4301,7 @@ int wolfSSL_PemPubKeyToDer(const char* fileName, int ret = 0; long sz = 0; XFILE file = XFOPEN(fileName, "rb"); - DerBuffer converted; + DerBuffer* converted = NULL; WOLFSSL_ENTER("wolfSSL_PemPubKeyToDer"); @@ -4348,25 +4324,22 @@ int wolfSSL_PemPubKeyToDer(const char* fileName, dynamic = 1; } if (ret == 0) { - ret = InitDer(&converted); + if ( (ret = (int)XFREAD(fileBuf, sz, 1, file)) < 0) + ret = SSL_BAD_FILE; + else + ret = PemToDer(fileBuf, sz, PUBLICKEY_TYPE, &converted, + 0, NULL, NULL); + if (ret == 0) { - if ( (ret = (int)XFREAD(fileBuf, sz, 1, file)) < 0) - ret = SSL_BAD_FILE; - else - ret = PemToDer(fileBuf, sz, PUBLICKEY_TYPE, &converted, - 0, NULL, NULL); - - if (ret == 0) { - if (converted.length < (word32)derSz) { - XMEMCPY(derBuf, converted.buffer, converted.length); - ret = converted.length; - } - else - ret = BUFFER_E; + if (converted->length < (word32)derSz) { + XMEMCPY(derBuf, converted->buffer, converted->length); + ret = converted->length; } - - FreeDer(&converted); + else + ret = BUFFER_E; } + + FreeDer(&converted); } XFCLOSE(file); @@ -4382,8 +4355,8 @@ int wolfSSL_PemPubKeyToDer(const char* fileName, int wolfSSL_PubKeyPemToDer(const unsigned char* pem, int pemSz, unsigned char* buff, int buffSz) { - int ret; - DerBuffer der; + int ret; + DerBuffer* der = NULL; WOLFSSL_ENTER("wolfSSL_PubKeyPemToDer"); @@ -4392,19 +4365,14 @@ int wolfSSL_PubKeyPemToDer(const unsigned char* pem, int pemSz, return BAD_FUNC_ARG; } - ret = InitDer(&der); - if (ret < 0) { - return ret; - } - ret = PemToDer(pem, pemSz, PUBLICKEY_TYPE, &der, NULL, NULL, NULL); if (ret < 0) { WOLFSSL_MSG("Bad Pem To Der"); } else { - if (der.length <= (word32)buffSz) { - XMEMCPY(buff, der.buffer, der.length); - ret = der.length; + if (der->length <= (word32)buffSz) { + XMEMCPY(buff, der->buffer, der->length); + ret = der->length; } else { WOLFSSL_MSG("Bad der length"); @@ -6160,9 +6128,11 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl, #ifndef NO_CERTS /* in case used set_accept_state after init */ - if (!havePSK && !haveAnon && - (ssl->buffers.certificate.buffer == NULL || - ssl->buffers.key.buffer == NULL)) { + if (!havePSK && !haveAnon && + (!ssl->buffers.certificate || + !ssl->buffers.certificate->buffer || + !ssl->buffers.key || + !ssl->buffers.key->buffer)) { WOLFSSL_MSG("accept error: don't have server cert and key"); ssl->error = NO_PRIVATE_KEY; WOLFSSL_ERROR(ssl->error); @@ -7414,9 +7384,8 @@ int wolfSSL_set_compression(WOLFSSL* ssl) const unsigned char* buf, long sz, int format) { - DerBuffer der; + DerBuffer* der = NULL; int ret = 0; - int weOwnDer = 0; word32 pSz = MAX_DH_SIZE; word32 gSz = MAX_DH_SIZE; #ifdef WOLFSSL_SMALL_STACK @@ -7430,8 +7399,12 @@ int wolfSSL_set_compression(WOLFSSL* ssl) if (ctx == NULL || buf == NULL) return BAD_FUNC_ARG; - der.buffer = (byte*)buf; - der.length = (word32)sz; + ret = AllocDer(&der, 0, DH_PARAM_TYPE, ctx->heap); + if (ret != 0) { + return ret; + } + der->buffer = (byte*)buf; + der->length = (word32)sz; #ifdef WOLFSSL_SMALL_STACK p = (byte*)XMALLOC(pSz, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -7448,16 +7421,13 @@ int wolfSSL_set_compression(WOLFSSL* ssl) ret = SSL_BAD_FILETYPE; else { if (format == SSL_FILETYPE_PEM) { - ret = InitDer(&der); - if (ret == 0) { - ret = PemToDer(buf, sz, DH_PARAM_TYPE, &der, ctx->heap, - NULL, NULL); - weOwnDer = 1; - } + FreeDer(&der); + ret = PemToDer(buf, sz, DH_PARAM_TYPE, &der, ctx->heap, + NULL, NULL); } if (ret == 0) { - if (wc_DhParamsLoad(der.buffer, der.length, p, &pSz, g, &gSz) < 0) + if (wc_DhParamsLoad(der->buffer, der->length, p, &pSz, g, &gSz) < 0) ret = SSL_BAD_FILETYPE; else if (ssl) ret = wolfSSL_SetTmpDH(ssl, p, pSz, g, gSz); @@ -7466,8 +7436,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) } } - if (weOwnDer) - FreeDer(&der); + FreeDer(&der); #ifdef WOLFSSL_SMALL_STACK XFREE(p, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -9796,8 +9765,8 @@ static void ExternalFreeX509(WOLFSSL_X509* x509) if (x509 == NULL || outSz == NULL) return NULL; - *outSz = (int)x509->derCert.length; - return x509->derCert.buffer; + *outSz = (int)x509->derCert->length; + return x509->derCert->buffer; } @@ -10011,7 +9980,7 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) XFILE file; WOLFSSL_X509* x509 = NULL; - DerBuffer der; + DerBuffer* der = NULL; WOLFSSL_ENTER("wolfSSL_X509_load_certificate"); @@ -10020,11 +9989,6 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM)) return NULL; - ret = InitDer(&der); - if (ret < 0) { - return NULL; - } - file = XFOPEN(fname, "rb"); if (file == XBADFILE) return NULL; @@ -10090,7 +10054,7 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) else { ret = AllocDer(&der, (word32)sz, CERT_TYPE, NULL); if (ret == 0) { - XMEMCPY(der.buffer, fileBuffer, sz); + XMEMCPY(der->buffer, fileBuffer, sz); } } @@ -10099,7 +10063,7 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) /* At this point we want `der` to have the certificate in DER format */ /* ready to be decoded. */ - if (der.buffer != NULL) { + if (der->buffer != NULL) { #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; #else @@ -10112,7 +10076,7 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) if (cert != NULL) #endif { - InitDecodedCert(cert, der.buffer, der.length, NULL); + InitDecodedCert(cert, der->buffer, der->length, NULL); if (ParseCertRelative(cert, CERT_TYPE, 0, NULL) == 0) { x509 = (WOLFSSL_X509*)XMALLOC(sizeof(WOLFSSL_X509), NULL, DYNAMIC_TYPE_X509); @@ -10899,19 +10863,17 @@ int wolfSSL_X509_STORE_add_cert(WOLFSSL_X509_STORE* store, WOLFSSL_X509* x509) int result = SSL_FATAL_ERROR; WOLFSSL_ENTER("wolfSSL_X509_STORE_add_cert"); - if (store != NULL && store->cm != NULL && x509 != NULL) { - DerBuffer derCert; + if (store != NULL && store->cm != NULL && x509 != NULL + && x509->derCert != NULL) { + DerBuffer* derCert = NULL; - result = InitDer(&derCert); + result = AllocDer(&derCert, x509->derCert->length, + x509->derCert->type, NULL); if (result == 0) { - result = AllocDer(&derCert, x509->derCert.length, - x509->derCert.type, NULL); - if (result == 0) { - /* AddCA() frees the buffer. */ - XMEMCPY(derCert.buffer, - x509->derCert.buffer, x509->derCert.length); - result = AddCA(store->cm, &derCert, WOLFSSL_USER_CA, 1); - } + /* AddCA() frees the buffer. */ + XMEMCPY(derCert->buffer, + x509->derCert->buffer, x509->derCert->length); + result = AddCA(store->cm, &derCert, WOLFSSL_USER_CA, 1); } } @@ -11024,10 +10986,10 @@ void wolfSSL_X509_STORE_CTX_cleanup(WOLFSSL_X509_STORE_CTX* ctx) int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX* ctx) { if (ctx != NULL && ctx->store != NULL && ctx->store->cm != NULL - && ctx->current_cert != NULL) { + && ctx->current_cert != NULL && ctx->current_cert->derCert != NULL) { return wolfSSL_CertManagerVerifyBuffer(ctx->store->cm, - ctx->current_cert->derCert.buffer, - ctx->current_cert->derCert.length, + ctx->current_cert->derCert->buffer, + ctx->current_cert->derCert->length, SSL_FILETYPE_ASN1); } return SSL_FATAL_ERROR; @@ -11481,12 +11443,7 @@ int wolfSSL_cmp_peer_cert_to_file(WOLFSSL* ssl, const char *fname) int eccKey = 0; WOLFSSL_CTX* ctx = ssl->ctx; WOLFSSL_X509* peer_cert = &ssl->peerCert; - DerBuffer fileDer; - - ret = InitDer(&fileDer); - if (ret < 0) { - return ret; - } + DerBuffer* fileDer = NULL; file = XFOPEN(fname, "rb"); if (file == XBADFILE) diff --git a/wolfssl/internal.h b/wolfssl/internal.h index fb9c40471..afc5dc80d 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1818,10 +1818,10 @@ struct WOLFSSL_CTX { buffer serverDH_G; #endif #ifndef NO_CERTS - DerBuffer certificate; - DerBuffer certChain; + DerBuffer* certificate; + DerBuffer* certChain; /* chain after self, in DER, with leading size for each cert */ - DerBuffer privateKey; + DerBuffer* privateKey; WOLFSSL_CERT_MANAGER* cm; /* our cert manager, ctx owns SSL will use */ #endif Suites* suites; /* make dynamic, user may not need/set */ @@ -1931,7 +1931,7 @@ int ProcessOldClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx, word32 inSz, word16 sz); #ifndef NO_CERTS WOLFSSL_LOCAL - int AddCA(WOLFSSL_CERT_MANAGER* ctx, DerBuffer* der, int type, int verify); + int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify); WOLFSSL_LOCAL int AlreadySigner(WOLFSSL_CERT_MANAGER* cm, byte* hash); #endif @@ -2193,9 +2193,9 @@ typedef struct Buffers { buffer serverDH_Priv; #endif #ifndef NO_CERTS - DerBuffer certificate; /* WOLFSSL_CTX owns, unless we own */ - DerBuffer key; /* WOLFSSL_CTX owns, unless we own */ - DerBuffer certChain; /* WOLFSSL_CTX owns, unless we own */ + DerBuffer* certificate; /* WOLFSSL_CTX owns, unless we own */ + DerBuffer* key; /* WOLFSSL_CTX owns, unless we own */ + DerBuffer* certChain; /* WOLFSSL_CTX owns, unless we own */ /* chain after self, in DER, with leading size for each cert */ #endif #ifdef WOLFSSL_DTLS @@ -2373,7 +2373,7 @@ struct WOLFSSL_X509 { word32 pkCurveOID; #endif /* HAVE_ECC */ #ifndef NO_CERTS - DerBuffer derCert; /* may need */ + DerBuffer* derCert; /* may need */ #endif DNS_entry* altNames; /* alt names list */ DNS_entry* altNamesNext; /* hint for retrieval */ @@ -2697,12 +2697,11 @@ typedef struct EncryptedInfo { #ifndef NO_CERTS - WOLFSSL_LOCAL int InitDer(DerBuffer* der); - WOLFSSL_LOCAL int AllocDer(DerBuffer* der, word32 length, int type, void* heap); - WOLFSSL_LOCAL void FreeDer(DerBuffer* der); + WOLFSSL_LOCAL int AllocDer(DerBuffer** der, word32 length, int type, void* heap); + WOLFSSL_LOCAL void FreeDer(DerBuffer** der); WOLFSSL_LOCAL int PemToDer(const unsigned char* buff, long sz, int type, - DerBuffer* der, void* heap, EncryptedInfo* info, + DerBuffer** pDer, void* heap, EncryptedInfo* info, int* eccKey); WOLFSSL_LOCAL int ProcessFile(WOLFSSL_CTX* ctx, const char* fname, int format, From 0f93b86b619fcbbb3e52132d68dad43b7d7b60bd Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 8 Mar 2016 08:45:30 -0800 Subject: [PATCH 042/192] Fixes for PK_CALLBACKS and sniffer after DerBuffer refactor #2. --- src/internal.c | 30 +++++++++++++++--------------- src/sniffer.c | 9 +++++---- src/ssl.c | 8 ++++---- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/internal.c b/src/internal.c index eadc88134..793c9ecd2 100644 --- a/src/internal.c +++ b/src/internal.c @@ -13556,8 +13556,8 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) #ifdef HAVE_ECC ret = ssl->ctx->EccSignCb(ssl, digest, digestSz, encodedSig, &localSz, - ssl->buffers.key.buffer, - ssl->buffers.key.length, + ssl->buffers.key->buffer, + ssl->buffers.key->length, ssl->EccSignCtx); #endif /* HAVE_ECC */ #endif /*HAVE_PK_CALLBACKS */ @@ -13651,8 +13651,8 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) ret = ssl->ctx->RsaSignCb(ssl, signBuffer, signSz, verify + extraSz + VERIFY_HEADER, &ioLen, - ssl->buffers.key.buffer, - ssl->buffers.key.length, + ssl->buffers.key->buffer, + ssl->buffers.key->length, ssl->RsaSignCtx); #endif /* NO_RSA */ #endif /*HAVE_PK_CALLBACKS */ @@ -14923,8 +14923,8 @@ int DoSessionTicket(WOLFSSL* ssl, word32 ioLen = sigSz; ret = ssl->ctx->RsaSignCb(ssl, signBuffer, signSz, output + idx, &ioLen, - ssl->buffers.key.buffer, - ssl->buffers.key.length, + ssl->buffers.key->buffer, + ssl->buffers.key->length, ssl->RsaSignCtx); #endif /*HAVE_PK_CALLBACKS */ } @@ -15000,8 +15000,8 @@ int DoSessionTicket(WOLFSSL* ssl, ret = ssl->ctx->EccSignCb(ssl, digest, digestSz, output + LENGTH_SZ + idx, &sz, - ssl->buffers.key.buffer, - ssl->buffers.key.length, + ssl->buffers.key->buffer, + ssl->buffers.key->length, ssl->EccSignCtx); #endif } @@ -15581,8 +15581,8 @@ int DoSessionTicket(WOLFSSL* ssl, word32 ioLen = sigSz; ret = ssl->ctx->RsaSignCb(ssl, signBuffer, signSz, output + idx, &ioLen, - ssl->buffers.key.buffer, - ssl->buffers.key.length, + ssl->buffers.key->buffer, + ssl->buffers.key->length, ssl->RsaSignCtx); #endif } else if (ret == 0) { @@ -17021,8 +17021,8 @@ int DoSessionTicket(WOLFSSL* ssl, #ifdef HAVE_PK_CALLBACKS ret = ssl->ctx->RsaDecCb(ssl, input + *inOutIdx, length, &out, - ssl->buffers.key.buffer, - ssl->buffers.key.length, + ssl->buffers.key->buffer, + ssl->buffers.key->length, ssl->RsaDecCtx); #endif } @@ -17168,7 +17168,7 @@ int DoSessionTicket(WOLFSSL* ssl, word16 cipherLen; word16 plainLen = sizeof(ssl->arrays->preMasterSecret); - if (!ssl->buffers.key.buffer) { + if (!ssl->buffers.key || !ssl->buffers.key->buffer) { return NO_PRIVATE_KEY; } @@ -17188,8 +17188,8 @@ int DoSessionTicket(WOLFSSL* ssl, } if (NTRU_OK != ntru_crypto_ntru_decrypt( - (word16) ssl->buffers.key.length, - ssl->buffers.key.buffer, cipherLen, + (word16) ssl->buffers.key->length, + ssl->buffers.key->buffer, cipherLen, input + *inOutIdx, &plainLen, ssl->arrays->preMasterSecret)) { return NTRU_DECRYPT_ERROR; diff --git a/src/sniffer.c b/src/sniffer.c index 30e860c5c..9a680d4a9 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -1341,16 +1341,17 @@ static int ProcessClientKeyExchange(const byte* input, int* sslBytes, RsaKey key; int ret; - if (session->sslServer->buffers.key.buffer == NULL || - session->sslServer->buffers.key.length == 0) { + if (session->sslServer->buffers.key == NULL || + session->sslServer->buffers.key->buffer == NULL || + session->sslServer->buffers.key->length == 0) { SetError(RSA_KEY_MISSING_STR, error, session, FATAL_ERROR_STATE); return -1; } ret = wc_InitRsaKey(&key, 0); if (ret == 0) - ret = wc_RsaPrivateKeyDecode(session->sslServer->buffers.key.buffer, - &idx, &key, session->sslServer->buffers.key.length); + ret = wc_RsaPrivateKeyDecode(session->sslServer->buffers.key->buffer, + &idx, &key, session->sslServer->buffers.key->length); if (ret == 0) { int length = wc_RsaEncryptSize(&key); diff --git a/src/ssl.c b/src/ssl.c index 1f4aaca08..645f4880e 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -11476,10 +11476,10 @@ int wolfSSL_cmp_peer_cert_to_file(WOLFSSL* ssl, const char *fname) (XFREAD(myBuffer, sz, 1, file) > 0) && (PemToDer(myBuffer, sz, CERT_TYPE, &fileDer, ctx->heap, info, &eccKey) == 0) && - (fileDer.length != 0) && - (fileDer.length == peer_cert->derCert.length) && - (XMEMCMP(peer_cert->derCert.buffer, fileDer.buffer, - fileDer.length) == 0)) + (fileDer->length != 0) && + (fileDer->length == peer_cert->derCert->length) && + (XMEMCMP(peer_cert->derCert->buffer, fileDer->buffer, + fileDer->length) == 0)) { ret = 0; } From c8633008059c82c6cdffaed047210fd512cad92b Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 8 Mar 2016 09:34:56 -0800 Subject: [PATCH 043/192] Fixed scan-build error with possibly using a NULL pointer. --- src/ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ssl.c b/src/ssl.c index 645f4880e..9080ec51f 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -10063,7 +10063,7 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) /* At this point we want `der` to have the certificate in DER format */ /* ready to be decoded. */ - if (der->buffer != NULL) { + if (der != NULL && der->buffer != NULL) { #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; #else From f17dfa5b0324ade1f10115e91125b420a9bad85b Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 9 Mar 2016 09:15:00 -0800 Subject: [PATCH 044/192] Moved the x509 XFREE to outside the FreeX509 function. Internally FreeX509 is only used in two places. One is for the ssl->peerCert, which is not dynamic anyways. The second is in the ExternalFreeX509 where it calls FreeX509 if its dynamic and will XFREE there. --- src/internal.c | 2 -- src/ssl.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 91caeeb3f..911bef531 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1695,8 +1695,6 @@ void FreeX509(WOLFSSL_X509* x509) #endif /* OPENSSL_EXTRA */ if (x509->altNames) FreeAltNames(x509->altNames, NULL); - if (x509->dynamicMemory) - XFREE(x509, NULL, DYNAMIC_TYPE_X509); } diff --git a/src/ssl.c b/src/ssl.c index 8e788a4bf..29c6f8ca6 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -9424,6 +9424,7 @@ static void ExternalFreeX509(WOLFSSL_X509* x509) if (x509) { if (x509->dynamicMemory) { FreeX509(x509); + XFREE(x509, NULL, DYNAMIC_TYPE_X509); } else { WOLFSSL_MSG("free called on non dynamic object, not freeing"); } From 49b547db08af0b2f95dc1a81b1c0376e78beb0df Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 8 Mar 2016 15:20:45 -0700 Subject: [PATCH 045/192] make QSH debug compile for C89 --- src/keys.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/keys.c b/src/keys.c index 07a0b1d38..f641a39df 100644 --- a/src/keys.c +++ b/src/keys.c @@ -3058,6 +3058,7 @@ int MakeMasterSecret(WOLFSSL* ssl) /* show secret SerSi and CliSi */ #ifdef SHOW_SECRETS + { word32 j; printf("QSH generated secret material\n"); printf("SerSi : "); @@ -3070,6 +3071,7 @@ int MakeMasterSecret(WOLFSSL* ssl) printf("%02x", ssl->QSH_secret->CliSi->buffer[j]); } printf("\n"); + } #endif } #endif From 6e1c5b380173be3d9e92c885de5b5741efcb1dac Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 9 Mar 2016 17:22:38 -0700 Subject: [PATCH 046/192] disable CERT_EXT policies check when SEP is used instead --- wolfcrypt/test/test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index b025dbf74..922bfda4c 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -3832,12 +3832,14 @@ int certext_test(void) if (cert.isCA) return -206; +#ifndef WOLFSSL_SEP /* test only if not using SEP policies */ /* check the Certificate Policies Id */ if (cert.extCertPoliciesNb != 1) return -227; if (strncmp(cert.extCertPolicies[0], "2.16.840.1.101.3.4.1.42", 23)) return -228; +#endif FreeDecodedCert(&cert); @@ -3881,6 +3883,7 @@ int certext_test(void) if (cert.isCA) return -216; +#ifndef WOLFSSL_SEP /* test only if not using SEP policies */ /* check the Certificate Policies Id */ if (cert.extCertPoliciesNb != 2) return -217; @@ -3890,6 +3893,7 @@ int certext_test(void) if (strncmp(cert.extCertPolicies[1], "1.2.13025.489.1.113549", 22)) return -219; +#endif FreeDecodedCert(&cert); #endif /* HAVE_ECC */ @@ -3933,6 +3937,7 @@ int certext_test(void) if (!cert.isCA) return -226; +#ifndef WOLFSSL_SEP /* test only if not using SEP policies */ /* check the Certificate Policies Id */ if (cert.extCertPoliciesNb != 2) return -227; @@ -3942,6 +3947,7 @@ int certext_test(void) if (strncmp(cert.extCertPolicies[1], "1.2.840.113549.1.9.16.6.5", 25)) return -229; +#endif FreeDecodedCert(&cert); free(tmp); From 80aa4316895e7252c8e6f3a430345da9f58a199f Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 10 Mar 2016 09:38:11 -0800 Subject: [PATCH 047/192] Fixes multiple Jenkins warnings/failures. First is PickHashSigAlgo is required for client builds or if certs are enabled. Fixed scan-build warning with OCSP not recognized ForceZero as cleaning memory and using possible garbage value. Also cleaned up the OCSP functions to use struct buffer* instead of void* for clarity with a little forward declaration. --- src/internal.c | 15 ++++++++------- src/ocsp.c | 7 +++---- wolfssl/ocsp.h | 6 ++++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/internal.c b/src/internal.c index 41baf4b3c..1155764bf 100644 --- a/src/internal.c +++ b/src/internal.c @@ -142,8 +142,6 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz, #ifndef NO_CERTS static int BuildCertHashes(WOLFSSL* ssl, Hashes* hashes); -static void PickHashSigAlgo(WOLFSSL* ssl, - const byte* hashSigAlgo, word32 hashSigAlgoSz); #endif #ifdef HAVE_QSH @@ -8702,7 +8700,9 @@ int SendCertificateStatus(WOLFSSL* ssl) /* case WOLFSSL_CSR_OCSP: */ case WOLFSSL_CSR2_OCSP: { OcspRequest* request = ssl->ctx->certOcspRequest; - buffer response = {NULL, 0}; + buffer response; + + XMEMSET(&response, 0, sizeof(response)); /* unable to fetch status. skip. */ if (ssl->ctx->cm == NULL || ssl->ctx->cm->ocspStaplingEnabled == 0) @@ -8799,7 +8799,7 @@ int SendCertificateStatus(WOLFSSL* ssl) buffer responses[1 + MAX_CHAIN_DEPTH]; int i = 0; - ForceZero(responses, sizeof(responses)); + XMEMSET(responses, 0, sizeof(responses)); /* unable to fetch status. skip. */ if (ssl->ctx->cm == NULL || ssl->ctx->cm->ocspStaplingEnabled == 0) @@ -10584,7 +10584,7 @@ int SetCipherList(Suites* suites, const char* list) return ret; } -#ifndef NO_CERTS +#if !defined(NO_WOLFSSL_SERVER) || !defined(NO_CERTS) static void PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz) { @@ -10620,7 +10620,7 @@ static void PickHashSigAlgo(WOLFSSL* ssl, } } } -#endif +#endif /* !defined(NO_WOLFSSL_SERVER) || !defined(NO_CERTS) */ #ifdef WOLFSSL_CALLBACKS @@ -15795,6 +15795,7 @@ int DoSessionTicket(WOLFSSL* ssl, return 1; } +#ifndef NO_WOLFSSL_SERVER static int MatchSuite(WOLFSSL* ssl, Suites* peerSuites) { word16 i, j; @@ -15831,7 +15832,7 @@ int DoSessionTicket(WOLFSSL* ssl, return MATCH_SUITE_ERROR; } - +#endif #ifdef OLD_HELLO_ALLOWED diff --git a/src/ocsp.c b/src/ocsp.c index a1fd6dc25..5d5186fc4 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -118,7 +118,7 @@ static int xstat2err(int stat) } -int CheckCertOCSP(WOLFSSL_OCSP* ocsp, DecodedCert* cert, void* encodedResponse) +int CheckCertOCSP(WOLFSSL_OCSP* ocsp, DecodedCert* cert, buffer* responseBuffer) { int ret = OCSP_LOOKUP_FAIL; @@ -141,7 +141,7 @@ int CheckCertOCSP(WOLFSSL_OCSP* ocsp, DecodedCert* cert, void* encodedResponse) #endif if (InitOcspRequest(ocspRequest, cert, ocsp->cm->ocspSendNonce) == 0) { - ret = CheckOcspRequest(ocsp, ocspRequest, encodedResponse); + ret = CheckOcspRequest(ocsp, ocspRequest, responseBuffer); FreeOcspRequest(ocspRequest); } @@ -239,14 +239,13 @@ static int GetOcspStatus(WOLFSSL_OCSP* ocsp, OcspRequest* request, } int CheckOcspRequest(WOLFSSL_OCSP* ocsp, OcspRequest* ocspRequest, - void* encodedResponse) + buffer* responseBuffer) { OcspEntry* entry = NULL; CertStatus* status = NULL; byte* request = NULL; int requestSz = 2048; byte* response = NULL; - buffer* responseBuffer = (buffer*) encodedResponse; const char* url = NULL; int urlSz = 0; int ret = -1; diff --git a/wolfssl/ocsp.h b/wolfssl/ocsp.h index 8d05c26d0..2a2442446 100644 --- a/wolfssl/ocsp.h +++ b/wolfssl/ocsp.h @@ -34,14 +34,16 @@ extern "C" { #endif +struct buffer; typedef struct WOLFSSL_OCSP WOLFSSL_OCSP; WOLFSSL_LOCAL int InitOCSP(WOLFSSL_OCSP*, WOLFSSL_CERT_MANAGER*); WOLFSSL_LOCAL void FreeOCSP(WOLFSSL_OCSP*, int dynamic); -WOLFSSL_LOCAL int CheckCertOCSP(WOLFSSL_OCSP*, DecodedCert*, void*); +WOLFSSL_LOCAL int CheckCertOCSP(WOLFSSL_OCSP*, DecodedCert*, + struct buffer* responseBuffer); WOLFSSL_LOCAL int CheckOcspRequest(WOLFSSL_OCSP* ocsp, - OcspRequest* ocspRequest, void*); + OcspRequest* ocspRequest, struct buffer* responseBuffer); #ifdef __cplusplus } /* extern "C" */ From 3976a3e2f214c1be279e332ae34e3815a7e3ec67 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 10 Mar 2016 14:35:55 -0700 Subject: [PATCH 048/192] K64F RNGA register --- wolfcrypt/src/random.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index f407949d3..e889bf50b 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -1160,7 +1160,13 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) int i; /* turn on RNGA module */ - SIM_SCGC3 |= SIM_SCGC3_RNGA_MASK; + #if defined(SIM_SCGC3_RNGA_MASK) + SIM_SCGC3 |= SIM_SCGC3_RNGA_MASK; + #endif + #if defined(SIM_SCGC6_RNGA_MASK) + /* additionally needed for at least K64F */ + SIM_SCGC6 |= SIM_SCGC6_RNGA_MASK; + #endif /* set SLP bit to 0 - "RNGA is not in sleep mode" */ RNG_CR &= ~RNG_CR_SLP_MASK; From 2e1c1ca7f8ecb885757834d1d4d6193590ed04ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moise=CC=81s=20Guimara=CC=83es?= Date: Thu, 10 Mar 2016 23:07:36 -0300 Subject: [PATCH 049/192] remove unnecessary condition --- src/internal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/internal.c b/src/internal.c index 1155764bf..82d3c10da 100644 --- a/src/internal.c +++ b/src/internal.c @@ -4806,7 +4806,7 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, #endif /* HAVE_OCSP || HAVE_CRL */ #ifdef KEEP_PEER_CERT - if (fatal == 0) { + { /* set X509 format for peer cert even if fatal */ int copyRet = CopyDecodedToX509(&ssl->peerCert, dCert); if (copyRet == MEMORY_E) @@ -8701,7 +8701,7 @@ int SendCertificateStatus(WOLFSSL* ssl) case WOLFSSL_CSR2_OCSP: { OcspRequest* request = ssl->ctx->certOcspRequest; buffer response; - + XMEMSET(&response, 0, sizeof(response)); /* unable to fetch status. skip. */ @@ -11341,7 +11341,7 @@ static void PickHashSigAlgo(WOLFSSL* ssl, /* don't send client cert or cert verify if user hasn't provided cert and private key */ - if (ssl->buffers.certificate && ssl->buffers.certificate->buffer && + if (ssl->buffers.certificate && ssl->buffers.certificate->buffer && ssl->buffers.key && ssl->buffers.key->buffer) ssl->options.sendVerify = SEND_CERT; else if (IsTLS(ssl)) @@ -13433,7 +13433,7 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) { #ifdef HAVE_ECC WOLFSSL_MSG("Trying ECC client cert, RSA didn't work"); - + if (ssl->buffers.key == NULL) { WOLFSSL_MSG("ECC Key missing"); return NO_PRIVATE_KEY; From 81b0ccdb1add4a46aae68027d64a3751315ffbe1 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 11 Mar 2016 09:39:13 -0800 Subject: [PATCH 050/192] Address scan-build issue on build #214 after DerBuffer refactor part 2 (ceafb25). --- src/internal.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/internal.c b/src/internal.c index 1155764bf..fa3ca840b 100644 --- a/src/internal.c +++ b/src/internal.c @@ -8879,7 +8879,7 @@ int SendCertificateStatus(WOLFSSL* ssl) if (ret == 0 && (!ssl->ctx->chainOcspRequest[0] || ssl->buffers.weOwnCertChain)) { - DerBuffer* der = NULL; + buffer der; word32 idx = 0; #ifdef WOLFSSL_SMALL_STACK DecodedCert* cert = NULL; @@ -8887,24 +8887,26 @@ int SendCertificateStatus(WOLFSSL* ssl) DecodedCert cert[1]; #endif - #ifdef WOLFSSL_SMALL_STACK - cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (cert == NULL) - return MEMORY_E; - #endif + XMEMSET(&der, 0, sizeof(buffer)); + + #ifdef WOLFSSL_SMALL_STACK + cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), NULL, + DYNAMIC_TYPE_TMP_BUFFER); + if (cert == NULL) + return MEMORY_E; + #endif while (idx + OPAQUE24_LEN < ssl->buffers.certChain->length) { - c24to32(ssl->buffers.certChain->buffer + idx, &der->length); + c24to32(ssl->buffers.certChain->buffer + idx, &der.length); idx += OPAQUE24_LEN; - der->buffer = ssl->buffers.certChain->buffer + idx; - idx += der->length; + der.buffer = ssl->buffers.certChain->buffer + idx; + idx += der.length; if (idx > ssl->buffers.certChain->length) break; - InitDecodedCert(cert, der->buffer, der->length, NULL); + InitDecodedCert(cert, der.buffer, der.length, NULL); if ((ret = ParseCertRelative(cert, CERT_TYPE, VERIFY, ssl->ctx->cm)) != 0) { From db758dc98be0a91f0a6f9688c24b5929e75b2c4e Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Sat, 12 Mar 2016 09:37:32 -0700 Subject: [PATCH 051/192] update test script, fall back to cert name search, fix der free --- configure.ac | 10 ++++ scripts/include.am | 16 +++--- scripts/trusted_peer.test | 108 ++++++++++++++++++++++++++++++++------ src/internal.c | 13 +++-- src/ssl.c | 46 +++++++++++----- wolfcrypt/src/asn.c | 4 -- wolfssl/internal.h | 10 +++- 7 files changed, 162 insertions(+), 45 deletions(-) diff --git a/configure.ac b/configure.ac index 45c859c16..c7e14cc9d 100644 --- a/configure.ac +++ b/configure.ac @@ -2510,6 +2510,7 @@ AM_CONDITIONAL([BUILD_PSK], [test "x$ENABLED_PSK" = "xyes"]) # check if should run the trusted peer certs test +# (for now checking both C_FLAGS and C_EXTRA_FLAGS) case $C_EXTRA_FLAGS in *WOLFSSL_TRUST_PEER_CERT*) have_tp=yes @@ -2517,6 +2518,15 @@ case $C_EXTRA_FLAGS in *) have_tp=no ;; esac +if test "$have_tp" = "no"; then + case $C_FLAGS in + *WOLFSSL_TRUST_PEER_CERT*) + have_tp=yes + break;; + *) + have_tp=no ;; + esac +fi AM_CONDITIONAL([BUILD_TRUST_PEER_CERT], [test "x$have_tp" = "xyes"]) diff --git a/scripts/include.am b/scripts/include.am index 2a0c8f4a7..53087fdc5 100644 --- a/scripts/include.am +++ b/scripts/include.am @@ -39,8 +39,16 @@ endif endif +if BUILD_PSK +dist_noinst_SCRIPTS+= scripts/psk.test endif +if BUILD_TRUST_PEER_CERT +dist_noinst_SCRIPTS+= scripts/trusted_peer.test +endif + +endif # end of BUILD_EXAMPLE_SERVERS + if BUILD_EXAMPLE_CLIENTS if !BUILD_IPV6 dist_noinst_SCRIPTS+= scripts/external.test @@ -49,14 +57,6 @@ dist_noinst_SCRIPTS+= scripts/google.test endif endif -if BUILD_PSK -dist_noinst_SCRIPTS+= scripts/psk.test -endif - -if BUILD_TRUST_PEER_CERT -dist_noinst_SCRIPTS+= scripts/trusted_peer.test -endif - EXTRA_DIST += scripts/testsuite.pcap # leave openssl.test as extra until non bash works EXTRA_DIST += scripts/openssl.test diff --git a/scripts/trusted_peer.test b/scripts/trusted_peer.test index a07836280..a4faf1c18 100755 --- a/scripts/trusted_peer.test +++ b/scripts/trusted_peer.test @@ -15,6 +15,17 @@ counter=0 # per source tree ready_file=`pwd`/wolfssl_tp_ready$$ +# variables for certs so can use RSA or ECC +client_cert=`pwd`/certs/client-cert.pem +client_ca=`pwd`/certs/ca-cert.pem +client_key=`pwd`/certs/client-key.pem +ca_key=`pwd`/certs/ca-key.pem +server_cert=`pwd`/certs/server-cert.pem +server_key=`pwd`/certs/server-key.pem +combined_cert=`pwd`/certs/client_combined.pem +wrong_ca=`pwd`/certs/wolfssl-website-ca.pem +wrong_cert=`pwd`/certs/server-revoked-cert.pem + echo "ready file $ready_file" create_port() { @@ -63,15 +74,41 @@ trap do_trap INT TERM [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1 +# Look for if RSA and/or ECC is enabled and adjust certs/keys +ciphers=`./examples/client/client -e` +if [[ $ciphers != *"RSA"* ]]; then + if [[ $ciphers == *"ECDSA"* ]]; then + client_cert=`pwd`/certs/client-ecc-cert.pem + client_ca=`pwd`/certs/server-ecc.pem + client_key=`pwd`/certs/ecc-client-key.pem + ca_key=`pwd`/certs/ecc-key.pem + server_cert=`pwd`/certs/server-ecc.pem + server_key=`pwd`/certs/ecc-key.pem + wrong_ca=`pwd`/certs/server-ecc-comp.pem + wrong_cert=`pwd`/certs/server-ecc-comp.pem + else + echo "configure options not set up for test. No RSA or ECC" + exit 0 + fi +fi + +# CRL list not set up for tests +crl_test=`./examples/client/client -h` +if [[ $crl_test == *"-C "* ]]; then + echo "test not set up to run with CRL" + exit 0 +fi + # Test for trusted peer certs build echo "" echo "Checking built with trusted peer certs " echo "-----------------------------------------------------" port=0 -./examples/server/server -E certs/client-cert.pem -R $ready_file -p $port & +remove_ready_file +./examples/server/server -E $client_cert -c $server_cert -k $server_key -R $ready_file -p $port & server_pid=$! create_port -./examples/client/client -p $port +./examples/client/client -A $client_ca -p $port RESULT=$? remove_ready_file # if fail here then is a settings issue so return 0 @@ -86,10 +123,10 @@ echo "" echo "Server and Client relying on trusted peer cert loaded" echo "-----------------------------------------------------" port=0 -./examples/server/server -A certs/wolfssl-website-ca.pem -E certs/client-cert.pem -c certs/server-cert.pem -R $ready_file -p $port & +./examples/server/server -A $wrong_ca -E $client_cert -c $server_cert -k $server_key -R $ready_file -p $port & server_pid=$! create_port -./examples/client/client -A certs/wolfssl-website-ca.pem -E certs/server-cert.pem -c certs/client-cert.pem -p $port +./examples/client/client -A $wrong_ca -E $server_cert -c $client_cert -p $port RESULT=$? remove_ready_file if [ $RESULT -ne 0 ]; then @@ -103,10 +140,10 @@ echo "" echo "Server relying on trusted peer cert loaded" echo "-----------------------------------------------------" port=0 -./examples/server/server -A certs/wolfssl-website-ca.pem -E certs/client-cert.pem -c certs/server-cert.pem -R $ready_file -p $port & +./examples/server/server -A $wrong_ca -E $client_cert -c $server_cert -k $server_key -R $ready_file -p $port & server_pid=$! create_port -./examples/client/client -c certs/client-cert.pem -p $port +./examples/client/client -A $client_ca -c $client_cert -p $port RESULT=$? remove_ready_file if [ $RESULT -ne 0 ]; then @@ -120,10 +157,10 @@ echo "" echo "Client relying on trusted peer cert loaded" echo "-----------------------------------------------------" port=0 -./examples/server/server -c certs/server-cert.pem -R $ready_file -p $port & +./examples/server/server -c $server_cert -k $server_key -R $ready_file -p $port & server_pid=$! create_port -./examples/client/client -E certs/server-cert.pem -p $port +./examples/client/client -A $wrong_ca -E $server_cert -p $port RESULT=$? remove_ready_file if [ $RESULT -ne 0 ]; then @@ -137,10 +174,10 @@ echo "" echo "Client fall through to loaded CAs" echo "-----------------------------------------------------" port=0 -./examples/server/server -R $ready_file -p $port & +./examples/server/server -c $server_cert -k $server_key -R $ready_file -p $port & server_pid=$! create_port -./examples/client/client -E certs/server-revoked-cert.pem -p $port +./examples/client/client -A $client_ca -E $wrong_cert -p $port RESULT=$? remove_ready_file if [ $RESULT -ne 0 ]; then @@ -151,13 +188,15 @@ fi echo "" # Test that client can fail +# check if using ECC client example is hard coded to load correct ECC ca so skip +if [[ $wrong_ca != *"ecc"* ]]; then echo "Client wrong CA and wrong trusted peer cert loaded" echo "-----------------------------------------------------" port=0 -./examples/server/server -R $ready_file -p $port & +./examples/server/server -c $server_cert -k $server_key -R $ready_file -p $port & server_pid=$! create_port -./examples/client/client -A certs/wolfssl-website-ca.pem -E certs/server-revoked-cert.pem -p $port +./examples/client/client -A $wrong_ca -E $wrong_cert -p $port RESULT=$? remove_ready_file if [ $RESULT -eq 0 ]; then @@ -166,15 +205,16 @@ if [ $RESULT -eq 0 ]; then exit 1 fi echo "" +fi # Test that server can fail echo "Server wrong CA and wrong trusted peer cert loaded" echo "-----------------------------------------------------" port=0 -./examples/server/server -A certs/wolfssl-website-ca.pem -E certs/server-revoked-cert.pem -R $ready_file -p $port & +./examples/server/server -A $wrong_ca -E $wrong_cert -c $server_cert -k $server_key -R $ready_file -p $port & server_pid=$! create_port -./examples/client/client -p $port +./examples/client/client -A $client_ca -p $port RESULT=$? remove_ready_file if [ $RESULT -eq 0 ]; then @@ -188,10 +228,10 @@ echo "" echo "Server fall through to loaded CAs" echo "-----------------------------------------------------" port=0 -./examples/server/server -E certs/server-revoked-cert.pem -R $ready_file -p $port & +./examples/server/server -E $wrong_cert -c $server_cert -k $server_key -R $ready_file -p $port & server_pid=$! create_port -./examples/client/client -p $port +./examples/client/client -A $client_ca -p $port RESULT=$? remove_ready_file if [ $RESULT -ne 0 ]; then @@ -201,6 +241,42 @@ if [ $RESULT -ne 0 ]; then fi echo "" +# test loading multiple certs +echo "Server loading multiple trusted peer certs" +echo "Test two success cases and one fail case" +echo "-----------------------------------------------------" +port=0 +cat $client_cert $client_ca > $combined_cert +./examples/server/server -i -A $wrong_ca -E $combined_cert -c $server_cert -k $server_key -R $ready_file -p $port & +server_pid=$! +create_port +./examples/client/client -A $client_ca -c $client_cert -k $client_key -p $port +RESULT=$? +if [ $RESULT -ne 0 ]; then + echo -e "\nServer load multiple trusted peer certs failed!" + do_cleanup + exit 1 +fi +./examples/client/client -A $client_ca -c $client_ca -k $ca_key -p $port +RESULT=$? +if [ $RESULT -ne 0 ]; then + echo -e "\nServer load multiple trusted peer certs failed!" + do_cleanup + exit 1 +fi +./examples/client/client -A $client_ca -c $wrong_cert -k $client_key -p $port +RESULT=$? +if [ $RESULT -eq 0 ]; then + echo -e "\nServer load multiple trusted peer certs failed!" + do_cleanup + exit 1 +fi + +do_cleanup # kill PID of server running in infinit loop +rm $combined_cert +remove_ready_file +echo "" + echo "-----------------------------------------------------" echo "ALL TESTS PASSED" echo "-----------------------------------------------------" diff --git a/src/internal.c b/src/internal.c index d78ab2acd..c1fa85438 100644 --- a/src/internal.c +++ b/src/internal.c @@ -4630,10 +4630,17 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, InitDecodedCert(dCert, certs[0].buffer, certs[0].length, ssl->heap); ret = ParseCertRelative(dCert, CERT_TYPE, 0, ssl->ctx->cm); #ifndef NO_SKID - if (dCert->extAuthKeyIdSet) - tp = GetTrustedPeer(ssl->ctx->cm, dCert->extSubjKeyId); + if (dCert->extAuthKeyIdSet) { + tp = GetTrustedPeer(ssl->ctx->cm, dCert->extSubjKeyId, + WC_MATCH_SKID); + } + else { /* if the cert has no SKID try to match by name */ + tp = GetTrustedPeer(ssl->ctx->cm, dCert->subjectHash, + WC_MATCH_NAME); + } #else /* NO_SKID */ - tp = GetTrustedPeer(ssl->ctx->cm, dCert->subjectHash); + tp = GetTrustedPeer(ssl->ctx->cm, dCert->subjectHash, + WC_MATCH_NAME); #endif /* NO SKID */ WOLFSSL_MSG("Checking for trusted peer cert"); diff --git a/src/ssl.c b/src/ssl.c index 5abb4a2b5..dd2d392f0 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2239,8 +2239,10 @@ int AlreadyTrustedPeer(WOLFSSL_CERT_MANAGER* cm, byte* hash) } -/* return Trusted Peer if found, otherwise NULL */ -TrustedPeerCert* GetTrustedPeer(void* vp, byte* hash) +/* return Trusted Peer if found, otherwise NULL + type is what to match on + */ +TrustedPeerCert* GetTrustedPeer(void* vp, byte* hash, int type) { WOLFSSL_CERT_MANAGER* cm = (WOLFSSL_CERT_MANAGER*)vp; TrustedPeerCert* ret = NULL; @@ -2258,11 +2260,20 @@ TrustedPeerCert* GetTrustedPeer(void* vp, byte* hash) tp = cm->tpTable[row]; while (tp) { byte* subjectHash; - #ifndef NO_SKID - subjectHash = tp->subjectKeyIdHash; - #else - subjectHash = tp->subjectNameHash; - #endif + switch (type) { + #ifndef NO_SKID + case WC_MATCH_SKID: + subjectHash = tp->subjectKeyIdHash; + break; + #endif + case WC_MATCH_NAME: + subjectHash = tp->subjectNameHash; + break; + default: + WOLFSSL_MSG("Unknown search type"); + UnLockMutex(&cm->tpLock); + return NULL; + } if (XMEMCMP(hash, subjectHash, SIGNER_DIGEST_SIZE) == 0) { ret = tp; break; @@ -2366,11 +2377,12 @@ Signer* GetCAByName(void* vp, byte* hash) #ifdef WOLFSSL_TRUST_PEER_CERT /* add a trusted peer cert to linked list */ -int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int verify) +int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int verify) { int ret, row; TrustedPeerCert* peerCert; DecodedCert* cert = NULL; + DerBuffer* der = *pDer; byte* subjectHash = NULL; WOLFSSL_MSG("Adding a Trusted Peer Cert"); @@ -2397,7 +2409,12 @@ int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int verify) XMEMSET(peerCert, 0, sizeof(TrustedPeerCert)); #ifndef NO_SKID - subjectHash = cert->extSubjKeyId; + if (cert->extAuthKeyIdSet) { + subjectHash = cert->extSubjKeyId; + } + else { + subjectHash = cert->subjectHash; + } #else subjectHash = cert->subjectHash; #endif @@ -2449,7 +2466,12 @@ int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int verify) #endif #ifndef NO_SKID - row = TrustedPeerHashSigner(peerCert->subjectKeyIdHash); + if (cert->extAuthKeyIdSet) { + row = TrustedPeerHashSigner(peerCert->subjectKeyIdHash); + } + else { + row = TrustedPeerHashSigner(peerCert->subjectNameHash); + } #else row = TrustedPeerHashSigner(peerCert->subjectNameHash); #endif @@ -2472,7 +2494,7 @@ int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int verify) FreeDecodedCert(cert); XFREE(cert, NULL, DYNAMIC_TYPE_TMP_BUFFER); WOLFSSL_MSG(" Freeing der trusted peer cert"); - FreeDer(der); + FreeDer(&der); WOLFSSL_MSG(" OK Freeing der trusted peer cert"); WOLFSSL_LEAVE("AddTrustedPeer", ret); @@ -3320,7 +3342,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, else if (type == TRUSTED_PEER_TYPE) { if (ctx == NULL) { WOLFSSL_MSG("Need context for trusted peer cert load"); - XFREE(der.buffer, heap, dynamicType); + FreeDer(&der); return BAD_FUNC_ARG; } /* add trusted peer cert */ diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index a44e93523..79ed25d03 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4900,10 +4900,6 @@ int ParseCert(DecodedCert* cert, int type, int verify, void* cm) extern "C" { #endif WOLFSSL_LOCAL Signer* GetCA(void* signers, byte* hash); -#ifdef WOLFSSL_TRUST_PEER_CERT - WOLFSSL_LOCAL TrustedPeerCert* GetTrustedPeer(void* signers, byte* hash); - WOLFSSL_LOCAL int MatchTrustedPeer(TrustedPeerCert* tp, DecodedCert* cert); -#endif /* WOLFSSL_TRUST_PEER_CERT */ #ifndef NO_SKID WOLFSSL_LOCAL Signer* GetCAByName(void* signers, byte* hash); #endif diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 2524a7334..1bdad174d 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1946,7 +1946,7 @@ int ProcessOldClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx, int AlreadySigner(WOLFSSL_CERT_MANAGER* cm, byte* hash); #ifdef WOLFSSL_TRUST_PEER_CERT WOLFSSL_LOCAL - int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer* der, int verify); + int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int verify); WOLFSSL_LOCAL int AlreadyTrustedPeer(WOLFSSL_CERT_MANAGER* cm, byte* hash); #endif @@ -2839,7 +2839,13 @@ WOLFSSL_LOCAL int VerifyClientSuite(WOLFSSL* ssl); RsaKey* key); #endif #ifdef WOLFSSL_TRUST_PEER_CERT - WOLFSSL_LOCAL TrustedPeerCert* GetTrustedPeer(void* vp, byte* hash); + + /* options for searching hash table for a matching trusted peer cert */ + #define WC_MATCH_SKID 0 + #define WC_MATCH_NAME 1 + + WOLFSSL_LOCAL TrustedPeerCert* GetTrustedPeer(void* vp, byte* hash, + int type); WOLFSSL_LOCAL int MatchTrustedPeer(TrustedPeerCert* tp, DecodedCert* cert); #endif From a38183b816ef0eada30e7a69b48a54dc134eb081 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 15 Mar 2016 13:58:51 -0700 Subject: [PATCH 052/192] Port for Nordic nRF51 RNG, RTC and AES. Added RNG test for wc_RNG_GenerateBlock 0's check even if HAVE_HASHDRBG is enabled. Added NIST test vectors for ECC P-256, P-384 and P-521. Added helpful debug message in ECC import if issue finding ecc_sets[] for curve. Moved memory tracker into separate file and added support for it to wolfcrypt test and benchmark. Added Ed255519/Curve25519 options for granular control of sign, verify, shared secret, import and export. Added AES options for max key size (AES_MAX_KEY_SIZE), no decrypt (NO_AES_DECRYPT) and no CBC (NO_AES_CBC). --- wolfcrypt/benchmark/benchmark.c | 100 ++++--- wolfcrypt/src/aes.c | 186 ++++++++++--- wolfcrypt/src/curve25519.c | 24 +- wolfcrypt/src/ecc.c | 5 +- wolfcrypt/src/ed25519.c | 18 ++ wolfcrypt/src/include.am | 3 +- wolfcrypt/src/port/nrf51.c | 215 ++++++++++++++ wolfcrypt/src/random.c | 36 +++ wolfcrypt/test/test.c | 479 +++++++++++++++++++++++--------- wolfssl/include.am | 3 +- wolfssl/mem_track.h | 157 +++++++++++ wolfssl/test.h | 124 +-------- wolfssl/wolfcrypt/include.am | 3 +- wolfssl/wolfcrypt/port/nrf51.h | 43 +++ wolfssl/wolfcrypt/settings.h | 55 ++++ 15 files changed, 1112 insertions(+), 339 deletions(-) create mode 100644 wolfcrypt/src/port/nrf51.c create mode 100644 wolfssl/mem_track.h create mode 100644 wolfssl/wolfcrypt/port/nrf51.h diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 12883c462..4bddb3a37 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -118,7 +118,7 @@ #ifdef HAVE_BLAKE2 #include void bench_blake2(void); -#endif +#endif #ifdef _MSC_VER /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */ @@ -127,6 +127,10 @@ #include "wolfcrypt/benchmark/benchmark.h" +#ifdef USE_WOLFSSL_MEMORY + #include "wolfssl/mem_track.h" +#endif + void bench_des(void); void bench_idea(void); void bench_arc4(void); @@ -156,9 +160,11 @@ void bench_eccKeyGen(void); void bench_eccKeyAgree(void); #endif #ifdef HAVE_CURVE25519 -void bench_curve25519KeyGen(void); -void bench_curve25519KeyAgree(void); -#endif + void bench_curve25519KeyGen(void); + #ifdef HAVE_CURVE25519_SHARED_SECRET + void bench_curve25519KeyAgree(void); + #endif /* HAVE_CURVE25519_SHARED_SECRET */ +#endif /* HAVE_CURVE25519 */ #ifdef HAVE_ED25519 void bench_ed25519KeyGen(void); void bench_ed25519KeySign(void); @@ -245,11 +251,15 @@ int main(int argc, char** argv) (void)argc; (void)argv; #else -int benchmark_test(void *args) +int benchmark_test(void *args) { (void)args; #endif +#ifdef USE_WOLFSSL_MEMORY + InitMemoryTracker(); +#endif + wolfCrypt_Init(); #if defined(DEBUG_WOLFSSL) && !defined(HAVE_VALGRIND) @@ -318,7 +328,7 @@ int benchmark_test(void *args) #ifdef HAVE_IDEA bench_idea(); #endif - + printf("\n"); #ifndef NO_MD5 @@ -375,7 +385,9 @@ int benchmark_test(void *args) #ifdef HAVE_CURVE25519 bench_curve25519KeyGen(); - bench_curve25519KeyAgree(); + #ifdef HAVE_CURVE25519_SHARED_SECRET + bench_curve25519KeyAgree(); + #endif #endif #ifdef HAVE_ED25519 @@ -387,6 +399,10 @@ int benchmark_test(void *args) wc_FreeRng(&rng); #endif +#ifdef USE_WOLFSSL_MEMORY + ShowMemoryTracker(); +#endif + return 0; } @@ -740,7 +756,7 @@ void bench_arc4(void) Arc4 enc; double start, total, persec; int i; - + #ifdef HAVE_CAVIUM if (wc_Arc4InitCavium(&enc, CAVIUM_DEV_ID) != 0) printf("arc4 init cavium failed\n"); @@ -778,7 +794,7 @@ void bench_hc128(void) HC128 enc; double start, total, persec; int i; - + wc_Hc128_SetKey(&enc, key, iv); start = current_time(1); BEGIN_INTEL_CYCLES @@ -808,7 +824,7 @@ void bench_rabbit(void) Rabbit enc; double start, total, persec; int i; - + wc_RabbitSetKey(&enc, key, iv); start = current_time(1); BEGIN_INTEL_CYCLES @@ -912,7 +928,7 @@ void bench_md5(void) for(i = 0; i < numBlocks; i++) wc_Md5Update(&hash, plain, sizeof(plain)); - + wc_Md5Final(&hash, digest); END_INTEL_CYCLES @@ -938,7 +954,7 @@ void bench_sha(void) byte digest[SHA_DIGEST_SIZE]; double start, total, persec; int i, ret; - + ret = wc_InitSha(&hash); if (ret != 0) { printf("InitSha failed, ret = %d\n", ret); @@ -946,10 +962,10 @@ void bench_sha(void) } start = current_time(1); BEGIN_INTEL_CYCLES - + for(i = 0; i < numBlocks; i++) wc_ShaUpdate(&hash, plain, sizeof(plain)); - + wc_ShaFinal(&hash, digest); END_INTEL_CYCLES @@ -1065,7 +1081,7 @@ void bench_sha512(void) byte digest[SHA512_DIGEST_SIZE]; double start, total, persec; int i, ret; - + ret = wc_InitSha512(&hash); if (ret != 0) { printf("InitSha512 failed, ret = %d\n", ret); @@ -1073,7 +1089,7 @@ void bench_sha512(void) } start = current_time(1); BEGIN_INTEL_CYCLES - + for(i = 0; i < numBlocks; i++) { ret = wc_Sha512Update(&hash, plain, sizeof(plain)); if (ret != 0) { @@ -1110,14 +1126,14 @@ void bench_ripemd(void) byte digest[RIPEMD_DIGEST_SIZE]; double start, total, persec; int i; - + wc_InitRipeMd(&hash); start = current_time(1); BEGIN_INTEL_CYCLES - + for(i = 0; i < numBlocks; i++) wc_RipeMdUpdate(&hash, plain, sizeof(plain)); - + wc_RipeMdFinal(&hash, digest); END_INTEL_CYCLES @@ -1143,7 +1159,7 @@ void bench_blake2(void) byte digest[64]; double start, total, persec; int i, ret; - + ret = wc_InitBlake2b(&b2b, 64); if (ret != 0) { printf("InitBlake2b failed, ret = %d\n", ret); @@ -1151,7 +1167,7 @@ void bench_blake2(void) } start = current_time(1); BEGIN_INTEL_CYCLES - + for(i = 0; i < numBlocks; i++) { ret = wc_Blake2bUpdate(&b2b, plain, sizeof(plain)); if (ret != 0) { @@ -1159,7 +1175,7 @@ void bench_blake2(void) return; } } - + ret = wc_Blake2bFinal(&b2b, digest, 64); if (ret != 0) { printf("Blake2bFinal failed, ret = %d\n", ret); @@ -1327,7 +1343,7 @@ void bench_dh(void) #error "need to define a cert buffer size" #endif /* USE_CERT_BUFFERS */ - + wc_InitDhKey(&dhKey); #ifdef NO_ASN bytes = wc_DhSetKey(&dhKey, dh_p, sizeof(dh_p), dh_g, sizeof(dh_g)); @@ -1374,12 +1390,12 @@ void bench_rsaKeyGen(void) RsaKey genKey; double start, total, each, milliEach; int i; - - /* 1024 bit */ + + /* 1024 bit */ start = current_time(1); for(i = 0; i < genTimes; i++) { - wc_InitRsaKey(&genKey, 0); + wc_InitRsaKey(&genKey, 0); wc_MakeRsaKey(&genKey, 1024, 65537, &rng); wc_FreeRsaKey(&genKey); } @@ -1395,7 +1411,7 @@ void bench_rsaKeyGen(void) start = current_time(1); for(i = 0; i < genTimes; i++) { - wc_InitRsaKey(&genKey, 0); + wc_InitRsaKey(&genKey, 0); wc_MakeRsaKey(&genKey, 2048, 65537, &rng); wc_FreeRsaKey(&genKey); } @@ -1647,8 +1663,8 @@ void bench_eccKeyGen(void) ecc_key genKey; double start, total, each, milliEach; int i; - - /* 256 bit */ + + /* 256 bit */ start = current_time(1); for(i = 0; i < genTimes; i++) { @@ -1672,7 +1688,7 @@ void bench_eccKeyAgree(void) double start, total, each, milliEach; int i, ret; byte shared[32]; -#ifndef NO_ASN +#if !defined(NO_ASN) && !defined(NO_ECC_SIGN) byte sig[64+16]; /* der encoding too */ #endif byte digest[32]; @@ -1715,7 +1731,7 @@ void bench_eccKeyAgree(void) digest[i] = (byte)i; -#ifndef NO_ASN +#if !defined(NO_ASN) && !defined(NO_ECC_SIGN) start = current_time(1); for(i = 0; i < agreeTimes; i++) { @@ -1723,7 +1739,7 @@ void bench_eccKeyAgree(void) ret = wc_ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &genKey); if (ret != 0) { printf("ecc_sign_hash failed\n"); - return; + return; } } @@ -1740,7 +1756,7 @@ void bench_eccKeyAgree(void) ret = wc_ecc_verify_hash(sig, x, digest, sizeof(digest), &verify, &genKey); if (ret != 0) { printf("ecc_verify_hash failed\n"); - return; + return; } } #endif @@ -1779,7 +1795,7 @@ void bench_curve25519KeyGen(void) " iterations\n", milliEach, genTimes); } - +#ifdef HAVE_CURVE25519_SHARED_SECRET void bench_curve25519KeyAgree(void) { curve25519_key genKey, genKey2; @@ -1823,6 +1839,7 @@ void bench_curve25519KeyAgree(void) wc_curve25519_free(&genKey2); wc_curve25519_free(&genKey); } +#endif /* HAVE_CURVE25519_SHARED_SECRET */ #endif /* HAVE_CURVE25519 */ #ifdef HAVE_ED25519 @@ -1852,12 +1869,15 @@ void bench_ed25519KeyGen(void) void bench_ed25519KeySign(void) { + int ret; ed25519_key genKey; +#ifdef HAVE_ED25519_SIGN double start, total, each, milliEach; - int i, ret; + int i; byte sig[ED25519_SIG_SIZE]; byte msg[512]; word32 x = 0; +#endif wc_ed25519_init(&genKey); @@ -1866,11 +1886,12 @@ void bench_ed25519KeySign(void) printf("ed25519_make_key failed\n"); return; } + +#ifdef HAVE_ED25519_SIGN /* make dummy msg */ for (i = 0; i < (int)sizeof(msg); i++) msg[i] = (byte)i; - start = current_time(1); for(i = 0; i < agreeTimes; i++) { @@ -1888,6 +1909,7 @@ void bench_ed25519KeySign(void) printf("ED25519 sign time %6.3f milliseconds, avg over %d" " iterations\n", milliEach, agreeTimes); +#ifdef HAVE_ED25519_VERIFY start = current_time(1); for(i = 0; i < agreeTimes; i++) { @@ -1905,6 +1927,8 @@ void bench_ed25519KeySign(void) milliEach = each * 1000; /* milliseconds */ printf("ED25519 verify time %6.3f milliseconds, avg over %d" " iterations\n", milliEach, agreeTimes); +#endif /* HAVE_ED25519_VERIFY */ +#endif /* HAVE_ED25519_SIGN */ wc_ed25519_free(&genKey); } @@ -1920,7 +1944,7 @@ void bench_ed25519KeySign(void) { static int init = 0; static LARGE_INTEGER freq; - + LARGE_INTEGER count; (void)reset; @@ -1960,7 +1984,7 @@ void bench_ed25519KeySign(void) #elif defined(WOLFSSL_IAR_ARM_TIME) || defined (WOLFSSL_MDK_ARM) || defined(WOLFSSL_USER_CURRTIME) extern double current_time(int reset); - + #elif defined FREERTOS double current_time(int reset) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 509063d47..a949ea8fe 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -48,12 +48,12 @@ int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) return AesCbcEncrypt_fips(aes, out, in, sz); } - +#ifdef HAVE_AES_DECRYPT int wc_AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz) { return AesCbcDecrypt_fips(aes, out, in, sz); } - +#endif /* HAVE_AES_DECRYPT */ /* AES-CTR */ #ifdef WOLFSSL_AES_COUNTER @@ -70,12 +70,12 @@ void wc_AesEncryptDirect(Aes* aes, byte* out, const byte* in) AesEncryptDirect(aes, out, in); } - +#ifdef HAVE_AES_DECRYPT void wc_AesDecryptDirect(Aes* aes, byte* out, const byte* in) { AesDecryptDirect(aes, out, in); } - +#endif /* HAVE_AES_DECRYPT */ int wc_AesSetKeyDirect(Aes* aes, const byte* key, word32 len, const byte* iv, int dir) @@ -101,7 +101,7 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz, authIn, authInSz); } - +#ifdef HAVE_AES_DECRYPT int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz, const byte* iv, word32 ivSz, const byte* authTag, word32 authTagSz, @@ -110,7 +110,7 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz, return AesGcmDecrypt_fips(aes, out, in, sz, iv, ivSz, authTag, authTagSz, authIn, authInSz); } - +#endif /* HAVE_AES_DECRYPT */ int wc_GmacSetKey(Gmac* gmac, const byte* key, word32 len) { @@ -149,7 +149,7 @@ int wc_AesCcmEncrypt(Aes* aes, byte* out, const byte* in, word32 inSz, return 0; } - +#ifdef HAVE_AES_DECRYPT int wc_AesCcmDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz, const byte* nonce, word32 nonceSz, const byte* authTag, word32 authTagSz, @@ -158,6 +158,7 @@ int wc_AesCcmDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz, return AesCcmDecrypt(aes, out, in, inSz, nonce, nonceSz, authTag, authTagSz, authIn, authInSz); } +#endif /* HAVE_AES_DECRYPT */ #endif /* HAVE_AESCCM */ #ifdef HAVE_CAVIUM @@ -195,7 +196,7 @@ void wc_AesFreeCavium(Aes* aes) #pragma warning(disable: 4127) #endif - +/* Define AES implementation includes and functions */ #if defined(STM32F2_CRYPTO) /* STM32F2 hardware AES support for CBC, CTR modes through the STM32F2 * Standard Peripheral Library. Documentation located in STM32F2xx @@ -219,7 +220,7 @@ void wc_AesFreeCavium(Aes* aes) #include "cau_api.h" static int wc_AesEncrypt(Aes* aes, const byte* inBlock, byte* outBlock) - { + { int ret = wolfSSL_CryptHwMutexLock(); if(ret == 0) { cau_aes_encrypt(inBlock, (byte*)aes->key, aes->rounds, outBlock); @@ -227,8 +228,9 @@ void wc_AesFreeCavium(Aes* aes) } return ret; } + #ifdef HAVE_AES_DECRYPT static int wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) - { + { int ret = wolfSSL_CryptHwMutexLock(); if(ret == 0) { cau_aes_decrypt(inBlock, (byte*)aes->key, aes->rounds, outBlock); @@ -236,6 +238,7 @@ void wc_AesFreeCavium(Aes* aes) } return ret; } + #endif /* HAVE_AES_DECRYPT */ #elif defined(WOLFSSL_PIC32MZ_CRYPT) /* NOTE: no support for AES-CCM/Direct */ #define DEBUG_WOLFSSL @@ -251,12 +254,29 @@ void wc_AesFreeCavium(Aes* aes) const byte* iv); static int wc_AesCaviumCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 length); + #ifdef HAVE_AES_DECRYPT static int wc_AesCaviumCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 length); + #endif /* HAVE_AES_DECRYPT */ +#elif defined(WOLFSSL_NRF51_AES) + /* Use built-in AES hardware - AES 128 ECB Encrypt Only */ + #include "wolfssl/wolfcrypt/port/nrf51.h" + + static int wc_AesEncrypt(Aes* aes, const byte* inBlock, byte* outBlock) + { + return nrf51_aes_encrypt(inBlock, (byte*)aes->key, aes->rounds, outBlock); + } + #ifdef HAVE_AES_DECRYPT + static int wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) + { + return nrf51_aes_decrypt(inBlock, (byte*)aes->key, aes->rounds, outBlock); + } + #endif /* HAVE_AES_DECRYPT */ + #else - /* using CTaoCrypt software AES implementation */ + /* using wolfCrypt software AES implementation */ #define NEED_AES_TABLES -#endif /* STM32F2_CRYPTO */ +#endif #ifdef NEED_AES_TABLES @@ -937,6 +957,7 @@ static const word32 Td[5][256] = { #define GETBYTE(x, y) (word32)((byte)((x) >> (8 * (y)))) + #ifdef WOLFSSL_AESNI /* Each platform needs to query info type 1 from cpuid to see if aesni is @@ -983,20 +1004,22 @@ void AES_CBC_encrypt(const unsigned char* in, unsigned char* out, const unsigned char* KS, int nr) XASM_LINK("AES_CBC_encrypt"); - +#ifdef HAVE_AES_DECRYPT void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, unsigned char* ivec, unsigned long length, const unsigned char* KS, int nr) XASM_LINK("AES_CBC_decrypt"); +#endif void AES_ECB_encrypt(const unsigned char* in, unsigned char* out, unsigned long length, const unsigned char* KS, int nr) XASM_LINK("AES_ECB_encrypt"); - +#ifdef HAVE_AES_DECRYPT void AES_ECB_decrypt(const unsigned char* in, unsigned char* out, unsigned long length, const unsigned char* KS, int nr) XASM_LINK("AES_ECB_decrypt"); +#endif void AES_128_Key_Expansion(const unsigned char* userkey, unsigned char* key_schedule) @@ -1032,7 +1055,7 @@ static int AES_set_encrypt_key(const unsigned char *userKey, const int bits, return BAD_FUNC_ARG; } - +#ifdef HAVE_AES_DECRYPT static int AES_set_decrypt_key(const unsigned char* userKey, const int bits, Aes* aes) { @@ -1075,9 +1098,7 @@ static int AES_set_decrypt_key(const unsigned char* userKey, const int bits, return 0; } - - - +#endif /* HAVE_AES_DECRYPT */ #endif /* WOLFSSL_AESNI */ @@ -1103,7 +1124,7 @@ static void wc_AesEncrypt(Aes* aes, const byte* inBlock, byte* outBlock) printf("sz = %d\n", AES_BLOCK_SIZE); #endif - /* check alignment, decrypt doesn't need alignment */ + /* check alignment, encrypt doesn't need alignment */ if ((wolfssl_word)inBlock % 16) { #ifndef NO_WOLFSSL_ALLOC_ALIGN byte* tmp = (byte*)XMALLOC(AES_BLOCK_SIZE, NULL, @@ -1260,6 +1281,7 @@ static void wc_AesEncrypt(Aes* aes, const byte* inBlock, byte* outBlock) XMEMCPY(outBlock + 3 * sizeof(s0), &s3, sizeof(s3)); } +#ifdef HAVE_AES_DECRYPT static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) { word32 s0, s1, s2, s3; @@ -1418,7 +1440,7 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) XMEMCPY(outBlock + 2 * sizeof(s0), &s2, sizeof(s2)); XMEMCPY(outBlock + 3 * sizeof(s0), &s3, sizeof(s3)); } - +#endif /* HAVE_AES_DECRYPT */ #endif /* NEED_AES_TABLES */ @@ -1521,15 +1543,38 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) return BAD_FUNC_ARG; aes->rounds = keylen/4 + 6; - + ret = wolfSSL_CryptHwMutexLock(); if(ret == 0) { cau_aes_set_key(userKey, keylen*8, rk); wolfSSL_CryptHwMutexUnLock(); - + ret = wc_AesSetIV(aes, iv); } - + + return ret; + } + + int wc_AesSetKeyDirect(Aes* aes, const byte* userKey, word32 keylen, + const byte* iv, int dir) + { + return wc_AesSetKey(aes, userKey, keylen, iv, dir); + } +#elif defined(WOLFSSL_NRF51_AES) + int wc_AesSetKey(Aes* aes, const byte* userKey, word32 keylen, const byte* iv, + int dir) + { + int ret; + + (void)dir; + (void)iv; + + if (keylen != 16) + return BAD_FUNC_ARG; + + aes->rounds = keylen/4 + 6; + ret = nrf51_aes_set_key(userKey); + return ret; } @@ -1574,6 +1619,7 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) switch(keylen) { +#if defined(AES_MAX_KEY_SIZE) && AES_MAX_KEY_SIZE >= 128 case 16: while (1) { @@ -1592,7 +1638,9 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) rk += 4; } break; +#endif /* 128 */ +#if defined(AES_MAX_KEY_SIZE) && AES_MAX_KEY_SIZE >= 192 case 24: /* for (;;) here triggers a bug in VC60 SP4 w/ Pro Pack */ while (1) @@ -1614,7 +1662,9 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) rk += 6; } break; +#endif /* 192 */ +#if defined(AES_MAX_KEY_SIZE) && AES_MAX_KEY_SIZE >= 256 case 32: while (1) { @@ -1643,11 +1693,13 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) rk += 8; } break; +#endif /* 256 */ default: return BAD_FUNC_ARG; } +#ifdef HAVE_AES_DECRYPT if (dir == AES_DECRYPTION) { unsigned int j; @@ -1686,6 +1738,7 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) Td[3][Te[4][GETBYTE(rk[3], 0)] & 0xff]; } } +#endif /* HAVE_AES_DECRYPT */ return wc_AesSetIV(aes, iv); } @@ -1697,6 +1750,14 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) if (!((keylen == 16) || (keylen == 24) || (keylen == 32))) return BAD_FUNC_ARG; + /* Check key length */ + #if defined(AES_MAX_KEY_SIZE) + const word32 max_key_len = (AES_MAX_KEY_SIZE / 8); + if (keylen > max_key_len) { + return BAD_FUNC_ARG; + } + #endif + #ifdef HAVE_CAVIUM if (aes->magic == WOLFSSL_AES_CAVIUM_MAGIC) return wc_AesCaviumSetKey(aes, userKey, keylen, iv); @@ -1713,8 +1774,10 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) XMEMCPY(aes->reg, iv, AES_BLOCK_SIZE); if (dir == AES_ENCRYPTION) return AES_set_encrypt_key(userKey, keylen * 8, aes); + #ifdef HAVE_AES_DECRYPT else return AES_set_decrypt_key(userKey, keylen * 8, aes); + #endif } #endif /* WOLFSSL_AESNI */ @@ -1768,13 +1831,13 @@ int wc_AesSetIV(Aes* aes, const byte* iv) { wc_AesEncrypt(aes, in, out); } - + #ifdef HAVE_AES_DECRYPT /* Allow direct access to one block decrypt */ void wc_AesDecryptDirect(Aes* aes, byte* out, const byte* in) { wc_AesDecrypt(aes, in, out); } - + #endif /* HAVE_AES_DECRYPT */ #endif /* AES direct block */ #endif /* WOLFSSL_AES_DIRECT */ @@ -1886,6 +1949,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) return 0; } + #ifdef HAVE_AES_DECRYPT int wc_AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz) { word32 *dec_key, *iv; @@ -2006,7 +2070,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) return 0; } - + #endif /* HAVE_AES_DECRYPT */ #elif defined(HAVE_COLDFIRE_SEC) static int wc_AesCbcCrypt(Aes* aes, byte* po, const byte* pi, word32 sz, word32 descHeader) @@ -2106,11 +2170,12 @@ int wc_AesSetIV(Aes* aes, const byte* iv) return (wc_AesCbcCrypt(aes, po, pi, sz, SEC_DESC_AES_CBC_ENCRYPT)); } + #ifdef HAVE_AES_DECRYPT int wc_AesCbcDecrypt(Aes* aes, byte* po, const byte* pi, word32 sz) { return (wc_AesCbcCrypt(aes, po, pi, sz, SEC_DESC_AES_CBC_DECRYPT)); } - + #endif /* HAVE_AES_DECRYPT */ #elif defined(FREESCALE_MMCAU) int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) { @@ -2147,7 +2212,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) return 0; } - + #ifdef HAVE_AES_DECRYPT int wc_AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz) { int i; @@ -2169,7 +2234,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) XMEMCPY(temp_block, in + offset, AES_BLOCK_SIZE); wc_AesDecrypt(aes, in + offset, out + offset); - + /* XOR block with IV for CBC */ for (i = 0; i < AES_BLOCK_SIZE; i++) (out + offset)[i] ^= iv[i]; @@ -2183,7 +2248,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) return 0; } - + #endif /* HAVE_AES_DECRYPT */ #elif defined(WOLFSSL_PIC32MZ_CRYPT) /* core hardware crypt engine driver */ static void wc_AesCrypt(Aes *aes, byte* out, const byte* in, word32 sz, @@ -2286,13 +2351,49 @@ int wc_AesSetIV(Aes* aes, const byte* iv) PIC32_CRYPTOALGO_RCBC ); return 0 ; } - + #ifdef HAVE_AES_DECRYPT int wc_AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz) { wc_AesCrypt(aes, out, in, sz, PIC32_DECRYPTION, PIC32_ALGO_AES, PIC32_CRYPTOALGO_RCBC); return 0 ; } + #endif /* HAVE_AES_DECRYPT */ +#elif defined(WOLFSSL_NRF51_AES) + int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) + { + int i, ret; + int offset = 0; + int len = sz; + + byte *iv; + byte temp_block[AES_BLOCK_SIZE]; + + iv = (byte*)aes->reg; + + while (len > 0) + { + XMEMCPY(temp_block, in + offset, AES_BLOCK_SIZE); + + /* XOR block with IV for CBC */ + for (i = 0; i < AES_BLOCK_SIZE; i++) { + temp_block[i] ^= iv[i]; + } + + ret = wc_AesEncrypt(aes, temp_block, out + offset); + if (ret != 0) { + return ret; + } + + len -= AES_BLOCK_SIZE; + offset += AES_BLOCK_SIZE; + + /* store IV for next block */ + XMEMCPY(iv, out + offset - AES_BLOCK_SIZE, AES_BLOCK_SIZE); + } + + return 0; + } #else int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) @@ -2358,6 +2459,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) return 0; } + #ifdef HAVE_AES_DECRYPT int wc_AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz) { word32 blocks = sz / AES_BLOCK_SIZE; @@ -2401,6 +2503,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) return 0; } + #endif #endif /* STM32F2_CRYPTO, AES-CBC block */ @@ -2650,6 +2753,9 @@ int wc_AesSetIV(Aes* aes, const byte* iv) #elif defined(HAVE_COLDFIRE_SEC) #error "Coldfire SEC doesn't currently support AES-GCM mode" +#elif defined(WOLFSSL_NRF51_AES) + #error "nRF51 doesn't currently support AES-GCM mode" + #endif enum { @@ -2967,6 +3073,7 @@ static void AES_GCM_encrypt(const unsigned char *in, } +#ifdef HAVE_AES_DECRYPT /* Figure 10. AES-GCM – Decrypt With Single Block Ghash at a Time */ static int AES_GCM_decrypt(const unsigned char *in, @@ -3185,7 +3292,7 @@ static int AES_GCM_decrypt(const unsigned char *in, return 1; /* when successful returns 1 */ } - +#endif /* HAVE_AES_DECRYPT */ #endif /* WOLFSSL_AESNI */ @@ -3424,7 +3531,7 @@ static void GHASH(Aes* aes, const byte* a, word32 aSz, static void GMULT(word64* X, word64* Y) { word64 Z[2] = {0,0}; - word64 V[2] ; + word64 V[2] ; int i, j; V[0] = X[0] ; V[1] = X[1] ; @@ -3466,7 +3573,7 @@ static void GHASH(Aes* aes, const byte* a, word32 aSz, XMEMCPY(bigH, aes->H, AES_BLOCK_SIZE); #ifdef LITTLE_ENDIAN_ORDER - ByteReverseWords64(bigH, bigH, AES_BLOCK_SIZE); + ByteReverseWords64(bigH, bigH, AES_BLOCK_SIZE); #endif /* Hash in A, the Additional Authentication Data */ @@ -3525,7 +3632,7 @@ static void GHASH(Aes* aes, const byte* a, word32 aSz, /* Hash in the lengths in bits of A and C */ { - word64 len[2] ; + word64 len[2] ; len[0] = aSz ; len[1] = cSz; /* Lengths are in bytes. Convert to bits. */ @@ -3764,6 +3871,7 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz, } +#ifdef HAVE_AES_DECRYPT int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz, const byte* iv, word32 ivSz, const byte* authTag, word32 authTagSz, @@ -3845,7 +3953,7 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz, return 0; } - +#endif /* HAVE_AES_DECRYPT */ WOLFSSL_API int wc_GmacSetKey(Gmac* gmac, const byte* key, word32 len) { @@ -4029,7 +4137,7 @@ int wc_AesCcmEncrypt(Aes* aes, byte* out, const byte* in, word32 inSz, return 0; } - +#ifdef HAVE_AES_DECRYPT int wc_AesCcmDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz, const byte* nonce, word32 nonceSz, const byte* authTag, word32 authTagSz, @@ -4118,7 +4226,7 @@ int wc_AesCcmDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz, return result; } - +#endif /* HAVE_AES_DECRYPT */ #endif /* HAVE_AESCCM */ @@ -4208,6 +4316,7 @@ static int wc_AesCaviumCbcEncrypt(Aes* aes, byte* out, const byte* in, return 0; } +#ifdef HAVE_AES_DECRYPT static int wc_AesCaviumCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 length) { @@ -4242,6 +4351,7 @@ static int wc_AesCaviumCbcDecrypt(Aes* aes, byte* out, const byte* in, } return 0; } +#endif /* HAVE_AES_DECRYPT */ #endif /* HAVE_CAVIUM */ diff --git a/wolfcrypt/src/curve25519.c b/wolfcrypt/src/curve25519.c index 56c5f04e0..c49af3c5c 100644 --- a/wolfcrypt/src/curve25519.c +++ b/wolfcrypt/src/curve25519.c @@ -39,10 +39,10 @@ #endif const curve25519_set_type curve25519_sets[] = { -{ + { 32, "CURVE25519", -} + } }; @@ -79,6 +79,8 @@ int wc_curve25519_make_key(WC_RNG* rng, int keysize, curve25519_key* key) return ret; } +#ifdef HAVE_CURVE25519_SHARED_SECRET + int wc_curve25519_shared_secret(curve25519_key* private_key, curve25519_key* public_key, byte* out, word32* outlen) @@ -125,6 +127,10 @@ int wc_curve25519_shared_secret_ex(curve25519_key* private_key, return ret; } +#endif /* HAVE_CURVE25519_SHARED_SECRET */ + +#ifdef HAVE_CURVE25519_KEY_EXPORT + /* export curve25519 public key (Big endian) * return 0 on success */ int wc_curve25519_export_public(curve25519_key* key, byte* out, word32* outLen) @@ -165,6 +171,10 @@ int wc_curve25519_export_public_ex(curve25519_key* key, byte* out, return 0; } +#endif /* HAVE_CURVE25519_KEY_EXPORT */ + +#ifdef HAVE_CURVE25519_KEY_IMPORT + /* import curve25519 public key (Big endian) * return 0 on success */ int wc_curve25519_import_public(const byte* in, word32 inLen, @@ -204,6 +214,10 @@ int wc_curve25519_import_public_ex(const byte* in, word32 inLen, return 0; } +#endif /* HAVE_CURVE25519_KEY_IMPORT */ + + +#ifdef HAVE_CURVE25519_KEY_EXPORT /* export curve25519 private key only raw (Big endian) * outLen is in/out size @@ -276,6 +290,9 @@ int wc_curve25519_export_key_raw_ex(curve25519_key* key, return wc_curve25519_export_public_ex(key, pub, pubSz, endian); } +#endif /* HAVE_CURVE25519_KEY_EXPORT */ + +#ifdef HAVE_CURVE25519_KEY_IMPORT /* curve25519 private key import (Big endian) * Public key to match private key needs to be imported too @@ -348,6 +365,9 @@ int wc_curve25519_import_private_ex(const byte* priv, word32 privSz, return 0; } +#endif /* HAVE_CURVE25519_KEY_IMPORT */ + + int wc_curve25519_init(curve25519_key* key) { if (key == NULL) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 3376b9252..853b3ddf5 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -65,6 +65,7 @@ ECC Curves: #include #include #include +#include #ifdef HAVE_ECC_ENCRYPT #include @@ -3017,7 +3018,8 @@ int wc_ecc_import_x963(const byte* in, word32 inLen, ecc_key* key) } } if (ecc_sets[x].size == 0) { - err = ASN_PARSE_E; + WOLFSSL_MSG("ecc_set size not found"); + err = ASN_PARSE_E; } else { /* set the idx */ key->idx = x; @@ -3257,6 +3259,7 @@ int wc_ecc_import_raw(ecc_key* key, const char* qx, const char* qy, } } if (ecc_sets[x].size == 0) { + WOLFSSL_MSG("ecc_set curve name not found"); err = ASN_PARSE_E; } else { /* set the curve */ diff --git a/wolfcrypt/src/ed25519.c b/wolfcrypt/src/ed25519.c index ef4510f42..98d70e42d 100644 --- a/wolfcrypt/src/ed25519.c +++ b/wolfcrypt/src/ed25519.c @@ -79,6 +79,7 @@ int wc_ed25519_make_key(WC_RNG* rng, int keySz, ed25519_key* key) } +#ifdef HAVE_ED25519_SIGN /* in contains the message to sign inlen is the length of the message to sign @@ -164,6 +165,9 @@ int wc_ed25519_sign_msg(const byte* in, word32 inlen, byte* out, return ret; } +#endif /* HAVE_ED25519_SIGN */ + +#ifdef HAVE_ED25519_VERIFY /* sig is array of bytes containing the signature @@ -238,6 +242,8 @@ int wc_ed25519_verify_msg(byte* sig, word32 siglen, const byte* msg, return ret; } +#endif /* HAVE_ED25519_VERIFY */ + /* initialize information and memory for key */ int wc_ed25519_init(ed25519_key* key) @@ -261,6 +267,8 @@ void wc_ed25519_free(ed25519_key* key) } +#ifdef HAVE_ED25519_KEY_EXPORT + /* outLen should contain the size of out buffer when input. outLen is than set to the final output length. @@ -283,7 +291,10 @@ int wc_ed25519_export_public(ed25519_key* key, byte* out, word32* outLen) return 0; } +#endif /* HAVE_ED25519_KEY_EXPORT */ + +#ifdef HAVE_ED25519_KEY_IMPORT /* Imports a compressed/uncompressed public key. in the byte array containing the public key @@ -357,6 +368,10 @@ int wc_ed25519_import_private_key(const byte* priv, word32 privSz, return ret; } +#endif /* HAVE_ED25519_KEY_IMPORT */ + + +#ifdef HAVE_ED25519_KEY_EXPORT /* export private key only (secret part so 32 bytes) @@ -424,6 +439,9 @@ int wc_ed25519_export_key(ed25519_key* key, return ret; } +#endif /* HAVE_ED25519_KEY_EXPORT */ + + /* returns the private key size (secret only) in bytes */ int wc_ed25519_size(ed25519_key* key) { diff --git a/wolfcrypt/src/include.am b/wolfcrypt/src/include.am index 299921579..28707ce21 100644 --- a/wolfcrypt/src/include.am +++ b/wolfcrypt/src/include.am @@ -43,6 +43,7 @@ EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \ wolfcrypt/src/port/ti/ti-des3.c \ wolfcrypt/src/port/ti/ti-hash.c \ wolfcrypt/src/port/ti/ti-ccm.c \ - wolfcrypt/src/port/pic32/pic32mz-hash.c + wolfcrypt/src/port/pic32/pic32mz-hash.c \ + wolfcrypt/src/port/nrf51.c diff --git a/wolfcrypt/src/port/nrf51.c b/wolfcrypt/src/port/nrf51.c new file mode 100644 index 000000000..9bc656b90 --- /dev/null +++ b/wolfcrypt/src/port/nrf51.c @@ -0,0 +1,215 @@ +/* nrf51.c + * + * Copyright (C) 2006-2015 wolfSSL Inc. + * + * This file is part of wolfSSL. (formerly known as CyaSSL) + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include + +#ifdef WOLFSSL_NRF51 + +#include "bsp.h" +#include "nrf_delay.h" +#include "app_uart.h" +#include "app_error.h" +#include "nrf_drv_rng.h" +#include "nrf_drv_rtc.h" +#include "nrf_drv_clock.h" +#include "nrf_ecb.h" + +#ifdef SOFTDEVICE_PRESENT + #include "softdevice_handler.h" + #include "nrf_soc.h" +#endif /* SOFTDEVICE_PRESENT */ + +/* RTC */ +#ifndef NO_CRYPT_BENCHMARK +static byte mRtcInitDone = 0; +static int mRtcSec = 0; +const nrf_drv_rtc_t rtc = NRF_DRV_RTC_INSTANCE(0); /**< Declaring an instance of nrf_drv_rtc for RTC0. */ +#endif /* !NO_CRYPT_BENCHMARK */ + +/* AES */ +#if !defined(NO_AES) && !defined(SOFTDEVICE_PRESENT) + static byte mAesInitDone = 0; +#endif + +/** @brief Function for getting vector of random numbers. + * + * @param[out] p_buff Pointer to unit8_t buffer for storing the bytes. + * @param[in] length Number of bytes to take from pool and place in p_buff. + * + * @retval 0 = Success, else error + */ +int nrf51_random_generate(byte* output, word32 size) +{ + int remaining = size, length, pos = 0; + uint8_t available; + uint32_t err_code; + + /* Make sure RNG is running */ + err_code = nrf_drv_rng_init(NULL); + if (NRF_SUCCESS != NRF_SUCCESS && err_code != NRF_ERROR_INVALID_STATE) { + return -1; + } + + while (remaining > 0) { + err_code = nrf_drv_rng_bytes_available(&available); + if (err_code == NRF_SUCCESS) { + length = (remaining < available) ? remaining : available; + if (length > 0) { + err_code = nrf_drv_rng_rand(&output[pos], length); + remaining -= length; + pos += length; + } + } + + if (err_code != NRF_SUCCESS) { + break; + } + } + + return (err_code == NRF_SUCCESS) ? 0 : -1; +} + +#if !defined(NO_AES) && defined(WOLFSSL_NRF51_AES) + +#ifdef SOFTDEVICE_PRESENT +static const byte* nRF51AesKey = NULL; +#endif +int nrf51_aes_set_key(const byte* key) +{ +#ifdef SOFTDEVICE_PRESENT + nRF51AesKey = key; +#else + if (!mAesInitDone) { + nrf_ecb_init(); + mAesInitDone = 1; + } + nrf_ecb_set_key(key); +#endif + return 0; +} + + +int nrf51_aes_encrypt(const byte* in, const byte* key, word32 rounds, byte* out) +{ + uint32_t err_code = 0; +#ifdef SOFTDEVICE_PRESENT + nrf_ecb_hal_data_t ecb_hal_data; +#endif + + /* Set key */ + nrf51_aes_set_key(key); + +#ifdef SOFTDEVICE_PRESENT + /* Define ECB record */ + XMEMCPY(ecb_hal_data.key, nRF51AesKey, SOC_ECB_KEY_LENGTH); + XMEMCPY(ecb_hal_data.cleartext, in, SOC_ECB_CLEARTEXT_LENGTH); + XMEMSET(ecb_hal_data.ciphertext, 0, SOC_ECB_CIPHERTEXT_LENGTH); + + /* Perform block encrypt */ + err_code = sd_ecb_block_encrypt(&ecb_hal_data); + if (err_code != NRF_SUCCESS) { + return -1; + } + + /* Grab result */ + XMEMCPY(out, ecb_hal_data.ciphertext, SOC_ECB_CIPHERTEXT_LENGTH); +#else + err_code = nrf_ecb_crypt(out, in); + err_code = err_code ? 0 : -1; +#endif + + return err_code; +} + +#endif /* !NO_AES && WOLFSSL_NRF51_AES */ + + +#ifndef NO_CRYPT_BENCHMARK +static void rtc_handler(nrf_drv_rtc_int_type_t int_type) +{ + if (int_type == NRF_DRV_RTC_INT_COMPARE0) + { + mRtcSec++; + nrf_drv_rtc_counter_clear(&rtc); + nrf_drv_rtc_int_enable(&rtc, RTC_CHANNEL_INT_MASK(0)); + +#ifdef BSP_LED_0 + nrf_gpio_pin_toggle(BSP_LED_0); +#endif + } +} + +static void rtc_config(void) +{ + uint32_t err_code; + + // Start the internal LFCLK XTAL oscillator + err_code = nrf_drv_clock_init(NULL); + APP_ERROR_CHECK(err_code); + + nrf_drv_clock_lfclk_request(); + + // Initialize RTC instance + err_code = nrf_drv_rtc_init(&rtc, NULL, rtc_handler); + APP_ERROR_CHECK(err_code); + + // Enable tick event + nrf_drv_rtc_tick_enable(&rtc, false); + + // Set compare channel to trigger interrupt after 1 seconds + err_code = nrf_drv_rtc_cc_set(&rtc, 0, RTC0_CONFIG_FREQUENCY, true); + APP_ERROR_CHECK(err_code); + + // Power on RTC instance + nrf_drv_rtc_enable(&rtc); +} + +static int rtc_get_ms(void) +{ + /* Prescaler is 12-bit for COUNTER: frequency = (32768/(PRESCALER+1)) */ + int frequency = (32768 / (rtc_prescaler_get(rtc.p_reg) + 1)); + int counter = nrf_drv_rtc_counter_get(&rtc); + + /* Convert with rounding frequency to milliseconds */ + return ((counter * 1000) + (frequency / 2) ) / frequency; +} + +double current_time(int reset) +{ + double time; + + if (!mRtcInitDone) { + rtc_config(); + mRtcInitDone = 1; + } + + time = mRtcSec; + time += (double)rtc_get_ms() / 1000; + + return time; +} +#endif /* !NO_CRYPT_BENCHMARK */ + +#endif /* WOLFSSL_NRF51 */ diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index e889bf50b..1840ebd32 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -1366,6 +1366,42 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) return 0; } +#elif defined(WOLFSSL_NRF51) + #include "app_error.h" + #include "nrf_drv_rng.h" + int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) + { + int remaining = sz, length, pos = 0; + uint8_t available; + uint32_t err_code; + + (void)os; + + /* Make sure RNG is running */ + err_code = nrf_drv_rng_init(NULL); + if (NRF_SUCCESS != NRF_SUCCESS && err_code != NRF_ERROR_INVALID_STATE) { + return -1; + } + + while (remaining > 0) { + err_code = nrf_drv_rng_bytes_available(&available); + if (err_code == NRF_SUCCESS) { + length = (remaining < available) ? remaining : available; + if (length > 0) { + err_code = nrf_drv_rng_rand(&output[pos], length); + remaining -= length; + pos += length; + } + } + + if (err_code != NRF_SUCCESS) { + break; + } + } + + return (err_code == NRF_SUCCESS) ? 0 : -1; + } + #elif defined(CUSTOM_RAND_GENERATE) /* Implement your own random generation function diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 922bfda4c..c667252fe 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -141,6 +141,10 @@ #include "wolfcrypt/test/test.h" +#ifdef USE_WOLFSSL_MEMORY + #include "wolfssl/mem_track.h" +#endif + typedef struct testVector { const char* input; @@ -258,6 +262,10 @@ int wolfcrypt_test(void* args) ((func_args*)args)->return_code = -1; /* error state */ +#ifdef USE_WOLFSSL_MEMORY + InitMemoryTracker(); +#endif + #ifdef HAVE_FIPS wolfCrypt_SetCb_fips(myFipsCb); #endif @@ -586,6 +594,10 @@ int wolfcrypt_test(void* args) printf( "PKCS7signed test passed!\n"); #endif +#ifdef USE_WOLFSSL_MEMORY + ShowMemoryTracker(); +#endif + ((func_args*)args)->return_code = ret; return ret; @@ -2607,6 +2619,11 @@ int aes_test(void) Aes enc; Aes dec; + byte cipher[AES_BLOCK_SIZE * 4]; + byte plain [AES_BLOCK_SIZE * 4]; + int ret = 0; + +#ifdef HAVE_AES_CBC const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */ 0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, @@ -2622,10 +2639,6 @@ int aes_test(void) byte key[] = "0123456789abcdef "; /* align */ byte iv[] = "1234567890abcdef "; /* align */ - byte cipher[AES_BLOCK_SIZE * 4]; - byte plain [AES_BLOCK_SIZE * 4]; - int ret; - #ifdef HAVE_CAVIUM if (wc_AesInitCavium(&enc, CAVIUM_DEV_ID) != 0) return -20003; @@ -2642,13 +2655,14 @@ int aes_test(void) ret = wc_AesCbcEncrypt(&enc, cipher, msg, AES_BLOCK_SIZE); if (ret != 0) return -1005; +#ifdef HAVE_AES_DECRYPT ret = wc_AesCbcDecrypt(&dec, plain, cipher, AES_BLOCK_SIZE); if (ret != 0) return -1006; if (memcmp(plain, msg, AES_BLOCK_SIZE)) return -60; - +#endif /* HAVE_AES_DECRYPT */ if (memcmp(cipher, verify, AES_BLOCK_SIZE)) return -61; @@ -2656,6 +2670,8 @@ int aes_test(void) wc_AesFreeCavium(&enc); wc_AesFreeCavium(&dec); #endif +#endif /* HAVE_AES_CBC */ + #ifdef WOLFSSL_AES_COUNTER { const byte ctrKey[] = @@ -2780,7 +2796,7 @@ int aes_test(void) } #endif /* WOLFSSL_AESNI && WOLFSSL_AES_DIRECT */ - return 0; + return ret; } #ifdef HAVE_AESGCM @@ -3553,12 +3569,52 @@ int idea_test(void) wc_FreeRng(&rng); } - + return 0; } #endif /* HAVE_IDEA */ +static int random_rng_test(void) +{ + WC_RNG rng; + byte block[32]; + int ret, i; + +#ifdef HAVE_CAVIUM + ret = wc_InitRngCavium(&rng, CAVIUM_DEV_ID); + if (ret != 0) return -2007; +#endif + ret = wc_InitRng(&rng); + if (ret != 0) return -39; + + XMEMSET(block, 0, sizeof(block)); + + ret = wc_RNG_GenerateBlock(&rng, block, sizeof(block)); + if (ret != 0) { + ret = -40; + goto exit; + } + + /* Check for 0's */ + for (i=0; i<(int)sizeof(block); i++) { + if (block[i] == 0) { + ret++; + } + } + /* All zeros count check */ + if (ret >= (int)sizeof(block)) { + ret = -38; + goto exit; + } + +exit: + /* Make sure and free RNG */ + wc_FreeRng(&rng); + + return ret; +} + #if (defined(HAVE_HASHDRBG) || defined(NO_RC4)) && !defined(CUSTOM_RAND_GENERATE_BLOCK) int random_test(void) @@ -3632,6 +3688,9 @@ int random_test(void) if (XMEMCMP(test2Output, output, sizeof(output)) != 0) return -42; + /* Basic RNG generate block test */ + random_rng_test(); + return 0; } @@ -3639,21 +3698,8 @@ int random_test(void) int random_test(void) { - WC_RNG rng; - byte block[32]; - int ret; - -#ifdef HAVE_CAVIUM - ret = wc_InitRngCavium(&rng, CAVIUM_DEV_ID); - if (ret != 0) return -2007; -#endif - ret = wc_InitRng(&rng); - if (ret != 0) return -39; - - ret = wc_RNG_GenerateBlock(&rng, block, sizeof(block)); - if (ret != 0) return -40; - - wc_FreeRng(&rng); + /* Basic RNG generate block test */ + random_rng_test(); return 0; } @@ -5612,9 +5658,9 @@ static int generate_random_salt(byte *buf, word32 size) return -1; if (buf && size && wc_InitRng(&rng) == 0) { - ret = wc_RNG_GenerateBlock(&rng, (byte *)buf, size); + ret = wc_RNG_GenerateBlock(&rng, (byte *)buf, size); - wc_FreeRng(&rng); + wc_FreeRng(&rng); } return ret; @@ -5660,7 +5706,7 @@ int srp_test(void) word32 v_size = sizeof(verifier); /* generating random salt */ - + r = generate_random_salt(salt, sizeof(salt)); /* client knows username and password. */ @@ -6162,32 +6208,93 @@ int hkdf_test(void) #ifdef HAVE_ECC +#ifndef HAVE_ECC_VECTOR_TEST +#if defined(HAVE_ECC192) || defined(HAVE_ECC224) || !defined(NO_ECC256) || \ + defined(HAVE_ECC384) || defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES) + #define HAVE_ECC_VECTOR_TEST +#endif +#endif + +#ifdef HAVE_ECC_VECTOR_TEST typedef struct rawEccVector { - const char* msg; + const char* msg; /* SHA-1 Encoded Message */ const char* Qx; const char* Qy; - const char* d; + const char* d; /* Private Key */ const char* R; const char* S; const char* curveName; size_t msgLen; } rawEccVector; +static int ecc_test_raw_vector(const rawEccVector* vector, ecc_key* userA, + byte* sig, word32 sigSz) +{ + int ret, verify; + word32 x; + + wc_ecc_free(userA); + wc_ecc_init(userA); + + memset(sig, 0, sigSz); + x = sigSz; + + ret = wc_ecc_import_raw(userA, vector->Qx, vector->Qy, + vector->d, vector->curveName); + if (ret != 0) + return -1018; + + ret = wc_ecc_rs_to_sig(vector->R, vector->S, sig, &x); + if (ret != 0) + return -1019; + + ret = wc_ecc_verify_hash(sig, x, (byte*)vector->msg, (word32)vector->msgLen, &verify, userA); + if (ret != 0) + return -1021; + + if (verify != 1) + return -1023; + + return 0; +} +#endif /* HAVE_ECC_VECTOR_TEST */ + int ecc_test(void) { WC_RNG rng; +#ifdef BENCH_EMBEDDED + byte sharedA[32]; + byte sharedB[32]; +#else byte sharedA[1024]; byte sharedB[1024]; -#if !defined(NO_ASN) || \ - ( !defined(NO_SHA) && ((defined(HAVE_ECC192) && defined(HAVE_ECC224)) \ - || defined(HAVE_ALL_CURVES))) - byte sig[1024]; - int verify; #endif - byte digest[20]; +#ifdef HAVE_ECC_KEY_EXPORT byte exportBuf[1024]; +#elif !defined(NO_ECC256) + /* Export is used to test import, so if export is not enabled, + use this pre-defined value (P-256 Only) */ + const byte exportBuf[] = { + 0x04, 0xb6, 0x1f, 0xf9, 0x71, 0xe3, 0x5b, 0x8d, 0xa7, 0xad, 0x9c, 0xd8, + 0x8f, 0x25, 0x09, 0xe7, 0x3f, 0x91, 0x10, 0xe5, 0x4e, 0x84, 0x5d, 0xee, + 0xe8, 0xc6, 0x9c, 0xd9, 0x84, 0x8e, 0xd9, 0x85, 0x0d, 0x73, 0x7f, 0x6e, + 0x63, 0x9a, 0x74, 0xe0, 0x1b, 0x6c, 0x55, 0x2f, 0xdd, 0xc6, 0x16, 0x72, + 0x52, 0x75, 0x6c, 0x12, 0x77, 0x38, 0x56, 0xf2, 0x20, 0xef, 0xe5, 0x76, + 0x59, 0x0d, 0x97, 0xd9, 0x94, + }; +#endif word32 x, y; - int i, ret; +#if defined(HAVE_ECC_VECTOR_TEST) || defined(HAVE_ECC_SIGN) + byte sig[1024]; +#endif /* HAVE_ECC_VECTOR_TEST || HAVE_ECC_SIGN */ +#if defined(HAVE_ECC_SIGN) + byte digest[20]; + int i; +#ifdef HAVE_ECC_VERIFY + int verify; +#endif /* HAVE_ECC_VERIFY */ +#endif /* HAVE_ECC_SIGN */ + int ret; ecc_key userA, userB, pubKey; ret = wc_InitRng(&rng); @@ -6199,7 +6306,6 @@ int ecc_test(void) wc_ecc_init(&pubKey); ret = wc_ecc_make_key(&rng, 32, &userA); - if (ret != 0) return -1014; @@ -6208,19 +6314,17 @@ int ecc_test(void) return -1024; ret = wc_ecc_make_key(&rng, 32, &userB); - if (ret != 0) return -1002; +#ifdef HAVE_ECC_DHE x = sizeof(sharedA); ret = wc_ecc_shared_secret(&userA, &userB, sharedA, &x); - if (ret != 0) return -1015; y = sizeof(sharedB); ret = wc_ecc_shared_secret(&userB, &userA, sharedB, &y); - if (ret != 0) return -1003; @@ -6229,162 +6333,238 @@ int ecc_test(void) if (memcmp(sharedA, sharedB, x)) return -1005; +#endif /* HAVE_ECC_DHE */ +#if defined(HAVE_ECC_KEY_EXPORT) || (defined(HAVE_ECC_KEY_IMPORT) && !defined(NO_ECC256)) x = sizeof(exportBuf); +#ifdef HAVE_ECC_KEY_EXPORT ret = wc_ecc_export_x963(&userA, exportBuf, &x); if (ret != 0) return -1006; +#endif /* HAVE_ECC_KEY_EXPORT */ +#if defined(HAVE_ECC_KEY_IMPORT) && (defined(HAVE_ECC_KEY_EXPORT) || !defined(NO_ECC256)) ret = wc_ecc_import_x963(exportBuf, x, &pubKey); - if (ret != 0) return -1007; +#endif +#if defined(HAVE_ECC_DHE) && defined(HAVE_ECC_KEY_IMPORT) && defined(HAVE_ECC_KEY_EXPORT) y = sizeof(sharedB); ret = wc_ecc_shared_secret(&userB, &pubKey, sharedB, &y); - if (ret != 0) return -1008; if (memcmp(sharedA, sharedB, y)) return -1009; +#endif /* HAVE_ECC_DHE */ +#endif #ifdef HAVE_COMP_KEY /* try compressed export / import too */ x = sizeof(exportBuf); +#ifdef HAVE_ECC_KEY_EXPORT ret = wc_ecc_export_x963_ex(&userA, exportBuf, &x, 1); if (ret != 0) return -1010; - wc_ecc_free(&pubKey); wc_ecc_init(&pubKey); +#if HAVE_ECC_KEY_IMPORT ret = wc_ecc_import_x963(exportBuf, x, &pubKey); - if (ret != 0) return -1011; -#endif +#endif /* HAVE_ECC_KEY_IMPORT */ +#endif /* HAVE_ECC_KEY_EXPORT */ +#if defined(HAVE_ECC_DHE) && defined(HAVE_ECC_KEY_IMPORT) && defined(HAVE_ECC_KEY_EXPORT) y = sizeof(sharedB); ret = wc_ecc_shared_secret(&userB, &pubKey, sharedB, &y); - if (ret != 0) return -1012; if (memcmp(sharedA, sharedB, y)) return -1013; +#endif /* HAVE_ECC_DHE */ +#endif /* HAVE_COMP_KEY */ +#ifdef HAVE_ECC_SIGN /* test DSA sign hash */ for (i = 0; i < (int)sizeof(digest); i++) digest[i] = (byte)i; -#ifndef NO_ASN x = sizeof(sig); ret = wc_ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &userA); if (ret != 0) return -1014; +#ifdef HAVE_ECC_VERIFY verify = 0; ret = wc_ecc_verify_hash(sig, x, digest, sizeof(digest), &verify, &userA); - if (ret != 0) return -1015; - if (verify != 1) return -1016; -#endif +#endif /* HAVE_ECC_VERIFY */ +#endif /* HAVE_ECC_SIGN */ +#ifdef HAVE_ECC_KEY_EXPORT x = sizeof(exportBuf); ret = wc_ecc_export_private_only(&userA, exportBuf, &x); if (ret != 0) return -1017; +#endif /* HAVE_ECC_KEY_EXPORT */ -#if !defined(NO_SHA) && \ - ((defined(HAVE_ECC192) && defined(HAVE_ECC224)) || defined(HAVE_ALL_CURVES)) +#ifdef HAVE_ECC_VECTOR_TEST +#if defined(HAVE_ECC192) || defined(HAVE_ALL_CURVES) { - /* test raw ECC key import */ - Sha sha; - byte hash[SHA_DIGEST_SIZE]; - rawEccVector a, b; - rawEccVector test_ecc[2]; - int times = sizeof(test_ecc) / sizeof(rawEccVector); - + rawEccVector ecc192; /* first [P-192,SHA-1] vector from FIPS 186-3 NIST vectors */ - a.msg = "\xeb\xf7\x48\xd7\x48\xeb\xbc\xa7\xd2\x9f\xb4\x73\x69\x8a" - "\x6e\x6b\x4f\xb1\x0c\x86\x5d\x4a\xf0\x24\xcc\x39\xae\x3d" - "\xf3\x46\x4b\xa4\xf1\xd6\xd4\x0f\x32\xbf\x96\x18\xa9\x1b" - "\xb5\x98\x6f\xa1\xa2\xaf\x04\x8a\x0e\x14\xdc\x51\xe5\x26" - "\x7e\xb0\x5e\x12\x7d\x68\x9d\x0a\xc6\xf1\xa7\xf1\x56\xce" - "\x06\x63\x16\xb9\x71\xcc\x7a\x11\xd0\xfd\x7a\x20\x93\xe2" - "\x7c\xf2\xd0\x87\x27\xa4\xe6\x74\x8c\xc3\x2f\xd5\x9c\x78" - "\x10\xc5\xb9\x01\x9d\xf2\x1c\xdc\xc0\xbc\xa4\x32\xc0\xa3" - "\xee\xd0\x78\x53\x87\x50\x88\x77\x11\x43\x59\xce\xe4\xa0" - "\x71\xcf"; - a.msgLen = 128; - a.Qx = "07008ea40b08dbe76432096e80a2494c94982d2d5bcf98e6"; - a.Qy = "76fab681d00b414ea636ba215de26d98c41bd7f2e4d65477"; - a.d = "e14f37b3d1374ff8b03f41b9b3fdd2f0ebccf275d660d7f3"; - a.R = "6994d962bdd0d793ffddf855ec5bf2f91a9698b46258a63e"; - a.S = "02ba6465a234903744ab02bc8521405b73cf5fc00e1a9f41"; - a.curveName = "ECC-192"; - - /* first [P-224,SHA-1] vector from FIPS 186-3 NIST vectors */ - b.msg = "\x36\xc8\xb2\x29\x86\x48\x7f\x67\x7c\x18\xd0\x97\x2a\x9e" - "\x20\x47\xb3\xaf\xa5\x9e\xc1\x62\x76\x4e\xc3\x0b\x5b\x69" - "\xe0\x63\x0f\x99\x0d\x4e\x05\xc2\x73\xb0\xe5\xa9\xd4\x28" - "\x27\xb6\x95\xfc\x2d\x64\xd9\x13\x8b\x1c\xf4\xc1\x21\x55" - "\x89\x4c\x42\x13\x21\xa7\xbb\x97\x0b\xdc\xe0\xfb\xf0\xd2" - "\xae\x85\x61\xaa\xd8\x71\x7f\x2e\x46\xdf\xe3\xff\x8d\xea" - "\xb4\xd7\x93\x23\x56\x03\x2c\x15\x13\x0d\x59\x9e\x26\xc1" - "\x0f\x2f\xec\x96\x30\x31\xac\x69\x38\xa1\x8d\x66\x45\x38" - "\xb9\x4d\xac\x55\x34\xef\x7b\x59\x94\x24\xd6\x9b\xe1\xf7" - "\x1c\x20"; - b.msgLen = 128; - b.Qx = "8a4dca35136c4b70e588e23554637ae251077d1365a6ba5db9585de7"; - b.Qy = "ad3dee06de0be8279d4af435d7245f14f3b4f82eb578e519ee0057b1"; - b.d = "97c4b796e1639dd1035b708fc00dc7ba1682cec44a1002a1a820619f"; - b.R = "147b33758321e722a0360a4719738af848449e2c1d08defebc1671a7"; - b.S = "24fc7ed7f1352ca3872aa0916191289e2e04d454935d50fe6af3ad5b"; - b.curveName = "ECC-224"; - - test_ecc[0] = a; - test_ecc[1] = b; - - for (i = 0; i < times; i++) { - - wc_ecc_free(&userA); - wc_ecc_init(&userA); - - memset(sig, 0, sizeof(sig)); - x = sizeof(sig); - - /* calculate SHA-1 hash of message */ - ret = wc_InitSha(&sha); - if (ret != 0) - return -1015 - i; - - wc_ShaUpdate(&sha, (byte*)test_ecc[i].msg, (word32)test_ecc[i].msgLen); - wc_ShaFinal(&sha, hash); - - ret = wc_ecc_import_raw(&userA, test_ecc[i].Qx, test_ecc[i].Qy, - test_ecc[i].d, test_ecc[i].curveName); - if (ret != 0) - return -1017 - i; - - ret = wc_ecc_rs_to_sig(test_ecc[i].R, test_ecc[i].S, sig, &x); - if (ret != 0) - return -1019 - i; - - ret = wc_ecc_verify_hash(sig, x, hash, sizeof(hash), &verify, &userA); - if (ret != 0) - return -1021 - i; - - if (verify != 1) - return -1023 - i; - } +#if 1 + ecc192.msg = "\x60\x80\x79\x42\x3f\x12\x42\x1d\xe6\x16\xb7\x49\x3e\xbe\x55\x1c\xf4\xd6\x5b\x92"; + ecc192.msgLen = 20; +#else + /* This is the raw message prior to SHA-1 */ + ecc192.msg = + "\xeb\xf7\x48\xd7\x48\xeb\xbc\xa7\xd2\x9f\xb4\x73\x69\x8a\x6e\x6b" + "\x4f\xb1\x0c\x86\x5d\x4a\xf0\x24\xcc\x39\xae\x3d\xf3\x46\x4b\xa4" + "\xf1\xd6\xd4\x0f\x32\xbf\x96\x18\xa9\x1b\xb5\x98\x6f\xa1\xa2\xaf" + "\x04\x8a\x0e\x14\xdc\x51\xe5\x26\x7e\xb0\x5e\x12\x7d\x68\x9d\x0a" + "\xc6\xf1\xa7\xf1\x56\xce\x06\x63\x16\xb9\x71\xcc\x7a\x11\xd0\xfd" + "\x7a\x20\x93\xe2\x7c\xf2\xd0\x87\x27\xa4\xe6\x74\x8c\xc3\x2f\xd5" + "\x9c\x78\x10\xc5\xb9\x01\x9d\xf2\x1c\xdc\xc0\xbc\xa4\x32\xc0\xa3" + "\xee\xd0\x78\x53\x87\x50\x88\x77\x11\x43\x59\xce\xe4\xa0\x71\xcf"; + ecc192.msgLen = 128; +#endif + ecc192.Qx = "07008ea40b08dbe76432096e80a2494c94982d2d5bcf98e6"; + ecc192.Qy = "76fab681d00b414ea636ba215de26d98c41bd7f2e4d65477"; + ecc192.d = "e14f37b3d1374ff8b03f41b9b3fdd2f0ebccf275d660d7f3"; + ecc192.R = "6994d962bdd0d793ffddf855ec5bf2f91a9698b46258a63e"; + ecc192.S = "02ba6465a234903744ab02bc8521405b73cf5fc00e1a9f41"; + ecc192.curveName = "ECC-192"; + ret = ecc_test_raw_vector(&ecc192, &userA, sig, sizeof(sig)); } -#endif /* defined(HAVE_ECC192) && defined(HAVE_ECC256) */ - +#endif /* HAVE_ECC192 */ +#if defined(HAVE_ECC224) || defined(HAVE_ALL_CURVES) + { + rawEccVector ecc224; + /* first [P-224,SHA-1] vector from FIPS 186-3 NIST vectors */ +#if 1 + ecc224.msg = "\xb9\xa3\xb8\x6d\xb0\xba\x99\xfd\xc6\xd2\x94\x6b\xfe\xbe\x9c\xe8\x3f\x10\x74\xfc"; + ecc224.msgLen = 20; +#else + /* This is the raw message prior to SHA-1 */ + ecc224.msg = + "\x36\xc8\xb2\x29\x86\x48\x7f\x67\x7c\x18\xd0\x97\x2a\x9e\x20\x47" + "\xb3\xaf\xa5\x9e\xc1\x62\x76\x4e\xc3\x0b\x5b\x69\xe0\x63\x0f\x99" + "\x0d\x4e\x05\xc2\x73\xb0\xe5\xa9\xd4\x28\x27\xb6\x95\xfc\x2d\x64" + "\xd9\x13\x8b\x1c\xf4\xc1\x21\x55\x89\x4c\x42\x13\x21\xa7\xbb\x97" + "\x0b\xdc\xe0\xfb\xf0\xd2\xae\x85\x61\xaa\xd8\x71\x7f\x2e\x46\xdf" + "\xe3\xff\x8d\xea\xb4\xd7\x93\x23\x56\x03\x2c\x15\x13\x0d\x59\x9e" + "\x26\xc1\x0f\x2f\xec\x96\x30\x31\xac\x69\x38\xa1\x8d\x66\x45\x38" + "\xb9\x4d\xac\x55\x34\xef\x7b\x59\x94\x24\xd6\x9b\xe1\xf7\x1c\x20"; + ecc224.msgLen = 128; +#endif + ecc224.Qx = "8a4dca35136c4b70e588e23554637ae251077d1365a6ba5db9585de7"; + ecc224.Qy = "ad3dee06de0be8279d4af435d7245f14f3b4f82eb578e519ee0057b1"; + ecc224.d = "97c4b796e1639dd1035b708fc00dc7ba1682cec44a1002a1a820619f"; + ecc224.R = "147b33758321e722a0360a4719738af848449e2c1d08defebc1671a7"; + ecc224.S = "24fc7ed7f1352ca3872aa0916191289e2e04d454935d50fe6af3ad5b"; + ecc224.curveName = "ECC-224"; + ret = ecc_test_raw_vector(&ecc224, &userA, sig, sizeof(sig)); + } +#endif /* HAVE_ECC192 */ +#if !defined(NO_ECC256) || defined(HAVE_ALL_CURVES) + { + rawEccVector ecc256; + /* first [P-256,SHA-1] vector from FIPS 186-3 NIST vectors */ +#if 1 + ecc256.msg = "\xa3\xf9\x1a\xe2\x1b\xa6\xb3\x03\x98\x64\x47\x2f\x18\x41\x44\xc6\xaf\x62\xcd\x0e"; + ecc256.msgLen = 20; +#else + /* This is the raw message prior to SHA-1 */ + ecc256.msg = + "\xa2\x4b\x21\x76\x2e\x6e\xdb\x15\x3c\xc1\x14\x38\xdb\x0e\x92\xcd" + "\xf5\x2b\x86\xb0\x6c\xa9\x70\x16\x06\x27\x59\xc7\x0d\x36\xd1\x56" + "\x2c\xc9\x63\x0d\x7f\xc7\xc7\x74\xb2\x8b\x54\xe3\x1e\xf5\x58\x72" + "\xb2\xa6\x5d\xf1\xd7\xec\x26\xde\xbb\x33\xe7\xd9\x27\xef\xcc\xf4" + "\x6b\x63\xde\x52\xa4\xf4\x31\xea\xca\x59\xb0\x5d\x2e\xde\xc4\x84" + "\x5f\xff\xc0\xee\x15\x03\x94\xd6\x1f\x3d\xfe\xcb\xcd\xbf\x6f\x5a" + "\x73\x38\xd0\xbe\x3f\x2a\x77\x34\x51\x98\x3e\xba\xeb\x48\xf6\x73" + "\x8f\xc8\x95\xdf\x35\x7e\x1a\x48\xa6\x53\xbb\x35\x5a\x31\xa1\xb4" + ecc256.msgLen = 128; +#endif + ecc256.Qx = "fa2737fb93488d19caef11ae7faf6b7f4bcd67b286e3fc54e8a65c2b74aeccb0"; + ecc256.Qy = "d4ccd6dae698208aa8c3a6f39e45510d03be09b2f124bfc067856c324f9b4d09"; + ecc256.d = "be34baa8d040a3b991f9075b56ba292f755b90e4b6dc10dad36715c33cfdac25"; + ecc256.R = "2b826f5d44e2d0b6de531ad96b51e8f0c56fdfead3c236892e4d84eacfc3b75c"; + ecc256.S = "a2248b62c03db35a7cd63e8a120a3521a89d3d2f61ff99035a2148ae32e3a248"; + ecc256.curveName = "nistp256"; + ret = ecc_test_raw_vector(&ecc256, &userA, sig, sizeof(sig)); + } +#endif /* !NO_ECC256 */ +#if defined(HAVE_ECC384) || defined(HAVE_ALL_CURVES) + { + rawEccVector ecc384; + /* first [P-384,SHA-1] vector from FIPS 186-3 NIST vectors */ +#if 1 + ecc384.msg = "\x9b\x9f\x8c\x95\x35\xa5\xca\x26\x60\x5d\xb7\xf2\xfa\x57\x3b\xdf\xc3\x2e\xab\x8b"; + ecc384.msgLen = 20; +#else + /* This is the raw message prior to SHA-1 */ + ecc384.msg = + "\xab\xe1\x0a\xce\x13\xe7\xe1\xd9\x18\x6c\x48\xf7\x88\x9d\x51\x47" + "\x3d\x3a\x09\x61\x98\x4b\xc8\x72\xdf\x70\x8e\xcc\x3e\xd3\xb8\x16" + "\x9d\x01\xe3\xd9\x6f\xc4\xf1\xd5\xea\x00\xa0\x36\x92\xbc\xc5\xcf" + "\xfd\x53\x78\x7c\x88\xb9\x34\xaf\x40\x4c\x03\x9d\x32\x89\xb5\xba" + "\xc5\xae\x7d\xb1\x49\x68\x75\xb5\xdc\x73\xc3\x09\xf9\x25\xc1\x3d" + "\x1c\x01\xab\xda\xaf\xeb\xcd\xac\x2c\xee\x43\x39\x39\xce\x8d\x4a" + "\x0a\x5d\x57\xbb\x70\x5f\x3b\xf6\xec\x08\x47\x95\x11\xd4\xb4\xa3" + "\x21\x1f\x61\x64\x9a\xd6\x27\x43\x14\xbf\x0d\x43\x8a\x81\xe0\x60" + ecc384.msgLen = 128; +#endif + ecc384.Qx = "e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef868"; + ecc384.Qy = "28f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e"; + ecc384.d = "a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71"; + ecc384.R = "6820b8585204648aed63bdff47f6d9acebdea62944774a7d14f0e14aa0b9a5b99545b2daee6b3c74ebf606667a3f39b7"; + ecc384.S = "491af1d0cccd56ddd520b233775d0bc6b40a6255cc55207d8e9356741f23c96c14714221078dbd5c17f4fdd89b32a907"; + ecc384.curveName = "nistp384"; + ret = ecc_test_raw_vector(&ecc384, &userA, sig, sizeof(sig)); + } +#endif /* HAVE_ECC384 */ +#if defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES) + { + rawEccVector ecc521; + /* first [P-521,SHA-1] vector from FIPS 186-3 NIST vectors */ +#if 1 + ecc521.msg = "\x1b\xf7\x03\x9c\xca\x23\x94\x27\x3f\x11\xa1\xd4\x8d\xcc\xb4\x46\x6f\x31\x61\xdf"; + ecc521.msgLen = 20; +#else + /* This is the raw message prior to SHA-1 */ + ecc521.msg = + "\x50\x3f\x79\x39\x34\x0a\xc7\x23\xcd\x4a\x2f\x4e\x6c\xcc\x27\x33" + "\x38\x3a\xca\x2f\xba\x90\x02\x19\x9d\x9e\x1f\x94\x8b\xe0\x41\x21" + "\x07\xa3\xfd\xd5\x14\xd9\x0c\xd4\xf3\x7c\xc3\xac\x62\xef\x00\x3a" + "\x2d\xb1\xd9\x65\x7a\xb7\x7f\xe7\x55\xbf\x71\xfa\x59\xe4\xd9\x6e" + "\xa7\x2a\xe7\xbf\x9d\xe8\x7d\x79\x34\x3b\xc1\xa4\xbb\x14\x4d\x16" + "\x28\xd1\xe9\xe9\xc8\xed\x80\x8b\x96\x2c\x54\xe5\xf9\x6d\x53\xda" + "\x14\x7a\x96\x38\xf9\x4a\x91\x75\xd8\xed\x61\x05\x5f\x0b\xa5\x73" + "\xa8\x2b\xb7\xe0\x18\xee\xda\xc4\xea\x7b\x36\x2e\xc8\x9c\x38\x2b" + ecc521.msgLen = 128; +#endif + ecc521.Qx = "12fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23"; + ecc521.Qy = "09cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d"; + ecc521.d = "1bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74"; + ecc521.R = "0bd117b4807710898f9dd7778056485777668f0e78e6ddf5b000356121eb7a220e9493c7f9a57c077947f89ac45d5acb6661bbcd17abb3faea149ba0aa3bb1521be"; + ecc521.S = "019cd2c5c3f9870ecdeb9b323abdf3a98cd5e231d85c6ddc5b71ab190739f7f226e6b134ba1d5889ddeb2751dabd97911dff90c34684cdbe7bb669b6c3d22f2480c"; + ecc521.curveName = "nistp521"; + ret = ecc_test_raw_vector(&ecc521, &userA, sig, sizeof(sig)); + } +#endif /* HAVE_ECC521 */ + if (ret != 0) { + return ret; + } +#endif /* HAVE_ECC_VECTOR_TEST */ #ifdef WOLFSSL_KEY_GEN { @@ -6574,12 +6754,18 @@ int ecc_encrypt_test(void) int curve25519_test(void) { WC_RNG rng; +#ifdef HAVE_CURVE25519_SHARED_SECRET byte sharedA[32]; byte sharedB[32]; + word32 y; +#endif +#ifdef HAVE_CURVE25519_KEY_EXPORT byte exportBuf[32]; - word32 x, y; +#endif + word32 x; curve25519_key userA, userB, pubKey; +#if defined(HAVE_CURVE25519_SHARED_SECRET) && defined(HAVE_CURVE25519_KEY_IMPORT) /* test vectors from https://tools.ietf.org/html/draft-josefsson-tls-curve25519-03 */ @@ -6623,6 +6809,7 @@ int curve25519_test(void) 0x73,0x8B,0x99,0xF0,0x94,0x68,0xB8,0xD6, 0xB8,0x51,0x11,0x84,0xD5,0x34,0x94,0xAB }; +#endif /* HAVE_CURVE25519_SHARED_SECRET */ if (wc_InitRng(&rng) != 0) return -1001; @@ -6638,6 +6825,7 @@ int curve25519_test(void) if (wc_curve25519_make_key(&rng, 32, &userB) != 0) return -1003; +#ifdef HAVE_CURVE25519_SHARED_SECRET /* find shared secret key */ x = sizeof(sharedA); if (wc_curve25519_shared_secret(&userA, &userB, sharedA, &x) != 0) @@ -6653,15 +6841,21 @@ int curve25519_test(void) if (XMEMCMP(sharedA, sharedB, x)) return -1007; +#endif +#ifdef HAVE_CURVE25519_KEY_EXPORT /* export a public key and import it for another user */ x = sizeof(exportBuf); if (wc_curve25519_export_public(&userA, exportBuf, &x) != 0) return -1008; +#ifdef HAVE_CURVE25519_KEY_IMPORT if (wc_curve25519_import_public(exportBuf, x, &pubKey) != 0) return -1009; +#endif +#endif +#if defined(HAVE_CURVE25519_SHARED_SECRET) && defined(HAVE_CURVE25519_KEY_IMPORT) /* test shared key after importing a public key */ XMEMSET(sharedB, 0, sizeof(sharedB)); y = sizeof(sharedB); @@ -6720,6 +6914,7 @@ int curve25519_test(void) if (XMEMCMP(sharedA, sharedB, x)) return -1023; +#endif /* HAVE_CURVE25519_SHARED_SECRET */ /* clean up keys when done */ wc_curve25519_free(&pubKey); @@ -6737,17 +6932,25 @@ int curve25519_test(void) int ed25519_test(void) { WC_RNG rng; +#if defined(HAVE_ED25519_SIGN) && defined(HAVE_ED25519_KEY_EXPORT) &&\ + defined(HAVE_ED25519_KEY_IMPORT) byte out[ED25519_SIG_SIZE]; byte exportPKey[ED25519_KEY_SIZE]; byte exportSKey[ED25519_KEY_SIZE]; - word32 outlen; word32 exportPSz; word32 exportSSz; + int i; + word32 outlen; +#ifdef HAVE_ED25519_VERIFY + int verify; +#endif /* HAVE_ED25519_VERIFY */ +#endif /* HAVE_ED25519_SIGN && HAVE_ED25519_KEY_EXPORT && HAVE_ED25519_KEY_IMPORT */ word32 keySz, sigSz; - int i, verify; ed25519_key key; ed25519_key key2; +#if defined(HAVE_ED25519_SIGN) && defined(HAVE_ED25519_KEY_EXPORT) && \ + defined(HAVE_ED25519_KEY_IMPORT) /* test vectors from https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-02 */ @@ -7060,6 +7263,7 @@ int ed25519_test(void) static const byte* msgs[] = { msg1, msg2, msg3, msg1, msg1, msg4}; static const word16 msgSz[] = {0 /*sizeof(msg1)*/, sizeof(msg2), sizeof(msg3), 0 /*sizeof(msg1)*/, 0 /*sizeof(msg1)*/, sizeof(msg4)}; +#endif /* HAVE_ED25519_SIGN && HAVE_ED25519_KEY_EXPORT && HAVE_ED25519_KEY_IMPORT */ /* create ed25519 keys */ wc_InitRng(&rng); @@ -7072,6 +7276,8 @@ int ed25519_test(void) keySz = wc_ed25519_size(&key); sigSz = wc_ed25519_sig_size(&key); +#if defined(HAVE_ED25519_SIGN) && defined(HAVE_ED25519_KEY_EXPORT) &&\ + defined(HAVE_ED25519_KEY_IMPORT) for (i = 0; i < 6; i++) { outlen = sizeof(out); XMEMSET(out, 0, sizeof(out)); @@ -7087,6 +7293,7 @@ int ed25519_test(void) if (XMEMCMP(out, sigs[i], 64)) return -1033 - i; +#if defined(HAVE_ED25519_VERIFY) /* test verify on good msg */ if (wc_ed25519_verify_msg(out, outlen, msgs[i], msgSz[i], &verify, &key) != 0 || verify != 1) @@ -7097,6 +7304,7 @@ int ed25519_test(void) if (wc_ed25519_verify_msg(out, outlen, msgs[i], msgSz[i], &verify, &key) == 0 || verify == 1) return -1045 - i; +#endif /* HAVE_ED25519_VERIFY */ /* test api for import/exporting keys */ exportPSz = sizeof(exportPKey); @@ -7120,13 +7328,16 @@ int ed25519_test(void) if (wc_ed25519_sign_msg(msgs[i], msgSz[i], out, &outlen, &key2) != 0) return -1075 - i; +#if defined(HAVE_ED25519_VERIFY) if (wc_ed25519_verify_msg(out, outlen, msgs[i], msgSz[i], &verify, &key2) != 0 || verify != 1) return -1081 - i; if (XMEMCMP(out, sigs[i], 64)) return -1087 - i; +#endif /* HAVE_ED25519_VERIFY */ } +#endif /* HAVE_ED25519_SIGN && HAVE_ED25519_KEY_EXPORT && HAVE_ED25519_KEY_IMPORT */ /* clean up keys when done */ wc_ed25519_free(&key); diff --git a/wolfssl/include.am b/wolfssl/include.am index a02488fc8..bd5abbb6b 100644 --- a/wolfssl/include.am +++ b/wolfssl/include.am @@ -18,7 +18,8 @@ nobase_include_HEADERS+= \ wolfssl/version.h \ wolfssl/options.h \ wolfssl/ocsp.h \ - wolfssl/crl.h + wolfssl/crl.h \ + wolfssl/mem_track.h noinst_HEADERS+= \ wolfssl/internal.h diff --git a/wolfssl/mem_track.h b/wolfssl/mem_track.h new file mode 100644 index 000000000..6d5ade303 --- /dev/null +++ b/wolfssl/mem_track.h @@ -0,0 +1,157 @@ +/* mem_track.h + * + * Copyright (C) 2006-2015 wolfSSL Inc. + * + * This file is part of wolfSSL. (formerly known as CyaSSL) + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef WOLFSSL_MEM_TRACK_H +#define WOLFSSL_MEM_TRACK_H + +#ifdef USE_WOLFSSL_MEMORY + + #include "wolfssl/wolfcrypt/logging.h" + + typedef struct memoryStats { + size_t totalAllocs; /* number of allocations */ + size_t totalBytes; /* total number of bytes allocated */ + size_t peakBytes; /* concurrent max bytes */ + size_t currentBytes; /* total current bytes in use */ + } memoryStats; + + typedef struct memHint { + size_t thisSize; /* size of this memory */ + void* thisMemory; /* actual memory for user */ + } memHint; + + typedef struct memoryTrack { + union { + memHint hint; + byte alignit[16]; /* make sure we have strong alignment */ + } u; + } memoryTrack; + + #if defined(WOLFSSL_TRACK_MEMORY) + #define DO_MEM_STATS + static memoryStats ourMemStats; + #endif + + static INLINE void* TrackMalloc(size_t sz) + { + memoryTrack* mt; + + if (sz == 0) + return NULL; + + mt = (memoryTrack*)malloc(sizeof(memoryTrack) + sz); + if (mt == NULL) + return NULL; + + mt->u.hint.thisSize = sz; + mt->u.hint.thisMemory = (byte*)mt + sizeof(memoryTrack); + +#ifdef DO_MEM_STATS + ourMemStats.totalAllocs++; + ourMemStats.totalBytes += sz; + ourMemStats.currentBytes += sz; + if (ourMemStats.currentBytes > ourMemStats.peakBytes) + ourMemStats.peakBytes = ourMemStats.currentBytes; +#endif + + return mt->u.hint.thisMemory; + } + + + static INLINE void TrackFree(void* ptr) + { + memoryTrack* mt; + + if (ptr == NULL) { + return; + } + + mt = (memoryTrack*)ptr; + --mt; /* same as minus sizeof(memoryTrack), removes header */ + +#ifdef DO_MEM_STATS + ourMemStats.currentBytes -= mt->u.hint.thisSize; +#endif + + free(mt); + } + + + static INLINE void* TrackRealloc(void* ptr, size_t sz) + { + void* ret = TrackMalloc(sz); + + if (ptr) { + /* if realloc is bigger, don't overread old ptr */ + memoryTrack* mt = (memoryTrack*)ptr; + --mt; /* same as minus sizeof(memoryTrack), removes header */ + + if (mt->u.hint.thisSize < sz) + sz = mt->u.hint.thisSize; + } + + if (ret && ptr) + memcpy(ret, ptr, sz); + + if (ret) + TrackFree(ptr); + + return ret; + } + + static INLINE int InitMemoryTracker(void) + { + int ret = 0; + ret = wolfSSL_SetAllocators(TrackMalloc, TrackFree, TrackRealloc); + if (ret != 0) { + WOLFSSL_MSG("wolfSSL SetAllocators failed for track memory"); + return ret; + } + + #ifdef DO_MEM_STATS + ourMemStats.totalAllocs = 0; + ourMemStats.totalBytes = 0; + ourMemStats.peakBytes = 0; + ourMemStats.currentBytes = 0; + #endif + + return ret; + } + + static INLINE void ShowMemoryTracker(void) + { + #ifdef DO_MEM_STATS + printf("total Allocs = %9lu\n", + (unsigned long)ourMemStats.totalAllocs); + printf("total Bytes = %9lu\n", + (unsigned long)ourMemStats.totalBytes); + printf("peak Bytes = %9lu\n", + (unsigned long)ourMemStats.peakBytes); + printf("current Bytes = %9lu\n", + (unsigned long)ourMemStats.currentBytes); + #endif + } + +#endif /* USE_WOLFSSL_MEMORY */ + +#endif /* WOLFSSL_MEM_TRACK_H */ + \ No newline at end of file diff --git a/wolfssl/test.h b/wolfssl/test.h index 1b1db4575..ba571237c 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -10,6 +10,7 @@ #include #include #include +#include #ifdef ATOMIC_USER #include @@ -1246,129 +1247,6 @@ static INLINE int OpenNitroxDevice(int dma_mode,int dev_id) } #endif /* !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_KEIL_FS) && !defined(WOLFSSL_TIRTOS) */ - -#ifdef USE_WOLFSSL_MEMORY - - typedef struct memoryStats { - size_t totalAllocs; /* number of allocations */ - size_t totalBytes; /* total number of bytes allocated */ - size_t peakBytes; /* concurrent max bytes */ - size_t currentBytes; /* total current bytes in use */ - } memoryStats; - - typedef struct memHint { - size_t thisSize; /* size of this memory */ - void* thisMemory; /* actual memory for user */ - } memHint; - - typedef struct memoryTrack { - union { - memHint hint; - byte alignit[16]; /* make sure we have strong alignment */ - } u; - } memoryTrack; - - #if defined(WOLFSSL_TRACK_MEMORY) - #define DO_MEM_STATS - static memoryStats ourMemStats; - #endif - - static INLINE void* TrackMalloc(size_t sz) - { - memoryTrack* mt; - - if (sz == 0) - return NULL; - - mt = (memoryTrack*)malloc(sizeof(memoryTrack) + sz); - if (mt == NULL) - return NULL; - - mt->u.hint.thisSize = sz; - mt->u.hint.thisMemory = (byte*)mt + sizeof(memoryTrack); - -#ifdef DO_MEM_STATS - ourMemStats.totalAllocs++; - ourMemStats.totalBytes += sz; - ourMemStats.currentBytes += sz; - if (ourMemStats.currentBytes > ourMemStats.peakBytes) - ourMemStats.peakBytes = ourMemStats.currentBytes; -#endif - - return mt->u.hint.thisMemory; - } - - - static INLINE void TrackFree(void* ptr) - { - memoryTrack* mt; - - if (ptr == NULL) - return; - - mt = (memoryTrack*)ptr; - --mt; /* same as minus sizeof(memoryTrack), removes header */ - -#ifdef DO_MEM_STATS - ourMemStats.currentBytes -= mt->u.hint.thisSize; -#endif - - free(mt); - } - - - static INLINE void* TrackRealloc(void* ptr, size_t sz) - { - void* ret = TrackMalloc(sz); - - if (ptr) { - /* if realloc is bigger, don't overread old ptr */ - memoryTrack* mt = (memoryTrack*)ptr; - --mt; /* same as minus sizeof(memoryTrack), removes header */ - - if (mt->u.hint.thisSize < sz) - sz = mt->u.hint.thisSize; - } - - if (ret && ptr) - memcpy(ret, ptr, sz); - - if (ret) - TrackFree(ptr); - - return ret; - } - - static INLINE void InitMemoryTracker(void) - { - if (wolfSSL_SetAllocators(TrackMalloc, TrackFree, TrackRealloc) != 0) - err_sys("wolfSSL SetAllocators failed for track memory"); - - #ifdef DO_MEM_STATS - ourMemStats.totalAllocs = 0; - ourMemStats.totalBytes = 0; - ourMemStats.peakBytes = 0; - ourMemStats.currentBytes = 0; - #endif - } - - static INLINE void ShowMemoryTracker(void) - { - #ifdef DO_MEM_STATS - printf("total Allocs = %9lu\n", - (unsigned long)ourMemStats.totalAllocs); - printf("total Bytes = %9lu\n", - (unsigned long)ourMemStats.totalBytes); - printf("peak Bytes = %9lu\n", - (unsigned long)ourMemStats.peakBytes); - printf("current Bytes = %9lu\n", - (unsigned long)ourMemStats.currentBytes); - #endif - } - -#endif /* USE_WOLFSSL_MEMORY */ - - #ifdef HAVE_STACK_SIZE typedef THREAD_RETURN WOLFSSL_THREAD (*thread_func)(void* args); diff --git a/wolfssl/wolfcrypt/include.am b/wolfssl/wolfcrypt/include.am index d72d24583..14f162a45 100644 --- a/wolfssl/wolfcrypt/include.am +++ b/wolfssl/wolfcrypt/include.am @@ -59,4 +59,5 @@ nobase_include_HEADERS+= \ noinst_HEADERS+= \ wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h \ wolfssl/wolfcrypt/port/ti/ti-hash.h \ - wolfssl/wolfcrypt/port/ti/ti-ccm.h + wolfssl/wolfcrypt/port/ti/ti-ccm.h \ + wolfssl/wolfcrypt/port/nrf51.h diff --git a/wolfssl/wolfcrypt/port/nrf51.h b/wolfssl/wolfcrypt/port/nrf51.h new file mode 100644 index 000000000..53b6927c2 --- /dev/null +++ b/wolfssl/wolfcrypt/port/nrf51.h @@ -0,0 +1,43 @@ +/* nrf51.h + * + * Copyright (C) 2006-2015 wolfSSL Inc. + * + * This file is part of wolfSSL. (formerly known as CyaSSL) + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef WOLFSSL_NRF51_PORT_H +#define WOLFSSL_NRF51_PORT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* Public Functions */ +int nrf51_random_generate(byte* output, word32 sz); + +int nrf51_aes_set_key(const byte* key); +int nrf51_aes_encrypt(const byte* in, const byte* key, word32 rounds, byte* out); + +double current_time(int reset); + +#ifdef __cplusplus +} +#endif + +#endif /* WOLFSSL_NRF51_PORT_H */ diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 96940c356..ed76ceb11 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -1029,6 +1029,61 @@ static char *fgets(char *buff, int sz, FILE *fp) #endif #endif /* HAVE_ECC */ +/* Curve255519 Configs */ +#ifdef HAVE_CURVE25519 + /* By default enable shared secret, key export and import */ + #ifndef NO_CURVE25519_SHARED_SECRET + #undef HAVE_CURVE25519_SHARED_SECRET + #define HAVE_CURVE25519_SHARED_SECRET + #endif + #ifndef NO_CURVE25519_KEY_EXPORT + #undef HAVE_CURVE25519_KEY_EXPORT + #define HAVE_CURVE25519_KEY_EXPORT + #endif + #ifndef NO_CURVE25519_KEY_IMPORT + #undef HAVE_CURVE25519_KEY_IMPORT + #define HAVE_CURVE25519_KEY_IMPORT + #endif +#endif /* HAVE_CURVE25519 */ + +/* Ed255519 Configs */ +#ifdef HAVE_ED25519 + /* By default enable sign, verify, key export and import */ + #ifndef NO_ED25519_SIGN + #undef HAVE_ED25519_SIGN + #define HAVE_ED25519_SIGN + #endif + #ifndef NO_ED25519_VERIFY + #undef HAVE_ED25519_VERIFY + #define HAVE_ED25519_VERIFY + #endif + #ifndef NO_ED25519_KEY_EXPORT + #undef HAVE_ED25519_KEY_EXPORT + #define HAVE_ED25519_KEY_EXPORT + #endif + #ifndef NO_ED25519_KEY_IMPORT + #undef HAVE_ED25519_KEY_IMPORT + #define HAVE_ED25519_KEY_IMPORT + #endif +#endif /* HAVE_ED25519 */ + +/* AES Config */ +#ifndef NO_AES + /* By default enable all AES key sizes, decryption and CBC */ + #ifndef AES_MAX_KEY_SIZE + #undef AES_MAX_KEY_SIZE + #define AES_MAX_KEY_SIZE 256 + #endif + #ifndef NO_AES_DECRYPT + #undef HAVE_AES_DECRYPT + #define HAVE_AES_DECRYPT + #endif + #ifndef NO_AES_CBC + #undef HAVE_AES_CBC + #define HAVE_AES_CBC + #endif +#endif + /* if desktop type system and fastmath increase default max bits */ #ifdef WOLFSSL_X86_64_BUILD #ifdef USE_FAST_MATH From bf058ef1b9a0b60ffa7121af5e559f05ffef1869 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 15 Mar 2016 17:18:03 -0700 Subject: [PATCH 053/192] Fixed Jenkins error reports for mem_track msg, incorrect #ifdef in aes_test and ecc_test_raw_vector response code checking. Fixed C89 compliance with wc_AesSetKey. Fixed nrf_drv_rng_init response checks in RNG code. Reverted comment change in AES. Fixed nRF51 AES CBC Encrypt support. Added response code checking for nrf51_aes_set_key. --- wolfcrypt/src/aes.c | 59 +++++++++----------------------------- wolfcrypt/src/port/nrf51.c | 8 ++++-- wolfcrypt/src/random.c | 2 +- wolfcrypt/test/test.c | 20 ++++++++++--- wolfssl/mem_track.h | 2 +- 5 files changed, 37 insertions(+), 54 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index a949ea8fe..6c52b7aed 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -1124,7 +1124,7 @@ static void wc_AesEncrypt(Aes* aes, const byte* inBlock, byte* outBlock) printf("sz = %d\n", AES_BLOCK_SIZE); #endif - /* check alignment, encrypt doesn't need alignment */ + /* check alignment, decrypt doesn't need alignment */ if ((wolfssl_word)inBlock % 16) { #ifndef NO_WOLFSSL_ALLOC_ALIGN byte* tmp = (byte*)XMALLOC(AES_BLOCK_SIZE, NULL, @@ -1746,24 +1746,26 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) int wc_AesSetKey(Aes* aes, const byte* userKey, word32 keylen, const byte* iv, int dir) { + #if defined(AES_MAX_KEY_SIZE) + const word32 max_key_len = (AES_MAX_KEY_SIZE / 8); + #endif if (!((keylen == 16) || (keylen == 24) || (keylen == 32))) return BAD_FUNC_ARG; + #if defined(AES_MAX_KEY_SIZE) /* Check key length */ - #if defined(AES_MAX_KEY_SIZE) - const word32 max_key_len = (AES_MAX_KEY_SIZE / 8); - if (keylen > max_key_len) { - return BAD_FUNC_ARG; - } - #endif + if (keylen > max_key_len) { + return BAD_FUNC_ARG; + } + #endif - #ifdef HAVE_CAVIUM + #ifdef HAVE_CAVIUM if (aes->magic == WOLFSSL_AES_CAVIUM_MAGIC) return wc_AesCaviumSetKey(aes, userKey, keylen, iv); - #endif + #endif - #ifdef WOLFSSL_AESNI + #ifdef WOLFSSL_AESNI if (checkAESNI == 0) { haveAESNI = Check_CPU_support_AES(); checkAESNI = 1; @@ -1779,7 +1781,7 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) return AES_set_decrypt_key(userKey, keylen * 8, aes); #endif } - #endif /* WOLFSSL_AESNI */ + #endif /* WOLFSSL_AESNI */ return wc_AesSetKeyLocal(aes, userKey, keylen, iv, dir); } @@ -2359,41 +2361,6 @@ int wc_AesSetIV(Aes* aes, const byte* iv) return 0 ; } #endif /* HAVE_AES_DECRYPT */ -#elif defined(WOLFSSL_NRF51_AES) - int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) - { - int i, ret; - int offset = 0; - int len = sz; - - byte *iv; - byte temp_block[AES_BLOCK_SIZE]; - - iv = (byte*)aes->reg; - - while (len > 0) - { - XMEMCPY(temp_block, in + offset, AES_BLOCK_SIZE); - - /* XOR block with IV for CBC */ - for (i = 0; i < AES_BLOCK_SIZE; i++) { - temp_block[i] ^= iv[i]; - } - - ret = wc_AesEncrypt(aes, temp_block, out + offset); - if (ret != 0) { - return ret; - } - - len -= AES_BLOCK_SIZE; - offset += AES_BLOCK_SIZE; - - /* store IV for next block */ - XMEMCPY(iv, out + offset - AES_BLOCK_SIZE, AES_BLOCK_SIZE); - } - - return 0; - } #else int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) diff --git a/wolfcrypt/src/port/nrf51.c b/wolfcrypt/src/port/nrf51.c index 9bc656b90..eaae360b2 100644 --- a/wolfcrypt/src/port/nrf51.c +++ b/wolfcrypt/src/port/nrf51.c @@ -68,7 +68,7 @@ int nrf51_random_generate(byte* output, word32 size) /* Make sure RNG is running */ err_code = nrf_drv_rng_init(NULL); - if (NRF_SUCCESS != NRF_SUCCESS && err_code != NRF_ERROR_INVALID_STATE) { + if (err_code != NRF_SUCCESS && err_code != NRF_ERROR_INVALID_STATE) { return -1; } @@ -113,13 +113,17 @@ int nrf51_aes_set_key(const byte* key) int nrf51_aes_encrypt(const byte* in, const byte* key, word32 rounds, byte* out) { + int ret; uint32_t err_code = 0; #ifdef SOFTDEVICE_PRESENT nrf_ecb_hal_data_t ecb_hal_data; #endif /* Set key */ - nrf51_aes_set_key(key); + ret = nrf51_aes_set_key(key); + if (ret != 0) { + return ret; + } #ifdef SOFTDEVICE_PRESENT /* Define ECB record */ diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 1840ebd32..904dab67e 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -1379,7 +1379,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) /* Make sure RNG is running */ err_code = nrf_drv_rng_init(NULL); - if (NRF_SUCCESS != NRF_SUCCESS && err_code != NRF_ERROR_INVALID_STATE) { + if (err_code != NRF_SUCCESS && err_code != NRF_ERROR_INVALID_STATE) { return -1; } diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index c667252fe..396109309 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -6369,7 +6369,7 @@ int ecc_test(void) return -1010; wc_ecc_free(&pubKey); wc_ecc_init(&pubKey); -#if HAVE_ECC_KEY_IMPORT +#ifdef HAVE_ECC_KEY_IMPORT ret = wc_ecc_import_x963(exportBuf, x, &pubKey); if (ret != 0) return -1011; @@ -6443,6 +6443,9 @@ int ecc_test(void) ecc192.S = "02ba6465a234903744ab02bc8521405b73cf5fc00e1a9f41"; ecc192.curveName = "ECC-192"; ret = ecc_test_raw_vector(&ecc192, &userA, sig, sizeof(sig)); + if (ret != 0) { + return ret; + } } #endif /* HAVE_ECC192 */ #if defined(HAVE_ECC224) || defined(HAVE_ALL_CURVES) @@ -6472,6 +6475,9 @@ int ecc_test(void) ecc224.S = "24fc7ed7f1352ca3872aa0916191289e2e04d454935d50fe6af3ad5b"; ecc224.curveName = "ECC-224"; ret = ecc_test_raw_vector(&ecc224, &userA, sig, sizeof(sig)); + if (ret != 0) { + return ret; + } } #endif /* HAVE_ECC192 */ #if !defined(NO_ECC256) || defined(HAVE_ALL_CURVES) @@ -6501,6 +6507,9 @@ int ecc_test(void) ecc256.S = "a2248b62c03db35a7cd63e8a120a3521a89d3d2f61ff99035a2148ae32e3a248"; ecc256.curveName = "nistp256"; ret = ecc_test_raw_vector(&ecc256, &userA, sig, sizeof(sig)); + if (ret != 0) { + return ret; + } } #endif /* !NO_ECC256 */ #if defined(HAVE_ECC384) || defined(HAVE_ALL_CURVES) @@ -6530,6 +6539,9 @@ int ecc_test(void) ecc384.S = "491af1d0cccd56ddd520b233775d0bc6b40a6255cc55207d8e9356741f23c96c14714221078dbd5c17f4fdd89b32a907"; ecc384.curveName = "nistp384"; ret = ecc_test_raw_vector(&ecc384, &userA, sig, sizeof(sig)); + if (ret != 0) { + return ret; + } } #endif /* HAVE_ECC384 */ #if defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES) @@ -6559,11 +6571,11 @@ int ecc_test(void) ecc521.S = "019cd2c5c3f9870ecdeb9b323abdf3a98cd5e231d85c6ddc5b71ab190739f7f226e6b134ba1d5889ddeb2751dabd97911dff90c34684cdbe7bb669b6c3d22f2480c"; ecc521.curveName = "nistp521"; ret = ecc_test_raw_vector(&ecc521, &userA, sig, sizeof(sig)); + if (ret != 0) { + return ret; + } } #endif /* HAVE_ECC521 */ - if (ret != 0) { - return ret; - } #endif /* HAVE_ECC_VECTOR_TEST */ #ifdef WOLFSSL_KEY_GEN diff --git a/wolfssl/mem_track.h b/wolfssl/mem_track.h index 6d5ade303..32af33695 100644 --- a/wolfssl/mem_track.h +++ b/wolfssl/mem_track.h @@ -123,7 +123,7 @@ int ret = 0; ret = wolfSSL_SetAllocators(TrackMalloc, TrackFree, TrackRealloc); if (ret != 0) { - WOLFSSL_MSG("wolfSSL SetAllocators failed for track memory"); + printf("wolfSSL SetAllocators failed for track memory\n"); return ret; } From f0ea9d747fd6f20ad0f89792c44b3f05428ae7d2 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 15 Mar 2016 18:33:24 -0700 Subject: [PATCH 054/192] Fix possible positive return value for random_rng_test. Removed reference to nrf51_aes_decrypt, which is not supported, and added compile error for it. Corrected ecc_test_raw_vector return code checking. Cleanup in InitMemoryTracker. --- wolfcrypt/src/aes.c | 5 +---- wolfcrypt/test/test.c | 11 ++++++----- wolfssl/mem_track.h | 5 ++--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 6c52b7aed..0123bbedd 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -267,10 +267,7 @@ void wc_AesFreeCavium(Aes* aes) return nrf51_aes_encrypt(inBlock, (byte*)aes->key, aes->rounds, outBlock); } #ifdef HAVE_AES_DECRYPT - static int wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) - { - return nrf51_aes_decrypt(inBlock, (byte*)aes->key, aes->rounds, outBlock); - } + #error nRF51 AES Hardware does not support decrypt #endif /* HAVE_AES_DECRYPT */ #else diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 396109309..6d844df43 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -3607,6 +3607,7 @@ static int random_rng_test(void) ret = -38; goto exit; } + ret = 0; exit: /* Make sure and free RNG */ @@ -6443,7 +6444,7 @@ int ecc_test(void) ecc192.S = "02ba6465a234903744ab02bc8521405b73cf5fc00e1a9f41"; ecc192.curveName = "ECC-192"; ret = ecc_test_raw_vector(&ecc192, &userA, sig, sizeof(sig)); - if (ret != 0) { + if (ret < 0) { return ret; } } @@ -6475,7 +6476,7 @@ int ecc_test(void) ecc224.S = "24fc7ed7f1352ca3872aa0916191289e2e04d454935d50fe6af3ad5b"; ecc224.curveName = "ECC-224"; ret = ecc_test_raw_vector(&ecc224, &userA, sig, sizeof(sig)); - if (ret != 0) { + if (ret < 0) { return ret; } } @@ -6507,7 +6508,7 @@ int ecc_test(void) ecc256.S = "a2248b62c03db35a7cd63e8a120a3521a89d3d2f61ff99035a2148ae32e3a248"; ecc256.curveName = "nistp256"; ret = ecc_test_raw_vector(&ecc256, &userA, sig, sizeof(sig)); - if (ret != 0) { + if (ret < 0) { return ret; } } @@ -6539,7 +6540,7 @@ int ecc_test(void) ecc384.S = "491af1d0cccd56ddd520b233775d0bc6b40a6255cc55207d8e9356741f23c96c14714221078dbd5c17f4fdd89b32a907"; ecc384.curveName = "nistp384"; ret = ecc_test_raw_vector(&ecc384, &userA, sig, sizeof(sig)); - if (ret != 0) { + if (ret < 0) { return ret; } } @@ -6571,7 +6572,7 @@ int ecc_test(void) ecc521.S = "019cd2c5c3f9870ecdeb9b323abdf3a98cd5e231d85c6ddc5b71ab190739f7f226e6b134ba1d5889ddeb2751dabd97911dff90c34684cdbe7bb669b6c3d22f2480c"; ecc521.curveName = "nistp521"; ret = ecc_test_raw_vector(&ecc521, &userA, sig, sizeof(sig)); - if (ret != 0) { + if (ret < 0) { return ret; } } diff --git a/wolfssl/mem_track.h b/wolfssl/mem_track.h index 32af33695..210c42d59 100644 --- a/wolfssl/mem_track.h +++ b/wolfssl/mem_track.h @@ -120,9 +120,8 @@ static INLINE int InitMemoryTracker(void) { - int ret = 0; - ret = wolfSSL_SetAllocators(TrackMalloc, TrackFree, TrackRealloc); - if (ret != 0) { + int ret = wolfSSL_SetAllocators(TrackMalloc, TrackFree, TrackRealloc); + if (ret < 0) { printf("wolfSSL SetAllocators failed for track memory\n"); return ret; } From 0683ecb7272b35d42e637d1cde9fe7ee693f0431 Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 16 Mar 2016 09:41:19 -0700 Subject: [PATCH 055/192] Fixed FreeCRL issue with strdup memory. Added additional checks for WOLF_AES_CBC and WOLF_AES_COUNTER. Disabled memory tracker by default for wolfCrypt test and benchmark. Updated README to better document Linux Binutils LD bug workaround. --- README | 4 +- src/crl.c | 69 +++++++++++++++++++-------------- src/ssl.c | 9 +++-- wolfcrypt/benchmark/benchmark.c | 22 ++++++----- wolfcrypt/src/aes.c | 22 +++++++++-- wolfcrypt/src/ecc.c | 3 +- wolfcrypt/src/wc_encrypt.c | 4 +- wolfcrypt/test/test.c | 6 ++- wolfssl/wolfcrypt/settings.h | 6 ++- 9 files changed, 90 insertions(+), 55 deletions(-) diff --git a/README b/README index efcab65e7..111dc3503 100644 --- a/README +++ b/README @@ -162,8 +162,8 @@ Release 3.6.0 of wolfSSL has bug fixes and new features including: - ECC make key crash fix on RNG failure, ECC users must update. - Improvements to usage of time code. - Improvements to VS solution files. -- GNU Binutils 2.24 ld has problems with some debug builds, to fix an ld error - add -fdebug-types-section to C_EXTRA_FLAGS +- GNU Binutils 2.24 (and late 2.23) ld has problems with some debug builds, + to fix an ld error add C_EXTRA_FLAGS="-fdebug-types-section -g1". - No high level security fixes that requires an update though we always recommend updating to the latest (except note 14, ecc RNG failure) diff --git a/src/crl.c b/src/crl.c index dde30a28e..5cdfbb20a 100644 --- a/src/crl.c +++ b/src/crl.c @@ -96,7 +96,7 @@ static int InitCRL_Entry(CRL_Entry* crle, DecodedCRL* dcrl) /* Free all CRL Entry resources */ static void FreeCRL_Entry(CRL_Entry* crle) { - RevokedCert* tmp = crle->certs; + RevokedCert* tmp = crle->certs; WOLFSSL_ENTER("FreeCRL_Entry"); @@ -195,7 +195,7 @@ int CheckCertCRL(WOLFSSL_CRL* crl, DecodedCert* cert) ret = CRL_CERT_REVOKED; break; } - rc = rc->next; + rc = rc->next; } } @@ -221,7 +221,7 @@ int CheckCertCRL(WOLFSSL_CRL* crl, DecodedCert* cert) } - return ret; + return ret; } @@ -356,16 +356,16 @@ static int SwapLists(WOLFSSL_CRL* crl) int ret; CRL_Entry* newList; #ifdef WOLFSSL_SMALL_STACK - WOLFSSL_CRL* tmp; + WOLFSSL_CRL* tmp; #else WOLFSSL_CRL tmp[1]; #endif - + #ifdef WOLFSSL_SMALL_STACK tmp = (WOLFSSL_CRL*)XMALLOC(sizeof(WOLFSSL_CRL), NULL, DYNAMIC_TYPE_TMP_BUFFER); if (tmp == NULL) return MEMORY_E; -#endif +#endif if (InitCRL(tmp, crl->cm) < 0) { WOLFSSL_MSG("Init tmp CRL failed"); @@ -536,7 +536,7 @@ static void* DoMonitor(void* arg) for (;;) { struct kevent event; int numEvents = kevent(crl->mfd, &change, 1, &event, 1, NULL); - + WOLFSSL_MSG("Got kevent"); if (numEvents == -1) { @@ -678,7 +678,7 @@ static void* DoMonitor(void* arg) FD_SET(crl->mfd, &readfds); result = select(max(notifyFd, crl->mfd) + 1, &readfds, NULL, NULL,NULL); - + WOLFSSL_MSG("Got notify event"); if (result < 0) { @@ -695,7 +695,7 @@ static void* DoMonitor(void* arg) if (length < 0) { WOLFSSL_MSG("notify read problem, continue"); continue; - } + } if (SwapLists(crl) < 0) { WOLFSSL_MSG("SwapLists problem, continue"); @@ -789,7 +789,7 @@ static int StartMonitorCRL(WOLFSSL_CRL* crl) #ifndef NO_FILESYSTEM -/* Load CRL path files of type, SSL_SUCCESS on ok */ +/* Load CRL path files of type, SSL_SUCCESS on ok */ int LoadCRL(WOLFSSL_CRL* crl, const char* path, int type, int monitor) { struct dirent* entry; @@ -832,14 +832,14 @@ int LoadCRL(WOLFSSL_CRL* crl, const char* path, int type, int monitor) if (s.st_mode & S_IFREG) { if (type == SSL_FILETYPE_PEM) { - if (strstr(entry->d_name, ".pem") == NULL) { + if (XSTRSTR(entry->d_name, ".pem") == NULL) { WOLFSSL_MSG("not .pem file, skipping"); continue; } } else { - if (strstr(entry->d_name, ".der") == NULL && - strstr(entry->d_name, ".crl") == NULL) { + if (XSTRSTR(entry->d_name, ".der") == NULL && + XSTRSTR(entry->d_name, ".crl") == NULL) { WOLFSSL_MSG("not .der or .crl file, skipping"); continue; @@ -858,27 +858,36 @@ int LoadCRL(WOLFSSL_CRL* crl, const char* path, int type, int monitor) #endif if (monitor & WOLFSSL_CRL_MONITOR) { + word32 pathLen; + char* pathBuf; + WOLFSSL_MSG("monitor path requested"); - if (type == SSL_FILETYPE_PEM) { - crl->monitors[0].path = strdup(path); - crl->monitors[0].type = SSL_FILETYPE_PEM; - if (crl->monitors[0].path == NULL) - ret = MEMORY_E; - } else { - crl->monitors[1].path = strdup(path); - crl->monitors[1].type = SSL_FILETYPE_ASN1; - if (crl->monitors[1].path == NULL) - ret = MEMORY_E; + pathLen = (word32)XSTRLEN(path); + pathBuf = (char*)XMALLOC(pathLen+1, NULL, DYNAMIC_TYPE_CRL_MONITOR); + if (pathBuf) { + XSTRNCPY(pathBuf, path, pathLen); + pathBuf[pathLen] = '\0'; /* Null Terminate */ + + if (type == SSL_FILETYPE_PEM) { + crl->monitors[0].path = pathBuf; + crl->monitors[0].type = SSL_FILETYPE_PEM; + } else { + crl->monitors[1].path = pathBuf; + crl->monitors[1].type = SSL_FILETYPE_ASN1; + } + + if (monitor & WOLFSSL_CRL_START_MON) { + WOLFSSL_MSG("start monitoring requested"); + + ret = StartMonitorCRL(crl); + } + } + else { + ret = MEMORY_E; } - - if (monitor & WOLFSSL_CRL_START_MON) { - WOLFSSL_MSG("start monitoring requested"); - - ret = StartMonitorCRL(crl); - } } - + closedir(dir); return ret; diff --git a/src/ssl.c b/src/ssl.c index dd2d392f0..5e462e1c0 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2785,7 +2785,7 @@ static int wolfssl_decrypt_buffer_key(DerBuffer* der, byte* password, ret = wc_Des3_CbcDecryptWithKey(der->buffer, der->buffer, der->length, key, info->iv); #endif /* NO_DES3 */ -#ifndef NO_AES +#if !defined(NO_AES) && defined(HAVE_AES_CBC) if (XSTRNCMP(info->name, EVP_AES_128_CBC, EVP_AES_SIZE) == 0) ret = wc_AesCbcDecryptWithKey(der->buffer, der->buffer, der->length, key, AES_128_KEY_SIZE, info->iv); @@ -2795,7 +2795,7 @@ static int wolfssl_decrypt_buffer_key(DerBuffer* der, byte* password, else if (XSTRNCMP(info->name, EVP_AES_256_CBC, EVP_AES_SIZE) == 0) ret = wc_AesCbcDecryptWithKey(der->buffer, der->buffer, der->length, key, AES_256_KEY_SIZE, info->iv); -#endif /* NO_AES */ +#endif /* !NO_AES && HAVE_AES_CBC */ #ifdef WOLFSSL_SMALL_STACK XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -9123,6 +9123,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) switch (ctx->cipherType) { #ifndef NO_AES +#ifdef HAVE_AES_CBC case AES_128_CBC_TYPE : case AES_192_CBC_TYPE : case AES_256_CBC_TYPE : @@ -9132,7 +9133,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) else ret = wc_AesCbcDecrypt(&ctx->cipher.aes, dst, src, len); break; - +#endif /* HAVE_AES_CBC */ #ifdef WOLFSSL_AES_COUNTER case AES_128_CTR_TYPE : case AES_192_CTR_TYPE : @@ -9140,7 +9141,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) WOLFSSL_MSG("AES CTR"); wc_AesCtrEncrypt(&ctx->cipher.aes, dst, src, len); break; -#endif +#endif /* WOLFSSL_AES_COUNTER */ #endif /* NO_AES */ #ifndef NO_DES3 diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 4bddb3a37..ef39a28e8 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -256,7 +256,7 @@ int benchmark_test(void *args) (void)args; #endif -#ifdef USE_WOLFSSL_MEMORY +#if defined(USE_WOLFSSL_MEMORY) && defined(WOLFSSL_TRACK_MEMORY) InitMemoryTracker(); #endif @@ -290,20 +290,21 @@ int benchmark_test(void *args) #endif #ifndef NO_AES +#ifdef HAVE_AES_CBC bench_aes(0); bench_aes(1); #endif #ifdef HAVE_AESGCM bench_aesgcm(); #endif - #ifdef WOLFSSL_AES_COUNTER bench_aesctr(); #endif - #ifdef HAVE_AESCCM bench_aesccm(); #endif +#endif /* !NO_AES */ + #ifdef HAVE_CAMELLIA bench_camellia(); #endif @@ -399,7 +400,7 @@ int benchmark_test(void *args) wc_FreeRng(&rng); #endif -#ifdef USE_WOLFSSL_MEMORY +#if defined(USE_WOLFSSL_MEMORY) && defined(WOLFSSL_TRACK_MEMORY) ShowMemoryTracker(); #endif @@ -428,6 +429,7 @@ static const char blockType[] = "megs"; /* used in printf output */ #ifndef NO_AES +#ifdef HAVE_AES_CBC void bench_aes(int show) { Aes enc; @@ -472,8 +474,7 @@ void bench_aes(int show) wc_AesFreeCavium(&enc); #endif } -#endif - +#endif /* HAVE_AES_CBC */ #if defined(HAVE_AESGCM) || defined(HAVE_AESCCM) static byte additional[13]; @@ -533,7 +534,8 @@ void bench_aesgcm(void) printf("\n"); #endif } -#endif +#endif /* HAVE_AESGCM */ + #ifdef WOLFSSL_AES_COUNTER void bench_aesctr(void) @@ -563,8 +565,7 @@ void bench_aesctr(void) SHOW_INTEL_CYCLES printf("\n"); } -#endif - +#endif /* WOLFSSL_AES_COUNTER */ #ifdef HAVE_AESCCM @@ -596,7 +597,8 @@ void bench_aesccm(void) SHOW_INTEL_CYCLES printf("\n"); } -#endif +#endif /* HAVE_AESCCM */ +#endif /* !NO_AES */ #ifdef HAVE_POLY1305 diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 0123bbedd..38565ec19 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -43,6 +43,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) } +#ifdef HAVE_AES_CBC int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) { return AesCbcEncrypt_fips(aes, out, in, sz); @@ -54,6 +55,7 @@ int wc_AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz) return AesCbcDecrypt_fips(aes, out, in, sz); } #endif /* HAVE_AES_DECRYPT */ +#endif /* HAVE_AES_CBC */ /* AES-CTR */ #ifdef WOLFSSL_AES_COUNTER @@ -252,12 +254,14 @@ void wc_AesFreeCavium(Aes* aes) static int wc_AesCaviumSetKey(Aes* aes, const byte* key, word32 length, const byte* iv); + #ifdef HAVE_AES_CBC static int wc_AesCaviumCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 length); #ifdef HAVE_AES_DECRYPT static int wc_AesCaviumCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 length); #endif /* HAVE_AES_DECRYPT */ + #endif /* HAVE_AES_CBC */ #elif defined(WOLFSSL_NRF51_AES) /* Use built-in AES hardware - AES 128 ECB Encrypt Only */ #include "wolfssl/wolfcrypt/port/nrf51.h" @@ -271,6 +275,7 @@ void wc_AesFreeCavium(Aes* aes) #endif /* HAVE_AES_DECRYPT */ #else + /* using wolfCrypt software AES implementation */ #define NEED_AES_TABLES #endif @@ -996,6 +1001,7 @@ static int haveAESNI = 0; /* tell C compiler these are asm functions in case any mix up of ABI underscore prefix between clang/gcc/llvm etc */ +#ifdef HAVE_AES_CBC void AES_CBC_encrypt(const unsigned char* in, unsigned char* out, unsigned char* ivec, unsigned long length, const unsigned char* KS, int nr) @@ -1006,8 +1012,9 @@ void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, unsigned char* ivec, unsigned long length, const unsigned char* KS, int nr) XASM_LINK("AES_CBC_decrypt"); -#endif - +#endif /* HAVE_AES_DECRYPT */ +#endif /* HAVE_AES_CBC */ + void AES_ECB_encrypt(const unsigned char* in, unsigned char* out, unsigned long length, const unsigned char* KS, int nr) XASM_LINK("AES_ECB_encrypt"); @@ -1098,6 +1105,8 @@ static int AES_set_decrypt_key(const unsigned char* userKey, const int bits, #endif /* HAVE_AES_DECRYPT */ #endif /* WOLFSSL_AESNI */ +#if defined(HAVE_AES_CBC) || defined(WOLFSSL_AES_DIRECT) ||\ + defined(HAVE_AESGCM) static void wc_AesEncrypt(Aes* aes, const byte* inBlock, byte* outBlock) { @@ -1277,8 +1286,10 @@ static void wc_AesEncrypt(Aes* aes, const byte* inBlock, byte* outBlock) XMEMCPY(outBlock + 2 * sizeof(s0), &s2, sizeof(s2)); XMEMCPY(outBlock + 3 * sizeof(s0), &s3, sizeof(s3)); } +#endif /* HAVE_AES_CBC || WOLFSSL_AES_DIRECT || HAVE_AESGCM */ #ifdef HAVE_AES_DECRYPT +#if defined(HAVE_AES_CBC) || defined(WOLFSSL_AES_DIRECT) static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) { word32 s0, s1, s2, s3; @@ -1438,6 +1449,8 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) XMEMCPY(outBlock + 3 * sizeof(s0), &s3, sizeof(s3)); } #endif /* HAVE_AES_DECRYPT */ +#endif /* HAVE_AES_CBC || WOLFSSL_AES_DIRECT */ + #endif /* NEED_AES_TABLES */ @@ -1842,6 +1855,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) /* AES-CBC */ +#ifdef HAVE_AES_CBC #ifdef STM32F2_CRYPTO int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) { @@ -2470,6 +2484,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) #endif #endif /* STM32F2_CRYPTO, AES-CBC block */ +#endif /* HAVE_AES_CBC */ /* AES-CTR */ #ifdef WOLFSSL_AES_COUNTER @@ -4246,7 +4261,7 @@ static int wc_AesCaviumSetKey(Aes* aes, const byte* key, word32 length, return wc_AesSetIV(aes, iv); } - +#ifdef HAVE_AES_CBC static int wc_AesCaviumCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 length) { @@ -4316,6 +4331,7 @@ static int wc_AesCaviumCbcDecrypt(Aes* aes, byte* out, const byte* in, return 0; } #endif /* HAVE_AES_DECRYPT */ +#endif /* HAVE_AES_CBC */ #endif /* HAVE_CAVIUM */ diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 853b3ddf5..506946388 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -5281,6 +5281,7 @@ int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg, if (ret == 0) { switch (ctx->encAlgo) { + #ifdef HAVE_AES_CBC case ecAES_128_CBC: { Aes aes; @@ -5291,7 +5292,7 @@ int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg, ret = wc_AesCbcDecrypt(&aes, out, msg, msgSz-digestSz); } break; - + #endif default: ret = BAD_FUNC_ARG; break; diff --git a/wolfcrypt/src/wc_encrypt.c b/wolfcrypt/src/wc_encrypt.c index db8390ddc..4fde7daf2 100644 --- a/wolfcrypt/src/wc_encrypt.c +++ b/wolfcrypt/src/wc_encrypt.c @@ -30,7 +30,7 @@ #include -#ifndef NO_AES +#if !defined(NO_AES) && defined(HAVE_AES_CBC) int wc_AesCbcDecryptWithKey(byte* out, const byte* in, word32 inSz, const byte* key, word32 keySz, const byte* iv) { @@ -84,7 +84,7 @@ int wc_AesCbcEncryptWithKey(byte* out, const byte* in, word32 inSz, return ret; } -#endif /* !NO_AES */ +#endif /* !NO_AES && HAVE_AES_CBC */ #ifndef NO_DES3 diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 6d844df43..434d5645d 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -262,7 +262,7 @@ int wolfcrypt_test(void* args) ((func_args*)args)->return_code = -1; /* error state */ -#ifdef USE_WOLFSSL_MEMORY +#if defined(USE_WOLFSSL_MEMORY) && defined(WOLFSSL_TRACK_MEMORY) InitMemoryTracker(); #endif @@ -594,7 +594,7 @@ int wolfcrypt_test(void* args) printf( "PKCS7signed test passed!\n"); #endif -#ifdef USE_WOLFSSL_MEMORY +#if defined(USE_WOLFSSL_MEMORY) && defined(WOLFSSL_TRACK_MEMORY) ShowMemoryTracker(); #endif @@ -2616,11 +2616,13 @@ int des3_test(void) #ifndef NO_AES int aes_test(void) { +#if defined(HAVE_AES_CBC) || defined(WOLFSSL_AES_COUNTER) Aes enc; Aes dec; byte cipher[AES_BLOCK_SIZE * 4]; byte plain [AES_BLOCK_SIZE * 4]; +#endif int ret = 0; #ifdef HAVE_AES_CBC diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index ed76ceb11..a24579cb7 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -1075,12 +1075,16 @@ static char *fgets(char *buff, int sz, FILE *fp) #define AES_MAX_KEY_SIZE 256 #endif #ifndef NO_AES_DECRYPT - #undef HAVE_AES_DECRYPT + #undef HAVE_AES_DECRYPT #define HAVE_AES_DECRYPT #endif #ifndef NO_AES_CBC #undef HAVE_AES_CBC #define HAVE_AES_CBC + #else + #ifndef WOLFCRYPT_ONLY + #error "AES CBC is required for TLS and can only be disabled for WOLFCRYPT_ONLY builds" + #endif #endif #endif From 473ea567bd848ac5d0c88f3c02275e32ae0852ac Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 16 Mar 2016 13:36:44 -0700 Subject: [PATCH 056/192] Refactor of the ChaCha hard coded variables. --- wolfcrypt/src/chacha.c | 39 +++++++++++++++++++------------------- wolfssl/wolfcrypt/chacha.h | 10 +++++++++- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/wolfcrypt/src/chacha.c b/wolfcrypt/src/chacha.c index 26972906b..3a15023c3 100644 --- a/wolfcrypt/src/chacha.c +++ b/wolfcrypt/src/chacha.c @@ -77,12 +77,12 @@ */ int wc_Chacha_SetIV(ChaCha* ctx, const byte* inIv, word32 counter) { - word32 temp[3]; /* used for alignment of memory */ + word32 temp[CHACHA_IV_WORDS];/* used for alignment of memory */ #ifdef CHACHA_AEAD_TEST word32 i; printf("NONCE : "); - for (i = 0; i < 12; i++) { + for (i = 0; i < CHACHA_IV_BYTES; i++) { printf("%02x", inIv[i]); } printf("\n\n"); @@ -91,12 +91,12 @@ int wc_Chacha_SetIV(ChaCha* ctx, const byte* inIv, word32 counter) if (ctx == NULL) return BAD_FUNC_ARG; - XMEMCPY(temp, inIv, 12); + XMEMCPY(temp, inIv, CHACHA_IV_BYTES); - ctx->X[12] = counter; /* block counter */ - ctx->X[13] = LITTLE32(temp[0]); /* fixed variable from nonce */ - ctx->X[14] = LITTLE32(temp[1]); /* counter from nonce */ - ctx->X[15] = LITTLE32(temp[2]); /* counter from nonce */ + ctx->X[CHACHA_IV_BYTES+0] = counter; /* block counter */ + ctx->X[CHACHA_IV_BYTES+1] = LITTLE32(temp[0]); /* fixed variable from nonce */ + ctx->X[CHACHA_IV_BYTES+2] = LITTLE32(temp[1]); /* counter from nonce */ + ctx->X[CHACHA_IV_BYTES+3] = LITTLE32(temp[2]); /* counter from nonce */ return 0; } @@ -174,12 +174,13 @@ int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz) /** * Converts word into bytes with rotations having been done. */ -static INLINE void wc_Chacha_wordtobyte(word32 output[16], const word32 input[16]) +static INLINE void wc_Chacha_wordtobyte(word32 output[CHACHA_CHUNK_WORDS], + const word32 input[CHACHA_CHUNK_WORDS]) { - word32 x[16]; + word32 x[CHACHA_CHUNK_WORDS]; word32 i; - for (i = 0; i < 16; i++) { + for (i = 0; i < CHACHA_CHUNK_WORDS; i++) { x[i] = input[i]; } @@ -194,11 +195,11 @@ static INLINE void wc_Chacha_wordtobyte(word32 output[16], const word32 input[16 QUARTERROUND(3, 4, 9, 14) } - for (i = 0; i < 16; i++) { + for (i = 0; i < CHACHA_CHUNK_WORDS; i++) { x[i] = PLUS(x[i], input[i]); } - for (i = 0; i < 16; i++) { + for (i = 0; i < CHACHA_CHUNK_WORDS; i++) { output[i] = LITTLE32(x[i]); } } @@ -210,7 +211,7 @@ static void wc_Chacha_encrypt_bytes(ChaCha* ctx, const byte* m, byte* c, word32 bytes) { byte* output; - word32 temp[16]; /* used to make sure aligned */ + word32 temp[CHACHA_CHUNK_WORDS]; /* used to make sure aligned */ word32 i; output = (byte*)temp; @@ -218,19 +219,19 @@ static void wc_Chacha_encrypt_bytes(ChaCha* ctx, const byte* m, byte* c, if (!bytes) return; for (;;) { wc_Chacha_wordtobyte(temp, ctx->X); - ctx->X[12] = PLUSONE(ctx->X[12]); - if (bytes <= 64) { + ctx->X[CHACHA_IV_BYTES] = PLUSONE(ctx->X[CHACHA_IV_BYTES]); + if (bytes <= CHACHA_CHUNK_BYTES) { for (i = 0; i < bytes; ++i) { c[i] = m[i] ^ output[i]; } return; } - for (i = 0; i < 64; ++i) { + for (i = 0; i < CHACHA_CHUNK_BYTES; ++i) { c[i] = m[i] ^ output[i]; } - bytes -= 64; - c += 64; - m += 64; + bytes -= CHACHA_CHUNK_BYTES; + c += CHACHA_CHUNK_BYTES; + m += CHACHA_CHUNK_BYTES; } } diff --git a/wolfssl/wolfcrypt/chacha.h b/wolfssl/wolfcrypt/chacha.h index da938c973..01a405b1f 100644 --- a/wolfssl/wolfcrypt/chacha.h +++ b/wolfssl/wolfcrypt/chacha.h @@ -30,12 +30,20 @@ extern "C" { #endif +/* Size of the IV */ +#define CHACHA_IV_WORDS 3 +#define CHACHA_IV_BYTES (CHACHA_IV_WORDS * sizeof(word32)) + +/* Size of ChaCha chunks */ +#define CHACHA_CHUNK_WORDS 16 +#define CHACHA_CHUNK_BYTES (CHACHA_CHUNK_WORDS * sizeof(word32)) + enum { CHACHA_ENC_TYPE = 7 /* cipher unique type */ }; typedef struct ChaCha { - word32 X[16]; /* state of cipher */ + word32 X[CHACHA_CHUNK_WORDS]; /* state of cipher */ } ChaCha; /** From 4c3ddac23cf92cb2d3df7da6a78bc201ccc2742d Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 16 Mar 2016 14:51:25 -0600 Subject: [PATCH 057/192] catch invalid test case of RSA-OAEP and fix cast --- wolfcrypt/src/rsa.c | 12 ++++++++++-- wolfcrypt/test/test.c | 36 +++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index 1d7c85232..12c444fed 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -421,8 +421,16 @@ static int wc_RsaPad_OAEP(const byte* input, word32 inputLen, byte* pkcsBlock, return ret; } - /* handles check of location for idx as well as psLen */ - if (inputLen > (pkcsBlockLen - 2 * hLen - 2)) { + /* handles check of location for idx as well as psLen, cast to int to check + for pkcsBlockLen(k) - 2 * hLen - 2 being negative + This check is similar to decryption where k > 2 * hLen + 2 as msg + size aproaches 0. In decryption if k is less than or equal -- then there + is no possible room for msg. + k = RSA key size + hLen = hash digest size + */ + if ((int)inputLen > ((int)pkcsBlockLen - 2 * hLen - 2)) { + WOLFSSL_MSG("OAEP pad error, message too long or hash to big for RSA key size"); #ifdef WOLFSSL_SMALL_STACK XFREE(lHash, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(seed, NULL, DYNAMIC_TYPE_TMP_BUFFER); diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 922bfda4c..fb4febe0b 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -4146,24 +4146,30 @@ int rsa_test(void) #endif /* NO_SHA256 */ #ifdef WOLFSSL_SHA512 - XMEMSET(plain, 0, sizeof(plain)); - ret = wc_RsaPublicEncrypt_ex(in, inLen, out, sizeof(out), &key, &rng, + /* Check valid RSA key size is used while using hash length of SHA512 + If key size is less than (hash length * 2) + 2 then is invalid use + and test, since OAEP padding requires this. + BAD_FUNC_ARG is returned when this case is not met */ + if (wc_RsaEncryptSize(&key) > ((int)SHA512_DIGEST_SIZE * 2) + 2) { + XMEMSET(plain, 0, sizeof(plain)); + ret = wc_RsaPublicEncrypt_ex(in, inLen, out, sizeof(out), &key, &rng, WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA512, WC_MGF1SHA512, NULL, 0); - if (ret < 0) { - free(tmp); - return -343; - } - ret = wc_RsaPrivateDecrypt_ex(out, ret, plain, sizeof(plain), &key, + if (ret < 0) { + free(tmp); + return -343; + } + ret = wc_RsaPrivateDecrypt_ex(out, ret, plain, sizeof(plain), &key, WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA512, WC_MGF1SHA512, NULL, 0); - if (ret < 0) { - free(tmp); - return -344; + if (ret < 0) { + free(tmp); + return -344; + } + if (XMEMCMP(plain, in, inLen)) { + free(tmp); + return -345; + } } - if (XMEMCMP(plain, in, inLen)) { - free(tmp); - return -345; - } - #endif /* NO_SHA */ + #endif /* WOLFSSL_SHA512 */ /* check using pkcsv15 padding with _ex API */ XMEMSET(plain, 0, sizeof(plain)); From 2dd5efd96972c7ed0167907664130814ca9258b3 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 16 Mar 2016 15:25:52 -0600 Subject: [PATCH 058/192] sanity check for RSA key size and hash digest size --- wolfcrypt/src/rsa.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index 12c444fed..c1cd2f7a7 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -427,10 +427,19 @@ static int wc_RsaPad_OAEP(const byte* input, word32 inputLen, byte* pkcsBlock, size aproaches 0. In decryption if k is less than or equal -- then there is no possible room for msg. k = RSA key size - hLen = hash digest size + hLen = hash digest size -- will always be >= 0 at this point */ - if ((int)inputLen > ((int)pkcsBlockLen - 2 * hLen - 2)) { - WOLFSSL_MSG("OAEP pad error, message too long or hash to big for RSA key size"); + if ((word32)(2 * hLen + 2) > pkcsBlockLen) { + WOLFSSL_MSG("OAEP pad error hash to big for RSA key size"); + #ifdef WOLFSSL_SMALL_STACK + XFREE(lHash, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(seed, NULL, DYNAMIC_TYPE_TMP_BUFFER); + #endif + return BAD_FUNC_ARG; + } + + if (inputLen > (pkcsBlockLen - 2 * hLen - 2)) { + WOLFSSL_MSG("OAEP pad error message too long"); #ifdef WOLFSSL_SMALL_STACK XFREE(lHash, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(seed, NULL, DYNAMIC_TYPE_TMP_BUFFER); From bda69decc11b136a87f508680f18cbe368a465dd Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 16 Mar 2016 17:04:07 -0700 Subject: [PATCH 059/192] Fix to reduce stack usage in the hash-based random number generator health tests when WOLFSSL_SMALL_STACK is defined. --- wolfcrypt/src/random.c | 94 +++++++++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 25 deletions(-) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 904dab67e..beb9ea163 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -37,6 +37,8 @@ #define CUSTOM_RAND_TYPE byte #endif +#define RNG_HEALTH_TEST_CHECK_SIZE (SHA256_DIGEST_SIZE * 4) + #ifdef HAVE_FIPS int wc_GenerateSeed(OS_Seed* os, byte* seed, word32 sz) @@ -607,42 +609,66 @@ int wc_RNG_HealthTest(int reseed, const byte* entropyA, word32 entropyASz, const byte* entropyB, word32 entropyBSz, byte* output, word32 outputSz) { - DRBG drbg; + int ret = -1; + DRBG* drbg; +#ifndef WOLFSSL_SMALL_STACK + DRBG drbg_var; +#endif - if (entropyA == NULL || output == NULL) + if (entropyA == NULL || output == NULL) { return BAD_FUNC_ARG; + } - if (reseed != 0 && entropyB == NULL) + if (reseed != 0 && entropyB == NULL) { return BAD_FUNC_ARG; + } - if (outputSz != (SHA256_DIGEST_SIZE * 4)) - return -1; + if (outputSz != RNG_HEALTH_TEST_CHECK_SIZE) { + return ret; + } - if (Hash_DRBG_Instantiate(&drbg, entropyA, entropyASz, NULL, 0) != 0) - return -1; +#ifdef WOLFSSL_SMALL_STACK + drbg = (struct DRBG*)XMALLOC(sizeof(DRBG), NULL, DYNAMIC_TYPE_RNG); + if (drbg == NULL) { + return MEMORY_E; + } +#else + drbg = &drbg_var; +#endif + + if (Hash_DRBG_Instantiate(drbg, entropyA, entropyASz, NULL, 0) != 0) { + goto exit_rng_ht; + } if (reseed) { - if (Hash_DRBG_Reseed(&drbg, entropyB, entropyBSz) != 0) { - Hash_DRBG_Uninstantiate(&drbg); - return -1; + if (Hash_DRBG_Reseed(drbg, entropyB, entropyBSz) != 0) { + goto exit_rng_ht; } } - if (Hash_DRBG_Generate(&drbg, output, outputSz) != 0) { - Hash_DRBG_Uninstantiate(&drbg); - return -1; + if (Hash_DRBG_Generate(drbg, output, outputSz) != 0) { + goto exit_rng_ht; } - if (Hash_DRBG_Generate(&drbg, output, outputSz) != 0) { - Hash_DRBG_Uninstantiate(&drbg); - return -1; + if (Hash_DRBG_Generate(drbg, output, outputSz) != 0) { + goto exit_rng_ht; + } + + /* Mark success */ + ret = 0; + +exit_rng_ht: + + /* This is safe to call even if Hash_DRBG_Instantiate fails */ + if (Hash_DRBG_Uninstantiate(drbg) != 0) { + ret = -1; } - if (Hash_DRBG_Uninstantiate(&drbg) != 0) { - return -1; - } +#ifdef WOLFSSL_SMALL_STACK + XFREE(drbg, NULL, DYNAMIC_TYPE_RNG); +#endif - return 0; + return ret; } @@ -698,27 +724,45 @@ const byte outputB[] = { static int wc_RNG_HealthTestLocal(int reseed) { int ret = 0; - byte check[SHA256_DIGEST_SIZE * 4]; +#ifdef WOLFSSL_SMALL_STACK + byte* check; +#else + byte check[RNG_HEALTH_TEST_CHECK_SIZE]; +#endif + +#ifdef WOLFSSL_SMALL_STACK + check = (byte*)XMALLOC(RNG_HEALTH_TEST_CHECK_SIZE, NULL, + DYNAMIC_TYPE_TMP_BUFFER); + if (check == NULL) { + return MEMORY_E; + } +#endif if (reseed) { ret = wc_RNG_HealthTest(1, entropyA, sizeof(entropyA), reseedEntropyA, sizeof(reseedEntropyA), - check, sizeof(check)); + check, RNG_HEALTH_TEST_CHECK_SIZE); if (ret == 0) { - if (ConstantCompare(check, outputA, sizeof(check)) != 0) + if (ConstantCompare(check, outputA, + RNG_HEALTH_TEST_CHECK_SIZE) != 0) ret = -1; } } else { ret = wc_RNG_HealthTest(0, entropyB, sizeof(entropyB), NULL, 0, - check, sizeof(check)); + check, RNG_HEALTH_TEST_CHECK_SIZE); if (ret == 0) { - if (ConstantCompare(check, outputB, sizeof(check)) != 0) + if (ConstantCompare(check, outputB, + RNG_HEALTH_TEST_CHECK_SIZE) != 0) ret = -1; } } +#ifdef WOLFSSL_SMALL_STACK + XFREE(check, NULL, DYNAMIC_TYPE_TMP_BUFFER); +#endif + return ret; } From 19967dd264ccb370789ccd7c230a2e3e67292f48 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 17 Mar 2016 09:39:10 -0700 Subject: [PATCH 060/192] Fixed bug where mp_unsigned_bin_size returning 0 could produce a UINT_MAX (based on -1) resulting in invalid index to an array. Added test case for this if FP_ECC is defined. --- wolfcrypt/src/ecc.c | 15 ++++++++++++--- wolfcrypt/test/test.c | 33 ++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 506946388..5d1bf4bb2 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -4199,7 +4199,10 @@ static int accel_fp_mul(int idx, mp_int* k, ecc_point *R, mp_int* modulus, else { /* let's reverse kb so it's little endian */ x = 0; - y = mp_unsigned_bin_size(&tk) - 1; + y = mp_unsigned_bin_size(&tk); + if (y > 0) { + y -= 1; + } mp_clear(&tk); while ((unsigned)x < y) { @@ -4401,7 +4404,10 @@ static int accel_fp_mul2add(int idx1, int idx2, /* let's reverse kb so it's little endian */ x = 0; - y = mp_unsigned_bin_size(&tka) - 1; + y = mp_unsigned_bin_size(&tka); + if (y > 0) { + y -= 1; + } mp_clear(&tka); while ((unsigned)x < y) { z = kb[0][x]; kb[0][x] = kb[0][y]; kb[0][y] = z; @@ -4423,7 +4429,10 @@ static int accel_fp_mul2add(int idx1, int idx2, } else { x = 0; - y = mp_unsigned_bin_size(&tkb) - 1; + y = mp_unsigned_bin_size(&tkb); + if (y > 0) { + y -= 1; + } mp_clear(&tkb); while ((unsigned)x < y) { z = kb[1][x]; kb[1][x] = kb[1][y]; kb[1][y] = z; diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 434d5645d..44b45efb4 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -6262,6 +6262,14 @@ static int ecc_test_raw_vector(const rawEccVector* vector, ecc_key* userA, } #endif /* HAVE_ECC_VECTOR_TEST */ +#undef ECC_TEST_KEY_SIZE +#define ECC_TEST_KEY_SIZE 32 +#define ECC_TEST_VERIFY_COUNT 1 +#ifdef FP_ECC + #undef ECC_TEST_VERIFY_COUNT + #define ECC_TEST_VERIFY_COUNT 2 + #define ECC_TEST_VERIFY_ZERO +#endif int ecc_test(void) { WC_RNG rng; @@ -6308,7 +6316,7 @@ int ecc_test(void) wc_ecc_init(&userB); wc_ecc_init(&pubKey); - ret = wc_ecc_make_key(&rng, 32, &userA); + ret = wc_ecc_make_key(&rng, ECC_TEST_KEY_SIZE, &userA); if (ret != 0) return -1014; @@ -6316,7 +6324,7 @@ int ecc_test(void) if (ret != 0) return -1024; - ret = wc_ecc_make_key(&rng, 32, &userB); + ret = wc_ecc_make_key(&rng, ECC_TEST_KEY_SIZE, &userB); if (ret != 0) return -1002; @@ -6392,8 +6400,13 @@ int ecc_test(void) #ifdef HAVE_ECC_SIGN /* test DSA sign hash */ - for (i = 0; i < (int)sizeof(digest); i++) + for (i = 0; i < (int)sizeof(digest); i++) { + #ifdef ECC_TEST_VERIFY_ZERO + digest[i] = 0; + #else digest[i] = (byte)i; + #endif + } x = sizeof(sig); ret = wc_ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &userA); @@ -6402,12 +6415,14 @@ int ecc_test(void) return -1014; #ifdef HAVE_ECC_VERIFY - verify = 0; - ret = wc_ecc_verify_hash(sig, x, digest, sizeof(digest), &verify, &userA); - if (ret != 0) - return -1015; - if (verify != 1) - return -1016; + for (i=0; i Date: Fri, 4 Mar 2016 10:05:22 -0800 Subject: [PATCH 061/192] Added "--enable-asynccrypt" option for enabling asynchronous crypto. This includes a refactor of SendServerKeyExchange and DoClientKeyExchange to support WC_PENDING_E on key generation, signing and verification. Currently uses async simulator (WOLFSSL_ASYNC_CRYPT_TEST) if cavium not enabled. All of the examples have been updated to support WC_PENDING_E on accept and connect. A generic WOLF_EVENT infrastructure has been added to support other types of future events and is enabled using "HAVE_WOLF_EVENT". Refactor the ASN OID type (ex: hashType/sigType) to use a more unique name. The real "async.c" and "async.h" files are in a private repo. --- .gitignore | 2 + autogen.sh | 4 + configure.ac | 22 + examples/client/client.c | 68 +- examples/echoclient/echoclient.c | 21 +- examples/echoserver/echoserver.c | 22 +- examples/server/server.c | 44 +- src/include.am | 4 + src/internal.c | 4943 ++++++++++++++---------------- src/ssl.c | 115 + wolfcrypt/src/asn.c | 84 +- wolfcrypt/src/error.c | 3 + wolfcrypt/src/hash.c | 14 + wolfcrypt/src/pkcs7.c | 16 +- wolfssl/error-ssl.h | 1 + wolfssl/internal.h | 92 +- wolfssl/ssl.h | 33 + wolfssl/test.h | 20 + wolfssl/wolfcrypt/asn.h | 26 +- wolfssl/wolfcrypt/error-crypt.h | 1 + wolfssl/wolfcrypt/hash.h | 1 + wolfssl/wolfcrypt/settings.h | 15 + 22 files changed, 2870 insertions(+), 2681 deletions(-) mode change 100644 => 100755 src/internal.c diff --git a/.gitignore b/.gitignore index f8ff8a508..999db3fe8 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ cyassl.sublime* fips.c fips_test.c fips +src/async.c +wolfssl/async.h ctaocrypt/benchmark/benchmark ctaocrypt/test/testctaocrypt wolfcrypt/benchmark/benchmark diff --git a/autogen.sh b/autogen.sh index 196764e1f..971878e33 100755 --- a/autogen.sh +++ b/autogen.sh @@ -18,6 +18,10 @@ if test -d .git; then # touch fips files for non fips distribution touch ./ctaocrypt/src/fips.c touch ./ctaocrypt/src/fips_test.c + + # touch async crypt files + touch ./src/async.c + touch ./wolfssl/async.h else WARNINGS="all" fi diff --git a/configure.ac b/configure.ac index c7e14cc9d..6e4669717 100644 --- a/configure.ac +++ b/configure.ac @@ -2505,6 +2505,27 @@ fi AM_CONDITIONAL([BUILD_MCAPI], [test "x$ENABLED_MCAPI" = "xyes"]) +# Asynchronous Crypto +AC_ARG_ENABLE([asynccrypt], + [ --enable-asynccrypt Enable Asynchronous Crypto (default: disabled)], + [ ENABLED_ASYNCCRYPT=$enableval ], + [ ENABLED_ASYNCCRYPT=no ] + ) + +if test "$ENABLED_ASYNCCRYPT" = "yes" +then + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASYNC_CRYPT" + + # if Cavium not enabled the use async simulator for testing + if test "x$ENABLED_CAVIUM" = "xno" + then + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASYNC_CRYPT_TEST" + fi +fi + +AM_CONDITIONAL([BUILD_ASYNCCRYPT], [test "x$ENABLED_ASYNCCRYPT" = "xyes"]) + + # check if PSK was enabled for conditionally running psk.test script AM_CONDITIONAL([BUILD_PSK], [test "x$ENABLED_PSK" = "xyes"]) @@ -2836,5 +2857,6 @@ echo " * LIBZ: $ENABLED_LIBZ" echo " * Examples: $ENABLED_EXAMPLES" echo " * User Crypto: $ENABLED_USER_CRYPTO" echo " * Fast RSA: $ENABLED_FAST_RSA" +echo " * Async Crypto: $ENABLED_ASYNCCRYPT" echo "" echo "---" diff --git a/examples/client/client.c b/examples/client/client.c index 08fdf9ad2..d800cb26e 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -68,7 +68,7 @@ #endif -static void NonBlockingSSL_Connect(WOLFSSL* ssl) +static void NonBlockingSSL_Connect(WOLFSSL_CTX* ctx, WOLFSSL* ssl) { #ifndef WOLFSSL_CALLBACKS int ret = wolfSSL_connect(ssl); @@ -79,14 +79,23 @@ static void NonBlockingSSL_Connect(WOLFSSL* ssl) SOCKET_T sockfd = (SOCKET_T)wolfSSL_get_fd(ssl); int select_ret; + (void)ctx; + while (ret != SSL_SUCCESS && (error == SSL_ERROR_WANT_READ || - error == SSL_ERROR_WANT_WRITE)) { + error == SSL_ERROR_WANT_WRITE || + error == WC_PENDING_E)) { int currTimeout = 1; if (error == SSL_ERROR_WANT_READ) printf("... client would read block\n"); - else + else if (error == SSL_ERROR_WANT_WRITE) printf("... client would write block\n"); +#ifdef WOLFSSL_ASYNC_CRYPT + else if (error == WC_PENDING_E) { + ret = AsyncCryptPoll(ctx, ssl); + if (ret < 0) { break; } else if (ret == 0) { continue; } + } +#endif #ifdef WOLFSSL_DTLS currTimeout = wolfSSL_dtls_get_current_timeout(ssl); @@ -95,11 +104,11 @@ static void NonBlockingSSL_Connect(WOLFSSL* ssl) if ((select_ret == TEST_RECV_READY) || (select_ret == TEST_ERROR_READY)) { - #ifndef WOLFSSL_CALLBACKS - ret = wolfSSL_connect(ssl); - #else - ret = wolfSSL_connect_ex(ssl,handShakeCB,timeoutCB,timeout); - #endif + #ifndef WOLFSSL_CALLBACKS + ret = wolfSSL_connect(ssl); + #else + ret = wolfSSL_connect_ex(ssl,handShakeCB,timeoutCB,timeout); + #endif error = wolfSSL_get_error(ssl, 0); } else if (select_ret == TEST_TIMEOUT && !wolfSSL_dtls(ssl)) { @@ -107,7 +116,7 @@ static void NonBlockingSSL_Connect(WOLFSSL* ssl) } #ifdef WOLFSSL_DTLS else if (select_ret == TEST_TIMEOUT && wolfSSL_dtls(ssl) && - wolfSSL_dtls_got_timeout(ssl) >= 0) { + wolfSSL_dtls_got_timeout(ssl) >= 0) { error = SSL_ERROR_WANT_READ; } #endif @@ -436,6 +445,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) int disableCRL = 0; int externalTest = 0; int ret; + int err = 0; int scr = 0; /* allow secure renegotiation */ int forceScr = 0; /* force client initiaed scr */ int trackMemory = 0; @@ -1170,27 +1180,40 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) if (nonBlocking) { wolfSSL_set_using_nonblock(ssl, 1); tcp_set_nonblocking(&sockfd); - NonBlockingSSL_Connect(ssl); + NonBlockingSSL_Connect(ctx, ssl); } - else if (wolfSSL_connect(ssl) != SSL_SUCCESS) { - /* see note at top of README */ - int err = wolfSSL_get_error(ssl, 0); - char buffer[WOLFSSL_MAX_ERROR_SZ]; - printf("err = %d, %s\n", err, - wolfSSL_ERR_error_string(err, buffer)); - err_sys("SSL_connect failed"); - /* if you're getting an error here */ + else { + do { +#ifdef WOLFSSL_ASYNC_CRYPT + if (err == WC_PENDING_E) { + ret = AsyncCryptPoll(ctx, ssl); + if (ret < 0) { break; } else if (ret == 0) { continue; } + } +#endif + err = 0; /* Reset error */ + ret = wolfSSL_connect(ssl); + if (ret != SSL_SUCCESS) { + err = wolfSSL_get_error(ssl, 0); + } + } while (ret != SSL_SUCCESS && err == WC_PENDING_E); + + if (ret != SSL_SUCCESS) { + char buffer[WOLFSSL_MAX_ERROR_SZ]; + printf("err = %d, %s\n", err, wolfSSL_ERR_error_string(err, buffer)); + err_sys("wolfSSL_connect failed"); + /* see note at top of README */ + /* if you're getting an error here */ + } } #else timeout.tv_sec = 2; timeout.tv_usec = 0; - NonBlockingSSL_Connect(ssl); /* will keep retrying on timeout */ + NonBlockingSSL_Connect(ctx, ssl); /* will keep retrying on timeout */ #endif showPeer(ssl); #ifdef HAVE_ALPN if (alpnList != NULL) { - int err; char *protocol_name = NULL; word16 protocol_nameSz = 0; @@ -1315,14 +1338,14 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) if (nonBlocking) { wolfSSL_set_using_nonblock(sslResume, 1); tcp_set_nonblocking(&sockfd); - NonBlockingSSL_Connect(sslResume); + NonBlockingSSL_Connect(ctx, sslResume); } else if (wolfSSL_connect(sslResume) != SSL_SUCCESS) err_sys("SSL resume failed"); #else timeout.tv_sec = 2; timeout.tv_usec = 0; - NonBlockingSSL_Connect(ssl); /* will keep retrying on timeout */ + NonBlockingSSL_Connect(ctx, ssl); /* will keep retrying on timeout */ #endif showPeer(sslResume); @@ -1333,7 +1356,6 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) #ifdef HAVE_ALPN if (alpnList != NULL) { - int err; char *protocol_name = NULL; word16 protocol_nameSz = 0; diff --git a/examples/echoclient/echoclient.c b/examples/echoclient/echoclient.c index 04bbf0374..4957b7a34 100644 --- a/examples/echoclient/echoclient.c +++ b/examples/echoclient/echoclient.c @@ -68,6 +68,7 @@ void echoclient_test(void* args) SSL_CTX* ctx = 0; SSL* ssl = 0; + int ret = 0, err = 0; int doDTLS = 0; int doPSK = 0; int sendSz; @@ -173,7 +174,25 @@ void echoclient_test(void* args) Sleep(100); #endif - if (SSL_connect(ssl) != SSL_SUCCESS) err_sys("SSL_connect failed"); + do { +#ifdef WOLFSSL_ASYNC_CRYPT + if (err == WC_PENDING_E) { + ret = AsyncCryptPoll(ctx, ssl); + if (ret < 0) { break; } else if (ret == 0) { continue; } + } +#endif + err = 0; /* Reset error */ + ret = SSL_connect(ssl); + if (ret != SSL_SUCCESS) { + err = SSL_get_error(ssl, 0); + } + } while (ret != SSL_SUCCESS && err == WC_PENDING_E); + + if (ret != SSL_SUCCESS) { + char buffer[CYASSL_MAX_ERROR_SZ]; + printf("err = %d, %s\n", err, ERR_error_string(err, buffer)); + err_sys("SSL_connect failed"); + } while (fgets(msg, sizeof(msg), fin) != 0) { diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index 76bf3e57a..4318a5816 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -77,6 +77,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) CYASSL_METHOD* method = 0; CYASSL_CTX* ctx = 0; + int ret = 0; int doDTLS = 0; int doPSK = 0; int outCreated = 0; @@ -228,6 +229,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) int clientfd; int firstRead = 1; int gotFirstG = 0; + int err = 0; SOCKADDR_IN_T client; socklen_t client_len = sizeof(client); #ifndef CYASSL_DTLS @@ -260,7 +262,25 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) #elif !defined(NO_DH) SetDH(ssl); /* will repick suites with DHE, higher than PSK */ #endif - if (CyaSSL_accept(ssl) != SSL_SUCCESS) { + + do { +#ifdef WOLFSSL_ASYNC_CRYPT + if (err == WC_PENDING_E) { + ret = AsyncCryptPoll(ctx, ssl); + if (ret < 0) { break; } else if (ret == 0) { continue; } + } +#endif + err = 0; /* Reset error */ + ret = CyaSSL_accept(ssl); + if (ret != SSL_SUCCESS) { + err = CyaSSL_get_error(ssl, 0); + } + } while (ret != SSL_SUCCESS && err == WC_PENDING_E); + + if (ret != SSL_SUCCESS) { + err = CyaSSL_get_error(ssl, 0); + char buffer[CYASSL_MAX_ERROR_SZ]; + printf("error = %d, %s\n", err, CyaSSL_ERR_error_string(err, buffer)); printf("SSL_accept failed\n"); CyaSSL_free(ssl); CloseSocket(clientfd); diff --git a/examples/server/server.c b/examples/server/server.c index d4937d280..0774a3142 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -71,7 +71,7 @@ -static void NonBlockingSSL_Accept(SSL* ssl) +static int NonBlockingSSL_Accept(SSL* ssl) { #ifndef CYASSL_CALLBACKS int ret = SSL_accept(ssl); @@ -120,8 +120,8 @@ static void NonBlockingSSL_Accept(SSL* ssl) error = SSL_FATAL_ERROR; } } - if (ret != SSL_SUCCESS) - err_sys("SSL_accept failed"); + + return ret; } /* Echo number of bytes specified by -e arg */ @@ -279,6 +279,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) int doListen = 1; int crlFlags = 0; int ret; + int err = 0; char* serverReadyFile = NULL; char* alpnList = NULL; unsigned char alpn_opt = 0; @@ -836,21 +837,44 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) if (nonBlocking) { CyaSSL_set_using_nonblock(ssl, 1); tcp_set_nonblocking(&clientfd); - NonBlockingSSL_Accept(ssl); - } else if (SSL_accept(ssl) != SSL_SUCCESS) { - int err = SSL_get_error(ssl, 0); + } +#endif + + do { +#ifdef WOLFSSL_ASYNC_CRYPT + if (err == WC_PENDING_E) { + ret = AsyncCryptPoll(ctx, ssl); + if (ret < 0) { break; } else if (ret == 0) { continue; } + } +#endif + + err = 0; /* Reset error */ +#ifndef CYASSL_CALLBACKS + if (nonBlocking) { + ret = NonBlockingSSL_Accept(ssl); + } + else { + ret = SSL_accept(ssl); + } +#else + ret = NonBlockingSSL_Accept(ssl); +#endif + if (ret != SSL_SUCCESS) { + err = SSL_get_error(ssl, 0); + } + } while (ret != SSL_SUCCESS && err == WC_PENDING_E); + + if (ret != SSL_SUCCESS) { + err = SSL_get_error(ssl, 0); char buffer[CYASSL_MAX_ERROR_SZ]; printf("error = %d, %s\n", err, ERR_error_string(err, buffer)); err_sys("SSL_accept failed"); } -#else - NonBlockingSSL_Accept(ssl); -#endif + showPeer(ssl); #ifdef HAVE_ALPN if (alpnList != NULL) { - int err; char *protocol_name = NULL, *list = NULL; word16 protocol_nameSz = 0, listSz = 0; diff --git a/src/include.am b/src/include.am index c65e8d263..5402934a9 100644 --- a/src/include.am +++ b/src/include.am @@ -250,4 +250,8 @@ if BUILD_SNIFFER src_libwolfssl_la_SOURCES += src/sniffer.c endif +if BUILD_ASYNCCRYPT +src_libwolfssl_la_SOURCES += src/async.c +endif + endif # !BUILD_CRYPTONLY diff --git a/src/internal.c b/src/internal.c old mode 100644 new mode 100755 index c1fa85438..60cc76706 --- a/src/internal.c +++ b/src/internal.c @@ -69,6 +69,8 @@ #define FALSE 0 #endif +#define ERROR_OUT(err, eLabel) { ret = (err); goto eLabel; } + #ifdef _MSC_VER /* disable for while(0) cases at the .c level for now */ #pragma warning(disable:4127) @@ -465,6 +467,61 @@ static INLINE void ato32(const byte* c, word32* u32) #endif /* HAVE_LIBZ */ +#ifdef HAVE_WOLF_EVENT +int wolfSSL_EventInit(WOLFSSL* ssl, WOLF_EVENT_TYPE type) +{ + if (!ssl) { + return BAD_FUNC_ARG; + } + + if (ssl->event.pending) { + WOLFSSL_MSG("ssl.event already pending!"); + return BAD_COND_E; + } + + XMEMSET(&ssl->event, 0, sizeof(WOLF_EVENT)); + ssl->event.ssl = ssl; + ssl->event.type = type; + + return 0; +} + +int wolfSSL_CTX_EventPush(WOLFSSL_CTX* ctx, WOLF_EVENT* event) +{ + int ret; + + if (ctx == NULL || event == NULL) { + return BAD_FUNC_ARG; + } + +#ifndef SINGLE_THREADED + if (LockMutex(&ctx->event_queue.lock) != 0) { + return BAD_MUTEX_E; + } +#endif + + /* Setup event */ + event->next = NULL; + event->pending = 1; + + if (ctx->event_queue.tail == NULL) { + ctx->event_queue.head = event; + } + else { + ctx->event_queue.tail->next = event; + } + ctx->event_queue.tail = event; /* add to the end either way */ + ret = 0; + +#ifndef SINGLE_THREADED + UnLockMutex(&ctx->event_queue.lock); +#endif + + return ret; +} +#endif /* HAVE_WOLF_EVENT */ + + void InitSSL_Method(WOLFSSL_METHOD* method, ProtocolVersion pv) { method->version = pv; @@ -542,6 +599,16 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method) ctx->ticketHint = SESSION_TICKET_HINT_DEFAULT; #endif +#ifdef HAVE_WOLF_EVENT + XMEMSET(&ctx->event_queue, 0, sizeof(WOLF_EVENT_QUEUE)); + #ifndef SINGLE_THREADED + if (InitMutex(&ctx->event_queue.lock) < 0) { + WOLFSSL_MSG("Mutex error on CTX event queue init"); + return BAD_MUTEX_E; + } + #endif +#endif /* HAVE_WOLF_EVENT */ + return 0; } @@ -553,6 +620,12 @@ void SSL_CtxResourceFree(WOLFSSL_CTX* ctx) (void)i; +#ifdef HAVE_WOLF_EVENT + #ifndef SINGLE_THREADED + FreeMutex(&ctx->event_queue.lock); + #endif +#endif /* HAVE_WOLF_EVENT */ + XFREE(ctx->method, ctx->heap, DYNAMIC_TYPE_METHOD); if (ctx->suites) XFREE(ctx->suites, ctx->heap, DYNAMIC_TYPE_SUITES); @@ -1697,9 +1770,78 @@ void FreeX509(WOLFSSL_X509* x509) #ifndef NO_RSA +int RsaSign(WOLFSSL* ssl, const byte* in, word32 inSz, byte* out, + word32* outSz, RsaKey* key, const byte* keyBuf, word32 keySz, void* ctx) +{ + int ret; + + (void)ssl; + (void)keyBuf; + (void)keySz; + (void)ctx; + +#if defined(WOLFSSL_ASYNC_CRYPT_TEST) + if (ssl->options.side == WOLFSSL_SERVER_END && + ssl->asyncCryptTest.type == ASYNC_TEST_NONE) + { + ssl->asyncCryptTest.type = ASYNC_TEST_RSA_SIGN; + ssl->asyncCryptTest.rsaSign.in = in; + ssl->asyncCryptTest.rsaSign.inSz = inSz; + ssl->asyncCryptTest.rsaSign.out = out; + ssl->asyncCryptTest.rsaSign.outSz = outSz; + ssl->asyncCryptTest.rsaSign.keyBuf = keyBuf; + ssl->asyncCryptTest.rsaSign.keySz = keySz; + ssl->asyncCryptTest.rsaSign.key = key; + #if defined(HAVE_PK_CALLBACKS) + ssl->asyncCryptTest.ctx = ctx; + #endif + return WC_PENDING_E; + } +#endif /* WOLFSSL_ASYNC_CRYPT_TEST */ + +#if defined(HAVE_PK_CALLBACKS) + if (ssl->ctx->RsaSignCb) { + ret = ssl->ctx->RsaSignCb(ssl, in, inSz, out, outSz, keyBuf, keySz, + ctx); + } + else +#endif /*HAVE_PK_CALLBACKS */ + { + ret = wc_RsaSSL_Sign(in, inSz, out, *outSz, key, ssl->rng); + } + if (ret > 0) { + *outSz = ret; + ret = 0; + } + + return ret; +} + +int RsaVerify(WOLFSSL* ssl, byte* in, word32 inSz, + byte** out, RsaKey* key, const byte* keyBuf, word32 keySz, void* ctx) +{ + int ret; + + (void)ssl; + (void)keyBuf; + (void)keySz; + (void)ctx; + +#ifdef HAVE_PK_CALLBACKS + if (ssl->ctx->RsaVerifyCb) { + ret = ssl->ctx->RsaVerifyCb(ssl, in, inSz, out, keyBuf, keySz, ctx); + } + else +#endif /*HAVE_PK_CALLBACKS */ + { + ret = wc_RsaSSL_VerifyInline(in, inSz, out, key); + } + return ret; +} + /* Verify RSA signature, 0 on success */ -int VerifyRsaSign(const byte* sig, word32 sigSz, - const byte* plain, word32 plainSz, RsaKey* key) +int VerifyRsaSign(WOLFSSL* ssl, const byte* sig, word32 sigSz, + const byte* plain, word32 plainSz, RsaKey* key) { #ifdef WOLFSSL_SMALL_STACK byte* verifySig = NULL; @@ -1709,6 +1851,8 @@ int VerifyRsaSign(const byte* sig, word32 sigSz, byte* out = NULL; /* inline result */ int ret; + (void)ssl; + WOLFSSL_ENTER("VerifyRsaSign"); if (sig == NULL || plain == NULL || key == NULL) { @@ -1745,8 +1889,261 @@ int VerifyRsaSign(const byte* sig, word32 sigSz, return ret; } +int RsaDec(WOLFSSL* ssl, byte* in, word32 inSz, byte** out, word32* outSz, + RsaKey* key, const byte* keyBuf, word32 keySz, void* ctx) +{ + int ret; + + (void)ssl; + (void)keyBuf; + (void)keySz; + (void)ctx; + +#if defined(WOLFSSL_ASYNC_CRYPT_TEST) + if (ssl->options.side == WOLFSSL_SERVER_END && + ssl->asyncCryptTest.type == ASYNC_TEST_NONE) + { + ssl->asyncCryptTest.type = ASYNC_TEST_RSA_DEC; + ssl->asyncCryptTest.rsaDec.in = in; + ssl->asyncCryptTest.rsaDec.inSz = inSz; + ssl->asyncCryptTest.rsaDec.out = out; + ssl->asyncCryptTest.rsaDec.outSz = outSz; + ssl->asyncCryptTest.rsaDec.keyBuf = keyBuf; + ssl->asyncCryptTest.rsaDec.keySz = keySz; + ssl->asyncCryptTest.rsaDec.key = key; + #if defined(HAVE_PK_CALLBACKS) + ssl->asyncCryptTest.ctx = ctx; + #endif + return WC_PENDING_E; + } +#endif /* WOLFSSL_ASYNC_CRYPT_TEST */ + +#ifdef HAVE_PK_CALLBACKS + if (ssl->ctx->RsaDecCb) { + ret = ssl->ctx->RsaDecCb(ssl, in, inSz, out, keyBuf, keySz, + ctx); + } + else +#endif /* HAVE_PK_CALLBACKS */ + { + ret = wc_RsaPrivateDecryptInline(in, inSz, out, key); + } + + if (ret > 0) { + *outSz = ret; + ret = 0; + } + return ret; +} + #endif /* NO_RSA */ +#ifdef HAVE_ECC + +int EccSign(WOLFSSL* ssl, const byte* in, word32 inSz, byte* out, + word32* outSz, ecc_key* key, byte* keyBuf, word32 keySz, void* ctx) +{ + int ret; + + (void)ssl; + (void)keyBuf; + (void)keySz; + (void)ctx; + +#if defined(WOLFSSL_ASYNC_CRYPT_TEST) + if (ssl->options.side == WOLFSSL_SERVER_END && + ssl->asyncCryptTest.type == ASYNC_TEST_NONE) + { + ssl->asyncCryptTest.type = ASYNC_TEST_ECC_SIGN; + ssl->asyncCryptTest.eccSign.in = in; + ssl->asyncCryptTest.eccSign.inSz = inSz; + ssl->asyncCryptTest.eccSign.out = out; + ssl->asyncCryptTest.eccSign.outSz = outSz; + ssl->asyncCryptTest.eccSign.keyBuf = keyBuf; + ssl->asyncCryptTest.eccSign.keySz = keySz; + ssl->asyncCryptTest.eccSign.key = key; + #if defined(HAVE_PK_CALLBACKS) + ssl->asyncCryptTest.ctx = ctx; + #endif + return WC_PENDING_E; + } +#endif /* WOLFSSL_ASYNC_CRYPT_TEST */ + +#if defined(HAVE_PK_CALLBACKS) + if (ssl->ctx->EccSignCb) { + ret = ssl->ctx->EccSignCb(ssl, in, inSz, out, outSz, keyBuf, + keySz, ctx); + } + else +#endif /* HAVE_PK_CALLBACKS */ + { + ret = wc_ecc_sign_hash(in, inSz, out, outSz, ssl->rng, key); + } + return ret; +} + +int EccVerify(WOLFSSL* ssl, const byte* in, word32 inSz, byte* out, + word32 outSz, ecc_key* key, byte* keyBuf, word32 keySz, + void* ctx) +{ + int ret, verify; + + (void)ssl; + (void)keyBuf; + (void)keySz; + (void)ctx; + +#ifdef HAVE_PK_CALLBACKS + if (ssl->ctx->EccVerifyCb) { + ret = ssl->ctx->EccVerifyCb(ssl, in, inSz, out, outSz, keyBuf, keySz, + &verify, ctx); + } + else +#endif + { + ret = wc_ecc_verify_hash(in, inSz, out, outSz, &verify, key); + } + + ret = (ret != 0 || verify == 0) ? VERIFY_SIGN_ERROR : 0; + + return ret; +} + +int EccSharedSecret(WOLFSSL* ssl, ecc_key* priv_key, ecc_key* pub_key, + byte* out, word32* outSz) +{ + int ret; + + (void)ssl; + +#if defined(WOLFSSL_ASYNC_CRYPT_TEST) + if (ssl->options.side == WOLFSSL_SERVER_END && + ssl->asyncCryptTest.type == ASYNC_TEST_NONE) + { + ssl->asyncCryptTest.type = ASYNC_TEST_ECC_SHARED_SEC; + ssl->asyncCryptTest.eccSharedSec.private_key = priv_key; + ssl->asyncCryptTest.eccSharedSec.public_key = pub_key; + ssl->asyncCryptTest.eccSharedSec.out = out; + ssl->asyncCryptTest.eccSharedSec.outLen = outSz; + return WC_PENDING_E; + } +#endif /* WOLFSSL_ASYNC_CRYPT_TEST */ + + ret = wc_ecc_shared_secret(priv_key, pub_key, out, outSz); + + return ret; +} + +int EccMakeTempKey(WOLFSSL* ssl) +{ + int ret = 0; + if (ssl->eccTempKeyPresent == 0) { + #if defined(WOLFSSL_ASYNC_CRYPT_TEST) + if (ssl->options.side == WOLFSSL_SERVER_END && + ssl->asyncCryptTest.type == ASYNC_TEST_NONE) + { + ssl->asyncCryptTest.type = ASYNC_TEST_ECC_TMPKEY_GEN; + return WC_PENDING_E; + } + #endif /* WOLFSSL_ASYNC_CRYPT_TEST */ + + ret = wc_ecc_make_key(ssl->rng, ssl->eccTempKeySz, + ssl->eccTempKey); + if (ret == MP_OKAY) { + ssl->eccTempKeyPresent = 1; + ret = 0; + } + } + return ret; +} + +#endif /* HAVE_ECC */ + +#if !defined(NO_DH) + +int DhGenKeyPair(WOLFSSL* ssl, + byte* p, word32 pSz, + byte* g, word32 gSz, + byte* priv, word32* privSz, + byte* pub, word32* pubSz) +{ + int ret; + DhKey dhKey; + +#if defined(WOLFSSL_ASYNC_CRYPT_TEST) + if (ssl->options.side == WOLFSSL_SERVER_END && + ssl->asyncCryptTest.type == ASYNC_TEST_NONE) + { + ssl->asyncCryptTest.type = ASYNC_TEST_DH_GEN; + ssl->asyncCryptTest.dhGen.p = p; + ssl->asyncCryptTest.dhGen.pSz = pSz; + ssl->asyncCryptTest.dhGen.g = g; + ssl->asyncCryptTest.dhGen.gSz = gSz; + ssl->asyncCryptTest.dhGen.priv = priv; + ssl->asyncCryptTest.dhGen.privSz = privSz; + ssl->asyncCryptTest.dhGen.pub = pub; + ssl->asyncCryptTest.dhGen.pubSz = pubSz; + return WC_PENDING_E; + } +#endif /* WOLFSSL_ASYNC_CRYPT_TEST */ + + wc_InitDhKey(&dhKey); + ret = wc_DhSetKey(&dhKey, p, pSz, g, gSz); + if (ret == 0) { + ret = wc_DhGenerateKeyPair(&dhKey, ssl->rng, priv, privSz, pub, pubSz); + } + wc_FreeDhKey(&dhKey); + return ret; +} + +int DhAgree(WOLFSSL* ssl, + byte* p, word32 pSz, + byte* g, word32 gSz, + byte* priv, word32* privSz, + byte* pub, word32* pubSz, + const byte* otherPub, word32 otherPubSz, + byte* agree, word32* agreeSz) +{ + int ret; + DhKey dhKey; + +#if defined(WOLFSSL_ASYNC_CRYPT_TEST) + if (ssl->options.side == WOLFSSL_SERVER_END && + ssl->asyncCryptTest.type == ASYNC_TEST_NONE) + { + ssl->asyncCryptTest.type = ASYNC_TEST_DH_AGREE; + ssl->asyncCryptTest.dhAgree.p = p; + ssl->asyncCryptTest.dhAgree.pSz = pSz; + ssl->asyncCryptTest.dhAgree.g = g; + ssl->asyncCryptTest.dhAgree.gSz = gSz; + ssl->asyncCryptTest.dhAgree.priv = priv; + ssl->asyncCryptTest.dhAgree.privSz = privSz; + ssl->asyncCryptTest.dhAgree.pub = pub; + ssl->asyncCryptTest.dhAgree.pubSz = pubSz; + ssl->asyncCryptTest.dhAgree.otherPub = otherPub; + ssl->asyncCryptTest.dhAgree.otherPubSz = otherPubSz; + ssl->asyncCryptTest.dhAgree.agree = agree; + ssl->asyncCryptTest.dhAgree.agreeSz = agreeSz; + return WC_PENDING_E; + } +#endif /* WOLFSSL_ASYNC_CRYPT_TEST */ + + wc_InitDhKey(&dhKey); + ret = wc_DhSetKey(&dhKey, p, pSz, g, gSz); + if (ret == 0 && pub) { + /* for DH, encSecret is Yc, agree is pre-master */ + ret = wc_DhGenerateKeyPair(&dhKey, ssl->rng, priv, privSz, pub, pubSz); + } + if (ret == 0) { + ret = wc_DhAgree(&dhKey, agree, agreeSz, priv, *privSz, otherPub, otherPubSz); + } + wc_FreeDhKey(&dhKey); + + return ret; +} + +#endif /* !NO_DH */ + #endif /* NO_CERTS */ @@ -2092,6 +2489,43 @@ void FreeArrays(WOLFSSL* ssl, int keep) ssl->arrays = NULL; } +static void FreeKeyExchange(WOLFSSL* ssl) +{ + /* Cleanup signature buffer */ + if (ssl->buffers.sig.buffer) { + XFREE(ssl->buffers.sig.buffer, NULL, DYNAMIC_TYPE_TMP_BUFFER); + ssl->buffers.sig.buffer = NULL; + ssl->buffers.sig.length = 0; + } + + /* Free sigKey */ + if (ssl->sigKey) { + switch (ssl->sigType) + { + #ifndef NO_RSA + case DYNAMIC_TYPE_RSA: + { + wc_FreeRsaKey((RsaKey*)ssl->sigKey); + XFREE(ssl->sigKey, NULL, DYNAMIC_TYPE_RSA); + break; + } + #endif /* ! NO_RSA */ + #ifdef HAVE_ECC + case DYNAMIC_TYPE_ECC: + { + wc_ecc_free((ecc_key*)ssl->sigKey); + XFREE(ssl->sigKey, NULL, DYNAMIC_TYPE_ECC); + break; + } + #endif /* HAVE_ECC */ + default: + break; + } + /* Reset type and pointer */ + ssl->sigType = 0; + ssl->sigKey = NULL; + } +} /* In case holding SSL object in array and don't want to free actual ssl */ void SSL_ResourceFree(WOLFSSL* ssl) @@ -2104,6 +2538,7 @@ void SSL_ResourceFree(WOLFSSL* ssl) FreeCiphers(ssl); FreeArrays(ssl, 0); + FreeKeyExchange(ssl); wc_FreeRng(ssl->rng); XFREE(ssl->rng, ssl->heap, DYNAMIC_TYPE_RNG); XFREE(ssl->suites, ssl->heap, DYNAMIC_TYPE_SUITES); @@ -2379,6 +2814,9 @@ int DtlsPoolInit(WOLFSSL* ssl) int DtlsPoolSave(WOLFSSL* ssl, const byte *src, int sz) { DtlsPool *pool = ssl->dtls_pool; + if (src == NULL) { + return BAD_FUNC_ARG; + } if (pool != NULL && pool->used < DTLS_POOL_SZ) { buffer *pBuf = &pool->buf[pool->used]; pBuf->buffer = (byte*)XMALLOC(sz, ssl->heap, DYNAMIC_TYPE_DTLS_POOL); @@ -5788,7 +6226,8 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx, /* hello_request not hashed */ /* Also, skip hashing the client_hello message here for DTLS. It will be * hashed later if the DTLS cookie is correct. */ - if (type != hello_request && !(ssl->options.dtls && type == client_hello)) { + if (type != hello_request && !(ssl->options.dtls && type == client_hello) && + ssl->error != WC_PENDING_E) { ret = HashInput(ssl, input + *inOutIdx, size); if (ret != 0) return ret; } @@ -7395,7 +7834,8 @@ int ProcessReply(WOLFSSL* ssl) atomicUser = 1; #endif - if (ssl->error != 0 && ssl->error != WANT_READ && ssl->error != WANT_WRITE){ + if (ssl->error != 0 && ssl->error != WANT_READ && + ssl->error != WANT_WRITE && ssl->error != WC_PENDING_E) { WOLFSSL_MSG("ProcessReply retry in error state, not allowed"); return ssl->error; } @@ -7768,7 +8208,7 @@ int ProcessReply(WOLFSSL* ssl) ssl->options.processReply = doProcessInit; /* input exhausted? */ - if (ssl->buffers.inputBuffer.idx == ssl->buffers.inputBuffer.length) + if (ssl->buffers.inputBuffer.idx >= ssl->buffers.inputBuffer.length) return 0; /* more messages per record */ @@ -9056,7 +9496,7 @@ int SendData(WOLFSSL* ssl, const void* data, int sz) ret, dtlsExtra = 0; - if (ssl->error == WANT_WRITE) + if (ssl->error == WANT_WRITE || ssl->error == WC_PENDING_E) ssl->error = 0; if (ssl->options.handShakeState != HANDSHAKE_DONE) { @@ -9171,7 +9611,7 @@ int ReceiveData(WOLFSSL* ssl, byte* output, int sz, int peek) WOLFSSL_ENTER("ReceiveData()"); - if (ssl->error == WANT_READ) + if (ssl->error == WANT_READ || ssl->error == WC_PENDING_E) ssl->error = 0; if (ssl->error != 0 && ssl->error != WANT_WRITE) { @@ -9661,6 +10101,9 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e) case OCSP_INVALID_STATUS: return "Invalid OCSP Status Error"; + case ASYNC_NOT_PENDING: + return "Async operation not pending"; + default : return "unknown error number"; } @@ -11455,7 +11898,6 @@ static void PickHashSigAlgo(WOLFSSL* ssl, word16 length = 0; word32 begin = *inOutIdx; int ret = 0; - #define ERROR_OUT(err, eLabel) do { ret = err; goto eLabel; } while(0) (void)length; /* shut up compiler warnings */ (void)begin; @@ -12140,32 +12582,25 @@ static void PickHashSigAlgo(WOLFSSL* ssl, case rsa_sa_algo: { byte* out = NULL; - byte doUserRsa = 0; word32 verifiedSz = 0; - #ifdef HAVE_PK_CALLBACKS - if (ssl->ctx->RsaVerifyCb) - doUserRsa = 1; - #endif /*HAVE_PK_CALLBACKS */ - if (ssl->peerRsaKey == NULL || !ssl->peerRsaKeyPresent) { ERROR_OUT(NO_PEER_KEY, done); } - if (doUserRsa) { + verifiedSz = RsaVerify(ssl, + (byte *)input + *inOutIdx, + length, + &out, + ssl->peerRsaKey, #ifdef HAVE_PK_CALLBACKS - verifiedSz = ssl->ctx->RsaVerifyCb(ssl, - (byte *)input + *inOutIdx, - length, &out, - ssl->buffers.peerRsaKey.buffer, - ssl->buffers.peerRsaKey.length, - ssl->RsaVerifyCtx); - #endif /*HAVE_PK_CALLBACKS */ - } - else { - verifiedSz = wc_RsaSSL_VerifyInline((byte *)input + *inOutIdx, - length, &out, ssl->peerRsaKey); - } + ssl->buffers.peerRsaKey.buffer, + ssl->buffers.peerRsaKey.length, + ssl->RsaVerifyCtx + #else + NULL, 0, NULL + #endif + ); if (IsAtLeastTLSv1_2(ssl)) { word32 encSigSz; @@ -12248,7 +12683,6 @@ static void PickHashSigAlgo(WOLFSSL* ssl, /* ecdsa */ case ecc_dsa_sa_algo: { - int verify = 0; #ifndef NO_OLD_TLS byte* digest = &hash[MD5_DIGEST_SIZE]; word32 digestSz = SHA_DIGEST_SIZE; @@ -12256,13 +12690,6 @@ static void PickHashSigAlgo(WOLFSSL* ssl, byte* digest = hash256; word32 digestSz = SHA256_DIGEST_SIZE; #endif - byte doUserEcc = 0; - - #ifdef HAVE_PK_CALLBACKS - if (ssl->ctx->EccVerifyCb) { - doUserEcc = 1; - } - #endif if (!ssl->peerEccDsaKeyPresent) ERROR_OUT(NO_PEER_KEY, done); @@ -12293,22 +12720,19 @@ static void PickHashSigAlgo(WOLFSSL* ssl, #endif } } - if (doUserEcc) { + + ret = EccVerify(ssl, + input + *inOutIdx, length, + digest, digestSz, + ssl->peerEccDsaKey, #ifdef HAVE_PK_CALLBACKS - ret = ssl->ctx->EccVerifyCb(ssl, input + *inOutIdx, length, - digest, digestSz, - ssl->buffers.peerEccDsaKey.buffer, - ssl->buffers.peerEccDsaKey.length, - &verify, ssl->EccVerifyCtx); + ssl->buffers.peerEccDsaKey.buffer, + ssl->buffers.peerEccDsaKey.length, + ssl->EccVerifyCtx + #else + NULL, 0, NULL #endif - } - else { - ret = wc_ecc_verify_hash(input + *inOutIdx, length, - digest, digestSz, &verify, ssl->peerEccDsaKey); - } - if (ret != 0 || verify == 0) { - ERROR_OUT(VERIFY_SIGN_ERROR, done); - } + ); break; } #endif /* HAVE_ECC */ @@ -12379,8 +12803,6 @@ static void PickHashSigAlgo(WOLFSSL* ssl, #else /* !NO_DH or HAVE_ECC */ return NOT_COMPILED_IN; /* not supported by build */ #endif /* !NO_DH or HAVE_ECC */ - - #undef ERROR_OUT } @@ -12848,10 +13270,9 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) byte priv[ENCRYPT_LEN]; #endif word32 privSz = 0; - DhKey key; - if (serverP.buffer == 0 || serverG.buffer == 0 || - serverPub.buffer == 0) { + if (serverP.buffer == NULL || serverG.buffer == NULL || + serverPub.buffer == NULL) { #ifdef WOLFSSL_SMALL_STACK XFREE(encSecret, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif @@ -12867,21 +13288,17 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) } #endif - wc_InitDhKey(&key); - ret = wc_DhSetKey(&key, serverP.buffer, serverP.length, - serverG.buffer, serverG.length); - if (ret == 0) - /* for DH, encSecret is Yc, agree is pre-master */ - ret = wc_DhGenerateKeyPair(&key, ssl->rng, priv, &privSz, - encSecret, &encSz); - if (ret == 0) - ret = wc_DhAgree(&key, ssl->arrays->preMasterSecret, - &ssl->arrays->preMasterSz, priv, privSz, - serverPub.buffer, serverPub.length); + ret = DhAgree(ssl, + serverP.buffer, serverP.length, + serverG.buffer, serverG.length, + priv, &privSz, + encSecret, &encSz, + serverPub.buffer, serverPub.length, + ssl->arrays->preMasterSecret, &ssl->arrays->preMasterSz); + #ifdef WOLFSSL_SMALL_STACK XFREE(priv, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif - wc_FreeDhKey(&key); } break; #endif /* NO_DH */ @@ -12945,7 +13362,6 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) word32 privSz = 0; word32 pubSz = 0; word32 esSz = 0; - DhKey key; if (serverP.buffer == 0 || serverG.buffer == 0 || serverPub.buffer == 0) { @@ -12992,19 +13408,15 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) XMEMCPY(es, ssl->arrays->client_identity, esSz); es += esSz; encSz = esSz + OPAQUE16_LEN; + + ret = DhAgree(ssl, + serverP.buffer, serverP.length, + serverG.buffer, serverG.length, + priv, &privSz, + es + OPAQUE16_LEN, &pubSz, + serverPub.buffer, serverPub.length, + pms + OPAQUE16_LEN, &ssl->arrays->preMasterSz); - wc_InitDhKey(&key); - ret = wc_DhSetKey(&key, serverP.buffer, serverP.length, - serverG.buffer, serverG.length); - if (ret == 0) - /* for DH, encSecret is Yc, agree is pre-master */ - ret = wc_DhGenerateKeyPair(&key, ssl->rng, priv, &privSz, - es + OPAQUE16_LEN, &pubSz); - if (ret == 0) - ret = wc_DhAgree(&key, pms + OPAQUE16_LEN, - &ssl->arrays->preMasterSz, priv, privSz, - serverPub.buffer, serverPub.length); - wc_FreeDhKey(&key); #ifdef WOLFSSL_SMALL_STACK XFREE(priv, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif @@ -13114,12 +13526,13 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) ret = ECC_EXPORT_ERROR; } else { - /* Create shared ECC key leaveing room at the begining + /* Create shared ECC key leaving room at the begining of buffer for size of shared key. Note sizeof preMasterSecret is ENCRYPT_LEN currently 512 */ size = sizeof(ssl->arrays->preMasterSecret) - OPAQUE16_LEN; - ret = wc_ecc_shared_secret(&myKey, peerKey, + + ret = EccSharedSecret(ssl, &myKey, peerKey, ssl->arrays->preMasterSecret + OPAQUE16_LEN, &size); if (ret != 0) { #ifdef WOLFSSL_SMALL_STACK @@ -13259,8 +13672,8 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) ret = ECC_EXPORT_ERROR; else { size = sizeof(ssl->arrays->preMasterSecret); - ret = wc_ecc_shared_secret(&myKey, peerKey, - ssl->arrays->preMasterSecret, &size); + ret = EccSharedSecret(ssl, &myKey, peerKey, + ssl->arrays->preMasterSecret, &size); if (ret != 0) ret = ECC_SHARED_ERROR; } @@ -13557,7 +13970,6 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) word32 localSz = MAX_ENCODED_SIG_SZ; word32 digestSz; byte* digest; - byte doUserEcc = 0; #ifndef NO_OLD_TLS /* old tls default */ digestSz = SHA_DIGEST_SIZE; @@ -13568,13 +13980,6 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) digest = ssl->hsHashes->certHashes.sha256; #endif - #ifdef HAVE_PK_CALLBACKS - #ifdef HAVE_ECC - if (ssl->ctx->EccSignCb) - doUserEcc = 1; - #endif /* HAVE_ECC */ - #endif /*HAVE_PK_CALLBACKS */ - if (IsAtLeastTLSv1_2(ssl)) { if (ssl->suites->hashAlgo == sha_mac) { #ifndef NO_SHA @@ -13602,36 +14007,28 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) } } - if (doUserEcc) { - #ifdef HAVE_PK_CALLBACKS - #ifdef HAVE_ECC - ret = ssl->ctx->EccSignCb(ssl, digest, digestSz, - encodedSig, &localSz, - ssl->buffers.key->buffer, - ssl->buffers.key->length, - ssl->EccSignCtx); - #endif /* HAVE_ECC */ - #endif /*HAVE_PK_CALLBACKS */ - } - else { - ret = wc_ecc_sign_hash(digest, digestSz, encodedSig, - &localSz, ssl->rng, &eccKey); - } + ret = EccSign(ssl, + digest, digestSz, + encodedSig, &localSz, + &eccKey, + #if defined(HAVE_PK_CALLBACKS) + ssl->buffers.key->buffer, + ssl->buffers.key->length, + ssl->EccSignCtx + #else + NULL, 0, NULL + #endif + ); if (ret == 0) { length = localSz; c16toa((word16)length, verify + extraSz); /* prepend hdr */ XMEMCPY(verify + extraSz + VERIFY_HEADER,encodedSig,length); } -#endif +#endif /* HAVE_ECC */ } #ifndef NO_RSA else { - byte doUserRsa = 0; - - #ifdef HAVE_PK_CALLBACKS - if (ssl->ctx->RsaSignCb) - doUserRsa = 1; - #endif /*HAVE_PK_CALLBACKS */ + word32 ioLen = ENCRYPT_LEN; if (IsAtLeastTLSv1_2(ssl)) { /* @@ -13695,28 +14092,28 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) } c16toa((word16)length, verify + extraSz); /* prepend hdr */ - if (doUserRsa) { - #ifdef HAVE_PK_CALLBACKS - #ifndef NO_RSA - word32 ioLen = ENCRYPT_LEN; - ret = ssl->ctx->RsaSignCb(ssl, signBuffer, signSz, - verify + extraSz + VERIFY_HEADER, - &ioLen, - ssl->buffers.key->buffer, - ssl->buffers.key->length, - ssl->RsaSignCtx); - #endif /* NO_RSA */ - #endif /*HAVE_PK_CALLBACKS */ - } - else { - ret = wc_RsaSSL_Sign(signBuffer, signSz, verify + extraSz + - VERIFY_HEADER, ENCRYPT_LEN, &key, ssl->rng); - } - if (ret > 0) { + ret = RsaSign(ssl, + signBuffer, signSz, + verify + extraSz + VERIFY_HEADER, + &ioLen, + &key, + ssl->buffers.key->buffer, + ssl->buffers.key->length, + #ifdef HAVE_PK_CALLBACKS + ssl->RsaSignCtx + #else + NULL + #endif + ); + if (ret == 0) { /* check for signature faults */ - ret = VerifyRsaSign(verify + extraSz + VERIFY_HEADER, ret, - signBuffer, signSz, &key); + ret = VerifyRsaSign(ssl, + verify + extraSz + VERIFY_HEADER, + ioLen, + signBuffer, + signSz, + &key); } } #endif @@ -13726,45 +14123,45 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) if (ret == 0) { AddHeaders(output, length + extraSz + VERIFY_HEADER, - certificate_verify, ssl); + certificate_verify, ssl); - sendSz = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ + length + + sendSz = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ + length + extraSz + VERIFY_HEADER; - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - } - #endif + #ifdef WOLFSSL_DTLS + if (ssl->options.dtls) { + sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + } + #endif - if (IsEncryptionOn(ssl, 1)) { - byte* input; - int inputSz = sendSz - RECORD_HEADER_SZ; - /* build msg adds rec hdr */ - input = (byte*)XMALLOC(inputSz, ssl->heap, - DYNAMIC_TYPE_TMP_BUFFER); - if (input == NULL) - ret = MEMORY_E; - else { - XMEMCPY(input, output + RECORD_HEADER_SZ, inputSz); - sendSz = BuildMessage(ssl, output, - MAX_CERT_VERIFY_SZ +MAX_MSG_EXTRA, - input, inputSz, handshake, 1); - XFREE(input, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER); + if (IsEncryptionOn(ssl, 1)) { + byte* input; + int inputSz = sendSz - RECORD_HEADER_SZ; + /* build msg adds rec hdr */ + input = (byte*)XMALLOC(inputSz, ssl->heap, + DYNAMIC_TYPE_TMP_BUFFER); + if (input == NULL) + ret = MEMORY_E; + else { + XMEMCPY(input, output + RECORD_HEADER_SZ, inputSz); + sendSz = BuildMessage(ssl, output, + MAX_CERT_VERIFY_SZ +MAX_MSG_EXTRA, + input, inputSz, handshake, 1); + XFREE(input, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER); - if (sendSz < 0) - ret = sendSz; - } - } else { - ret = HashOutput(ssl, output, sendSz, 0); - } + if (sendSz < 0) + ret = sendSz; + } + } else { + ret = HashOutput(ssl, output, sendSz, 0); + } - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0) - return ret; - } - #endif + #ifdef WOLFSSL_DTLS + if (ssl->options.dtls) { + if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0) + return ret; + } + #endif } } #ifndef NO_RSA @@ -13788,9 +14185,9 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) return 0; else return SendBuffered(ssl); - } + } else - return ret; + return ret; } #endif /* NO_CERTS */ @@ -14031,1714 +14428,1087 @@ int DoSessionTicket(WOLFSSL* ssl, int SendServerKeyExchange(WOLFSSL* ssl) { - int ret = 0; - #ifdef HAVE_QSH - word32 qshSz = 0; + int ret; + int sendSz = 0; + byte *output = NULL; + word32 idx = 0, sigSz = 0, length = 0; + #if defined(HAVE_ECC) || (!defined(NO_DH) && !defined(NO_RSA)) + byte *sigDataBuf = NULL; + word32 sigDataSz = 0; #endif + #if defined(HAVE_ECC) + byte *exportBuf = NULL; + word32 exportSz = 0; + #endif + (void)ssl; - #define ERROR_OUT(err, eLabel) do { ret = err; goto eLabel; } while(0) + (void)sigSz; - #ifdef HAVE_QSH - if (ssl->peerQSHKeyPresent && ssl->options.haveQSH) { - qshSz = QSH_KeyGetSize(ssl); + #ifdef WOLFSSL_ASYNC_CRYPT + ret = wolfSSL_async_pop(ssl, WOLF_EVENT_TYPE_ASYNC_ACCEPT); + if (ret != ASYNC_NOT_PENDING) { + /* Check for error */ + if (ret < 0) { + goto exit_sske; + } + else { + /* Restore variables needed for async */ + output = ssl->async.output; + sendSz = ssl->async.sendSz; + idx = ssl->async.idx; + sigSz = ssl->async.sigSz; + length = ssl->async.length; + + /* Advance key share state */ + ssl->options.keyShareState++; + } + } + else + #endif + { + /* Reset state */ + ret = 0; + ssl->options.keyShareState = KEYSHARE_BEGIN; + } + + switch(ssl->options.keyShareState) + { + case KEYSHARE_BEGIN: + { + /* Do some checks / debug msgs */ + switch(ssl->specs.kea) + { + #if defined(HAVE_ECC) && !defined(NO_PSK) + case ecdhe_psk_kea: + { + /* pub key size */ + WOLFSSL_MSG("Using ephemeral ECDH"); + break; + } + #endif /* HAVE_ECC && !NO_PSK */ + #ifdef HAVE_ECC + case ecc_diffie_hellman_kea: + { + if (ssl->specs.static_ecdh) { + WOLFSSL_MSG("Using Static ECDH, not sending ServerKeyExchange"); + ERROR_OUT(0, exit_sske); + } + + if (!ssl->buffers.key->buffer) { + ERROR_OUT(NO_PRIVATE_KEY, exit_sske); + } + + WOLFSSL_MSG("Using ephemeral ECDH"); + break; + } + #endif /* HAVE_ECC */ + } + + /* Preparing keys */ + switch(ssl->specs.kea) + { + #ifndef NO_PSK + case psk_kea: + { + /* Nothing to do in this sub-state */ + break; + } + #endif /* !NO_PSK */ + #if !defined(NO_DH) && (!defined(NO_PSK) || !defined(NO_RSA)) + #if !defined(NO_PSK) + case dhe_psk_kea: + #endif + #if !defined(NO_RSA) + case diffie_hellman_kea: + #endif + { + /* Allocate DH key buffers and generate key */ + if (ssl->buffers.serverDH_P.buffer == NULL || + ssl->buffers.serverDH_G.buffer == NULL) { + ERROR_OUT(NO_DH_PARAMS, exit_sske); + } + + if (ssl->buffers.serverDH_Pub.buffer == NULL) { + /* Free'd in SSL_ResourceFree and FreeHandshakeResources */ + ssl->buffers.serverDH_Pub.buffer = (byte*)XMALLOC( + ssl->buffers.serverDH_P.length + 2, ssl->ctx->heap, + DYNAMIC_TYPE_DH); + if (ssl->buffers.serverDH_Pub.buffer == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + } + + if (ssl->buffers.serverDH_Priv.buffer == NULL) { + /* Free'd in SSL_ResourceFree and FreeHandshakeResources */ + ssl->buffers.serverDH_Priv.buffer = (byte*)XMALLOC( + ssl->buffers.serverDH_P.length + 2, ssl->ctx->heap, + DYNAMIC_TYPE_DH); + if (ssl->buffers.serverDH_Priv.buffer == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + } + + ret = DhGenKeyPair(ssl, + ssl->buffers.serverDH_P.buffer, + ssl->buffers.serverDH_P.length, + ssl->buffers.serverDH_G.buffer, + ssl->buffers.serverDH_G.length, + ssl->buffers.serverDH_Priv.buffer, + &ssl->buffers.serverDH_Priv.length, + ssl->buffers.serverDH_Pub.buffer, + &ssl->buffers.serverDH_Pub.length); + break; + } + #endif /* !defined(NO_DH) && (!defined(NO_PSK) || !defined(NO_RSA)) */ + #if defined(HAVE_ECC) && !defined(NO_PSK) + case ecdhe_psk_kea: + /* Fall through to create temp ECC key */ + #endif /* HAVE_ECC && !NO_PSK */ + #ifdef HAVE_ECC + case ecc_diffie_hellman_kea: + { + /* need ephemeral key now, create it if missing */ + if (ssl->eccTempKey == NULL) { + /* alloc/init on demand */ + ssl->eccTempKey = (ecc_key*)XMALLOC(sizeof(ecc_key), + ssl->ctx->heap, DYNAMIC_TYPE_ECC); + if (ssl->eccTempKey == NULL) { + WOLFSSL_MSG("EccTempKey Memory error"); + ERROR_OUT(MEMORY_E, exit_sske); + } + wc_ecc_init(ssl->eccTempKey); + } + ret = EccMakeTempKey(ssl); + break; + } + #endif /* HAVE_ECC */ + default: + /* Skip ServerKeyExchange */ + goto exit_sske; + } /* switch(ssl->specs.kea) */ + + /* Check for error */ + if (ret != 0) { + goto exit_sske; + } + + /* Advance state and proceed */ + ssl->options.keyShareState = KEYSHARE_BUILD; + } /* case KEYSHARE_BEGIN */ + + case KEYSHARE_BUILD: + { + word32 preSigSz, preSigIdx; + + #ifdef HAVE_QSH + word32 qshSz = 0; + if (ssl->peerQSHKeyPresent && ssl->options.haveQSH) { + qshSz = QSH_KeyGetSize(ssl); + } + #endif + + switch(ssl->specs.kea) + { + #ifndef NO_PSK + case psk_kea: + { + idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; + + if (ssl->arrays->server_hint[0] == 0) { + ERROR_OUT(0, exit_sske); /* don't send */ + } + + /* include size part */ + length = (word32)XSTRLEN(ssl->arrays->server_hint); + if (length > MAX_PSK_ID_LEN) { + ERROR_OUT(SERVER_HINT_ERROR, exit_sske); + } + + length += HINT_LEN_SZ; + sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ; + + #ifdef HAVE_QSH + length += qshSz; + sendSz += qshSz; + #endif + + #ifdef WOLFSSL_DTLS + if (ssl->options.dtls) { + sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + idx += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + } + #endif + /* check for available size */ + if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { + goto exit_sske; + } + + /* get ouput buffer */ + output = ssl->buffers.outputBuffer.buffer + + ssl->buffers.outputBuffer.length; + + AddHeaders(output, length, server_key_exchange, ssl); + + /* key data */ + #ifdef HAVE_QSH + c16toa((word16)(length - qshSz - HINT_LEN_SZ), output + idx); + #else + c16toa((word16)(length - HINT_LEN_SZ), output + idx); + #endif + + idx += HINT_LEN_SZ; + XMEMCPY(output + idx, ssl->arrays->server_hint, length - HINT_LEN_SZ); + break; + } + #endif /* !NO_PSK */ + #if !defined(NO_DH) && !defined(NO_PSK) + case dhe_psk_kea: + { + word32 hintLen; + + idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; + length = LENGTH_SZ * 3 + /* p, g, pub */ + ssl->buffers.serverDH_P.length + + ssl->buffers.serverDH_G.length + + ssl->buffers.serverDH_Pub.length; + + /* include size part */ + hintLen = (word32)XSTRLEN(ssl->arrays->server_hint); + if (hintLen > MAX_PSK_ID_LEN) { + ERROR_OUT(SERVER_HINT_ERROR, exit_sske); + } + length += hintLen + HINT_LEN_SZ; + sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ; + + #ifdef HAVE_QSH + length += qshSz; + sendSz += qshSz; + #endif + #ifdef WOLFSSL_DTLS + if (ssl->options.dtls) { + sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + idx += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + } + #endif + + /* check for available size */ + if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { + goto exit_sske; + } + + /* get ouput buffer */ + output = ssl->buffers.outputBuffer.buffer + + ssl->buffers.outputBuffer.length; + + AddHeaders(output, length, server_key_exchange, ssl); + + /* key data */ + c16toa((word16)hintLen, output + idx); + idx += HINT_LEN_SZ; + XMEMCPY(output + idx, ssl->arrays->server_hint, hintLen); + idx += hintLen; + + /* add p, g, pub */ + c16toa((word16)ssl->buffers.serverDH_P.length, output + idx); + idx += LENGTH_SZ; + XMEMCPY(output + idx, ssl->buffers.serverDH_P.buffer, + ssl->buffers.serverDH_P.length); + idx += ssl->buffers.serverDH_P.length; + + /* g */ + c16toa((word16)ssl->buffers.serverDH_G.length, output + idx); + idx += LENGTH_SZ; + XMEMCPY(output + idx, ssl->buffers.serverDH_G.buffer, + ssl->buffers.serverDH_G.length); + idx += ssl->buffers.serverDH_G.length; + + /* pub */ + c16toa((word16)ssl->buffers.serverDH_Pub.length, output + idx); + idx += LENGTH_SZ; + XMEMCPY(output + idx, ssl->buffers.serverDH_Pub.buffer, + ssl->buffers.serverDH_Pub.length); + idx += ssl->buffers.serverDH_Pub.length; + break; + } + #endif /* !defined(NO_DH) && !defined(NO_PSK) */ + #if defined(HAVE_ECC) && !defined(NO_PSK) + case ecdhe_psk_kea: + { + word32 hintLen; + + /* curve type, named curve, length(1) */ + idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; + length = ENUM_LEN + CURVE_LEN + ENUM_LEN; + + exportSz = MAX_EXPORT_ECC_SZ; + exportBuf = (byte*)XMALLOC(exportSz, NULL, + DYNAMIC_TYPE_TMP_BUFFER); + if (exportBuf == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + if (wc_ecc_export_x963(ssl->eccTempKey, exportBuf, &exportSz) != 0) { + ERROR_OUT(ECC_EXPORT_ERROR, exit_sske); + } + length += exportSz; + + /* include size part */ + hintLen = (word32)XSTRLEN(ssl->arrays->server_hint); + if (hintLen > MAX_PSK_ID_LEN) { + ERROR_OUT(SERVER_HINT_ERROR, exit_sske); + } + length += hintLen + HINT_LEN_SZ; + sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ; + + #ifdef HAVE_QSH + length += qshSz; + sendSz += qshSz; + #endif + #ifdef WOLFSSL_DTLS + if (ssl->options.dtls) { + sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + idx += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + } + #endif + /* check for available size */ + if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { + goto exit_sske; + } + + /* get output buffer */ + output = ssl->buffers.outputBuffer.buffer + + ssl->buffers.outputBuffer.length; + + /* key data */ + c16toa((word16)hintLen, output + idx); + idx += HINT_LEN_SZ; + XMEMCPY(output + idx, ssl->arrays->server_hint, hintLen); + idx += hintLen; + + /* ECC key exchange data */ + output[idx++] = named_curve; + output[idx++] = 0x00; /* leading zero */ + output[idx++] = SetCurveId(wc_ecc_size(ssl->eccTempKey)); + output[idx++] = (byte)exportSz; + XMEMCPY(output + idx, exportBuf, exportSz); + break; + } + #endif /* HAVE_ECC && !NO_PSK */ + #ifdef HAVE_ECC + case ecc_diffie_hellman_kea: + { + int typeH = 0; + enum wc_HashType hashType = WC_HASH_TYPE_NONE; + + /* curve type, named curve, length(1) */ + idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; + length = ENUM_LEN + CURVE_LEN + ENUM_LEN; + + /* Export temp ECC key and add to length */ + exportSz = MAX_EXPORT_ECC_SZ; + exportBuf = (byte*)XMALLOC(exportSz, NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (exportBuf == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + if (wc_ecc_export_x963(ssl->eccTempKey, exportBuf, &exportSz) != 0) { + ERROR_OUT(ECC_EXPORT_ERROR, exit_sske); + } + length += exportSz; + + preSigSz = length; + preSigIdx = idx; + + switch(ssl->specs.sig_algo) + { + #ifndef NO_RSA + case rsa_sa_algo: + { + word32 i = 0; + ssl->sigKey = XMALLOC(sizeof(RsaKey), NULL, DYNAMIC_TYPE_RSA); + if (ssl->sigKey == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + ssl->sigType = DYNAMIC_TYPE_RSA; + + ret = wc_InitRsaKey((RsaKey*)ssl->sigKey, ssl->heap); + if (ret != 0) { + goto exit_sske; + } + + ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &i, + (RsaKey*)ssl->sigKey, ssl->buffers.key->length); + if (ret != 0) { + goto exit_sske; + } + sigSz = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); + break; + } + #endif /* !NO_RSA */ + case ecc_dsa_sa_algo: + { + word32 i = 0; + ssl->sigKey = XMALLOC(sizeof(ecc_key), NULL, DYNAMIC_TYPE_ECC); + if (ssl->sigKey == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + ssl->sigType = DYNAMIC_TYPE_ECC; + + wc_ecc_init((ecc_key*)ssl->sigKey); + + ret = wc_EccPrivateKeyDecode(ssl->buffers.key->buffer, &i, + (ecc_key*)ssl->sigKey, ssl->buffers.key->length); + if (ret != 0) { + goto exit_sske; + } + sigSz = wc_ecc_sig_size((ecc_key*)ssl->sigKey); /* worst case estimate */ + break; + } + default: + ERROR_OUT(ALGO_ID_E, exit_sske); /* unsupported type */ + } /* switch(ssl->specs.sig_algo) */ + + /* sig length */ + length += LENGTH_SZ; + length += sigSz; + + if (IsAtLeastTLSv1_2(ssl)) { + length += HASH_SIG_SIZE; + } + + sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ; + + #ifdef HAVE_QSH + length += qshSz; + sendSz += qshSz; + #endif + #ifdef WOLFSSL_DTLS + if (ssl->options.dtls) { + sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + idx += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + preSigIdx = idx; + } + #endif + /* check for available size */ + if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { + goto exit_sske; + } + + /* get ouput buffer */ + output = ssl->buffers.outputBuffer.buffer + + ssl->buffers.outputBuffer.length; + + /* record and message headers will be added below, when we're sure + of the sig length */ + + /* key exchange data */ + output[idx++] = named_curve; + output[idx++] = 0x00; /* leading zero */ + output[idx++] = SetCurveId(wc_ecc_size(ssl->eccTempKey)); + output[idx++] = (byte)exportSz; + XMEMCPY(output + idx, exportBuf, exportSz); + idx += exportSz; + + /* Determine hash type */ + if (IsAtLeastTLSv1_2(ssl)) { + output[idx++] = ssl->suites->hashAlgo; + output[idx++] = ssl->suites->sigAlgo; + + switch (ssl->suites->hashAlgo) { + case sha512_mac: + #ifdef WOLFSSL_SHA512 + hashType = WC_HASH_TYPE_SHA512; + typeH = SHA512h; + #endif + break; + + case sha384_mac: + #ifdef WOLFSSL_SHA384 + hashType = WC_HASH_TYPE_SHA384; + typeH = SHA384h; + #endif + break; + + case sha256_mac: + #ifndef NO_SHA256 + hashType = WC_HASH_TYPE_SHA256; + typeH = SHA256h; + #endif + break; + + case sha_mac: + #ifndef NO_OLD_TLS + hashType = WC_HASH_TYPE_SHA; + typeH = SHAh; + #endif + break; + + default: + WOLFSSL_MSG("Bad hash sig algo"); + break; + } + + if (hashType == WC_HASH_TYPE_NONE) { + ERROR_OUT(ALGO_ID_E, exit_sske); + } + + } else { + /* only using sha and md5 for rsa */ + #ifndef NO_OLD_TLS + hashType = WC_HASH_TYPE_SHA; + if (ssl->suites->sigAlgo == rsa_sa_algo) { + hashType = WC_HASH_TYPE_MD5_SHA; + } + #else + ERROR_OUT(ALGO_ID_E, exit_sske); + #endif + } + + /* Signtaure length will be written later, when we're sure what it is */ + + #ifdef HAVE_FUZZER + if (ssl->fuzzerCb) { + ssl->fuzzerCb(ssl, output + preSigIdx, preSigSz, + FUZZ_SIGNATURE, ssl->fuzzerCtx); + } + #endif + + /* Assemble buffer to hash for signature */ + sigDataSz = RAN_LEN + RAN_LEN + preSigSz; + sigDataBuf = (byte*)XMALLOC(sigDataSz, NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (sigDataBuf == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + XMEMCPY(sigDataBuf, ssl->arrays->clientRandom, RAN_LEN); + XMEMCPY(sigDataBuf+RAN_LEN, ssl->arrays->serverRandom, RAN_LEN); + XMEMCPY(sigDataBuf+RAN_LEN+RAN_LEN, output + preSigIdx, preSigSz); + + ssl->buffers.sig.length = wc_HashGetDigestSize(hashType); + ssl->buffers.sig.buffer = (byte*)XMALLOC(ssl->buffers.sig.length, + NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (ssl->buffers.sig.buffer == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + + /* Perform hash */ + ret = wc_Hash(hashType, sigDataBuf, sigDataSz, + ssl->buffers.sig.buffer, ssl->buffers.sig.length); + if (ret != 0) { + goto exit_sske; + } + + ssl->sigLen = sigSz; + + /* Sign hash to create signature */ + switch(ssl->specs.sig_algo) + { + #ifndef NO_RSA + case rsa_sa_algo: + { + /* For TLS 1.2 re-encode signature */ + if (IsAtLeastTLSv1_2(ssl)) { + byte* encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ, NULL, + DYNAMIC_TYPE_TMP_BUFFER); + if (encodedSig == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + + ssl->buffers.sig.length = wc_EncodeSignature(encodedSig, + ssl->buffers.sig.buffer, ssl->buffers.sig.length, typeH); + + /* Replace sig buffer with new one */ + XFREE(ssl->buffers.sig.buffer, NULL, DYNAMIC_TYPE_TMP_BUFFER); + ssl->buffers.sig.buffer = encodedSig; + } + + /* write sig size here */ + c16toa((word16)ssl->sigLen, output + idx); + idx += LENGTH_SZ; + + ret = RsaSign(ssl, + ssl->buffers.sig.buffer, + ssl->buffers.sig.length, + output + idx, + &ssl->sigLen, + (RsaKey*)ssl->sigKey, + ssl->buffers.key->buffer, + ssl->buffers.key->length, + #ifdef HAVE_PK_CALLBACKS + ssl->RsaSignCtx + #else + NULL + #endif + ); + break; + } + #endif /* !NO_RSA */ + case ecc_dsa_sa_algo: + { + ret = EccSign(ssl, + ssl->buffers.sig.buffer, + ssl->buffers.sig.length, + output + LENGTH_SZ + idx, + &ssl->sigLen, + (ecc_key*)ssl->sigKey, + #if defined(HAVE_PK_CALLBACKS) + ssl->buffers.key->buffer, + ssl->buffers.key->length, + ssl->EccSignCtx + #else + NULL, 0, NULL + #endif + ); + break; + } + } /* switch(ssl->specs.sig_algo) */ + break; + } + #endif /* HAVE_ECC */ + #if !defined(NO_DH) && !defined(NO_RSA) + case diffie_hellman_kea: + { + int typeH = 0; + enum wc_HashType hashType = WC_HASH_TYPE_NONE; + + idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; + length = LENGTH_SZ * 3; /* p, g, pub */ + length += ssl->buffers.serverDH_P.length + + ssl->buffers.serverDH_G.length + + ssl->buffers.serverDH_Pub.length; + + preSigIdx = idx; + preSigSz = length; + + if (!ssl->options.usingAnon_cipher) { + word32 i = 0; + + ssl->sigKey = XMALLOC(sizeof(RsaKey), NULL, DYNAMIC_TYPE_RSA); + if (ssl->sigKey == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + ssl->sigType = DYNAMIC_TYPE_RSA; + + ret = wc_InitRsaKey((RsaKey*)ssl->sigKey, ssl->heap); + if (ret != 0) { + goto exit_sske; + } + + /* sig length */ + length += LENGTH_SZ; + + if (!ssl->buffers.key->buffer) { + ERROR_OUT(NO_PRIVATE_KEY, exit_sske); + } + + ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &i, + (RsaKey*)ssl->sigKey, ssl->buffers.key->length); + if (ret != 0) { + goto exit_sske; + } + sigSz = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); + length += sigSz; + + if (IsAtLeastTLSv1_2(ssl)) { + length += HASH_SIG_SIZE; + } + } + + sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ; + + #ifdef HAVE_QSH + length += qshSz; + sendSz += qshSz; + #endif + #ifdef WOLFSSL_DTLS + if (ssl->options.dtls) { + sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + idx += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; + preSigIdx = idx; + } + #endif + + /* check for available size */ + if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { + goto exit_sske; + } + + /* get ouput buffer */ + output = ssl->buffers.outputBuffer.buffer + + ssl->buffers.outputBuffer.length; + + AddHeaders(output, length, server_key_exchange, ssl); + + /* add p, g, pub */ + c16toa((word16)ssl->buffers.serverDH_P.length, output + idx); + idx += LENGTH_SZ; + XMEMCPY(output + idx, ssl->buffers.serverDH_P.buffer, + ssl->buffers.serverDH_P.length); + idx += ssl->buffers.serverDH_P.length; + + /* g */ + c16toa((word16)ssl->buffers.serverDH_G.length, output + idx); + idx += LENGTH_SZ; + XMEMCPY(output + idx, ssl->buffers.serverDH_G.buffer, + ssl->buffers.serverDH_G.length); + idx += ssl->buffers.serverDH_G.length; + + /* pub */ + c16toa((word16)ssl->buffers.serverDH_Pub.length, output + idx); + idx += LENGTH_SZ; + XMEMCPY(output + idx, ssl->buffers.serverDH_Pub.buffer, + ssl->buffers.serverDH_Pub.length); + idx += ssl->buffers.serverDH_Pub.length; + + #ifdef HAVE_FUZZER + if (ssl->fuzzerCb) { + ssl->fuzzerCb(ssl, output + preSigIdx, preSigSz, + FUZZ_SIGNATURE, ssl->fuzzerCtx); + } + #endif + + /* Determine hash type */ + if (IsAtLeastTLSv1_2(ssl)) { + output[idx++] = ssl->suites->hashAlgo; + output[idx++] = ssl->suites->sigAlgo; + + switch (ssl->suites->hashAlgo) { + case sha512_mac: + #ifdef WOLFSSL_SHA512 + hashType = WC_HASH_TYPE_SHA512; + typeH = SHA512h; + #endif + break; + + case sha384_mac: + #ifdef WOLFSSL_SHA384 + hashType = WC_HASH_TYPE_SHA384; + typeH = SHA384h; + #endif + break; + + case sha256_mac: + #ifndef NO_SHA256 + hashType = WC_HASH_TYPE_SHA256; + typeH = SHA256h; + #endif + break; + + case sha_mac: + #ifndef NO_OLD_TLS + hashType = WC_HASH_TYPE_SHA; + typeH = SHAh; + #endif + break; + + default: + WOLFSSL_MSG("Bad hash sig algo"); + break; + } + + if (hashType == WC_HASH_TYPE_NONE) { + ERROR_OUT(ALGO_ID_E, exit_sske); + } + } else { + /* only using sha and md5 for rsa */ + #ifndef NO_OLD_TLS + hashType = WC_HASH_TYPE_SHA; + if (ssl->suites->sigAlgo == rsa_sa_algo) { + hashType = WC_HASH_TYPE_MD5_SHA; + } + #else + ERROR_OUT(ALGO_ID_E, exit_sske); + #endif + } + + /* signature size */ + c16toa((word16)sigSz, output + idx); + idx += LENGTH_SZ; + + /* Assemble buffer to hash for signature */ + sigDataSz = RAN_LEN + RAN_LEN + preSigSz; + sigDataBuf = (byte*)XMALLOC(sigDataSz, NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (sigDataBuf == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + XMEMCPY(sigDataBuf, ssl->arrays->clientRandom, RAN_LEN); + XMEMCPY(sigDataBuf+RAN_LEN, ssl->arrays->serverRandom, RAN_LEN); + XMEMCPY(sigDataBuf+RAN_LEN+RAN_LEN, output + preSigIdx, preSigSz); + + ssl->buffers.sig.length = wc_HashGetDigestSize(hashType); + ssl->buffers.sig.buffer = (byte*)XMALLOC(ssl->buffers.sig.length, + NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (ssl->buffers.sig.buffer == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + + /* Perform hash */ + ret = wc_Hash(hashType, sigDataBuf, sigDataSz, + ssl->buffers.sig.buffer, ssl->buffers.sig.length); + if (ret != 0) { + goto exit_sske; + } + + ssl->sigLen = sigSz; + + /* Sign hash to create signature */ + switch (ssl->suites->sigAlgo) + { + #ifndef NO_RSA + case rsa_sa_algo: + { + /* For TLS 1.2 re-encode signature */ + if (IsAtLeastTLSv1_2(ssl)) { + byte* encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ, NULL, + DYNAMIC_TYPE_TMP_BUFFER); + if (encodedSig == NULL) { + ERROR_OUT(MEMORY_E, exit_sske); + } + + ssl->buffers.sig.length = wc_EncodeSignature(encodedSig, + ssl->buffers.sig.buffer, ssl->buffers.sig.length, typeH); + + /* Replace sig buffer with new one */ + XFREE(ssl->buffers.sig.buffer, NULL, DYNAMIC_TYPE_TMP_BUFFER); + ssl->buffers.sig.buffer = encodedSig; + } + + ret = RsaSign(ssl, + ssl->buffers.sig.buffer, + ssl->buffers.sig.length, + output + idx, + &ssl->sigLen, + (RsaKey*)ssl->sigKey, + ssl->buffers.key->buffer, + ssl->buffers.key->length, + #ifdef HAVE_PK_CALLBACKS + ssl->RsaSignCtx + #else + NULL + #endif + ); + break; + } + #endif /* NO_RSA */ + } /* switch (ssl->suites->sigAlgo) */ + + break; + } + #endif /* !defined(NO_DH) && !defined(NO_RSA) */ + } /* switch(ssl->specs.kea) */ + + /* Check for error */ + if (ret != 0) { + goto exit_sske; + } + + /* Advance state and proceed */ + ssl->options.keyShareState = KEYSHARE_VERIFY; + } /* case KEYSHARE_BUILD */ + + case KEYSHARE_VERIFY: + { + switch(ssl->specs.kea) + { + #ifndef NO_PSK + case psk_kea: + { + /* Nothing to do in this sub-state */ + break; + } + #endif /* !NO_PSK */ + #if !defined(NO_DH) && !defined(NO_PSK) + case dhe_psk_kea: + { + /* Nothing to do in this sub-state */ + break; + } + #endif /* !defined(NO_DH) && !defined(NO_PSK) */ + #if defined(HAVE_ECC) && !defined(NO_PSK) + case ecdhe_psk_kea: + { + /* Nothing to do in this sub-state */ + break; + } + #endif /* HAVE_ECC && !NO_PSK */ + #ifdef HAVE_ECC + case ecc_diffie_hellman_kea: + { + switch(ssl->specs.sig_algo) + { + #ifndef NO_RSA + case rsa_sa_algo: + { + /* check for signature faults */ + ret = VerifyRsaSign(ssl, + output + idx, + ssl->sigLen, + ssl->buffers.sig.buffer, + ssl->buffers.sig.length, + (RsaKey*)ssl->sigKey); + break; + } + #endif + case ecc_dsa_sa_algo: + { + /* Now that we know the real sig size, write it. */ + c16toa((word16)ssl->sigLen, output + idx); + + /* And adjust length and sendSz from estimates */ + length += ssl->sigLen - sigSz; + sendSz += ssl->sigLen - sigSz; + break; + } + default: + ERROR_OUT(ALGO_ID_E, exit_sske); /* unsupported type */ + } /* switch(ssl->specs.sig_algo) */ + break; + } + #endif /* HAVE_ECC */ + #if !defined(NO_DH) && !defined(NO_RSA) + case diffie_hellman_kea: + { + switch (ssl->suites->sigAlgo) + { + #ifndef NO_RSA + case rsa_sa_algo: + { + /* check for signature faults */ + ret = VerifyRsaSign(ssl, + output + idx, + ssl->sigLen, + ssl->buffers.sig.buffer, + ssl->buffers.sig.length, + (RsaKey*)ssl->sigKey); + break; + } + #endif + } /* switch (ssl->suites->sigAlgo) */ + break; + } + #endif /* !defined(NO_DH) && !defined(NO_RSA) */ + } /* switch(ssl->specs.kea) */ + + /* Check for error */ + if (ret != 0) { + goto exit_sske; + } + + /* Advance state and proceed */ + ssl->options.keyShareState = KEYSHARE_FINALIZE; + } /* case KEYSHARE_VERIFY */ + + case KEYSHARE_FINALIZE: + { + #ifdef HAVE_QSH + if (ssl->peerQSHKeyPresent) { + if (qshSz > 0) { + idx = sendSz - qshSz; + if (QSH_KeyExchangeWrite(ssl, 1) != 0) { + ERROR_OUT(MEMORY_E, exit_sske); + } + + /* extension type */ + c16toa(TLSX_QUANTUM_SAFE_HYBRID, output + idx); + idx += OPAQUE16_LEN; + + /* write to output and check amount written */ + if (TLSX_QSHPK_Write(ssl->QSH_secret->list, output + idx) + > qshSz - OPAQUE16_LEN) { + ERROR_OUT(MEMORY_E, exit_sske); + } + } + } + #endif + + #if defined(HAVE_ECC) + if (ssl->specs.kea == ecdhe_psk_kea || ssl->specs.kea == ecc_diffie_hellman_kea) { + AddHeaders(output, length, server_key_exchange, ssl); + } + #endif /* HAVE_ECC */ + + #ifdef WOLFSSL_DTLS + if (ssl->options.dtls) { + if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0) { + goto exit_sske; + } + } + #endif + + ret = HashOutput(ssl, output, sendSz, 0); + if (ret != 0) { + goto exit_sske; + } + + #ifdef WOLFSSL_CALLBACKS + if (ssl->hsInfoOn) { + AddPacketName("ServerKeyExchange", &ssl->handShakeInfo); + } + if (ssl->toInfoOn) { + AddPacketInfo("ServerKeyExchange", &ssl->timeoutInfo, output, + sendSz, ssl->heap); + } + #endif + + /* Check for error */ + if (ret != 0) { + goto exit_sske; + } + + /* Advance state and proceed */ + ssl->options.keyShareState = KEYSHARE_END; + } /* case KEYSHARE_FINALIZE */ + + case KEYSHARE_END: + { + ssl->buffers.outputBuffer.length += sendSz; + if (!ssl->options.groupMessages) { + ret = SendBuffered(ssl); + } + + ssl->options.serverState = SERVER_KEYEXCHANGE_COMPLETE; + break; + } + default: + ret = INPUT_CASE_ERROR; + } /* switch(ssl->options.keyShareState) */ + + exit_sske: + + /* Handle cleanup for stack variables here */ + #if defined(HAVE_ECC) + if (exportBuf) { + XFREE(exportBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); + exportBuf = NULL; + } + #endif + #if defined(HAVE_ECC) || (!defined(NO_DH) && !defined(NO_RSA)) + if (sigDataBuf) { + XFREE(sigDataBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); + sigDataBuf = NULL; } #endif +#ifdef WOLFSSL_ASYNC_CRYPT + /* Handle WC_PENDING_E */ + if (ret == WC_PENDING_E) { + /* Store variables needed for async */ + XMEMSET(&ssl->async, 0, sizeof(ssl->async)); + ssl->async.output = output; + ssl->async.sendSz = sendSz; + ssl->async.idx = idx; + ssl->async.length = length; + ssl->async.sigSz = sigSz; - switch(ssl->specs.kea) - { - #ifndef NO_PSK - case psk_kea: - { - byte *output; - word32 length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; - int sendSz; - if (ssl->arrays->server_hint[0] == 0) return 0; /* don't send */ - - /* include size part */ - length = (word32)XSTRLEN(ssl->arrays->server_hint); - if (length > MAX_PSK_ID_LEN) { - return SERVER_HINT_ERROR; - } - - length += HINT_LEN_SZ; - sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ; - - #ifdef HAVE_QSH - length += qshSz; - sendSz += qshSz; - #endif - - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - idx += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - } - #endif - /* check for available size */ - if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { - return ret; - } - - /* get output buffer */ - output = ssl->buffers.outputBuffer.buffer + - ssl->buffers.outputBuffer.length; - - AddHeaders(output, length, server_key_exchange, ssl); - - /* key data */ - #ifdef HAVE_QSH - c16toa((word16)(length - qshSz - HINT_LEN_SZ), output + idx); - #else - c16toa((word16)(length - HINT_LEN_SZ), output + idx); - #endif - idx += HINT_LEN_SZ; - XMEMCPY(output + idx, ssl->arrays->server_hint,length -HINT_LEN_SZ); - - #ifdef HAVE_QSH - if (ssl->peerQSHKeyPresent) { - if (qshSz > 0) { - idx = sendSz - qshSz; - if (QSH_KeyExchangeWrite(ssl, 1) != 0) { - return MEMORY_E; - } - - /* extension type */ - c16toa(TLSX_QUANTUM_SAFE_HYBRID, output + idx); - idx += OPAQUE16_LEN; - - /* write to output and check amount written */ - if (TLSX_QSHPK_Write(ssl->QSH_secret->list, output + idx) - > qshSz - OPAQUE16_LEN) { - return MEMORY_E; - } - } - } - #endif - - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0) { - return ret; - } - } - #endif - - ret = HashOutput(ssl, output, sendSz, 0); - if (ret != 0) { - return ret; - } - - #ifdef WOLFSSL_CALLBACKS - if (ssl->hsInfoOn) { - AddPacketName("ServerKeyExchange", &ssl->handShakeInfo); - } - if (ssl->toInfoOn) { - AddPacketInfo("ServerKeyExchange", &ssl->timeoutInfo, output, - sendSz, ssl->heap); - } - #endif - - ssl->buffers.outputBuffer.length += sendSz; - if (ssl->options.groupMessages) { - ret = 0; - } - else { - ret = SendBuffered(ssl); - } - ssl->options.serverState = SERVER_KEYEXCHANGE_COMPLETE; - break; - } - #endif /*NO_PSK */ - - #if !defined(NO_DH) && !defined(NO_PSK) - case dhe_psk_kea: - { - byte *output; - word32 length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; - word32 hintLen; - int sendSz; - DhKey dhKey; - - if (ssl->buffers.serverDH_P.buffer == NULL || - ssl->buffers.serverDH_G.buffer == NULL) { - return NO_DH_PARAMS; - } - - if (ssl->buffers.serverDH_Pub.buffer == NULL) { - ssl->buffers.serverDH_Pub.buffer = (byte*)XMALLOC( - ssl->buffers.serverDH_P.length + 2, ssl->ctx->heap, - DYNAMIC_TYPE_DH); - if (ssl->buffers.serverDH_Pub.buffer == NULL) { - return MEMORY_E; - } - } - - if (ssl->buffers.serverDH_Priv.buffer == NULL) { - ssl->buffers.serverDH_Priv.buffer = (byte*)XMALLOC( - ssl->buffers.serverDH_P.length + 2, ssl->ctx->heap, - DYNAMIC_TYPE_DH); - if (ssl->buffers.serverDH_Priv.buffer == NULL) { - return MEMORY_E; - } - } - - wc_InitDhKey(&dhKey); - ret = wc_DhSetKey(&dhKey, ssl->buffers.serverDH_P.buffer, - ssl->buffers.serverDH_P.length, - ssl->buffers.serverDH_G.buffer, - ssl->buffers.serverDH_G.length); + /* Push event to queue */ + ret = wolfSSL_async_push(ssl, WOLF_EVENT_TYPE_ASYNC_ACCEPT); if (ret == 0) { - ret = wc_DhGenerateKeyPair(&dhKey, ssl->rng, - ssl->buffers.serverDH_Priv.buffer, - &ssl->buffers.serverDH_Priv.length, - ssl->buffers.serverDH_Pub.buffer, - &ssl->buffers.serverDH_Pub.length); + return WC_PENDING_E; } - wc_FreeDhKey(&dhKey); - if (ret != 0) { - return ret; - } - - length = LENGTH_SZ * 3 + /* p, g, pub */ - ssl->buffers.serverDH_P.length + - ssl->buffers.serverDH_G.length + - ssl->buffers.serverDH_Pub.length; - - /* include size part */ - hintLen = (word32)XSTRLEN(ssl->arrays->server_hint); - if (hintLen > MAX_PSK_ID_LEN) { - return SERVER_HINT_ERROR; - } - length += hintLen + HINT_LEN_SZ; - sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ; - - #ifdef HAVE_QSH - length += qshSz; - sendSz += qshSz; - #endif - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - idx += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - } - #endif - - /* check for available size */ - if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { - return ret; - } - - /* get output buffer */ - output = ssl->buffers.outputBuffer.buffer + - ssl->buffers.outputBuffer.length; - - AddHeaders(output, length, server_key_exchange, ssl); - - /* key data */ - c16toa((word16)hintLen, output + idx); - idx += HINT_LEN_SZ; - XMEMCPY(output + idx, ssl->arrays->server_hint, hintLen); - idx += hintLen; - - /* add p, g, pub */ - c16toa((word16)ssl->buffers.serverDH_P.length, output + idx); - idx += LENGTH_SZ; - XMEMCPY(output + idx, ssl->buffers.serverDH_P.buffer, - ssl->buffers.serverDH_P.length); - idx += ssl->buffers.serverDH_P.length; - - /* g */ - c16toa((word16)ssl->buffers.serverDH_G.length, output + idx); - idx += LENGTH_SZ; - XMEMCPY(output + idx, ssl->buffers.serverDH_G.buffer, - ssl->buffers.serverDH_G.length); - idx += ssl->buffers.serverDH_G.length; - - /* pub */ - c16toa((word16)ssl->buffers.serverDH_Pub.length, output + idx); - idx += LENGTH_SZ; - XMEMCPY(output + idx, ssl->buffers.serverDH_Pub.buffer, - ssl->buffers.serverDH_Pub.length); - idx += ssl->buffers.serverDH_Pub.length; - (void)idx; /* suppress analyzer warning, and keep idx current */ - - #ifdef HAVE_QSH - if (ssl->peerQSHKeyPresent) { - if (qshSz > 0) { - idx = sendSz - qshSz; - QSH_KeyExchangeWrite(ssl, 1); - - /* extension type */ - c16toa(TLSX_QUANTUM_SAFE_HYBRID, output + idx); - idx += OPAQUE16_LEN; - - /* write to output and check amount written */ - if (TLSX_QSHPK_Write(ssl->QSH_secret->list, output + idx) - > qshSz - OPAQUE16_LEN) { - return MEMORY_E; - } - } - } - #endif - - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0) { - return ret; - } - } - #endif - - ret = HashOutput(ssl, output, sendSz, 0); - - if (ret != 0) { - return ret; - } - - #ifdef WOLFSSL_CALLBACKS - if (ssl->hsInfoOn) { - AddPacketName("ServerKeyExchange", &ssl->handShakeInfo); - } - if (ssl->toInfoOn) { - AddPacketInfo("ServerKeyExchange", &ssl->timeoutInfo, output, - sendSz, ssl->heap); - } - #endif - - ssl->buffers.outputBuffer.length += sendSz; - if (ssl->options.groupMessages) { - ret = 0; - } - else { - ret = SendBuffered(ssl); - } - ssl->options.serverState = SERVER_KEYEXCHANGE_COMPLETE; - break; } - #endif /* !NO_DH && !NO_PSK */ - - #if defined(HAVE_ECC) && !defined(NO_PSK) - case ecdhe_psk_kea: - { - word32 hintLen; - word32 length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; - int sendSz; - byte *output; - ecc_key dsaKey; - #ifdef WOLFSSL_SMALL_STACK - byte* exportBuf = NULL; - #else - byte exportBuf[MAX_EXPORT_ECC_SZ]; - #endif - word32 expSz = MAX_EXPORT_ECC_SZ; - - /* curve type, named curve, length(1) */ - length = ENUM_LEN + CURVE_LEN + ENUM_LEN; - /* pub key size */ - WOLFSSL_MSG("Using ephemeral ECDH"); - - /* need ephemeral key now, create it if missing */ - if (ssl->eccTempKey == NULL) { - /* alloc/init on demand */ - ssl->eccTempKey = (ecc_key*)XMALLOC(sizeof(ecc_key), - ssl->ctx->heap, DYNAMIC_TYPE_ECC); - if (ssl->eccTempKey == NULL) { - WOLFSSL_MSG("EccTempKey Memory error"); - return MEMORY_E; - } - wc_ecc_init(ssl->eccTempKey); - } - if (ssl->eccTempKeyPresent == 0) { - if (wc_ecc_make_key(ssl->rng, ssl->eccTempKeySz, - ssl->eccTempKey) != 0) { - return ECC_MAKEKEY_ERROR; - } - ssl->eccTempKeyPresent = 1; - } - - #ifdef WOLFSSL_SMALL_STACK - exportBuf = (byte*)XMALLOC(MAX_EXPORT_ECC_SZ, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (exportBuf == NULL) { - return MEMORY_E; - } - #endif - - if (wc_ecc_export_x963(ssl->eccTempKey, exportBuf, &expSz) != 0) { - #ifdef WOLFSSL_SMALL_STACK - XFREE(exportBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - return ECC_EXPORT_ERROR; - } - length += expSz; - - /* include size part */ - hintLen = (word32)XSTRLEN(ssl->arrays->server_hint); - if (hintLen > MAX_PSK_ID_LEN) { - #ifdef WOLFSSL_SMALL_STACK - XFREE(exportBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - return SERVER_HINT_ERROR; - } - length += hintLen + HINT_LEN_SZ; - sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ; - - #ifdef HAVE_QSH - length += qshSz; - sendSz += qshSz; - #endif - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - idx += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - } - #endif - /* check for available size */ - if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { - wc_ecc_free(&dsaKey); - #ifdef WOLFSSL_SMALL_STACK - XFREE(exportBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - return ret; - } - - /* get output buffer */ - output = ssl->buffers.outputBuffer.buffer + - ssl->buffers.outputBuffer.length; - - /* key data */ - c16toa((word16)hintLen, output + idx); - idx += HINT_LEN_SZ; - XMEMCPY(output + idx, ssl->arrays->server_hint, hintLen); - idx += hintLen; - - /* ECC key exchange data */ - output[idx++] = named_curve; - output[idx++] = 0x00; /* leading zero */ - output[idx++] = SetCurveId(wc_ecc_size(ssl->eccTempKey)); - output[idx++] = (byte)expSz; - XMEMCPY(output + idx, exportBuf, expSz); - #ifdef WOLFSSL_SMALL_STACK - XFREE(exportBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - - #ifdef HAVE_QSH - if (ssl->peerQSHKeyPresent) { - if (qshSz > 0) { - idx = sendSz - qshSz; - QSH_KeyExchangeWrite(ssl, 1); - - /* extension type */ - c16toa(TLSX_QUANTUM_SAFE_HYBRID, output + idx); - idx += OPAQUE16_LEN; - - /* write to output and check amount written */ - if (TLSX_QSHPK_Write(ssl->QSH_secret->list, output + idx) - > qshSz - OPAQUE16_LEN) { - return MEMORY_E; - } - } - } - #endif - - - AddHeaders(output, length, server_key_exchange, ssl); - - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0) { - return ret; - } - } - #endif - - ret = HashOutput(ssl, output, sendSz, 0); - - if (ret != 0) { - return ret; - } - - #ifdef WOLFSSL_CALLBACKS - if (ssl->hsInfoOn) { - AddPacketName("ServerKeyExchange", &ssl->handShakeInfo); - } - if (ssl->toInfoOn) { - AddPacketInfo("ServerKeyExchange", &ssl->timeoutInfo, output, - sendSz, ssl->heap); - } - #endif - - ssl->buffers.outputBuffer.length += sendSz; - if (ssl->options.groupMessages) { - ret = 0; - } - else { - ret = SendBuffered(ssl); - } - ssl->options.serverState = SERVER_KEYEXCHANGE_COMPLETE; - break; - } - #endif /* HAVE_ECC && !NO_PSK */ - - #ifdef HAVE_ECC - case ecc_diffie_hellman_kea: - { - byte *output; - word32 length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; - int sendSz; - word32 sigSz; - word32 preSigSz, preSigIdx; - #ifndef NO_RSA - RsaKey rsaKey; - #endif - ecc_key dsaKey; - #ifdef WOLFSSL_SMALL_STACK - byte* exportBuf = NULL; - #else - byte exportBuf[MAX_EXPORT_ECC_SZ]; - #endif - word32 expSz = MAX_EXPORT_ECC_SZ; - - #ifndef NO_OLD_TLS - byte doMd5 = 0; - byte doSha = 0; - #endif - #ifndef NO_SHA256 - byte doSha256 = 0; - #endif - #ifdef WOLFSSL_SHA384 - byte doSha384 = 0; - #endif - #ifdef WOLFSSL_SHA512 - byte doSha512 = 0; - #endif - - if (ssl->specs.static_ecdh) { - WOLFSSL_MSG("Using Static ECDH, not sending ServerKeyExchange"); - return 0; - } - - /* curve type, named curve, length(1) */ - length = ENUM_LEN + CURVE_LEN + ENUM_LEN; - /* pub key size */ - WOLFSSL_MSG("Using ephemeral ECDH"); - - /* need ephemeral key now, create it if missing */ - if (ssl->eccTempKey == NULL) { - /* alloc/init on demand */ - ssl->eccTempKey = (ecc_key*)XMALLOC(sizeof(ecc_key), - ssl->ctx->heap, DYNAMIC_TYPE_ECC); - if (ssl->eccTempKey == NULL) { - WOLFSSL_MSG("EccTempKey Memory error"); - return MEMORY_E; - } - wc_ecc_init(ssl->eccTempKey); - } - if (ssl->eccTempKeyPresent == 0) { - if (wc_ecc_make_key(ssl->rng, ssl->eccTempKeySz, - ssl->eccTempKey) != 0) { - return ECC_MAKEKEY_ERROR; - } - ssl->eccTempKeyPresent = 1; - } - - #ifdef WOLFSSL_SMALL_STACK - exportBuf = (byte*)XMALLOC(MAX_EXPORT_ECC_SZ, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (exportBuf == NULL) { - return MEMORY_E; - } - #endif - - if (wc_ecc_export_x963(ssl->eccTempKey, exportBuf, &expSz) != 0) { - ERROR_OUT(ECC_EXPORT_ERROR, done_a); - } - length += expSz; - - preSigSz = length; - preSigIdx = idx; - - #ifndef NO_RSA - ret = wc_InitRsaKey(&rsaKey, ssl->heap); - if (ret != 0) { - goto done_a; - } - #endif - - wc_ecc_init(&dsaKey); - - /* sig length */ - length += LENGTH_SZ; - - if (!ssl->buffers.key || !ssl->buffers.key->buffer) { - #ifndef NO_RSA - wc_FreeRsaKey(&rsaKey); - #endif - wc_ecc_free(&dsaKey); - ERROR_OUT(NO_PRIVATE_KEY, done_a); - } - - #ifndef NO_RSA - if (ssl->specs.sig_algo == rsa_sa_algo) { - /* rsa sig size */ - word32 i = 0; - ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &i, - &rsaKey, ssl->buffers.key->length); - if (ret != 0) { - goto done_a; - } - sigSz = wc_RsaEncryptSize(&rsaKey); - } else - #endif - - if (ssl->specs.sig_algo == ecc_dsa_sa_algo) { - /* ecdsa sig size */ - word32 i = 0; - ret = wc_EccPrivateKeyDecode(ssl->buffers.key->buffer, &i, - &dsaKey, ssl->buffers.key->length); - if (ret != 0) { - goto done_a; - } - sigSz = wc_ecc_sig_size(&dsaKey); /* worst case estimate */ - } - else { - #ifndef NO_RSA - wc_FreeRsaKey(&rsaKey); - #endif - wc_ecc_free(&dsaKey); - ERROR_OUT(ALGO_ID_E, done_a); /* unsupported type */ - } - length += sigSz; - - if (IsAtLeastTLSv1_2(ssl)) { - length += HASH_SIG_SIZE; - } - - sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ; - - #ifdef HAVE_QSH - length += qshSz; - sendSz += qshSz; - #endif - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - idx += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - preSigIdx = idx; - } - #endif - /* check for available size */ - if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { - #ifndef NO_RSA - wc_FreeRsaKey(&rsaKey); - #endif - wc_ecc_free(&dsaKey); - goto done_a; - } - - /* get output buffer */ - output = ssl->buffers.outputBuffer.buffer + - ssl->buffers.outputBuffer.length; - - /* record and message headers will be added below, when we're sure - of the sig length */ - - /* key exchange data */ - output[idx++] = named_curve; - output[idx++] = 0x00; /* leading zero */ - output[idx++] = SetCurveId(wc_ecc_size(ssl->eccTempKey)); - output[idx++] = (byte)expSz; - XMEMCPY(output + idx, exportBuf, expSz); - idx += expSz; - if (IsAtLeastTLSv1_2(ssl)) { - byte setHash = 0; - - output[idx++] = ssl->suites->hashAlgo; - output[idx++] = ssl->suites->sigAlgo; - - switch (ssl->suites->hashAlgo) { - case sha512_mac: - #ifdef WOLFSSL_SHA512 - doSha512 = 1; - setHash = 1; - #endif - break; - - case sha384_mac: - #ifdef WOLFSSL_SHA384 - doSha384 = 1; - setHash = 1; - #endif - break; - - case sha256_mac: - #ifndef NO_SHA256 - doSha256 = 1; - setHash = 1; - #endif - break; - - case sha_mac: - #ifndef NO_OLD_TLS - doSha = 1; - setHash = 1; - #endif - break; - - default: - WOLFSSL_MSG("Bad hash sig algo"); - break; - } - - if (setHash == 0) { - #ifndef NO_RSA - wc_FreeRsaKey(&rsaKey); - #endif - wc_ecc_free(&dsaKey); - ERROR_OUT(ALGO_ID_E, done_a); - } - } else { - /* only using sha and md5 for rsa */ - #ifndef NO_OLD_TLS - doSha = 1; - if (ssl->suites->sigAlgo == rsa_sa_algo) { - doMd5 = 1; - } - #else - #ifndef NO_RSA - wc_FreeRsaKey(&rsaKey); - #endif - wc_ecc_free(&dsaKey); - ERROR_OUT(ALGO_ID_E, done_a); - #endif - } - - /* Signtaure length will be written later, when we're sure what it - is */ - - #ifdef HAVE_FUZZER - if (ssl->fuzzerCb) { - ssl->fuzzerCb(ssl, output + preSigIdx, preSigSz, - FUZZ_SIGNATURE, ssl->fuzzerCtx); - } - #endif - - /* do signature */ - { - #ifndef NO_OLD_TLS - #ifdef WOLFSSL_SMALL_STACK - Md5* md5 = NULL; - Sha* sha = NULL; - #else - Md5 md5[1]; - Sha sha[1]; - #endif - #endif - #ifdef WOLFSSL_SMALL_STACK - byte* hash = NULL; - #else - byte hash[FINISHED_SZ]; - #endif - #ifndef NO_SHA256 - #ifdef WOLFSSL_SMALL_STACK - Sha256* sha256 = NULL; - byte* hash256 = NULL; - #else - Sha256 sha256[1]; - byte hash256[SHA256_DIGEST_SIZE]; - #endif - #endif - #ifdef WOLFSSL_SHA384 - #ifdef WOLFSSL_SMALL_STACK - Sha384* sha384 = NULL; - byte* hash384 = NULL; - #else - Sha384 sha384[1]; - byte hash384[SHA384_DIGEST_SIZE]; - #endif - #endif - #ifdef WOLFSSL_SHA512 - #ifdef WOLFSSL_SMALL_STACK - Sha512* sha512 = NULL; - byte* hash512 = NULL; - #else - Sha512 sha512[1]; - byte hash512[SHA512_DIGEST_SIZE]; - #endif - #endif - - #ifdef WOLFSSL_SMALL_STACK - hash = (byte*)XMALLOC(FINISHED_SZ, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (hash == NULL) { - ERROR_OUT(MEMORY_E, done_a); - } - #endif - - #ifndef NO_OLD_TLS - /* md5 */ - #ifdef WOLFSSL_SMALL_STACK - if (doMd5) { - md5 = (Md5*)XMALLOC(sizeof(Md5), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (md5 == NULL) { - ERROR_OUT(MEMORY_E, done_a2); - } - } - #endif - if (doMd5) { - wc_InitMd5(md5); - wc_Md5Update(md5, ssl->arrays->clientRandom, RAN_LEN); - wc_Md5Update(md5, ssl->arrays->serverRandom, RAN_LEN); - wc_Md5Update(md5, output + preSigIdx, preSigSz); - wc_Md5Final(md5, hash); - } - /* sha */ - #ifdef WOLFSSL_SMALL_STACK - if (doSha) { - sha = (Sha*)XMALLOC(sizeof(Sha), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (sha == NULL) { - ERROR_OUT(MEMORY_E, done_a2); - } - } - #endif - if (doSha) { - ret = wc_InitSha(sha); - if (ret != 0) { - goto done_a2; - } - wc_ShaUpdate(sha, ssl->arrays->clientRandom, RAN_LEN); - wc_ShaUpdate(sha, ssl->arrays->serverRandom, RAN_LEN); - wc_ShaUpdate(sha, output + preSigIdx, preSigSz); - wc_ShaFinal(sha, &hash[MD5_DIGEST_SIZE]); - } - #endif - - #ifndef NO_SHA256 - #ifdef WOLFSSL_SMALL_STACK - if (doSha256) { - sha256 = (Sha256*)XMALLOC(sizeof(Sha256), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - hash256 = (byte*)XMALLOC(SHA256_DIGEST_SIZE, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (sha256 == NULL || hash256 == NULL) { - ERROR_OUT(MEMORY_E, done_a2); - } - } - #endif - - if (doSha256) { - if (!(ret = wc_InitSha256(sha256)) - && !(ret = wc_Sha256Update(sha256, - ssl->arrays->clientRandom, RAN_LEN)) - && !(ret = wc_Sha256Update(sha256, - ssl->arrays->serverRandom, RAN_LEN)) - && !(ret = wc_Sha256Update(sha256, - output + preSigIdx, preSigSz))) { - ret = wc_Sha256Final(sha256, hash256); - } - if (ret != 0) { - goto done_a2; - } - } - #endif - - #ifdef WOLFSSL_SHA384 - #ifdef WOLFSSL_SMALL_STACK - if (doSha384) { - sha384 = (Sha384*)XMALLOC(sizeof(Sha384), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - hash384 = (byte*)XMALLOC(SHA384_DIGEST_SIZE, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (sha384 == NULL || hash384 == NULL) { - ERROR_OUT(MEMORY_E, done_a2); - } - } - #endif - - if (doSha384) { - if (!(ret = wc_InitSha384(sha384)) - && !(ret = wc_Sha384Update(sha384, - ssl->arrays->clientRandom, RAN_LEN)) - && !(ret = wc_Sha384Update(sha384, - ssl->arrays->serverRandom, RAN_LEN)) - && !(ret = wc_Sha384Update(sha384, - output + preSigIdx, preSigSz))) { - ret = wc_Sha384Final(sha384, hash384); - } - if (ret != 0) { - goto done_a2; - } - } - #endif - - #ifdef WOLFSSL_SHA512 - #ifdef WOLFSSL_SMALL_STACK - if (doSha512) { - sha512 = (Sha512*)XMALLOC(sizeof(Sha512), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - hash512 = (byte*)XMALLOC(SHA512_DIGEST_SIZE, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (sha512 == NULL || hash512 == NULL) { - ERROR_OUT(MEMORY_E, done_a2); - } - } - #endif - - if (doSha512) { - if (!(ret = wc_InitSha512(sha512)) - && !(ret = wc_Sha512Update(sha512, - ssl->arrays->clientRandom, RAN_LEN)) - && !(ret = wc_Sha512Update(sha512, - ssl->arrays->serverRandom, RAN_LEN)) - && !(ret = wc_Sha512Update(sha512, - output + preSigIdx, preSigSz))) { - ret = wc_Sha512Final(sha512, hash512); - } - if (ret != 0) { - goto done_a2; - } - } - #endif - - #ifndef NO_RSA - if (ssl->suites->sigAlgo == rsa_sa_algo) { - byte* signBuffer = hash; - word32 signSz = FINISHED_SZ; - byte doUserRsa = 0; - #ifdef WOLFSSL_SMALL_STACK - byte* encodedSig = NULL; - #else - byte encodedSig[MAX_ENCODED_SIG_SZ]; - #endif - - #ifdef HAVE_PK_CALLBACKS - if (ssl->ctx->RsaSignCb) - doUserRsa = 1; - #endif - - #ifdef WOLFSSL_SMALL_STACK - encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (encodedSig == NULL) { - ERROR_OUT(MEMORY_E, done_a2); - } - #endif - - if (IsAtLeastTLSv1_2(ssl)) { - byte* digest = &hash[MD5_DIGEST_SIZE]; - int typeH = SHAh; - int digestSz = SHA_DIGEST_SIZE; - - if (ssl->suites->hashAlgo == sha256_mac) { - #ifndef NO_SHA256 - digest = hash256; - typeH = SHA256h; - digestSz = SHA256_DIGEST_SIZE; - #endif - } - else if (ssl->suites->hashAlgo == sha384_mac) { - #ifdef WOLFSSL_SHA384 - digest = hash384; - typeH = SHA384h; - digestSz = SHA384_DIGEST_SIZE; - #endif - } - else if (ssl->suites->hashAlgo == sha512_mac) { - #ifdef WOLFSSL_SHA512 - digest = hash512; - typeH = SHA512h; - digestSz = SHA512_DIGEST_SIZE; - #endif - } - - if (digest == NULL) { - #ifndef NO_RSA - wc_FreeRsaKey(&rsaKey); - #endif - wc_ecc_free(&dsaKey); - ERROR_OUT(ALGO_ID_E, done_a2); - } - signSz = wc_EncodeSignature(encodedSig, digest, - digestSz, typeH); - signBuffer = encodedSig; - } - /* write sig size here */ - c16toa((word16)sigSz, output + idx); - idx += LENGTH_SZ; - - if (doUserRsa) { - #ifdef HAVE_PK_CALLBACKS - word32 ioLen = sigSz; - ret = ssl->ctx->RsaSignCb(ssl, signBuffer, signSz, - output + idx, &ioLen, - ssl->buffers.key->buffer, - ssl->buffers.key->length, - ssl->RsaSignCtx); - #endif /*HAVE_PK_CALLBACKS */ - } - else { - ret = wc_RsaSSL_Sign(signBuffer, signSz, output + idx, - sigSz, &rsaKey, ssl->rng); - } - - if (ret > 0) { - /* check for signature faults */ - ret = VerifyRsaSign(output + idx, ret, - signBuffer, signSz, &rsaKey); - } - wc_FreeRsaKey(&rsaKey); - wc_ecc_free(&dsaKey); - - #ifdef WOLFSSL_SMALL_STACK - XFREE(encodedSig, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - - if (ret < 0) { - goto done_a2; - } - } else - #endif - - if (ssl->suites->sigAlgo == ecc_dsa_sa_algo) { - #ifndef NO_OLD_TLS - byte* digest = &hash[MD5_DIGEST_SIZE]; - word32 digestSz = SHA_DIGEST_SIZE; - #else - byte* digest = hash256; - word32 digestSz = SHA256_DIGEST_SIZE; - #endif - word32 sz = sigSz; - byte doUserEcc = 0; - - #if defined(HAVE_PK_CALLBACKS) && defined(HAVE_ECC) - if (ssl->ctx->EccSignCb) { - doUserEcc = 1; - } - #endif - - if (IsAtLeastTLSv1_2(ssl)) { - if (ssl->suites->hashAlgo == sha_mac) { - #ifndef NO_SHA - digest = &hash[MD5_DIGEST_SIZE]; - digestSz = SHA_DIGEST_SIZE; - #endif - } - else if (ssl->suites->hashAlgo == sha256_mac) { - #ifndef NO_SHA256 - digest = hash256; - digestSz = SHA256_DIGEST_SIZE; - #endif - } - else if (ssl->suites->hashAlgo == sha384_mac) { - #ifdef WOLFSSL_SHA384 - digest = hash384; - digestSz = SHA384_DIGEST_SIZE; - #endif - } - else if (ssl->suites->hashAlgo == sha512_mac) { - #ifdef WOLFSSL_SHA512 - digest = hash512; - digestSz = SHA512_DIGEST_SIZE; - #endif - } - } - - if (doUserEcc) { - #if defined(HAVE_PK_CALLBACKS) && defined(HAVE_ECC) - ret = ssl->ctx->EccSignCb(ssl, digest, digestSz, - output + LENGTH_SZ + idx, - &sz, - ssl->buffers.key->buffer, - ssl->buffers.key->length, - ssl->EccSignCtx); - #endif - } - else { - ret = wc_ecc_sign_hash(digest, digestSz, - output + LENGTH_SZ + idx, &sz, ssl->rng, &dsaKey); - } - #ifndef NO_RSA - wc_FreeRsaKey(&rsaKey); - #endif - wc_ecc_free(&dsaKey); - - if (ret < 0) { - goto done_a2; - } - - /* Now that we know the real sig size, write it. */ - c16toa((word16)sz, output + idx); - - /* And adjust length and sendSz from estimates */ - length += sz - sigSz; - sendSz += sz - sigSz; - } - - done_a2: - #ifdef WOLFSSL_SMALL_STACK - #ifndef NO_OLD_TLS - XFREE(md5, NULL, DYNAMIC_TYPE_TMP_BUFFER); - XFREE(sha, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - XFREE(hash, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #ifndef NO_SHA256 - XFREE(sha256, NULL, DYNAMIC_TYPE_TMP_BUFFER); - XFREE(hash256, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - #ifdef WOLFSSL_SHA384 - XFREE(sha384, NULL, DYNAMIC_TYPE_TMP_BUFFER); - XFREE(hash384, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - #ifdef WOLFSSL_SHA512 - XFREE(sha512, NULL, DYNAMIC_TYPE_TMP_BUFFER); - XFREE(hash512, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - #endif - - if (ret < 0) - goto done_a; - } - -#ifdef HAVE_QSH - if (ssl->peerQSHKeyPresent) { - if (qshSz > 0) { - idx = sendSz - qshSz; - QSH_KeyExchangeWrite(ssl, 1); - - /* extension type */ - c16toa(TLSX_QUANTUM_SAFE_HYBRID, output + idx); - idx += OPAQUE16_LEN; - - /* write to output and check amount written */ - if (TLSX_QSHPK_Write(ssl->QSH_secret->list, output + idx) - > qshSz - OPAQUE16_LEN) { - return MEMORY_E; - } - } - } #endif - - AddHeaders(output, length, server_key_exchange, ssl); - - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0) { - goto done_a; - } - } - #endif - - if ((ret = HashOutput(ssl, output, sendSz, 0)) != 0) { - goto done_a; - } - - #ifdef WOLFSSL_CALLBACKS - if (ssl->hsInfoOn) { - AddPacketName("ServerKeyExchange", &ssl->handShakeInfo); - } - if (ssl->toInfoOn) { - AddPacketInfo("ServerKeyExchange", &ssl->timeoutInfo, - output, sendSz, ssl->heap); - } - #endif - - ssl->buffers.outputBuffer.length += sendSz; - if (ssl->options.groupMessages) { - ret = 0; - } - else { - ret = SendBuffered(ssl); - } - ssl->options.serverState = SERVER_KEYEXCHANGE_COMPLETE; - - done_a: - #ifdef WOLFSSL_SMALL_STACK - XFREE(exportBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - - return ret; - } - #endif /* HAVE_ECC */ - - #if !defined(NO_DH) && !defined(NO_RSA) - case diffie_hellman_kea: - { - byte *output; - word32 length = 0, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; - int sendSz; - word32 sigSz = 0, i = 0; - word32 preSigSz = 0, preSigIdx = 0; - RsaKey rsaKey; - DhKey dhKey; - - if (ssl->buffers.serverDH_P.buffer == NULL || - ssl->buffers.serverDH_G.buffer == NULL) { - return NO_DH_PARAMS; - } - - if (ssl->buffers.serverDH_Pub.buffer == NULL) { - ssl->buffers.serverDH_Pub.buffer = (byte*)XMALLOC( - ssl->buffers.serverDH_P.length + 2, ssl->ctx->heap, - DYNAMIC_TYPE_DH); - if (ssl->buffers.serverDH_Pub.buffer == NULL) { - return MEMORY_E; - } - } - - if (ssl->buffers.serverDH_Priv.buffer == NULL) { - ssl->buffers.serverDH_Priv.buffer = (byte*)XMALLOC( - ssl->buffers.serverDH_P.length + 2, ssl->ctx->heap, - DYNAMIC_TYPE_DH); - if (ssl->buffers.serverDH_Priv.buffer == NULL) { - return MEMORY_E; - } - } - - wc_InitDhKey(&dhKey); - ret = wc_DhSetKey(&dhKey, ssl->buffers.serverDH_P.buffer, - ssl->buffers.serverDH_P.length, - ssl->buffers.serverDH_G.buffer, - ssl->buffers.serverDH_G.length); - if (ret == 0) { - ret = wc_DhGenerateKeyPair(&dhKey, ssl->rng, - ssl->buffers.serverDH_Priv.buffer, - &ssl->buffers.serverDH_Priv.length, - ssl->buffers.serverDH_Pub.buffer, - &ssl->buffers.serverDH_Pub.length); - } - wc_FreeDhKey(&dhKey); - - if (ret != 0) { - return ret; - } - - length = LENGTH_SZ * 3; /* p, g, pub */ - length += ssl->buffers.serverDH_P.length + - ssl->buffers.serverDH_G.length + - ssl->buffers.serverDH_Pub.length; - - preSigIdx = idx; - preSigSz = length; - - if (!ssl->options.usingAnon_cipher) { - ret = wc_InitRsaKey(&rsaKey, ssl->heap); - if (ret != 0) { - return ret; - } - - /* sig length */ - length += LENGTH_SZ; - - if (!ssl->buffers.key || !ssl->buffers.key->buffer) { - return NO_PRIVATE_KEY; - } - - ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &i, - &rsaKey, ssl->buffers.key->length); - if (ret == 0) { - sigSz = wc_RsaEncryptSize(&rsaKey); - length += sigSz; - } - else { - wc_FreeRsaKey(&rsaKey); - return ret; - } - - if (IsAtLeastTLSv1_2(ssl)) { - length += HASH_SIG_SIZE; - } - } - - sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ; - - #ifdef HAVE_QSH - length += qshSz; - sendSz += qshSz; - #endif - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - idx += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA; - preSigIdx = idx; - } - #endif - - /* check for available size */ - if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { - if (!ssl->options.usingAnon_cipher) { - wc_FreeRsaKey(&rsaKey); - } - return ret; - } - - /* get output buffer */ - output = ssl->buffers.outputBuffer.buffer + - ssl->buffers.outputBuffer.length; - - AddHeaders(output, length, server_key_exchange, ssl); - - /* add p, g, pub */ - c16toa((word16)ssl->buffers.serverDH_P.length, output + idx); - idx += LENGTH_SZ; - XMEMCPY(output + idx, ssl->buffers.serverDH_P.buffer, - ssl->buffers.serverDH_P.length); - idx += ssl->buffers.serverDH_P.length; - - /* g */ - c16toa((word16)ssl->buffers.serverDH_G.length, output + idx); - idx += LENGTH_SZ; - XMEMCPY(output + idx, ssl->buffers.serverDH_G.buffer, - ssl->buffers.serverDH_G.length); - idx += ssl->buffers.serverDH_G.length; - - /* pub */ - c16toa((word16)ssl->buffers.serverDH_Pub.length, output + idx); - idx += LENGTH_SZ; - XMEMCPY(output + idx, ssl->buffers.serverDH_Pub.buffer, - ssl->buffers.serverDH_Pub.length); - idx += ssl->buffers.serverDH_Pub.length; - - #ifdef HAVE_FUZZER - if (ssl->fuzzerCb) { - ssl->fuzzerCb(ssl, output + preSigIdx, preSigSz, - FUZZ_SIGNATURE, ssl->fuzzerCtx); - } - #endif - - /* Add signature */ - if (!ssl->options.usingAnon_cipher) { - #ifndef NO_OLD_TLS - #ifdef WOLFSSL_SMALL_STACK - Md5* md5 = NULL; - Sha* sha = NULL; - #else - Md5 md5[1]; - Sha sha[1]; - #endif - #endif - #ifdef WOLFSSL_SMALL_STACK - byte* hash = NULL; - #else - byte hash[FINISHED_SZ]; - #endif - #ifndef NO_SHA256 - #ifdef WOLFSSL_SMALL_STACK - Sha256* sha256 = NULL; - byte* hash256 = NULL; - #else - Sha256 sha256[1]; - byte hash256[SHA256_DIGEST_SIZE]; - #endif - #endif - #ifdef WOLFSSL_SHA384 - #ifdef WOLFSSL_SMALL_STACK - Sha384* sha384 = NULL; - byte* hash384 = NULL; - #else - Sha384 sha384[1]; - byte hash384[SHA384_DIGEST_SIZE]; - #endif - #endif - #ifdef WOLFSSL_SHA512 - #ifdef WOLFSSL_SMALL_STACK - Sha512* sha512 = NULL; - byte* hash512 = NULL; - #else - Sha512 sha512[1]; - byte hash512[SHA512_DIGEST_SIZE]; - #endif - #endif - - #ifndef NO_OLD_TLS - byte doMd5 = 0; - byte doSha = 0; - #endif - #ifndef NO_SHA256 - byte doSha256 = 0; - #endif - #ifdef WOLFSSL_SHA384 - byte doSha384 = 0; - #endif - #ifdef WOLFSSL_SHA512 - byte doSha512 = 0; - #endif - - /* Add hash/signature algo ID */ - if (IsAtLeastTLSv1_2(ssl)) { - byte setHash = 0; - - output[idx++] = ssl->suites->hashAlgo; - output[idx++] = ssl->suites->sigAlgo; - - switch (ssl->suites->hashAlgo) { - case sha512_mac: - #ifdef WOLFSSL_SHA512 - doSha512 = 1; - setHash = 1; - #endif - break; - - case sha384_mac: - #ifdef WOLFSSL_SHA384 - doSha384 = 1; - setHash = 1; - #endif - break; - - case sha256_mac: - #ifndef NO_SHA256 - doSha256 = 1; - setHash = 1; - #endif - break; - - case sha_mac: - #ifndef NO_OLD_TLS - doSha = 1; - setHash = 1; - #endif - break; - - default: - WOLFSSL_MSG("Bad hash sig algo"); - break; - } - - if (setHash == 0) { - wc_FreeRsaKey(&rsaKey); - return ALGO_ID_E; - } - } else { - /* only using sha and md5 for rsa */ - #ifndef NO_OLD_TLS - doSha = 1; - if (ssl->suites->sigAlgo == rsa_sa_algo) { - doMd5 = 1; - } - #else - wc_FreeRsaKey(&rsaKey); - return ALGO_ID_E; - #endif - } - - /* signature size */ - c16toa((word16)sigSz, output + idx); - idx += LENGTH_SZ; - - /* do signature */ - #ifdef WOLFSSL_SMALL_STACK - hash = (byte*)XMALLOC(FINISHED_SZ, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (hash == NULL) { - return MEMORY_E; /* No heap commitment before this point, - from now on, the resources are freed - at done_b. */ - } - #endif - - #ifndef NO_OLD_TLS - /* md5 */ - #ifdef WOLFSSL_SMALL_STACK - if (doMd5) { - md5 = (Md5*)XMALLOC(sizeof(Md5), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (md5 == NULL) { - ERROR_OUT(MEMORY_E, done_b); - } - } - #endif - if (doMd5) { - wc_InitMd5(md5); - wc_Md5Update(md5, ssl->arrays->clientRandom, RAN_LEN); - wc_Md5Update(md5, ssl->arrays->serverRandom, RAN_LEN); - wc_Md5Update(md5, output + preSigIdx, preSigSz); - wc_Md5Final(md5, hash); - } - - /* sha */ - #ifdef WOLFSSL_SMALL_STACK - if (doSha) { - sha = (Sha*)XMALLOC(sizeof(Sha), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (sha == NULL) { - ERROR_OUT(MEMORY_E, done_b); - } - } - #endif - - if (doSha) { - if ((ret = wc_InitSha(sha)) != 0) { - goto done_b; - } - wc_ShaUpdate(sha, ssl->arrays->clientRandom, RAN_LEN); - wc_ShaUpdate(sha, ssl->arrays->serverRandom, RAN_LEN); - wc_ShaUpdate(sha, output + preSigIdx, preSigSz); - wc_ShaFinal(sha, &hash[MD5_DIGEST_SIZE]); - } - #endif - - #ifndef NO_SHA256 - #ifdef WOLFSSL_SMALL_STACK - if (doSha256) { - sha256 = (Sha256*)XMALLOC(sizeof(Sha256), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - hash256 = (byte*)XMALLOC(SHA256_DIGEST_SIZE, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (sha256 == NULL || hash256 == NULL) { - ERROR_OUT(MEMORY_E, done_b); - } - } - #endif - - if (doSha256) { - if (!(ret = wc_InitSha256(sha256)) - && !(ret = wc_Sha256Update(sha256, - ssl->arrays->clientRandom, RAN_LEN)) - && !(ret = wc_Sha256Update(sha256, - ssl->arrays->serverRandom, RAN_LEN)) - && !(ret = wc_Sha256Update(sha256, - output + preSigIdx, preSigSz))) { - ret = wc_Sha256Final(sha256, hash256); - } - if (ret != 0) { - goto done_b; - } - } - #endif - - #ifdef WOLFSSL_SHA384 - #ifdef WOLFSSL_SMALL_STACK - if (doSha384) { - sha384 = (Sha384*)XMALLOC(sizeof(Sha384), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - hash384 = (byte*)XMALLOC(SHA384_DIGEST_SIZE, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (sha384 == NULL || hash384 == NULL) { - ERROR_OUT(MEMORY_E, done_b); - } - } - #endif - - if (doSha384) { - if (!(ret = wc_InitSha384(sha384)) - && !(ret = wc_Sha384Update(sha384, - ssl->arrays->clientRandom, RAN_LEN)) - && !(ret = wc_Sha384Update(sha384, - ssl->arrays->serverRandom, RAN_LEN)) - && !(ret = wc_Sha384Update(sha384, - output + preSigIdx, preSigSz))) { - ret = wc_Sha384Final(sha384, hash384); - } - if (ret != 0) { - goto done_b; - } - } - #endif - - #ifdef WOLFSSL_SHA512 - #ifdef WOLFSSL_SMALL_STACK - if (doSha512) { - sha512 = (Sha512*)XMALLOC(sizeof(Sha512), NULL, - DYNAMIC_TYPE_TMP_BUFFER); - hash512 = (byte*)XMALLOC(SHA512_DIGEST_SIZE, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (sha512 == NULL || hash512 == NULL) { - ERROR_OUT(MEMORY_E, done_b); - } - } - #endif - - if (doSha512) { - if (!(ret = wc_InitSha512(sha512)) - && !(ret = wc_Sha512Update(sha512, - ssl->arrays->clientRandom, RAN_LEN)) - && !(ret = wc_Sha512Update(sha512, - ssl->arrays->serverRandom, RAN_LEN)) - && !(ret = wc_Sha512Update(sha512, - output + preSigIdx, preSigSz))) { - ret = wc_Sha512Final(sha512, hash512); - } - if (ret != 0) { - goto done_b; - } - } - #endif - - #ifndef NO_RSA - if (ssl->suites->sigAlgo == rsa_sa_algo) { - byte* signBuffer = hash; - word32 signSz = FINISHED_SZ; - #ifdef WOLFSSL_SMALL_STACK - byte* encodedSig = NULL; - #else - byte encodedSig[MAX_ENCODED_SIG_SZ]; - #endif - byte doUserRsa = 0; - - #ifdef HAVE_PK_CALLBACKS - if (ssl->ctx->RsaSignCb) { - doUserRsa = 1; - } - #endif - - if (IsAtLeastTLSv1_2(ssl)) { - byte* digest = &hash[MD5_DIGEST_SIZE]; - int typeH = SHAh; - int digestSz = SHA_DIGEST_SIZE; - - #ifdef WOLFSSL_SMALL_STACK - encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (encodedSig == NULL) - ERROR_OUT(MEMORY_E, done_b); - #endif - - if (ssl->suites->hashAlgo == sha256_mac) { - #ifndef NO_SHA256 - digest = hash256; - typeH = SHA256h; - digestSz = SHA256_DIGEST_SIZE; - #endif - } - else if (ssl->suites->hashAlgo == sha384_mac) { - #ifdef WOLFSSL_SHA384 - digest = hash384; - typeH = SHA384h; - digestSz = SHA384_DIGEST_SIZE; - #endif - } - else if (ssl->suites->hashAlgo == sha512_mac) { - #ifdef WOLFSSL_SHA512 - digest = hash512; - typeH = SHA512h; - digestSz = SHA512_DIGEST_SIZE; - #endif - } - - if (digest == NULL) { - ret = ALGO_ID_E; - } else { - signSz = wc_EncodeSignature(encodedSig, digest, - digestSz, typeH); - signBuffer = encodedSig; - } - } - if (doUserRsa && ret == 0) { - #ifdef HAVE_PK_CALLBACKS - word32 ioLen = sigSz; - ret = ssl->ctx->RsaSignCb(ssl, signBuffer, signSz, - output + idx, &ioLen, - ssl->buffers.key->buffer, - ssl->buffers.key->length, - ssl->RsaSignCtx); - #endif - } else if (ret == 0) { - ret = wc_RsaSSL_Sign(signBuffer, signSz, output + idx, - sigSz, &rsaKey, ssl->rng); - } - - if (ret > 0) { - /* check for signature faults */ - ret = VerifyRsaSign(output + idx, ret, - signBuffer, signSz, &rsaKey); - } - - wc_FreeRsaKey(&rsaKey); - - #ifdef WOLFSSL_SMALL_STACK - XFREE(encodedSig, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - } - #endif - - done_b: - #ifdef WOLFSSL_SMALL_STACK - #ifndef NO_OLD_TLS - XFREE(md5, NULL, DYNAMIC_TYPE_TMP_BUFFER); - XFREE(sha, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - XFREE(hash, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #ifndef NO_SHA256 - XFREE(sha256, NULL, DYNAMIC_TYPE_TMP_BUFFER); - XFREE(hash256, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - #ifdef WOLFSSL_SHA384 - XFREE(sha384, NULL, DYNAMIC_TYPE_TMP_BUFFER); - XFREE(hash384, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - #ifdef WOLFSSL_SHA512 - XFREE(sha512, NULL, DYNAMIC_TYPE_TMP_BUFFER); - XFREE(hash512, NULL, DYNAMIC_TYPE_TMP_BUFFER); - #endif - #endif - - if (ret < 0) { - return ret; - } - } - - #ifdef HAVE_QSH - if (ssl->peerQSHKeyPresent) { - if (qshSz > 0) { - idx = sendSz - qshSz; - QSH_KeyExchangeWrite(ssl, 1); - - /* extension type */ - c16toa(TLSX_QUANTUM_SAFE_HYBRID, output + idx); - idx += OPAQUE16_LEN; - - /* write to output and check amount written */ - if (TLSX_QSHPK_Write(ssl->QSH_secret->list, output + idx) - > qshSz - OPAQUE16_LEN) { - return MEMORY_E; - } - } - } - #endif - - #ifdef WOLFSSL_DTLS - if (ssl->options.dtls) { - if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0) { - return ret; - } - } - #endif - - if ((ret = HashOutput(ssl, output, sendSz, 0)) != 0) { - return ret; - } - - #ifdef WOLFSSL_CALLBACKS - if (ssl->hsInfoOn) { - AddPacketName("ServerKeyExchange", &ssl->handShakeInfo); - } - if (ssl->toInfoOn) { - AddPacketInfo("ServerKeyExchange", &ssl->timeoutInfo, - output, sendSz, ssl->heap); - } - #endif - - ssl->buffers.outputBuffer.length += sendSz; - if (ssl->options.groupMessages) { - ret = 0; - } - else { - ret = SendBuffered(ssl); - } - ssl->options.serverState = SERVER_KEYEXCHANGE_COMPLETE; - break; - } - #endif /* NO_DH */ - default: - break; - } /* switch(ssl->specs.kea) */ + /* Final cleanup */ + FreeKeyExchange(ssl); return ret; - #undef ERROR_OUT } @@ -16514,28 +16284,22 @@ int DoSessionTicket(WOLFSSL* ssl, if (ssl->peerRsaKey != NULL && ssl->peerRsaKeyPresent != 0) { byte* out = NULL; int outLen = 0; - byte doUserRsa = 0; - - #ifdef HAVE_PK_CALLBACKS - if (ssl->ctx->RsaVerifyCb) - doUserRsa = 1; - #endif /*HAVE_PK_CALLBACKS */ WOLFSSL_MSG("Doing RSA peer cert verify"); - if (doUserRsa) { - #ifdef HAVE_PK_CALLBACKS - outLen = ssl->ctx->RsaVerifyCb(ssl, input + *inOutIdx, sz, - &out, - ssl->buffers.peerRsaKey.buffer, - ssl->buffers.peerRsaKey.length, - ssl->RsaVerifyCtx); - #endif /*HAVE_PK_CALLBACKS */ - } - else { - outLen = wc_RsaSSL_VerifyInline(input + *inOutIdx, sz, &out, - ssl->peerRsaKey); - } + outLen = RsaVerify(ssl, + input + *inOutIdx, + sz, + &out, + ssl->peerRsaKey, +#ifdef HAVE_PK_CALLBACKS + ssl->buffers.peerRsaKey.buffer, + ssl->buffers.peerRsaKey.length, + ssl->RsaVerifyCtx +#else + NULL, 0, NULL +#endif + ); if (IsAtLeastTLSv1_2(ssl)) { #ifdef WOLFSSL_SMALL_STACK @@ -16602,16 +16366,8 @@ int DoSessionTicket(WOLFSSL* ssl, #endif #ifdef HAVE_ECC if (ssl->peerEccDsaKeyPresent) { - int verify = 0; - int err = -1; byte* digest = ssl->hsHashes->certHashes.sha; word32 digestSz = SHA_DIGEST_SIZE; - byte doUserEcc = 0; - - #ifdef HAVE_PK_CALLBACKS - if (ssl->ctx->EccVerifyCb) - doUserEcc = 1; - #endif WOLFSSL_MSG("Doing ECC peer cert verify"); @@ -16640,22 +16396,18 @@ int DoSessionTicket(WOLFSSL* ssl, } } - if (doUserEcc) { + ret = EccVerify(ssl, + input + *inOutIdx, sz, + digest, digestSz, + ssl->peerEccDsaKey, #ifdef HAVE_PK_CALLBACKS - ret = ssl->ctx->EccVerifyCb(ssl, input + *inOutIdx, sz, digest, - digestSz, - ssl->buffers.peerEccDsaKey.buffer, - ssl->buffers.peerEccDsaKey.length, - &verify, ssl->EccVerifyCtx); + ssl->buffers.peerEccDsaKey.buffer, + ssl->buffers.peerEccDsaKey.length, + ssl->EccVerifyCtx + #else + NULL, 0, NULL #endif - } - else { - err = wc_ecc_verify_hash(input + *inOutIdx, sz, digest, - digestSz, &verify, ssl->peerEccDsaKey); - } - - if (err == 0 && verify == 1) - ret = 0; /* verified */ + ); } #endif *inOutIdx += sz; @@ -16963,750 +16715,778 @@ int DoSessionTicket(WOLFSSL* ssl, static int DoClientKeyExchange(WOLFSSL* ssl, byte* input, word32* inOutIdx, word32 size) { - #ifdef HAVE_QSH - word16 name; - int qshSz; - #endif - int ret = 0; + int ret; word32 length = 0; - byte* out = NULL; - word32 begin = *inOutIdx; + word32 idx = *inOutIdx, begin = *inOutIdx; + byte* output_lcl = NULL; + byte** output = &output_lcl; - (void)length; /* shut up compiler warnings */ - (void)out; + /* suppress possible compiler warnings */ (void)input; (void)size; - (void)begin; + (void)length; + (void)idx; + (void)output; - if (ssl->options.side != WOLFSSL_SERVER_END) { - WOLFSSL_MSG("Client received client keyexchange, attack?"); - WOLFSSL_ERROR(ssl->error = SIDE_ERROR); - return SSL_FATAL_ERROR; - } + #ifdef WOLFSSL_ASYNC_CRYPT + /* Use async output pointer */ + output = &ssl->async.output; - if (ssl->options.clientState < CLIENT_HELLO_COMPLETE) { - WOLFSSL_MSG("Client sending keyexchange at wrong time"); - SendAlert(ssl, alert_fatal, unexpected_message); - return OUT_OF_ORDER_E; - } - - #ifndef NO_CERTS - if (ssl->options.verifyPeer && ssl->options.failNoCert) { - if (!ssl->options.havePeerCert) { - WOLFSSL_MSG("client didn't present peer cert"); - return NO_PEER_CERT; - } + ret = wolfSSL_async_pop(ssl, WOLF_EVENT_TYPE_ASYNC_ACCEPT); + if (ret != ASYNC_NOT_PENDING) { + /* Check for error */ + if (ret < 0) { + goto exit_dcke; } + else { + /* Restore variables needed for async */ + idx = ssl->async.idx; + length = ssl->async.length; - if (ssl->options.verifyPeer && ssl->options.failNoCertxPSK) { - if (!ssl->options.havePeerCert && + /* Advance state */ + ssl->options.keyShareState++; + } + } + else + #endif + { + /* Reset state */ + ret = 0; + ssl->options.keyShareState = KEYSHARE_BEGIN; + } + + /* Do Client Key Exchange State Machine */ + switch(ssl->options.keyShareState) + { + case KEYSHARE_BEGIN: + { + /* Sanity checks */ + if (ssl->options.side != WOLFSSL_SERVER_END) { + WOLFSSL_MSG("Client received client keyexchange, attack?"); + WOLFSSL_ERROR(ssl->error = SIDE_ERROR); + ERROR_OUT(SSL_FATAL_ERROR, exit_dcke); + } + + if (ssl->options.clientState < CLIENT_HELLO_COMPLETE) { + WOLFSSL_MSG("Client sending keyexchange at wrong time"); + SendAlert(ssl, alert_fatal, unexpected_message); + ERROR_OUT(OUT_OF_ORDER_E, exit_dcke); + } + + #ifndef NO_CERTS + if (ssl->options.verifyPeer && ssl->options.failNoCert) { + if (!ssl->options.havePeerCert) { + WOLFSSL_MSG("client didn't present peer cert"); + ERROR_OUT(NO_PEER_CERT, exit_dcke); + } + } + + if (ssl->options.verifyPeer && ssl->options.failNoCertxPSK) { + if (!ssl->options.havePeerCert && !ssl->options.usingPSK_cipher){ - WOLFSSL_MSG("client didn't present peer cert"); - return NO_PEER_CERT; - } - } - #endif - - #ifdef WOLFSSL_CALLBACKS - if (ssl->hsInfoOn) { - AddPacketName("ClientKeyExchange", &ssl->handShakeInfo); - } - if (ssl->toInfoOn) { - AddLateName("ClientKeyExchange", &ssl->timeoutInfo); - } - #endif - - switch (ssl->specs.kea) { - #ifndef NO_RSA - case rsa_kea: - { - word32 idx = 0; - RsaKey key; - byte doUserRsa = 0; - - #ifdef HAVE_PK_CALLBACKS - if (ssl->ctx->RsaDecCb) { - doUserRsa = 1; + WOLFSSL_MSG("client didn't present peer cert"); + return NO_PEER_CERT; } - #endif + } + #endif - ret = wc_InitRsaKey(&key, ssl->heap); + #ifdef WOLFSSL_CALLBACKS + if (ssl->hsInfoOn) { + AddPacketName("ClientKeyExchange", &ssl->handShakeInfo); + } + if (ssl->toInfoOn) { + AddLateName("ClientKeyExchange", &ssl->timeoutInfo); + } + #endif + + switch (ssl->specs.kea) { + #ifndef NO_RSA + case rsa_kea: + { + if (!ssl->buffers.key->buffer) { + ERROR_OUT(NO_PRIVATE_KEY, exit_dcke); + } + break; + } /* rsa_kea */ + #endif /* !NO_RSA */ + #ifndef NO_PSK + case psk_kea: + { + /* sanity check that PSK server callback has been set */ + if (ssl->options.server_psk_cb == NULL) { + WOLFSSL_MSG("No server PSK callback set"); + ERROR_OUT(PSK_KEY_ERROR, exit_dcke); + } + break; + } + #endif /* !NO_PSK */ + #ifdef HAVE_NTRU + case ntru_kea: + { + if (!ssl->buffers.key->buffer) { + ERROR_OUT(NO_PRIVATE_KEY, exit_dcke); + } + break; + } + #endif /* HAVE_NTRU */ + #ifdef HAVE_ECC + case ecc_diffie_hellman_kea: + { + break; + } + #endif /* HAVE_ECC */ + #ifndef NO_DH + case diffie_hellman_kea: + { + break; + } + #endif /* !NO_DH */ + #if !defined(NO_DH) && !defined(NO_PSK) + case dhe_psk_kea: + { + /* sanity check that PSK server callback has been set */ + if (ssl->options.server_psk_cb == NULL) { + WOLFSSL_MSG("No server PSK callback set"); + ERROR_OUT(PSK_KEY_ERROR, exit_dcke); + } + break; + } + #endif /* !NO_DH && !NO_PSK */ + #if defined(HAVE_ECC) && !defined(NO_PSK) + case ecdhe_psk_kea: + { + /* sanity check that PSK server callback has been set */ + if (ssl->options.server_psk_cb == NULL) { + WOLFSSL_MSG("No server PSK callback set"); + ERROR_OUT(PSK_KEY_ERROR, exit_dcke); + } + break; + } + #endif /* HAVE_ECC && !NO_PSK */ + default: + WOLFSSL_MSG("Bad kea type"); + ret = BAD_KEA_TYPE_E; + } /* switch (ssl->specs.kea) */ + + /* Check for error */ if (ret != 0) { - return ret; + goto exit_dcke; } - if (!ssl->buffers.key || !ssl->buffers.key->buffer) { - return NO_PRIVATE_KEY; - } + /* Advance state and proceed */ + ssl->options.keyShareState = KEYSHARE_BUILD; + } /* KEYSHARE_BEGIN */ - ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &idx, - &key, ssl->buffers.key->length); + case KEYSHARE_BUILD: + { + switch (ssl->specs.kea) { + #ifndef NO_RSA + case rsa_kea: + { + word32 i = 0; + ssl->sigKey = XMALLOC(sizeof(RsaKey), NULL, DYNAMIC_TYPE_RSA); + if (ssl->sigKey == NULL) { + ERROR_OUT(MEMORY_E, exit_dcke); + } + ssl->sigType = DYNAMIC_TYPE_RSA; - if (ret == 0) { - length = wc_RsaEncryptSize(&key); - ssl->arrays->preMasterSz = SECRET_LEN; - - if (ssl->options.tls) { - word16 check; - - if ((*inOutIdx - begin) + OPAQUE16_LEN > size) { - return BUFFER_ERROR; + ret = wc_InitRsaKey((RsaKey*)ssl->sigKey, ssl->heap); + if (ret != 0) { + goto exit_dcke; } - ato16(input + *inOutIdx, &check); - *inOutIdx += OPAQUE16_LEN; - - if ((word32) check != length) { - WOLFSSL_MSG("RSA explicit size doesn't match"); - wc_FreeRsaKey(&key); - return RSA_PRIVATE_ERROR; + ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &i, + (RsaKey*)ssl->sigKey, ssl->buffers.key->length); + if (ret != 0) { + goto exit_dcke; } - } + length = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); + ssl->arrays->preMasterSz = SECRET_LEN; - if ((*inOutIdx - begin) + length > size) { - WOLFSSL_MSG("RSA message too big"); - wc_FreeRsaKey(&key); - return BUFFER_ERROR; - } + if (ssl->options.tls) { + word16 check; - if (doUserRsa) { - #ifdef HAVE_PK_CALLBACKS - ret = ssl->ctx->RsaDecCb(ssl, - input + *inOutIdx, length, &out, - ssl->buffers.key->buffer, - ssl->buffers.key->length, - ssl->RsaDecCtx); - #endif - } - else { - ret = wc_RsaPrivateDecryptInline(input + *inOutIdx, length, - &out, &key); - } - - *inOutIdx += length; - - if (ret == SECRET_LEN) { - XMEMCPY(ssl->arrays->preMasterSecret, out, SECRET_LEN); - if (ssl->arrays->preMasterSecret[0] != - ssl->chVersion.major - || ssl->arrays->preMasterSecret[1] != - ssl->chVersion.minor) { - ret = PMS_VERSION_ERROR; - } - else - { - #ifdef HAVE_QSH - if (ssl->options.haveQSH) { - /* extension name */ - ato16(input + *inOutIdx, &name); - *inOutIdx += OPAQUE16_LEN; - - if (name == TLSX_QUANTUM_SAFE_HYBRID) { - /* if qshSz is larger than 0 it is the - length of buffer used */ - if ((qshSz = TLSX_QSHCipher_Parse(ssl, input - + *inOutIdx, size - *inOutIdx - + begin, 1)) < 0) { - return qshSz; - } - *inOutIdx += qshSz; - } - else { - /* unknown extension sent client ignored - handshake */ - return BUFFER_ERROR; - } + if ((idx - begin) + OPAQUE16_LEN > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); } - #endif - ret = MakeMasterSecret(ssl); - } - } - else { - ret = RSA_PRIVATE_ERROR; - } - } - wc_FreeRsaKey(&key); - } - break; - #endif - #ifndef NO_PSK - case psk_kea: - { - byte* pms = ssl->arrays->preMasterSecret; - word16 ci_sz; + ato16(input + idx, &check); + idx += OPAQUE16_LEN; - /* sanity check that PSK server callback has been set */ - if (ssl->options.server_psk_cb == NULL) { - WOLFSSL_MSG("No server PSK callback set"); - return PSK_KEY_ERROR; - } - - if ((*inOutIdx - begin) + OPAQUE16_LEN > size) { - return BUFFER_ERROR; - } - - ato16(input + *inOutIdx, &ci_sz); - *inOutIdx += OPAQUE16_LEN; - - if (ci_sz > MAX_PSK_ID_LEN) { - return CLIENT_ID_ERROR; - } - - if ((*inOutIdx - begin) + ci_sz > size) { - return BUFFER_ERROR; - } - - XMEMCPY(ssl->arrays->client_identity, input + *inOutIdx, ci_sz); - *inOutIdx += ci_sz; - - ssl->arrays->client_identity[min(ci_sz, MAX_PSK_ID_LEN-1)] = 0; - ssl->arrays->psk_keySz = ssl->options.server_psk_cb(ssl, - ssl->arrays->client_identity, ssl->arrays->psk_key, - MAX_PSK_KEY_LEN); - - if (ssl->arrays->psk_keySz == 0 || - ssl->arrays->psk_keySz > MAX_PSK_KEY_LEN) { - return PSK_KEY_ERROR; - } - - /* make psk pre master secret */ - /* length of key + length 0s + length of key + key */ - c16toa((word16) ssl->arrays->psk_keySz, pms); - pms += OPAQUE16_LEN; - - XMEMSET(pms, 0, ssl->arrays->psk_keySz); - pms += ssl->arrays->psk_keySz; - - c16toa((word16) ssl->arrays->psk_keySz, pms); - pms += OPAQUE16_LEN; - - XMEMCPY(pms, ssl->arrays->psk_key, ssl->arrays->psk_keySz); - ssl->arrays->preMasterSz = ssl->arrays->psk_keySz * 2 + 4; - - #ifdef HAVE_QSH - if (ssl->options.haveQSH) { - /* extension name */ - ato16(input + *inOutIdx, &name); - *inOutIdx += OPAQUE16_LEN; - - if (name == TLSX_QUANTUM_SAFE_HYBRID) { - /* if qshSz is larger than 0 it is the length of - buffer used */ - if ((qshSz = TLSX_QSHCipher_Parse(ssl, input + *inOutIdx, - size - *inOutIdx + begin, 1)) < 0) { - return qshSz; + if ((word32)check != length) { + WOLFSSL_MSG("RSA explicit size doesn't match"); + ERROR_OUT(RSA_PRIVATE_ERROR, exit_dcke); + } } - *inOutIdx += qshSz; - } - else { - /* unknown extension sent client ignored - handshake */ - return BUFFER_ERROR; - } - } - #endif - ret = MakeMasterSecret(ssl); - /* No further need for PSK */ - ForceZero(ssl->arrays->psk_key, ssl->arrays->psk_keySz); - ssl->arrays->psk_keySz = 0; - } - break; - #endif /* NO_PSK */ - #ifdef HAVE_NTRU - case ntru_kea: - { - word16 cipherLen; - word16 plainLen = sizeof(ssl->arrays->preMasterSecret); - - if (!ssl->buffers.key || !ssl->buffers.key->buffer) { - return NO_PRIVATE_KEY; - } - - if ((*inOutIdx - begin) + OPAQUE16_LEN > size) { - return BUFFER_ERROR; - } - - ato16(input + *inOutIdx, &cipherLen); - *inOutIdx += OPAQUE16_LEN; - - if (cipherLen > MAX_NTRU_ENCRYPT_SZ) { - return NTRU_KEY_ERROR; - } - - if ((*inOutIdx - begin) + cipherLen > size) { - return BUFFER_ERROR; - } - - if (NTRU_OK != ntru_crypto_ntru_decrypt( - (word16) ssl->buffers.key->length, - ssl->buffers.key->buffer, cipherLen, - input + *inOutIdx, &plainLen, - ssl->arrays->preMasterSecret)) { - return NTRU_DECRYPT_ERROR; - } - - if (plainLen != SECRET_LEN) { - return NTRU_DECRYPT_ERROR; - } - - *inOutIdx += cipherLen; - - #ifdef HAVE_QSH - if (ssl->options.haveQSH) { - /* extension name */ - ato16(input + *inOutIdx, &name); - *inOutIdx += OPAQUE16_LEN; - - if (name == TLSX_QUANTUM_SAFE_HYBRID) { - /* if qshSz is larger than 0 it is the length of - buffer used */ - if ((qshSz = TLSX_QSHCipher_Parse(ssl, input + *inOutIdx, - size - *inOutIdx + begin, 1)) < 0) { - return qshSz; + if ((idx - begin) + length > size) { + WOLFSSL_MSG("RSA message too big"); + ERROR_OUT(BUFFER_ERROR, exit_dcke); } - *inOutIdx += qshSz; + + /* These RSA variables persist throughout DoClientKeyExchange */ + *output = NULL; + ret = RsaDec(ssl, + input + idx, + length, + output, + &ssl->sigLen, + (RsaKey*)ssl->sigKey, + #if defined(HAVE_PK_CALLBACKS) + ssl->buffers.key->buffer, + ssl->buffers.key->length, + ssl->RsaDecCtx + #else + NULL, 0, NULL + #endif + ); + break; + } /* rsa_kea */ + #endif /* !NO_RSA */ + #ifndef NO_PSK + case psk_kea: + { + byte* pms = ssl->arrays->preMasterSecret; + word16 ci_sz; + + if ((idx - begin) + OPAQUE16_LEN > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + ato16(input + idx, &ci_sz); + idx += OPAQUE16_LEN; + + if (ci_sz > MAX_PSK_ID_LEN) { + ERROR_OUT(CLIENT_ID_ERROR, exit_dcke); + } + + if ((idx - begin) + ci_sz > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + XMEMCPY(ssl->arrays->client_identity, input + idx, ci_sz); + idx += ci_sz; + + ssl->arrays->client_identity[min(ci_sz, MAX_PSK_ID_LEN-1)] = 0; + ssl->arrays->psk_keySz = ssl->options.server_psk_cb(ssl, + ssl->arrays->client_identity, ssl->arrays->psk_key, + MAX_PSK_KEY_LEN); + + if (ssl->arrays->psk_keySz == 0 || + ssl->arrays->psk_keySz > MAX_PSK_KEY_LEN) { + ERROR_OUT(PSK_KEY_ERROR, exit_dcke); + } + + /* make psk pre master secret */ + /* length of key + length 0s + length of key + key */ + c16toa((word16) ssl->arrays->psk_keySz, pms); + pms += OPAQUE16_LEN; + + XMEMSET(pms, 0, ssl->arrays->psk_keySz); + pms += ssl->arrays->psk_keySz; + + c16toa((word16) ssl->arrays->psk_keySz, pms); + pms += OPAQUE16_LEN; + + XMEMCPY(pms, ssl->arrays->psk_key, ssl->arrays->psk_keySz); + ssl->arrays->preMasterSz = ssl->arrays->psk_keySz * 2 + 4; + break; } - else { - /* unknown extension sent client ignored - handshake */ - return BUFFER_ERROR; + #endif /* !NO_PSK */ + #ifdef HAVE_NTRU + case ntru_kea: + { + word16 cipherLen; + word16 plainLen = sizeof(ssl->arrays->preMasterSecret); + + if ((idx - begin) + OPAQUE16_LEN > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + ato16(input + idx, &cipherLen); + idx += OPAQUE16_LEN; + + if (cipherLen > MAX_NTRU_ENCRYPT_SZ) { + ERROR_OUT(NTRU_KEY_ERROR, exit_dcke); + } + + if ((idx - begin) + cipherLen > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + if (NTRU_OK != ntru_crypto_ntru_decrypt( + (word16) ssl->buffers.key->length, + ssl->buffers.key->buffer, cipherLen, + input + idx, &plainLen, + ssl->arrays->preMasterSecret)) { + ERROR_OUT(NTRU_DECRYPT_ERROR, exit_dcke); + } + + if (plainLen != SECRET_LEN) { + ERROR_OUT(NTRU_DECRYPT_ERROR, exit_dcke); + } + + idx += cipherLen; + ssl->arrays->preMasterSz = plainLen; + + break; } - } - #endif - ssl->arrays->preMasterSz = plainLen; - ret = MakeMasterSecret(ssl); - } - break; - #endif /* HAVE_NTRU */ - #ifdef HAVE_ECC - case ecc_diffie_hellman_kea: - { - if ((*inOutIdx - begin) + OPAQUE8_LEN > size) { - return BUFFER_ERROR; - } + #endif /* HAVE_NTRU */ + #ifdef HAVE_ECC + case ecc_diffie_hellman_kea: + { + ecc_key* private_key = ssl->eccTempKey; - length = input[(*inOutIdx)++]; + if ((idx - begin) + OPAQUE8_LEN > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } - if ((*inOutIdx - begin) + length > size) { - return BUFFER_ERROR; - } + length = input[idx++]; - if (ssl->peerEccKey == NULL) { - /* alloc/init on demand */ - ssl->peerEccKey = (ecc_key*)XMALLOC(sizeof(ecc_key), + if ((idx - begin) + length > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + if (ssl->peerEccKey == NULL) { + /* alloc/init on demand */ + ssl->peerEccKey = (ecc_key*)XMALLOC(sizeof(ecc_key), + ssl->ctx->heap, DYNAMIC_TYPE_ECC); + if (ssl->peerEccKey == NULL) { + WOLFSSL_MSG("PeerEccKey Memory error"); + ERROR_OUT(MEMORY_E, exit_dcke); + } + wc_ecc_init(ssl->peerEccKey); + } else if (ssl->peerEccKeyPresent) { /* don't leak on reuse */ + wc_ecc_free(ssl->peerEccKey); + ssl->peerEccKeyPresent = 0; + wc_ecc_init(ssl->peerEccKey); + } + + if (wc_ecc_import_x963(input + idx, length, ssl->peerEccKey)) { + ERROR_OUT(ECC_PEERKEY_ERROR, exit_dcke); + } + + idx += length; + ssl->peerEccKeyPresent = 1; + + ssl->sigLen = sizeof(ssl->arrays->preMasterSecret); + + if (ssl->specs.static_ecdh) { + word32 i = 0; + + ssl->sigKey = XMALLOC(sizeof(ecc_key), NULL, DYNAMIC_TYPE_ECC); + if (ssl->sigKey == NULL) { + ERROR_OUT(MEMORY_E, exit_dcke); + } + ssl->sigType = DYNAMIC_TYPE_ECC; + + wc_ecc_init((ecc_key*)ssl->sigKey); + + ret = wc_EccPrivateKeyDecode( + ssl->buffers.key->buffer, + &i, + (ecc_key*)ssl->sigKey, + ssl->buffers.key->length); + if (ret == 0) { + private_key = (ecc_key*)ssl->sigKey; + } + } + else if (ssl->eccTempKeyPresent == 0) { + WOLFSSL_MSG("Ecc ephemeral key not made correctly"); + ERROR_OUT(ECC_MAKEKEY_ERROR, exit_dcke); + } + if (ret != 0) { + ERROR_OUT(ECC_SHARED_ERROR, exit_dcke); + } + + /* Generate shared secret */ + ret = EccSharedSecret(ssl, private_key, ssl->peerEccKey, + ssl->arrays->preMasterSecret, &ssl->sigLen); + break; + } + #endif /* HAVE_ECC */ + #ifndef NO_DH + case diffie_hellman_kea: + { + word16 clientPubSz; + + if ((idx - begin) + OPAQUE16_LEN > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + ato16(input + idx, &clientPubSz); + idx += OPAQUE16_LEN; + + if ((idx - begin) + clientPubSz > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + ret = DhAgree(ssl, + ssl->buffers.serverDH_P.buffer, + ssl->buffers.serverDH_P.length, + ssl->buffers.serverDH_G.buffer, + ssl->buffers.serverDH_G.length, + ssl->buffers.serverDH_Priv.buffer, + &ssl->buffers.serverDH_Priv.length, + NULL, + 0, + input + idx, + clientPubSz, + ssl->arrays->preMasterSecret, + &ssl->arrays->preMasterSz); + + idx += clientPubSz; + break; + } + #endif /* !NO_DH */ + #if !defined(NO_DH) && !defined(NO_PSK) + case dhe_psk_kea: + { + byte* pms = ssl->arrays->preMasterSecret; + word16 clientSz; + + /* Read in the PSK hint */ + if ((idx - begin) + OPAQUE16_LEN > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + ato16(input + idx, &clientSz); + idx += OPAQUE16_LEN; + if (clientSz > MAX_PSK_ID_LEN) { + ERROR_OUT(CLIENT_ID_ERROR, exit_dcke); + } + + if ((idx - begin) + clientSz > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + XMEMCPY(ssl->arrays->client_identity, input + idx, clientSz); + idx += clientSz; + ssl->arrays->client_identity[ + min(clientSz, MAX_PSK_ID_LEN-1)] = 0; + + /* Read in the DHE business */ + if ((idx - begin) + OPAQUE16_LEN > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + ato16(input + idx, &clientSz); + idx += OPAQUE16_LEN; + + if ((idx - begin) + clientSz > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + ret = DhAgree(ssl, + ssl->buffers.serverDH_P.buffer, + ssl->buffers.serverDH_P.length, + ssl->buffers.serverDH_G.buffer, + ssl->buffers.serverDH_G.length, + ssl->buffers.serverDH_Priv.buffer, + &ssl->buffers.serverDH_Priv.length, + NULL, + 0, + input + idx, + clientSz, + pms + OPAQUE16_LEN, + &ssl->arrays->preMasterSz); + + idx += clientSz; + c16toa((word16)ssl->arrays->preMasterSz, pms); + ssl->arrays->preMasterSz += OPAQUE16_LEN; + pms += ssl->arrays->preMasterSz; + + /* Use the PSK hint to look up the PSK and add it to the + * preMasterSecret here. */ + ssl->arrays->psk_keySz = ssl->options.server_psk_cb(ssl, + ssl->arrays->client_identity, ssl->arrays->psk_key, + MAX_PSK_KEY_LEN); + + if (ssl->arrays->psk_keySz == 0 || + ssl->arrays->psk_keySz > MAX_PSK_KEY_LEN) { + ERROR_OUT(PSK_KEY_ERROR, exit_dcke); + } + + c16toa((word16) ssl->arrays->psk_keySz, pms); + pms += OPAQUE16_LEN; + + XMEMCPY(pms, ssl->arrays->psk_key, ssl->arrays->psk_keySz); + ssl->arrays->preMasterSz += ssl->arrays->psk_keySz + OPAQUE16_LEN; + break; + } + #endif /* !NO_DH && !NO_PSK */ + #if defined(HAVE_ECC) && !defined(NO_PSK) + case ecdhe_psk_kea: + { + word16 clientSz; + + /* Read in the PSK hint */ + if ((idx - begin) + OPAQUE16_LEN > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + ato16(input + idx, &clientSz); + idx += OPAQUE16_LEN; + if (clientSz > MAX_PSK_ID_LEN) { + ERROR_OUT(CLIENT_ID_ERROR, exit_dcke); + } + if ((idx - begin) + clientSz > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + XMEMCPY(ssl->arrays->client_identity, + input + idx, clientSz); + idx += clientSz; + ssl->arrays->client_identity[ + min(clientSz, MAX_PSK_ID_LEN-1)] = 0; + + /* ECC key */ + if ((idx - begin) + OPAQUE8_LEN > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + length = input[idx++]; + + if ((idx - begin) + length > size) { + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + + if (ssl->peerEccKey == NULL) { + /* alloc/init on demand */ + ssl->peerEccKey = (ecc_key*)XMALLOC(sizeof(ecc_key), ssl->ctx->heap, DYNAMIC_TYPE_ECC); - if (ssl->peerEccKey == NULL) { - WOLFSSL_MSG("PeerEccKey Memory error"); - return MEMORY_E; + if (ssl->peerEccKey == NULL) { + WOLFSSL_MSG("PeerEccKey Memory error"); + ERROR_OUT(MEMORY_E, exit_dcke); + } + wc_ecc_init(ssl->peerEccKey); + } else if (ssl->peerEccKeyPresent) { /* don't leak on reuse */ + wc_ecc_free(ssl->peerEccKey); + ssl->peerEccKeyPresent = 0; + wc_ecc_init(ssl->peerEccKey); + } + if (wc_ecc_import_x963(input + idx, length, + ssl->peerEccKey)) { + ERROR_OUT(ECC_PEERKEY_ERROR, exit_dcke); + } + + idx += length; + ssl->peerEccKeyPresent = 1; + + /* Note sizeof preMasterSecret is ENCRYPT_LEN currently 512 */ + ssl->sigLen = sizeof(ssl->arrays->preMasterSecret); + + if (ssl->eccTempKeyPresent == 0) { + WOLFSSL_MSG("Ecc ephemeral key not made correctly"); + ERROR_OUT(ECC_MAKEKEY_ERROR, exit_dcke); + } + + /* Generate shared secret */ + ret = EccSharedSecret(ssl, + ssl->eccTempKey, + ssl->peerEccKey, + ssl->arrays->preMasterSecret + OPAQUE16_LEN, + &ssl->sigLen); + break; } - wc_ecc_init(ssl->peerEccKey); - } else if (ssl->peerEccKeyPresent) { /* don't leak on reuse */ - wc_ecc_free(ssl->peerEccKey); - ssl->peerEccKeyPresent = 0; - wc_ecc_init(ssl->peerEccKey); - } - - if (wc_ecc_import_x963(input + *inOutIdx, length, ssl->peerEccKey)) { - return ECC_PEERKEY_ERROR; - } - - *inOutIdx += length; - ssl->peerEccKeyPresent = 1; - - length = sizeof(ssl->arrays->preMasterSecret); - - if (ssl->specs.static_ecdh) { - ecc_key staticKey; - word32 i = 0; - - wc_ecc_init(&staticKey); - ret = wc_EccPrivateKeyDecode(ssl->buffers.key->buffer, &i, - &staticKey, ssl->buffers.key->length); - - if (ret == 0) { - ret = wc_ecc_shared_secret(&staticKey, ssl->peerEccKey, - ssl->arrays->preMasterSecret, &length); - } - - wc_ecc_free(&staticKey); - } - else { - if (ssl->eccTempKeyPresent == 0) { - WOLFSSL_MSG("Ecc ephemeral key not made correctly"); - ret = ECC_MAKEKEY_ERROR; - } else { - ret = wc_ecc_shared_secret(ssl->eccTempKey,ssl->peerEccKey, - ssl->arrays->preMasterSecret, &length); - } - } + #endif /* HAVE_ECC && !NO_PSK */ + default: + ret = BAD_KEA_TYPE_E; + } /* switch (ssl->specs.kea) */ + /* Check for error */ if (ret != 0) { - return ECC_SHARED_ERROR; + goto exit_dcke; } - ssl->arrays->preMasterSz = length; + /* Advance state and proceed */ + ssl->options.keyShareState = KEYSHARE_VERIFY; + } /* KEYSHARE_BUILD */ + + case KEYSHARE_VERIFY: + { + switch (ssl->specs.kea) { + #ifndef NO_RSA + case rsa_kea: + { + /* Add the signature length to idx */ + idx += length; + + if (ssl->sigLen == SECRET_LEN && *output != NULL) { + XMEMCPY(ssl->arrays->preMasterSecret, *output, SECRET_LEN); + if (ssl->arrays->preMasterSecret[0] != ssl->chVersion.major || + ssl->arrays->preMasterSecret[1] != ssl->chVersion.minor) { + ERROR_OUT(PMS_VERSION_ERROR, exit_dcke); + } + } + else { + ERROR_OUT(RSA_PRIVATE_ERROR, exit_dcke); + } + break; + } /* rsa_kea */ + #endif /* !NO_RSA */ + #ifndef NO_PSK + case psk_kea: + { + break; + } + #endif /* !NO_PSK */ + #ifdef HAVE_NTRU + case ntru_kea: + { + break; + } + #endif /* HAVE_NTRU */ + #ifdef HAVE_ECC + case ecc_diffie_hellman_kea: + { + ssl->arrays->preMasterSz = ssl->sigLen; + break; + } + #endif /* HAVE_ECC */ + #ifndef NO_DH + case diffie_hellman_kea: + { + break; + } + #endif /* !NO_DH */ + #if !defined(NO_DH) && !defined(NO_PSK) + case dhe_psk_kea: + { + break; + } + #endif /* !NO_DH && !NO_PSK */ + #if defined(HAVE_ECC) && !defined(NO_PSK) + case ecdhe_psk_kea: + { + byte* pms = ssl->arrays->preMasterSecret; + + /* Add preMasterSecret */ + c16toa((word16)ssl->sigLen, pms); + ssl->arrays->preMasterSz += OPAQUE16_LEN + ssl->sigLen; + pms += ssl->arrays->preMasterSz; + + /* Use the PSK hint to look up the PSK and add it to the + * preMasterSecret here. */ + ssl->arrays->psk_keySz = ssl->options.server_psk_cb(ssl, + ssl->arrays->client_identity, ssl->arrays->psk_key, + MAX_PSK_KEY_LEN); + + if (ssl->arrays->psk_keySz == 0 || + ssl->arrays->psk_keySz > MAX_PSK_KEY_LEN) { + ERROR_OUT(PSK_KEY_ERROR, exit_dcke); + } + + c16toa((word16) ssl->arrays->psk_keySz, pms); + pms += OPAQUE16_LEN; + + XMEMCPY(pms, ssl->arrays->psk_key, ssl->arrays->psk_keySz); + ssl->arrays->preMasterSz += + ssl->arrays->psk_keySz + OPAQUE16_LEN; + break; + } + #endif /* HAVE_ECC && !NO_PSK */ + default: + ret = BAD_KEA_TYPE_E; + } /* switch (ssl->specs.kea) */ + + /* Check for error */ + if (ret != 0) { + goto exit_dcke; + } + + /* Advance state and proceed */ + ssl->options.keyShareState = KEYSHARE_FINALIZE; + } /* KEYSHARE_VERIFY */ + + case KEYSHARE_FINALIZE: + { #ifdef HAVE_QSH + word16 name; + int qshSz; + if (ssl->options.haveQSH) { /* extension name */ - ato16(input + *inOutIdx, &name); - *inOutIdx += OPAQUE16_LEN; + ato16(input + idx, &name); + idx += OPAQUE16_LEN; if (name == TLSX_QUANTUM_SAFE_HYBRID) { - /* if qshSz is larger than 0 it is the length of - buffer used */ - if ((qshSz = TLSX_QSHCipher_Parse(ssl, input + *inOutIdx, - size - *inOutIdx + begin, 1)) < 0) { - return qshSz; + /* if qshSz is larger than 0 it is the + length of buffer used */ + if ((qshSz = TLSX_QSHCipher_Parse(ssl, + input + idx, + size - idx + begin, 1)) < 0) { + ERROR_OUT(qshSz, exit_dcke); } - *inOutIdx += qshSz; + idx += qshSz; } else { - /* unknown extension sent client ignored - handshake */ - return BUFFER_ERROR; + /* unknown extension sent client ignored handshake */ + ERROR_OUT(BUFFER_ERROR, exit_dcke); } } #endif ret = MakeMasterSecret(ssl); - } - break; - #endif /* HAVE_ECC */ - #ifndef NO_DH - case diffie_hellman_kea: - { - word16 clientPubSz; - DhKey dhKey; - - if ((*inOutIdx - begin) + OPAQUE16_LEN > size) { - return BUFFER_ERROR; - } - - ato16(input + *inOutIdx, &clientPubSz); - *inOutIdx += OPAQUE16_LEN; - - if ((*inOutIdx - begin) + clientPubSz > size) { - return BUFFER_ERROR; - } - - wc_InitDhKey(&dhKey); - ret = wc_DhSetKey(&dhKey, ssl->buffers.serverDH_P.buffer, - ssl->buffers.serverDH_P.length, - ssl->buffers.serverDH_G.buffer, - ssl->buffers.serverDH_G.length); - if (ret == 0) { - ret = wc_DhAgree(&dhKey, ssl->arrays->preMasterSecret, - &ssl->arrays->preMasterSz, - ssl->buffers.serverDH_Priv.buffer, - ssl->buffers.serverDH_Priv.length, - input + *inOutIdx, clientPubSz); - } - wc_FreeDhKey(&dhKey); - - *inOutIdx += clientPubSz; - - #ifdef HAVE_QSH - if (ssl->options.haveQSH) { - /* extension name */ - ato16(input + *inOutIdx, &name); - *inOutIdx += OPAQUE16_LEN; - - if (name == TLSX_QUANTUM_SAFE_HYBRID) { - /* if qshSz is larger than 0 it is the length of - buffer used */ - if ((qshSz = TLSX_QSHCipher_Parse(ssl, input + *inOutIdx, - size - *inOutIdx + begin, 1)) < 0) { - return qshSz; - } - *inOutIdx += qshSz; - } - else { - /* unknown extension sent client ignored - handshake */ - return BUFFER_ERROR; - } - } - #endif - if (ret == 0) { - ret = MakeMasterSecret(ssl); - } - } - break; - #endif /* NO_DH */ - #if !defined(NO_DH) && !defined(NO_PSK) - case dhe_psk_kea: - { - byte* pms = ssl->arrays->preMasterSecret; - word16 clientSz; - DhKey dhKey; - - /* sanity check that PSK server callback has been set */ - if (ssl->options.server_psk_cb == NULL) { - WOLFSSL_MSG("No server PSK callback set"); - return PSK_KEY_ERROR; - } - - /* Read in the PSK hint */ - if ((*inOutIdx - begin) + OPAQUE16_LEN > size) { - return BUFFER_ERROR; - } - - ato16(input + *inOutIdx, &clientSz); - *inOutIdx += OPAQUE16_LEN; - if (clientSz > MAX_PSK_ID_LEN) { - return CLIENT_ID_ERROR; - } - - if ((*inOutIdx - begin) + clientSz > size) { - return BUFFER_ERROR; - } - - XMEMCPY(ssl->arrays->client_identity, - input + *inOutIdx, clientSz); - *inOutIdx += clientSz; - ssl->arrays->client_identity[min(clientSz, MAX_PSK_ID_LEN-1)] = - 0; - - /* Read in the DHE business */ - if ((*inOutIdx - begin) + OPAQUE16_LEN > size) { - return BUFFER_ERROR; - } - - ato16(input + *inOutIdx, &clientSz); - *inOutIdx += OPAQUE16_LEN; - - if ((*inOutIdx - begin) + clientSz > size) { - return BUFFER_ERROR; - } - - wc_InitDhKey(&dhKey); - ret = wc_DhSetKey(&dhKey, ssl->buffers.serverDH_P.buffer, - ssl->buffers.serverDH_P.length, - ssl->buffers.serverDH_G.buffer, - ssl->buffers.serverDH_G.length); - if (ret == 0) { - ret = wc_DhAgree(&dhKey, pms + OPAQUE16_LEN, - &ssl->arrays->preMasterSz, - ssl->buffers.serverDH_Priv.buffer, - ssl->buffers.serverDH_Priv.length, - input + *inOutIdx, clientSz); - } - wc_FreeDhKey(&dhKey); - - *inOutIdx += clientSz; - c16toa((word16)ssl->arrays->preMasterSz, pms); - ssl->arrays->preMasterSz += OPAQUE16_LEN; - pms += ssl->arrays->preMasterSz; - - /* Use the PSK hint to look up the PSK and add it to the - * preMasterSecret here. */ - ssl->arrays->psk_keySz = ssl->options.server_psk_cb(ssl, - ssl->arrays->client_identity, ssl->arrays->psk_key, - MAX_PSK_KEY_LEN); - - if (ssl->arrays->psk_keySz == 0 || - ssl->arrays->psk_keySz > MAX_PSK_KEY_LEN) { - return PSK_KEY_ERROR; - } - - c16toa((word16) ssl->arrays->psk_keySz, pms); - pms += OPAQUE16_LEN; - - XMEMCPY(pms, ssl->arrays->psk_key, ssl->arrays->psk_keySz); - ssl->arrays->preMasterSz += - ssl->arrays->psk_keySz + OPAQUE16_LEN; - #ifdef HAVE_QSH - if (ssl->options.haveQSH) { - /* extension name */ - ato16(input + *inOutIdx, &name); - *inOutIdx += OPAQUE16_LEN; - - if (name == TLSX_QUANTUM_SAFE_HYBRID) { - /* if qshSz is larger than 0 it is the length of - buffer used */ - if ((qshSz = TLSX_QSHCipher_Parse(ssl, input + *inOutIdx, - size - *inOutIdx + begin, 1)) < 0) { - return qshSz; - } - *inOutIdx += qshSz; - } - else { - /* unknown extension sent client ignored - handshake */ - return BUFFER_ERROR; - } - } - #endif - if (ret == 0) - ret = MakeMasterSecret(ssl); - - /* No further need for PSK */ - ForceZero(ssl->arrays->psk_key, ssl->arrays->psk_keySz); - ssl->arrays->psk_keySz = 0; - } - break; - #endif /* !NO_DH && !NO_PSK */ - #if defined(HAVE_ECC) && !defined(NO_PSK) - case ecdhe_psk_kea: - { - byte* pms = ssl->arrays->preMasterSecret; - word16 clientSz; - - /* sanity check that PSK server callback has been set */ - if (ssl->options.server_psk_cb == NULL) { - WOLFSSL_MSG("No server PSK callback set"); - return PSK_KEY_ERROR; - } - - /* Read in the PSK hint */ - if ((*inOutIdx - begin) + OPAQUE16_LEN > size) { - return BUFFER_ERROR; - } - - ato16(input + *inOutIdx, &clientSz); - *inOutIdx += OPAQUE16_LEN; - if (clientSz > MAX_PSK_ID_LEN) { - return CLIENT_ID_ERROR; - } - - if ((*inOutIdx - begin) + clientSz > size) { - return BUFFER_ERROR; - } - - XMEMCPY(ssl->arrays->client_identity, - input + *inOutIdx, clientSz); - *inOutIdx += clientSz; - ssl->arrays->client_identity[min(clientSz, MAX_PSK_ID_LEN-1)] = - 0; - - /* ECC key */ - if ((*inOutIdx - begin) + OPAQUE8_LEN > size) { - return BUFFER_ERROR; - } - - length = input[(*inOutIdx)++]; - - if ((*inOutIdx - begin) + length > size) { - return BUFFER_ERROR; - } - - if (ssl->peerEccKey == NULL) { - /* alloc/init on demand */ - ssl->peerEccKey = (ecc_key*)XMALLOC(sizeof(ecc_key), - ssl->ctx->heap, DYNAMIC_TYPE_ECC); - if (ssl->peerEccKey == NULL) { - WOLFSSL_MSG("PeerEccKey Memory error"); - return MEMORY_E; - } - wc_ecc_init(ssl->peerEccKey); - } else if (ssl->peerEccKeyPresent) { /* don't leak on reuse */ - wc_ecc_free(ssl->peerEccKey); - ssl->peerEccKeyPresent = 0; - wc_ecc_init(ssl->peerEccKey); - } - - if (wc_ecc_import_x963(input + *inOutIdx, length, - ssl->peerEccKey)) { - return ECC_PEERKEY_ERROR; - } - - *inOutIdx += length; - ssl->peerEccKeyPresent = 1; - - /* Note sizeof preMasterSecret is ENCRYPT_LEN currently 512 */ - length = sizeof(ssl->arrays->preMasterSecret); - - if (ssl->eccTempKeyPresent == 0) { - WOLFSSL_MSG("Ecc ephemeral key not made correctly"); - ret = ECC_MAKEKEY_ERROR; - } else { - ret = wc_ecc_shared_secret(ssl->eccTempKey, - ssl->peerEccKey, ssl->arrays->preMasterSecret + - OPAQUE16_LEN, &length); - } + /* Check for error */ if (ret != 0) { - return ECC_SHARED_ERROR; + goto exit_dcke; } - c16toa((word16)length, pms); - ssl->arrays->preMasterSz += OPAQUE16_LEN + length; - pms += ssl->arrays->preMasterSz; + /* Advance state and proceed */ + ssl->options.keyShareState = KEYSHARE_END; + } /* KEYSHARE_FINALIZE */ - /* Use the PSK hint to look up the PSK and add it to the - * preMasterSecret here. */ - ssl->arrays->psk_keySz = ssl->options.server_psk_cb(ssl, - ssl->arrays->client_identity, ssl->arrays->psk_key, - MAX_PSK_KEY_LEN); - - if (ssl->arrays->psk_keySz == 0 || - ssl->arrays->psk_keySz > MAX_PSK_KEY_LEN) { - return PSK_KEY_ERROR; - } - - c16toa((word16) ssl->arrays->psk_keySz, pms); - pms += OPAQUE16_LEN; - - XMEMCPY(pms, ssl->arrays->psk_key, ssl->arrays->psk_keySz); - ssl->arrays->preMasterSz += - ssl->arrays->psk_keySz + OPAQUE16_LEN; - - #ifdef HAVE_QSH - if (ssl->options.haveQSH) { - /* extension name */ - ato16(input + *inOutIdx, &name); - *inOutIdx += OPAQUE16_LEN; - - if (name == TLSX_QUANTUM_SAFE_HYBRID) { - /* if qshSz is larger than 0 it is the length of - buffer used */ - if ((qshSz = TLSX_QSHCipher_Parse(ssl, input + *inOutIdx, - size - *inOutIdx + begin, 1)) < 0) { - return qshSz; - } - *inOutIdx += qshSz; - } - else { - /* unknown extension sent client ignored - handshake */ - return BUFFER_ERROR; - } - } - #endif - if (ret == 0) - ret = MakeMasterSecret(ssl); - - /* No further need for PSK */ - ForceZero(ssl->arrays->psk_key, ssl->arrays->psk_keySz); - ssl->arrays->psk_keySz = 0; - } - break; - #endif /* HAVE_ECC && !NO_PSK */ - default: + case KEYSHARE_END: { - WOLFSSL_MSG("Bad kea type"); - ret = BAD_KEA_TYPE_E; - } - break; - } + /* Set final index */ + *inOutIdx = idx; - /* No further need for PMS */ - ForceZero(ssl->arrays->preMasterSecret, ssl->arrays->preMasterSz); - ssl->arrays->preMasterSz = 0; - - if (ret == 0) { - ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE; + ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE; #ifndef NO_CERTS if (ssl->options.verifyPeer) { ret = BuildCertHashes(ssl, &ssl->hsHashes->certHashes); } #endif + break; + } /* KEYSHARE_END */ + default: + ret = INPUT_CASE_ERROR; + } /* switch(ssl->options.keyShareState) */ + + exit_dcke: + #ifdef WOLFSSL_ASYNC_CRYPT + /* Handle WC_PENDING_E */ + if (ret == WC_PENDING_E) { + /* Store variables needed for async */ + XMEMSET(&ssl->async, 0, sizeof(ssl->async)); + ssl->async.idx = idx; + ssl->async.length = length; + + /* Adjust the index so header will be re-evaluated */ + *inOutIdx -= HANDSHAKE_HEADER_SZ; + /* Mark message as not recevied so it can process again */ + ssl->msgsReceived.got_client_key_exchange = 0; + + /* Push event to queue */ + ret = wolfSSL_async_push(ssl, WOLF_EVENT_TYPE_ASYNC_ACCEPT); + if (ret == 0) { + return WC_PENDING_E; + } } + #endif + + /* Cleanup PMS */ + ForceZero(ssl->arrays->preMasterSecret, ssl->arrays->preMasterSz); + ssl->arrays->preMasterSz = 0; + + /* Final cleanup */ + FreeKeyExchange(ssl); return ret; } + #ifdef HAVE_STUNNEL static int SNI_Callback(WOLFSSL* ssl) { @@ -17725,4 +17505,7 @@ int DoSessionTicket(WOLFSSL* ssl, } #endif /* HAVE_STUNNEL */ #endif /* NO_WOLFSSL_SERVER */ + +#undef ERROR_OUT + #endif /* WOLFCRYPT_ONLY */ diff --git a/src/ssl.c b/src/ssl.c index 5e462e1c0..78ae3edcb 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -17826,4 +17826,119 @@ void* wolfSSL_get_jobject(WOLFSSL* ssl) #endif /* WOLFSSL_JNI */ +#ifdef HAVE_WOLF_EVENT +int wolfssl_CTX_poll_peek(WOLFSSL_CTX* ctx, int* eventCount) +{ + WOLF_EVENT* event; + int count = 0; + + if (ctx == NULL) { + return BAD_FUNC_ARG; + } + +#ifndef SINGLE_THREADED + if (LockMutex(&ctx->event_queue.lock) != 0) { + return BAD_MUTEX_E; + } +#endif + + /* Itterate event queue */ + for (event = ctx->event_queue.head; event != NULL; event = event->next) { + count++; + } + +#ifndef SINGLE_THREADED + UnLockMutex(&ctx->event_queue.lock); +#endif + + if (eventCount) { + *eventCount = count; + } + + return 0; +} + +int wolfSSL_CTX_poll(WOLFSSL_CTX* ctx, WOLF_EVENT* events, int maxEvents, + unsigned char flags, int* eventCount) +{ + WOLF_EVENT* event, *event_prev = NULL; + int count = 0, ret = SSL_ERROR_NONE; + + if (ctx == NULL || events == NULL || maxEvents <= 0) { + return BAD_FUNC_ARG; + } + +#ifndef SINGLE_THREADED + if (LockMutex(&ctx->event_queue.lock) != 0) { + return BAD_MUTEX_E; + } +#endif + + /* Itterate event queue */ + for (event = ctx->event_queue.head; event != NULL; event = event->next) + { + byte removeEvent = 0; + + #ifdef WOLFSSL_ASYNC_CRYPT + if (event->type >= WOLF_EVENT_TYPE_ASYNC_FIRST && + event->type <= WOLF_EVENT_TYPE_ASYNC_LAST) + { + ret = wolfSSL_async_poll(event, flags); + } + #endif /* WOLFSSL_ASYNC_CRYPT */ + + /* If event is done add to returned event data */ + if (event->done) { + /* Check to make sure we have room for event */ + if (count >= maxEvents) { + break; /* Exit for */ + } + + /* Copy event data to provided buffer */ + XMEMCPY(&events[count], event, sizeof(WOLF_EVENT)); + count++; + removeEvent = 1; + } + + if (removeEvent) { + /* Remove from queue list */ + if (event_prev == NULL) { + ctx->event_queue.head = event->next; + if (ctx->event_queue.head == NULL) { + ctx->event_queue.tail = NULL; + } + } + else { + event_prev->next = event->next; + } + } + else { + /* Leave in queue, save prev pointer */ + event_prev = event; + } + + /* Check for error */ + if (ret < 0) { + break; /* Exit for */ + } + } + +#ifndef SINGLE_THREADED + UnLockMutex(&ctx->event_queue.lock); +#endif + + /* Return number of poperly populated events */ + if (eventCount) { + *eventCount = count; + } + + /* Make sure success returns 0 */ + if (ret > 0) { + ret = 0; + } + + return ret; +} +#endif /* HAVE_WOLF_EVENT */ + #endif /* WOLFCRYPT_ONLY */ diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 79ed25d03..e23ae37b2 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -788,7 +788,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) switch (type) { - case hashType: + case oidHashType: switch (id) { case MD2h: oid = hashMd2hOid; @@ -817,7 +817,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) } break; - case sigType: + case oidSigType: switch (id) { #ifndef NO_DSA case CTC_SHAwDSA: @@ -874,7 +874,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) } break; - case keyType: + case oidKeyType: switch (id) { #ifndef NO_DSA case DSAk: @@ -906,7 +906,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) break; #ifdef HAVE_ECC - case curveType: + case oidCurveType: switch (id) { #if defined(HAVE_ALL_CURVES) || !defined(NO_ECC256) case ECC_256R1: @@ -950,7 +950,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) break; #endif /* HAVE_ECC */ - case blkType: + case oidBlkType: switch (id) { case DESb: oid = blkDesCbcOid; @@ -964,7 +964,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) break; #ifdef HAVE_OCSP - case ocspType: + case oidOcspType: switch (id) { case OCSP_BASIC_OID: oid = ocspBasicOid; @@ -978,7 +978,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) break; #endif /* HAVE_OCSP */ - case certExtType: + case oidCertExtType: switch (id) { case BASIC_CA_OID: oid = extBasicCaOid; @@ -1027,7 +1027,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) } break; - case certAuthInfoType: + case oidCertAuthInfoType: switch (id) { case AIA_OCSP_OID: oid = extAuthInfoOcspOid; @@ -1040,7 +1040,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) } break; - case certPolicyType: + case oidCertPolicyType: switch (id) { case CP_ANY_OID: oid = extCertPolicyAnyOid; @@ -1049,7 +1049,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) } break; - case certAltNameType: + case oidCertAltNameType: switch (id) { case HW_NAME_OID: oid = extAltNamesHwNameOid; @@ -1058,7 +1058,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) } break; - case certKeyUseType: + case oidCertKeyUseType: switch (id) { case EKU_ANY_OID: oid = extExtKeyUsageAnyOid; @@ -1078,7 +1078,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) break; } - case kdfType: + case oidKdfType: switch (id) { case PBKDF2_OID: oid = pbkdf2Oid; @@ -1087,7 +1087,7 @@ static const byte* OidFromId(word32 id, word32 type, word32* oidSz) } break; - case ignoreType: + case oidIgnoreType: default: break; } @@ -1138,7 +1138,7 @@ WOLFSSL_LOCAL int GetObjectId(const byte* input, word32* inOutIdx, word32* oid, const byte* checkOid = NULL; word32 checkOidSz; - if (oidType != ignoreType) { + if (oidType != oidIgnoreType) { checkOid = OidFromId(*oid, oidType, &checkOidSz); if (checkOid != NULL && @@ -1317,7 +1317,7 @@ int ToTraditional(byte* input, word32 sz) if (GetMyVersion(input, &inOutIdx, &version) < 0) return ASN_PARSE_E; - if (GetAlgoId(input, &inOutIdx, &oid, sigType, sz) < 0) + if (GetAlgoId(input, &inOutIdx, &oid, oidSigType, sz) < 0) return ASN_PARSE_E; if (input[inOutIdx] == ASN_OBJECT_ID) { @@ -1594,7 +1594,7 @@ int ToTraditionalEnc(byte* input, word32 sz,const char* password,int passwordSz) if (GetSequence(input, &inOutIdx, &length, sz) < 0) return ASN_PARSE_E; - if (GetAlgoId(input, &inOutIdx, &oid, sigType, sz) < 0) + if (GetAlgoId(input, &inOutIdx, &oid, oidSigType, sz) < 0) return ASN_PARSE_E; first = input[inOutIdx - 2]; /* PKCS version always 2nd to last byte */ @@ -1608,7 +1608,7 @@ int ToTraditionalEnc(byte* input, word32 sz,const char* password,int passwordSz) if (GetSequence(input, &inOutIdx, &length, sz) < 0) return ASN_PARSE_E; - if (GetAlgoId(input, &inOutIdx, &oid, kdfType, sz) < 0) + if (GetAlgoId(input, &inOutIdx, &oid, oidKdfType, sz) < 0) return ASN_PARSE_E; if (oid != PBKDF2_OID) @@ -1654,7 +1654,7 @@ int ToTraditionalEnc(byte* input, word32 sz,const char* password,int passwordSz) if (version == PKCS5v2) { /* get encryption algo */ /* JOHN: New type. Need a little more research. */ - if (GetAlgoId(input, &inOutIdx, &oid, blkType, sz) < 0) { + if (GetAlgoId(input, &inOutIdx, &oid, oidBlkType, sz) < 0) { #ifdef WOLFSSL_SMALL_STACK XFREE(salt, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(cbcIv, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -2352,7 +2352,7 @@ static int GetKey(DecodedCert* cert) return ASN_PARSE_E; if (GetAlgoId(cert->source, &cert->srcIdx, - &cert->keyOID, keyType, cert->maxIdx) < 0) + &cert->keyOID, oidKeyType, cert->maxIdx) < 0) return ASN_PARSE_E; switch (cert->keyOID) { @@ -2443,7 +2443,7 @@ static int GetKey(DecodedCert* cert) byte b; if (GetObjectId(cert->source, &cert->srcIdx, - &cert->pkCurveOID, curveType, cert->maxIdx) < 0) + &cert->pkCurveOID, oidCurveType, cert->maxIdx) < 0) return ASN_PARSE_E; if (CheckCurve(cert->pkCurveOID) < 0) @@ -3146,7 +3146,7 @@ int DecodeToKey(DecodedCert* cert, int verify) WOLFSSL_MSG("Got Cert Header"); if ( (ret = GetAlgoId(cert->source, &cert->srcIdx, &cert->signatureOID, - sigType, cert->maxIdx)) < 0) + oidSigType, cert->maxIdx)) < 0) return ret; WOLFSSL_MSG("Got Algo ID"); @@ -3377,8 +3377,8 @@ WOLFSSL_LOCAL word32 SetAlgoID(int algoOID, byte* output, int type, int curveSz) byte ID_Length[MAX_LENGTH_SZ]; byte seqArray[MAX_SEQ_SZ + 1]; /* add object_id to end */ - tagSz = (type == hashType || type == sigType || - (type == keyType && algoOID == RSAk)) ? 2 : 0; + tagSz = (type == oidHashType || type == oidSigType || + (type == oidKeyType && algoOID == RSAk)) ? 2 : 0; algoName = OidFromId(algoOID, type, &algoSz); @@ -3414,7 +3414,7 @@ word32 wc_EncodeSignature(byte* out, const byte* digest, word32 digSz, word32 encDigSz, algoSz, seqSz; encDigSz = SetDigest(digest, digSz, digArray); - algoSz = SetAlgoID(hashOID, algoArray, hashType, 0); + algoSz = SetAlgoID(hashOID, algoArray, oidHashType, 0); seqSz = SetSequence(encDigSz + algoSz, seqArray); XMEMCPY(out, seqArray, seqSz); @@ -3986,7 +3986,7 @@ static int DecodeAltNames(byte* input, int sz, DecodedCert* cert) /* Consume the rest of this sequence. */ length -= (strLen + idx - lenStartIdx); - if (GetObjectId(input, &idx, &oid, certAltNameType, sz) < 0) { + if (GetObjectId(input, &idx, &oid, oidCertAltNameType, sz) < 0) { WOLFSSL_MSG("\tbad OID"); return ASN_PARSE_E; } @@ -4237,7 +4237,7 @@ static int DecodeAuthInfo(byte* input, int sz, DecodedCert* cert) return ASN_PARSE_E; oid = 0; - if (GetObjectId(input, &idx, &oid, certAuthInfoType, sz) < 0) + if (GetObjectId(input, &idx, &oid, oidCertAuthInfoType, sz) < 0) return ASN_PARSE_E; /* Only supporting URIs right now. */ @@ -4383,7 +4383,7 @@ static int DecodeExtKeyUsage(byte* input, int sz, DecodedCert* cert) #endif while (idx < (word32)sz) { - if (GetObjectId(input, &idx, &oid, certKeyUseType, sz) < 0) + if (GetObjectId(input, &idx, &oid, oidCertKeyUseType, sz) < 0) return ASN_PARSE_E; switch (oid) { @@ -4718,7 +4718,7 @@ static int DecodeCertExtensions(DecodedCert* cert) } oid = 0; - if (GetObjectId(input, &idx, &oid, certExtType, sz) < 0) { + if (GetObjectId(input, &idx, &oid, oidCertExtType, sz) < 0) { WOLFSSL_MSG("\tfail: OBJECT ID"); return ASN_PARSE_E; } @@ -4970,7 +4970,7 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm) } if ((ret = GetAlgoId(cert->source, &cert->srcIdx, &confirmOID, - sigType, cert->maxIdx)) < 0) + oidSigType, cert->maxIdx)) < 0) return ret; if ((ret = GetSignature(cert)) < 0) @@ -5522,7 +5522,7 @@ static int SetRsaPublicKey(byte* output, RsaKey* key, #else byte algo[MAX_ALGO_SZ]; #endif - algoSz = SetAlgoID(RSAk, algo, keyType, 0); + algoSz = SetAlgoID(RSAk, algo, oidKeyType, 0); lenSz = SetLength(seqSz + nSz + eSz + 1, len); len[lenSz++] = 0; /* trailing 0 */ @@ -5938,7 +5938,7 @@ static int SetEccPublicKey(byte* output, ecc_key* key, int with_header) return MEMORY_E; } #endif - algoSz = SetAlgoID(ECDSAk, algo, keyType, curveSz); + algoSz = SetAlgoID(ECDSAk, algo, oidKeyType, curveSz); lenSz = SetLength(pubSz + 1, len); len[lenSz++] = 0; /* trailing 0 */ @@ -6787,7 +6787,7 @@ static int EncodeCert(Cert* cert, DerCert* der, RsaKey* rsaKey, ecc_key* eccKey, der->serialSz = SetSerial(cert->serial, der->serial); /* signature algo */ - der->sigAlgoSz = SetAlgoID(cert->sigType, der->sigAlgo, sigType, 0); + der->sigAlgoSz = SetAlgoID(cert->sigType, der->sigAlgo, oidSigType, 0); if (der->sigAlgoSz == 0) return ALGO_ID_E; @@ -7179,7 +7179,7 @@ static int AddSignature(byte* buffer, int bodySz, const byte* sig, int sigSz, int idx = bodySz, seqSz; /* algo */ - idx += SetAlgoID(sigAlgoType, buffer + idx, sigType, 0); + idx += SetAlgoID(sigAlgoType, buffer + idx, oidSigType, 0); /* bit string */ buffer[idx++] = ASN_BIT_STRING; /* length */ @@ -7986,7 +7986,7 @@ static int SetAltNamesFromCert(Cert* cert, const byte* der, int derSz) decoded->srcIdx = startIdx; if (GetAlgoId(decoded->source, &decoded->srcIdx, &oid, - certExtType, decoded->maxIdx) < 0) { + oidCertExtType, decoded->maxIdx) < 0) { ret = ASN_PARSE_E; break; } @@ -8745,7 +8745,7 @@ static int DecodeSingleResponse(byte* source, if (GetSequence(source, &idx, &length, size) < 0) return ASN_PARSE_E; /* Skip the hash algorithm */ - if (GetAlgoId(source, &idx, &oid, ignoreType, size) < 0) + if (GetAlgoId(source, &idx, &oid, oidIgnoreType, size) < 0) return ASN_PARSE_E; /* Save reference to the hash of CN */ if (source[idx++] != ASN_OCTET_STRING) @@ -8867,7 +8867,7 @@ static int DecodeOcspRespExtensions(byte* source, } oid = 0; - if (GetObjectId(source, &idx, &oid, ocspType, sz) < 0) { + if (GetObjectId(source, &idx, &oid, oidOcspType, sz) < 0) { WOLFSSL_MSG("\tfail: OBJECT ID"); return ASN_PARSE_E; } @@ -9020,7 +9020,7 @@ static int DecodeBasicOcspResponse(byte* source, word32* ioIndex, return ASN_PARSE_E; /* Get the signature algorithm */ - if (GetAlgoId(source, &idx, &resp->sigOID, sigType, size) < 0) + if (GetAlgoId(source, &idx, &resp->sigOID, oidSigType, size) < 0) return ASN_PARSE_E; /* Obtain pointer to the start of the signature, and save the size */ @@ -9126,7 +9126,7 @@ int OcspResponseDecode(OcspResponse* resp, void* cm) return ASN_PARSE_E; /* Check ObjectID for the resposeBytes */ - if (GetObjectId(source, &idx, &oid, ocspType, size) < 0) + if (GetObjectId(source, &idx, &oid, oidOcspType, size) < 0) return ASN_PARSE_E; if (oid != OCSP_BASIC_OID) return ASN_PARSE_E; @@ -9212,9 +9212,9 @@ int EncodeOcspRequest(OcspRequest* req, byte* output, word32 size) WOLFSSL_ENTER("EncodeOcspRequest"); #ifdef NO_SHA - algoSz = SetAlgoID(SHA256h, algoArray, hashType, 0); + algoSz = SetAlgoID(SHA256h, algoArray, oidHashType, 0); #else - algoSz = SetAlgoID(SHAh, algoArray, hashType, 0); + algoSz = SetAlgoID(SHAh, algoArray, oidHashType, 0); #endif issuerSz = SetDigest(req->issuerHash, KEYID_SIZE, issuerArray); @@ -9604,7 +9604,7 @@ int ParseCRL(DecodedCRL* dcrl, const byte* buff, word32 sz, void* cm) return ASN_PARSE_E; } - if (GetAlgoId(buff, &idx, &oid, ignoreType, sz) < 0) + if (GetAlgoId(buff, &idx, &oid, oidIgnoreType, sz) < 0) return ASN_PARSE_E; if (GetNameHash(buff, &idx, dcrl->issuerHash, sz) < 0) @@ -9648,7 +9648,7 @@ int ParseCRL(DecodedCRL* dcrl, const byte* buff, word32 sz, void* cm) if (idx != dcrl->sigIndex) idx = dcrl->sigIndex; /* skip extensions */ - if (GetAlgoId(buff, &idx, &dcrl->signatureOID, sigType, sz) < 0) + if (GetAlgoId(buff, &idx, &dcrl->signatureOID, oidSigType, sz) < 0) return ASN_PARSE_E; if (GetCRL_Signature(buff, &idx, dcrl, sz) < 0) diff --git a/wolfcrypt/src/error.c b/wolfcrypt/src/error.c index f9c02690a..071ecf4b9 100644 --- a/wolfcrypt/src/error.c +++ b/wolfcrypt/src/error.c @@ -373,6 +373,9 @@ const char* wc_GetErrorString(int error) case HASH_TYPE_E: return "Hash type not enabled/available"; + case WC_PENDING_E: + return "wolfCrypt Operation Pending (would block / eagain) error"; + default: return "unknown error number"; diff --git a/wolfcrypt/src/hash.c b/wolfcrypt/src/hash.c index 5469580ee..1f00528a8 100644 --- a/wolfcrypt/src/hash.c +++ b/wolfcrypt/src/hash.c @@ -44,6 +44,7 @@ int wc_HashGetOID(enum wc_HashType hash_type) oid = MD2h; #endif break; + case WC_HASH_TYPE_MD5_SHA: case WC_HASH_TYPE_MD5: #ifndef NO_MD5 oid = MD5h; @@ -110,6 +111,11 @@ int wc_HashGetDigestSize(enum wc_HashType hash_type) case WC_HASH_TYPE_SHA512: #ifdef WOLFSSL_SHA512 dig_size = SHA512_DIGEST_SIZE; +#endif + break; + case WC_HASH_TYPE_MD5_SHA: +#if !defined(NO_MD5) && !defined(NO_SHA) + dig_size = MD5_DIGEST_SIZE + SHA_DIGEST_SIZE; #endif break; @@ -168,6 +174,14 @@ int wc_Hash(enum wc_HashType hash_type, const byte* data, case WC_HASH_TYPE_SHA512: #ifdef WOLFSSL_SHA512 ret = wc_Sha512Hash(data, data_len, hash); +#endif + break; + case WC_HASH_TYPE_MD5_SHA: +#if !defined(NO_MD5) && !defined(NO_SHA) + ret = wc_Md5Hash(data, data_len, hash); + if (ret == 0) { + ret = wc_ShaHash(data, data_len, &hash[MD5_DIGEST_SIZE]); + } #endif break; diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 00c213416..dbc99261f 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -130,7 +130,7 @@ int wc_GetContentType(const byte* input, word32* inOutIdx, word32* oid, word32 maxIdx) { WOLFSSL_ENTER("wc_GetContentType"); - if (GetObjectId(input, inOutIdx, oid, ignoreType, maxIdx) < 0) + if (GetObjectId(input, inOutIdx, oid, oidIgnoreType, maxIdx) < 0) return ASN_PARSE_E; return 0; @@ -396,10 +396,10 @@ int wc_PKCS7_EncodeSignedData(PKCS7* pkcs7, byte* output, word32 outputSz) esd->signerVersionSz = SetMyVersion(1, esd->signerVersion, 0); signerInfoSz += esd->signerVersionSz; esd->signerDigAlgoIdSz = SetAlgoID(pkcs7->hashOID, esd->signerDigAlgoId, - hashType, 0); + oidHashType, 0); signerInfoSz += esd->signerDigAlgoIdSz; esd->digEncAlgoIdSz = SetAlgoID(pkcs7->encryptOID, esd->digEncAlgoId, - keyType, 0); + oidKeyType, 0); signerInfoSz += esd->digEncAlgoIdSz; if (pkcs7->signedAttribsSz != 0) { @@ -576,7 +576,7 @@ int wc_PKCS7_EncodeSignedData(PKCS7* pkcs7, byte* output, word32 outputSz) esd->certsSet); esd->singleDigAlgoIdSz = SetAlgoID(pkcs7->hashOID, esd->singleDigAlgoId, - hashType, 0); + oidHashType, 0); esd->digAlgoIdSetSz = SetSet(esd->singleDigAlgoIdSz, esd->digAlgoIdSet); @@ -1033,7 +1033,7 @@ WOLFSSL_LOCAL int wc_CreateRecipientInfo(const byte* cert, word32 certSz, return ALGO_ID_E; } - keyEncAlgSz = SetAlgoID(keyEncAlgo, keyAlgArray, keyType, 0); + keyEncAlgSz = SetAlgoID(keyEncAlgo, keyAlgArray, oidKeyType, 0); if (keyEncAlgSz == 0) { FreeDecodedCert(decoded); #ifdef WOLFSSL_SMALL_STACK @@ -1319,7 +1319,7 @@ int wc_PKCS7_EncodeEnvelopedData(PKCS7* pkcs7, byte* output, word32 outputSz) /* build up our ContentEncryptionAlgorithmIdentifier sequence, * adding (ivOctetStringSz + DES_BLOCK_SIZE) for IV OCTET STRING */ contentEncAlgoSz = SetAlgoID(pkcs7->encryptOID, contentEncAlgo, - blkType, ivOctetStringSz + DES_BLOCK_SIZE); + oidBlkType, ivOctetStringSz + DES_BLOCK_SIZE); if (contentEncAlgoSz == 0) { XFREE(encryptedContent, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -1592,7 +1592,7 @@ WOLFSSL_API int wc_PKCS7_DecodeEnvelopedData(PKCS7* pkcs7, byte* pkiMsg, XFREE(serialNum, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif - if (GetAlgoId(pkiMsg, &idx, &encOID, keyType, pkiMsgSz) < 0) { + if (GetAlgoId(pkiMsg, &idx, &encOID, oidKeyType, pkiMsgSz) < 0) { #ifdef WOLFSSL_SMALL_STACK XFREE(encryptedKey, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif @@ -1653,7 +1653,7 @@ WOLFSSL_API int wc_PKCS7_DecodeEnvelopedData(PKCS7* pkcs7, byte* pkiMsg, return ASN_PARSE_E; } - if (GetAlgoId(pkiMsg, &idx, &encOID, blkType, pkiMsgSz) < 0) { + if (GetAlgoId(pkiMsg, &idx, &encOID, oidBlkType, pkiMsgSz) < 0) { #ifdef WOLFSSL_SMALL_STACK XFREE(encryptedKey, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif diff --git a/wolfssl/error-ssl.h b/wolfssl/error-ssl.h index 577103f73..593b45729 100644 --- a/wolfssl/error-ssl.h +++ b/wolfssl/error-ssl.h @@ -141,6 +141,7 @@ enum wolfSSL_ErrorCodes { UNKNOWN_ALPN_PROTOCOL_NAME_E = -405, /* Unrecognized protocol name Error*/ BAD_CERTIFICATE_STATUS_ERROR = -406, /* Bad certificate status message */ OCSP_INVALID_STATUS = -407, /* Invalid OCSP Status */ + ASYNC_NOT_PENDING = -408, /* Async operation not pending */ /* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */ diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 1bdad174d..893169000 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -153,6 +153,10 @@ #include "zlib.h" #endif +#ifdef WOLFSSL_ASYNC_CRYPT + #include +#endif + #ifdef _MSC_VER /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */ #pragma warning(disable: 4996) @@ -1818,6 +1822,22 @@ WOLFSSL_LOCAL int TLSX_ValidateQSHScheme(TLSX** extensions, word16 name); #endif /* HAVE_QSH */ + +#ifdef HAVE_WOLF_EVENT +typedef struct { + WOLF_EVENT* head; /* head of queue */ + WOLF_EVENT* tail; /* tail of queue */ +#ifndef SINGLE_THREADED + wolfSSL_Mutex lock; /* queue lock */ +#endif +} WOLF_EVENT_QUEUE; + +WOLFSSL_LOCAL int wolfSSL_EventInit(WOLFSSL* ssl, WOLF_EVENT_TYPE type); + +WOLFSSL_LOCAL int wolfSSL_CTX_EventPush(WOLFSSL_CTX* ctx, WOLF_EVENT* event); +#endif /* HAVE_WOLF_EVENT */ + + /* wolfSSL context type */ struct WOLFSSL_CTX { WOLFSSL_METHOD* method; @@ -1924,6 +1944,9 @@ struct WOLFSSL_CTX { CallbackRsaDec RsaDecCb; /* User Rsa Private Decrypt handler */ #endif /* NO_RSA */ #endif /* HAVE_PK_CALLBACKS */ +#ifdef HAVE_WOLF_EVENT + WOLF_EVENT_QUEUE event_queue; +#endif /* HAVE_WOLF_EVENT */ }; @@ -2188,12 +2211,22 @@ enum AcceptState { ACCEPT_THIRD_REPLY_DONE }; +/* sub-states for send/do key share (key exchange) */ +enum KeyShareState { + KEYSHARE_BEGIN = 0, + KEYSHARE_BUILD, + KEYSHARE_VERIFY, + KEYSHARE_FINALIZE, + KEYSHARE_END +}; +/* buffers for struct WOLFSSL */ typedef struct Buffers { bufferStatic inputBuffer; bufferStatic outputBuffer; buffer domainName; /* for client check */ buffer clearOutputBuffer; + buffer sig; /* signature data */ int prevSent; /* previous plain text bytes sent when got WANT_WRITE */ int plainSz; /* plain text bytes in buffer to send @@ -2301,6 +2334,8 @@ typedef struct Options { byte minDowngrade; /* minimum downgrade version */ byte connectState; /* nonblocking resume */ byte acceptState; /* nonblocking resume */ + byte keyShareState; /* sub-state for key share (key exchange). + See enum KeyShareState. */ #ifndef NO_DH word16 minDhKeySz; /* minimum DH key size */ word16 dhKeySz; /* actual DH key size */ @@ -2535,6 +2570,12 @@ struct WOLFSSL { HandShakeDoneCb hsDoneCb; /* notify user handshake done */ void* hsDoneCtx; /* user handshake cb context */ #endif +#ifdef WOLFSSL_ASYNC_CRYPT + AsyncCrypt async; +#endif + void* sigKey; /* RsaKey or ecc_key allocated from heap */ + word32 sigType; /* Type of sigKey */ + word32 sigLen; /* Actual signature length */ WOLFSSL_CIPHER cipher; hmacfp hmac; Ciphers encrypt; @@ -2683,6 +2724,12 @@ struct WOLFSSL { #ifdef WOLFSSL_JNI void* jObjectRef; /* reference to WolfSSLSession in JNI wrapper */ #endif /* WOLFSSL_JNI */ +#ifdef HAVE_WOLF_EVENT + WOLF_EVENT event; +#endif /* HAVE_WOLF_EVENT */ +#ifdef WOLFSSL_ASYNC_CRYPT_TEST + AsyncCryptTests asyncCryptTest; +#endif /* WOLFSSL_ASYNC_CRYPT_TEST */ }; @@ -2834,10 +2881,29 @@ WOLFSSL_LOCAL void ShrinkOutputBuffer(WOLFSSL* ssl); WOLFSSL_LOCAL int VerifyClientSuite(WOLFSSL* ssl); #ifndef NO_CERTS #ifndef NO_RSA - WOLFSSL_LOCAL int VerifyRsaSign(const byte* sig, word32 sigSz, + WOLFSSL_LOCAL int VerifyRsaSign(WOLFSSL* ssl, + const byte* sig, word32 sigSz, const byte* plain, word32 plainSz, RsaKey* key); - #endif + WOLFSSL_LOCAL int RsaSign(WOLFSSL* ssl, const byte* in, word32 inSz, byte* out, + word32* outSz, RsaKey* key, const byte* keyBuf, word32 keySz, void* ctx); + WOLFSSL_LOCAL int RsaVerify(WOLFSSL* ssl, byte* in, word32 inSz, + byte** out, RsaKey* key, const byte* keyBuf, word32 keySz, void* ctx); + WOLFSSL_LOCAL int RsaDec(WOLFSSL* ssl, byte* in, word32 inSz, byte** out, + word32* outSz, RsaKey* key, const byte* keyBuf, word32 keySz, void* ctx); + #endif /* !NO_RSA */ + + #ifdef HAVE_ECC + WOLFSSL_LOCAL int EccSign(WOLFSSL* ssl, const byte* in, word32 inSz, + byte* out, word32* outSz, ecc_key* key, byte* keyBuf, word32 keySz, + void* ctx); + WOLFSSL_LOCAL int EccVerify(WOLFSSL* ssl, const byte* in, word32 inSz, + byte* out, word32 outSz, ecc_key* key, byte* keyBuf, word32 keySz, + void* ctx); + WOLFSSL_LOCAL int EccSharedSecret(WOLFSSL* ssl, ecc_key* priv_key, + ecc_key* pub_key, byte* out, word32* outSz); + #endif /* HAVE_ECC */ + #ifdef WOLFSSL_TRUST_PEER_CERT /* options for searching hash table for a matching trusted peer cert */ @@ -2849,11 +2915,12 @@ WOLFSSL_LOCAL int VerifyClientSuite(WOLFSSL* ssl); WOLFSSL_LOCAL int MatchTrustedPeer(TrustedPeerCert* tp, DecodedCert* cert); #endif + WOLFSSL_LOCAL Signer* GetCA(void* cm, byte* hash); #ifndef NO_SKID WOLFSSL_LOCAL Signer* GetCAByName(void* cm, byte* hash); #endif -#endif +#endif /* !NO_CERTS */ WOLFSSL_LOCAL int BuildTlsFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender); WOLFSSL_LOCAL void FreeArrays(WOLFSSL* ssl, int keep); @@ -2928,6 +2995,25 @@ enum encrypt_side { WOLFSSL_LOCAL int SetKeysSide(WOLFSSL*, enum encrypt_side); +#ifndef NO_DH + WOLFSSL_LOCAL int DhGenKeyPair(WOLFSSL* ssl, + byte* p, word32 pSz, + byte* g, word32 gSz, + byte* priv, word32* privSz, + byte* pub, word32* pubSz); + WOLFSSL_LOCAL int DhAgree(WOLFSSL* ssl, + byte* p, word32 pSz, + byte* g, word32 gSz, + byte* priv, word32* privSz, + byte* pub, word32* pubSz, + const byte* otherPub, word32 otherPubSz, + byte* agree, word32* agreeSz); +#endif + +#ifdef HAVE_ECC + WOLFSSL_LOCAL int EccMakeTempKey(WOLFSSL* ssl); +#endif + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index ea9ba0801..046176542 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1780,6 +1780,39 @@ WOLFSSL_API int wolfSSL_set_jobject(WOLFSSL* ssl, void* objPtr); WOLFSSL_API void* wolfSSL_get_jobject(WOLFSSL* ssl); #endif /* WOLFSSL_JNI */ +#ifdef HAVE_WOLF_EVENT +typedef enum WOLF_EVENT_TYPE { + WOLF_EVENT_TYPE_NONE, + #ifdef WOLFSSL_ASYNC_CRYPT + WOLF_EVENT_TYPE_ASYNC_ACCEPT, + WOLF_EVENT_TYPE_ASYNC_CONNECT, + WOLF_EVENT_TYPE_ASYNC_READ, + WOLF_EVENT_TYPE_ASYNC_WRITE, + WOLF_EVENT_TYPE_ASYNC_FIRST = WOLF_EVENT_TYPE_ASYNC_ACCEPT, + WOLF_EVENT_TYPE_ASYNC_LAST = WOLF_EVENT_TYPE_ASYNC_WRITE, + #endif +} WOLF_EVENT_TYPE; + +typedef struct WOLF_EVENT WOLF_EVENT; +struct WOLF_EVENT { + WOLF_EVENT* next; /* To support event linked list */ + WOLFSSL* ssl; /* Reference back to SSL object */ + int ret; /* Async return code */ + WOLF_EVENT_TYPE type; + unsigned short pending:1; + unsigned short done:1; + /* Future event flags can go here */ +}; + +enum WOLF_POLL_FLAGS { + WOLF_POLL_FLAG_CHECK_HW = 0x01, +}; + +WOLFSSL_API int wolfssl_CTX_poll_peek(WOLFSSL_CTX* ctx, int* eventCount); +WOLFSSL_API int wolfSSL_CTX_poll(WOLFSSL_CTX* ctx, WOLF_EVENT* events, int maxEvents, + unsigned char flags, int* eventCount); +#endif /* HAVE_WOLF_EVENT */ + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/wolfssl/test.h b/wolfssl/test.h index ba571237c..6d1ed6cd8 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -1907,4 +1907,24 @@ static INLINE const char* mymktemp(char *tempfn, int len, int num) #endif /* HAVE_SESSION_TICKET && CHACHA20 && POLY1305 */ +#ifdef WOLFSSL_ASYNC_CRYPT + static INLINE int AsyncCryptPoll(WOLFSSL_CTX* ctx, WOLFSSL* ssl) + { + int ret, eventCount = 0; + WOLF_EVENT events[1]; + + printf("Connect/Accept got WC_PENDING_E\n"); + + ret = wolfSSL_CTX_poll(ctx, events, sizeof(events)/sizeof(WOLF_EVENT), WOLF_POLL_FLAG_CHECK_HW, &eventCount); + if (ret == 0 && eventCount > 0) { + /* Check the SSL context in the event matches ours */ + if (events[0].ssl == ssl) { + ret = 1; /* Success */ + } + } + + return ret; + } +#endif + #endif /* wolfSSL_TEST_H */ diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index c7a4e340b..a1d311af8 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -199,19 +199,19 @@ enum Misc_ASN { enum Oid_Types { - hashType = 0, - sigType = 1, - keyType = 2, - curveType = 3, - blkType = 4, - ocspType = 5, - certExtType = 6, - certAuthInfoType = 7, - certPolicyType = 8, - certAltNameType = 9, - certKeyUseType = 10, - kdfType = 11, - ignoreType + oidHashType = 0, + oidSigType = 1, + oidKeyType = 2, + oidCurveType = 3, + oidBlkType = 4, + oidOcspType = 5, + oidCertExtType = 6, + oidCertAuthInfoType = 7, + oidCertPolicyType = 8, + oidCertAltNameType = 9, + oidCertKeyUseType = 10, + oidKdfType = 11, + oidIgnoreType }; diff --git a/wolfssl/wolfcrypt/error-crypt.h b/wolfssl/wolfcrypt/error-crypt.h index b7a3c89ac..ff153f495 100644 --- a/wolfssl/wolfcrypt/error-crypt.h +++ b/wolfssl/wolfcrypt/error-crypt.h @@ -166,6 +166,7 @@ enum { BAD_COND_E = -230, /* Bad condition variable operation */ SIG_TYPE_E = -231, /* Signature Type not enabled/available */ HASH_TYPE_E = -232, /* Hash Type not enabled/available */ + WC_PENDING_E = -233, /* wolfCrypt operation pending (would block) */ MIN_CODE_E = -300 /* errors -101 - -299 */ diff --git a/wolfssl/wolfcrypt/hash.h b/wolfssl/wolfcrypt/hash.h index 2c9acec3a..5a5d44259 100644 --- a/wolfssl/wolfcrypt/hash.h +++ b/wolfssl/wolfcrypt/hash.h @@ -38,6 +38,7 @@ enum wc_HashType { WC_HASH_TYPE_SHA256 = 5, WC_HASH_TYPE_SHA384 = 6, WC_HASH_TYPE_SHA512 = 7, + WC_HASH_TYPE_MD5_SHA = 8, }; /* Find largest possible digest size diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index a24579cb7..cf812145c 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -135,6 +135,9 @@ /* Uncomment next line if building for ARDUINO */ /* #define WOLFSSL_ARDUINO */ +/* Uncomment next line to enable asynchronous crypto WC_PENDING_E */ +/* #define WOLFSSL_ASYNC_CRYPT */ + #include #ifdef WOLFSSL_USER_SETTINGS @@ -1147,6 +1150,18 @@ static char *fgets(char *buff, int sz, FILE *fp) #undef NO_DH #endif +/* Asynchronous Crypto */ +#ifdef WOLFSSL_ASYNC_CRYPT + /* Make sure wolf events are enabled */ + #undef HAVE_WOLF_EVENT + #define HAVE_WOLF_EVENT +#else + #ifdef WOLFSSL_ASYNC_CRYPT_TEST + #error Must have WOLFSSL_ASYNC_CRYPT enabled with WOLFSSL_ASYNC_CRYPT_TEST + #endif +#endif /* WOLFSSL_ASYNC_CRYPT */ + + /* Place any other flags or defines here */ From e99a5b04834228190215c5cad11869544249f54f Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 17 Mar 2016 16:02:13 -0600 Subject: [PATCH 062/192] prepare for release v3.9.0 --- IDE/ARDUINO/sketches/wolfssl_client.ino | 7 ++-- .../Projects/benchmark/benchmark-main.c | 7 ++-- .../Projects/benchmark/current_time.c | 7 ++-- .../Projects/common/minimum-startup.c | 7 ++-- IDE/IAR-EWARM/Projects/test/test-main.c | 7 ++-- IDE/LPCXPRESSO/lib_wolfssl/lpc_18xx_port.c | 7 ++-- .../wolf_example/src/lpc_18xx_startup.c | 7 ++-- IDE/MDK-ARM/LPC43xx/time-LCP43xx.c | 7 ++-- IDE/MDK-ARM/MDK-ARM/wolfSSL/cert_data.c | 7 ++-- .../MDK-ARM/wolfSSL/config-BARE-METAL.h | 7 ++-- IDE/MDK-ARM/MDK-ARM/wolfSSL/config-FS.h | 7 ++-- .../MDK-ARM/wolfSSL/config-RTX-TCP-FS.h | 7 ++-- IDE/MDK-ARM/MDK-ARM/wolfSSL/config.h | 7 ++-- IDE/MDK-ARM/MDK-ARM/wolfSSL/main.c | 7 ++-- IDE/MDK-ARM/MDK-ARM/wolfSSL/shell.c | 7 ++-- IDE/MDK-ARM/MDK-ARM/wolfSSL/time-CortexM3-4.c | 7 ++-- IDE/MDK-ARM/MDK-ARM/wolfSSL/time-dummy.c | 7 ++-- IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.c | 38 +++++++++---------- IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.h | 7 ++-- .../STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c | 7 ++-- IDE/MDK5-ARM/Conf/config-Crypt.h | 7 ++-- IDE/MDK5-ARM/Inc/config.h | 7 ++-- .../CryptBenchmark/RTE/wolfSSL/settings.h | 7 ++-- IDE/MDK5-ARM/Projects/CryptBenchmark/main.c | 7 ++-- .../Projects/CryptBenchmark/time-CortexM3-4.c | 7 ++-- .../Projects/CryptBenchmark/time-dummy.c | 7 ++-- .../Projects/CryptTest/RTE/wolfSSL/settings.h | 7 ++-- IDE/MDK5-ARM/Projects/CryptTest/main.c | 7 ++-- IDE/MDK5-ARM/Projects/CryptTest/time-dummy.c | 7 ++-- .../EchoClient/RTE/wolfSSL/settings.h | 7 ++-- .../Projects/EchoClient/config-EchoClient.h | 7 ++-- IDE/MDK5-ARM/Projects/EchoClient/main.c | 7 ++-- IDE/MDK5-ARM/Projects/EchoClient/time-dummy.c | 7 ++-- .../EchoServer/RTE/wolfSSL/settings.h | 7 ++-- IDE/MDK5-ARM/Projects/EchoServer/main.c | 7 ++-- IDE/MDK5-ARM/Projects/EchoServer/time-dummy.c | 7 ++-- .../SimpleClient/RTE/wolfSSL/settings.h | 7 ++-- .../SimpleClient/config-SimpleClient.h | 7 ++-- IDE/MDK5-ARM/Projects/SimpleClient/main.c | 7 ++-- .../Projects/SimpleClient/time-CortexM3-4.c | 7 ++-- .../Projects/SimpleClient/time-STM32F2xx.c | 7 ++-- .../Projects/SimpleClient/time-dummy.c | 7 ++-- .../SimpleServer/RTE/wolfSSL/settings.h | 7 ++-- .../SimpleServer/config-SimpleServer.h | 7 ++-- IDE/MDK5-ARM/Projects/SimpleServer/main.c | 7 ++-- .../Projects/SimpleServer/time-dummy.c | 7 ++-- IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c | 7 ++-- IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c | 7 ++-- .../Projects/wolfSSL-Full/time-CortexM3-4.c | 7 ++-- IDE/MDK5-ARM/Src/ssl-dummy.c | 7 ++-- IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c | 7 ++-- IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c | 7 ++-- IDE/ROWLEY-CROSSWORKS-ARM/kinetis_hw.c | 7 ++-- IDE/ROWLEY-CROSSWORKS-ARM/retarget.c | 7 ++-- IDE/ROWLEY-CROSSWORKS-ARM/test_main.c | 7 ++-- README | 35 +++++++++++++++++ README.md | 34 +++++++++++++++++ configure.ac | 4 +- ctaocrypt/src/misc.c | 7 ++-- ctaocrypt/src/wolfcrypt_first.c | 7 ++-- ctaocrypt/src/wolfcrypt_last.c | 7 ++-- cyassl/callbacks.h | 7 ++-- cyassl/crl.h | 7 ++-- cyassl/ctaocrypt/aes.h | 7 ++-- cyassl/ctaocrypt/arc4.h | 7 ++-- cyassl/ctaocrypt/asn.h | 7 ++-- cyassl/ctaocrypt/asn_public.h | 7 ++-- cyassl/ctaocrypt/blake2-impl.h | 7 ++-- cyassl/ctaocrypt/blake2-int.h | 7 ++-- cyassl/ctaocrypt/blake2.h | 7 ++-- cyassl/ctaocrypt/camellia.h | 7 ++-- cyassl/ctaocrypt/chacha.h | 7 ++-- cyassl/ctaocrypt/coding.h | 7 ++-- cyassl/ctaocrypt/compress.h | 7 ++-- cyassl/ctaocrypt/des3.h | 7 ++-- cyassl/ctaocrypt/dh.h | 7 ++-- cyassl/ctaocrypt/dsa.h | 7 ++-- cyassl/ctaocrypt/ecc.h | 7 ++-- cyassl/ctaocrypt/error-crypt.h | 7 ++-- cyassl/ctaocrypt/fips_test.h | 7 ++-- cyassl/ctaocrypt/hc128.h | 7 ++-- cyassl/ctaocrypt/hmac.h | 7 ++-- cyassl/ctaocrypt/integer.h | 7 ++-- cyassl/ctaocrypt/logging.h | 7 ++-- cyassl/ctaocrypt/md2.h | 7 ++-- cyassl/ctaocrypt/md4.h | 7 ++-- cyassl/ctaocrypt/md5.h | 7 ++-- cyassl/ctaocrypt/memory.h | 7 ++-- cyassl/ctaocrypt/misc.h | 7 ++-- cyassl/ctaocrypt/mpi_class.h | 7 ++-- cyassl/ctaocrypt/mpi_superclass.h | 7 ++-- cyassl/ctaocrypt/pkcs7.h | 9 +++-- cyassl/ctaocrypt/poly1305.h | 7 ++-- cyassl/ctaocrypt/port/pic32/pic32mz-crypt.h | 7 ++-- cyassl/ctaocrypt/pwdbased.h | 7 ++-- cyassl/ctaocrypt/rabbit.h | 7 ++-- cyassl/ctaocrypt/random.h | 7 ++-- cyassl/ctaocrypt/ripemd.h | 7 ++-- cyassl/ctaocrypt/rsa.h | 7 ++-- cyassl/ctaocrypt/settings.h | 7 ++-- cyassl/ctaocrypt/settings_comp.h | 7 ++-- cyassl/ctaocrypt/sha.h | 7 ++-- cyassl/ctaocrypt/sha256.h | 7 ++-- cyassl/ctaocrypt/sha512.h | 7 ++-- cyassl/ctaocrypt/tfm.h | 7 ++-- cyassl/ctaocrypt/types.h | 7 ++-- cyassl/ctaocrypt/visibility.h | 7 ++-- cyassl/ctaocrypt/wc_port.h | 7 ++-- cyassl/error-ssl.h | 7 ++-- cyassl/internal.h | 7 ++-- cyassl/ocsp.h | 7 ++-- cyassl/openssl/des.h | 7 ++-- cyassl/openssl/evp.h | 7 ++-- cyassl/openssl/hmac.h | 7 ++-- cyassl/openssl/ssl.h | 9 +++-- cyassl/options.h.in | 7 ++-- cyassl/sniffer.h | 7 ++-- cyassl/sniffer_error.h | 7 ++-- cyassl/ssl.h | 9 +++-- cyassl/version.h | 7 ++-- cyassl/version.h.in | 7 ++-- examples/client/client.c | 7 ++-- examples/client/client.h | 7 ++-- examples/echoclient/echoclient.c | 7 ++-- examples/echoclient/echoclient.h | 7 ++-- examples/echoserver/echoserver.c | 7 ++-- examples/echoserver/echoserver.h | 7 ++-- examples/server/server.c | 7 ++-- examples/server/server.h | 7 ++-- mcapi/crypto.c | 7 ++-- mcapi/crypto.h | 7 ++-- mcapi/mcapi_test.c | 7 ++-- mplabx/benchmark_main.c | 7 ++-- mplabx/test_main.c | 7 ++-- rpm/spec.in | 5 ++- src/crl.c | 7 ++-- src/internal.c | 7 ++-- src/io.c | 7 ++-- src/keys.c | 7 ++-- src/ocsp.c | 7 ++-- src/sniffer.c | 7 ++-- src/ssl.c | 7 ++-- src/tls.c | 7 ++-- sslSniffer/sslSnifferTest/snifftest.c | 7 ++-- support/wolfssl.pc | 2 +- swig/wolfssl.i | 7 ++-- swig/wolfssl_adds.c | 7 ++-- tests/api.c | 7 ++-- tests/hash.c | 7 ++-- tests/srp.c | 13 ++++--- tests/suites.c | 7 ++-- tests/unit.c | 7 ++-- tests/unit.h | 7 ++-- testsuite/testsuite.c | 7 ++-- wolfcrypt/benchmark/benchmark.c | 7 ++-- wolfcrypt/benchmark/benchmark.h | 7 ++-- wolfcrypt/src/aes.c | 7 ++-- wolfcrypt/src/aes_asm.s | 7 ++-- wolfcrypt/src/arc4.c | 7 ++-- wolfcrypt/src/asm.c | 7 ++-- wolfcrypt/src/asn.c | 7 ++-- wolfcrypt/src/blake2b.c | 7 ++-- wolfcrypt/src/camellia.c | 7 ++-- wolfcrypt/src/chacha.c | 7 ++-- wolfcrypt/src/chacha20_poly1305.c | 7 ++-- wolfcrypt/src/coding.c | 7 ++-- wolfcrypt/src/compress.c | 9 +++-- wolfcrypt/src/curve25519.c | 7 ++-- wolfcrypt/src/des3.c | 7 ++-- wolfcrypt/src/dh.c | 7 ++-- wolfcrypt/src/dsa.c | 7 ++-- wolfcrypt/src/ecc.c | 7 ++-- wolfcrypt/src/ed25519.c | 7 ++-- wolfcrypt/src/error.c | 7 ++-- wolfcrypt/src/fe_low_mem.c | 7 ++-- wolfcrypt/src/fe_operations.c | 7 ++-- wolfcrypt/src/fp_mont_small.i | 7 ++-- wolfcrypt/src/fp_mul_comba_12.i | 7 ++-- wolfcrypt/src/fp_mul_comba_17.i | 7 ++-- wolfcrypt/src/fp_mul_comba_20.i | 7 ++-- wolfcrypt/src/fp_mul_comba_24.i | 7 ++-- wolfcrypt/src/fp_mul_comba_28.i | 7 ++-- wolfcrypt/src/fp_mul_comba_3.i | 7 ++-- wolfcrypt/src/fp_mul_comba_32.i | 7 ++-- wolfcrypt/src/fp_mul_comba_4.i | 7 ++-- wolfcrypt/src/fp_mul_comba_48.i | 7 ++-- wolfcrypt/src/fp_mul_comba_6.i | 7 ++-- wolfcrypt/src/fp_mul_comba_64.i | 7 ++-- wolfcrypt/src/fp_mul_comba_7.i | 7 ++-- wolfcrypt/src/fp_mul_comba_8.i | 7 ++-- wolfcrypt/src/fp_mul_comba_9.i | 7 ++-- wolfcrypt/src/fp_mul_comba_small_set.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_12.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_17.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_20.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_24.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_28.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_3.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_32.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_4.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_48.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_6.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_64.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_7.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_8.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_9.i | 7 ++-- wolfcrypt/src/fp_sqr_comba_small_set.i | 7 ++-- wolfcrypt/src/ge_low_mem.c | 7 ++-- wolfcrypt/src/ge_operations.c | 7 ++-- wolfcrypt/src/hash.c | 7 ++-- wolfcrypt/src/hc128.c | 7 ++-- wolfcrypt/src/hmac.c | 7 ++-- wolfcrypt/src/idea.c | 7 ++-- wolfcrypt/src/integer.c | 7 ++-- wolfcrypt/src/logging.c | 7 ++-- wolfcrypt/src/md2.c | 7 ++-- wolfcrypt/src/md4.c | 7 ++-- wolfcrypt/src/md5.c | 7 ++-- wolfcrypt/src/memory.c | 7 ++-- wolfcrypt/src/misc.c | 7 ++-- wolfcrypt/src/pkcs7.c | 7 ++-- wolfcrypt/src/poly1305.c | 12 +++--- wolfcrypt/src/port/nrf51.c | 7 ++-- wolfcrypt/src/port/pic32/pic32mz-hash.c | 7 ++-- wolfcrypt/src/port/ti/ti-aes.c | 7 ++-- wolfcrypt/src/port/ti/ti-ccm.c | 7 ++-- wolfcrypt/src/port/ti/ti-des3.c | 7 ++-- wolfcrypt/src/port/ti/ti-hash.c | 7 ++-- wolfcrypt/src/pwdbased.c | 7 ++-- wolfcrypt/src/rabbit.c | 7 ++-- wolfcrypt/src/random.c | 7 ++-- wolfcrypt/src/ripemd.c | 7 ++-- wolfcrypt/src/rsa.c | 7 ++-- wolfcrypt/src/sha.c | 7 ++-- wolfcrypt/src/sha256.c | 7 ++-- wolfcrypt/src/sha512.c | 7 ++-- wolfcrypt/src/signature.c | 7 ++-- wolfcrypt/src/srp.c | 7 ++-- wolfcrypt/src/tfm.c | 7 ++-- wolfcrypt/src/wc_encrypt.c | 7 ++-- wolfcrypt/src/wc_port.c | 7 ++-- wolfcrypt/test/test.c | 7 ++-- wolfcrypt/test/test.h | 7 ++-- wolfcrypt/user-crypto/README.txt | 7 ++-- wolfcrypt/user-crypto/include/user_rsa.h | 7 ++-- wolfcrypt/user-crypto/src/rsa.c | 7 ++-- wolfssl/callbacks.h | 7 ++-- wolfssl/crl.h | 7 ++-- wolfssl/error-ssl.h | 7 ++-- wolfssl/internal.h | 7 ++-- wolfssl/mem_track.h | 7 ++-- wolfssl/ocsp.h | 7 ++-- wolfssl/openssl/des.h | 7 ++-- wolfssl/openssl/evp.h | 7 ++-- wolfssl/openssl/hmac.h | 7 ++-- wolfssl/openssl/ssl.h | 9 +++-- wolfssl/options.h.in | 7 ++-- wolfssl/sniffer.h | 7 ++-- wolfssl/sniffer_error.h | 7 ++-- wolfssl/ssl.h | 7 ++-- wolfssl/version.h | 11 +++--- wolfssl/version.h.in | 7 ++-- wolfssl/wolfcrypt/aes.h | 7 ++-- wolfssl/wolfcrypt/arc4.h | 7 ++-- wolfssl/wolfcrypt/asn.h | 7 ++-- wolfssl/wolfcrypt/asn_public.h | 7 ++-- wolfssl/wolfcrypt/blake2-impl.h | 7 ++-- wolfssl/wolfcrypt/blake2-int.h | 7 ++-- wolfssl/wolfcrypt/blake2.h | 9 +++-- wolfssl/wolfcrypt/camellia.h | 7 ++-- wolfssl/wolfcrypt/chacha.h | 7 ++-- wolfssl/wolfcrypt/chacha20_poly1305.h | 7 ++-- wolfssl/wolfcrypt/coding.h | 7 ++-- wolfssl/wolfcrypt/compress.h | 7 ++-- wolfssl/wolfcrypt/curve25519.h | 7 ++-- wolfssl/wolfcrypt/des3.h | 7 ++-- wolfssl/wolfcrypt/dh.h | 7 ++-- wolfssl/wolfcrypt/dsa.h | 7 ++-- wolfssl/wolfcrypt/ecc.h | 7 ++-- wolfssl/wolfcrypt/ed25519.h | 7 ++-- wolfssl/wolfcrypt/error-crypt.h | 7 ++-- wolfssl/wolfcrypt/fe_operations.h | 7 ++-- wolfssl/wolfcrypt/fips_test.h | 7 ++-- wolfssl/wolfcrypt/ge_operations.h | 7 ++-- wolfssl/wolfcrypt/hash.h | 7 ++-- wolfssl/wolfcrypt/hc128.h | 7 ++-- wolfssl/wolfcrypt/hmac.h | 7 ++-- wolfssl/wolfcrypt/idea.h | 7 ++-- wolfssl/wolfcrypt/integer.h | 7 ++-- wolfssl/wolfcrypt/logging.h | 7 ++-- wolfssl/wolfcrypt/md2.h | 7 ++-- wolfssl/wolfcrypt/md4.h | 7 ++-- wolfssl/wolfcrypt/md5.h | 7 ++-- wolfssl/wolfcrypt/memory.h | 7 ++-- wolfssl/wolfcrypt/misc.h | 7 ++-- wolfssl/wolfcrypt/mpi_class.h | 7 ++-- wolfssl/wolfcrypt/mpi_superclass.h | 7 ++-- wolfssl/wolfcrypt/pkcs7.h | 7 ++-- wolfssl/wolfcrypt/poly1305.h | 7 ++-- wolfssl/wolfcrypt/port/nrf51.h | 7 ++-- wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h | 7 ++-- wolfssl/wolfcrypt/port/ti/ti-ccm.h | 6 +-- wolfssl/wolfcrypt/port/ti/ti-hash.h | 7 ++-- wolfssl/wolfcrypt/pwdbased.h | 7 ++-- wolfssl/wolfcrypt/rabbit.h | 7 ++-- wolfssl/wolfcrypt/random.h | 7 ++-- wolfssl/wolfcrypt/ripemd.h | 7 ++-- wolfssl/wolfcrypt/rsa.h | 7 ++-- wolfssl/wolfcrypt/settings.h | 7 ++-- wolfssl/wolfcrypt/sha.h | 7 ++-- wolfssl/wolfcrypt/sha256.h | 7 ++-- wolfssl/wolfcrypt/sha512.h | 7 ++-- wolfssl/wolfcrypt/signature.h | 7 ++-- wolfssl/wolfcrypt/srp.h | 7 ++-- wolfssl/wolfcrypt/tfm.h | 7 ++-- wolfssl/wolfcrypt/types.h | 7 ++-- wolfssl/wolfcrypt/visibility.h | 7 ++-- wolfssl/wolfcrypt/wc_encrypt.h | 7 ++-- wolfssl/wolfcrypt/wc_port.h | 7 ++-- .../wolfSSL-DTLS-PSK-Server.cs | 6 +-- .../wolfSSL-DTLS-Server.cs | 6 +-- .../wolfSSL-Example-IOCallbacks.cs | 23 ++++++++++- .../wolfSSL-TLS-PSK-Server.cs | 6 +-- .../wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs | 6 +-- wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs | 6 +-- 325 files changed, 1397 insertions(+), 991 deletions(-) diff --git a/IDE/ARDUINO/sketches/wolfssl_client.ino b/IDE/ARDUINO/sketches/wolfssl_client.ino index f91f85a4e..6d52690c2 100644 --- a/IDE/ARDUINO/sketches/wolfssl_client.ino +++ b/IDE/ARDUINO/sketches/wolfssl_client.ino @@ -1,8 +1,8 @@ /* wolfssl_client.ino * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include #include #include diff --git a/IDE/IAR-EWARM/Projects/benchmark/benchmark-main.c b/IDE/IAR-EWARM/Projects/benchmark/benchmark-main.c index cdb8efd26..3b12b6f29 100644 --- a/IDE/IAR-EWARM/Projects/benchmark/benchmark-main.c +++ b/IDE/IAR-EWARM/Projects/benchmark/benchmark-main.c @@ -1,8 +1,8 @@ /* benchmark-main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/IDE/IAR-EWARM/Projects/benchmark/current_time.c b/IDE/IAR-EWARM/Projects/benchmark/current_time.c index 9a21fd740..1c626f5ef 100644 --- a/IDE/IAR-EWARM/Projects/benchmark/current_time.c +++ b/IDE/IAR-EWARM/Projects/benchmark/current_time.c @@ -1,8 +1,8 @@ /* current-time.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/IDE/IAR-EWARM/Projects/common/minimum-startup.c b/IDE/IAR-EWARM/Projects/common/minimum-startup.c index 0315d577e..030914bfd 100644 --- a/IDE/IAR-EWARM/Projects/common/minimum-startup.c +++ b/IDE/IAR-EWARM/Projects/common/minimum-startup.c @@ -1,8 +1,8 @@ /* minimum-startup.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include #pragma language=extended diff --git a/IDE/IAR-EWARM/Projects/test/test-main.c b/IDE/IAR-EWARM/Projects/test/test-main.c index ad78746d5..5d0930b71 100644 --- a/IDE/IAR-EWARM/Projects/test/test-main.c +++ b/IDE/IAR-EWARM/Projects/test/test-main.c @@ -1,8 +1,8 @@ /* test-main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + typedef struct func_args { int argc; char** argv; diff --git a/IDE/LPCXPRESSO/lib_wolfssl/lpc_18xx_port.c b/IDE/LPCXPRESSO/lib_wolfssl/lpc_18xx_port.c index 600173913..12fe6ff44 100644 --- a/IDE/LPCXPRESSO/lib_wolfssl/lpc_18xx_port.c +++ b/IDE/LPCXPRESSO/lib_wolfssl/lpc_18xx_port.c @@ -1,8 +1,8 @@ /* lpc_18xx_port.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include "board.h" #include "otp_18xx_43xx.h" /* For RNG */ #include "timer_18xx_43xx.h" diff --git a/IDE/LPCXPRESSO/wolf_example/src/lpc_18xx_startup.c b/IDE/LPCXPRESSO/wolf_example/src/lpc_18xx_startup.c index 893704285..5b5006eae 100644 --- a/IDE/LPCXPRESSO/wolf_example/src/lpc_18xx_startup.c +++ b/IDE/LPCXPRESSO/wolf_example/src/lpc_18xx_startup.c @@ -1,8 +1,8 @@ /* lpc_18xx_startup.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include "board.h" #include #include diff --git a/IDE/MDK-ARM/LPC43xx/time-LCP43xx.c b/IDE/MDK-ARM/LPC43xx/time-LCP43xx.c index 8db219671..c481e177b 100644 --- a/IDE/MDK-ARM/LPC43xx/time-LCP43xx.c +++ b/IDE/MDK-ARM/LPC43xx/time-LCP43xx.c @@ -1,8 +1,8 @@ /* time.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/cert_data.c b/IDE/MDK-ARM/MDK-ARM/wolfSSL/cert_data.c index a29e8fcbb..313e64f64 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/cert_data.c +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/cert_data.c @@ -1,8 +1,8 @@ /* certs_test.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-BARE-METAL.h b/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-BARE-METAL.h index 5ce08dc3d..e0f8ab925 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-BARE-METAL.h +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-BARE-METAL.h @@ -1,8 +1,8 @@ /* config-BEREFOOT.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /**** wolfSSL for KEIL-RL Configuration ****/ #define __CORTEX_M3__ diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-FS.h b/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-FS.h index 37c92f446..c3a746ae2 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-FS.h +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-FS.h @@ -1,8 +1,8 @@ /* config-FS.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /**** wolfSSL for KEIL-RL Configuration ****/ #define __CORTEX_M3__ diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-RTX-TCP-FS.h b/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-RTX-TCP-FS.h index 454b86bce..bd04e62e4 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-RTX-TCP-FS.h +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/config-RTX-TCP-FS.h @@ -1,8 +1,8 @@ /* config-RTX-TCP-FS.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,11 +16,12 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /**** wolfSSL for MDK-RTX-TCP-FS Configuration ****/ #define __CORTEX_M3__ diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/config.h b/IDE/MDK-ARM/MDK-ARM/wolfSSL/config.h index 3f5c11191..19260198e 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/config.h +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/config.h @@ -1,8 +1,8 @@ /* config.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef MDK_CONFIG_H__ #define MDK_CONFIG_H__ /**** wolfSSL for KEIL-RL Configuration ****/ diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/main.c b/IDE/MDK-ARM/MDK-ARM/wolfSSL/main.c index a12d16249..178ff93cd 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/main.c +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/main.c @@ -1,8 +1,8 @@ /* main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/shell.c b/IDE/MDK-ARM/MDK-ARM/wolfSSL/shell.c index 446efbe20..39d97db73 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/shell.c +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/shell.c @@ -1,8 +1,8 @@ /*shell.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /*** tiny Shell for wolfSSL apps ***/ diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/time-CortexM3-4.c b/IDE/MDK-ARM/MDK-ARM/wolfSSL/time-CortexM3-4.c index ca5046138..2171fa629 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/time-CortexM3-4.c +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/time-CortexM3-4.c @@ -1,8 +1,8 @@ /* time-STM32F2.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/time-dummy.c b/IDE/MDK-ARM/MDK-ARM/wolfSSL/time-dummy.c index ba1a6a734..55cd2e0c9 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/time-dummy.c +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/time-dummy.c @@ -1,8 +1,8 @@ /* time-dummy.c.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.c b/IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.c index ab71b87ab..40984aca2 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.c +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.c @@ -1,23 +1,23 @@ /* wolfssl_KEIL_RL.c - * - * Copyright (C) 2006-2015 wolfSSL Inc. - * - * This file is part of wolfSSL. (formerly known as CyaSSL) - * - * wolfSSL is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * wolfSSL is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ + * + * Copyright (C) 2006-2016 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ /***************************************************************************************/ diff --git a/IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.h b/IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.h index 665fc62c0..7ad930a24 100644 --- a/IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.h +++ b/IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.h @@ -1,8 +1,8 @@ /* wolfssl_KEIL_RL.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /******************************************************************************/ /** This file is for defining types, values for specific to KEIL-MDK-ARM. **/ /******************************************************************************/ diff --git a/IDE/MDK-ARM/STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c b/IDE/MDK-ARM/STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c index 969fda07d..03e2153d5 100644 --- a/IDE/MDK-ARM/STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c +++ b/IDE/MDK-ARM/STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c @@ -1,8 +1,8 @@ /* main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Conf/config-Crypt.h b/IDE/MDK5-ARM/Conf/config-Crypt.h index baaf43f2e..6950af981 100644 --- a/IDE/MDK5-ARM/Conf/config-Crypt.h +++ b/IDE/MDK5-ARM/Conf/config-Crypt.h @@ -1,8 +1,8 @@ /* config-Crypt.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + // <<< Use Configuration Wizard in Context Menu >>> // wolfCrypt Configuration diff --git a/IDE/MDK5-ARM/Inc/config.h b/IDE/MDK5-ARM/Inc/config.h index 39986dd95..9010d13be 100644 --- a/IDE/MDK5-ARM/Inc/config.h +++ b/IDE/MDK5-ARM/Inc/config.h @@ -1,8 +1,8 @@ /* config.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #define __CORTEX_M3__ #if defined(MDK_CONF_full) diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/settings.h index 965388788..3eb9d28b8 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/settings.h +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/settings.h @@ -1,8 +1,8 @@ /* settings.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Place OS specific preprocessor flags, defines, includes here, will be included into every file because types.h includes it */ diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c b/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c index a120dfe34..d1c6e194b 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c @@ -1,8 +1,8 @@ /* main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/time-CortexM3-4.c b/IDE/MDK5-ARM/Projects/CryptBenchmark/time-CortexM3-4.c index ca5046138..2171fa629 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/time-CortexM3-4.c +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/time-CortexM3-4.c @@ -1,8 +1,8 @@ /* time-STM32F2.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/time-dummy.c b/IDE/MDK5-ARM/Projects/CryptBenchmark/time-dummy.c index 8f98da46a..3463d57f0 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/time-dummy.c +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/time-dummy.c @@ -1,8 +1,8 @@ /* time-dummy.c.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/settings.h index 86a57a0db..3eb9d28b8 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/settings.h +++ b/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/settings.h @@ -1,8 +1,8 @@ /* settings.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Place OS specific preprocessor flags, defines, includes here, will be included into every file because types.h includes it */ diff --git a/IDE/MDK5-ARM/Projects/CryptTest/main.c b/IDE/MDK5-ARM/Projects/CryptTest/main.c index 36954c661..f2072a9da 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/main.c +++ b/IDE/MDK5-ARM/Projects/CryptTest/main.c @@ -1,8 +1,8 @@ /* main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/CryptTest/time-dummy.c b/IDE/MDK5-ARM/Projects/CryptTest/time-dummy.c index 8f98da46a..3463d57f0 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/time-dummy.c +++ b/IDE/MDK5-ARM/Projects/CryptTest/time-dummy.c @@ -1,8 +1,8 @@ /* time-dummy.c.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/settings.h index 5cfe60dfe..147c19869 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/settings.h +++ b/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/settings.h @@ -1,8 +1,8 @@ /* settings.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Place OS specific preprocessor flags, defines, includes here, will be included into every file because types.h includes it */ diff --git a/IDE/MDK5-ARM/Projects/EchoClient/config-EchoClient.h b/IDE/MDK5-ARM/Projects/EchoClient/config-EchoClient.h index 43e39026f..01bdb25e2 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/config-EchoClient.h +++ b/IDE/MDK5-ARM/Projects/EchoClient/config-EchoClient.h @@ -1,8 +1,8 @@ /* config-RTX-TCP-FS.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,11 +16,12 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + // <<< Use Configuration Wizard in Context Menu >>> // Build Target: Simple Client // Callee IP Address diff --git a/IDE/MDK5-ARM/Projects/EchoClient/main.c b/IDE/MDK5-ARM/Projects/EchoClient/main.c index f2f7da985..434165986 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/main.c +++ b/IDE/MDK5-ARM/Projects/EchoClient/main.c @@ -1,8 +1,8 @@ /* main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/EchoClient/time-dummy.c b/IDE/MDK5-ARM/Projects/EchoClient/time-dummy.c index 8f98da46a..3463d57f0 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/time-dummy.c +++ b/IDE/MDK5-ARM/Projects/EchoClient/time-dummy.c @@ -1,8 +1,8 @@ /* time-dummy.c.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/settings.h index 5cfe60dfe..147c19869 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/settings.h +++ b/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/settings.h @@ -1,8 +1,8 @@ /* settings.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Place OS specific preprocessor flags, defines, includes here, will be included into every file because types.h includes it */ diff --git a/IDE/MDK5-ARM/Projects/EchoServer/main.c b/IDE/MDK5-ARM/Projects/EchoServer/main.c index b11946403..5f5715597 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/main.c +++ b/IDE/MDK5-ARM/Projects/EchoServer/main.c @@ -1,8 +1,8 @@ /* main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/EchoServer/time-dummy.c b/IDE/MDK5-ARM/Projects/EchoServer/time-dummy.c index 8f98da46a..3463d57f0 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/time-dummy.c +++ b/IDE/MDK5-ARM/Projects/EchoServer/time-dummy.c @@ -1,8 +1,8 @@ /* time-dummy.c.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/settings.h index 86a57a0db..3eb9d28b8 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/settings.h +++ b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/settings.h @@ -1,8 +1,8 @@ /* settings.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Place OS specific preprocessor flags, defines, includes here, will be included into every file because types.h includes it */ diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h b/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h index f6171d165..54902f480 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h +++ b/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h @@ -1,8 +1,8 @@ /* config-RTX-TCP-FS.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /**** CyaSSL for KEIL-RL Configuration ****/ #define __CORTEX_M3__ diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/main.c b/IDE/MDK5-ARM/Projects/SimpleClient/main.c index a882c24ca..bf6a2ab5b 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/main.c +++ b/IDE/MDK5-ARM/Projects/SimpleClient/main.c @@ -1,8 +1,8 @@ /* main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/time-CortexM3-4.c b/IDE/MDK5-ARM/Projects/SimpleClient/time-CortexM3-4.c index ca5046138..2171fa629 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/time-CortexM3-4.c +++ b/IDE/MDK5-ARM/Projects/SimpleClient/time-CortexM3-4.c @@ -1,8 +1,8 @@ /* time-STM32F2.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/time-STM32F2xx.c b/IDE/MDK5-ARM/Projects/SimpleClient/time-STM32F2xx.c index 367029387..4b2606e2a 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/time-STM32F2xx.c +++ b/IDE/MDK5-ARM/Projects/SimpleClient/time-STM32F2xx.c @@ -1,8 +1,8 @@ /* time-STM32F2.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/time-dummy.c b/IDE/MDK5-ARM/Projects/SimpleClient/time-dummy.c index 8f98da46a..3463d57f0 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/time-dummy.c +++ b/IDE/MDK5-ARM/Projects/SimpleClient/time-dummy.c @@ -1,8 +1,8 @@ /* time-dummy.c.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/settings.h index 5cfe60dfe..147c19869 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/settings.h +++ b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/settings.h @@ -1,8 +1,8 @@ /* settings.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Place OS specific preprocessor flags, defines, includes here, will be included into every file because types.h includes it */ diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/config-SimpleServer.h b/IDE/MDK5-ARM/Projects/SimpleServer/config-SimpleServer.h index eda721c87..cb37a99eb 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/config-SimpleServer.h +++ b/IDE/MDK5-ARM/Projects/SimpleServer/config-SimpleServer.h @@ -1,8 +1,8 @@ /* config-RTX-TCP-FS.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,11 +16,12 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + // <<< Use Configuration Wizard in Context Menu >>> // Build Target: Simple Server // Listen Port Number diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/main.c b/IDE/MDK5-ARM/Projects/SimpleServer/main.c index 9fd78f019..8024d99b9 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/main.c +++ b/IDE/MDK5-ARM/Projects/SimpleServer/main.c @@ -1,8 +1,8 @@ /* main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/time-dummy.c b/IDE/MDK5-ARM/Projects/SimpleServer/time-dummy.c index 8f98da46a..3463d57f0 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/time-dummy.c +++ b/IDE/MDK5-ARM/Projects/SimpleServer/time-dummy.c @@ -1,8 +1,8 @@ /* time-dummy.c.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c b/IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c index 2ee3de735..eaf711e25 100644 --- a/IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c +++ b/IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c @@ -1,8 +1,8 @@ /* main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c b/IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c index f9550c2a6..b24693767 100644 --- a/IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c +++ b/IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c @@ -1,8 +1,8 @@ /*shell.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /*** tiny Shell for wolfSSL apps ***/ diff --git a/IDE/MDK5-ARM/Projects/wolfSSL-Full/time-CortexM3-4.c b/IDE/MDK5-ARM/Projects/wolfSSL-Full/time-CortexM3-4.c index c825387dd..0f6b02bbe 100644 --- a/IDE/MDK5-ARM/Projects/wolfSSL-Full/time-CortexM3-4.c +++ b/IDE/MDK5-ARM/Projects/wolfSSL-Full/time-CortexM3-4.c @@ -1,8 +1,8 @@ /* time-STM32F2.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/IDE/MDK5-ARM/Src/ssl-dummy.c b/IDE/MDK5-ARM/Src/ssl-dummy.c index 1ddc843e6..8b5cba869 100644 --- a/IDE/MDK5-ARM/Src/ssl-dummy.c +++ b/IDE/MDK5-ARM/Src/ssl-dummy.c @@ -1,8 +1,8 @@ /* ssl-dummy.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c b/IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c index faab65705..358c0f2d7 100644 --- a/IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c +++ b/IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c @@ -1,8 +1,8 @@ /* arm_startup.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include "hw.h" #include diff --git a/IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c b/IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c index 9d3891e62..cdeda8570 100644 --- a/IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c +++ b/IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c @@ -1,8 +1,8 @@ /* benchmark_main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/IDE/ROWLEY-CROSSWORKS-ARM/kinetis_hw.c b/IDE/ROWLEY-CROSSWORKS-ARM/kinetis_hw.c index 7dab09433..338ebcbe2 100644 --- a/IDE/ROWLEY-CROSSWORKS-ARM/kinetis_hw.c +++ b/IDE/ROWLEY-CROSSWORKS-ARM/kinetis_hw.c @@ -1,8 +1,8 @@ /* kinetis_hw.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include "hw.h" #if defined(FREESCALE) && defined(K_SERIES) diff --git a/IDE/ROWLEY-CROSSWORKS-ARM/retarget.c b/IDE/ROWLEY-CROSSWORKS-ARM/retarget.c index 8f524b841..11dd05092 100644 --- a/IDE/ROWLEY-CROSSWORKS-ARM/retarget.c +++ b/IDE/ROWLEY-CROSSWORKS-ARM/retarget.c @@ -1,8 +1,8 @@ /* retarget.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include "hw.h" double current_time(int reset) diff --git a/IDE/ROWLEY-CROSSWORKS-ARM/test_main.c b/IDE/ROWLEY-CROSSWORKS-ARM/test_main.c index 632adcb98..aad67b819 100644 --- a/IDE/ROWLEY-CROSSWORKS-ARM/test_main.c +++ b/IDE/ROWLEY-CROSSWORKS-ARM/test_main.c @@ -1,8 +1,8 @@ /* test_main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/README b/README index 111dc3503..47b8d4c89 100644 --- a/README +++ b/README @@ -35,6 +35,41 @@ before calling wolfSSL_new(); Though it's not recommended. *** end Notes *** + ********* wolfSSL (Formerly CyaSSL) Release 3.9.0 (3/18/2016) + +Release 3.9.0 of wolfSSL has bug fixes and new features including: + +- Add new leantls configuration +- Add RSA OAEP padding at wolfCrypt level +- Add Arduino port and example client +- Add fixed point DH operation +- Add CUSTOM_RAND_GENRATE_SEED_OS and CUSTOM_RAND_GENERATE_BLOCK +- Add ECDHE-PSK cipher suites +- Add PSK ChaCha20-Poly1305 cipher suites +- Add option for fail on no peer cert except PSK suites +- Add port for Nordic nRF51 +- Add additional ECC NIST test vectors for 256, 384 and 521 +- Add more granular ECC, Ed25519/Curve25519 and AES configs +- Update to ChaCha20-Poly1305 +- Update support for Freescale KSDK 1.3.0 +- Update DER buffer handling code, refactoring and reducing memory +- Fix to AESNI 192 bit key expansion +- Fix to C# wrapper character encoding +- Fix sequence number issue with DTLS epoch 0 messages +- Fix RNGA with K64 build +- Fix ASN.1 X509 V3 certificate policy extension parsing +- Fix potential free of uninitialized RSA key in asn.c +- Fix potential underflow when using ECC build with FP_ECC +- Fixes for warnings in Visual Studio 2015 build + +- No high level security fixes that requires an update though we always +recommend updating to the latest +- FP_ECC is off by default, users with it enabled should update for the zero +sized hash fix + +See INSTALL file for build instructions. +More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html + ********* wolfSSL (Formerly CyaSSL) Release 3.8.0 (12/30/2015) Release 3.8.0 of wolfSSL has bug fixes and new features including: diff --git a/README.md b/README.md index e1f985e59..7e5daf459 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,40 @@ wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0); before calling wolfSSL_new(); Though it's not recommended. ``` +# wolfSSL (Formerly CyaSSL) Release 3.9.0 (03/18/2015) + +##Release 3.9.0 of wolfSSL has bug fixes and new features including: + +- Add new leantls configuration +- Add RSA OAEP padding at wolfCrypt level +- Add Arduino port and example client +- Add fixed point DH operation +- Add CUSTOM_RAND_GENRATE_SEED_OS and CUSTOM_RAND_GENERATE_BLOCK +- Add ECDHE-PSK cipher suites +- Add PSK ChaCha20-Poly1305 cipher suites +- Add option for fail on no peer cert except PSK suites +- Add port for Nordic nRF51 +- Add additional ECC NIST test vectors for 256, 384 and 521 +- Add more granular ECC, Ed25519/Curve25519 and AES configs +- Update to ChaCha20-Poly1305 +- Update support for Freescale KSDK 1.3.0 +- Update DER buffer handling code, refactoring and reducing memory +- Fix to AESNI 192 bit key expansion +- Fix to C# wrapper character encoding +- Fix sequence number issue with DTLS epoch 0 messages +- Fix RNGA with K64 build +- Fix ASN.1 X509 V3 certificate policy extension parsing +- Fix potential free of uninitialized RSA key in asn.c +- Fix potential underflow when using ECC build with FP_ECC +- Fixes for warnings in Visual Studio 2015 build + +- No high level security fixes that requires an update though we always +recommend updating to the latest +- FP_ECC is off by default, users with it enabled should update for the zero +sized hash fix + +See INSTALL file for build instructions. +More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html # wolfSSL (Formerly CyaSSL) Release 3.8.0 (12/30/2015) diff --git a/configure.ac b/configure.ac index c7e14cc9d..9a84505c5 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ # # -AC_INIT([wolfssl],[3.8.1],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[http://www.wolfssl.com]) +AC_INIT([wolfssl],[3.9.0],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[http://www.wolfssl.com]) AC_CONFIG_AUX_DIR([build-aux]) @@ -35,7 +35,7 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS. #shared library versioning -WOLFSSL_LIBRARY_VERSION=4:0:1 +WOLFSSL_LIBRARY_VERSION=5:0:2 # | | | # +------+ | +---+ # | | | diff --git a/ctaocrypt/src/misc.c b/ctaocrypt/src/misc.c index dc4198be8..40be5ebad 100644 --- a/ctaocrypt/src/misc.c +++ b/ctaocrypt/src/misc.c @@ -1,8 +1,8 @@ /* misc.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef NO_INLINE #include #else diff --git a/ctaocrypt/src/wolfcrypt_first.c b/ctaocrypt/src/wolfcrypt_first.c index 00e474457..8591f3e4d 100644 --- a/ctaocrypt/src/wolfcrypt_first.c +++ b/ctaocrypt/src/wolfcrypt_first.c @@ -1,8 +1,8 @@ /* wolfcrypt_first.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* This file needs to be linked first in order to work correctly */ #ifdef HAVE_CONFIG_H diff --git a/ctaocrypt/src/wolfcrypt_last.c b/ctaocrypt/src/wolfcrypt_last.c index 284eb110e..d3924d4d0 100644 --- a/ctaocrypt/src/wolfcrypt_last.c +++ b/ctaocrypt/src/wolfcrypt_last.c @@ -1,8 +1,8 @@ /* wolfcrypt_last.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* This file needs to be linked last in order to work correctly */ #ifdef HAVE_CONFIG_H diff --git a/cyassl/callbacks.h b/cyassl/callbacks.h index f74f7a65e..8608e1ed3 100644 --- a/cyassl/callbacks.h +++ b/cyassl/callbacks.h @@ -1,8 +1,8 @@ /* callbacks.h * - * Copyright (C) 2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include diff --git a/cyassl/crl.h b/cyassl/crl.h index 87e402f38..c19dd8be6 100644 --- a/cyassl/crl.h +++ b/cyassl/crl.h @@ -1,8 +1,8 @@ /* crl.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include diff --git a/cyassl/ctaocrypt/aes.h b/cyassl/ctaocrypt/aes.h index 2bb213589..8ad064f06 100644 --- a/cyassl/ctaocrypt/aes.h +++ b/cyassl/ctaocrypt/aes.h @@ -1,8 +1,8 @@ /* aes.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_AES #ifndef CTAO_CRYPT_AES_H diff --git a/cyassl/ctaocrypt/arc4.h b/cyassl/ctaocrypt/arc4.h index 965b079a0..093d8465b 100644 --- a/cyassl/ctaocrypt/arc4.h +++ b/cyassl/ctaocrypt/arc4.h @@ -1,8 +1,8 @@ /* arc4.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_ARC4_H #define CTAO_CRYPT_ARC4_H diff --git a/cyassl/ctaocrypt/asn.h b/cyassl/ctaocrypt/asn.h index c27c144dd..7e7a9e76d 100644 --- a/cyassl/ctaocrypt/asn.h +++ b/cyassl/ctaocrypt/asn.h @@ -1,8 +1,8 @@ /* asn.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_ASN #ifndef CTAO_CRYPT_ASN_H diff --git a/cyassl/ctaocrypt/asn_public.h b/cyassl/ctaocrypt/asn_public.h index 040734eab..ac36ca476 100644 --- a/cyassl/ctaocrypt/asn_public.h +++ b/cyassl/ctaocrypt/asn_public.h @@ -1,8 +1,8 @@ /* asn_public.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_ASN_PUBLIC_H #define CTAO_CRYPT_ASN_PUBLIC_H diff --git a/cyassl/ctaocrypt/blake2-impl.h b/cyassl/ctaocrypt/blake2-impl.h index de6ed273b..e09bc2990 100644 --- a/cyassl/ctaocrypt/blake2-impl.h +++ b/cyassl/ctaocrypt/blake2-impl.h @@ -12,9 +12,9 @@ */ /* blake2-impl.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,10 +28,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAOCRYPT_BLAKE2_IMPL_H #define CTAOCRYPT_BLAKE2_IMPL_H diff --git a/cyassl/ctaocrypt/blake2-int.h b/cyassl/ctaocrypt/blake2-int.h index 9dadaadcb..f65dda15e 100644 --- a/cyassl/ctaocrypt/blake2-int.h +++ b/cyassl/ctaocrypt/blake2-int.h @@ -12,9 +12,9 @@ */ /* blake2-int.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,11 +28,12 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAOCRYPT_BLAKE2_INT_H #define CTAOCRYPT_BLAKE2_INT_H diff --git a/cyassl/ctaocrypt/blake2.h b/cyassl/ctaocrypt/blake2.h index b7749173c..daa96ce73 100644 --- a/cyassl/ctaocrypt/blake2.h +++ b/cyassl/ctaocrypt/blake2.h @@ -1,8 +1,8 @@ /* blake2.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_BLAKE2 #ifndef CTAOCRYPT_BLAKE2_H diff --git a/cyassl/ctaocrypt/camellia.h b/cyassl/ctaocrypt/camellia.h index bbe7dcf1b..a42b34d06 100644 --- a/cyassl/ctaocrypt/camellia.h +++ b/cyassl/ctaocrypt/camellia.h @@ -1,8 +1,8 @@ /* camellia.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_CAMELLIA_H #define CTAO_CRYPT_CAMELLIA_H diff --git a/cyassl/ctaocrypt/chacha.h b/cyassl/ctaocrypt/chacha.h index 7651d28af..2cb008b1b 100644 --- a/cyassl/ctaocrypt/chacha.h +++ b/cyassl/ctaocrypt/chacha.h @@ -1,8 +1,8 @@ /* chacha.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_CHACHA_H #define CTAO_CRYPT_CHACHA_H diff --git a/cyassl/ctaocrypt/coding.h b/cyassl/ctaocrypt/coding.h index 47f5d2533..f0007eae8 100644 --- a/cyassl/ctaocrypt/coding.h +++ b/cyassl/ctaocrypt/coding.h @@ -1,8 +1,8 @@ /* coding.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_CODING_H #define CTAO_CRYPT_CODING_H diff --git a/cyassl/ctaocrypt/compress.h b/cyassl/ctaocrypt/compress.h index 632af2ec3..a5682eebe 100644 --- a/cyassl/ctaocrypt/compress.h +++ b/cyassl/ctaocrypt/compress.h @@ -1,8 +1,8 @@ /* compress.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_LIBZ #ifndef CTAO_CRYPT_COMPRESS_H diff --git a/cyassl/ctaocrypt/des3.h b/cyassl/ctaocrypt/des3.h index c6fbaa8b7..674d96840 100644 --- a/cyassl/ctaocrypt/des3.h +++ b/cyassl/ctaocrypt/des3.h @@ -1,8 +1,8 @@ /* des3.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_DES3 #ifndef CTAO_CRYPT_DES3_H diff --git a/cyassl/ctaocrypt/dh.h b/cyassl/ctaocrypt/dh.h index 4bd7757b5..7dcf5de60 100644 --- a/cyassl/ctaocrypt/dh.h +++ b/cyassl/ctaocrypt/dh.h @@ -1,8 +1,8 @@ /* dh.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_DH #ifndef CTAO_CRYPT_DH_H diff --git a/cyassl/ctaocrypt/dsa.h b/cyassl/ctaocrypt/dsa.h index bdc8cd5ac..33ca045e0 100644 --- a/cyassl/ctaocrypt/dsa.h +++ b/cyassl/ctaocrypt/dsa.h @@ -1,8 +1,8 @@ /* dsa.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_DSA #ifndef CTAO_CRYPT_DSA_H diff --git a/cyassl/ctaocrypt/ecc.h b/cyassl/ctaocrypt/ecc.h index 3ae13f76d..09d3db9cb 100644 --- a/cyassl/ctaocrypt/ecc.h +++ b/cyassl/ctaocrypt/ecc.h @@ -1,8 +1,8 @@ /* ecc.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_ECC #ifndef CTAO_CRYPT_ECC_H diff --git a/cyassl/ctaocrypt/error-crypt.h b/cyassl/ctaocrypt/error-crypt.h index f20145543..bbc70f5cd 100644 --- a/cyassl/ctaocrypt/error-crypt.h +++ b/cyassl/ctaocrypt/error-crypt.h @@ -1,8 +1,8 @@ /* error-crypt.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_ERROR_H #define CTAO_CRYPT_ERROR_H diff --git a/cyassl/ctaocrypt/fips_test.h b/cyassl/ctaocrypt/fips_test.h index 12e1ce0a0..09848cff6 100644 --- a/cyassl/ctaocrypt/fips_test.h +++ b/cyassl/ctaocrypt/fips_test.h @@ -1,8 +1,8 @@ /* fips_test.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_FIPS_TEST_H #define CTAO_CRYPT_FIPS_TEST_H diff --git a/cyassl/ctaocrypt/hc128.h b/cyassl/ctaocrypt/hc128.h index b2c9bc9d3..190f86899 100644 --- a/cyassl/ctaocrypt/hc128.h +++ b/cyassl/ctaocrypt/hc128.h @@ -1,8 +1,8 @@ /* hc128.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_HC128 #ifndef CTAO_CRYPT_HC128_H diff --git a/cyassl/ctaocrypt/hmac.h b/cyassl/ctaocrypt/hmac.h index 4625f10ea..b582395e3 100644 --- a/cyassl/ctaocrypt/hmac.h +++ b/cyassl/ctaocrypt/hmac.h @@ -1,8 +1,8 @@ /* hmac.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_HMAC #ifndef CTAO_CRYPT_HMAC_H diff --git a/cyassl/ctaocrypt/integer.h b/cyassl/ctaocrypt/integer.h index 97b22822b..e9068288a 100644 --- a/cyassl/ctaocrypt/integer.h +++ b/cyassl/ctaocrypt/integer.h @@ -1,8 +1,8 @@ /* integer.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* * Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com diff --git a/cyassl/ctaocrypt/logging.h b/cyassl/ctaocrypt/logging.h index faa85d449..c3a32bd2c 100644 --- a/cyassl/ctaocrypt/logging.h +++ b/cyassl/ctaocrypt/logging.h @@ -1,8 +1,8 @@ /* logging.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* submitted by eof */ diff --git a/cyassl/ctaocrypt/md2.h b/cyassl/ctaocrypt/md2.h index cb7633752..3b1ade15e 100644 --- a/cyassl/ctaocrypt/md2.h +++ b/cyassl/ctaocrypt/md2.h @@ -1,8 +1,8 @@ /* md2.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* check for old macro */ #if !defined(CYASSL_MD2) && defined(WOLFSSL_MD2) #define CYASSL_MD2 diff --git a/cyassl/ctaocrypt/md4.h b/cyassl/ctaocrypt/md4.h index 458465621..16e4f5f46 100644 --- a/cyassl/ctaocrypt/md4.h +++ b/cyassl/ctaocrypt/md4.h @@ -1,8 +1,8 @@ /* md4.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_MD4 #ifndef CTAO_CRYPT_MD4_H diff --git a/cyassl/ctaocrypt/md5.h b/cyassl/ctaocrypt/md5.h index 3f5d01756..6e36fe9ce 100644 --- a/cyassl/ctaocrypt/md5.h +++ b/cyassl/ctaocrypt/md5.h @@ -1,8 +1,8 @@ /* md5.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_MD5 #ifndef CTAO_CRYPT_MD5_H diff --git a/cyassl/ctaocrypt/memory.h b/cyassl/ctaocrypt/memory.h index 285005350..683fac98d 100644 --- a/cyassl/ctaocrypt/memory.h +++ b/cyassl/ctaocrypt/memory.h @@ -1,8 +1,8 @@ /* memory.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* submitted by eof */ diff --git a/cyassl/ctaocrypt/misc.h b/cyassl/ctaocrypt/misc.h index a640044e5..828d29964 100644 --- a/cyassl/ctaocrypt/misc.h +++ b/cyassl/ctaocrypt/misc.h @@ -1,8 +1,8 @@ /* misc.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_MISC_H #define CTAO_CRYPT_MISC_H diff --git a/cyassl/ctaocrypt/mpi_class.h b/cyassl/ctaocrypt/mpi_class.h index 0ce92a64c..46855e9e4 100644 --- a/cyassl/ctaocrypt/mpi_class.h +++ b/cyassl/ctaocrypt/mpi_class.h @@ -1,8 +1,8 @@ /* mpi_class.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include diff --git a/cyassl/ctaocrypt/mpi_superclass.h b/cyassl/ctaocrypt/mpi_superclass.h index 68cd0a6e3..bee878425 100644 --- a/cyassl/ctaocrypt/mpi_superclass.h +++ b/cyassl/ctaocrypt/mpi_superclass.h @@ -1,8 +1,8 @@ /* mpi_superclass.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* super class file for PK algos */ #include diff --git a/cyassl/ctaocrypt/pkcs7.h b/cyassl/ctaocrypt/pkcs7.h index dfb7c2fd3..afac3e9a0 100644 --- a/cyassl/ctaocrypt/pkcs7.h +++ b/cyassl/ctaocrypt/pkcs7.h @@ -1,8 +1,8 @@ /* pkcs7.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -10,16 +10,17 @@ * (at your option) any later version. * * wolfSSL is distributed in the hope that it will be useful, - * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_PKCS7 #ifndef CTAO_CRYPT_PKCS7_H diff --git a/cyassl/ctaocrypt/poly1305.h b/cyassl/ctaocrypt/poly1305.h index bceb772a5..46e9bd64f 100644 --- a/cyassl/ctaocrypt/poly1305.h +++ b/cyassl/ctaocrypt/poly1305.h @@ -1,8 +1,8 @@ /* poly1305.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_POLY1305 #ifndef CTAO_CRYPT_POLY1305_H diff --git a/cyassl/ctaocrypt/port/pic32/pic32mz-crypt.h b/cyassl/ctaocrypt/port/pic32/pic32mz-crypt.h index a5dca8904..2bbf5ce6c 100644 --- a/cyassl/ctaocrypt/port/pic32/pic32mz-crypt.h +++ b/cyassl/ctaocrypt/port/pic32/pic32mz-crypt.h @@ -1,8 +1,8 @@ /* pic32mz-crypt.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef PIC32MZ_CRYPT_H #define PIC32MZ_CRYPT_H diff --git a/cyassl/ctaocrypt/pwdbased.h b/cyassl/ctaocrypt/pwdbased.h index 7d6dced51..304287f13 100644 --- a/cyassl/ctaocrypt/pwdbased.h +++ b/cyassl/ctaocrypt/pwdbased.h @@ -1,8 +1,8 @@ /* pwdbased.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_PWDBASED #ifndef CTAO_CRYPT_PWDBASED_H diff --git a/cyassl/ctaocrypt/rabbit.h b/cyassl/ctaocrypt/rabbit.h index a6e92ec2e..8918962c2 100644 --- a/cyassl/ctaocrypt/rabbit.h +++ b/cyassl/ctaocrypt/rabbit.h @@ -1,8 +1,8 @@ /* rabbit.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_RABBIT #ifndef CTAO_CRYPT_RABBIT_H diff --git a/cyassl/ctaocrypt/random.h b/cyassl/ctaocrypt/random.h index 6d3a96fea..f9b35d039 100644 --- a/cyassl/ctaocrypt/random.h +++ b/cyassl/ctaocrypt/random.h @@ -1,8 +1,8 @@ /* random.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_RANDOM_H #define CTAO_CRYPT_RANDOM_H diff --git a/cyassl/ctaocrypt/ripemd.h b/cyassl/ctaocrypt/ripemd.h index 4458fcc44..ffc6815d6 100644 --- a/cyassl/ctaocrypt/ripemd.h +++ b/cyassl/ctaocrypt/ripemd.h @@ -1,8 +1,8 @@ /* ripemd.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,11 +16,12 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_RIPEMD_H #define CTAO_CRYPT_RIPEME_H diff --git a/cyassl/ctaocrypt/rsa.h b/cyassl/ctaocrypt/rsa.h index 72f8dc5d0..3c8a9f23b 100644 --- a/cyassl/ctaocrypt/rsa.h +++ b/cyassl/ctaocrypt/rsa.h @@ -1,8 +1,8 @@ /* rsa.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_RSA #ifndef CTAO_CRYPT_RSA_H diff --git a/cyassl/ctaocrypt/settings.h b/cyassl/ctaocrypt/settings.h index b880be666..5db9f3c4a 100644 --- a/cyassl/ctaocrypt/settings.h +++ b/cyassl/ctaocrypt/settings.h @@ -1,8 +1,8 @@ /* settings.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Place OS specific preprocessor flags, defines, includes here, will be included into every file because types.h includes it */ diff --git a/cyassl/ctaocrypt/settings_comp.h b/cyassl/ctaocrypt/settings_comp.h index f1832c3f0..d8384d3e3 100644 --- a/cyassl/ctaocrypt/settings_comp.h +++ b/cyassl/ctaocrypt/settings_comp.h @@ -1,8 +1,8 @@ /* settings_comp.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_SETTINGS_C_H #define CTAO_CRYPT_SETTINGS_C_H diff --git a/cyassl/ctaocrypt/sha.h b/cyassl/ctaocrypt/sha.h index 56927e2de..768acfcb5 100644 --- a/cyassl/ctaocrypt/sha.h +++ b/cyassl/ctaocrypt/sha.h @@ -1,8 +1,8 @@ /* sha.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_SHA #ifndef CTAO_CRYPT_SHA_H diff --git a/cyassl/ctaocrypt/sha256.h b/cyassl/ctaocrypt/sha256.h index b8b1f2465..d875e3138 100644 --- a/cyassl/ctaocrypt/sha256.h +++ b/cyassl/ctaocrypt/sha256.h @@ -1,8 +1,8 @@ /* sha256.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* code submitted by raphael.huck@efixo.com */ diff --git a/cyassl/ctaocrypt/sha512.h b/cyassl/ctaocrypt/sha512.h index 3eab76005..7b3f646a1 100644 --- a/cyassl/ctaocrypt/sha512.h +++ b/cyassl/ctaocrypt/sha512.h @@ -1,8 +1,8 @@ /* sha512.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_SHA512_H #define CTAO_CRYPT_SHA512_H diff --git a/cyassl/ctaocrypt/tfm.h b/cyassl/ctaocrypt/tfm.h index 0b16b5189..903e07939 100644 --- a/cyassl/ctaocrypt/tfm.h +++ b/cyassl/ctaocrypt/tfm.h @@ -1,8 +1,8 @@ /* tfm.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com diff --git a/cyassl/ctaocrypt/types.h b/cyassl/ctaocrypt/types.h index 95bfb45e0..854e2df90 100644 --- a/cyassl/ctaocrypt/types.h +++ b/cyassl/ctaocrypt/types.h @@ -1,8 +1,8 @@ /* types.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_TYPES_H #define CTAO_CRYPT_TYPES_H diff --git a/cyassl/ctaocrypt/visibility.h b/cyassl/ctaocrypt/visibility.h index 6bb4953a3..4c9b2612d 100644 --- a/cyassl/ctaocrypt/visibility.h +++ b/cyassl/ctaocrypt/visibility.h @@ -1,8 +1,8 @@ /* visibility.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Visibility control macros */ #ifndef CTAO_CRYPT_VISIBILITY_H diff --git a/cyassl/ctaocrypt/wc_port.h b/cyassl/ctaocrypt/wc_port.h index f35a451ca..332c02cfa 100644 --- a/cyassl/ctaocrypt/wc_port.h +++ b/cyassl/ctaocrypt/wc_port.h @@ -1,8 +1,8 @@ /* port.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CTAO_CRYPT_PORT_H #define CTAO_CRYPT_PORT_H diff --git a/cyassl/error-ssl.h b/cyassl/error-ssl.h index 8eab84354..006bb774b 100644 --- a/cyassl/error-ssl.h +++ b/cyassl/error-ssl.h @@ -1,8 +1,8 @@ /* error-ssl.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include diff --git a/cyassl/internal.h b/cyassl/internal.h index c0ba722e8..a2c665482 100644 --- a/cyassl/internal.h +++ b/cyassl/internal.h @@ -1,8 +1,8 @@ /* internal.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include diff --git a/cyassl/ocsp.h b/cyassl/ocsp.h index 1ad9efe04..3741caa43 100644 --- a/cyassl/ocsp.h +++ b/cyassl/ocsp.h @@ -1,8 +1,8 @@ /* ocsp.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include diff --git a/cyassl/openssl/des.h b/cyassl/openssl/des.h index 0c8d55c11..2416cea27 100644 --- a/cyassl/openssl/des.h +++ b/cyassl/openssl/des.h @@ -1,8 +1,8 @@ /* des.h * - * Copyright (C) 2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* des.h defines mini des openssl compatibility layer * */ diff --git a/cyassl/openssl/evp.h b/cyassl/openssl/evp.h index a0715587c..54335170e 100644 --- a/cyassl/openssl/evp.h +++ b/cyassl/openssl/evp.h @@ -1,8 +1,8 @@ /* evp.h * - * Copyright (C) 2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* evp.h defines mini evp openssl compatibility layer * */ diff --git a/cyassl/openssl/hmac.h b/cyassl/openssl/hmac.h index f35fd7542..9de057682 100644 --- a/cyassl/openssl/hmac.h +++ b/cyassl/openssl/hmac.h @@ -1,8 +1,8 @@ /* hmac.h * - * Copyright (C) 2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* hmac.h defines mini hamc openssl compatibility layer * */ diff --git a/cyassl/openssl/ssl.h b/cyassl/openssl/ssl.h index ebf8dfa3b..bbaacd7f2 100644 --- a/cyassl/openssl/ssl.h +++ b/cyassl/openssl/ssl.h @@ -1,8 +1,8 @@ /* ssl.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,11 +15,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * a with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* ssl.h defines openssl compatibility layer * */ diff --git a/cyassl/options.h.in b/cyassl/options.h.in index 523be8c57..c3f8012ac 100644 --- a/cyassl/options.h.in +++ b/cyassl/options.h.in @@ -1,8 +1,8 @@ /* options.h.in * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* default blank options for autoconf */ #ifndef CYASSL_OPTIONS_H diff --git a/cyassl/sniffer.h b/cyassl/sniffer.h index 2ae674409..6de2d64c4 100644 --- a/cyassl/sniffer.h +++ b/cyassl/sniffer.h @@ -1,8 +1,8 @@ /* sniffer.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include diff --git a/cyassl/sniffer_error.h b/cyassl/sniffer_error.h index 8b3e00346..ae5f6f075 100644 --- a/cyassl/sniffer_error.h +++ b/cyassl/sniffer_error.h @@ -1,8 +1,8 @@ /* sniffer_error.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include diff --git a/cyassl/ssl.h b/cyassl/ssl.h index eadf29681..de7c1990a 100644 --- a/cyassl/ssl.h +++ b/cyassl/ssl.h @@ -1,8 +1,8 @@ /* ssl.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,10 +15,11 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * a with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* * ssl.h makes wolfssl backwards compatibile with cyassl */ diff --git a/cyassl/version.h b/cyassl/version.h index 79bcc1793..f0d119781 100644 --- a/cyassl/version.h +++ b/cyassl/version.h @@ -1,8 +1,8 @@ /* cyassl/version.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include #define LIBCYASSL_VERSION_STRING LIBWOLFSSL_VERSION_STRING diff --git a/cyassl/version.h.in b/cyassl/version.h.in index a999a9238..f94e815e5 100644 --- a/cyassl/version.h.in +++ b/cyassl/version.h.in @@ -1,8 +1,8 @@ /* cyassl_version.h.in * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #include diff --git a/examples/client/client.c b/examples/client/client.c index 08fdf9ad2..48d456149 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -1,8 +1,8 @@ /* client.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/examples/client/client.h b/examples/client/client.h index 5efefe993..6b5bd27e4 100644 --- a/examples/client/client.h +++ b/examples/client/client.h @@ -1,8 +1,8 @@ /* client.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_CLIENT_H #define WOLFSSL_CLIENT_H diff --git a/examples/echoclient/echoclient.c b/examples/echoclient/echoclient.c index 04bbf0374..27bcee4d6 100644 --- a/examples/echoclient/echoclient.c +++ b/examples/echoclient/echoclient.c @@ -1,8 +1,8 @@ /* echoclient.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/examples/echoclient/echoclient.h b/examples/echoclient/echoclient.h index 0498c69ed..113b80021 100644 --- a/examples/echoclient/echoclient.h +++ b/examples/echoclient/echoclient.h @@ -1,8 +1,8 @@ /* echoclient.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_ECHOCLIENT_H #define WOLFSSL_ECHOCLIENT_H diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index 76bf3e57a..751e53842 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -1,8 +1,8 @@ /* echoserver.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/examples/echoserver/echoserver.h b/examples/echoserver/echoserver.h index 6fc153564..f245eb09b 100644 --- a/examples/echoserver/echoserver.h +++ b/examples/echoserver/echoserver.h @@ -1,8 +1,8 @@ /* echoserver.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_ECHOSERVER_H #define WOLFSSL_ECHOSERVER_H diff --git a/examples/server/server.c b/examples/server/server.c index d4937d280..087dd8b28 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -1,8 +1,8 @@ /* server.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/examples/server/server.h b/examples/server/server.h index bfd6a14f1..fe37c36c5 100644 --- a/examples/server/server.h +++ b/examples/server/server.h @@ -1,8 +1,8 @@ /* server.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_SERVER_H #define WOLFSSL_SERVER_H diff --git a/mcapi/crypto.c b/mcapi/crypto.c index 4cb890c48..b73ff2772 100644 --- a/mcapi/crypto.c +++ b/mcapi/crypto.c @@ -1,8 +1,8 @@ /* crypto.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Implements Microchip CRYPTO API layer */ diff --git a/mcapi/crypto.h b/mcapi/crypto.h index 82b4d0249..5db03299d 100644 --- a/mcapi/crypto.h +++ b/mcapi/crypto.h @@ -1,8 +1,8 @@ /* crypto.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Defines Microchip CRYPTO API layer */ diff --git a/mcapi/mcapi_test.c b/mcapi/mcapi_test.c index b7bf06292..a34834d17 100644 --- a/mcapi/mcapi_test.c +++ b/mcapi/mcapi_test.c @@ -1,8 +1,8 @@ /* test.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Tests Microchip CRYPTO API layer */ diff --git a/mplabx/benchmark_main.c b/mplabx/benchmark_main.c index d25c8bf40..5c4c8651e 100644 --- a/mplabx/benchmark_main.c +++ b/mplabx/benchmark_main.c @@ -1,8 +1,8 @@ /* benchmark_main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/mplabx/test_main.c b/mplabx/test_main.c index 1ed008a3d..258200697 100644 --- a/mplabx/test_main.c +++ b/mplabx/test_main.c @@ -1,8 +1,8 @@ /* main.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/rpm/spec.in b/rpm/spec.in index 8fde26c02..c86ea6bf0 100644 --- a/rpm/spec.in +++ b/rpm/spec.in @@ -69,7 +69,7 @@ mkdir -p $RPM_BUILD_ROOT/ %{_libdir}/libwolfssl.la %{_libdir}/libwolfssl.so %{_libdir}/libwolfssl.so.3 -%{_libdir}/libwolfssl.so.3.1.0 +%{_libdir}/libwolfssl.so.3.2.0 %files devel %defattr(-,root,root,-) @@ -223,6 +223,7 @@ mkdir -p $RPM_BUILD_ROOT/ %{_includedir}/wolfssl/wolfcrypt/wc_encrypt.h %{_includedir}/wolfssl/error-ssl.h %{_includedir}/wolfssl/ocsp.h +%{_includedir}/wolfssl/mem_track.h %{_includedir}/wolfssl/openssl/asn1.h %{_includedir}/wolfssl/openssl/bio.h %{_includedir}/wolfssl/openssl/bn.h @@ -267,6 +268,8 @@ mkdir -p $RPM_BUILD_ROOT/ %{_libdir}/pkgconfig/wolfssl.pc %changelog +* Thu Mar 17 2016 Jacob Barthelmeh +- Added header for mem_track.h * Wed Dec 30 2015 Jacob Barthelmeh - Added headers for curve25519 and ed25519 openssl compatibility - Added headers for Idea, srp, signature, and wc_encrypt diff --git a/src/crl.c b/src/crl.c index 5cdfbb20a..6653110dc 100644 --- a/src/crl.c +++ b/src/crl.c @@ -1,8 +1,8 @@ /* crl.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Name change compatibility layer no longer needs included here */ #ifdef HAVE_CONFIG_H diff --git a/src/internal.c b/src/internal.c index c1fa85438..09ca058e9 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1,8 +1,8 @@ /* internal.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/src/io.c b/src/io.c index c710754ae..c971951f5 100644 --- a/src/io.c +++ b/src/io.c @@ -1,8 +1,8 @@ /* io.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/src/keys.c b/src/keys.c index f641a39df..4fe8ef68d 100644 --- a/src/keys.c +++ b/src/keys.c @@ -1,8 +1,8 @@ /* keys.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Name change compatibility layer no longer needs to be included here */ #ifdef HAVE_CONFIG_H diff --git a/src/ocsp.c b/src/ocsp.c index 5d5186fc4..dfc65ff0c 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -1,8 +1,8 @@ /* ocsp.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Name change compatibility layer no longer needs to be included here */ #ifdef HAVE_CONFIG_H diff --git a/src/sniffer.c b/src/sniffer.c index 9a680d4a9..3561781f4 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -1,8 +1,8 @@ /* sniffer.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/src/ssl.c b/src/ssl.c index 5e462e1c0..f6301eea9 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -1,8 +1,8 @@ /* ssl.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/src/tls.c b/src/tls.c index b66041f37..8294d2342 100644 --- a/src/tls.c +++ b/src/tls.c @@ -1,8 +1,8 @@ /* tls.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/sslSniffer/sslSnifferTest/snifftest.c b/sslSniffer/sslSnifferTest/snifftest.c index 04ceb5ed9..58881498a 100644 --- a/sslSniffer/sslSnifferTest/snifftest.c +++ b/sslSniffer/sslSnifferTest/snifftest.c @@ -1,8 +1,8 @@ /* snifftest.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/support/wolfssl.pc b/support/wolfssl.pc index 30e8eba24..a629a66a8 100644 --- a/support/wolfssl.pc +++ b/support/wolfssl.pc @@ -5,6 +5,6 @@ includedir=${prefix}/include Name: wolfssl Description: wolfssl C library. -Version: 3.8.1 +Version: 3.9.0 Libs: -L${libdir} -lwolfssl Cflags: -I${includedir} diff --git a/swig/wolfssl.i b/swig/wolfssl.i index ca1492269..d46134177 100644 --- a/swig/wolfssl.i +++ b/swig/wolfssl.i @@ -1,8 +1,8 @@ /* wolfssl.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + %module wolfssl %{ #include diff --git a/swig/wolfssl_adds.c b/swig/wolfssl_adds.c index 00267c926..2132efb0b 100644 --- a/swig/wolfssl_adds.c +++ b/swig/wolfssl_adds.c @@ -1,8 +1,8 @@ /* wolfssl_adds.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/tests/api.c b/tests/api.c index 59fcb4d51..36189efb2 100644 --- a/tests/api.c +++ b/tests/api.c @@ -1,8 +1,8 @@ /* api.c API unit tests * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /*----------------------------------------------------------------------------* | Includes *----------------------------------------------------------------------------*/ diff --git a/tests/hash.c b/tests/hash.c index e28a71a03..4cf19d8bb 100644 --- a/tests/hash.c +++ b/tests/hash.c @@ -1,8 +1,8 @@ /* hash.c has unit tests * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/tests/srp.c b/tests/srp.c index ac92bf9f8..3314a69b6 100644 --- a/tests/srp.c +++ b/tests/srp.c @@ -1,24 +1,25 @@ /* srp.c SRP unit tests * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify - * it under the terms of the GNU Geteral Public License as published by + * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * wolfSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Geteral Public License for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU Geteral Public License + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/tests/suites.c b/tests/suites.c index 365cf1704..a330c608d 100644 --- a/tests/suites.c +++ b/tests/suites.c @@ -1,8 +1,8 @@ /* suites.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/tests/unit.c b/tests/unit.c index 41ee8a1d4..c1b97c708 100644 --- a/tests/unit.c +++ b/tests/unit.c @@ -1,8 +1,8 @@ /* unit.c API unit tests driver * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Name change compatibility layer no longer need to be included here */ #ifdef HAVE_CONFIG_H diff --git a/tests/unit.h b/tests/unit.h index 1a038a21f..c28afe1d7 100644 --- a/tests/unit.h +++ b/tests/unit.h @@ -1,8 +1,8 @@ /* unit.c API unit tests driver * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef CyaSSL_UNIT_H #define CyaSSL_UNIT_H diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c index cb063d75c..4f9d1f17f 100644 --- a/testsuite/testsuite.c +++ b/testsuite/testsuite.c @@ -1,8 +1,8 @@ /* testsuite.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index ef39a28e8..f77976be9 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -1,8 +1,8 @@ /* benchmark.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* wolfCrypt benchmark */ diff --git a/wolfcrypt/benchmark/benchmark.h b/wolfcrypt/benchmark/benchmark.h index b916229d3..20feeb45d 100644 --- a/wolfcrypt/benchmark/benchmark.h +++ b/wolfcrypt/benchmark/benchmark.h @@ -1,8 +1,8 @@ /* wolfcrypt/benchmark/benchmark.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFCRYPT_BENCHMARK_H #define WOLFCRYPT_BENCHMARK_H diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 38565ec19..1c57f405b 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -1,8 +1,8 @@ /* aes.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/aes_asm.s b/wolfcrypt/src/aes_asm.s index 46f7e29e6..385a2d49a 100644 --- a/wolfcrypt/src/aes_asm.s +++ b/wolfcrypt/src/aes_asm.s @@ -1,8 +1,8 @@ /* aes_asm.s * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* This file is in at&t asm syntax, see .asm for intel syntax */ /* See Intel® Advanced Encryption Standard (AES) Instructions Set White Paper diff --git a/wolfcrypt/src/arc4.c b/wolfcrypt/src/arc4.c index 17c4a16c3..a30d11117 100644 --- a/wolfcrypt/src/arc4.c +++ b/wolfcrypt/src/arc4.c @@ -1,8 +1,8 @@ /* arc4.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c index 9f8458588..8976204c6 100644 --- a/wolfcrypt/src/asm.c +++ b/wolfcrypt/src/asm.c @@ -1,8 +1,8 @@ /* asm.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 79ed25d03..0c41eaa34 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -1,8 +1,8 @@ /* asn.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/blake2b.c b/wolfcrypt/src/blake2b.c index d0d6d7739..9b2d05fac 100644 --- a/wolfcrypt/src/blake2b.c +++ b/wolfcrypt/src/blake2b.c @@ -12,9 +12,9 @@ */ /* blake2b.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,10 +28,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/camellia.c b/wolfcrypt/src/camellia.c index fb8c4cead..7607875d3 100644 --- a/wolfcrypt/src/camellia.c +++ b/wolfcrypt/src/camellia.c @@ -27,9 +27,9 @@ /* camellia.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,9 +43,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* * Algorithm Specification * http://info.isl.ntt.co.jp/crypt/eng/camellia/specifications.html diff --git a/wolfcrypt/src/chacha.c b/wolfcrypt/src/chacha.c index 26972906b..44d9ea8f2 100644 --- a/wolfcrypt/src/chacha.c +++ b/wolfcrypt/src/chacha.c @@ -1,8 +1,8 @@ /* chacha.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA * * based from * chacha-ref.c version 20080118 @@ -25,6 +25,7 @@ */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/chacha20_poly1305.c b/wolfcrypt/src/chacha20_poly1305.c index 71bacbb88..d0da3c5fe 100644 --- a/wolfcrypt/src/chacha20_poly1305.c +++ b/wolfcrypt/src/chacha20_poly1305.c @@ -1,8 +1,8 @@ /* chacha.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/coding.c b/wolfcrypt/src/coding.c index 909866a2a..826e74c85 100644 --- a/wolfcrypt/src/coding.c +++ b/wolfcrypt/src/coding.c @@ -1,8 +1,8 @@ /* coding.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/compress.c b/wolfcrypt/src/compress.c index a01c071dc..0dd47a335 100644 --- a/wolfcrypt/src/compress.c +++ b/wolfcrypt/src/compress.c @@ -1,9 +1,9 @@ /* compress.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. + * + * This file is part of wolfSSL. * - * This file is part of wolfSSL. (formerly known as CyaSSL) - wc_* * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/curve25519.c b/wolfcrypt/src/curve25519.c index c49af3c5c..6fb359a4b 100644 --- a/wolfcrypt/src/curve25519.c +++ b/wolfcrypt/src/curve25519.c @@ -1,8 +1,8 @@ /* curve25519.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Based On Daniel J Bernstein's curve25519 Public Domain ref10 work. */ diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index b59aded36..1bf3f3d2f 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -1,8 +1,8 @@ /* des3.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/dh.c b/wolfcrypt/src/dh.c index 05f5fb4d8..8e9bbd184 100644 --- a/wolfcrypt/src/dh.c +++ b/wolfcrypt/src/dh.c @@ -1,8 +1,8 @@ /* dh.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/dsa.c b/wolfcrypt/src/dsa.c index 13d4c9bb9..a066705a2 100644 --- a/wolfcrypt/src/dsa.c +++ b/wolfcrypt/src/dsa.c @@ -1,8 +1,8 @@ /* dsa.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 5d1bf4bb2..b1b56372a 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -1,8 +1,8 @@ /* ecc.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/ed25519.c b/wolfcrypt/src/ed25519.c index 98d70e42d..b776566eb 100644 --- a/wolfcrypt/src/ed25519.c +++ b/wolfcrypt/src/ed25519.c @@ -1,8 +1,8 @@ /* ed25519.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Based On Daniel J Bernstein's ed25519 Public Domain ref10 work. */ #ifdef HAVE_CONFIG_H diff --git a/wolfcrypt/src/error.c b/wolfcrypt/src/error.c index f9c02690a..038f9b1d5 100644 --- a/wolfcrypt/src/error.c +++ b/wolfcrypt/src/error.c @@ -1,8 +1,8 @@ /* error.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/fe_low_mem.c b/wolfcrypt/src/fe_low_mem.c index a95c5a56a..373fd1cc5 100644 --- a/wolfcrypt/src/fe_low_mem.c +++ b/wolfcrypt/src/fe_low_mem.c @@ -1,8 +1,8 @@ /* fe_low_mem.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Based from Daniel Beer's public domain word. */ #ifdef HAVE_CONFIG_H diff --git a/wolfcrypt/src/fe_operations.c b/wolfcrypt/src/fe_operations.c index 0908a755c..636ef70f0 100644 --- a/wolfcrypt/src/fe_operations.c +++ b/wolfcrypt/src/fe_operations.c @@ -1,8 +1,8 @@ /* fe_operations.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Based On Daniel J Bernstein's curve25519 Public Domain ref10 work. */ #ifdef HAVE_CONFIG_H diff --git a/wolfcrypt/src/fp_mont_small.i b/wolfcrypt/src/fp_mont_small.i index c4a339b9b..46ac50f2a 100644 --- a/wolfcrypt/src/fp_mont_small.i +++ b/wolfcrypt/src/fp_mont_small.i @@ -1,8 +1,8 @@ /* fp_mont_small.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SMALL_MONT_SET /* computes x/R == x (mod N) via Montgomery Reduction */ void fp_montgomery_reduce_small(fp_int *a, fp_int *m, fp_digit mp) diff --git a/wolfcrypt/src/fp_mul_comba_12.i b/wolfcrypt/src/fp_mul_comba_12.i index b25ce5c4a..fe21a5294 100644 --- a/wolfcrypt/src/fp_mul_comba_12.i +++ b/wolfcrypt/src/fp_mul_comba_12.i @@ -1,8 +1,8 @@ /* fp_mul_comba_12.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL12 void fp_mul_comba12(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_17.i b/wolfcrypt/src/fp_mul_comba_17.i index fe12f0602..4ea109a5c 100644 --- a/wolfcrypt/src/fp_mul_comba_17.i +++ b/wolfcrypt/src/fp_mul_comba_17.i @@ -1,8 +1,8 @@ /* fp_mul_comba_17.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL17 void fp_mul_comba17(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_20.i b/wolfcrypt/src/fp_mul_comba_20.i index cd07e5dfd..11de0ff1f 100644 --- a/wolfcrypt/src/fp_mul_comba_20.i +++ b/wolfcrypt/src/fp_mul_comba_20.i @@ -1,8 +1,8 @@ /* fp_mul_comba_20.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL20 void fp_mul_comba20(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_24.i b/wolfcrypt/src/fp_mul_comba_24.i index 2576d27aa..02324c50b 100644 --- a/wolfcrypt/src/fp_mul_comba_24.i +++ b/wolfcrypt/src/fp_mul_comba_24.i @@ -1,8 +1,8 @@ /* fp_mul_comba_24.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL24 void fp_mul_comba24(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_28.i b/wolfcrypt/src/fp_mul_comba_28.i index 822dd14c7..fc12bde5f 100644 --- a/wolfcrypt/src/fp_mul_comba_28.i +++ b/wolfcrypt/src/fp_mul_comba_28.i @@ -1,8 +1,8 @@ /* fp_mul_comba_28.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL28 void fp_mul_comba28(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_3.i b/wolfcrypt/src/fp_mul_comba_3.i index 440291e38..9d2b0016f 100644 --- a/wolfcrypt/src/fp_mul_comba_3.i +++ b/wolfcrypt/src/fp_mul_comba_3.i @@ -1,8 +1,8 @@ /* fp_mul_comba_3.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL3 void fp_mul_comba3(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_32.i b/wolfcrypt/src/fp_mul_comba_32.i index 905028d17..0bd92aaa1 100644 --- a/wolfcrypt/src/fp_mul_comba_32.i +++ b/wolfcrypt/src/fp_mul_comba_32.i @@ -1,8 +1,8 @@ /* fp_mul_comba_32.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL32 void fp_mul_comba32(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_4.i b/wolfcrypt/src/fp_mul_comba_4.i index e981eb1f0..07a1e68ff 100644 --- a/wolfcrypt/src/fp_mul_comba_4.i +++ b/wolfcrypt/src/fp_mul_comba_4.i @@ -1,8 +1,8 @@ /* fp_mul_comba_4.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL4 void fp_mul_comba4(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_48.i b/wolfcrypt/src/fp_mul_comba_48.i index 79e43b8d0..9a4682ba8 100644 --- a/wolfcrypt/src/fp_mul_comba_48.i +++ b/wolfcrypt/src/fp_mul_comba_48.i @@ -1,8 +1,8 @@ /* fp_mul_comba_48.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL48 void fp_mul_comba48(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_6.i b/wolfcrypt/src/fp_mul_comba_6.i index 165c270b7..4daa55903 100644 --- a/wolfcrypt/src/fp_mul_comba_6.i +++ b/wolfcrypt/src/fp_mul_comba_6.i @@ -1,8 +1,8 @@ /* fp_mul_comba_6.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL6 void fp_mul_comba6(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_64.i b/wolfcrypt/src/fp_mul_comba_64.i index 76d7c2114..99a9a8159 100644 --- a/wolfcrypt/src/fp_mul_comba_64.i +++ b/wolfcrypt/src/fp_mul_comba_64.i @@ -1,8 +1,8 @@ /* fp_mul_comba_64.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL64 void fp_mul_comba64(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_7.i b/wolfcrypt/src/fp_mul_comba_7.i index eed886315..c03e22ee6 100644 --- a/wolfcrypt/src/fp_mul_comba_7.i +++ b/wolfcrypt/src/fp_mul_comba_7.i @@ -1,8 +1,8 @@ /* fp_mul_comba_7.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL7 void fp_mul_comba7(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_8.i b/wolfcrypt/src/fp_mul_comba_8.i index fa578a839..829424d7d 100644 --- a/wolfcrypt/src/fp_mul_comba_8.i +++ b/wolfcrypt/src/fp_mul_comba_8.i @@ -1,8 +1,8 @@ /* fp_mul_comba_8.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL8 void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_9.i b/wolfcrypt/src/fp_mul_comba_9.i index 755067f86..d9adf67c4 100644 --- a/wolfcrypt/src/fp_mul_comba_9.i +++ b/wolfcrypt/src/fp_mul_comba_9.i @@ -1,8 +1,8 @@ /* fp_mul_comba_9.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_MUL9 void fp_mul_comba9(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_mul_comba_small_set.i b/wolfcrypt/src/fp_mul_comba_small_set.i index deea5932c..8c5cb3225 100644 --- a/wolfcrypt/src/fp_mul_comba_small_set.i +++ b/wolfcrypt/src/fp_mul_comba_small_set.i @@ -1,8 +1,8 @@ /* fp_mul_comba_small_set.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #if defined(TFM_SMALL_SET) void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C) { diff --git a/wolfcrypt/src/fp_sqr_comba_12.i b/wolfcrypt/src/fp_sqr_comba_12.i index 078b8986d..a39de8358 100644 --- a/wolfcrypt/src/fp_sqr_comba_12.i +++ b/wolfcrypt/src/fp_sqr_comba_12.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_12.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR12 void fp_sqr_comba12(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_17.i b/wolfcrypt/src/fp_sqr_comba_17.i index d5f4674fb..d75bfe034 100644 --- a/wolfcrypt/src/fp_sqr_comba_17.i +++ b/wolfcrypt/src/fp_sqr_comba_17.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_17.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR17 void fp_sqr_comba17(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_20.i b/wolfcrypt/src/fp_sqr_comba_20.i index dcd9f318f..05c895a73 100644 --- a/wolfcrypt/src/fp_sqr_comba_20.i +++ b/wolfcrypt/src/fp_sqr_comba_20.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_20.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR20 void fp_sqr_comba20(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_24.i b/wolfcrypt/src/fp_sqr_comba_24.i index cf512e3c3..bb512e472 100644 --- a/wolfcrypt/src/fp_sqr_comba_24.i +++ b/wolfcrypt/src/fp_sqr_comba_24.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_24.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR24 void fp_sqr_comba24(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_28.i b/wolfcrypt/src/fp_sqr_comba_28.i index 08e9bc4d5..e38104d87 100644 --- a/wolfcrypt/src/fp_sqr_comba_28.i +++ b/wolfcrypt/src/fp_sqr_comba_28.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_28.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR28 void fp_sqr_comba28(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_3.i b/wolfcrypt/src/fp_sqr_comba_3.i index b4754093d..dd838ac4a 100644 --- a/wolfcrypt/src/fp_sqr_comba_3.i +++ b/wolfcrypt/src/fp_sqr_comba_3.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_3.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR3 void fp_sqr_comba3(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_32.i b/wolfcrypt/src/fp_sqr_comba_32.i index 4a35d7477..205d81c94 100644 --- a/wolfcrypt/src/fp_sqr_comba_32.i +++ b/wolfcrypt/src/fp_sqr_comba_32.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_32.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR32 void fp_sqr_comba32(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_4.i b/wolfcrypt/src/fp_sqr_comba_4.i index bb09dc891..9d8956685 100644 --- a/wolfcrypt/src/fp_sqr_comba_4.i +++ b/wolfcrypt/src/fp_sqr_comba_4.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_4.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR4 void fp_sqr_comba4(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_48.i b/wolfcrypt/src/fp_sqr_comba_48.i index cbaac02cc..be4fde7cf 100644 --- a/wolfcrypt/src/fp_sqr_comba_48.i +++ b/wolfcrypt/src/fp_sqr_comba_48.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_48.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR48 void fp_sqr_comba48(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_6.i b/wolfcrypt/src/fp_sqr_comba_6.i index bb2fd743e..a1cdcd52d 100644 --- a/wolfcrypt/src/fp_sqr_comba_6.i +++ b/wolfcrypt/src/fp_sqr_comba_6.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_6.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR6 void fp_sqr_comba6(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_64.i b/wolfcrypt/src/fp_sqr_comba_64.i index b74367a7c..a119ebefc 100644 --- a/wolfcrypt/src/fp_sqr_comba_64.i +++ b/wolfcrypt/src/fp_sqr_comba_64.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_64.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR64 void fp_sqr_comba64(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_7.i b/wolfcrypt/src/fp_sqr_comba_7.i index 8ddef1a9b..89686a208 100644 --- a/wolfcrypt/src/fp_sqr_comba_7.i +++ b/wolfcrypt/src/fp_sqr_comba_7.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_7.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR7 void fp_sqr_comba7(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_8.i b/wolfcrypt/src/fp_sqr_comba_8.i index f9a72bcf6..f64156503 100644 --- a/wolfcrypt/src/fp_sqr_comba_8.i +++ b/wolfcrypt/src/fp_sqr_comba_8.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_8.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR8 void fp_sqr_comba8(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_9.i b/wolfcrypt/src/fp_sqr_comba_9.i index 94a5d2e92..75bb72ba6 100644 --- a/wolfcrypt/src/fp_sqr_comba_9.i +++ b/wolfcrypt/src/fp_sqr_comba_9.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_9.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef TFM_SQR9 void fp_sqr_comba9(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/fp_sqr_comba_small_set.i b/wolfcrypt/src/fp_sqr_comba_small_set.i index 9918b2ee8..e9cd60883 100644 --- a/wolfcrypt/src/fp_sqr_comba_small_set.i +++ b/wolfcrypt/src/fp_sqr_comba_small_set.i @@ -1,8 +1,8 @@ /* fp_sqr_comba_small_set.i * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #if defined(TFM_SMALL_SET) void fp_sqr_comba_small(fp_int *A, fp_int *B) { diff --git a/wolfcrypt/src/ge_low_mem.c b/wolfcrypt/src/ge_low_mem.c index 65ee07f30..4f809103b 100644 --- a/wolfcrypt/src/ge_low_mem.c +++ b/wolfcrypt/src/ge_low_mem.c @@ -1,8 +1,8 @@ /* ge_low_mem.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Based from Daniel Beer's public domain work. */ #ifdef HAVE_CONFIG_H diff --git a/wolfcrypt/src/ge_operations.c b/wolfcrypt/src/ge_operations.c index c17cb7259..fe9c7280b 100644 --- a/wolfcrypt/src/ge_operations.c +++ b/wolfcrypt/src/ge_operations.c @@ -1,8 +1,8 @@ /* ge_operations.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Based On Daniel J Bernstein's ed25519 Public Domain ref10 work. */ diff --git a/wolfcrypt/src/hash.c b/wolfcrypt/src/hash.c index 5469580ee..9f7740228 100644 --- a/wolfcrypt/src/hash.c +++ b/wolfcrypt/src/hash.c @@ -1,8 +1,8 @@ /* hash.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/hc128.c b/wolfcrypt/src/hc128.c index bcfa148e0..54d832de0 100644 --- a/wolfcrypt/src/hc128.c +++ b/wolfcrypt/src/hc128.c @@ -1,8 +1,8 @@ /* hc128.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/hmac.c b/wolfcrypt/src/hmac.c index 8aa17b54b..b1e696ce2 100644 --- a/wolfcrypt/src/hmac.c +++ b/wolfcrypt/src/hmac.c @@ -1,8 +1,8 @@ /* hmac.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/idea.c b/wolfcrypt/src/idea.c index 99ca42bbc..730ee4da1 100644 --- a/wolfcrypt/src/idea.c +++ b/wolfcrypt/src/idea.c @@ -1,8 +1,8 @@ /* idea.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/integer.c b/wolfcrypt/src/integer.c index bde65343c..9e9b3d01e 100644 --- a/wolfcrypt/src/integer.c +++ b/wolfcrypt/src/integer.c @@ -1,8 +1,8 @@ /* integer.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* * Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com diff --git a/wolfcrypt/src/logging.c b/wolfcrypt/src/logging.c index 2fe66dc3b..4351f7209 100644 --- a/wolfcrypt/src/logging.c +++ b/wolfcrypt/src/logging.c @@ -1,8 +1,8 @@ /* logging.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/md2.c b/wolfcrypt/src/md2.c index ce4e424b7..094a1199c 100644 --- a/wolfcrypt/src/md2.c +++ b/wolfcrypt/src/md2.c @@ -1,8 +1,8 @@ /* md2.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/md4.c b/wolfcrypt/src/md4.c index c428610ef..54fd4ebb1 100644 --- a/wolfcrypt/src/md4.c +++ b/wolfcrypt/src/md4.c @@ -1,8 +1,8 @@ /* md4.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/md5.c b/wolfcrypt/src/md5.c index 5d1339a8f..1143e86b0 100644 --- a/wolfcrypt/src/md5.c +++ b/wolfcrypt/src/md5.c @@ -1,8 +1,8 @@ /* md5.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/memory.c b/wolfcrypt/src/memory.c index dd9281945..663da8d41 100644 --- a/wolfcrypt/src/memory.c +++ b/wolfcrypt/src/memory.c @@ -1,8 +1,8 @@ /* memory.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index 8a79a4c29..bc2cefd76 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -1,8 +1,8 @@ /* misc.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 00c213416..721ec21f3 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -1,8 +1,8 @@ /* pkcs7.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/poly1305.c b/wolfcrypt/src/poly1305.c index 72af2bda6..8725fb01f 100644 --- a/wolfcrypt/src/poly1305.c +++ b/wolfcrypt/src/poly1305.c @@ -1,8 +1,8 @@ /* poly1305.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - * - * Based off the public domain implementations by Andrew Moon + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +/* + * Based off the public domain implementations by Andrew Moon * and Daniel J. Bernstein */ diff --git a/wolfcrypt/src/port/nrf51.c b/wolfcrypt/src/port/nrf51.c index eaae360b2..1d51c268b 100644 --- a/wolfcrypt/src/port/nrf51.c +++ b/wolfcrypt/src/port/nrf51.c @@ -1,8 +1,8 @@ /* nrf51.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/port/pic32/pic32mz-hash.c b/wolfcrypt/src/port/pic32/pic32mz-hash.c index c2dbfcd43..ccc0c757c 100644 --- a/wolfcrypt/src/port/pic32/pic32mz-hash.c +++ b/wolfcrypt/src/port/pic32/pic32mz-hash.c @@ -1,8 +1,8 @@ /* pic32mz-hash.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/port/ti/ti-aes.c b/wolfcrypt/src/port/ti/ti-aes.c index 857f9c4d7..c0ab7b4b8 100644 --- a/wolfcrypt/src/port/ti/ti-aes.c +++ b/wolfcrypt/src/port/ti/ti-aes.c @@ -1,8 +1,8 @@ /* port/ti/ti-aes.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include diff --git a/wolfcrypt/src/port/ti/ti-ccm.c b/wolfcrypt/src/port/ti/ti-ccm.c index 65a51350e..42b20930a 100644 --- a/wolfcrypt/src/port/ti/ti-ccm.c +++ b/wolfcrypt/src/port/ti/ti-ccm.c @@ -1,8 +1,8 @@ /* port/ti/ti_ccm.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/port/ti/ti-des3.c b/wolfcrypt/src/port/ti/ti-des3.c index 2927a1b89..177cd1ba1 100644 --- a/wolfcrypt/src/port/ti/ti-des3.c +++ b/wolfcrypt/src/port/ti/ti-des3.c @@ -1,8 +1,8 @@ /* port/ti/ti-des.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/port/ti/ti-hash.c b/wolfcrypt/src/port/ti/ti-hash.c index 56526af86..7ca795b91 100644 --- a/wolfcrypt/src/port/ti/ti-hash.c +++ b/wolfcrypt/src/port/ti/ti-hash.c @@ -1,8 +1,8 @@ /* port/ti/ti-hash.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index b9764d8d0..5efd21fc8 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -1,8 +1,8 @@ /* pwdbased.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/rabbit.c b/wolfcrypt/src/rabbit.c index fc7861115..dc2c9b7b0 100644 --- a/wolfcrypt/src/rabbit.c +++ b/wolfcrypt/src/rabbit.c @@ -1,8 +1,8 @@ /* rabbit.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 904dab67e..c349458be 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -1,8 +1,8 @@ /* random.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/ripemd.c b/wolfcrypt/src/ripemd.c index 639a42d07..1ec17d5cf 100644 --- a/wolfcrypt/src/ripemd.c +++ b/wolfcrypt/src/ripemd.c @@ -1,8 +1,8 @@ /* ripemd.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index c1cd2f7a7..0232af6f2 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -1,8 +1,8 @@ /* rsa.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index bde6376c8..b0d8dd9dc 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -1,8 +1,8 @@ /* sha.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 2cdad7d88..ad862caa0 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -1,8 +1,8 @@ /* sha256.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* code submitted by raphael.huck@efixo.com */ #ifdef HAVE_CONFIG_H diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index acd07c40c..9b0649fa6 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -1,8 +1,8 @@ /* sha512.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/signature.c b/wolfcrypt/src/signature.c index b3c57142b..46e8ff238 100644 --- a/wolfcrypt/src/signature.c +++ b/wolfcrypt/src/signature.c @@ -1,8 +1,8 @@ /* signature.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/srp.c b/wolfcrypt/src/srp.c index ad21cf854..415cad38e 100644 --- a/wolfcrypt/src/srp.c +++ b/wolfcrypt/src/srp.c @@ -1,8 +1,8 @@ /* srp.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index a0d3ec830..4ee88bddc 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -1,8 +1,8 @@ /* tfm.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com diff --git a/wolfcrypt/src/wc_encrypt.c b/wolfcrypt/src/wc_encrypt.c index 4fde7daf2..dc4e4c1b3 100644 --- a/wolfcrypt/src/wc_encrypt.c +++ b/wolfcrypt/src/wc_encrypt.c @@ -1,8 +1,8 @@ /* wc_encrypt.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 1a97c31af..9f8e2f7b9 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -1,8 +1,8 @@ /* port.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 13f83435f..59abdaa1e 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -1,8 +1,8 @@ /* test.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfcrypt/test/test.h b/wolfcrypt/test/test.h index 53f299454..47d8b74c2 100644 --- a/wolfcrypt/test/test.h +++ b/wolfcrypt/test/test.h @@ -1,8 +1,8 @@ /* wolfcrypt/test/test.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFCRYPT_TEST_H #define WOLFCRYPT_TEST_H diff --git a/wolfcrypt/user-crypto/README.txt b/wolfcrypt/user-crypto/README.txt index 50bc8b709..76e7c8c5b 100644 --- a/wolfcrypt/user-crypto/README.txt +++ b/wolfcrypt/user-crypto/README.txt @@ -1,7 +1,7 @@ /* - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,9 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Created to use intel's IPP see their license for linking to intel's IPP library */ diff --git a/wolfcrypt/user-crypto/include/user_rsa.h b/wolfcrypt/user-crypto/include/user_rsa.h index 21b7b7a31..fbf9430fe 100644 --- a/wolfcrypt/user-crypto/include/user_rsa.h +++ b/wolfcrypt/user-crypto/include/user_rsa.h @@ -1,8 +1,8 @@ /* user_rsa.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Created to use intel's IPP see their license for linking to intel's IPP library */ diff --git a/wolfcrypt/user-crypto/src/rsa.c b/wolfcrypt/user-crypto/src/rsa.c index ed7ef57a8..a3df104a3 100644 --- a/wolfcrypt/user-crypto/src/rsa.c +++ b/wolfcrypt/user-crypto/src/rsa.c @@ -1,8 +1,8 @@ /* rsa.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H /* configure options when using autoconf */ #include #endif diff --git a/wolfssl/callbacks.h b/wolfssl/callbacks.h index 0e85d32b0..23681db76 100644 --- a/wolfssl/callbacks.h +++ b/wolfssl/callbacks.h @@ -1,8 +1,8 @@ /* callbacks.h * - * Copyright (C) 2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_CALLBACKS_H #define WOLFSSL_CALLBACKS_H diff --git a/wolfssl/crl.h b/wolfssl/crl.h index 05c039aa3..982842384 100644 --- a/wolfssl/crl.h +++ b/wolfssl/crl.h @@ -1,8 +1,8 @@ /* crl.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_CRL_H #define WOLFSSL_CRL_H diff --git a/wolfssl/error-ssl.h b/wolfssl/error-ssl.h index 577103f73..620ccc58a 100644 --- a/wolfssl/error-ssl.h +++ b/wolfssl/error-ssl.h @@ -1,8 +1,8 @@ /* error-ssl.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_ERROR_H #define WOLFSSL_ERROR_H diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 1bdad174d..3646b18fd 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1,8 +1,8 @@ /* internal.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as wolfSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_INT_H #define WOLFSSL_INT_H diff --git a/wolfssl/mem_track.h b/wolfssl/mem_track.h index 210c42d59..1a6fa794b 100644 --- a/wolfssl/mem_track.h +++ b/wolfssl/mem_track.h @@ -1,8 +1,8 @@ /* mem_track.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_MEM_TRACK_H #define WOLFSSL_MEM_TRACK_H diff --git a/wolfssl/ocsp.h b/wolfssl/ocsp.h index 2a2442446..af083410b 100644 --- a/wolfssl/ocsp.h +++ b/wolfssl/ocsp.h @@ -1,8 +1,8 @@ /* ocsp.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* wolfSSL OCSP API */ #ifndef WOLFSSL_OCSP_H diff --git a/wolfssl/openssl/des.h b/wolfssl/openssl/des.h index f5b4f2a84..e8c2ac42b 100644 --- a/wolfssl/openssl/des.h +++ b/wolfssl/openssl/des.h @@ -1,8 +1,8 @@ /* des.h * - * Copyright (C) 2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as wolfSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* des.h defines mini des openssl compatibility layer * */ diff --git a/wolfssl/openssl/evp.h b/wolfssl/openssl/evp.h index 6ea1443e5..f972d2594 100644 --- a/wolfssl/openssl/evp.h +++ b/wolfssl/openssl/evp.h @@ -1,8 +1,8 @@ /* evp.h * - * Copyright (C) 2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* evp.h defines mini evp openssl compatibility layer * */ diff --git a/wolfssl/openssl/hmac.h b/wolfssl/openssl/hmac.h index 0dca8cb2b..76d2481bf 100644 --- a/wolfssl/openssl/hmac.h +++ b/wolfssl/openssl/hmac.h @@ -1,8 +1,8 @@ /* hmac.h * - * Copyright (C) 2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* hmac.h defines mini hamc openssl compatibility layer * */ diff --git a/wolfssl/openssl/ssl.h b/wolfssl/openssl/ssl.h index 27fec0890..f9bf3f03e 100644 --- a/wolfssl/openssl/ssl.h +++ b/wolfssl/openssl/ssl.h @@ -1,8 +1,8 @@ /* ssl.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,11 +15,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * a with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* ssl.h defines wolfssl_openssl compatibility layer * */ diff --git a/wolfssl/options.h.in b/wolfssl/options.h.in index 2043cbbf7..19d1fcec9 100644 --- a/wolfssl/options.h.in +++ b/wolfssl/options.h.in @@ -1,8 +1,8 @@ /* options.h.in * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* default blank options for autoconf */ #ifndef WOLFSSL_OPTIONS_H diff --git a/wolfssl/sniffer.h b/wolfssl/sniffer.h index 6b8ae02ee..57d144fa6 100644 --- a/wolfssl/sniffer.h +++ b/wolfssl/sniffer.h @@ -1,8 +1,8 @@ /* sniffer.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_SNIFFER_H #define WOLFSSL_SNIFFER_H diff --git a/wolfssl/sniffer_error.h b/wolfssl/sniffer_error.h index ee953a255..327455ec2 100644 --- a/wolfssl/sniffer_error.h +++ b/wolfssl/sniffer_error.h @@ -1,8 +1,8 @@ /* sniffer_error.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_SNIFFER_ERROR_H #define WOLFSSL_SNIFFER_ERROR_H diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index ea9ba0801..6208cfc35 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1,8 +1,8 @@ /* ssl.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* wolfSSL API */ #ifndef WOLFSSL_SSL_H diff --git a/wolfssl/version.h b/wolfssl/version.h index d349140b5..8f6cac71b 100644 --- a/wolfssl/version.h +++ b/wolfssl/version.h @@ -1,8 +1,8 @@ /* wolfssl_version.h.in * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_VERSION_H #define WOLFSSL_VERSION_H @@ -27,8 +28,8 @@ extern "C" { #endif -#define LIBWOLFSSL_VERSION_STRING "3.8.1" -#define LIBWOLFSSL_VERSION_HEX 0x03008001 +#define LIBWOLFSSL_VERSION_STRING "3.9.0" +#define LIBWOLFSSL_VERSION_HEX 0x03009000 #ifdef __cplusplus } diff --git a/wolfssl/version.h.in b/wolfssl/version.h.in index cc3c5e30f..ecd801388 100644 --- a/wolfssl/version.h.in +++ b/wolfssl/version.h.in @@ -1,8 +1,8 @@ /* wolfssl_version.h.in * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_VERSION_H #define WOLFSSL_VERSION_H diff --git a/wolfssl/wolfcrypt/aes.h b/wolfssl/wolfcrypt/aes.h index af149861c..1e1a061c5 100644 --- a/wolfssl/wolfcrypt/aes.h +++ b/wolfssl/wolfcrypt/aes.h @@ -1,8 +1,8 @@ /* aes.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_AES_H #define WOLF_CRYPT_AES_H diff --git a/wolfssl/wolfcrypt/arc4.h b/wolfssl/wolfcrypt/arc4.h index 727b62759..a97430632 100644 --- a/wolfssl/wolfcrypt/arc4.h +++ b/wolfssl/wolfcrypt/arc4.h @@ -1,8 +1,8 @@ /* arc4.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_ARC4_H #define WOLF_CRYPT_ARC4_H diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index c7a4e340b..995ea3a66 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -1,8 +1,8 @@ /* asn.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_ASN_H #define WOLF_CRYPT_ASN_H diff --git a/wolfssl/wolfcrypt/asn_public.h b/wolfssl/wolfcrypt/asn_public.h index f450e4784..4fdaf7005 100644 --- a/wolfssl/wolfcrypt/asn_public.h +++ b/wolfssl/wolfcrypt/asn_public.h @@ -1,8 +1,8 @@ /* asn_public.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_ASN_PUBLIC_H #define WOLF_CRYPT_ASN_PUBLIC_H diff --git a/wolfssl/wolfcrypt/blake2-impl.h b/wolfssl/wolfcrypt/blake2-impl.h index 0e82bd389..3830c33fc 100644 --- a/wolfssl/wolfcrypt/blake2-impl.h +++ b/wolfssl/wolfcrypt/blake2-impl.h @@ -12,9 +12,9 @@ */ /* blake2-impl.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,10 +28,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFCRYPT_BLAKE2_IMPL_H #define WOLFCRYPT_BLAKE2_IMPL_H diff --git a/wolfssl/wolfcrypt/blake2-int.h b/wolfssl/wolfcrypt/blake2-int.h index 26a2c87b4..0d62eaf52 100644 --- a/wolfssl/wolfcrypt/blake2-int.h +++ b/wolfssl/wolfcrypt/blake2-int.h @@ -12,9 +12,9 @@ */ /* blake2-int.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,11 +28,12 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFCRYPT_BLAKE2_INT_H #define WOLFCRYPT_BLAKE2_INT_H diff --git a/wolfssl/wolfcrypt/blake2.h b/wolfssl/wolfcrypt/blake2.h index 51866639a..ccad86cfb 100644 --- a/wolfssl/wolfcrypt/blake2.h +++ b/wolfssl/wolfcrypt/blake2.h @@ -1,8 +1,8 @@ /* blake2.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,12 +15,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * a with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_BLAKE2_H #define WOLF_CRYPT_BLAKE2_H diff --git a/wolfssl/wolfcrypt/camellia.h b/wolfssl/wolfcrypt/camellia.h index 4b7b92af3..923d5a940 100644 --- a/wolfssl/wolfcrypt/camellia.h +++ b/wolfssl/wolfcrypt/camellia.h @@ -27,9 +27,9 @@ /* camellia.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,9 +43,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_CAMELLIA_H #define WOLF_CRYPT_CAMELLIA_H diff --git a/wolfssl/wolfcrypt/chacha.h b/wolfssl/wolfcrypt/chacha.h index da938c973..4f08bcc21 100644 --- a/wolfssl/wolfcrypt/chacha.h +++ b/wolfssl/wolfcrypt/chacha.h @@ -1,8 +1,8 @@ /* chacha.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_CHACHA_H #define WOLF_CRYPT_CHACHA_H diff --git a/wolfssl/wolfcrypt/chacha20_poly1305.h b/wolfssl/wolfcrypt/chacha20_poly1305.h index e65842bfa..47df00426 100644 --- a/wolfssl/wolfcrypt/chacha20_poly1305.h +++ b/wolfssl/wolfcrypt/chacha20_poly1305.h @@ -1,8 +1,8 @@ /* chacha20_poly1305.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* This implementation of the ChaCha20-Poly1305 AEAD is based on "ChaCha20 * and Poly1305 for IETF protocols" (draft-irtf-cfrg-chacha20-poly1305-10): * https://tools.ietf.org/html/draft-irtf-cfrg-chacha20-poly1305-10 diff --git a/wolfssl/wolfcrypt/coding.h b/wolfssl/wolfcrypt/coding.h index cd180e72a..5395cc2f4 100644 --- a/wolfssl/wolfcrypt/coding.h +++ b/wolfssl/wolfcrypt/coding.h @@ -1,8 +1,8 @@ /* coding.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_CODING_H #define WOLF_CRYPT_CODING_H diff --git a/wolfssl/wolfcrypt/compress.h b/wolfssl/wolfcrypt/compress.h index dc012b865..27ead357f 100644 --- a/wolfssl/wolfcrypt/compress.h +++ b/wolfssl/wolfcrypt/compress.h @@ -1,8 +1,8 @@ /* compress.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_COMPRESS_H #define WOLF_CRYPT_COMPRESS_H diff --git a/wolfssl/wolfcrypt/curve25519.h b/wolfssl/wolfcrypt/curve25519.h index cb1dad032..d775877bf 100644 --- a/wolfssl/wolfcrypt/curve25519.h +++ b/wolfssl/wolfcrypt/curve25519.h @@ -1,8 +1,8 @@ /* curve25519.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_CURVE25519_H #define WOLF_CRYPT_CURVE25519_H diff --git a/wolfssl/wolfcrypt/des3.h b/wolfssl/wolfcrypt/des3.h index 4506e3dae..370b52d44 100644 --- a/wolfssl/wolfcrypt/des3.h +++ b/wolfssl/wolfcrypt/des3.h @@ -1,8 +1,8 @@ /* des3.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_DES3_H #define WOLF_CRYPT_DES3_H diff --git a/wolfssl/wolfcrypt/dh.h b/wolfssl/wolfcrypt/dh.h index a116eab7c..6ac7be65e 100644 --- a/wolfssl/wolfcrypt/dh.h +++ b/wolfssl/wolfcrypt/dh.h @@ -1,8 +1,8 @@ /* dh.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_DH_H #define WOLF_CRYPT_DH_H diff --git a/wolfssl/wolfcrypt/dsa.h b/wolfssl/wolfcrypt/dsa.h index 1d26a3d69..1b56367ce 100644 --- a/wolfssl/wolfcrypt/dsa.h +++ b/wolfssl/wolfcrypt/dsa.h @@ -1,8 +1,8 @@ /* dsa.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_DSA_H #define WOLF_CRYPT_DSA_H diff --git a/wolfssl/wolfcrypt/ecc.h b/wolfssl/wolfcrypt/ecc.h index 9fe4a89f0..b952e68b9 100644 --- a/wolfssl/wolfcrypt/ecc.h +++ b/wolfssl/wolfcrypt/ecc.h @@ -1,8 +1,8 @@ /* ecc.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_ECC_H #define WOLF_CRYPT_ECC_H diff --git a/wolfssl/wolfcrypt/ed25519.h b/wolfssl/wolfcrypt/ed25519.h index 606ff4145..103a06599 100644 --- a/wolfssl/wolfcrypt/ed25519.h +++ b/wolfssl/wolfcrypt/ed25519.h @@ -1,8 +1,8 @@ /* ed25519.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_ED25519_H #define WOLF_CRYPT_ED25519_H diff --git a/wolfssl/wolfcrypt/error-crypt.h b/wolfssl/wolfcrypt/error-crypt.h index b7a3c89ac..4a4d62baa 100644 --- a/wolfssl/wolfcrypt/error-crypt.h +++ b/wolfssl/wolfcrypt/error-crypt.h @@ -1,8 +1,8 @@ /* error-crypt.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_ERROR_H #define WOLF_CRYPT_ERROR_H diff --git a/wolfssl/wolfcrypt/fe_operations.h b/wolfssl/wolfcrypt/fe_operations.h index 52b79d842..1d0a801ef 100644 --- a/wolfssl/wolfcrypt/fe_operations.h +++ b/wolfssl/wolfcrypt/fe_operations.h @@ -1,8 +1,8 @@ /* fe_operations.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_FE_OPERATIONS_H #define WOLF_CRYPT_FE_OPERATIONS_H diff --git a/wolfssl/wolfcrypt/fips_test.h b/wolfssl/wolfcrypt/fips_test.h index 6ef06788f..5b3a2c1f9 100644 --- a/wolfssl/wolfcrypt/fips_test.h +++ b/wolfssl/wolfcrypt/fips_test.h @@ -1,8 +1,8 @@ /* fips_test.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_FIPS_TEST_H #define WOLF_CRYPT_FIPS_TEST_H diff --git a/wolfssl/wolfcrypt/ge_operations.h b/wolfssl/wolfcrypt/ge_operations.h index 00d1b3edc..c079b36b8 100644 --- a/wolfssl/wolfcrypt/ge_operations.h +++ b/wolfssl/wolfcrypt/ge_operations.h @@ -1,8 +1,8 @@ /* ge_operations.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Based On Daniel J Bernstein's ed25519 Public Domain ref10 work. */ #ifndef WOLF_CRYPT_GE_OPERATIONS_H diff --git a/wolfssl/wolfcrypt/hash.h b/wolfssl/wolfcrypt/hash.h index 2c9acec3a..467e3a50d 100644 --- a/wolfssl/wolfcrypt/hash.h +++ b/wolfssl/wolfcrypt/hash.h @@ -1,8 +1,8 @@ /* hash.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_HASH_H #define WOLF_CRYPT_HASH_H diff --git a/wolfssl/wolfcrypt/hc128.h b/wolfssl/wolfcrypt/hc128.h index ba53dd3d5..609228ad0 100644 --- a/wolfssl/wolfcrypt/hc128.h +++ b/wolfssl/wolfcrypt/hc128.h @@ -1,8 +1,8 @@ /* hc128.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_HC128_H #define WOLF_CRYPT_HC128_H diff --git a/wolfssl/wolfcrypt/hmac.h b/wolfssl/wolfcrypt/hmac.h index 2be5afcee..b80a48786 100644 --- a/wolfssl/wolfcrypt/hmac.h +++ b/wolfssl/wolfcrypt/hmac.h @@ -1,8 +1,8 @@ /* hmac.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef NO_HMAC #ifndef WOLF_CRYPT_HMAC_H diff --git a/wolfssl/wolfcrypt/idea.h b/wolfssl/wolfcrypt/idea.h index 7fcd2c051..de6ad767a 100644 --- a/wolfssl/wolfcrypt/idea.h +++ b/wolfssl/wolfcrypt/idea.h @@ -1,8 +1,8 @@ /* idea.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_IDEA_H #define WOLF_CRYPT_IDEA_H diff --git a/wolfssl/wolfcrypt/integer.h b/wolfssl/wolfcrypt/integer.h index a765f3dec..a0ca3c15e 100644 --- a/wolfssl/wolfcrypt/integer.h +++ b/wolfssl/wolfcrypt/integer.h @@ -1,8 +1,8 @@ /* integer.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* * Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com diff --git a/wolfssl/wolfcrypt/logging.h b/wolfssl/wolfcrypt/logging.h index 03681412d..29bf0abea 100644 --- a/wolfssl/wolfcrypt/logging.h +++ b/wolfssl/wolfcrypt/logging.h @@ -1,8 +1,8 @@ /* logging.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* submitted by eof */ diff --git a/wolfssl/wolfcrypt/md2.h b/wolfssl/wolfcrypt/md2.h index d494078b2..a86995e9c 100644 --- a/wolfssl/wolfcrypt/md2.h +++ b/wolfssl/wolfcrypt/md2.h @@ -1,8 +1,8 @@ /* md2.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_MD2_H #define WOLF_CRYPT_MD2_H diff --git a/wolfssl/wolfcrypt/md4.h b/wolfssl/wolfcrypt/md4.h index 369e15bc8..7b2688ec4 100644 --- a/wolfssl/wolfcrypt/md4.h +++ b/wolfssl/wolfcrypt/md4.h @@ -1,8 +1,8 @@ /* md4.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_MD4_H #define WOLF_CRYPT_MD4_H diff --git a/wolfssl/wolfcrypt/md5.h b/wolfssl/wolfcrypt/md5.h index 4f4e6f9da..bed0b984c 100644 --- a/wolfssl/wolfcrypt/md5.h +++ b/wolfssl/wolfcrypt/md5.h @@ -1,8 +1,8 @@ /* md5.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_MD5_H #define WOLF_CRYPT_MD5_H diff --git a/wolfssl/wolfcrypt/memory.h b/wolfssl/wolfcrypt/memory.h index 3968b3527..30d5c1626 100644 --- a/wolfssl/wolfcrypt/memory.h +++ b/wolfssl/wolfcrypt/memory.h @@ -1,8 +1,8 @@ /* memory.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* submitted by eof */ diff --git a/wolfssl/wolfcrypt/misc.h b/wolfssl/wolfcrypt/misc.h index 78c7fbdc9..959b2d87f 100644 --- a/wolfssl/wolfcrypt/misc.h +++ b/wolfssl/wolfcrypt/misc.h @@ -1,8 +1,8 @@ /* misc.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_MISC_H #define WOLF_CRYPT_MISC_H diff --git a/wolfssl/wolfcrypt/mpi_class.h b/wolfssl/wolfcrypt/mpi_class.h index 334a7a4db..32b95f1f3 100644 --- a/wolfssl/wolfcrypt/mpi_class.h +++ b/wolfssl/wolfcrypt/mpi_class.h @@ -1,8 +1,8 @@ /* mpi_class.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #if !(defined(LTM1) && defined(LTM2) && defined(LTM3)) #if defined(LTM2) #define LTM3 diff --git a/wolfssl/wolfcrypt/mpi_superclass.h b/wolfssl/wolfcrypt/mpi_superclass.h index 7475b6200..aa09bed63 100644 --- a/wolfssl/wolfcrypt/mpi_superclass.h +++ b/wolfssl/wolfcrypt/mpi_superclass.h @@ -1,8 +1,8 @@ /* mpi_superclass.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* super class file for PK algos */ /* default ... include all MPI */ diff --git a/wolfssl/wolfcrypt/pkcs7.h b/wolfssl/wolfcrypt/pkcs7.h index 32a46faf2..e5634df12 100644 --- a/wolfssl/wolfcrypt/pkcs7.h +++ b/wolfssl/wolfcrypt/pkcs7.h @@ -1,8 +1,8 @@ /* pkcs7.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_PKCS7_H #define WOLF_CRYPT_PKCS7_H diff --git a/wolfssl/wolfcrypt/poly1305.h b/wolfssl/wolfcrypt/poly1305.h index 55369cb4a..e64cabf94 100644 --- a/wolfssl/wolfcrypt/poly1305.h +++ b/wolfssl/wolfcrypt/poly1305.h @@ -1,8 +1,8 @@ /* poly1305.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_POLY1305_H #define WOLF_CRYPT_POLY1305_H diff --git a/wolfssl/wolfcrypt/port/nrf51.h b/wolfssl/wolfcrypt/port/nrf51.h index 53b6927c2..ca085fad6 100644 --- a/wolfssl/wolfcrypt/port/nrf51.h +++ b/wolfssl/wolfcrypt/port/nrf51.h @@ -1,8 +1,8 @@ /* nrf51.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLFSSL_NRF51_PORT_H #define WOLFSSL_NRF51_PORT_H diff --git a/wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h b/wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h index 85ad8b037..f8105d703 100644 --- a/wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h +++ b/wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h @@ -1,8 +1,8 @@ /* pic32mz-crypt.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef PIC32MZ_CRYPT_H #define PIC32MZ_CRYPT_H diff --git a/wolfssl/wolfcrypt/port/ti/ti-ccm.h b/wolfssl/wolfcrypt/port/ti/ti-ccm.h index 8e75e0d3e..30ab108ac 100644 --- a/wolfssl/wolfcrypt/port/ti/ti-ccm.h +++ b/wolfssl/wolfcrypt/port/ti/ti-ccm.h @@ -1,8 +1,8 @@ /* port/ti/ti_ccm.c * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ #ifndef WOLF_CRYPT_TI_CCM_H diff --git a/wolfssl/wolfcrypt/port/ti/ti-hash.h b/wolfssl/wolfcrypt/port/ti/ti-hash.h index 505ccc498..c63a2ce20 100644 --- a/wolfssl/wolfcrypt/port/ti/ti-hash.h +++ b/wolfssl/wolfcrypt/port/ti/ti-hash.h @@ -1,8 +1,8 @@ /* port/ti/ti-hash.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_TI_HASH_H #define WOLF_CRYPT_TI_HASH_H diff --git a/wolfssl/wolfcrypt/pwdbased.h b/wolfssl/wolfcrypt/pwdbased.h index f4d47ca58..b9cfa01df 100644 --- a/wolfssl/wolfcrypt/pwdbased.h +++ b/wolfssl/wolfcrypt/pwdbased.h @@ -1,8 +1,8 @@ /* pwdbased.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_PWDBASED_H #define WOLF_CRYPT_PWDBASED_H diff --git a/wolfssl/wolfcrypt/rabbit.h b/wolfssl/wolfcrypt/rabbit.h index ea5ae7308..50ebeebf6 100644 --- a/wolfssl/wolfcrypt/rabbit.h +++ b/wolfssl/wolfcrypt/rabbit.h @@ -1,8 +1,8 @@ /* rabbit.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_RABBIT_H #define WOLF_CRYPT_RABBIT_H diff --git a/wolfssl/wolfcrypt/random.h b/wolfssl/wolfcrypt/random.h index 96ddf11cd..cfcc671a2 100644 --- a/wolfssl/wolfcrypt/random.h +++ b/wolfssl/wolfcrypt/random.h @@ -1,8 +1,8 @@ /* random.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_RANDOM_H #define WOLF_CRYPT_RANDOM_H diff --git a/wolfssl/wolfcrypt/ripemd.h b/wolfssl/wolfcrypt/ripemd.h index a76b64d8a..5845d594c 100644 --- a/wolfssl/wolfcrypt/ripemd.h +++ b/wolfssl/wolfcrypt/ripemd.h @@ -1,8 +1,8 @@ /* ripemd.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_RIPEMD_H #define WOLF_CRYPT_RIPEMD_H diff --git a/wolfssl/wolfcrypt/rsa.h b/wolfssl/wolfcrypt/rsa.h index 6d9f504a5..e3d8261ff 100644 --- a/wolfssl/wolfcrypt/rsa.h +++ b/wolfssl/wolfcrypt/rsa.h @@ -1,8 +1,8 @@ /* rsa.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_RSA_H #define WOLF_CRYPT_RSA_H diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index a24579cb7..1d1632148 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -1,8 +1,8 @@ /* settings.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Place OS specific preprocessor flags, defines, includes here, will be included into every file because types.h includes it */ diff --git a/wolfssl/wolfcrypt/sha.h b/wolfssl/wolfcrypt/sha.h index 4d6bb99ed..c65b0e52c 100644 --- a/wolfssl/wolfcrypt/sha.h +++ b/wolfssl/wolfcrypt/sha.h @@ -1,8 +1,8 @@ /* sha.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_SHA_H #define WOLF_CRYPT_SHA_H diff --git a/wolfssl/wolfcrypt/sha256.h b/wolfssl/wolfcrypt/sha256.h index 5ee13a7a7..93b515ee3 100644 --- a/wolfssl/wolfcrypt/sha256.h +++ b/wolfssl/wolfcrypt/sha256.h @@ -1,8 +1,8 @@ /* sha256.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* code submitted by raphael.huck@efixo.com */ #ifndef WOLF_CRYPT_SHA256_H diff --git a/wolfssl/wolfcrypt/sha512.h b/wolfssl/wolfcrypt/sha512.h index 455d83854..7869c6f15 100644 --- a/wolfssl/wolfcrypt/sha512.h +++ b/wolfssl/wolfcrypt/sha512.h @@ -1,8 +1,8 @@ /* sha512.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_SHA512_H #define WOLF_CRYPT_SHA512_H diff --git a/wolfssl/wolfcrypt/signature.h b/wolfssl/wolfcrypt/signature.h index 411ae2eb3..da5c061b8 100644 --- a/wolfssl/wolfcrypt/signature.h +++ b/wolfssl/wolfcrypt/signature.h @@ -1,8 +1,8 @@ /* signature.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_SIGNATURE_H #define WOLF_CRYPT_SIGNATURE_H diff --git a/wolfssl/wolfcrypt/srp.h b/wolfssl/wolfcrypt/srp.h index 0e61e72a8..e761e51f5 100644 --- a/wolfssl/wolfcrypt/srp.h +++ b/wolfssl/wolfcrypt/srp.h @@ -1,8 +1,8 @@ /* srp.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef WOLFCRYPT_HAVE_SRP #ifndef WOLFCRYPT_SRP_H diff --git a/wolfssl/wolfcrypt/tfm.h b/wolfssl/wolfcrypt/tfm.h index f714bcfbe..c0e05e4ae 100644 --- a/wolfssl/wolfcrypt/tfm.h +++ b/wolfssl/wolfcrypt/tfm.h @@ -1,8 +1,8 @@ /* tfm.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 13911d9f8..af30c926e 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -1,8 +1,8 @@ /* types.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_TYPES_H #define WOLF_CRYPT_TYPES_H diff --git a/wolfssl/wolfcrypt/visibility.h b/wolfssl/wolfcrypt/visibility.h index 6e41d238f..82f110f55 100644 --- a/wolfssl/wolfcrypt/visibility.h +++ b/wolfssl/wolfcrypt/visibility.h @@ -1,8 +1,8 @@ /* visibility.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + /* Visibility control macros */ #ifndef WOLF_CRYPT_VISIBILITY_H diff --git a/wolfssl/wolfcrypt/wc_encrypt.h b/wolfssl/wolfcrypt/wc_encrypt.h index f5425a03a..4cbc9f428 100644 --- a/wolfssl/wolfcrypt/wc_encrypt.h +++ b/wolfssl/wolfcrypt/wc_encrypt.h @@ -1,8 +1,8 @@ /* wc_encrypt.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_ENCRYPT_H #define WOLF_CRYPT_ENCRYPT_H diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index 221108a72..c68ec15df 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -1,8 +1,8 @@ /* wc_port.h * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifndef WOLF_CRYPT_PORT_H #define WOLF_CRYPT_PORT_H diff --git a/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.cs b/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.cs index 89603ff2f..35f4ea615 100644 --- a/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.cs +++ b/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.cs @@ -1,8 +1,8 @@ /* wolfSSL-DTLS-PSK-Server.cs * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ using System; diff --git a/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.cs b/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.cs index 246d73f93..cb4e62406 100644 --- a/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.cs +++ b/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.cs @@ -1,8 +1,8 @@ /* wolfSSL-DTLS-Server.cs * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ using System; diff --git a/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.cs b/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.cs index f770a8514..c0435a657 100644 --- a/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.cs +++ b/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.cs @@ -1,4 +1,25 @@ -using System; +/* wolfSSL-Example-IOCallbacks.cs + * + * Copyright (C) 2006-2016 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.cs b/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.cs index 4c603b9c7..e6481b20b 100644 --- a/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.cs +++ b/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.cs @@ -1,8 +1,8 @@ /* wolfSSL-TLS-PSK-Server.cs * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ using System; diff --git a/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs b/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs index 8a629f3f1..73c432fcd 100644 --- a/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs +++ b/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs @@ -1,8 +1,8 @@ /* wolfSSL-TLS-Server.cs * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ using System; diff --git a/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs b/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs index 60f35afb3..5b3b46e2c 100644 --- a/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs +++ b/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs @@ -1,8 +1,8 @@ /* wolfSSL.cs * - * Copyright (C) 2006-2015 wolfSSL Inc. + * Copyright (C) 2006-2016 wolfSSL Inc. * - * This file is part of wolfSSL. (formerly known as CyaSSL) + * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ using System; From 369930238ae99f7dded8072ca50c7ad00fbc0ad3 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 17 Mar 2016 15:31:45 -0700 Subject: [PATCH 063/192] Cleanup of the ecc_test functions to break areas into separate functions providing WC_RNG and key size. Added ECC tests by key size for all enabled curves. Added actual key size on wc_ecc_make_key for the NIST test vectors. Added ECC testing of wc_ecc_verify_hash with digests having 0's and sequence (1,2,3,...) and made sure it runs verify twice. --- wolfcrypt/test/test.c | 625 ++++++++++++++++++++++++------------------ 1 file changed, 357 insertions(+), 268 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 13f83435f..5d6da8056 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -6217,15 +6217,16 @@ int hkdf_test(void) #ifdef HAVE_ECC -#ifndef HAVE_ECC_VECTOR_TEST -#if defined(HAVE_ECC192) || defined(HAVE_ECC224) || !defined(NO_ECC256) || \ - defined(HAVE_ECC384) || defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES) - #define HAVE_ECC_VECTOR_TEST -#endif +#ifndef NO_ECC_VECTOR_TEST + #if (defined(HAVE_ECC192) || defined(HAVE_ECC224) ||\ + !defined(NO_ECC256) || defined(HAVE_ECC384) ||\ + defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES)) + #define HAVE_ECC_VECTOR_TEST + #endif #endif #ifdef HAVE_ECC_VECTOR_TEST -typedef struct rawEccVector { +typedef struct eccVector { const char* msg; /* SHA-1 Encoded Message */ const char* Qx; const char* Qy; @@ -6233,22 +6234,31 @@ typedef struct rawEccVector { const char* R; const char* S; const char* curveName; - size_t msgLen; -} rawEccVector; + word32 msgLen; + word32 keySize; +} eccVector; -static int ecc_test_raw_vector(const rawEccVector* vector, ecc_key* userA, - byte* sig, word32 sigSz) +static int ecc_test_vector_item(const eccVector* vector, WC_RNG* rng) { int ret, verify; word32 x; + ecc_key userA; + byte sig[1024]; - wc_ecc_free(userA); - wc_ecc_init(userA); + wc_ecc_init(&userA); - memset(sig, 0, sigSz); - x = sigSz; + ret = wc_ecc_make_key(rng, vector->keySize, &userA); + if (ret != 0) + return -1014; - ret = wc_ecc_import_raw(userA, vector->Qx, vector->Qy, + ret = wc_ecc_check_key(&userA); + if (ret != 0) + return -1024; + + memset(sig, 0, sizeof(sig)); + x = sizeof(sig); + + ret = wc_ecc_import_raw(&userA, vector->Qx, vector->Qy, vector->d, vector->curveName); if (ret != 0) return -1018; @@ -6257,28 +6267,240 @@ static int ecc_test_raw_vector(const rawEccVector* vector, ecc_key* userA, if (ret != 0) return -1019; - ret = wc_ecc_verify_hash(sig, x, (byte*)vector->msg, (word32)vector->msgLen, &verify, userA); + ret = wc_ecc_verify_hash(sig, x, (byte*)vector->msg, vector->msgLen, &verify, &userA); if (ret != 0) return -1021; if (verify != 1) return -1023; + wc_ecc_free(&userA); + return 0; } + +static int ecc_test_vector(WC_RNG* rng, int keySize) +{ + int ret; + eccVector vec; + + XMEMSET(&vec, 0, sizeof(vec)); + vec.keySize = keySize; + + switch(keySize) { +#if defined(HAVE_ECC192) || defined(HAVE_ALL_CURVES) + case 24: + /* first [P-192,SHA-1] vector from FIPS 186-3 NIST vectors */ + #if 1 + vec.msg = "\x60\x80\x79\x42\x3f\x12\x42\x1d\xe6\x16\xb7\x49\x3e\xbe\x55\x1c\xf4\xd6\x5b\x92"; + vec.msgLen = 20; + #else + /* This is the raw message prior to SHA-1 */ + vec.msg = + "\xeb\xf7\x48\xd7\x48\xeb\xbc\xa7\xd2\x9f\xb4\x73\x69\x8a\x6e\x6b" + "\x4f\xb1\x0c\x86\x5d\x4a\xf0\x24\xcc\x39\xae\x3d\xf3\x46\x4b\xa4" + "\xf1\xd6\xd4\x0f\x32\xbf\x96\x18\xa9\x1b\xb5\x98\x6f\xa1\xa2\xaf" + "\x04\x8a\x0e\x14\xdc\x51\xe5\x26\x7e\xb0\x5e\x12\x7d\x68\x9d\x0a" + "\xc6\xf1\xa7\xf1\x56\xce\x06\x63\x16\xb9\x71\xcc\x7a\x11\xd0\xfd" + "\x7a\x20\x93\xe2\x7c\xf2\xd0\x87\x27\xa4\xe6\x74\x8c\xc3\x2f\xd5" + "\x9c\x78\x10\xc5\xb9\x01\x9d\xf2\x1c\xdc\xc0\xbc\xa4\x32\xc0\xa3" + "\xee\xd0\x78\x53\x87\x50\x88\x77\x11\x43\x59\xce\xe4\xa0\x71\xcf"; + vec.msgLen = 128; + #endif + vec.Qx = "07008ea40b08dbe76432096e80a2494c94982d2d5bcf98e6"; + vec.Qy = "76fab681d00b414ea636ba215de26d98c41bd7f2e4d65477"; + vec.d = "e14f37b3d1374ff8b03f41b9b3fdd2f0ebccf275d660d7f3"; + vec.R = "6994d962bdd0d793ffddf855ec5bf2f91a9698b46258a63e"; + vec.S = "02ba6465a234903744ab02bc8521405b73cf5fc00e1a9f41"; + vec.curveName = "ECC-192"; + break; +#endif /* HAVE_ECC192 */ + +#if defined(HAVE_ECC224) || defined(HAVE_ALL_CURVES) + case 28: + /* first [P-224,SHA-1] vector from FIPS 186-3 NIST vectors */ + #if 1 + vec.msg = "\xb9\xa3\xb8\x6d\xb0\xba\x99\xfd\xc6\xd2\x94\x6b\xfe\xbe\x9c\xe8\x3f\x10\x74\xfc"; + vec.msgLen = 20; + #else + /* This is the raw message prior to SHA-1 */ + vec.msg = + "\x36\xc8\xb2\x29\x86\x48\x7f\x67\x7c\x18\xd0\x97\x2a\x9e\x20\x47" + "\xb3\xaf\xa5\x9e\xc1\x62\x76\x4e\xc3\x0b\x5b\x69\xe0\x63\x0f\x99" + "\x0d\x4e\x05\xc2\x73\xb0\xe5\xa9\xd4\x28\x27\xb6\x95\xfc\x2d\x64" + "\xd9\x13\x8b\x1c\xf4\xc1\x21\x55\x89\x4c\x42\x13\x21\xa7\xbb\x97" + "\x0b\xdc\xe0\xfb\xf0\xd2\xae\x85\x61\xaa\xd8\x71\x7f\x2e\x46\xdf" + "\xe3\xff\x8d\xea\xb4\xd7\x93\x23\x56\x03\x2c\x15\x13\x0d\x59\x9e" + "\x26\xc1\x0f\x2f\xec\x96\x30\x31\xac\x69\x38\xa1\x8d\x66\x45\x38" + "\xb9\x4d\xac\x55\x34\xef\x7b\x59\x94\x24\xd6\x9b\xe1\xf7\x1c\x20"; + vec.msgLen = 128; + #endif + vec.Qx = "8a4dca35136c4b70e588e23554637ae251077d1365a6ba5db9585de7"; + vec.Qy = "ad3dee06de0be8279d4af435d7245f14f3b4f82eb578e519ee0057b1"; + vec.d = "97c4b796e1639dd1035b708fc00dc7ba1682cec44a1002a1a820619f"; + vec.R = "147b33758321e722a0360a4719738af848449e2c1d08defebc1671a7"; + vec.S = "24fc7ed7f1352ca3872aa0916191289e2e04d454935d50fe6af3ad5b"; + vec.curveName = "ECC-224"; + break; +#endif /* HAVE_ECC224 */ + +#if !defined(NO_ECC256) || defined(HAVE_ALL_CURVES) + case 32: + /* first [P-256,SHA-1] vector from FIPS 186-3 NIST vectors */ + #if 1 + vec.msg = "\xa3\xf9\x1a\xe2\x1b\xa6\xb3\x03\x98\x64\x47\x2f\x18\x41\x44\xc6\xaf\x62\xcd\x0e"; + vec.msgLen = 20; + #else + /* This is the raw message prior to SHA-1 */ + vec.msg = + "\xa2\x4b\x21\x76\x2e\x6e\xdb\x15\x3c\xc1\x14\x38\xdb\x0e\x92\xcd" + "\xf5\x2b\x86\xb0\x6c\xa9\x70\x16\x06\x27\x59\xc7\x0d\x36\xd1\x56" + "\x2c\xc9\x63\x0d\x7f\xc7\xc7\x74\xb2\x8b\x54\xe3\x1e\xf5\x58\x72" + "\xb2\xa6\x5d\xf1\xd7\xec\x26\xde\xbb\x33\xe7\xd9\x27\xef\xcc\xf4" + "\x6b\x63\xde\x52\xa4\xf4\x31\xea\xca\x59\xb0\x5d\x2e\xde\xc4\x84" + "\x5f\xff\xc0\xee\x15\x03\x94\xd6\x1f\x3d\xfe\xcb\xcd\xbf\x6f\x5a" + "\x73\x38\xd0\xbe\x3f\x2a\x77\x34\x51\x98\x3e\xba\xeb\x48\xf6\x73" + "\x8f\xc8\x95\xdf\x35\x7e\x1a\x48\xa6\x53\xbb\x35\x5a\x31\xa1\xb4" + vec.msgLen = 128; + #endif + vec.Qx = "fa2737fb93488d19caef11ae7faf6b7f4bcd67b286e3fc54e8a65c2b74aeccb0"; + vec.Qy = "d4ccd6dae698208aa8c3a6f39e45510d03be09b2f124bfc067856c324f9b4d09"; + vec.d = "be34baa8d040a3b991f9075b56ba292f755b90e4b6dc10dad36715c33cfdac25"; + vec.R = "2b826f5d44e2d0b6de531ad96b51e8f0c56fdfead3c236892e4d84eacfc3b75c"; + vec.S = "a2248b62c03db35a7cd63e8a120a3521a89d3d2f61ff99035a2148ae32e3a248"; + vec.curveName = "nistp256"; + break; +#endif /* !NO_ECC256 */ + +#if defined(HAVE_ECC384) || defined(HAVE_ALL_CURVES) + case 48: + /* first [P-384,SHA-1] vector from FIPS 186-3 NIST vectors */ + #if 1 + vec.msg = "\x9b\x9f\x8c\x95\x35\xa5\xca\x26\x60\x5d\xb7\xf2\xfa\x57\x3b\xdf\xc3\x2e\xab\x8b"; + vec.msgLen = 20; + #else + /* This is the raw message prior to SHA-1 */ + vec.msg = + "\xab\xe1\x0a\xce\x13\xe7\xe1\xd9\x18\x6c\x48\xf7\x88\x9d\x51\x47" + "\x3d\x3a\x09\x61\x98\x4b\xc8\x72\xdf\x70\x8e\xcc\x3e\xd3\xb8\x16" + "\x9d\x01\xe3\xd9\x6f\xc4\xf1\xd5\xea\x00\xa0\x36\x92\xbc\xc5\xcf" + "\xfd\x53\x78\x7c\x88\xb9\x34\xaf\x40\x4c\x03\x9d\x32\x89\xb5\xba" + "\xc5\xae\x7d\xb1\x49\x68\x75\xb5\xdc\x73\xc3\x09\xf9\x25\xc1\x3d" + "\x1c\x01\xab\xda\xaf\xeb\xcd\xac\x2c\xee\x43\x39\x39\xce\x8d\x4a" + "\x0a\x5d\x57\xbb\x70\x5f\x3b\xf6\xec\x08\x47\x95\x11\xd4\xb4\xa3" + "\x21\x1f\x61\x64\x9a\xd6\x27\x43\x14\xbf\x0d\x43\x8a\x81\xe0\x60" + vec.msgLen = 128; + #endif + vec.Qx = "e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef868"; + vec.Qy = "28f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e"; + vec.d = "a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71"; + vec.R = "6820b8585204648aed63bdff47f6d9acebdea62944774a7d14f0e14aa0b9a5b99545b2daee6b3c74ebf606667a3f39b7"; + vec.S = "491af1d0cccd56ddd520b233775d0bc6b40a6255cc55207d8e9356741f23c96c14714221078dbd5c17f4fdd89b32a907"; + vec.curveName = "nistp384"; + break; +#endif /* HAVE_ECC384 */ + +#if defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES) + case 66: + /* first [P-521,SHA-1] vector from FIPS 186-3 NIST vectors */ + #if 1 + vec.msg = "\x1b\xf7\x03\x9c\xca\x23\x94\x27\x3f\x11\xa1\xd4\x8d\xcc\xb4\x46\x6f\x31\x61\xdf"; + vec.msgLen = 20; + #else + /* This is the raw message prior to SHA-1 */ + vec.msg = + "\x50\x3f\x79\x39\x34\x0a\xc7\x23\xcd\x4a\x2f\x4e\x6c\xcc\x27\x33" + "\x38\x3a\xca\x2f\xba\x90\x02\x19\x9d\x9e\x1f\x94\x8b\xe0\x41\x21" + "\x07\xa3\xfd\xd5\x14\xd9\x0c\xd4\xf3\x7c\xc3\xac\x62\xef\x00\x3a" + "\x2d\xb1\xd9\x65\x7a\xb7\x7f\xe7\x55\xbf\x71\xfa\x59\xe4\xd9\x6e" + "\xa7\x2a\xe7\xbf\x9d\xe8\x7d\x79\x34\x3b\xc1\xa4\xbb\x14\x4d\x16" + "\x28\xd1\xe9\xe9\xc8\xed\x80\x8b\x96\x2c\x54\xe5\xf9\x6d\x53\xda" + "\x14\x7a\x96\x38\xf9\x4a\x91\x75\xd8\xed\x61\x05\x5f\x0b\xa5\x73" + "\xa8\x2b\xb7\xe0\x18\xee\xda\xc4\xea\x7b\x36\x2e\xc8\x9c\x38\x2b" + vec.msgLen = 128; + #endif + vec.Qx = "12fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23"; + vec.Qy = "09cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d"; + vec.d = "1bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74"; + vec.R = "0bd117b4807710898f9dd7778056485777668f0e78e6ddf5b000356121eb7a220e9493c7f9a57c077947f89ac45d5acb6661bbcd17abb3faea149ba0aa3bb1521be"; + vec.S = "019cd2c5c3f9870ecdeb9b323abdf3a98cd5e231d85c6ddc5b71ab190739f7f226e6b134ba1d5889ddeb2751dabd97911dff90c34684cdbe7bb669b6c3d22f2480c"; + vec.curveName = "nistp521"; + break; +#endif /* HAVE_ECC521 */ + default: + return NOT_COMPILED_IN; /* Invalid key size / Not supported */ + }; /* Switch */ + + ret = ecc_test_vector_item(&vec, rng); + if (ret < 0) { + return ret; + } + + return 0; +} + #endif /* HAVE_ECC_VECTOR_TEST */ -#undef ECC_TEST_KEY_SIZE -#define ECC_TEST_KEY_SIZE 32 -#define ECC_TEST_VERIFY_COUNT 1 -#ifdef FP_ECC - #undef ECC_TEST_VERIFY_COUNT - #define ECC_TEST_VERIFY_COUNT 2 - #define ECC_TEST_VERIFY_ZERO -#endif -int ecc_test(void) +#ifdef WOLFSSL_KEY_GEN +static int ecc_test_key_gen(WC_RNG* rng, int keySize) +{ + int ret; + int derSz, pemSz; + byte der[FOURK_BUF]; + byte pem[FOURK_BUF]; + FILE* keyFile; + FILE* pemFile; + + ecc_key userA; + + wc_ecc_init(&userA); + + ret = wc_ecc_make_key(rng, keySize, &userA); + if (ret != 0) + return -1014; + + ret = wc_ecc_check_key(&userA); + if (ret != 0) + return -1024; + + derSz = wc_EccKeyToDer(&userA, der, FOURK_BUF); + if (derSz < 0) { + return -1024; + } + + keyFile = fopen("./ecc-key.der", "wb"); + if (!keyFile) { + return -1025; + } + ret = (int)fwrite(der, 1, derSz, keyFile); + fclose(keyFile); + if (ret != derSz) { + return -1026; + } + + pemSz = wc_DerToPem(der, derSz, pem, FOURK_BUF, ECC_PRIVATEKEY_TYPE); + if (pemSz < 0) { + return -1027; + } + + pemFile = fopen("./ecc-key.pem", "wb"); + if (!pemFile) { + return -1028; + } + ret = (int)fwrite(pem, 1, pemSz, pemFile); + fclose(pemFile); + if (ret != pemSz) { + return -1029; + } + + wc_ecc_free(&userA); + + return 0; +} +#endif /* WOLFSSL_KEY_GEN */ + +static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount) { - WC_RNG rng; #ifdef BENCH_EMBEDDED byte sharedA[32]; byte sharedB[32]; @@ -6288,23 +6510,10 @@ int ecc_test(void) #endif #ifdef HAVE_ECC_KEY_EXPORT byte exportBuf[1024]; -#elif !defined(NO_ECC256) - /* Export is used to test import, so if export is not enabled, - use this pre-defined value (P-256 Only) */ - const byte exportBuf[] = { - 0x04, 0xb6, 0x1f, 0xf9, 0x71, 0xe3, 0x5b, 0x8d, 0xa7, 0xad, 0x9c, 0xd8, - 0x8f, 0x25, 0x09, 0xe7, 0x3f, 0x91, 0x10, 0xe5, 0x4e, 0x84, 0x5d, 0xee, - 0xe8, 0xc6, 0x9c, 0xd9, 0x84, 0x8e, 0xd9, 0x85, 0x0d, 0x73, 0x7f, 0x6e, - 0x63, 0x9a, 0x74, 0xe0, 0x1b, 0x6c, 0x55, 0x2f, 0xdd, 0xc6, 0x16, 0x72, - 0x52, 0x75, 0x6c, 0x12, 0x77, 0x38, 0x56, 0xf2, 0x20, 0xef, 0xe5, 0x76, - 0x59, 0x0d, 0x97, 0xd9, 0x94, - }; #endif word32 x, y; -#if defined(HAVE_ECC_VECTOR_TEST) || defined(HAVE_ECC_SIGN) +#ifdef HAVE_ECC_SIGN byte sig[1024]; -#endif /* HAVE_ECC_VECTOR_TEST || HAVE_ECC_SIGN */ -#if defined(HAVE_ECC_SIGN) byte digest[20]; int i; #ifdef HAVE_ECC_VERIFY @@ -6314,15 +6523,11 @@ int ecc_test(void) int ret; ecc_key userA, userB, pubKey; - ret = wc_InitRng(&rng); - if (ret != 0) - return -1001; - wc_ecc_init(&userA); wc_ecc_init(&userB); wc_ecc_init(&pubKey); - ret = wc_ecc_make_key(&rng, ECC_TEST_KEY_SIZE, &userA); + ret = wc_ecc_make_key(rng, keySize, &userA); if (ret != 0) return -1014; @@ -6330,7 +6535,7 @@ int ecc_test(void) if (ret != 0) return -1024; - ret = wc_ecc_make_key(&rng, ECC_TEST_KEY_SIZE, &userB); + ret = wc_ecc_make_key(rng, keySize, &userB); if (ret != 0) return -1002; @@ -6352,21 +6557,19 @@ int ecc_test(void) return -1005; #endif /* HAVE_ECC_DHE */ -#if defined(HAVE_ECC_KEY_EXPORT) || (defined(HAVE_ECC_KEY_IMPORT) && !defined(NO_ECC256)) - x = sizeof(exportBuf); #ifdef HAVE_ECC_KEY_EXPORT + x = sizeof(exportBuf); + ret = wc_ecc_export_x963(&userA, exportBuf, &x); if (ret != 0) return -1006; -#endif /* HAVE_ECC_KEY_EXPORT */ -#if defined(HAVE_ECC_KEY_IMPORT) && (defined(HAVE_ECC_KEY_EXPORT) || !defined(NO_ECC256)) +#ifdef HAVE_ECC_KEY_IMPORT ret = wc_ecc_import_x963(exportBuf, x, &pubKey); if (ret != 0) return -1007; -#endif -#if defined(HAVE_ECC_DHE) && defined(HAVE_ECC_KEY_IMPORT) && defined(HAVE_ECC_KEY_EXPORT) +#ifdef HAVE_ECC_DHE y = sizeof(sharedB); ret = wc_ecc_shared_secret(&userB, &pubKey, sharedB, &y); if (ret != 0) @@ -6375,25 +6578,22 @@ int ecc_test(void) if (memcmp(sharedA, sharedB, y)) return -1009; #endif /* HAVE_ECC_DHE */ -#endif #ifdef HAVE_COMP_KEY /* try compressed export / import too */ x = sizeof(exportBuf); -#ifdef HAVE_ECC_KEY_EXPORT + ret = wc_ecc_export_x963_ex(&userA, exportBuf, &x, 1); if (ret != 0) return -1010; wc_ecc_free(&pubKey); wc_ecc_init(&pubKey); -#ifdef HAVE_ECC_KEY_IMPORT + ret = wc_ecc_import_x963(exportBuf, x, &pubKey); if (ret != 0) return -1011; -#endif /* HAVE_ECC_KEY_IMPORT */ -#endif /* HAVE_ECC_KEY_EXPORT */ -#if defined(HAVE_ECC_DHE) && defined(HAVE_ECC_KEY_IMPORT) && defined(HAVE_ECC_KEY_EXPORT) +#ifdef HAVE_ECC_DHE y = sizeof(sharedB); ret = wc_ecc_shared_secret(&userB, &pubKey, sharedB, &y); if (ret != 0) @@ -6403,25 +6603,45 @@ int ecc_test(void) return -1013; #endif /* HAVE_ECC_DHE */ #endif /* HAVE_COMP_KEY */ +#endif /* HAVE_ECC_KEY_IMPORT */ +#endif /* HAVE_ECC_KEY_EXPORT */ #ifdef HAVE_ECC_SIGN - /* test DSA sign hash */ + /* test DSA sign hash with zeros */ for (i = 0; i < (int)sizeof(digest); i++) { - #ifdef ECC_TEST_VERIFY_ZERO digest[i] = 0; - #else - digest[i] = (byte)i; - #endif } x = sizeof(sig); - ret = wc_ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &userA); + ret = wc_ecc_sign_hash(digest, sizeof(digest), sig, &x, rng, &userA); if (ret != 0) return -1014; #ifdef HAVE_ECC_VERIFY - for (i=0; i Date: Thu, 17 Mar 2016 15:56:51 -0700 Subject: [PATCH 064/192] Resolve unused "typeH" warning. --- src/internal.c | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/internal.c b/src/internal.c index 60cc76706..03391dae5 100755 --- a/src/internal.c +++ b/src/internal.c @@ -2106,7 +2106,7 @@ int DhAgree(WOLFSSL* ssl, { int ret; DhKey dhKey; - + #if defined(WOLFSSL_ASYNC_CRYPT_TEST) if (ssl->options.side == WOLFSSL_SERVER_END && ssl->asyncCryptTest.type == ASYNC_TEST_NONE) @@ -13408,7 +13408,7 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) XMEMCPY(es, ssl->arrays->client_identity, esSz); es += esSz; encSz = esSz + OPAQUE16_LEN; - + ret = DhAgree(ssl, serverP.buffer, serverP.length, serverG.buffer, serverG.length, @@ -15065,7 +15065,6 @@ int DoSessionTicket(WOLFSSL* ssl, #if !defined(NO_DH) && !defined(NO_RSA) case diffie_hellman_kea: { - int typeH = 0; enum wc_HashType hashType = WC_HASH_TYPE_NONE; idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; @@ -15173,28 +15172,24 @@ int DoSessionTicket(WOLFSSL* ssl, case sha512_mac: #ifdef WOLFSSL_SHA512 hashType = WC_HASH_TYPE_SHA512; - typeH = SHA512h; #endif break; case sha384_mac: #ifdef WOLFSSL_SHA384 hashType = WC_HASH_TYPE_SHA384; - typeH = SHA384h; #endif break; case sha256_mac: #ifndef NO_SHA256 hashType = WC_HASH_TYPE_SHA256; - typeH = SHA256h; #endif break; case sha_mac: #ifndef NO_OLD_TLS hashType = WC_HASH_TYPE_SHA; - typeH = SHAh; #endif break; @@ -15256,11 +15251,37 @@ int DoSessionTicket(WOLFSSL* ssl, { /* For TLS 1.2 re-encode signature */ if (IsAtLeastTLSv1_2(ssl)) { + int typeH = 0; byte* encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (encodedSig == NULL) { ERROR_OUT(MEMORY_E, exit_sske); } + + switch (ssl->suites->hashAlgo) { + case sha512_mac: + #ifdef WOLFSSL_SHA512 + typeH = SHA512h; + #endif + break; + case sha384_mac: + #ifdef WOLFSSL_SHA384 + typeH = SHA384h; + #endif + break; + case sha256_mac: + #ifndef NO_SHA256 + typeH = SHA256h; + #endif + break; + case sha_mac: + #ifndef NO_OLD_TLS + typeH = SHAh; + #endif + break; + default: + break; + } ssl->buffers.sig.length = wc_EncodeSignature(encodedSig, ssl->buffers.sig.buffer, ssl->buffers.sig.length, typeH); @@ -17120,7 +17141,7 @@ int DoSessionTicket(WOLFSSL* ssl, if ((idx - begin) + clientPubSz > size) { ERROR_OUT(BUFFER_ERROR, exit_dcke); } - + ret = DhAgree(ssl, ssl->buffers.serverDH_P.buffer, ssl->buffers.serverDH_P.length, From 71683e23e9df076931ea2717eda5d74a294240a8 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 18 Mar 2016 06:27:42 -0700 Subject: [PATCH 065/192] Resolve 2nd unused "typeH" warning. --- src/internal.c | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/src/internal.c b/src/internal.c index 03391dae5..040b4c909 100755 --- a/src/internal.c +++ b/src/internal.c @@ -14796,7 +14796,6 @@ int DoSessionTicket(WOLFSSL* ssl, #ifdef HAVE_ECC case ecc_diffie_hellman_kea: { - int typeH = 0; enum wc_HashType hashType = WC_HASH_TYPE_NONE; /* curve type, named curve, length(1) */ @@ -14916,31 +14915,23 @@ int DoSessionTicket(WOLFSSL* ssl, case sha512_mac: #ifdef WOLFSSL_SHA512 hashType = WC_HASH_TYPE_SHA512; - typeH = SHA512h; #endif break; - case sha384_mac: #ifdef WOLFSSL_SHA384 hashType = WC_HASH_TYPE_SHA384; - typeH = SHA384h; #endif break; - case sha256_mac: #ifndef NO_SHA256 hashType = WC_HASH_TYPE_SHA256; - typeH = SHA256h; #endif break; - case sha_mac: #ifndef NO_OLD_TLS hashType = WC_HASH_TYPE_SHA; - typeH = SHAh; #endif break; - default: WOLFSSL_MSG("Bad hash sig algo"); break; @@ -14998,18 +14989,44 @@ int DoSessionTicket(WOLFSSL* ssl, ssl->sigLen = sigSz; /* Sign hash to create signature */ - switch(ssl->specs.sig_algo) + switch (ssl->specs.sig_algo) { #ifndef NO_RSA case rsa_sa_algo: { /* For TLS 1.2 re-encode signature */ if (IsAtLeastTLSv1_2(ssl)) { + int typeH = 0; byte* encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (encodedSig == NULL) { ERROR_OUT(MEMORY_E, exit_sske); } + + switch (ssl->suites->hashAlgo) { + case sha512_mac: + #ifdef WOLFSSL_SHA512 + typeH = SHA512h; + #endif + break; + case sha384_mac: + #ifdef WOLFSSL_SHA384 + typeH = SHA384h; + #endif + break; + case sha256_mac: + #ifndef NO_SHA256 + typeH = SHA256h; + #endif + break; + case sha_mac: + #ifndef NO_OLD_TLS + typeH = SHAh; + #endif + break; + default: + break; + } ssl->buffers.sig.length = wc_EncodeSignature(encodedSig, ssl->buffers.sig.buffer, ssl->buffers.sig.length, typeH); @@ -15174,25 +15191,21 @@ int DoSessionTicket(WOLFSSL* ssl, hashType = WC_HASH_TYPE_SHA512; #endif break; - case sha384_mac: #ifdef WOLFSSL_SHA384 hashType = WC_HASH_TYPE_SHA384; #endif break; - case sha256_mac: #ifndef NO_SHA256 hashType = WC_HASH_TYPE_SHA256; #endif break; - case sha_mac: #ifndef NO_OLD_TLS hashType = WC_HASH_TYPE_SHA; #endif break; - default: WOLFSSL_MSG("Bad hash sig algo"); break; From 0fc5575b8b91b386d32c9abf98babdd31281e2e4 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 18 Mar 2016 15:41:03 -0700 Subject: [PATCH 066/192] Fixed typo with WOLFSSL_VALIDATE_ECC_IMPORT defined. Disable ECC-224 bit compressed key test since it isn't working. Cleanup in accel_fp_mul for KB_SIZE. --- wolfcrypt/src/ecc.c | 6 ++--- wolfcrypt/test/test.c | 55 +++++++++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 5d1bf4bb2..55a1badc7 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -2886,7 +2886,7 @@ static int ecc_check_privkey_gen_helper(ecc_key* key) err = mp_read_radix(&prime, (char*)key->dp->prime, 16); - if (err == MP_OKAY); + if (err == MP_OKAY) err = ecc_check_privkey_gen(key, &prime); mp_clear(&prime); @@ -4124,7 +4124,7 @@ static int accel_fp_mul(int idx, mp_int* k, ecc_point *R, mp_int* modulus, #ifdef WOLFSSL_SMALL_STACK unsigned char* kb; #else - unsigned char kb[128]; + unsigned char kb[KB_SIZE]; #endif int x; unsigned y, z, err, bitlen, bitpos, lut_gap, first; @@ -4280,7 +4280,7 @@ static int accel_fp_mul2add(int idx1, int idx2, #ifdef WOLFSSL_SMALL_STACK unsigned char* kb[2]; #else - unsigned char kb[2][128]; + unsigned char kb[2][KB_SIZE]; #endif int x; unsigned y, z, err, bitlen, bitpos, lut_gap, first, zA, zB; diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 5d6da8056..6aac77c7e 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -6499,7 +6499,8 @@ static int ecc_test_key_gen(WC_RNG* rng, int keySize) } #endif /* WOLFSSL_KEY_GEN */ -static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount) +static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount, + int testCompressedKey) { #ifdef BENCH_EMBEDDED byte sharedA[32]; @@ -6579,30 +6580,32 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount) return -1009; #endif /* HAVE_ECC_DHE */ -#ifdef HAVE_COMP_KEY - /* try compressed export / import too */ - x = sizeof(exportBuf); + if (testCompressedKey) { + #ifdef HAVE_COMP_KEY + /* try compressed export / import too */ + x = sizeof(exportBuf); - ret = wc_ecc_export_x963_ex(&userA, exportBuf, &x, 1); - if (ret != 0) - return -1010; - wc_ecc_free(&pubKey); - wc_ecc_init(&pubKey); + ret = wc_ecc_export_x963_ex(&userA, exportBuf, &x, 1); + if (ret != 0) + return -1010; + wc_ecc_free(&pubKey); + wc_ecc_init(&pubKey); - ret = wc_ecc_import_x963(exportBuf, x, &pubKey); - if (ret != 0) - return -1011; + ret = wc_ecc_import_x963(exportBuf, x, &pubKey); + if (ret != 0) + return -1011; -#ifdef HAVE_ECC_DHE - y = sizeof(sharedB); - ret = wc_ecc_shared_secret(&userB, &pubKey, sharedB, &y); - if (ret != 0) - return -1012; + #ifdef HAVE_ECC_DHE + y = sizeof(sharedB); + ret = wc_ecc_shared_secret(&userB, &pubKey, sharedB, &y); + if (ret != 0) + return -1012; - if (memcmp(sharedA, sharedB, y)) - return -1013; -#endif /* HAVE_ECC_DHE */ -#endif /* HAVE_COMP_KEY */ + if (memcmp(sharedA, sharedB, y)) + return -1013; + #endif /* HAVE_ECC_DHE */ + #endif /* HAVE_COMP_KEY */ + } #endif /* HAVE_ECC_KEY_IMPORT */ #endif /* HAVE_ECC_KEY_EXPORT */ @@ -6670,9 +6673,15 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount) #define ECC_TEST_VERIFY_COUNT 2 static int ecc_test_curve(WC_RNG* rng, int keySize) { - int ret; + int ret, testCompressedKey = 1; - ret = ecc_test_curve_size(rng, keySize, ECC_TEST_VERIFY_COUNT); + /* At this time, ECC 224-bit does not work with compressed key */ + if (keySize == 28) { + testCompressedKey = 0; + } + + ret = ecc_test_curve_size(rng, keySize, ECC_TEST_VERIFY_COUNT, + testCompressedKey); if (ret < 0) { return ret; } From 620e4fa5ca32c8d66a3ab07945653368ef54c882 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 23 Mar 2016 09:27:27 -0600 Subject: [PATCH 067/192] fix free of WOLFSSL_METHOD pointer on create ctx fail --- src/ssl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ssl.c b/src/ssl.c index f6301eea9..c01012dbd 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -154,6 +154,11 @@ static volatile int initRefCount = 0; static wolfSSL_Mutex count_mutex; /* init ref count mutex */ +/* Create a new WOLFSSL_CTX struct and return the pointer to created struct. + WOLFSSL_METHOD pointer passed in is given to ctx to manage. + This function frees the passed in WOLFSSL_METHOD struct on failure and on + success is freed when ctx is freed. + */ WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD* method) { WOLFSSL_CTX* ctx = NULL; @@ -166,6 +171,9 @@ WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD* method) if (ret != SSL_SUCCESS) { WOLFSSL_MSG("wolfSSL_Init failed"); WOLFSSL_LEAVE("WOLFSSL_CTX_new", 0); + if (method != NULL) { + XFREE(method, NULL, DYNAMIC_TYPE_METHOD); + } return NULL; } } @@ -177,6 +185,12 @@ WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD* method) if (ctx) { if (InitSSL_Ctx(ctx, method) < 0) { WOLFSSL_MSG("Init CTX failed"); + + /* check for case when wolfSSL_CTX_free does not free method */ + if (ctx == NULL) { + XFREE(method, NULL, DYNAMIC_TYPE_METHOD); + } + wolfSSL_CTX_free(ctx); ctx = NULL; } From 8f8f7ac152c7d36034b84092b69861724a69432e Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 23 Mar 2016 13:40:45 -0600 Subject: [PATCH 068/192] remove unecessary XFREE --- src/ssl.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index c01012dbd..4e9b87fd3 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -185,12 +185,6 @@ WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD* method) if (ctx) { if (InitSSL_Ctx(ctx, method) < 0) { WOLFSSL_MSG("Init CTX failed"); - - /* check for case when wolfSSL_CTX_free does not free method */ - if (ctx == NULL) { - XFREE(method, NULL, DYNAMIC_TYPE_METHOD); - } - wolfSSL_CTX_free(ctx); ctx = NULL; } From 20285bec01c266d0339c85560b4af841a1a780fa Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Wed, 23 Mar 2016 15:33:53 -0600 Subject: [PATCH 069/192] fix wc_ecc_import_raw comment, public key instead of base point --- wolfcrypt/src/ecc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index d93db472e..4261e7854 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -3209,8 +3209,8 @@ int wc_ecc_rs_to_sig(const char* r, const char* s, byte* out, word32* outlen) /** Import raw ECC key key The destination ecc_key structure - qx x component of base point, as ASCII hex string - qy y component of base point, as ASCII hex string + qx x component of the public key, as ASCII hex string + qy y component of the public key, as ASCII hex string d private key, as ASCII hex string curveName ECC curve name, from ecc_sets[] return MP_OKAY on success From 3796fc13221efbc18a7711d6f525cf6f72920324 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 24 Mar 2016 07:08:42 -0700 Subject: [PATCH 070/192] Enhancement to the STM32F2_CRYPTO port to support AES GCM, AES CCM and AES-Direct (for encrypt only) using combination of software and AES HW acceleration. --- wolfcrypt/src/aes.c | 120 +++++++++++++++++++++++++++++++++++-------- wolfcrypt/src/des3.c | 8 ++- 2 files changed, 106 insertions(+), 22 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 1c57f405b..37eaa94e5 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -203,10 +203,94 @@ void wc_AesFreeCavium(Aes* aes) #if defined(STM32F2_CRYPTO) /* STM32F2 hardware AES support for CBC, CTR modes through the STM32F2 * Standard Peripheral Library. Documentation located in STM32F2xx - * Standard Peripheral Library document (See note in README). - * NOTE: no support for AES-GCM/CCM/Direct */ + * Standard Peripheral Library document (See note in README). */ #include "stm32f2xx.h" #include "stm32f2xx_cryp.h" + + static int wc_AesEncrypt(Aes* aes, const byte* inBlock, byte* outBlock) + { + word32 *enc_key; + CRYP_InitTypeDef AES_CRYP_InitStructure; + CRYP_KeyInitTypeDef AES_CRYP_KeyInitStructure; + + enc_key = aes->key; + + /* crypto structure initialization */ + CRYP_KeyStructInit(&AES_CRYP_KeyInitStructure); + CRYP_StructInit(&AES_CRYP_InitStructure); + + /* reset registers to their default values */ + CRYP_DeInit(); + + /* load key into correct registers */ + switch(aes->rounds) + { + case 10: /* 128-bit key */ + AES_CRYP_InitStructure.CRYP_KeySize = CRYP_KeySize_128b; + AES_CRYP_KeyInitStructure.CRYP_Key2Left = enc_key[0]; + AES_CRYP_KeyInitStructure.CRYP_Key2Right = enc_key[1]; + AES_CRYP_KeyInitStructure.CRYP_Key3Left = enc_key[2]; + AES_CRYP_KeyInitStructure.CRYP_Key3Right = enc_key[3]; + break; + + case 12: /* 192-bit key */ + AES_CRYP_InitStructure.CRYP_KeySize = CRYP_KeySize_192b; + AES_CRYP_KeyInitStructure.CRYP_Key1Left = enc_key[0]; + AES_CRYP_KeyInitStructure.CRYP_Key1Right = enc_key[1]; + AES_CRYP_KeyInitStructure.CRYP_Key2Left = enc_key[2]; + AES_CRYP_KeyInitStructure.CRYP_Key2Right = enc_key[3]; + AES_CRYP_KeyInitStructure.CRYP_Key3Left = enc_key[4]; + AES_CRYP_KeyInitStructure.CRYP_Key3Right = enc_key[5]; + break; + + case 14: /* 256-bit key */ + AES_CRYP_InitStructure.CRYP_KeySize = CRYP_KeySize_256b; + AES_CRYP_KeyInitStructure.CRYP_Key0Left = enc_key[0]; + AES_CRYP_KeyInitStructure.CRYP_Key0Right = enc_key[1]; + AES_CRYP_KeyInitStructure.CRYP_Key1Left = enc_key[2]; + AES_CRYP_KeyInitStructure.CRYP_Key1Right = enc_key[3]; + AES_CRYP_KeyInitStructure.CRYP_Key2Left = enc_key[4]; + AES_CRYP_KeyInitStructure.CRYP_Key2Right = enc_key[5]; + AES_CRYP_KeyInitStructure.CRYP_Key3Left = enc_key[6]; + AES_CRYP_KeyInitStructure.CRYP_Key3Right = enc_key[7]; + break; + + default: + break; + } + CRYP_KeyInit(&AES_CRYP_KeyInitStructure); + + /* set direction, mode, and datatype */ + AES_CRYP_InitStructure.CRYP_AlgoDir = CRYP_AlgoDir_Encrypt; + AES_CRYP_InitStructure.CRYP_AlgoMode = CRYP_AlgoMode_AES_ECB; + AES_CRYP_InitStructure.CRYP_DataType = CRYP_DataType_8b; + CRYP_Init(&AES_CRYP_InitStructure); + + /* enable crypto processor */ + CRYP_Cmd(ENABLE); + + /* flush IN/OUT FIFOs */ + CRYP_FIFOFlush(); + + CRYP_DataIn(*(uint32_t*)&inBlock[0]); + CRYP_DataIn(*(uint32_t*)&inBlock[4]); + CRYP_DataIn(*(uint32_t*)&inBlock[8]); + CRYP_DataIn(*(uint32_t*)&inBlock[12]); + + /* wait until the complete message has been processed */ + while(CRYP_GetFlagStatus(CRYP_FLAG_BUSY) != RESET) {} + + *(uint32_t*)&outBlock[0] = CRYP_DataOut(); + *(uint32_t*)&outBlock[4] = CRYP_DataOut(); + *(uint32_t*)&outBlock[8] = CRYP_DataOut(); + *(uint32_t*)&outBlock[12] = CRYP_DataOut(); + + /* disable crypto processor */ + CRYP_Cmd(DISABLE); + + return 0; + } + #elif defined(HAVE_COLDFIRE_SEC) /* Freescale Coldfire SEC support for CBC mode. * NOTE: no support for AES-CTR/GCM/CCM/Direct */ @@ -1015,7 +1099,7 @@ void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, XASM_LINK("AES_CBC_decrypt"); #endif /* HAVE_AES_DECRYPT */ #endif /* HAVE_AES_CBC */ - + void AES_ECB_encrypt(const unsigned char* in, unsigned char* out, unsigned long length, const unsigned char* KS, int nr) XASM_LINK("AES_ECB_encrypt"); @@ -1462,6 +1546,8 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) { word32 *rk = aes->key; + (void)dir; + if (!((keylen == 16) || (keylen == 24) || (keylen == 32))) return BAD_FUNC_ARG; @@ -1471,13 +1557,13 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) return wc_AesSetIV(aes, iv); } - - int wc_AesSetKeyDirect(Aes* aes, const byte* userKey, word32 keylen, - const byte* iv, int dir) - { - return wc_AesSetKey(aes, userKey, keylen, iv, dir); - } - + #if defined(WOLFSSL_AES_DIRECT) + int wc_AesSetKeyDirect(Aes* aes, const byte* userKey, word32 keylen, + const byte* iv, int dir) + { + return wc_AesSetKey(aes, userKey, keylen, iv, dir); + } + #endif #elif defined(HAVE_COLDFIRE_SEC) #if defined (HAVE_THREADX) #include "memory_pools.h" @@ -1829,8 +1915,8 @@ int wc_AesSetIV(Aes* aes, const byte* iv) /* AES-DIRECT */ #if defined(WOLFSSL_AES_DIRECT) - #if defined(STM32F2_CRYPTO) - #error "STM32F2 crypto doesn't yet support AES direct" + #if defined(STM32F2_CRYPTO) && defined(HAVE_AES_DECRYPT) + #error "STM32F2 crypto doesn't yet support AES direct decrypt" #elif defined(HAVE_COLDFIRE_SEC) #error "Coldfire SEC doesn't yet support AES direct" @@ -2727,10 +2813,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv) * number counter. */ -#ifdef STM32F2_CRYPTO - #error "STM32F2 crypto doesn't currently support AES-GCM mode" - -#elif defined(HAVE_COLDFIRE_SEC) +#if defined(HAVE_COLDFIRE_SEC) #error "Coldfire SEC doesn't currently support AES-GCM mode" #elif defined(WOLFSSL_NRF51_AES) @@ -3954,10 +4037,7 @@ WOLFSSL_API int wc_GmacUpdate(Gmac* gmac, const byte* iv, word32 ivSz, #ifdef HAVE_AESCCM -#ifdef STM32F2_CRYPTO - #error "STM32F2 crypto doesn't currently support AES-CCM mode" - -#elif defined(HAVE_COLDFIRE_SEC) +#if defined(HAVE_COLDFIRE_SEC) #error "Coldfire SEC doesn't currently support AES-CCM mode" #elif defined(WOLFSSL_PIC32MZ_CRYPT) diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index 1bf3f3d2f..03c2eb9b5 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -154,6 +154,8 @@ void wc_Des3_FreeCavium(Des3* des3) int wc_Des_SetKey(Des* des, const byte* key, const byte* iv, int dir) { word32 *dkey = des->key; + + (void)dir; XMEMCPY(dkey, key, 8); ByteReverseWords(dkey, dkey, 8); @@ -168,6 +170,8 @@ void wc_Des3_FreeCavium(Des3* des3) word32 *dkey1 = des->key[0]; word32 *dkey2 = des->key[1]; word32 *dkey3 = des->key[2]; + + (void)dir; XMEMCPY(dkey1, key, 8); /* set key 1 */ XMEMCPY(dkey2, key + 8, 8); /* set key 2 */ @@ -180,7 +184,7 @@ void wc_Des3_FreeCavium(Des3* des3) return wc_Des3_SetIV(des, iv); } - void DesCrypt(Des* des, byte* out, const byte* in, word32 sz, + static void DesCrypt(Des* des, byte* out, const byte* in, word32 sz, int dir, int mode) { word32 *dkey, *iv; @@ -276,7 +280,7 @@ void wc_Des3_FreeCavium(Des3* des3) return 0; } - void Des3Crypt(Des3* des, byte* out, const byte* in, word32 sz, + static void Des3Crypt(Des3* des, byte* out, const byte* in, word32 sz, int dir) { word32 *dkey1, *dkey2, *dkey3, *iv; From 27e041246f520705da4c32101b09a1439a0241b1 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 24 Mar 2016 08:42:19 -0700 Subject: [PATCH 071/192] Added benchmark for the RNG. --- wolfcrypt/benchmark/benchmark.c | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index f77976be9..96c705077 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -84,6 +84,7 @@ #ifdef HAVE_NTRU #include "libntruencrypt/ntru_crypto.h" #endif +#include #if defined(WOLFSSL_MDK_ARM) extern FILE * wolfSSL_fopen(const char *fname, const char *mode) ; @@ -174,6 +175,7 @@ void bench_ed25519KeySign(void); void bench_ntru(void); void bench_ntruKeyGen(void); #endif +void bench_rng(void); double current_time(int); @@ -290,6 +292,7 @@ int benchmark_test(void *args) } #endif + bench_rng(); #ifndef NO_AES #ifdef HAVE_AES_CBC bench_aes(0); @@ -427,6 +430,51 @@ enum BenchmarkBounds { static const char blockType[] = "megs"; /* used in printf output */ #endif +void bench_rng(void) +{ + int ret, i; + double start, total, persec; +#ifndef HAVE_LOCAL_RNG + WC_RNG rng; +#endif + +#ifndef HAVE_LOCAL_RNG + ret = wc_InitRng(&rng); + if (ret < 0) { + printf("InitRNG failed\n"); + return; + } +#endif + + start = current_time(1); + BEGIN_INTEL_CYCLES + + for(i = 0; i < numBlocks; i++) { + ret = wc_RNG_GenerateBlock(&rng, plain, sizeof(plain)); + if (ret < 0) { + printf("wc_RNG_GenerateBlock failed %d\n", ret); + break; + } + } + + END_INTEL_CYCLES + total = current_time(0) - start; + + persec = 1 / total * numBlocks; +#ifdef BENCH_EMBEDDED + /* since using kB, convert to MB/s */ + persec = persec / 1024; +#endif + printf("RNG %d %s took %5.3f seconds, %8.3f MB/s", numBlocks, + blockType, total, persec); + SHOW_INTEL_CYCLES + printf("\n"); + +#ifndef HAVE_LOCAL_RNG + wc_FreeRng(&rng); +#endif +} + #ifndef NO_AES From f539a60a40f4be02b92233a8db23a8e66a63538a Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 25 Mar 2016 06:59:35 -0700 Subject: [PATCH 072/192] Adjusted the RNG benchmark to split into smaller requests of max allowed RNG size. --- wolfcrypt/benchmark/benchmark.c | 19 +++++++++++++++---- wolfcrypt/src/random.c | 7 ++++++- wolfssl/wolfcrypt/random.h | 2 ++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 96c705077..31b2e7bea 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -434,6 +434,7 @@ void bench_rng(void) { int ret, i; double start, total, persec; + int pos, len, remain; #ifndef HAVE_LOCAL_RNG WC_RNG rng; #endif @@ -450,10 +451,20 @@ void bench_rng(void) BEGIN_INTEL_CYCLES for(i = 0; i < numBlocks; i++) { - ret = wc_RNG_GenerateBlock(&rng, plain, sizeof(plain)); - if (ret < 0) { - printf("wc_RNG_GenerateBlock failed %d\n", ret); - break; + /* Split request to handle large RNG request */ + pos = 0; + remain = (int)sizeof(plain); + while (remain > 0) { + len = remain; + if (len > RNG_MAX_BLOCK_LEN) + len = RNG_MAX_BLOCK_LEN; + ret = wc_RNG_GenerateBlock(&rng, &plain[pos], len); + if (ret < 0) { + printf("wc_RNG_GenerateBlock failed %d\n", ret); + break; + } + remain -= len; + pos += len; } } diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 2b5f40bfc..124e18281 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -194,6 +194,11 @@ int wc_FreeRng(WC_RNG* rng) #define DRBG_FAILED 2 #define DRBG_CONT_FAILED 3 +/* Verify max gen block len */ +#if RNG_MAX_BLOCK_LEN > MAX_REQUEST_LEN + #error RNG_MAX_BLOCK_LEN is larger than NIST DBRG max request length +#endif + enum { drbgInitC = 0, @@ -533,7 +538,7 @@ int wc_RNG_GenerateBlock(WC_RNG* rng, byte* output, word32 sz) { int ret; - if (rng == NULL || output == NULL || sz > MAX_REQUEST_LEN) + if (rng == NULL || output == NULL || sz > RNG_MAX_BLOCK_LEN) return BAD_FUNC_ARG; if (rng->status != DRBG_OK) diff --git a/wolfssl/wolfcrypt/random.h b/wolfssl/wolfcrypt/random.h index cfcc671a2..2e1e1e072 100644 --- a/wolfssl/wolfcrypt/random.h +++ b/wolfssl/wolfcrypt/random.h @@ -68,6 +68,8 @@ typedef struct OS_Seed { #endif } OS_Seed; +/* Maximum generate block length */ +#define RNG_MAX_BLOCK_LEN (0x10000) #if (defined(HAVE_HASHDRBG) || defined(NO_RC4)) && !defined(CUSTOM_RAND_GENERATE_BLOCK) From 5569dfe838a3a4e3bd62ff471c29c26416588435 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 25 Mar 2016 08:56:11 -0700 Subject: [PATCH 073/192] Fix with FIPS build and RNG_MAX_BLOCK_LEN define location. --- wolfssl/wolfcrypt/random.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wolfssl/wolfcrypt/random.h b/wolfssl/wolfcrypt/random.h index 2e1e1e072..421203dd9 100644 --- a/wolfssl/wolfcrypt/random.h +++ b/wolfssl/wolfcrypt/random.h @@ -35,6 +35,9 @@ extern "C" { #endif +/* Maximum generate block length */ +#define RNG_MAX_BLOCK_LEN (0x10000) + #ifndef HAVE_FIPS /* avoid redefining structs and macros */ #if defined(WOLFSSL_FORCE_RC4_DRBG) && defined(NO_RC4) #error Cannot have WOLFSSL_FORCE_RC4_DRBG and NO_RC4 defined. @@ -68,8 +71,6 @@ typedef struct OS_Seed { #endif } OS_Seed; -/* Maximum generate block length */ -#define RNG_MAX_BLOCK_LEN (0x10000) #if (defined(HAVE_HASHDRBG) || defined(NO_RC4)) && !defined(CUSTOM_RAND_GENERATE_BLOCK) From 57ea1cdcd7013a0071100107b577e4ca0b8c4da0 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 25 Mar 2016 11:32:53 -0600 Subject: [PATCH 074/192] sanity check on ssl pased to wolfSSL_set_fd --- src/ssl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ssl.c b/src/ssl.c index 4e9b87fd3..0ca464ffe 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -255,6 +255,11 @@ int wolfSSL_use_old_poly(WOLFSSL* ssl, int value) int wolfSSL_set_fd(WOLFSSL* ssl, int fd) { WOLFSSL_ENTER("SSL_set_fd"); + + if (ssl == NULL) { + return BAD_FUNC_ARG; + } + ssl->rfd = fd; /* not used directly to allow IO callbacks */ ssl->wfd = fd; From 1649af37be2c73664ea21d914e375943070e3adc Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 25 Mar 2016 11:33:35 -0700 Subject: [PATCH 075/192] fix ecc curve test in normal math mode, free is needed --- wolfcrypt/test/test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 4b3a016b5..d33ab5aa0 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -6259,6 +6259,7 @@ static int ecc_test_vector_item(const eccVector* vector, WC_RNG* rng) memset(sig, 0, sizeof(sig)); x = sizeof(sig); + wc_ecc_free(&userA); /* free key before importing a new one over the top */ ret = wc_ecc_import_raw(&userA, vector->Qx, vector->Qy, vector->d, vector->curveName); if (ret != 0) From 696169634e7362426b5721eda1b5627c8636b4bd Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 25 Mar 2016 13:59:04 -0600 Subject: [PATCH 076/192] check return value of wolfSSL_set_fd --- examples/client/client.c | 16 ++++++++++++---- examples/server/server.c | 4 +++- input | 4 +++- mqx/wolfssl_client/Sources/main.c | 4 +++- swig/wolfssl_adds.c | 3 ++- tests/api.c | 15 +++++++++++---- 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 48d456149..5f120e467 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -173,7 +173,9 @@ int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, if (benchResume) wolfSSL_set_session(ssl, benchSession); #endif - wolfSSL_set_fd(ssl, sockfd); + if (wolfSSL_set_fd(ssl, sockfd) != SSL_SUCCESS) { + err_sys("error in setting fd"); + } if (wolfSSL_connect(ssl) != SSL_SUCCESS) err_sys("SSL_connect failed"); @@ -213,7 +215,9 @@ int ClientBenchmarkThroughput(WOLFSSL_CTX* ctx, char* host, word16 port, if (ssl == NULL) err_sys("unable to get SSL object"); tcp_connect(&sockfd, host, port, doDTLS, ssl); - wolfSSL_set_fd(ssl, sockfd); + if (wolfSSL_set_fd(ssl, sockfd) != SSL_SUCCESS) { + err_sys("error in setting fd"); + } if (wolfSSL_connect(ssl) == SSL_SUCCESS) { /* Perform throughput test */ char *tx_buffer, *rx_buffer; @@ -1140,7 +1144,9 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) #endif tcp_connect(&sockfd, host, port, doDTLS, ssl); - wolfSSL_set_fd(ssl, sockfd); + if (wolfSSL_set_fd(ssl, sockfd) != SSL_SUCCESS) { + err_sys("error in setting fd"); + } #ifdef HAVE_CRL if (disableCRL == 0) { if (wolfSSL_EnableCRL(ssl, WOLFSSL_CRL_CHECKALL) != SSL_SUCCESS) @@ -1292,7 +1298,9 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) #endif } tcp_connect(&sockfd, host, port, doDTLS, sslResume); - wolfSSL_set_fd(sslResume, sockfd); + if (wolfSSL_set_fd(sslResume, sockfd) != SSL_SUCCESS) { + err_sys("error in setting fd"); + } #ifdef HAVE_ALPN if (alpnList != NULL) { printf("ALPN accepted protocols list : %s\n", alpnList); diff --git a/examples/server/server.c b/examples/server/server.c index 087dd8b28..b9dcd1d5a 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -797,7 +797,9 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) doDTLS, serverReadyFile ? 1 : 0, doListen); doListen = 0; /* Don't listen next time */ - SSL_set_fd(ssl, clientfd); + if (SSL_set_fd(ssl, clientfd) != SSL_SUCCESS) { + err_sys("error in setting fd"); + } #ifdef HAVE_ALPN if (alpnList != NULL) { diff --git a/input b/input index 06dbbf076..a8cdf06c1 100644 --- a/input +++ b/input @@ -48,7 +48,9 @@ int main(int argc, char** argv) ssl = SSL_new(ctx); - SSL_set_fd(ssl, sockfd); + if (SSL_set_fd(ssl, sockfd) != SSL_SUCCESS) + err_sys("can't set ssl fd"); + if (SSL_connect(ssl) != SSL_SUCCESS) err_sys("SSL_connect failed"); while (fgets(send, sizeof(send), fin)) { diff --git a/mqx/wolfssl_client/Sources/main.c b/mqx/wolfssl_client/Sources/main.c index f641f13d2..51f5538e2 100644 --- a/mqx/wolfssl_client/Sources/main.c +++ b/mqx/wolfssl_client/Sources/main.c @@ -254,7 +254,9 @@ void client_test(void) if ( (ssl = wolfSSL_new(ctx)) == NULL) err_sys("wolfSSL_new failed"); - wolfSSL_set_fd(ssl, sockfd); + ret = wolfSSL_set_fd(ssl, sockfd); + if (ret != SSL_SUCCESS) + err_sys("wolfSSL_set_fd failed"); ret = wolfSSL_connect(ssl); if (ret != SSL_SUCCESS) diff --git a/swig/wolfssl_adds.c b/swig/wolfssl_adds.c index 2132efb0b..13bfbdbcc 100644 --- a/swig/wolfssl_adds.c +++ b/swig/wolfssl_adds.c @@ -169,7 +169,8 @@ int wolfSSL_swig_connect(WOLFSSL* ssl, const char* server, int port) int ret = tcp_connect(&sockfd, server, port); if (ret != 0) return ret; - wolfSSL_set_fd(ssl, sockfd); + ret = wolfSSL_set_fd(ssl, sockfd); + if (ret != SSL_SUCCESS) return ret; return wolfSSL_connect(ssl); } diff --git a/tests/api.c b/tests/api.c index 36189efb2..9a67d5f88 100644 --- a/tests/api.c +++ b/tests/api.c @@ -540,7 +540,10 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_nofail(void* args) tcp_accept(&sockfd, &clientfd, (func_args*)args, port, 0, 0, 0, 1); CloseSocket(sockfd); - wolfSSL_set_fd(ssl, clientfd); + if (wolfSSL_set_fd(ssl, clientfd) != SSL_SUCCESS) { + /*err_sys("SSL_set_fd failed");*/ + goto done; + } #ifdef NO_PSK #if !defined(NO_FILESYSTEM) && !defined(NO_DH) @@ -649,7 +652,11 @@ static void test_client_nofail(void* args) ssl = wolfSSL_new(ctx); tcp_connect(&sockfd, wolfSSLIP, ((func_args*)args)->signal->port, 0, ssl); - wolfSSL_set_fd(ssl, sockfd); + if (wolfSSL_set_fd(ssl, sockfd) != SSL_SUCCESS) { + /*err_sys("SSL_set_fd failed");*/ + goto done2; + } + if (wolfSSL_connect(ssl) != SSL_SUCCESS) { int err = wolfSSL_get_error(ssl, 0); @@ -739,7 +746,7 @@ static THREAD_RETURN WOLFSSL_THREAD run_wolfssl_server(void* args) tcp_accept(&sfd, &cfd, (func_args*)args, port, 0, 0, 0, 1); CloseSocket(sfd); - wolfSSL_set_fd(ssl, cfd); + AssertIntEQ(SSL_SUCCESS, wolfSSL_set_fd(ssl, cfd)); #ifdef NO_PSK #if !defined(NO_FILESYSTEM) && !defined(NO_DH) @@ -831,7 +838,7 @@ static void run_wolfssl_client(void* args) ssl = wolfSSL_new(ctx); tcp_connect(&sfd, wolfSSLIP, ((func_args*)args)->signal->port, 0, ssl); - wolfSSL_set_fd(ssl, sfd); + AssertIntEQ(SSL_SUCCESS, wolfSSL_set_fd(ssl, sfd)); if (callbacks->ssl_ready) callbacks->ssl_ready(ssl); From 67b4d2e2f41ebb9ec828f572d2b524a14d4d5613 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 25 Mar 2016 14:19:51 -0600 Subject: [PATCH 077/192] case where memory is exhausted before ctx copied to ssl --- src/internal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index 09ca058e9..70bb27900 100644 --- a/src/internal.c +++ b/src/internal.c @@ -2345,7 +2345,9 @@ void FreeHandshakeResources(WOLFSSL* ssl) void FreeSSL(WOLFSSL* ssl) { - FreeSSL_Ctx(ssl->ctx); /* will decrement and free underyling CTX if 0 */ + if (ssl->ctx) { + FreeSSL_Ctx(ssl->ctx); /* will decrement and free underyling CTX if 0 */ + } SSL_ResourceFree(ssl); XFREE(ssl, ssl->heap, DYNAMIC_TYPE_SSL); } From 03765ecca734664ffa4c19fab03bd2e8a79c9ffd Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 25 Mar 2016 13:22:31 -0700 Subject: [PATCH 078/192] Fixes to cleanup unnecessary ECC make key, check key and free in ECC vector item test. --- wolfcrypt/test/test.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index d33ab5aa0..741d4da36 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -6239,7 +6239,7 @@ typedef struct eccVector { word32 keySize; } eccVector; -static int ecc_test_vector_item(const eccVector* vector, WC_RNG* rng) +static int ecc_test_vector_item(const eccVector* vector) { int ret, verify; word32 x; @@ -6248,18 +6248,9 @@ static int ecc_test_vector_item(const eccVector* vector, WC_RNG* rng) wc_ecc_init(&userA); - ret = wc_ecc_make_key(rng, vector->keySize, &userA); - if (ret != 0) - return -1014; - - ret = wc_ecc_check_key(&userA); - if (ret != 0) - return -1024; - memset(sig, 0, sizeof(sig)); x = sizeof(sig); - wc_ecc_free(&userA); /* free key before importing a new one over the top */ ret = wc_ecc_import_raw(&userA, vector->Qx, vector->Qy, vector->d, vector->curveName); if (ret != 0) @@ -6281,7 +6272,7 @@ static int ecc_test_vector_item(const eccVector* vector, WC_RNG* rng) return 0; } -static int ecc_test_vector(WC_RNG* rng, int keySize) +static int ecc_test_vector(int keySize) { int ret; eccVector vec; @@ -6433,7 +6424,7 @@ static int ecc_test_vector(WC_RNG* rng, int keySize) return NOT_COMPILED_IN; /* Invalid key size / Not supported */ }; /* Switch */ - ret = ecc_test_vector_item(&vec, rng); + ret = ecc_test_vector_item(&vec); if (ret < 0) { return ret; } @@ -6689,7 +6680,7 @@ static int ecc_test_curve(WC_RNG* rng, int keySize) } #ifdef HAVE_ECC_VECTOR_TEST - ret = ecc_test_vector(rng, keySize); + ret = ecc_test_vector(keySize); if (ret < 0) { return ret; } From 79a212da8da839404166e19cade88377cb0364d2 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 28 Mar 2016 14:24:12 -0600 Subject: [PATCH 079/192] fix disable inline build --- wolfssl/mem_track.h | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/wolfssl/mem_track.h b/wolfssl/mem_track.h index 1a6fa794b..3b9906505 100644 --- a/wolfssl/mem_track.h +++ b/wolfssl/mem_track.h @@ -52,7 +52,19 @@ static memoryStats ourMemStats; #endif - static INLINE void* TrackMalloc(size_t sz) + /* if defined to not using inline then declare function prototypes */ + #ifdef NO_INLINE + #define STATIC + WOLFSSL_LOCAL void* TrackMalloc(size_t sz); + WOLFSSL_LOCAL void TrackFree(void* ptr); + WOLFSSL_LOCAL void* TrackRealloc(void* ptr, size_t sz); + WOLFSSL_LOCAL int InitMemoryTracker(void); + WOLFSSL_LOCAL void ShowMemoryTracker(void); + #else + #define STATIC static + #endif + + STATIC INLINE void* TrackMalloc(size_t sz) { memoryTrack* mt; @@ -78,7 +90,7 @@ } - static INLINE void TrackFree(void* ptr) + STATIC INLINE void TrackFree(void* ptr) { memoryTrack* mt; @@ -97,7 +109,7 @@ } - static INLINE void* TrackRealloc(void* ptr, size_t sz) + STATIC INLINE void* TrackRealloc(void* ptr, size_t sz) { void* ret = TrackMalloc(sz); @@ -119,7 +131,7 @@ return ret; } - static INLINE int InitMemoryTracker(void) + STATIC INLINE int InitMemoryTracker(void) { int ret = wolfSSL_SetAllocators(TrackMalloc, TrackFree, TrackRealloc); if (ret < 0) { @@ -133,11 +145,11 @@ ourMemStats.peakBytes = 0; ourMemStats.currentBytes = 0; #endif - + return ret; } - static INLINE void ShowMemoryTracker(void) + STATIC INLINE void ShowMemoryTracker(void) { #ifdef DO_MEM_STATS printf("total Allocs = %9lu\n", @@ -154,4 +166,4 @@ #endif /* USE_WOLFSSL_MEMORY */ #endif /* WOLFSSL_MEM_TRACK_H */ - \ No newline at end of file + From 2665db73a43123c5b2a3211fbba0fd1dd41d6dbd Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 28 Mar 2016 16:03:15 -0600 Subject: [PATCH 080/192] check for compiling misc.c when not needed --- src/internal.c | 1 + src/ocsp.c | 1 + src/sniffer.c | 1 + src/ssl.c | 1 + src/tls.c | 1 + wolfcrypt/src/aes.c | 1 + wolfcrypt/src/asn.c | 1 + wolfcrypt/src/camellia.c | 1 + wolfcrypt/src/chacha.c | 1 + wolfcrypt/src/chacha20_poly1305.c | 1 + wolfcrypt/src/compress.c | 1 + wolfcrypt/src/curve25519.c | 1 + wolfcrypt/src/des3.c | 1 + wolfcrypt/src/ecc.c | 1 + wolfcrypt/src/ed25519.c | 1 + wolfcrypt/src/fe_low_mem.c | 1 + wolfcrypt/src/fe_operations.c | 1 + wolfcrypt/src/ge_low_mem.c | 1 + wolfcrypt/src/ge_operations.c | 1 + wolfcrypt/src/hc128.c | 1 + wolfcrypt/src/idea.c | 1 + wolfcrypt/src/md2.c | 1 + wolfcrypt/src/md4.c | 1 + wolfcrypt/src/md5.c | 1 + wolfcrypt/src/misc.c | 5 +++++ wolfcrypt/src/pkcs7.c | 1 + wolfcrypt/src/poly1305.c | 1 + wolfcrypt/src/pwdbased.c | 1 + wolfcrypt/src/rabbit.c | 1 + wolfcrypt/src/random.c | 1 + wolfcrypt/src/ripemd.c | 1 + wolfcrypt/src/rsa.c | 1 + wolfcrypt/src/sha.c | 1 + wolfcrypt/src/sha256.c | 1 + wolfcrypt/src/sha512.c | 1 + wolfcrypt/src/srp.c | 1 + wolfcrypt/src/tfm.c | 1 + 37 files changed, 41 insertions(+) diff --git a/src/internal.c b/src/internal.c index 70bb27900..c9c0d2031 100644 --- a/src/internal.c +++ b/src/internal.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/src/ocsp.c b/src/ocsp.c index dfc65ff0c..16d560698 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -38,6 +38,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/src/sniffer.c b/src/sniffer.c index 3561781f4..010ad61b9 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -50,6 +50,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/src/ssl.c b/src/ssl.c index 0ca464ffe..e5234b2f6 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -38,6 +38,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/src/tls.c b/src/tls.c index 8294d2342..a655896a8 100644 --- a/src/tls.c +++ b/src/tls.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 1c57f405b..ad8cb5213 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -187,6 +187,7 @@ void wc_AesFreeCavium(Aes* aes) #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif #ifdef DEBUG_AESNI diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 0c41eaa34..d4eb4f8d4 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -54,6 +54,7 @@ ASN Options: #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/camellia.c b/wolfcrypt/src/camellia.c index 7607875d3..bb2cfe8c2 100644 --- a/wolfcrypt/src/camellia.c +++ b/wolfcrypt/src/camellia.c @@ -67,6 +67,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/chacha.c b/wolfcrypt/src/chacha.c index a383689a7..eafc8e579 100644 --- a/wolfcrypt/src/chacha.c +++ b/wolfcrypt/src/chacha.c @@ -40,6 +40,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/chacha20_poly1305.c b/wolfcrypt/src/chacha20_poly1305.c index d0da3c5fe..3964b4ea8 100644 --- a/wolfcrypt/src/chacha20_poly1305.c +++ b/wolfcrypt/src/chacha20_poly1305.c @@ -38,6 +38,7 @@ #ifdef NO_INLINE #include #else +#define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/compress.c b/wolfcrypt/src/compress.c index 0dd47a335..346dcbc7d 100644 --- a/wolfcrypt/src/compress.c +++ b/wolfcrypt/src/compress.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/curve25519.c b/wolfcrypt/src/curve25519.c index 6fb359a4b..1f7c012d9 100644 --- a/wolfcrypt/src/curve25519.c +++ b/wolfcrypt/src/curve25519.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index 1bf3f3d2f..f39bb6842 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -127,6 +127,7 @@ void wc_Des3_FreeCavium(Des3* des3) #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 4261e7854..807c44fe8 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -76,6 +76,7 @@ ECC Curves: #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/ed25519.c b/wolfcrypt/src/ed25519.c index b776566eb..959225015 100644 --- a/wolfcrypt/src/ed25519.c +++ b/wolfcrypt/src/ed25519.c @@ -37,6 +37,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/fe_low_mem.c b/wolfcrypt/src/fe_low_mem.c index 373fd1cc5..e7b793ca9 100644 --- a/wolfcrypt/src/fe_low_mem.c +++ b/wolfcrypt/src/fe_low_mem.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/fe_operations.c b/wolfcrypt/src/fe_operations.c index 636ef70f0..7f7f388fe 100644 --- a/wolfcrypt/src/fe_operations.c +++ b/wolfcrypt/src/fe_operations.c @@ -37,6 +37,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/ge_low_mem.c b/wolfcrypt/src/ge_low_mem.c index 4f809103b..9f17e5e1f 100644 --- a/wolfcrypt/src/ge_low_mem.c +++ b/wolfcrypt/src/ge_low_mem.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/ge_operations.c b/wolfcrypt/src/ge_operations.c index fe9c7280b..a7970b51d 100644 --- a/wolfcrypt/src/ge_operations.c +++ b/wolfcrypt/src/ge_operations.c @@ -38,6 +38,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/hc128.c b/wolfcrypt/src/hc128.c index 54d832de0..4e365244d 100644 --- a/wolfcrypt/src/hc128.c +++ b/wolfcrypt/src/hc128.c @@ -35,6 +35,7 @@ #include #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/idea.c b/wolfcrypt/src/idea.c index 730ee4da1..5d7550a5f 100644 --- a/wolfcrypt/src/idea.c +++ b/wolfcrypt/src/idea.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/md2.c b/wolfcrypt/src/md2.c index 094a1199c..02f3e4936 100644 --- a/wolfcrypt/src/md2.c +++ b/wolfcrypt/src/md2.c @@ -35,6 +35,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/md4.c b/wolfcrypt/src/md4.c index 54fd4ebb1..126077f3c 100644 --- a/wolfcrypt/src/md4.c +++ b/wolfcrypt/src/md4.c @@ -32,6 +32,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/md5.c b/wolfcrypt/src/md5.c index 1143e86b0..0a6c3f617 100644 --- a/wolfcrypt/src/md5.c +++ b/wolfcrypt/src/md5.c @@ -45,6 +45,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index bc2cefd76..4a9de4fa0 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -39,11 +39,16 @@ */ #ifdef NO_INLINE + #undef WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_COMPILED #define STATIC #else #define STATIC static #endif +#ifndef WOLFSSL_MISC_COMPILED + #error misc.c does not need to be compiled when not defined NO_INLINE +#endif #ifdef INTEL_INTRINSICS diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 721ec21f3..a8bce24f2 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -34,6 +34,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/poly1305.c b/wolfcrypt/src/poly1305.c index 8725fb01f..1e76c707c 100644 --- a/wolfcrypt/src/poly1305.c +++ b/wolfcrypt/src/poly1305.c @@ -37,6 +37,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif #ifdef CHACHA_AEAD_TEST diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index 5efd21fc8..7f3e50759 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -55,6 +55,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/rabbit.c b/wolfcrypt/src/rabbit.c index dc2c9b7b0..53a31b91e 100644 --- a/wolfcrypt/src/rabbit.c +++ b/wolfcrypt/src/rabbit.c @@ -34,6 +34,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 124e18281..65f900f0e 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -131,6 +131,7 @@ int wc_FreeRng(WC_RNG* rng) #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif #endif /* HAVE_HASHDRBG || NO_RC4 */ diff --git a/wolfcrypt/src/ripemd.c b/wolfcrypt/src/ripemd.c index 1ec17d5cf..55a483162 100644 --- a/wolfcrypt/src/ripemd.c +++ b/wolfcrypt/src/ripemd.c @@ -33,6 +33,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index 0232af6f2..630de3fa3 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -129,6 +129,7 @@ int wc_RsaFlattenPublicKey(RsaKey* key, byte* a, word32* aSz, byte* b, #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index b0d8dd9dc..cd3e6f161 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index ad862caa0..09c2d0c36 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -282,6 +282,7 @@ static void set_Transform(void) { #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index 9b0649fa6..162a7ff8c 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -76,6 +76,7 @@ int wc_Sha384Final(Sha384* sha, byte* out) #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/srp.c b/wolfcrypt/src/srp.c index 415cad38e..05393e140 100644 --- a/wolfcrypt/src/srp.c +++ b/wolfcrypt/src/srp.c @@ -35,6 +35,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index 4ee88bddc..00c6ec97b 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -40,6 +40,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif From 7e90e2e5402f01f59739ae592a91a560c18e251b Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 28 Mar 2016 17:22:39 -0600 Subject: [PATCH 081/192] misc.c compile warning accounts for FIPS --- wolfcrypt/src/misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index 4a9de4fa0..3498deb53 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -46,7 +46,9 @@ #define STATIC static #endif -#ifndef WOLFSSL_MISC_COMPILED +/* Check for if compiling misc.c when not needed. FIPS build has source code + without preprocessor flag so the warning is not used in a FIPS build. */ +#if !defined(WOLFSSL_MISC_COMPILED) && !defined(HAVE_FIPS) #error misc.c does not need to be compiled when not defined NO_INLINE #endif From 2437e97d70bf938a02d660646c049828d300ffc0 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 28 Mar 2016 17:33:38 -0600 Subject: [PATCH 082/192] if using inline do not compile misc.c in iOS XCode builds --- IDE/iOS/wolfssl.xcodeproj/project.pbxproj | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/IDE/iOS/wolfssl.xcodeproj/project.pbxproj b/IDE/iOS/wolfssl.xcodeproj/project.pbxproj index df541be3b..92c863b4e 100644 --- a/IDE/iOS/wolfssl.xcodeproj/project.pbxproj +++ b/IDE/iOS/wolfssl.xcodeproj/project.pbxproj @@ -36,7 +36,6 @@ 30B0606E1C6DDB2B00D46008 /* md4.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646221A8992CC0062516A /* md4.c */; }; 30B0606F1C6DDB2B00D46008 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646231A8992CC0062516A /* md5.c */; }; 30B060701C6DDB2B00D46008 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646241A8992CC0062516A /* memory.c */; }; - 30B060711C6DDB2B00D46008 /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646251A8992CC0062516A /* misc.c */; }; 30B060721C6DDB2B00D46008 /* pkcs7.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646261A8992CC0062516A /* pkcs7.c */; }; 30B060731C6DDB2B00D46008 /* poly1305.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646271A8992CC0062516A /* poly1305.c */; }; 30B060741C6DDB2B00D46008 /* pwdbased.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646281A8992CC0062516A /* pwdbased.c */; }; @@ -185,7 +184,6 @@ 521646431A8992CC0062516A /* md4.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646221A8992CC0062516A /* md4.c */; }; 521646441A8992CC0062516A /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646231A8992CC0062516A /* md5.c */; }; 521646451A8992CC0062516A /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646241A8992CC0062516A /* memory.c */; }; - 521646461A8992CC0062516A /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646251A8992CC0062516A /* misc.c */; }; 521646471A8992CC0062516A /* pkcs7.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646261A8992CC0062516A /* pkcs7.c */; }; 521646481A8992CC0062516A /* poly1305.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646271A8992CC0062516A /* poly1305.c */; }; 521646491A8992CC0062516A /* pwdbased.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646281A8992CC0062516A /* pwdbased.c */; }; @@ -315,7 +313,6 @@ A4F318551BC58B1700FDF2BB /* camellia.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646151A8992CC0062516A /* camellia.c */; }; A4F318561BC58B1700FDF2BB /* wc_port.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646311A8992CC0062516A /* wc_port.c */; }; A4F318571BC58B1700FDF2BB /* pwdbased.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646281A8992CC0062516A /* pwdbased.c */; }; - A4F318581BC58B1700FDF2BB /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646251A8992CC0062516A /* misc.c */; }; A4F318591BC58B1700FDF2BB /* hc128.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216461D1A8992CC0062516A /* hc128.c */; }; A4F3185A1BC58B1700FDF2BB /* asn.c in Sources */ = {isa = PBXBuildFile; fileRef = 521646131A8992CC0062516A /* asn.c */; }; A4F3185B1BC58B1700FDF2BB /* sha512.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216462F1A8992CC0062516A /* sha512.c */; }; @@ -1435,7 +1432,6 @@ 30B0606E1C6DDB2B00D46008 /* md4.c in Sources */, 30B0606F1C6DDB2B00D46008 /* md5.c in Sources */, 30B060701C6DDB2B00D46008 /* memory.c in Sources */, - 30B060711C6DDB2B00D46008 /* misc.c in Sources */, 30B060721C6DDB2B00D46008 /* pkcs7.c in Sources */, 30B060731C6DDB2B00D46008 /* poly1305.c in Sources */, 30B060741C6DDB2B00D46008 /* pwdbased.c in Sources */, @@ -1464,7 +1460,6 @@ 521646361A8992CC0062516A /* camellia.c in Sources */, 521646521A8992CC0062516A /* wc_port.c in Sources */, 521646491A8992CC0062516A /* pwdbased.c in Sources */, - 521646461A8992CC0062516A /* misc.c in Sources */, 5216463E1A8992CC0062516A /* hc128.c in Sources */, 521646341A8992CC0062516A /* asn.c in Sources */, 521646501A8992CC0062516A /* sha512.c in Sources */, @@ -1514,7 +1509,6 @@ A4F318551BC58B1700FDF2BB /* camellia.c in Sources */, A4F318561BC58B1700FDF2BB /* wc_port.c in Sources */, A4F318571BC58B1700FDF2BB /* pwdbased.c in Sources */, - A4F318581BC58B1700FDF2BB /* misc.c in Sources */, A4F318591BC58B1700FDF2BB /* hc128.c in Sources */, A4F3185A1BC58B1700FDF2BB /* asn.c in Sources */, A4F3185B1BC58B1700FDF2BB /* sha512.c in Sources */, @@ -1790,6 +1784,7 @@ 30B060521C6DDAEA00D46008 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 52B1344816F3C9E800C07B32 /* Build configuration list for PBXProject "wolfssl" */ = { isa = XCConfigurationList; From e60adfc9da80e13d2fa125bd504bad599decf692 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 29 Mar 2016 13:42:40 -0600 Subject: [PATCH 083/192] better naming of macro and alter misc.c check --- ctaocrypt/src/misc.c | 1 + src/internal.c | 2 +- src/ocsp.c | 2 +- src/sniffer.c | 2 +- src/ssl.c | 2 +- src/tls.c | 2 +- wolfcrypt/src/aes.c | 2 +- wolfcrypt/src/asn.c | 2 +- wolfcrypt/src/camellia.c | 2 +- wolfcrypt/src/chacha.c | 2 +- wolfcrypt/src/chacha20_poly1305.c | 2 +- wolfcrypt/src/compress.c | 2 +- wolfcrypt/src/curve25519.c | 2 +- wolfcrypt/src/des3.c | 2 +- wolfcrypt/src/ecc.c | 2 +- wolfcrypt/src/ed25519.c | 2 +- wolfcrypt/src/fe_low_mem.c | 2 +- wolfcrypt/src/fe_operations.c | 2 +- wolfcrypt/src/ge_low_mem.c | 2 +- wolfcrypt/src/ge_operations.c | 2 +- wolfcrypt/src/hc128.c | 2 +- wolfcrypt/src/idea.c | 2 +- wolfcrypt/src/md2.c | 2 +- wolfcrypt/src/md4.c | 2 +- wolfcrypt/src/md5.c | 2 +- wolfcrypt/src/misc.c | 7 ++----- wolfcrypt/src/pkcs7.c | 2 +- wolfcrypt/src/poly1305.c | 2 +- wolfcrypt/src/pwdbased.c | 2 +- wolfcrypt/src/rabbit.c | 2 +- wolfcrypt/src/random.c | 2 +- wolfcrypt/src/ripemd.c | 2 +- wolfcrypt/src/rsa.c | 2 +- wolfcrypt/src/sha.c | 2 +- wolfcrypt/src/sha256.c | 2 +- wolfcrypt/src/sha512.c | 2 +- wolfcrypt/src/srp.c | 2 +- wolfcrypt/src/tfm.c | 2 +- 38 files changed, 39 insertions(+), 41 deletions(-) diff --git a/ctaocrypt/src/misc.c b/ctaocrypt/src/misc.c index 40be5ebad..854e45a3d 100644 --- a/ctaocrypt/src/misc.c +++ b/ctaocrypt/src/misc.c @@ -24,5 +24,6 @@ #include #else /* for inline includes */ + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/src/internal.c b/src/internal.c index c9c0d2031..951ce7384 100644 --- a/src/internal.c +++ b/src/internal.c @@ -36,7 +36,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/src/ocsp.c b/src/ocsp.c index 16d560698..59a8cf057 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -38,7 +38,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/src/sniffer.c b/src/sniffer.c index 010ad61b9..6d791377c 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -50,7 +50,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/src/ssl.c b/src/ssl.c index e5234b2f6..dec4ed39e 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -38,7 +38,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/src/tls.c b/src/tls.c index a655896a8..3b6e0a879 100644 --- a/src/tls.c +++ b/src/tls.c @@ -36,7 +36,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index ad8cb5213..9ec6ef0e4 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -187,7 +187,7 @@ void wc_AesFreeCavium(Aes* aes) #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif #ifdef DEBUG_AESNI diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index d4eb4f8d4..d60053311 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -54,7 +54,7 @@ ASN Options: #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/camellia.c b/wolfcrypt/src/camellia.c index bb2cfe8c2..95609371d 100644 --- a/wolfcrypt/src/camellia.c +++ b/wolfcrypt/src/camellia.c @@ -67,7 +67,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/chacha.c b/wolfcrypt/src/chacha.c index eafc8e579..1402e49cf 100644 --- a/wolfcrypt/src/chacha.c +++ b/wolfcrypt/src/chacha.c @@ -40,7 +40,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/chacha20_poly1305.c b/wolfcrypt/src/chacha20_poly1305.c index 3964b4ea8..104bb5737 100644 --- a/wolfcrypt/src/chacha20_poly1305.c +++ b/wolfcrypt/src/chacha20_poly1305.c @@ -38,7 +38,7 @@ #ifdef NO_INLINE #include #else -#define WOLFSSL_MISC_COMPILED +#define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/compress.c b/wolfcrypt/src/compress.c index 346dcbc7d..2423a0402 100644 --- a/wolfcrypt/src/compress.c +++ b/wolfcrypt/src/compress.c @@ -36,7 +36,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/curve25519.c b/wolfcrypt/src/curve25519.c index 1f7c012d9..3e7b0f52a 100644 --- a/wolfcrypt/src/curve25519.c +++ b/wolfcrypt/src/curve25519.c @@ -36,7 +36,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index f39bb6842..541a9843d 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -127,7 +127,7 @@ void wc_Des3_FreeCavium(Des3* des3) #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 807c44fe8..f7b572af3 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -76,7 +76,7 @@ ECC Curves: #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/ed25519.c b/wolfcrypt/src/ed25519.c index 959225015..9eb86da23 100644 --- a/wolfcrypt/src/ed25519.c +++ b/wolfcrypt/src/ed25519.c @@ -37,7 +37,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/fe_low_mem.c b/wolfcrypt/src/fe_low_mem.c index e7b793ca9..0fe6158a0 100644 --- a/wolfcrypt/src/fe_low_mem.c +++ b/wolfcrypt/src/fe_low_mem.c @@ -36,7 +36,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/fe_operations.c b/wolfcrypt/src/fe_operations.c index 7f7f388fe..1a387ce37 100644 --- a/wolfcrypt/src/fe_operations.c +++ b/wolfcrypt/src/fe_operations.c @@ -37,7 +37,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/ge_low_mem.c b/wolfcrypt/src/ge_low_mem.c index 9f17e5e1f..9b6b26206 100644 --- a/wolfcrypt/src/ge_low_mem.c +++ b/wolfcrypt/src/ge_low_mem.c @@ -36,7 +36,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/ge_operations.c b/wolfcrypt/src/ge_operations.c index a7970b51d..40dd4c7b1 100644 --- a/wolfcrypt/src/ge_operations.c +++ b/wolfcrypt/src/ge_operations.c @@ -38,7 +38,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/hc128.c b/wolfcrypt/src/hc128.c index 4e365244d..e6344ae10 100644 --- a/wolfcrypt/src/hc128.c +++ b/wolfcrypt/src/hc128.c @@ -35,7 +35,7 @@ #include #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/idea.c b/wolfcrypt/src/idea.c index 5d7550a5f..04f1fb319 100644 --- a/wolfcrypt/src/idea.c +++ b/wolfcrypt/src/idea.c @@ -36,7 +36,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/md2.c b/wolfcrypt/src/md2.c index 02f3e4936..01f8f48aa 100644 --- a/wolfcrypt/src/md2.c +++ b/wolfcrypt/src/md2.c @@ -35,7 +35,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/md4.c b/wolfcrypt/src/md4.c index 126077f3c..3b3ae9555 100644 --- a/wolfcrypt/src/md4.c +++ b/wolfcrypt/src/md4.c @@ -32,7 +32,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/md5.c b/wolfcrypt/src/md5.c index 0a6c3f617..48eab1bdf 100644 --- a/wolfcrypt/src/md5.c +++ b/wolfcrypt/src/md5.c @@ -45,7 +45,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index 3498deb53..3b7360665 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -39,16 +39,13 @@ */ #ifdef NO_INLINE - #undef WOLFSSL_MISC_COMPILED - #define WOLFSSL_MISC_COMPILED #define STATIC #else #define STATIC static #endif -/* Check for if compiling misc.c when not needed. FIPS build has source code - without preprocessor flag so the warning is not used in a FIPS build. */ -#if !defined(WOLFSSL_MISC_COMPILED) && !defined(HAVE_FIPS) +/* Check for if compiling misc.c when not needed. */ +#if !defined(WOLFSSL_MISC_INCLUDED) && !defined(NO_INLINE) #error misc.c does not need to be compiled when not defined NO_INLINE #endif diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index a8bce24f2..390c93615 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -34,7 +34,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/poly1305.c b/wolfcrypt/src/poly1305.c index 1e76c707c..09f88c707 100644 --- a/wolfcrypt/src/poly1305.c +++ b/wolfcrypt/src/poly1305.c @@ -37,7 +37,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif #ifdef CHACHA_AEAD_TEST diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index 7f3e50759..c20ea1f18 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -55,7 +55,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/rabbit.c b/wolfcrypt/src/rabbit.c index 53a31b91e..4e51d3095 100644 --- a/wolfcrypt/src/rabbit.c +++ b/wolfcrypt/src/rabbit.c @@ -34,7 +34,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 65f900f0e..235dce133 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -131,7 +131,7 @@ int wc_FreeRng(WC_RNG* rng) #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif #endif /* HAVE_HASHDRBG || NO_RC4 */ diff --git a/wolfcrypt/src/ripemd.c b/wolfcrypt/src/ripemd.c index 55a483162..9da179e4e 100644 --- a/wolfcrypt/src/ripemd.c +++ b/wolfcrypt/src/ripemd.c @@ -33,7 +33,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index 630de3fa3..ea5bf381f 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -129,7 +129,7 @@ int wc_RsaFlattenPublicKey(RsaKey* key, byte* a, word32* aSz, byte* b, #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index cd3e6f161..b09b00c4d 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -36,7 +36,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 09c2d0c36..e546a7c24 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -282,7 +282,7 @@ static void set_Transform(void) { #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index 162a7ff8c..d06bc0880 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -76,7 +76,7 @@ int wc_Sha384Final(Sha384* sha, byte* out) #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/srp.c b/wolfcrypt/src/srp.c index 05393e140..e00af4bb7 100644 --- a/wolfcrypt/src/srp.c +++ b/wolfcrypt/src/srp.c @@ -35,7 +35,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index 00c6ec97b..81372ab8c 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -40,7 +40,7 @@ #ifdef NO_INLINE #include #else - #define WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_INCLUDED #include #endif From ec9f10d74fb07cf6ae6a05efcf7ee3ac7295993f Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Wed, 30 Mar 2016 10:52:27 -0600 Subject: [PATCH 084/192] extra cleanup in sniffer.c with ForceZero --- src/sniffer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sniffer.c b/src/sniffer.c index 6d791377c..783003cde 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -1082,6 +1082,7 @@ static int LoadKeyFile(byte** keyBuf, word32* keyBufSz, ret = 0; } + ForceZero(loadBuf, (word32)fileSz); free(loadBuf); *keyBuf = saveBuf; @@ -3093,6 +3094,7 @@ doPart: * wants to null terminate plaintext */ tmpData = (byte*)realloc(*data, decoded + ret + 1); if (tmpData == NULL) { + ForceZero(*data, decoded); free(*data); *data = NULL; SetError(MEMORY_STR, error, session, From 4472152b184942e5186f2868dc45e1811faa8d27 Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 30 Mar 2016 15:15:38 -0700 Subject: [PATCH 085/192] Added new "wolfSSL_poll" which filters event queue by ssl object pointer. Changed wolfSSL_CTX_poll to support using WOLF_POLL_FLAG_PEEK flag to peek at events and return count. Removed "wolfssl_CTX_poll_peek". Switched the examples (test.h AsyncCryptPoll) to use just the WOLFSSL object and call new wolfSSL_poll. Added warning when using the "--enable-asynccrypt" option to make sure users know they need real async.c/.h files. --- configure.ac | 6 ++ examples/client/client.c | 12 ++- examples/echoclient/echoclient.c | 2 +- examples/echoserver/echoserver.c | 2 +- examples/server/server.c | 2 +- src/ssl.c | 129 +++++++++++++++---------------- wolfssl/ssl.h | 9 ++- wolfssl/test.h | 10 +-- 8 files changed, 88 insertions(+), 84 deletions(-) diff --git a/configure.ac b/configure.ac index 6e4669717..e95ac7dc2 100644 --- a/configure.ac +++ b/configure.ac @@ -2860,3 +2860,9 @@ echo " * Fast RSA: $ENABLED_FAST_RSA" echo " * Async Crypto: $ENABLED_ASYNCCRYPT" echo "" echo "---" + +# Show warnings at bottom so they are noticed +if test "$ENABLED_ASYNCCRYPT" = "yes" +then + AC_MSG_WARN([Make sure real async files are loaded. Contact wolfSSL for details on using the asynccrypt option.]) +fi diff --git a/examples/client/client.c b/examples/client/client.c index d800cb26e..0741d2512 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -68,7 +68,7 @@ #endif -static void NonBlockingSSL_Connect(WOLFSSL_CTX* ctx, WOLFSSL* ssl) +static void NonBlockingSSL_Connect(WOLFSSL* ssl) { #ifndef WOLFSSL_CALLBACKS int ret = wolfSSL_connect(ssl); @@ -79,8 +79,6 @@ static void NonBlockingSSL_Connect(WOLFSSL_CTX* ctx, WOLFSSL* ssl) SOCKET_T sockfd = (SOCKET_T)wolfSSL_get_fd(ssl); int select_ret; - (void)ctx; - while (ret != SSL_SUCCESS && (error == SSL_ERROR_WANT_READ || error == SSL_ERROR_WANT_WRITE || error == WC_PENDING_E)) { @@ -92,7 +90,7 @@ static void NonBlockingSSL_Connect(WOLFSSL_CTX* ctx, WOLFSSL* ssl) printf("... client would write block\n"); #ifdef WOLFSSL_ASYNC_CRYPT else if (error == WC_PENDING_E) { - ret = AsyncCryptPoll(ctx, ssl); + ret = AsyncCryptPoll(ssl); if (ret < 0) { break; } else if (ret == 0) { continue; } } #endif @@ -1180,13 +1178,13 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) if (nonBlocking) { wolfSSL_set_using_nonblock(ssl, 1); tcp_set_nonblocking(&sockfd); - NonBlockingSSL_Connect(ctx, ssl); + NonBlockingSSL_Connect(ssl); } else { do { #ifdef WOLFSSL_ASYNC_CRYPT if (err == WC_PENDING_E) { - ret = AsyncCryptPoll(ctx, ssl); + ret = AsyncCryptPoll(ssl); if (ret < 0) { break; } else if (ret == 0) { continue; } } #endif @@ -1338,7 +1336,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) if (nonBlocking) { wolfSSL_set_using_nonblock(sslResume, 1); tcp_set_nonblocking(&sockfd); - NonBlockingSSL_Connect(ctx, sslResume); + NonBlockingSSL_Connect(sslResume); } else if (wolfSSL_connect(sslResume) != SSL_SUCCESS) err_sys("SSL resume failed"); diff --git a/examples/echoclient/echoclient.c b/examples/echoclient/echoclient.c index 4957b7a34..330324ce4 100644 --- a/examples/echoclient/echoclient.c +++ b/examples/echoclient/echoclient.c @@ -177,7 +177,7 @@ void echoclient_test(void* args) do { #ifdef WOLFSSL_ASYNC_CRYPT if (err == WC_PENDING_E) { - ret = AsyncCryptPoll(ctx, ssl); + ret = AsyncCryptPoll(ssl); if (ret < 0) { break; } else if (ret == 0) { continue; } } #endif diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index 4318a5816..11a087452 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -266,7 +266,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) do { #ifdef WOLFSSL_ASYNC_CRYPT if (err == WC_PENDING_E) { - ret = AsyncCryptPoll(ctx, ssl); + ret = AsyncCryptPoll(ssl); if (ret < 0) { break; } else if (ret == 0) { continue; } } #endif diff --git a/examples/server/server.c b/examples/server/server.c index 0774a3142..29a07522f 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -843,7 +843,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) do { #ifdef WOLFSSL_ASYNC_CRYPT if (err == WC_PENDING_E) { - ret = AsyncCryptPoll(ctx, ssl); + ret = AsyncCryptPoll(ssl); if (ret < 0) { break; } else if (ret == 0) { continue; } } #endif diff --git a/src/ssl.c b/src/ssl.c index 78ae3edcb..9ff1a28cf 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -3433,7 +3433,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, ecc_key key; wc_ecc_init(&key); - if (wc_EccPrivateKeyDecode(der->buffer, &idx, &key, + if (wc_EccPrivateKeyDecode(der->buffer, &idx, &key, der->length) != 0) { wc_ecc_free(&key); return SSL_BAD_FILE; @@ -4542,7 +4542,7 @@ int wolfSSL_PemCertToDer(const char* fileName, unsigned char* derBuf, int derSz) else dynamic = 1; } - + if (ret == 0) { if ( (ret = (int)XFREAD(fileBuf, sz, 1, file)) < 0) { ret = SSL_BAD_FILE; @@ -6429,10 +6429,10 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl, #ifndef NO_CERTS /* in case used set_accept_state after init */ - if (!havePSK && !haveAnon && - (!ssl->buffers.certificate || + if (!havePSK && !haveAnon && + (!ssl->buffers.certificate || !ssl->buffers.certificate->buffer || - !ssl->buffers.key || + !ssl->buffers.key || !ssl->buffers.key->buffer)) { WOLFSSL_MSG("accept error: don't have server cert and key"); ssl->error = NO_PRIVATE_KEY; @@ -11200,10 +11200,10 @@ int wolfSSL_X509_STORE_add_cert(WOLFSSL_X509_STORE* store, WOLFSSL_X509* x509) int result = SSL_FATAL_ERROR; WOLFSSL_ENTER("wolfSSL_X509_STORE_add_cert"); - if (store != NULL && store->cm != NULL && x509 != NULL + if (store != NULL && store->cm != NULL && x509 != NULL && x509->derCert != NULL) { DerBuffer* derCert = NULL; - + result = AllocDer(&derCert, x509->derCert->length, x509->derCert->type, NULL); if (result == 0) { @@ -17827,48 +17827,23 @@ void* wolfSSL_get_jobject(WOLFSSL* ssl) #endif /* WOLFSSL_JNI */ #ifdef HAVE_WOLF_EVENT -int wolfssl_CTX_poll_peek(WOLFSSL_CTX* ctx, int* eventCount) -{ - WOLF_EVENT* event; - int count = 0; - - if (ctx == NULL) { - return BAD_FUNC_ARG; - } - -#ifndef SINGLE_THREADED - if (LockMutex(&ctx->event_queue.lock) != 0) { - return BAD_MUTEX_E; - } -#endif - - /* Itterate event queue */ - for (event = ctx->event_queue.head; event != NULL; event = event->next) { - count++; - } - -#ifndef SINGLE_THREADED - UnLockMutex(&ctx->event_queue.lock); -#endif - - if (eventCount) { - *eventCount = count; - } - - return 0; -} - -int wolfSSL_CTX_poll(WOLFSSL_CTX* ctx, WOLF_EVENT* events, int maxEvents, - unsigned char flags, int* eventCount) +static int _wolfSSL_CTX_poll(WOLFSSL_CTX* ctx, WOLFSSL* ssl, WOLF_EVENT* events, + int maxEvents, unsigned char flags, int* eventCount) { WOLF_EVENT* event, *event_prev = NULL; int count = 0, ret = SSL_ERROR_NONE; - if (ctx == NULL || events == NULL || maxEvents <= 0) { + if (ctx == NULL || maxEvents <= 0) { + return BAD_FUNC_ARG; + } + + /* Events arg can be NULL only if peek */ + if (events == NULL && !(flags & WOLF_POLL_FLAG_PEEK)) { return BAD_FUNC_ARG; } #ifndef SINGLE_THREADED + /* In single threaded mode "event_queue.lock" doesn't exist */ if (LockMutex(&ctx->event_queue.lock) != 0) { return BAD_MUTEX_E; } @@ -17879,25 +17854,35 @@ int wolfSSL_CTX_poll(WOLFSSL_CTX* ctx, WOLF_EVENT* events, int maxEvents, { byte removeEvent = 0; - #ifdef WOLFSSL_ASYNC_CRYPT - if (event->type >= WOLF_EVENT_TYPE_ASYNC_FIRST && - event->type <= WOLF_EVENT_TYPE_ASYNC_LAST) - { - ret = wolfSSL_async_poll(event, flags); - } - #endif /* WOLFSSL_ASYNC_CRYPT */ - - /* If event is done add to returned event data */ - if (event->done) { - /* Check to make sure we have room for event */ - if (count >= maxEvents) { - break; /* Exit for */ + /* Optionally filter by ssl object pointer */ + if (ssl == NULL || (ssl == event->ssl)) { + if (flags & WOLF_POLL_FLAG_PEEK) { + if (events) { + /* Copy event data to provided buffer */ + XMEMCPY(&events[count], event, sizeof(WOLF_EVENT)); + } + count++; } + else { + /* Check hardware */ + if (flags & WOLF_POLL_FLAG_CHECK_HW) { + #ifdef WOLFSSL_ASYNC_CRYPT + if (event->type >= WOLF_EVENT_TYPE_ASYNC_FIRST && + event->type <= WOLF_EVENT_TYPE_ASYNC_LAST) + { + ret = wolfSSL_async_poll(event, flags); + } + #endif /* WOLFSSL_ASYNC_CRYPT */ + } - /* Copy event data to provided buffer */ - XMEMCPY(&events[count], event, sizeof(WOLF_EVENT)); - count++; - removeEvent = 1; + /* If event is done then return in 'events' argument */ + if (event->done) { + /* Copy event data to provided buffer */ + XMEMCPY(&events[count], event, sizeof(WOLF_EVENT)); + count++; + removeEvent = 1; + } + } } if (removeEvent) { @@ -17917,6 +17902,11 @@ int wolfSSL_CTX_poll(WOLFSSL_CTX* ctx, WOLF_EVENT* events, int maxEvents, event_prev = event; } + /* Check to make sure our event list isn't full */ + if (events && count >= maxEvents) { + break; /* Exit for */ + } + /* Check for error */ if (ret < 0) { break; /* Exit for */ @@ -17926,19 +17916,28 @@ int wolfSSL_CTX_poll(WOLFSSL_CTX* ctx, WOLF_EVENT* events, int maxEvents, #ifndef SINGLE_THREADED UnLockMutex(&ctx->event_queue.lock); #endif - - /* Return number of poperly populated events */ + + /* Return number of properly populated events */ if (eventCount) { *eventCount = count; } - /* Make sure success returns 0 */ - if (ret > 0) { - ret = 0; - } - return ret; } + +int wolfSSL_CTX_poll(WOLFSSL_CTX* ctx, WOLF_EVENT* events, + int maxEvents, unsigned char flags, int* eventCount) +{ + return _wolfSSL_CTX_poll(ctx, NULL, events, maxEvents, flags, eventCount); +} + +int wolfSSL_poll(WOLFSSL* ssl, WOLF_EVENT* events, + int maxEvents, unsigned char flags, int* eventCount) +{ + return _wolfSSL_CTX_poll(ssl->ctx, ssl, events, maxEvents, flags, + eventCount); +} + #endif /* HAVE_WOLF_EVENT */ #endif /* WOLFCRYPT_ONLY */ diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 046176542..3ee601b7d 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1806,11 +1806,14 @@ struct WOLF_EVENT { enum WOLF_POLL_FLAGS { WOLF_POLL_FLAG_CHECK_HW = 0x01, + WOLF_POLL_FLAG_PEEK = 0x02, }; -WOLFSSL_API int wolfssl_CTX_poll_peek(WOLFSSL_CTX* ctx, int* eventCount); -WOLFSSL_API int wolfSSL_CTX_poll(WOLFSSL_CTX* ctx, WOLF_EVENT* events, int maxEvents, - unsigned char flags, int* eventCount); +WOLFSSL_API int wolfSSL_CTX_poll(WOLFSSL_CTX* ctx, WOLF_EVENT* events, + int maxEvents, unsigned char flags, int* eventCount); +WOLFSSL_API int wolfSSL_poll(WOLFSSL* ssl, WOLF_EVENT* events, + int maxEvents, unsigned char flags, int* eventCount); + #endif /* HAVE_WOLF_EVENT */ #ifdef __cplusplus diff --git a/wolfssl/test.h b/wolfssl/test.h index 6d1ed6cd8..293ef0309 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -1908,19 +1908,17 @@ static INLINE const char* mymktemp(char *tempfn, int len, int num) #endif /* HAVE_SESSION_TICKET && CHACHA20 && POLY1305 */ #ifdef WOLFSSL_ASYNC_CRYPT - static INLINE int AsyncCryptPoll(WOLFSSL_CTX* ctx, WOLFSSL* ssl) + static INLINE int AsyncCryptPoll(WOLFSSL* ssl) { int ret, eventCount = 0; WOLF_EVENT events[1]; printf("Connect/Accept got WC_PENDING_E\n"); - ret = wolfSSL_CTX_poll(ctx, events, sizeof(events)/sizeof(WOLF_EVENT), WOLF_POLL_FLAG_CHECK_HW, &eventCount); + ret = wolfSSL_poll(ssl, events, sizeof(events)/sizeof(WOLF_EVENT), + WOLF_POLL_FLAG_CHECK_HW, &eventCount); if (ret == 0 && eventCount > 0) { - /* Check the SSL context in the event matches ours */ - if (events[0].ssl == ssl) { - ret = 1; /* Success */ - } + ret = 1; /* Success */ } return ret; From 2939c3ace1147b7cb0c3e9a03e87e7591919a8d1 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Thu, 31 Mar 2016 13:25:39 -0600 Subject: [PATCH 086/192] add ssl_FreeZeroDecode() to sniffer.c --- src/sniffer.c | 13 +++++++++++++ sslSniffer/sslSnifferTest/snifftest.c | 4 ++-- wolfssl/sniffer.h | 4 ++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/sniffer.c b/src/sniffer.c index 783003cde..4a9f18570 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -3245,10 +3245,23 @@ int ssl_DecodePacket(const byte* packet, int length, byte** data, char* error) /* Deallocator for the decoded data buffer. */ /* returns 0 on success, -1 on error */ int ssl_FreeDecodeBuffer(byte** data, char* error) +{ + return ssl_FreeZeroDecodeBuffer(data, 0, error); +} + + +/* Deallocator for the decoded data buffer, zeros out buffer. */ +/* returns 0 on success, -1 on error */ +int ssl_FreeZeroDecodeBuffer(byte** data, int sz, char* error) { (void)error; + if (sz < 0) { + return -1; + } + if (data != NULL) { + ForceZero(*data, (word32)sz); free(*data); *data = NULL; } diff --git a/sslSniffer/sslSnifferTest/snifftest.c b/sslSniffer/sslSnifferTest/snifftest.c index 58881498a..5e7757bde 100644 --- a/sslSniffer/sslSnifferTest/snifftest.c +++ b/sslSniffer/sslSnifferTest/snifftest.c @@ -313,8 +313,8 @@ int main(int argc, char** argv) } if (ret > 0) { data[ret] = 0; - printf("SSL App Data(%d:%d):%s\n", packetNumber, ret, data); - ssl_FreeDecodeBuffer(&data, err); + printf("SSL App Data(%d:%d):%s\n", packetNumber, ret, data); + ssl_FreeZeroDecodeBuffer(&data, ret, err); } } else if (saveFile) diff --git a/wolfssl/sniffer.h b/wolfssl/sniffer.h index 57d144fa6..9773f7987 100644 --- a/wolfssl/sniffer.h +++ b/wolfssl/sniffer.h @@ -62,6 +62,10 @@ SSL_SNIFFER_API int ssl_DecodePacket(const unsigned char* packet, int length, WOLFSSL_API SSL_SNIFFER_API int ssl_FreeDecodeBuffer(unsigned char** data, char* error); +WOLFSSL_API +SSL_SNIFFER_API int ssl_FreeZeroDecodeBuffer(unsigned char** data, int sz, + char* error); + WOLFSSL_API SSL_SNIFFER_API int ssl_Trace(const char* traceFile, char* error); From dd28d53cfb1aa4f71fa855dfb5467f02c743d56e Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 1 Apr 2016 09:23:46 -0700 Subject: [PATCH 087/192] Fix build issues with new async changes. Fixed issue with unused args preSigSz and preSigIdx with PSK enabled and ECC + RSA disabled. Fixed issue with missing qsSz variable in DoClientKeyExchange. Fixed missing DhAgree and DhKeyGen with NO_CERTS and PSK enabled. Fixed a couple scan-build warnings with "Value stored to '' is never read". --- src/internal.c | 26 ++++++++++++++++---------- wolfcrypt/benchmark/benchmark.c | 8 ++++---- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/internal.c b/src/internal.c index 9a3eb703d..b48343699 100755 --- a/src/internal.c +++ b/src/internal.c @@ -2061,6 +2061,9 @@ int EccMakeTempKey(WOLFSSL* ssl) #endif /* HAVE_ECC */ +#endif /* !NO_CERTS */ + +#if !defined(NO_CERTS) || !defined(NO_PSK) #if !defined(NO_DH) int DhGenKeyPair(WOLFSSL* ssl, @@ -2145,8 +2148,8 @@ int DhAgree(WOLFSSL* ssl, } #endif /* !NO_DH */ +#endif /* !NO_CERTS || !NO_PSK */ -#endif /* NO_CERTS */ /* This function inherits a WOLFSSL_CTX's fields into an SSL object. @@ -14445,6 +14448,13 @@ int DoSessionTicket(WOLFSSL* ssl, word32 exportSz = 0; #endif + #ifdef HAVE_QSH + word32 qshSz = 0; + if (ssl->peerQSHKeyPresent) { + qshSz = QSH_KeyGetSize(ssl); + } + #endif + (void)ssl; (void)sigSz; @@ -14602,14 +14612,9 @@ int DoSessionTicket(WOLFSSL* ssl, case KEYSHARE_BUILD: { + #if (!defined(NO_DH) && !defined(NO_RSA)) || defined(HAVE_ECC) word32 preSigSz, preSigIdx; - - #ifdef HAVE_QSH - word32 qshSz = 0; - if (ssl->peerQSHKeyPresent && ssl->options.haveQSH) { - qshSz = QSH_KeyGetSize(ssl); - } - #endif + #endif switch(ssl->specs.kea) { @@ -14731,7 +14736,8 @@ int DoSessionTicket(WOLFSSL* ssl, idx += LENGTH_SZ; XMEMCPY(output + idx, ssl->buffers.serverDH_Pub.buffer, ssl->buffers.serverDH_Pub.length); - idx += ssl->buffers.serverDH_Pub.length; + /* No need to update idx, since sizes are already set */ + /* idx += ssl->buffers.serverDH_Pub.length; */ break; } #endif /* !defined(NO_DH) && !defined(NO_PSK) */ @@ -17441,7 +17447,6 @@ int DoSessionTicket(WOLFSSL* ssl, { #ifdef HAVE_QSH word16 name; - int qshSz; if (ssl->options.haveQSH) { /* extension name */ @@ -17449,6 +17454,7 @@ int DoSessionTicket(WOLFSSL* ssl, idx += OPAQUE16_LEN; if (name == TLSX_QUANTUM_SAFE_HYBRID) { + int qshSz; /* if qshSz is larger than 0 it is the length of buffer used */ if ((qshSz = TLSX_QSHCipher_Parse(ssl, diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 31b2e7bea..fbb79c3e7 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -1391,16 +1391,16 @@ void bench_dh(void) (void)tmp; -#ifdef USE_CERT_BUFFERS_1024 +#if defined(NO_ASN) + dhKeySz = 1024; + /* do nothing, but don't use default FILE */ +#elif defined(USE_CERT_BUFFERS_1024) tmp = dh_key_der_1024; bytes = sizeof_dh_key_der_1024; dhKeySz = 1024; #elif defined(USE_CERT_BUFFERS_2048) tmp = dh_key_der_2048; bytes = sizeof_dh_key_der_2048; -#elif defined(NO_ASN) - dhKeySz = 1024; - /* do nothing, but don't use default FILE */ #else #error "need to define a cert buffer size" #endif /* USE_CERT_BUFFERS */ From 19f0769ec494ade6cbf8d8451ca7e31adaac168d Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 1 Apr 2016 10:55:01 -0700 Subject: [PATCH 088/192] Fix for scan-build warning where async changes make it appear like the output buffer could be NULL (even though its not). Added NULL check on the AddRecordHeader function. --- src/internal.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index b48343699..de74ae50b 100755 --- a/src/internal.c +++ b/src/internal.c @@ -3532,6 +3532,9 @@ static void AddRecordHeader(byte* output, word32 length, byte type, WOLFSSL* ssl /* record layer header */ rl = (RecordLayerHeader*)output; + if (rl == NULL) { + return; + } rl->type = type; rl->pvMajor = ssl->version.major; /* type and version same in each */ rl->pvMinor = ssl->version.minor; @@ -3539,13 +3542,15 @@ static void AddRecordHeader(byte* output, word32 length, byte type, WOLFSSL* ssl #ifdef WOLFSSL_ALTERNATIVE_DOWNGRADE if (ssl->options.side == WOLFSSL_CLIENT_END && ssl->options.connectState == CONNECT_BEGIN - && !ssl->options.resuming) + && !ssl->options.resuming) { rl->pvMinor = ssl->options.downgrade ? ssl->options.minDowngrade : ssl->version.minor; + } #endif - if (!ssl->options.dtls) + if (!ssl->options.dtls) { c16toa((word16)length, rl->length); + } else { #ifdef WOLFSSL_DTLS DtlsRecordLayerHeader* dtls; From 2d4aa1bbb5e7e33db8a40449c4c481b38dbbba0f Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 1 Apr 2016 12:57:33 -0700 Subject: [PATCH 089/192] Better fix for scan-build warning regarding possible use of NULL in AddRecordHeader. Scan-build considers paths where output is set to NULL, but ssl->spec.kea is corrupted/changed, which could result in output == NULL (even though it should never happen). So added proper NULL check in SendServerKeyExchange on AddHeader to make sure output isn't NULL. --- src/internal.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index de74ae50b..f072d8181 100755 --- a/src/internal.c +++ b/src/internal.c @@ -15468,8 +15468,15 @@ int DoSessionTicket(WOLFSSL* ssl, #endif #if defined(HAVE_ECC) - if (ssl->specs.kea == ecdhe_psk_kea || ssl->specs.kea == ecc_diffie_hellman_kea) { - AddHeaders(output, length, server_key_exchange, ssl); + if (ssl->specs.kea == ecdhe_psk_kea || + ssl->specs.kea == ecc_diffie_hellman_kea) { + /* Check output to make sure it was set */ + if (output) { + AddHeaders(output, length, server_key_exchange, ssl); + } + else { + ERROR_OUT(BUFFER_ERROR, exit_sske); + } } #endif /* HAVE_ECC */ From 85a9c55048c10e0f911728e416e0ba87a5048d02 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 6 Apr 2016 11:16:40 -0600 Subject: [PATCH 090/192] fix c89 build on windows --- cyassl/ctaocrypt/types.h | 1 - examples/echoserver/echoserver.c | 2 +- examples/server/server.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cyassl/ctaocrypt/types.h b/cyassl/ctaocrypt/types.h index 854e2df90..a8a24d589 100644 --- a/cyassl/ctaocrypt/types.h +++ b/cyassl/ctaocrypt/types.h @@ -34,7 +34,6 @@ #define CYASSL_MAX_16BIT WOLFSSL_MAX_16BIT #define CYASSL_MAX_ERROR_SZ WOLFSSL_MAX_ERROR_SZ #define cyassl_word wolfssl_word -#define CYASSL_MAX_ERROR_SZ WOLFSSL_MAX_ERROR_SZ #endif /* CTAO_CRYPT_TYPES_H */ diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index 99a05aa27..6ea0b6da2 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -279,8 +279,8 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) } while (ret != SSL_SUCCESS && err == WC_PENDING_E); if (ret != SSL_SUCCESS) { - err = CyaSSL_get_error(ssl, 0); char buffer[CYASSL_MAX_ERROR_SZ]; + err = CyaSSL_get_error(ssl, 0); printf("error = %d, %s\n", err, CyaSSL_ERR_error_string(err, buffer)); printf("SSL_accept failed\n"); CyaSSL_free(ssl); diff --git a/examples/server/server.c b/examples/server/server.c index 9609108bf..282341803 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -868,8 +868,8 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) } while (ret != SSL_SUCCESS && err == WC_PENDING_E); if (ret != SSL_SUCCESS) { - err = SSL_get_error(ssl, 0); char buffer[CYASSL_MAX_ERROR_SZ]; + err = SSL_get_error(ssl, 0); printf("error = %d, %s\n", err, ERR_error_string(err, buffer)); err_sys("SSL_accept failed"); } From 4f8fffbc37c5cc8073d6b498e32aca628dff19ab Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 1 Apr 2016 10:43:45 -0600 Subject: [PATCH 091/192] add wc_EccPublicKeyToDer function --- .gitignore | 1 + wolfcrypt/src/asn.c | 37 ++++++++++++++++++++++++++++++---- wolfcrypt/test/test.c | 20 ++++++++++++++++++ wolfssl/wolfcrypt/asn_public.h | 4 ++++ 4 files changed, 58 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 999db3fe8..47c38e3f1 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,7 @@ ntru-cert.pem ntru-key.raw key.der key.pem +ecc-public-key.der ecc-key.der ecc-key.pem certreq.der diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 25f5450dc..53c84c198 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -5877,9 +5877,8 @@ static int SetSerial(const byte* serial, byte* output) return length + CTC_SERIAL_SIZE; } - -#ifdef HAVE_ECC - +#endif /* defined(WOLFSSL_CERT_GEN) && !defined(NO_RSA) */ +#if defined(HAVE_ECC) && (defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN)) /* Write a public ECC key to output */ static int SetEccPublicKey(byte* output, ecc_key* key, int with_header) @@ -5978,8 +5977,38 @@ static int SetEccPublicKey(byte* output, ecc_key* key, int with_header) } -#endif /* HAVE_ECC */ +/* returns the size of buffer used, the public ECC key in DER format is stored + in output buffer + with_AlgCurve is a flag for when to include a header that has the Algorithm + and Curve infromation */ +int wc_EccPublicKeyToDer(ecc_key* key, byte* output, word32 inLen, + int with_AlgCurve) +{ + word32 infoSz = 0; + if (output == NULL || key == NULL) { + return BAD_FUNC_ARG; + } + + if (with_AlgCurve) { + int maxSetLength = 4; /* max buffer space needed for SetLength */ + int asnBit = 1; /* buffer space needed for asn bit string macro */ + + infoSz += asnBit; + infoSz += maxSetLength + asnBit; /* SetSequence buffer needed */ + infoSz += 2 * MAX_ALGO_SZ; /* buffer space for algorithm/curve */ + infoSz += asnBit; + infoSz += maxSetLength; + } + + if (inLen < wc_ecc_size(key) + infoSz) { + return BAD_FUNC_ARG; + } + + return SetEccPublicKey(output, key, with_AlgCurve); +} +#endif /* HAVE_ECC && (WOLFSSL_CERT_GEN || WOLFSSL_KEY_GEN) */ +#if defined(WOLFSSL_CERT_GEN) && !defined(NO_RSA) static INLINE byte itob(int number) { diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 741d4da36..97cf2b888 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -5001,6 +5001,7 @@ int rsa_test(void) free(tmp); return -5415; } + fclose(pemFile); free(pem); free(derCert); @@ -6486,6 +6487,25 @@ static int ecc_test_key_gen(WC_RNG* rng, int keySize) return -1029; } + /* test export of public key */ + derSz = wc_EccPublicKeyToDer(&userA, der, FOURK_BUF, 1); + if (derSz <= 0) { + return -5516; + } +#ifdef FREESCALE_MQX + keyFile = fopen("a:\\certs\\ecc-public-key.der", "wb"); +#else + keyFile = fopen("./ecc-public-key.der", "wb"); +#endif + if (!keyFile) { + return -5417; + } + ret = (int)fwrite(der, 1, derSz, keyFile); + fclose(keyFile); + if (ret != derSz) { + return -5418; + } + wc_ecc_free(&userA); return 0; diff --git a/wolfssl/wolfcrypt/asn_public.h b/wolfssl/wolfcrypt/asn_public.h index 4fdaf7005..1e8d4634b 100644 --- a/wolfssl/wolfcrypt/asn_public.h +++ b/wolfssl/wolfcrypt/asn_public.h @@ -259,6 +259,10 @@ WOLFSSL_API int wc_SetCertificatePolicies(Cert *cert, const char **input); /* public key helper */ WOLFSSL_API int wc_EccPublicKeyDecode(const byte*, word32*, ecc_key*, word32); + #if (defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN)) + WOLFSSL_API int wc_EccPublicKeyToDer(ecc_key*, byte* output, + word32 inLen, int with_AlgCurve); + #endif #endif /* DER encode signature */ From 665fb3076ce9b8a6f26c50a422570252f8a24849 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 4 Apr 2016 17:47:11 -0600 Subject: [PATCH 092/192] add trailing zero enum and correct call for export key size --- wolfcrypt/src/asn.c | 28 +++++++++++++++++----------- wolfssl/wolfcrypt/asn.h | 3 ++- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 53c84c198..c68d5c645 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -5883,7 +5883,7 @@ static int SetSerial(const byte* serial, byte* output) /* Write a public ECC key to output */ static int SetEccPublicKey(byte* output, ecc_key* key, int with_header) { - byte len[MAX_LENGTH_SZ + 1]; /* trailing 0 */ + byte len[MAX_LENGTH_SZ + TRAILING_ZERO]; int algoSz; int curveSz; int lenSz; @@ -5941,7 +5941,7 @@ static int SetEccPublicKey(byte* output, ecc_key* key, int with_header) #endif algoSz = SetAlgoID(ECDSAk, algo, oidKeyType, curveSz); - lenSz = SetLength(pubSz + 1, len); + lenSz = SetLength(pubSz + TRAILING_ZERO, len); len[lenSz++] = 0; /* trailing 0 */ /* write, 1 is for ASN_BIT_STRING */ @@ -5985,24 +5985,30 @@ int wc_EccPublicKeyToDer(ecc_key* key, byte* output, word32 inLen, int with_AlgCurve) { word32 infoSz = 0; + word32 keySz = 0; + int ret; if (output == NULL || key == NULL) { return BAD_FUNC_ARG; } if (with_AlgCurve) { - int maxSetLength = 4; /* max buffer space needed for SetLength */ - int asnBit = 1; /* buffer space needed for asn bit string macro */ + /* buffer space for algorithm/curve */ + infoSz += MAX_SEQ_SZ; + infoSz += 2 * MAX_ALGO_SZ; - infoSz += asnBit; - infoSz += maxSetLength + asnBit; /* SetSequence buffer needed */ - infoSz += 2 * MAX_ALGO_SZ; /* buffer space for algorithm/curve */ - infoSz += asnBit; - infoSz += maxSetLength; + /* buffer space for public key sequence */ + infoSz += MAX_SEQ_SZ; + infoSz += TRAILING_ZERO; } - if (inLen < wc_ecc_size(key) + infoSz) { - return BAD_FUNC_ARG; + if ((ret = wc_ecc_export_x963(key, NULL, &keySz)) != LENGTH_ONLY_E) { + WOLFSSL_MSG("Error in getting ECC public key size"); + return ret; + } + + if (inLen < keySz + infoSz) { + return BUFFER_E; } return SetEccPublicKey(output, key, with_AlgCurve); diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index 50d0c6c4f..dd54ffb5b 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -195,7 +195,8 @@ enum Misc_ASN { EIGHTK_BUF = 8192, /* Tmp buffer size */ MAX_PUBLIC_KEY_SZ = MAX_NTRU_ENC_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ * 2, /* use bigger NTRU size */ - HEADER_ENCRYPTED_KEY_SIZE = 88 /* Extra header size for encrypted key */ + HEADER_ENCRYPTED_KEY_SIZE = 88,/* Extra header size for encrypted key */ + TRAILING_ZERO = 1 /* Used for size of zero pad */ }; From 5b4f17545b778fe381ee97b1da888eeb66aa128a Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 6 Apr 2016 09:25:53 -0600 Subject: [PATCH 093/192] autoconf checks on some builds that break, macro for no server, and user rsa --- configure.ac | 17 +++++++++++++++++ src/internal.c | 5 ++++- src/ssl.c | 15 +++++++++++++-- wolfcrypt/test/test.c | 3 ++- wolfssl/wolfcrypt/asn_public.h | 3 +++ wolfssl/wolfcrypt/settings.h | 6 ++++++ 6 files changed, 45 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index ba50a4b1a..221e365df 100644 --- a/configure.ac +++ b/configure.ac @@ -2568,6 +2568,23 @@ AS_IF([test "x$ENABLED_OCSP" = "xyes" && \ test "x$ENABLED_ECC" = "xno"], [AC_MSG_ERROR([please enable rsa or ecc if enabling ocsp.])]) +# checks for pkcs7 needed enables +AS_IF([test "x$ENABLED_PKCS7" = "xyes" && \ + test "x$ENABLED_RSA" = "xno"], + [AC_MSG_ERROR([please enable rsa if enabling pkcs7.])]) + +AS_IF([test "x$ENABLED_PKCS7" = "xyes" && \ + test "x$ENABLED_SHA" = "xno"], + [AC_MSG_ERROR([please enable sha if enabling pkcs7.])]) + +AS_IF([test "x$ENABLED_LEANTLS" = "xyes" && \ + test "x$ENABLED_ECC" = "xno"], + [AC_MSG_ERROR([please enable ecc if enabling leantls.])]) + +AS_IF([test "x$ENABLED_SNIFFER" = "xyes" && \ + test "x$ENABLED_RSA" = "xno"], + [AC_MSG_ERROR([please enable rsa if enabling sniffer.])]) + ################################################################################ # Update CFLAGS based on options # ################################################################################ diff --git a/src/internal.c b/src/internal.c index f072d8181..2c6257e9b 100755 --- a/src/internal.c +++ b/src/internal.c @@ -9080,7 +9080,7 @@ int SendCertificateRequest(WOLFSSL* ssl) return SendBuffered(ssl); } - +#ifndef NO_WOLFSSL_SERVER #if defined(HAVE_CERTIFICATE_STATUS_REQUEST) \ || defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2) static int BuildCertificateStatus(WOLFSSL* ssl, byte type, buffer* status, @@ -9178,6 +9178,7 @@ static int BuildCertificateStatus(WOLFSSL* ssl, byte type, buffer* status, return ret; } #endif +#endif /* NO_WOLFSSL_SERVER */ int SendCertificateStatus(WOLFSSL* ssl) @@ -9199,6 +9200,7 @@ int SendCertificateStatus(WOLFSSL* ssl) switch (status_type) { + #ifndef NO_WOLFSSL_SERVER #if defined(HAVE_CERTIFICATE_STATUS_REQUEST) \ || defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2) /* case WOLFSSL_CSR_OCSP: */ @@ -9490,6 +9492,7 @@ int SendCertificateStatus(WOLFSSL* ssl) break; #endif /* HAVE_CERTIFICATE_STATUS_REQUEST_V2 */ + #endif /* NO_WOLFSSL_SERVER */ default: break; diff --git a/src/ssl.c b/src/ssl.c index af69cbc48..f916c185c 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -1879,11 +1879,13 @@ static const char *EVP_AES_256_CBC = "AES-256-CBC"; #endif static const int EVP_AES_SIZE = 11; +#ifndef NO_DES3 static const char *EVP_DES_CBC = "DES-CBC"; static const int EVP_DES_SIZE = 7; static const char *EVP_DES_EDE3_CBC = "DES-EDE3-CBC"; static const int EVP_DES_EDE3_SIZE = 12; +#endif #ifdef HAVE_IDEA static const char *EVP_IDEA_CBC = "IDEA-CBC"; @@ -8437,6 +8439,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) if (XSTRNCMP(md, "MD5", 3) != 0) return 0; /* only support CBC DES and AES for now */ + #ifndef NO_DES3 if (XSTRNCMP(type, EVP_DES_CBC, EVP_DES_SIZE) == 0) { keyLen = DES_KEY_SIZE; ivLen = DES_IV_SIZE; @@ -8445,7 +8448,9 @@ int wolfSSL_set_compression(WOLFSSL* ssl) keyLen = DES3_KEY_SIZE; ivLen = DES_IV_SIZE; } - else if (XSTRNCMP(type, EVP_AES_128_CBC, EVP_AES_SIZE) == 0) { + else + #endif /* NO_DES3 */ + if (XSTRNCMP(type, EVP_AES_128_CBC, EVP_AES_SIZE) == 0) { keyLen = AES_128_KEY_SIZE; ivLen = AES_IV_SIZE; } @@ -8797,6 +8802,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) } +#ifndef NO_DES3 const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_cbc(void) { WOLFSSL_ENTER("wolfSSL_EVP_des_cbc"); @@ -8809,7 +8815,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) WOLFSSL_ENTER("wolfSSL_EVP_des_ede3_cbc"); return EVP_DES_EDE3_CBC; } - +#endif /* NO_DES3 */ const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_rc4(void) { @@ -10962,12 +10968,15 @@ char* wolfSSL_CIPHER_description(WOLFSSL_CIPHER* cipher, char* in, int len) } +#ifndef NO_SESSION_CACHE + WOLFSSL_SESSION* wolfSSL_get1_session(WOLFSSL* ssl) { /* sessions are stored statically, no need for reference count */ return wolfSSL_get_session(ssl); } +#endif /* NO_SESSION_CACHE */ void wolfSSL_X509_free(WOLFSSL_X509* x509) { @@ -17367,6 +17376,7 @@ int wolfSSL_set_tlsext_host_name(WOLFSSL* ssl, const char* host_name) } +#ifndef NO_WOLFSSL_SERVER const char * wolfSSL_get_servername(WOLFSSL* ssl, byte type) { void * serverName = NULL; @@ -17375,6 +17385,7 @@ const char * wolfSSL_get_servername(WOLFSSL* ssl, byte type) TLSX_SNI_GetRequest(ssl->extensions, type, &serverName); return (const char *)serverName; } +#endif /* NO_WOLFSSL_SERVER */ #endif /* HAVE_SNI */ diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 741d4da36..3dfd92856 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -4103,7 +4103,8 @@ int rsa_test(void) #ifndef WC_NO_RSA_OAEP /* OAEP padding testing */ - #if !defined(HAVE_FAST_RSA) && !defined(HAVE_FIPS) + #if !defined(HAVE_FAST_RSA) && !defined(HAVE_USER_RSA) && \ + !defined(HAVE_FIPS) #ifndef NO_SHA XMEMSET(plain, 0, sizeof(plain)); ret = wc_RsaPublicEncrypt_ex(in, inLen, out, sizeof(out), &key, &rng, diff --git a/wolfssl/wolfcrypt/asn_public.h b/wolfssl/wolfcrypt/asn_public.h index 4fdaf7005..135f2878d 100644 --- a/wolfssl/wolfcrypt/asn_public.h +++ b/wolfssl/wolfcrypt/asn_public.h @@ -96,6 +96,9 @@ enum Ctc_Misc { #ifndef HAVE_ECC typedef struct ecc_key ecc_key; #endif +#ifdef NO_RSA + typedef struct RsaKey RsaKey; +#endif typedef struct CertName { char country[CTC_NAME_SIZE]; diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 5e5d1f34d..89c0000ac 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -1162,6 +1162,12 @@ static char *fgets(char *buff, int sz, FILE *fp) #endif #endif /* WOLFSSL_ASYNC_CRYPT */ +/* leantls checks */ +#ifdef WOLFSSL_LEANTLS + #ifndef HAVE_ECC + #error leantls build needs ECC + #endif +#endif /* WOLFSSL_LEANTLS*/ /* Place any other flags or defines here */ From 8d040ad41f2d0013439638a15106f995939ca0e3 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Thu, 24 Mar 2016 11:07:05 -0600 Subject: [PATCH 094/192] uTasker: add initial port, WOLFSSL_UTASKER --- src/internal.c | 7 +++++ wolfcrypt/src/logging.c | 3 ++ wolfssl/openssl/ssl.h | 5 ++++ wolfssl/wolfcrypt/settings.h | 58 ++++++++++++++++++++++++++++++++++-- wolfssl/wolfcrypt/types.h | 4 +-- 5 files changed, 73 insertions(+), 4 deletions(-) diff --git a/src/internal.c b/src/internal.c index f072d8181..c46235b42 100755 --- a/src/internal.c +++ b/src/internal.c @@ -3351,6 +3351,13 @@ ProtocolVersion MakeDTLSv1_2(void) return (word32) Seconds_get(); } +#elif defined(WOLFSSL_UTASKER) + + word32 LowResTimer(void) + { + return (word32)(uTaskerSystemTick / TICK_RESOLUTION); + } + #elif defined(USER_TICKS) #if 0 word32 LowResTimer(void) diff --git a/wolfcrypt/src/logging.c b/wolfcrypt/src/logging.c index 4351f7209..9a4fac5f4 100644 --- a/wolfcrypt/src/logging.c +++ b/wolfcrypt/src/logging.c @@ -122,6 +122,9 @@ static void wolfssl_log(const int logLevel, const char *const logMessage) fflush(stdout) ; #elif defined(WOLFSSL_LOG_PRINTF) printf("%s\n", logMessage); +#elif defined(WOLFSSL_UTASKER) + fnDebugMsg((char*)logMessage); + fnDebugMsg("\r\n"); #else fprintf(stderr, "%s\n", logMessage); #endif diff --git a/wolfssl/openssl/ssl.h b/wolfssl/openssl/ssl.h index f9bf3f03e..67902a679 100644 --- a/wolfssl/openssl/ssl.h +++ b/wolfssl/openssl/ssl.h @@ -41,6 +41,11 @@ #undef X509_NAME #endif +#ifdef WOLFSSL_UTASKER + /* tcpip.h clashes */ + #undef ASN1_INTEGER +#endif + typedef WOLFSSL SSL; typedef WOLFSSL_SESSION SSL_SESSION; diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 5e5d1f34d..527b829cd 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -139,6 +139,9 @@ /* Uncomment next line to enable asynchronous crypto WC_PENDING_E */ /* #define WOLFSSL_ASYNC_CRYPT */ +/* Uncomment next line if building for uTasker */ +/* #define WOLFSSL_UTASKER */ + #include #ifdef WOLFSSL_USER_SETTINGS @@ -349,9 +352,60 @@ #endif +#ifdef WOLFSSL_UTASKER + /* uTasker configuration - used for fnRandom() */ + #include "config.h" + + #define SINGLE_THREADED + #define NO_WOLFSSL_DIR + #define WOLFSSL_HAVE_MIN + #define NO_WRITEV + + #define HAVE_ECC + #define ALT_ECC_SIZE + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define ECC_TIMING_RESISTANT + + /* used in wolfCrypt test */ + #define NO_MAIN_DRIVER + #define USE_CERT_BUFFERS_2048 + + /* uTasker port uses RAW sockets, use I/O callbacks + * See wolfSSL uTasker example for sample callbacks */ + #define WOLFSSL_USER_IO + + /* uTasker filesystem not ported */ + #define NO_FILESYSTEM + + /* uTasker RNG is abstracted, calls HW RNG when available */ + #define CUSTOM_RAND_GENERATE fnRandom + #define CUSTOM_RAND_TYPE unsigned short + + /* use uTasker std library replacements where available */ + #define STRING_USER + #define XMEMCPY(d,s,l) uMemcpy((d),(s),(l)) + #define XMEMSET(b,c,l) uMemset((b),(c),(l)) + #define XMEMCMP(s1,s2,n) uMemcmp((s1),(s2),(n)) + #define XMEMMOVE(d,s,l) memmove((d),(s),(l)) + + #define XSTRLEN(s1) uStrlen((s1)) + #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n)) + #define XSTRSTR(s1,s2) strstr((s1),(s2)) + #define XSTRNSTR(s1,s2,n) mystrnstr((s1),(s2),(n)) + #define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n)) + #define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n)) + #define XSTRNCASECMP(s1,s2,n) _strnicmp((s1),(s2),(n)) + #if defined(WOLFSSL_CERT_EXT) || defined(HAVE_ALPN) + #define XSTRTOK strtok_r + #endif +#endif + + /* Micrium will use Visual Studio for compilation but not the Win32 API */ -#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && !defined(FREERTOS_TCP)\ - && !defined(EBSNET) && !defined(WOLFSSL_EROAD) +#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \ + !defined(FREERTOS_TCP) && !defined(EBSNET) && !defined(WOLFSSL_EROAD) && \ + !defined(WOLFSSL_UTASKER) #define USE_WINDOWS_API #endif diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index af30c926e..5ce3c32a0 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -160,8 +160,8 @@ /* Micrium will use Visual Studio for compilation but not the Win32 API */ - #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && !defined(FREERTOS_TCP) \ - && !defined(EBSNET) + #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \ + !defined(FREERTOS_TCP) && !defined(EBSNET) && !defined(WOLFSSL_UTASKER) #define USE_WINDOWS_API #endif From 46f4be357b5514b2235247441bf5c230013381d5 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Fri, 25 Mar 2016 11:33:27 -0600 Subject: [PATCH 095/192] uTasker: add note about XTIME to settings.h --- src/internal.c | 2 +- wolfssl/wolfcrypt/settings.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index c46235b42..c27b072f5 100755 --- a/src/internal.c +++ b/src/internal.c @@ -3355,7 +3355,7 @@ ProtocolVersion MakeDTLSv1_2(void) word32 LowResTimer(void) { - return (word32)(uTaskerSystemTick / TICK_RESOLUTION); + return (word32)(uTaskerSystemTick / TICK_RESOLUTION); } #elif defined(USER_TICKS) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 527b829cd..5664792a7 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -382,6 +382,13 @@ #define CUSTOM_RAND_GENERATE fnRandom #define CUSTOM_RAND_TYPE unsigned short + /* user needs to define XTIME to function that provides + * seconds since Unix epoch */ + #ifndef XTIME + #error XTIME must be defined in wolfSSL settings.h + /* #define XTIME fnSecondsSinceEpoch */ + #endif + /* use uTasker std library replacements where available */ #define STRING_USER #define XMEMCPY(d,s,l) uMemcpy((d),(s),(l)) From 2aab090c8b732d0872d1eb2e5411ef9c08316d36 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 1 Apr 2016 10:42:13 -0700 Subject: [PATCH 096/192] Fixes when using the STM32 with STM32F2_HASH defined. --- wolfcrypt/src/md5.c | 1 + wolfcrypt/src/sha.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/md5.c b/wolfcrypt/src/md5.c index 48eab1bdf..dfda77915 100644 --- a/wolfcrypt/src/md5.c +++ b/wolfcrypt/src/md5.c @@ -64,6 +64,7 @@ * document (See note in README). */ #include "stm32f2xx.h" + #include "stm32f2xx_hash.h" void wc_InitMd5(Md5* md5) { diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index b09b00c4d..9de702a45 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -136,7 +136,7 @@ int wc_ShaUpdate(Sha* sha, const byte* data, word32 len) /* append partial to existing stored block */ XMEMCPY((byte*)sha->buffer + sha->buffLen, data, len); sha->buffLen += len; - return; + return 0; } } From 993972162ee482028584114a5402d60e935d4228 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 1 Apr 2016 15:45:53 -0700 Subject: [PATCH 097/192] MinGW fixes, server port assigning cleanup and ping test cleanup. Fixes issue with visibility detection with MinGW. The visibility.m4 script was not actually trying to call the hidden function, which caused MinGW to detect improperly that visibility was supported. Fix for bogusFile on Windows build. Fixes to build warnings for unused variable 'res' and signed/unsigned comparison for sizeof min(). Cleanup of the server side port assignment to allow use with Windows/MinGW/Cygwin. If Windows uses new GetRandomPort() function in test.h to get port in in the 49152 - 65535 range. If *nix then uses the tcp_listen returned port. Otherwise uses the default wolfSSLPort. Refactor of the ping test code to use common file and properly handle ping count differences (Windows "-c" vs. *Nix style "-n"). Workaround for MinGW and cyassl/options.h getting file permissions error. Added non-fatal compile warning if using MinGW that "strtok_s" might be missing along with a link to public domain source that can be used. --- configure.ac | 24 ++++++++++++++++++--- examples/echoserver/echoserver.c | 25 ++++++++++++++-------- examples/server/server.c | 11 ++++++---- m4/visibility.m4 | 8 +++---- scripts/external.test | 4 +--- scripts/google.test | 4 +--- scripts/include.am | 4 +++- scripts/ocsp-stapling.test | 4 +--- scripts/ocsp.test | 4 +--- scripts/ping.test | 29 +++++++++++++++++++++++++ tests/api.c | 36 ++++++++++++++++++++++++-------- tests/unit.c | 1 + testsuite/testsuite.c | 1 + wolfcrypt/src/asn.c | 2 +- wolfcrypt/src/dsa.c | 2 +- wolfssl/test.h | 14 +++++++++++++ wolfssl/wolfcrypt/types.h | 7 +++++++ wolfssl/wolfcrypt/visibility.h | 6 ++++-- 18 files changed, 140 insertions(+), 46 deletions(-) create mode 100755 scripts/ping.test diff --git a/configure.ac b/configure.ac index ba50a4b1a..a9553419e 100644 --- a/configure.ac +++ b/configure.ac @@ -2621,12 +2621,22 @@ fi LIB_SOCKET_NSL AX_HARDEN_CC_COMPILER_FLAGS -# link to ws2_32 if on mingw +# if mingw then link to ws2_32 for sockets case $host_os in - *mingw32) + mingw*) LDFLAGS="$LDFLAGS -lws2_32" ;; esac +# add wolfSSL defines for shared/static +if test "$enable_shared" = "yes" +then + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHARED" +fi +if test "$enable_static" = "yes" +then + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_STATIC" +fi + # add user C_EXTRA_FLAGS back CFLAGS="$CFLAGS $USER_C_EXTRA_FLAGS" OPTION_FLAGS="$USER_CFLAGS $USER_C_EXTRA_FLAGS $AM_CFLAGS" @@ -2700,7 +2710,7 @@ for option in $OPTION_FLAGS; do noequalsign=`echo $defonly | sed 's/=/ /'` if test "$noequalsign" = "NDEBUG" || test "$noequalsign" = "DEBUG" then - echo "not outputing (N)DEBUG to $OPTION_FILE" + echo "not outputting (N)DEBUG to $OPTION_FILE" continue fi @@ -2750,8 +2760,16 @@ done < $OPTION_FILE # switch ifdef protection in cyassl/option.h to CYASSL_OPTONS_H, remove bak sed -i.bak 's/WOLFSSL_OPTIONS_H/CYASSL_OPTIONS_H/g' cyassl/options.h + +# workaround for mingw sed that may get "Permission denied" trying to preserver permissions +case $host_os in + mingw*) + chmod u+w cyassl/options.h ;; +esac + rm cyassl/options.h.bak + # output config summary echo "---" echo "Configuration summary for $PACKAGE_NAME version $VERSION" diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index 6ea0b6da2..fb982af3f 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -84,7 +84,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) int outCreated = 0; int shutDown = 0; int useAnyAddr = 0; - word16 port = wolfSSLPort; + word16 port; int argc = ((func_args*)args)->argc; char** argv = ((func_args*)args)->argv; @@ -114,14 +114,21 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) doPSK = 1; #endif - #if defined(NO_MAIN_DRIVER) && !defined(USE_WINDOWS_API) && \ - !defined(CYASSL_SNIFFER) && !defined(WOLFSSL_MDK_SHELL) && \ - !defined(CYASSL_TIRTOS) - port = 0; - #endif - #if defined(USE_ANY_ADDR) - useAnyAddr = 1; - #endif +#if defined(USE_WINDOWS_API) + /* Generate random port for testing */ + port = GetRandomPort(); +#elif defined(NO_MAIN_DRIVER) && !defined(CYASSL_SNIFFER) && \ + !defined(WOLFSSL_MDK_SHELL) && !defined(CYASSL_TIRTOS) + /* Let tcp_listen assign port */ + port = 0; +#else + /* Use default port */ + port = wolfSSLPort; +#endif + +#if defined(USE_ANY_ADDR) + useAnyAddr = 1; +#endif #ifdef CYASSL_TIRTOS fdOpenSession(Task_self()); diff --git a/examples/server/server.c b/examples/server/server.c index 282341803..0a7d1a8fc 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -398,10 +398,6 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) case 'p' : port = (word16)atoi(myoptarg); - #if defined(USE_WINDOWS_API) - if (port == 0) - err_sys("port number cannot be 0"); - #endif break; case 'w' : @@ -726,6 +722,13 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) err_sys("UseSNI failed"); #endif +#ifdef USE_WINDOWS_API + if (port == 0) { + /* Generate random port for testing */ + port = GetRandomPort(); + } +#endif /* USE_WINDOWS_API */ + while (1) { /* allow resume option */ if(resumeCount > 1) { diff --git a/m4/visibility.m4 b/m4/visibility.m4 index 75c34b6e1..757154f33 100644 --- a/m4/visibility.m4 +++ b/m4/visibility.m4 @@ -1,5 +1,5 @@ -# visibility.m4 serial 4 (gettext-0.18.2) -dnl Copyright (C) 2005, 2008, 2010-2011 Free Software Foundation, Inc. +# visibility.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -12,7 +12,7 @@ dnl __attribute__((__visibility__("hidden"))) and dnl __attribute__((__visibility__("default"))). dnl Does *not* test for __visibility__("protected") - which has tricky dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on -dnl MacOS X. +dnl Mac OS X. dnl Does *not* test for __visibility__("internal") - which has processor dnl dependent semantics. dnl Does *not* test for #pragma GCC visibility push(hidden) - which is @@ -58,7 +58,7 @@ AC_DEFUN([gl_VISIBILITY], extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); extern __attribute__((__visibility__("default"))) int exportedfunc (void); - void dummyfunc (void) {} + int hiddenfunc (void) { return 0; } ]], [[]])], [gl_cv_cc_visibility=yes], diff --git a/scripts/external.test b/scripts/external.test index f2ba8d125..3eb84bbc7 100755 --- a/scripts/external.test +++ b/scripts/external.test @@ -16,9 +16,7 @@ else fi # is our desired server there? -ping -c 2 $server -RESULT=$? -[ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 0 +./scripts/ping.test $server 2 # client test against the server ./examples/client/client -X -C -h $server -p 443 -g -A $ca diff --git a/scripts/google.test b/scripts/google.test index 8a3ca3750..d84b4da2d 100755 --- a/scripts/google.test +++ b/scripts/google.test @@ -7,9 +7,7 @@ server=www.google.com [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1 # is our desired server there? -ping -c 2 $server -RESULT=$? -[ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 0 +./scripts/ping.test $server 2 # client test against the server ./examples/client/client -X -C -h $server -p 443 -g -d diff --git a/scripts/include.am b/scripts/include.am index 53087fdc5..0e1bffe52 100644 --- a/scripts/include.am +++ b/scripts/include.am @@ -57,6 +57,8 @@ dist_noinst_SCRIPTS+= scripts/google.test endif endif -EXTRA_DIST += scripts/testsuite.pcap +EXTRA_DIST += scripts/testsuite.pcap \ + scripts/ping.test + # leave openssl.test as extra until non bash works EXTRA_DIST += scripts/openssl.test diff --git a/scripts/ocsp-stapling.test b/scripts/ocsp-stapling.test index 7d711d417..572310a01 100755 --- a/scripts/ocsp-stapling.test +++ b/scripts/ocsp-stapling.test @@ -10,9 +10,7 @@ ca=certs/external/ca-verisign-g5.pem [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1 # is our desired server there? - login.live.com doesn't answers PING -# ping -c 2 $server -# RESULT=$? -# [ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 0 +#./scripts/ping.test $server 2 # client test against the server ./examples/client/client -X -C -h $server -p 443 -A $ca -g -W 1 diff --git a/scripts/ocsp.test b/scripts/ocsp.test index 66d4488ad..807c80533 100755 --- a/scripts/ocsp.test +++ b/scripts/ocsp.test @@ -8,9 +8,7 @@ ca=certs/external/ca-globalsign-root-r2.pem [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1 # is our desired server there? -ping -c 2 $server -RESULT=$? -[ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 0 +./scripts/ping.test $server 2 # client test against the server ./examples/client/client -X -C -h $server -p 443 -A $ca -g -o diff --git a/scripts/ping.test b/scripts/ping.test new file mode 100755 index 000000000..a6e21277f --- /dev/null +++ b/scripts/ping.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# ping.test + +# defaults +server=www.wolfssl.com +tries=2 + +# populate args +if [ "$#" -gt 1 ]; then + tries=$2 +fi +if [ "$#" -gt 0 ]; then + server=$1 +fi + +# determine os +OS="`uname`" +case $OS in + MINGW* | MSYS*) PINGSW=-n ;; + *) PINGSW=-c ;; +esac + +# is our desired server there? +ping $PINGSW $tries $server +RESULT=$? +[ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 0 + +exit 0 diff --git a/tests/api.c b/tests/api.c index 9a67d5f88..da2273c53 100644 --- a/tests/api.c +++ b/tests/api.c @@ -58,7 +58,13 @@ static const char* passed = "passed"; static const char* failed = "failed"; #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) -static const char* bogusFile = "/dev/null"; + static const char* bogusFile = + #ifdef _WIN32 + "NUL" + #else + "/dev/null" + #endif + ; #endif /*----------------------------------------------------------------------------* @@ -485,7 +491,7 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_nofail(void* args) { SOCKET_T sockfd = 0; SOCKET_T clientfd = 0; - word16 port = wolfSSLPort; + word16 port; WOLFSSL_METHOD* method = 0; WOLFSSL_CTX* ctx = 0; @@ -503,10 +509,16 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_nofail(void* args) method = wolfSSLv23_server_method(); ctx = wolfSSL_CTX_new(method); -#if defined(NO_MAIN_DRIVER) && !defined(USE_WINDOWS_API) && \ - !defined(WOLFSSL_SNIFFER) && !defined(WOLFSSL_MDK_SHELL) && \ - !defined(WOLFSSL_TIRTOS) +#if defined(USE_WINDOWS_API) + /* Generate random port for testing */ + port = GetRandomPort(); +#elif defined(NO_MAIN_DRIVER) && !defined(WOLFSSL_SNIFFER) && \ + !defined(WOLFSSL_MDK_SHELL) && !defined(WOLFSSL_TIRTOS) + /* Let tcp_listen assign port */ port = 0; +#else + /* Use default port */ + port = wolfSSLPort; #endif wolfSSL_CTX_set_verify(ctx, @@ -704,7 +716,7 @@ static THREAD_RETURN WOLFSSL_THREAD run_wolfssl_server(void* args) WOLFSSL* ssl = NULL; SOCKET_T sfd = 0; SOCKET_T cfd = 0; - word16 port = wolfSSLPort; + word16 port; char msg[] = "I hear you fa shizzle!"; int len = (int) XSTRLEN(msg); @@ -716,10 +728,16 @@ static THREAD_RETURN WOLFSSL_THREAD run_wolfssl_server(void* args) #endif ((func_args*)args)->return_code = TEST_FAIL; -#if defined(NO_MAIN_DRIVER) && !defined(USE_WINDOWS_API) && \ - !defined(WOLFSSL_SNIFFER) && !defined(WOLFSSL_MDK_SHELL) && \ - !defined(WOLFSSL_TIRTOS) +#if defined(USE_WINDOWS_API) + /* Generate random port for testing */ + port = GetRandomPort(); +#elif defined(NO_MAIN_DRIVER) && !defined(WOLFSSL_SNIFFER) && \ + !defined(WOLFSSL_MDK_SHELL) && !defined(WOLFSSL_TIRTOS) + /* Let tcp_listen assign port */ port = 0; +#else + /* Use default port */ + port = wolfSSLPort; #endif wolfSSL_CTX_set_verify(ctx, diff --git a/tests/unit.c b/tests/unit.c index c1b97c708..924510792 100644 --- a/tests/unit.c +++ b/tests/unit.c @@ -152,6 +152,7 @@ void join_thread(THREAD_TYPE thread) assert(res == WAIT_OBJECT_0); res = CloseHandle((HANDLE)thread); assert(res); + (void)res; /* Suppress un-used variable warning */ #endif } diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c index 4f9d1f17f..e2054ea5a 100644 --- a/testsuite/testsuite.c +++ b/testsuite/testsuite.c @@ -332,6 +332,7 @@ void join_thread(THREAD_TYPE thread) assert(res == WAIT_OBJECT_0); res = CloseHandle((HANDLE)thread); assert(res); + (void)res; /* Suppress un-used variable warning */ #endif } diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index c68d5c645..517d374ca 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -7093,7 +7093,7 @@ static int WriteCertBody(DerCert* der, byte* buffer) if (der->extensionsSz) { /* extensions */ XMEMCPY(buffer + idx, der->extensions, min(der->extensionsSz, - sizeof(der->extensions))); + (int)sizeof(der->extensions))); idx += der->extensionsSz; } diff --git a/wolfcrypt/src/dsa.c b/wolfcrypt/src/dsa.c index a066705a2..8eeb4efcf 100644 --- a/wolfcrypt/src/dsa.c +++ b/wolfcrypt/src/dsa.c @@ -347,7 +347,7 @@ int wc_DsaSign(const byte* digest, byte* out, DsaKey* key, WC_RNG* rng) int ret, sz; byte buffer[DSA_HALF_SIZE]; - sz = min(sizeof(buffer), mp_unsigned_bin_size(&key->q)); + sz = min((int)sizeof(buffer), mp_unsigned_bin_size(&key->q)); /* generate k */ ret = wc_RNG_GenerateBlock(rng, buffer, sz); diff --git a/wolfssl/test.h b/wolfssl/test.h index 293ef0309..6572155e3 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -1925,4 +1925,18 @@ static INLINE const char* mymktemp(char *tempfn, int len, int num) } #endif +static INLINE word16 GetRandomPort(void) +{ + word16 port = 0; + + /* Generate random port for testing */ + WC_RNG rng; + if (wc_InitRng(&rng) == 0) { + wc_RNG_GenerateBlock(&rng, (byte*)&port, sizeof(port)); + port |= 0xC000; /* Make sure its in the 49152 - 65535 range */ + wc_FreeRng(&rng); + } + return port; +} + #endif /* wolfSSL_TEST_H */ diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index af30c926e..89c1a9566 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -223,6 +223,13 @@ #define XSTRTOK strtok_r #else #define XSTRTOK strtok_s + + #ifdef __MINGW32__ + #pragma GCC diagnostic push + #pragma GCC diagnostic warning "-Wcpp" + #warning "MinGW may be missing strtok_s. You can find a public domain implementation here: https://github.com/fletcher/MultiMarkdown-4/blob/master/strtok.c" + #pragma GCC diagnostic pop + #endif #endif #endif #endif diff --git a/wolfssl/wolfcrypt/visibility.h b/wolfssl/wolfcrypt/visibility.h index 82f110f55..90e4c89d5 100644 --- a/wolfssl/wolfcrypt/visibility.h +++ b/wolfssl/wolfcrypt/visibility.h @@ -47,7 +47,8 @@ #define WOLFSSL_API __global #define WOLFSSL_LOCAL __hidden #elif defined(_MSC_VER) - #ifdef WOLFSSL_DLL + #if defined(WOLFSSL_DLL) || \ + (defined(__MINGW32__) && defined(WOLFSSL_SHARED)) #define WOLFSSL_API __declspec(dllexport) #else #define WOLFSSL_API @@ -59,7 +60,8 @@ #endif /* HAVE_VISIBILITY */ #else /* BUILDING_WOLFSSL */ #if defined(_MSC_VER) - #ifdef WOLFSSL_DLL + #if defined(WOLFSSL_DLL) || \ + (defined(__MINGW32__) && defined(WOLFSSL_SHARED)) #define WOLFSSL_API __declspec(dllimport) #else #define WOLFSSL_API From b75dc127f3ba330ad3926e9d9d1352453a3f37b5 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 8 Apr 2016 11:53:40 -0700 Subject: [PATCH 098/192] 1. Attempting to perform 8 AES-CBC decrypt operations simultaneously. 2. Added code to test large AES-CBC decrypts. --- wolfcrypt/src/aes.c | 12 ++ wolfcrypt/src/aes_asm.s | 250 ++++++++++++++++++++++++++++++++++++++++ wolfcrypt/test/test.c | 83 +++++++++++++ 3 files changed, 345 insertions(+) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 6d6eae21e..a3c98370b 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -1094,10 +1094,17 @@ void AES_CBC_encrypt(const unsigned char* in, unsigned char* out, XASM_LINK("AES_CBC_encrypt"); #ifdef HAVE_AES_DECRYPT +#ifndef HAVE_AES_DECRYPT_EX void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, unsigned char* ivec, unsigned long length, const unsigned char* KS, int nr) XASM_LINK("AES_CBC_decrypt"); +#else /* HAVE_AES_DECRYPT_EX */ +void AES_CBC_decrypt_ex(const unsigned char* in, unsigned char* out, + unsigned char* ivec, unsigned long length, + const unsigned char* KS, int nr) + XASM_LINK("AES_CBC_decrypt_ex"); +#endif /* HAVE_AES_DECRYPT_EX */ #endif /* HAVE_AES_DECRYPT */ #endif /* HAVE_AES_CBC */ @@ -2549,8 +2556,13 @@ int wc_AesSetIV(Aes* aes, const byte* iv) /* if input and output same will overwrite input iv */ XMEMCPY(aes->tmp, in + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE); +#ifndef HAVE_AES_DECRYPT_EX AES_CBC_decrypt(in, out, (byte*)aes->reg, sz, (byte*)aes->key, aes->rounds); +#else /* HAVE_AES_DECRYPT_EX */ + AES_CBC_decrypt_ex(in, out, (byte*)aes->reg, sz, (byte*)aes->key, + aes->rounds); +#endif /* HAVE_AES_DECRYPT_EX */ /* store iv for next call */ XMEMCPY(aes->reg, aes->tmp, AES_BLOCK_SIZE); return 0; diff --git a/wolfcrypt/src/aes_asm.s b/wolfcrypt/src/aes_asm.s index 385a2d49a..c9ae40a18 100644 --- a/wolfcrypt/src/aes_asm.s +++ b/wolfcrypt/src/aes_asm.s @@ -266,6 +266,256 @@ DEND_4: ret +/* +AES_CBC_decrypt_ex (const unsigned char *in, + unsigned char *out, + unsigned char ivec[16], + unsigned long length, + const unsigned char *KS, + int nr) +*/ +.globl AES_CBC_decrypt_ex +AES_CBC_decrypt_ex: +# parameter 1: %rdi - in +# parameter 2: %rsi - out +# parameter 3: %rdx - ivec +# parameter 4: %rcx - length +# parameter 5: %r8 - KS +# parameter 6: %r9d - nr + + movq %rcx, %r10 + shrq $4, %rcx + shlq $60, %r10 + je ENO_PARTS_8 + addq $1, %rcx +ENO_PARTS_8: + movq %rcx, %r10 + shlq $61, %r10 + shrq $61, %r10 + shrq $3, %rcx + movdqu (%rdx), %xmm9 + je EREMAINDER_8 + subq $128, %rsi +ELOOP_8: + movdqu (%rdi), %xmm1 + movdqu 16(%rdi), %xmm2 + movdqu 32(%rdi), %xmm3 + movdqu 48(%rdi), %xmm4 + movdqu 64(%rdi), %xmm5 + movdqu 80(%rdi), %xmm6 + movdqu 96(%rdi), %xmm7 + movdqu 112(%rdi), %xmm8 + movdqa (%r8), %xmm10 + movdqa 16(%r8), %xmm11 + movdqa 32(%r8), %xmm12 + movdqa 48(%r8), %xmm13 + pxor %xmm10, %xmm1 + pxor %xmm10, %xmm2 + pxor %xmm10, %xmm3 + pxor %xmm10, %xmm4 + pxor %xmm10, %xmm5 + pxor %xmm10, %xmm6 + pxor %xmm10, %xmm7 + pxor %xmm10, %xmm8 + aesdec %xmm11, %xmm1 + aesdec %xmm11, %xmm2 + aesdec %xmm11, %xmm3 + aesdec %xmm11, %xmm4 + aesdec %xmm11, %xmm5 + aesdec %xmm11, %xmm6 + aesdec %xmm11, %xmm7 + aesdec %xmm11, %xmm8 + aesdec %xmm12, %xmm1 + aesdec %xmm12, %xmm2 + aesdec %xmm12, %xmm3 + aesdec %xmm12, %xmm4 + aesdec %xmm12, %xmm5 + aesdec %xmm12, %xmm6 + aesdec %xmm12, %xmm7 + aesdec %xmm12, %xmm8 + aesdec %xmm13, %xmm1 + aesdec %xmm13, %xmm2 + aesdec %xmm13, %xmm3 + aesdec %xmm13, %xmm4 + aesdec %xmm13, %xmm5 + aesdec %xmm13, %xmm6 + aesdec %xmm13, %xmm7 + aesdec %xmm13, %xmm8 + movdqa 64(%r8), %xmm10 + movdqa 80(%r8), %xmm11 + movdqa 96(%r8), %xmm12 + movdqa 112(%r8), %xmm13 + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 + aesdec %xmm10, %xmm5 + aesdec %xmm10, %xmm6 + aesdec %xmm10, %xmm7 + aesdec %xmm10, %xmm8 + aesdec %xmm11, %xmm1 + aesdec %xmm11, %xmm2 + aesdec %xmm11, %xmm3 + aesdec %xmm11, %xmm4 + aesdec %xmm11, %xmm5 + aesdec %xmm11, %xmm6 + aesdec %xmm11, %xmm7 + aesdec %xmm11, %xmm8 + aesdec %xmm12, %xmm1 + aesdec %xmm12, %xmm2 + aesdec %xmm12, %xmm3 + aesdec %xmm12, %xmm4 + aesdec %xmm12, %xmm5 + aesdec %xmm12, %xmm6 + aesdec %xmm12, %xmm7 + aesdec %xmm12, %xmm8 + aesdec %xmm13, %xmm1 + aesdec %xmm13, %xmm2 + aesdec %xmm13, %xmm3 + aesdec %xmm13, %xmm4 + aesdec %xmm13, %xmm5 + aesdec %xmm13, %xmm6 + aesdec %xmm13, %xmm7 + aesdec %xmm13, %xmm8 + movdqa 128(%r8), %xmm10 + movdqa 144(%r8), %xmm11 + movdqa 160(%r8), %xmm12 + cmpl $12, %r9d + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 + aesdec %xmm10, %xmm5 + aesdec %xmm10, %xmm6 + aesdec %xmm10, %xmm7 + aesdec %xmm10, %xmm8 + aesdec %xmm11, %xmm1 + aesdec %xmm11, %xmm2 + aesdec %xmm11, %xmm3 + aesdec %xmm11, %xmm4 + aesdec %xmm11, %xmm5 + aesdec %xmm11, %xmm6 + aesdec %xmm11, %xmm7 + aesdec %xmm11, %xmm8 + jb ELAST_8 + movdqa 160(%r8), %xmm10 + movdqa 176(%r8), %xmm11 + movdqa 192(%r8), %xmm12 + cmpl $14, %r9d + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 + aesdec %xmm10, %xmm5 + aesdec %xmm10, %xmm6 + aesdec %xmm10, %xmm7 + aesdec %xmm10, %xmm8 + aesdec %xmm11, %xmm1 + aesdec %xmm11, %xmm2 + aesdec %xmm11, %xmm3 + aesdec %xmm11, %xmm4 + aesdec %xmm11, %xmm5 + aesdec %xmm11, %xmm6 + aesdec %xmm11, %xmm7 + aesdec %xmm11, %xmm8 + jb ELAST_8 + movdqa 192(%r8), %xmm10 + movdqa 208(%r8), %xmm11 + movdqa 224(%r8), %xmm12 + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 + aesdec %xmm10, %xmm5 + aesdec %xmm10, %xmm6 + aesdec %xmm10, %xmm7 + aesdec %xmm10, %xmm8 + aesdec %xmm11, %xmm1 + aesdec %xmm11, %xmm2 + aesdec %xmm11, %xmm3 + aesdec %xmm11, %xmm4 + aesdec %xmm11, %xmm5 + aesdec %xmm11, %xmm6 + aesdec %xmm11, %xmm7 + aesdec %xmm11, %xmm8 +ELAST_8: + addq $128, %rsi + aesdeclast %xmm12, %xmm1 + aesdeclast %xmm12, %xmm2 + aesdeclast %xmm12, %xmm3 + aesdeclast %xmm12, %xmm4 + aesdeclast %xmm12, %xmm5 + aesdeclast %xmm12, %xmm6 + aesdeclast %xmm12, %xmm7 + aesdeclast %xmm12, %xmm8 + movdqu (%rdi), %xmm10 + movdqu 16(%rdi), %xmm11 + movdqu 32(%rdi), %xmm12 + movdqu 48(%rdi), %xmm13 + pxor %xmm9, %xmm1 + pxor %xmm10, %xmm2 + pxor %xmm11, %xmm3 + pxor %xmm12, %xmm4 + pxor %xmm13, %xmm5 + movdqu 64(%rdi), %xmm10 + movdqu 80(%rdi), %xmm11 + movdqu 96(%rdi), %xmm12 + movdqu 112(%rdi), %xmm9 + pxor %xmm10, %xmm6 + pxor %xmm11, %xmm7 + pxor %xmm12, %xmm8 + movdqu %xmm1, (%rsi) + movdqu %xmm2, 16(%rsi) + movdqu %xmm3, 32(%rsi) + movdqu %xmm4, 48(%rsi) + movdqu %xmm5, 64(%rsi) + movdqu %xmm6, 80(%rsi) + movdqu %xmm7, 96(%rsi) + movdqu %xmm8, 112(%rsi) + addq $128, %rdi + decq %rcx + jne ELOOP_8 + addq $128, %rsi +EREMAINDER_8: + cmpq $0, %r10 + je EEND_8 +ELOOP_8_2: + movdqu (%rdi), %xmm1 + movdqa %xmm1 ,%xmm10 + addq $16, %rdi + pxor (%r8), %xmm1 + movdqu 160(%r8), %xmm2 + cmpl $12, %r9d + aesdec 16(%r8), %xmm1 + aesdec 32(%r8), %xmm1 + aesdec 48(%r8), %xmm1 + aesdec 64(%r8), %xmm1 + aesdec 80(%r8), %xmm1 + aesdec 96(%r8), %xmm1 + aesdec 112(%r8), %xmm1 + aesdec 128(%r8), %xmm1 + aesdec 144(%r8), %xmm1 + jb ELAST_8_2 + movdqu 192(%r8), %xmm2 + cmpl $14, %r9d + aesdec 160(%r8), %xmm1 + aesdec 176(%r8), %xmm1 + jb ELAST_8_2 + movdqu 224(%r8), %xmm2 + aesdec 192(%r8), %xmm1 + aesdec 208(%r8), %xmm1 +ELAST_8_2: + aesdeclast %xmm2, %xmm1 + pxor %xmm9, %xmm1 + movdqa %xmm10, %xmm9 + movdqu %xmm1, (%rsi) + addq $16, %rsi + decq %r10 + jne ELOOP_8_2 +EEND_8: + ret + + /* AES_ECB_encrypt (const unsigned char *in, unsigned char *out, diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 741d4da36..c55dc3921 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -2669,6 +2669,89 @@ int aes_test(void) if (memcmp(cipher, verify, AES_BLOCK_SIZE)) return -61; +#if defined(WOLFSSL_AESNI) && \ + defined(HAVE_AES_DECRYPT) && defined(HAVE_AES_DECRYPT_EX) + { + const byte bigMsg[] = { + /* "All work and no play makes Jack a dull boy. " */ + 0x41,0x6c,0x6c,0x20,0x77,0x6f,0x72,0x6b, + 0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x20, + 0x70,0x6c,0x61,0x79,0x20,0x6d,0x61,0x6b, + 0x65,0x73,0x20,0x4a,0x61,0x63,0x6b,0x20, + 0x61,0x20,0x64,0x75,0x6c,0x6c,0x20,0x62, + 0x6f,0x79,0x2e,0x20,0x41,0x6c,0x6c,0x20, + 0x77,0x6f,0x72,0x6b,0x20,0x61,0x6e,0x64, + 0x20,0x6e,0x6f,0x20,0x70,0x6c,0x61,0x79, + 0x20,0x6d,0x61,0x6b,0x65,0x73,0x20,0x4a, + 0x61,0x63,0x6b,0x20,0x61,0x20,0x64,0x75, + 0x6c,0x6c,0x20,0x62,0x6f,0x79,0x2e,0x20, + 0x41,0x6c,0x6c,0x20,0x77,0x6f,0x72,0x6b, + 0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x20, + 0x70,0x6c,0x61,0x79,0x20,0x6d,0x61,0x6b, + 0x65,0x73,0x20,0x4a,0x61,0x63,0x6b,0x20, + 0x61,0x20,0x64,0x75,0x6c,0x6c,0x20,0x62, + 0x6f,0x79,0x2e,0x20,0x41,0x6c,0x6c,0x20, + 0x77,0x6f,0x72,0x6b,0x20,0x61,0x6e,0x64, + 0x20,0x6e,0x6f,0x20,0x70,0x6c,0x61,0x79, + 0x20,0x6d,0x61,0x6b,0x65,0x73,0x20,0x4a, + 0x61,0x63,0x6b,0x20,0x61,0x20,0x64,0x75, + 0x6c,0x6c,0x20,0x62,0x6f,0x79,0x2e,0x20, + 0x41,0x6c,0x6c,0x20,0x77,0x6f,0x72,0x6b, + 0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x20, + 0x70,0x6c,0x61,0x79,0x20,0x6d,0x61,0x6b, + 0x65,0x73,0x20,0x4a,0x61,0x63,0x6b,0x20, + 0x61,0x20,0x64,0x75,0x6c,0x6c,0x20,0x62, + 0x6f,0x79,0x2e,0x20,0x41,0x6c,0x6c,0x20, + 0x77,0x6f,0x72,0x6b,0x20,0x61,0x6e,0x64, + 0x20,0x6e,0x6f,0x20,0x70,0x6c,0x61,0x79, + 0x20,0x6d,0x61,0x6b,0x65,0x73,0x20,0x4a, + 0x61,0x63,0x6b,0x20,0x61,0x20,0x64,0x75, + 0x6c,0x6c,0x20,0x62,0x6f,0x79,0x2e,0x20, + 0x41,0x6c,0x6c,0x20,0x77,0x6f,0x72,0x6b, + 0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x20, + 0x70,0x6c,0x61,0x79,0x20,0x6d,0x61,0x6b, + 0x65,0x73,0x20,0x4a,0x61,0x63,0x6b,0x20, + 0x61,0x20,0x64,0x75,0x6c,0x6c,0x20,0x62, + 0x6f,0x79,0x2e,0x20,0x41,0x6c,0x6c,0x20, + 0x77,0x6f,0x72,0x6b,0x20,0x61,0x6e,0x64, + 0x20,0x6e,0x6f,0x20,0x70,0x6c,0x61,0x79, + 0x20,0x6d,0x61,0x6b,0x65,0x73,0x20,0x4a, + 0x61,0x63,0x6b,0x20,0x61,0x20,0x64,0x75, + 0x6c,0x6c,0x20,0x62,0x6f,0x79,0x2e,0x20, + 0x41,0x6c,0x6c,0x20,0x77,0x6f,0x72,0x6b, + 0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x20, + 0x70,0x6c,0x61,0x79,0x20,0x6d,0x61,0x6b, + 0x65,0x73,0x20,0x4a,0x61,0x63,0x6b,0x20 + }; + byte bigCipher[sizeof(bigMsg)]; + byte bigPlain[sizeof(bigMsg)]; + + ret = wc_AesSetKey(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION); + if (ret != 0) + return -1030; + ret = wc_AesSetKey(&dec, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION); + if (ret != 0) + return -1031; + + #define AESNI_DECRYPT_SIZE (AES_BLOCK_SIZE*24) + + if ((sizeof(bigMsg) < AESNI_DECRYPT_SIZE) || + (AESNI_DECRYPT_SIZE == 0) || + (AESNI_DECRYPT_SIZE % AES_BLOCK_SIZE != 0)) + return -1032; + + ret = wc_AesCbcEncrypt(&enc, bigCipher, bigMsg, AESNI_DECRYPT_SIZE); + if (ret != 0) + return -1033; + ret = wc_AesCbcDecrypt(&dec, bigPlain, bigCipher, AESNI_DECRYPT_SIZE); + if (ret != 0) + return -1034; + + if (memcmp(bigPlain, bigMsg, AESNI_DECRYPT_SIZE)) + return -1035; + } +#endif /* WOLFSSL_AESNI HAVE_AES_DECRYPT HAVE_AES_DECRYPT_EX */ + #ifdef HAVE_CAVIUM wc_AesFreeCavium(&enc); wc_AesFreeCavium(&dec); From 698b1cc7dc26c0cf3b764859cfb866874449efc5 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 8 Apr 2016 13:33:41 -0700 Subject: [PATCH 099/192] update benchmark to show AES-CBC decrypt speed --- wolfcrypt/benchmark/benchmark.c | 36 ++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index fbb79c3e7..76cd20f71 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -525,7 +525,41 @@ void bench_aes(int show) #endif if (show) { - printf("AES %d %s took %5.3f seconds, %8.3f MB/s", numBlocks, + printf("AES enc %d %s took %5.3f seconds, %8.3f MB/s", numBlocks, + blockType, total, persec); + SHOW_INTEL_CYCLES + printf("\n"); + } +#ifdef HAVE_CAVIUM + wc_AesFreeCavium(&enc); + if (wc_AesInitCavium(&enc, CAVIUM_DEV_ID) != 0) { + printf("aes init cavium failed\n"); + return; + } +#endif + + ret = wc_AesSetKey(&enc, key, 16, iv, AES_DECRYPTION); + if (ret != 0) { + printf("AesSetKey failed, ret = %d\n", ret); + return; + } + start = current_time(1); + BEGIN_INTEL_CYCLES + + for(i = 0; i < numBlocks; i++) + wc_AesCbcDecrypt(&enc, plain, cipher, sizeof(plain)); + + END_INTEL_CYCLES + total = current_time(0) - start; + + persec = 1 / total * numBlocks; +#ifdef BENCH_EMBEDDED + /* since using kB, convert to MB/s */ + persec = persec / 1024; +#endif + + if (show) { + printf("AES dec %d %s took %5.3f seconds, %8.3f MB/s", numBlocks, blockType, total, persec); SHOW_INTEL_CYCLES printf("\n"); From c6e9021732ff7da6c0f737e6623c91a4240a4686 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Mon, 11 Apr 2016 11:13:26 -0600 Subject: [PATCH 100/192] scan-build warnings related to enable-psk, disable-asn,rsa,ecc --- examples/client/client.c | 23 +++++++++++++++++++---- examples/server/server.c | 19 +++++++++++++++++-- src/internal.c | 4 ++++ 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 4ea65d1b2..40e7f453c 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -917,11 +917,15 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) } #ifdef WOLFSSL_LEANPSK - usePsk = 1; + if (!usePsk) { + usePsk = 1; + } #endif #if defined(NO_RSA) && !defined(HAVE_ECC) - usePsk = 1; + if (!usePsk) { + usePsk = 1; + } #endif if (fewerPackets) @@ -948,7 +952,9 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) err_sys("client can't set cipher list 2"); } #endif - useClientCert = 0; + if (useClientCert) { + useClientCert = 0; + } } if (useAnon) { @@ -959,7 +965,9 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) err_sys("client can't set cipher list 4"); } #endif - useClientCert = 0; + if (useClientCert) { + useClientCert = 0; + } } #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) @@ -1023,12 +1031,19 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) } #endif /* WOLFSSL_TRUST_PEER_CERT */ } +#else /* !NO_FILESYSTEM && !NO_CERTS */ + (void) useClientCert; + (void) verifyCert; + (void) ourCert; + (void) ourKey; #endif /* !NO_FILESYSTEM && !NO_CERTS */ #if !defined(NO_CERTS) if (!usePsk && !useAnon && doPeerCheck == 0) wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0); if (!usePsk && !useAnon && overrideDateErrors == 1) wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, myDateCb); +#else + (void) overrideDateErrors; #endif #ifdef HAVE_CAVIUM diff --git a/examples/server/server.c b/examples/server/server.c index 282341803..d253926bc 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -614,11 +614,15 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) err_sys("server can't set cipher list 1"); #ifdef CYASSL_LEANPSK - usePsk = 1; + if (!usePsk) { + usePsk = 1; + } #endif #if defined(NO_RSA) && !defined(HAVE_ECC) - usePsk = 1; + if (!usePsk) { + usePsk = 1; + } #endif if (fewerPackets) @@ -635,6 +639,8 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) err_sys("can't load server cert file, check file and run from" " wolfSSL home dir"); } +#else + (void) ourCert; #endif #ifndef NO_DH @@ -656,6 +662,9 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) err_sys("can't load server private key file, check file and run " "from wolfSSL home dir"); } +#else + (void) ourKey; + (void) useNtruKey; #endif if (usePsk || usePskPlus) { @@ -709,6 +718,9 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) } #endif /* WOLFSSL_TRUST_PEER_CERT */ } +#else + (void) verifyCert; + (void) doCliCertCheck; #endif #if defined(CYASSL_SNIFFER) @@ -832,7 +844,10 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #if !defined(NO_FILESYSTEM) && !defined(NO_DH) && !defined(NO_ASN) CyaSSL_SetTmpDH_file(ssl, ourDhParam, SSL_FILETYPE_PEM); #elif !defined(NO_DH) + (void) ourDhParam; SetDH(ssl); /* repick suites with DHE, higher priority than PSK */ + #else + (void) ourDhParam; #endif } diff --git a/src/internal.c b/src/internal.c index 19a9ee1bf..9407321da 100755 --- a/src/internal.c +++ b/src/internal.c @@ -8549,6 +8549,10 @@ static int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, int ret = 0; int atomicUser = 0; + if (ssl == NULL || output == NULL || input == NULL) { + return BAD_FUNC_ARG; + } + #ifdef WOLFSSL_DTLS if (ssl->options.dtls) { sz += DTLS_RECORD_EXTRA; From 23ab4247ea70636f77ef21a94427953ca242a488 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 11 Apr 2016 11:56:30 -0600 Subject: [PATCH 101/192] build with asn disabled and opensslextra enabled --- src/ssl.c | 19 ++++++++++++++++--- wolfssl/internal.h | 10 +++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index f916c185c..fb4da19e6 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -89,6 +89,10 @@ #endif #endif +#ifdef NO_ASN + #include +#endif + #ifndef NO_FILESYSTEM #if !defined(USE_WINDOWS_API) && !defined(NO_WOLFSSL_DIR) \ && !defined(EBSNET) @@ -1866,6 +1870,7 @@ int wolfSSL_CertPemToDer(const unsigned char* pem, int pemSz, return ret; } +#endif /* NO_CERTS */ #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) @@ -1906,6 +1911,7 @@ static INLINE int OurPasswordCb(char* passwd, int sz, int rw, void* userdata) #endif /* OPENSSL_EXTRA || HAVE_WEBSERVER */ +#ifndef NO_CERTS /* Return bytes written to buff or < 0 for error */ int wolfSSL_KeyPemToDer(const unsigned char* pem, int pemSz, @@ -2745,7 +2751,7 @@ int wolfSSL_Init(void) } -#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) +#if (defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)) && !defined(NO_CERTS) /* SSL_SUCCESS if ok, <= 0 else */ static int wolfssl_decrypt_buffer_key(DerBuffer* der, byte* password, @@ -9740,7 +9746,8 @@ int wolfSSL_set_compression(WOLFSSL* ssl) #endif /* KEEP_PEER_CERT */ -#if defined(KEEP_PEER_CERT) || defined(SESSION_CERTS) || defined(OPENSSSL_EXTRA) +#ifndef NO_CERTS +#if defined(KEEP_PEER_CERT) || defined(SESSION_CERTS) || defined(OPENSSL_EXTRA) /* user externally called free X509, if dynamic go ahead with free, otherwise * don't */ @@ -9767,7 +9774,6 @@ static void ExternalFreeX509(WOLFSSL_X509* x509) ExternalFreeX509(x509); } - /* return the next, if any, altname from the peer cert */ char* wolfSSL_X509_get_next_altname(WOLFSSL_X509* cert) { @@ -10462,6 +10468,7 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) #endif /* NO_FILESYSTEM */ #endif /* KEEP_PEER_CERT || SESSION_CERTS */ +#endif /* NO_CERTS */ #ifdef OPENSSL_EXTRA @@ -10978,11 +10985,13 @@ WOLFSSL_SESSION* wolfSSL_get1_session(WOLFSSL* ssl) #endif /* NO_SESSION_CACHE */ +#ifndef NO_CERTS void wolfSSL_X509_free(WOLFSSL_X509* x509) { WOLFSSL_ENTER("wolfSSL_X509_free"); ExternalFreeX509(x509); } +#endif /* NO_CERTS */ /* was do nothing */ @@ -11219,6 +11228,7 @@ WOLFSSL_X509_LOOKUP* wolfSSL_X509_STORE_add_lookup(WOLFSSL_X509_STORE* store, } +#ifndef NO_CERTS int wolfSSL_X509_STORE_add_cert(WOLFSSL_X509_STORE* store, WOLFSSL_X509* x509) { int result = SSL_FATAL_ERROR; @@ -11355,6 +11365,7 @@ int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX* ctx) } return SSL_FATAL_ERROR; } +#endif /* NO_CERTS */ WOLFSSL_ASN1_TIME* wolfSSL_X509_CRL_get_lastUpdate(WOLFSSL_X509_CRL* crl) @@ -16831,11 +16842,13 @@ void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl) return NULL; } +#ifndef NO_CERTS void wolfSSL_X509_NAME_free(WOLFSSL_X509_NAME *name){ FreeX509Name(name); WOLFSSL_ENTER("wolfSSL_X509_NAME_free"); WOLFSSL_STUB("wolfSSL_X509_NAME_free"); } +#endif /* NO_CERTS */ void wolfSSL_sk_X509_NAME_pop_free(STACK_OF(WOLFSSL_X509_NAME)* sk, void f (WOLFSSL_X509_NAME*)){ (void) sk; diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 8c88e471e..14e26ee8e 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -2381,7 +2381,7 @@ struct WOLFSSL_X509_NAME { char staticName[ASN_NAME_MAX]; int dynamicName; int sz; -#ifdef OPENSSL_EXTRA +#if defined(OPENSSL_EXTRA) && !defined(NO_ASN) DecodedName fullName; #endif /* OPENSSL_EXTRA */ }; @@ -2972,11 +2972,11 @@ WOLFSSL_LOCAL int GrowInputBuffer(WOLFSSL* ssl, int size, int usedLength); WOLFSSL_LOCAL word32 LowResTimer(void); -WOLFSSL_LOCAL void InitX509Name(WOLFSSL_X509_NAME*, int); -WOLFSSL_LOCAL void FreeX509Name(WOLFSSL_X509_NAME* name); -WOLFSSL_LOCAL void InitX509(WOLFSSL_X509*, int); -WOLFSSL_LOCAL void FreeX509(WOLFSSL_X509*); #ifndef NO_CERTS + WOLFSSL_LOCAL void InitX509Name(WOLFSSL_X509_NAME*, int); + WOLFSSL_LOCAL void FreeX509Name(WOLFSSL_X509_NAME* name); + WOLFSSL_LOCAL void InitX509(WOLFSSL_X509*, int); + WOLFSSL_LOCAL void FreeX509(WOLFSSL_X509*); WOLFSSL_LOCAL int CopyDecodedToX509(WOLFSSL_X509*, DecodedCert*); #endif From 1b7cd5cb066f8e24cb3ede2d6eb9c25ea388bb96 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Mon, 11 Apr 2016 13:39:44 -0600 Subject: [PATCH 102/192] consolidate handling of dead assignment warnings --- examples/client/client.c | 16 +++++++++------- examples/server/server.c | 20 +++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 40e7f453c..275c92f95 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -1031,19 +1031,12 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) } #endif /* WOLFSSL_TRUST_PEER_CERT */ } -#else /* !NO_FILESYSTEM && !NO_CERTS */ - (void) useClientCert; - (void) verifyCert; - (void) ourCert; - (void) ourKey; #endif /* !NO_FILESYSTEM && !NO_CERTS */ #if !defined(NO_CERTS) if (!usePsk && !useAnon && doPeerCheck == 0) wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0); if (!usePsk && !useAnon && overrideDateErrors == 1) wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, myDateCb); -#else - (void) overrideDateErrors; #endif #ifdef HAVE_CAVIUM @@ -1451,6 +1444,15 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) ShowMemoryTracker(); #endif /* USE_WOLFSSL_MEMORY */ + /* There are use cases when these assignments are not read. To avoid + * potential confusion those warnings have been handled here. + */ + (void) overrideDateErrors; + (void) useClientCert; + (void) verifyCert; + (void) ourCert; + (void) ourKey; + #if !defined(WOLFSSL_TIRTOS) return 0; #endif diff --git a/examples/server/server.c b/examples/server/server.c index d253926bc..65845dd0a 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -639,8 +639,6 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) err_sys("can't load server cert file, check file and run from" " wolfSSL home dir"); } -#else - (void) ourCert; #endif #ifndef NO_DH @@ -662,9 +660,6 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) err_sys("can't load server private key file, check file and run " "from wolfSSL home dir"); } -#else - (void) ourKey; - (void) useNtruKey; #endif if (usePsk || usePskPlus) { @@ -718,9 +713,6 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) } #endif /* WOLFSSL_TRUST_PEER_CERT */ } -#else - (void) verifyCert; - (void) doCliCertCheck; #endif #if defined(CYASSL_SNIFFER) @@ -844,10 +836,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #if !defined(NO_FILESYSTEM) && !defined(NO_DH) && !defined(NO_ASN) CyaSSL_SetTmpDH_file(ssl, ourDhParam, SSL_FILETYPE_PEM); #elif !defined(NO_DH) - (void) ourDhParam; SetDH(ssl); /* repick suites with DHE, higher priority than PSK */ - #else - (void) ourDhParam; #endif } @@ -986,6 +975,15 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) TicketCleanup(); #endif + /* There are use cases when these assignments are not read. To avoid + * potential confusion those warnings have been handled here. + */ + (void) ourKey; + (void) verifyCert; + (void) doCliCertCheck; + (void) useNtruKey; + (void) ourDhParam; + (void) ourCert; #ifndef CYASSL_TIRTOS return 0; #endif From cfd5af341b8c0e261b67d245cce3fb7c4d822fba Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Tue, 12 Apr 2016 11:05:30 +0900 Subject: [PATCH 103/192] fixed test.c compile error and server.c/client.c/ssl.c warnings with MDK5 compiler. --- examples/client/client.c | 2 ++ examples/server/server.c | 2 ++ src/ssl.c | 4 ---- wolfcrypt/test/test.c | 22 +++++++++++----------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 275c92f95..c96c0f93f 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -150,6 +150,8 @@ static void ShowVersions(void) printf("3\n"); } +extern double current_time(void); + int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, int doDTLS, int benchmark, int resumeSession) { diff --git a/examples/server/server.c b/examples/server/server.c index 65845dd0a..73c90cc31 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -125,6 +125,8 @@ static int NonBlockingSSL_Accept(SSL* ssl) return ret; } +extern double current_time(void); + /* Echo number of bytes specified by -e arg */ int ServerEchoData(SSL* ssl, int clientfd, int echoData, int throughput) { diff --git a/src/ssl.c b/src/ssl.c index f916c185c..6e9b8b45a 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -15257,16 +15257,12 @@ int wolfSSL_EC_GROUP_get_degree(const WOLFSSL_EC_GROUP *group) switch(group->curve_nid) { case NID_X9_62_prime256v1: return 256; - break; case NID_secp384r1: return 384; - break; case NID_secp521r1: return 521; - break; default : return SSL_FAILURE; - break; } } diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 6930ed96c..ad3e408b7 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -2080,7 +2080,7 @@ int poly1305_test(void) byte tag[16]; Poly1305 enc; - const byte msg[] = + static const byte msg[] = { 0x43,0x72,0x79,0x70,0x74,0x6f,0x67,0x72, 0x61,0x70,0x68,0x69,0x63,0x20,0x46,0x6f, @@ -2089,13 +2089,13 @@ int poly1305_test(void) 0x75,0x70 }; - const byte msg2[] = + static const byte msg2[] = { 0x48,0x65,0x6c,0x6c,0x6f,0x20,0x77,0x6f,0x72, 0x6c,0x64,0x21 }; - const byte msg3[] = + static const byte msg3[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -2103,7 +2103,7 @@ int poly1305_test(void) 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; - const byte msg4[] = + static const byte msg4[] = { 0xd3,0x1a,0x8d,0x34,0x64,0x8e,0x60,0xdb, 0x7b,0x86,0xaf,0xbc,0x53,0xef,0x7e,0xc2, @@ -2128,46 +2128,46 @@ int poly1305_test(void) 0xc4,0xc5,0xc6,0xc7 }; - const byte correct[] = + static const byte correct[] = { 0xa8,0x06,0x1d,0xc1,0x30,0x51,0x36,0xc6, 0xc2,0x2b,0x8b,0xaf,0x0c,0x01,0x27,0xa9 }; - const byte correct2[] = + static const byte correct2[] = { 0xa6,0xf7,0x45,0x00,0x8f,0x81,0xc9,0x16, 0xa2,0x0d,0xcc,0x74,0xee,0xf2,0xb2,0xf0 }; - const byte correct3[] = + static const byte correct3[] = { 0x49,0xec,0x78,0x09,0x0e,0x48,0x1e,0xc6, 0xc2,0x6b,0x33,0xb9,0x1c,0xcc,0x03,0x07 }; - const byte correct4[] = + static const byte correct4[] = { 0x1a,0xe1,0x0b,0x59,0x4f,0x09,0xe2,0x6a, 0x7e,0x90,0x2e,0xcb,0xd0,0x60,0x06,0x91 }; - const byte key[] = { + static const byte key[] = { 0x85,0xd6,0xbe,0x78,0x57,0x55,0x6d,0x33, 0x7f,0x44,0x52,0xfe,0x42,0xd5,0x06,0xa8, 0x01,0x03,0x80,0x8a,0xfb,0x0d,0xb2,0xfd, 0x4a,0xbf,0xf6,0xaf,0x41,0x49,0xf5,0x1b }; - const byte key2[] = { + static const byte key2[] = { 0x74,0x68,0x69,0x73,0x20,0x69,0x73,0x20, 0x33,0x32,0x2d,0x62,0x79,0x74,0x65,0x20, 0x6b,0x65,0x79,0x20,0x66,0x6f,0x72,0x20, 0x50,0x6f,0x6c,0x79,0x31,0x33,0x30,0x35 }; - const byte key4[] = { + static const byte key4[] = { 0x7b,0xac,0x2b,0x25,0x2d,0xb4,0x47,0xaf, 0x09,0xb6,0x7a,0x55,0xa4,0xe9,0x55,0x84, 0x0a,0xe1,0xd6,0x73,0x10,0x75,0xd9,0xeb, From 8524afc56a26c1bb6ca4e77a0aabfd472c52578e Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 12 Apr 2016 10:10:55 -0700 Subject: [PATCH 104/192] 1. Rename routine AES_CBC_decrypt_ex as AES_CBC_decrypt_by8 2. Added routine AES_CBC_decrypt_by6 that does six at a time. 3. Setting HAVE_AES_DECRYPT_BY6 or _BY8 (or not setting it) selects the 6, 8, or 4 way version of the assembly routine. 4. Modified AES-NI decrypt test to loop checking against the test bolus from 1 AES block to the whole 24 blocks. --- wolfcrypt/src/aes.c | 24 ++--- wolfcrypt/src/aes_asm.s | 228 +++++++++++++++++++++++++++++++++++++++- wolfcrypt/test/test.c | 45 ++++---- 3 files changed, 258 insertions(+), 39 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index a3c98370b..3ce0fbcde 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -1094,17 +1094,22 @@ void AES_CBC_encrypt(const unsigned char* in, unsigned char* out, XASM_LINK("AES_CBC_encrypt"); #ifdef HAVE_AES_DECRYPT -#ifndef HAVE_AES_DECRYPT_EX +#if defined(HAVE_AES_DECRYPT_BY8) +void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, + unsigned char* ivec, unsigned long length, + const unsigned char* KS, int nr) + XASM_LINK("AES_CBC_decrypt_by8"); +#elif defined(HAVE_AES_DECRYPT_BY6) +void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, + unsigned char* ivec, unsigned long length, + const unsigned char* KS, int nr) + XASM_LINK("AES_CBC_decrypt_by6"); +#else void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, unsigned char* ivec, unsigned long length, const unsigned char* KS, int nr) XASM_LINK("AES_CBC_decrypt"); -#else /* HAVE_AES_DECRYPT_EX */ -void AES_CBC_decrypt_ex(const unsigned char* in, unsigned char* out, - unsigned char* ivec, unsigned long length, - const unsigned char* KS, int nr) - XASM_LINK("AES_CBC_decrypt_ex"); -#endif /* HAVE_AES_DECRYPT_EX */ +#endif /* HAVE_AES_DECRYPT_BYX */ #endif /* HAVE_AES_DECRYPT */ #endif /* HAVE_AES_CBC */ @@ -2556,13 +2561,8 @@ int wc_AesSetIV(Aes* aes, const byte* iv) /* if input and output same will overwrite input iv */ XMEMCPY(aes->tmp, in + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE); -#ifndef HAVE_AES_DECRYPT_EX AES_CBC_decrypt(in, out, (byte*)aes->reg, sz, (byte*)aes->key, aes->rounds); -#else /* HAVE_AES_DECRYPT_EX */ - AES_CBC_decrypt_ex(in, out, (byte*)aes->reg, sz, (byte*)aes->key, - aes->rounds); -#endif /* HAVE_AES_DECRYPT_EX */ /* store iv for next call */ XMEMCPY(aes->reg, aes->tmp, AES_BLOCK_SIZE); return 0; diff --git a/wolfcrypt/src/aes_asm.s b/wolfcrypt/src/aes_asm.s index c9ae40a18..3120aef22 100644 --- a/wolfcrypt/src/aes_asm.s +++ b/wolfcrypt/src/aes_asm.s @@ -267,15 +267,237 @@ ret /* -AES_CBC_decrypt_ex (const unsigned char *in, +AES_CBC_decrypt_by6 (const unsigned char *in, unsigned char *out, unsigned char ivec[16], unsigned long length, const unsigned char *KS, int nr) */ -.globl AES_CBC_decrypt_ex -AES_CBC_decrypt_ex: +.globl AES_CBC_decrypt_by6 +AES_CBC_decrypt_by6: +# parameter 1: %rdi - in +# parameter 2: %rsi - out +# parameter 3: %rdx - ivec +# parameter 4: %rcx - length +# parameter 5: %r8 - KS +# parameter 6: %r9d - nr + + movq %rcx, %r10 + shrq $4, %rcx + shlq $60, %r10 + je ENO_PARTS_6 + addq $1, %rcx +ENO_PARTS_6: + movq %rax, %r12 + movq %rdx, %r13 + movq %rbx, %r14 + movq $0, %rdx + movq %rcx, %rax + movq $6, %rbx + div %rbx + movq %rax, %rcx + movq %rdx, %r10 + movq %r12, %rax + movq %r13, %rdx + movq %r14, %rbx + cmpq $0, %rcx + movdqu (%rdx), %xmm7 + je EREMAINDER_6 + subq $96, %rsi +ELOOP_6: + movdqu (%rdi), %xmm1 + movdqu 16(%rdi), %xmm2 + movdqu 32(%rdi), %xmm3 + movdqu 48(%rdi), %xmm4 + movdqu 64(%rdi), %xmm5 + movdqu 80(%rdi), %xmm6 + movdqa (%r8), %xmm8 + movdqa 16(%r8), %xmm9 + movdqa 32(%r8), %xmm10 + movdqa 48(%r8), %xmm11 + pxor %xmm8, %xmm1 + pxor %xmm8, %xmm2 + pxor %xmm8, %xmm3 + pxor %xmm8, %xmm4 + pxor %xmm8, %xmm5 + pxor %xmm8, %xmm6 + aesdec %xmm9, %xmm1 + aesdec %xmm9, %xmm2 + aesdec %xmm9, %xmm3 + aesdec %xmm9, %xmm4 + aesdec %xmm9, %xmm5 + aesdec %xmm9, %xmm6 + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 + aesdec %xmm10, %xmm5 + aesdec %xmm10, %xmm6 + aesdec %xmm11, %xmm1 + aesdec %xmm11, %xmm2 + aesdec %xmm11, %xmm3 + aesdec %xmm11, %xmm4 + aesdec %xmm11, %xmm5 + aesdec %xmm11, %xmm6 + movdqa 64(%r8), %xmm8 + movdqa 80(%r8), %xmm9 + movdqa 96(%r8), %xmm10 + movdqa 112(%r8), %xmm11 + aesdec %xmm8, %xmm1 + aesdec %xmm8, %xmm2 + aesdec %xmm8, %xmm3 + aesdec %xmm8, %xmm4 + aesdec %xmm8, %xmm5 + aesdec %xmm8, %xmm6 + aesdec %xmm9, %xmm1 + aesdec %xmm9, %xmm2 + aesdec %xmm9, %xmm3 + aesdec %xmm9, %xmm4 + aesdec %xmm9, %xmm5 + aesdec %xmm9, %xmm6 + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 + aesdec %xmm10, %xmm5 + aesdec %xmm10, %xmm6 + aesdec %xmm11, %xmm1 + aesdec %xmm11, %xmm2 + aesdec %xmm11, %xmm3 + aesdec %xmm11, %xmm4 + aesdec %xmm11, %xmm5 + aesdec %xmm11, %xmm6 + movdqa 128(%r8), %xmm8 + movdqa 144(%r8), %xmm9 + movdqa 160(%r8), %xmm10 + cmpl $12, %r9d + aesdec %xmm8, %xmm1 + aesdec %xmm8, %xmm2 + aesdec %xmm8, %xmm3 + aesdec %xmm8, %xmm4 + aesdec %xmm8, %xmm5 + aesdec %xmm8, %xmm6 + aesdec %xmm9, %xmm1 + aesdec %xmm9, %xmm2 + aesdec %xmm9, %xmm3 + aesdec %xmm9, %xmm4 + aesdec %xmm9, %xmm5 + aesdec %xmm9, %xmm6 + jb ELAST_6 + movdqa 160(%r8), %xmm8 + movdqa 176(%r8), %xmm9 + movdqa 192(%r8), %xmm10 + cmpl $14, %r9d + aesdec %xmm8, %xmm1 + aesdec %xmm8, %xmm2 + aesdec %xmm8, %xmm3 + aesdec %xmm8, %xmm4 + aesdec %xmm8, %xmm5 + aesdec %xmm8, %xmm6 + aesdec %xmm9, %xmm1 + aesdec %xmm9, %xmm2 + aesdec %xmm9, %xmm3 + aesdec %xmm9, %xmm4 + aesdec %xmm9, %xmm5 + aesdec %xmm9, %xmm6 + jb ELAST_6 + movdqa 192(%r8), %xmm8 + movdqa 208(%r8), %xmm9 + movdqa 224(%r8), %xmm10 + aesdec %xmm8, %xmm1 + aesdec %xmm8, %xmm2 + aesdec %xmm8, %xmm3 + aesdec %xmm8, %xmm4 + aesdec %xmm8, %xmm5 + aesdec %xmm8, %xmm6 + aesdec %xmm9, %xmm1 + aesdec %xmm9, %xmm2 + aesdec %xmm9, %xmm3 + aesdec %xmm9, %xmm4 + aesdec %xmm9, %xmm5 + aesdec %xmm9, %xmm6 +ELAST_6: + addq $96, %rsi + aesdeclast %xmm10, %xmm1 + aesdeclast %xmm10, %xmm2 + aesdeclast %xmm10, %xmm3 + aesdeclast %xmm10, %xmm4 + aesdeclast %xmm10, %xmm5 + aesdeclast %xmm10, %xmm6 + movdqu (%rdi), %xmm8 + movdqu 16(%rdi), %xmm9 + movdqu 32(%rdi), %xmm10 + movdqu 48(%rdi), %xmm11 + movdqu 64(%rdi), %xmm12 + movdqu 80(%rdi), %xmm13 + pxor %xmm7, %xmm1 + pxor %xmm8, %xmm2 + pxor %xmm9, %xmm3 + pxor %xmm10, %xmm4 + pxor %xmm11, %xmm5 + pxor %xmm12, %xmm6 + movdqu %xmm13, %xmm7 + movdqu %xmm1, (%rsi) + movdqu %xmm2, 16(%rsi) + movdqu %xmm3, 32(%rsi) + movdqu %xmm4, 48(%rsi) + movdqu %xmm5, 64(%rsi) + movdqu %xmm6, 80(%rsi) + addq $96, %rdi + decq %rcx + jne ELOOP_6 + addq $96, %rsi +EREMAINDER_6: + cmpq $0, %r10 + je EEND_6 +ELOOP_6_2: + movdqu (%rdi), %xmm1 + movdqa %xmm1 ,%xmm10 + addq $16, %rdi + pxor (%r8), %xmm1 + movdqu 160(%r8), %xmm2 + cmpl $12, %r9d + aesdec 16(%r8), %xmm1 + aesdec 32(%r8), %xmm1 + aesdec 48(%r8), %xmm1 + aesdec 64(%r8), %xmm1 + aesdec 80(%r8), %xmm1 + aesdec 96(%r8), %xmm1 + aesdec 112(%r8), %xmm1 + aesdec 128(%r8), %xmm1 + aesdec 144(%r8), %xmm1 + jb ELAST_6_2 + movdqu 192(%r8), %xmm2 + cmpl $14, %r9d + aesdec 160(%r8), %xmm1 + aesdec 176(%r8), %xmm1 + jb ELAST_6_2 + movdqu 224(%r8), %xmm2 + aesdec 192(%r8), %xmm1 + aesdec 208(%r8), %xmm1 +ELAST_6_2: + aesdeclast %xmm2, %xmm1 + pxor %xmm7, %xmm1 + movdqa %xmm10, %xmm7 + movdqu %xmm1, (%rsi) + addq $16, %rsi + decq %r10 + jne ELOOP_6_2 +EEND_6: + ret + + +/* +AES_CBC_decrypt_by8 (const unsigned char *in, + unsigned char *out, + unsigned char ivec[16], + unsigned long length, + const unsigned char *KS, + int nr) +*/ +.globl AES_CBC_decrypt_by8 +AES_CBC_decrypt_by8: # parameter 1: %rdi - in # parameter 2: %rsi - out # parameter 3: %rdx - ivec diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index c55dc3921..6d97aa0e1 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -2669,8 +2669,7 @@ int aes_test(void) if (memcmp(cipher, verify, AES_BLOCK_SIZE)) return -61; -#if defined(WOLFSSL_AESNI) && \ - defined(HAVE_AES_DECRYPT) && defined(HAVE_AES_DECRYPT_EX) +#if defined(WOLFSSL_AESNI) && defined(HAVE_AES_DECRYPT) { const byte bigMsg[] = { /* "All work and no play makes Jack a dull boy. " */ @@ -2725,32 +2724,30 @@ int aes_test(void) }; byte bigCipher[sizeof(bigMsg)]; byte bigPlain[sizeof(bigMsg)]; + word32 i; - ret = wc_AesSetKey(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION); - if (ret != 0) - return -1030; - ret = wc_AesSetKey(&dec, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION); - if (ret != 0) - return -1031; + for (i = AES_BLOCK_SIZE; i <= sizeof(bigMsg); i += AES_BLOCK_SIZE) { + memset(bigCipher, 0, sizeof(bigCipher)); + memset(bigPlain, 0, sizeof(bigPlain)); + ret = wc_AesSetKey(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION); + if (ret != 0) + return -1030; + ret = wc_AesSetKey(&dec, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION); + if (ret != 0) + return -1031; - #define AESNI_DECRYPT_SIZE (AES_BLOCK_SIZE*24) + ret = wc_AesCbcEncrypt(&enc, bigCipher, bigMsg, i); + if (ret != 0) + return -1032; + ret = wc_AesCbcDecrypt(&dec, bigPlain, bigCipher, i); + if (ret != 0) + return -1033; - if ((sizeof(bigMsg) < AESNI_DECRYPT_SIZE) || - (AESNI_DECRYPT_SIZE == 0) || - (AESNI_DECRYPT_SIZE % AES_BLOCK_SIZE != 0)) - return -1032; - - ret = wc_AesCbcEncrypt(&enc, bigCipher, bigMsg, AESNI_DECRYPT_SIZE); - if (ret != 0) - return -1033; - ret = wc_AesCbcDecrypt(&dec, bigPlain, bigCipher, AESNI_DECRYPT_SIZE); - if (ret != 0) - return -1034; - - if (memcmp(bigPlain, bigMsg, AESNI_DECRYPT_SIZE)) - return -1035; + if (memcmp(bigPlain, bigMsg, i)) + return -1034; + } } -#endif /* WOLFSSL_AESNI HAVE_AES_DECRYPT HAVE_AES_DECRYPT_EX */ +#endif /* WOLFSSL_AESNI HAVE_AES_DECRYPT */ #ifdef HAVE_CAVIUM wc_AesFreeCavium(&enc); From c7ad33e5d497489d16afc84c90a73ed867c63167 Mon Sep 17 00:00:00 2001 From: Vikram Adiga Date: Tue, 12 Apr 2016 12:00:31 -0700 Subject: [PATCH 105/192] enable aesgcm and alpn support in TI-RTOS/WolfSSL configuration These macros enable the AES GCM cipher suites and application layer protocol negotiation in the TLS layer. Adding these macros would allow connecting to websites with higher security requirements and also support newer web technologies like HTTP/2 but the drawback is that they add ~2K increase in memory footprint. Applications not requiring these features can comment the macros and rebuild the library to get smaller footprint. Signed-off-by: Vikram Adiga --- wolfssl/wolfcrypt/settings.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index d3bbd452b..90bb9dbf2 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -546,6 +546,9 @@ static char *fgets(char *buff, int sz, FILE *fp) #define NO_ERROR_STRINGS #define USER_TIME #define HAVE_ECC + #define HAVE_ALPN + #define HAVE_TLS_EXTENSIONS + #define HAVE_AESGCM #ifdef __IAR_SYSTEMS_ICC__ #pragma diag_suppress=Pa089 From d5df119c65ff6f7dd1f697d2d183b7b1a37e62ec Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Tue, 12 Apr 2016 15:03:34 -0600 Subject: [PATCH 106/192] fix typo in FREERTOS_TCP settings.h --- wolfssl/wolfcrypt/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index d3bbd452b..0377d5a7d 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -529,7 +529,7 @@ static char *fgets(char *buff, int sz, FILE *fp) #define NO_WRITEV #define WOLFSSL_HAVE_MIN #define USE_FAST_MATH -#define TFM_TIMING_REGISTANT +#define TFM_TIMING_RESISTANT #define NO_MAIN_DRIVER #endif From 451fd878f9bab9c509fafe6f5fb5c6b635eabc78 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 13 Apr 2016 11:48:25 -0700 Subject: [PATCH 107/192] touching whitespace in assembly routines being touched right now --- wolfcrypt/src/aes_asm.asm | 400 +++++++++++++++++++------------------- wolfcrypt/src/aes_asm.s | 305 ++++++++++++++--------------- 2 files changed, 347 insertions(+), 358 deletions(-) diff --git a/wolfcrypt/src/aes_asm.asm b/wolfcrypt/src/aes_asm.asm index 5453d2e45..345229037 100644 --- a/wolfcrypt/src/aes_asm.asm +++ b/wolfcrypt/src/aes_asm.asm @@ -101,221 +101,213 @@ LAST: AES_CBC_encrypt ENDP - -; /* -; AES_CBC_decrypt[const ,unsigned char*in -; unsigned ,char*out -; unsigned ,char ivec+16 -; unsigned ,long length -; const ,unsigned char*KS -; int nr] -; */ -; . globl AES_CBC_decrypt +; void AES_CBC_decrypt(const unsigned char* in, +; unsigned char* out, +; unsigned char ivec[16], +; unsigned long length, +; const unsigned char* KS, +; int nr) AES_CBC_decrypt PROC -;# parameter 1: rdi -;# parameter 2: rsi -;# parameter 3: rdx -;# parameter 4: rcx -;# parameter 5: r8 -;# parameter 6: r9d +; parameter 1: rdi +; parameter 2: rsi +; parameter 3: rdx +; parameter 4: rcx +; parameter 5: r8 +; parameter 6: r9d -; save rdi and rsi to rax and r11, restore before ret - mov rax,rdi - mov r11,rsi - -; convert to what we had for att&t convention - mov rdi,rcx - mov rsi,rdx - mov rdx,r8 - mov rcx,r9 - mov r8,[rsp+40] - mov r9d,[rsp+48] - -; on microsoft xmm6-xmm15 are non volaitle, let's save on stack and restore at end - sub rsp,8+8*16 ; 8 = align stack , 8 xmm6-12,15 16 bytes each - movdqa [rsp+0], xmm6 - movdqa [rsp+16], xmm7 - movdqa [rsp+32], xmm8 - movdqa [rsp+48], xmm9 - movdqa [rsp+64], xmm10 - movdqa [rsp+80], xmm11 - movdqa [rsp+96], xmm12 - movdqa [rsp+112], xmm15 - - mov r10,rcx - shr rcx,4 - shl r10,60 - je DNO_PARTS_4 - add rcx,1 + ; save rdi and rsi to rax and r11, restore before ret + mov rax, rdi + mov r11, rsi + ; convert to what we had for att&t convention + mov rdi, rcx + mov rsi, rdx + mov rdx, r8 + mov rcx,r9 + mov r8, [rsp+40] + mov r9d, [rsp+48] + ; on microsoft xmm6-xmm15 are non volatile, + ; let's save on stack and restore at end + sub rsp, 8+8*16 ; 8 = align stack , 8 xmm6-12,15 16 bytes each + movdqa [rsp+0], xmm6 + movdqa [rsp+16], xmm7 + movdqa [rsp+32], xmm8 + movdqa [rsp+48], xmm9 + movdqa [rsp+64], xmm10 + movdqa [rsp+80], xmm11 + movdqa [rsp+96], xmm12 + movdqa [rsp+112], xmm15 + mov r10, rcx + shr rcx, 4 + shl r10, 60 + je DNO_PARTS_4 + add rcx, 1 DNO_PARTS_4: - mov r10,rcx - shl r10,62 - shr r10,62 - shr rcx,2 - movdqu xmm5,[rdx] - je DREMAINDER_4 - sub rsi,64 + mov r10, rcx + shl r10, 62 + shr r10, 62 + shr rcx, 2 + movdqu xmm5, [rdx] + je DREMAINDER_4 + sub rsi, 64 DLOOP_4: - movdqu xmm1,[rdi] - movdqu xmm2,16[rdi] - movdqu xmm3,32[rdi] - movdqu xmm4,48[rdi] - movdqa xmm6,xmm1 - movdqa xmm7,xmm2 - movdqa xmm8,xmm3 - movdqa xmm15,xmm4 - movdqa xmm9,[r8] - movdqa xmm10,16[r8] - movdqa xmm11,32[r8] - movdqa xmm12,48[r8] - pxor xmm1,xmm9 - pxor xmm2,xmm9 - pxor xmm3,xmm9 - - pxor xmm4,xmm9 - aesdec xmm1,xmm10 - aesdec xmm2,xmm10 - aesdec xmm3,xmm10 - aesdec xmm4,xmm10 - aesdec xmm1,xmm11 - aesdec xmm2,xmm11 - aesdec xmm3,xmm11 - aesdec xmm4,xmm11 - aesdec xmm1,xmm12 - aesdec xmm2,xmm12 - aesdec xmm3,xmm12 - aesdec xmm4,xmm12 - movdqa xmm9,64[r8] - movdqa xmm10,80[r8] - movdqa xmm11,96[r8] - movdqa xmm12,112[r8] - aesdec xmm1,xmm9 - aesdec xmm2,xmm9 - aesdec xmm3,xmm9 - aesdec xmm4,xmm9 - aesdec xmm1,xmm10 - aesdec xmm2,xmm10 - aesdec xmm3,xmm10 - aesdec xmm4,xmm10 - aesdec xmm1,xmm11 - aesdec xmm2,xmm11 - aesdec xmm3,xmm11 - aesdec xmm4,xmm11 - aesdec xmm1,xmm12 - aesdec xmm2,xmm12 - aesdec xmm3,xmm12 - aesdec xmm4,xmm12 - movdqa xmm9,128[r8] - movdqa xmm10,144[r8] - movdqa xmm11,160[r8] - cmp r9d,12 - aesdec xmm1,xmm9 - aesdec xmm2,xmm9 - aesdec xmm3,xmm9 - aesdec xmm4,xmm9 - aesdec xmm1,xmm10 - aesdec xmm2,xmm10 - aesdec xmm3,xmm10 - aesdec xmm4,xmm10 - jb DLAST_4 - movdqa xmm9,160[r8] - movdqa xmm10,176[r8] - movdqa xmm11,192[r8] - cmp r9d,14 - aesdec xmm1,xmm9 - aesdec xmm2,xmm9 - aesdec xmm3,xmm9 - aesdec xmm4,xmm9 - aesdec xmm1,xmm10 - aesdec xmm2,xmm10 - aesdec xmm3,xmm10 - aesdec xmm4,xmm10 - jb DLAST_4 - - movdqa xmm9,192[r8] - movdqa xmm10,208[r8] - movdqa xmm11,224[r8] - aesdec xmm1,xmm9 - aesdec xmm2,xmm9 - aesdec xmm3,xmm9 - aesdec xmm4,xmm9 - aesdec xmm1,xmm10 - aesdec xmm2,xmm10 - aesdec xmm3,xmm10 - aesdec xmm4,xmm10 + movdqu xmm1, [rdi] + movdqu xmm2, 16[rdi] + movdqu xmm3, 32[rdi] + movdqu xmm4, 48[rdi] + movdqa xmm6, xmm1 + movdqa xmm7, xmm2 + movdqa xmm8, xmm3 + movdqa xmm15, xmm4 + movdqa xmm9, [r8] + movdqa xmm10, 16[r8] + movdqa xmm11, 32[r8] + movdqa xmm12, 48[r8] + pxor xmm1, xmm9 + pxor xmm2, xmm9 + pxor xmm3, xmm9 + pxor xmm4, xmm9 + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 + aesdec xmm1, xmm11 + aesdec xmm2, xmm11 + aesdec xmm3, xmm11 + aesdec xmm4, xmm11 + aesdec xmm1, xmm12 + aesdec xmm2, xmm12 + aesdec xmm3, xmm12 + aesdec xmm4, xmm12 + movdqa xmm9, 64[r8] + movdqa xmm10, 80[r8] + movdqa xmm11, 96[r8] + movdqa xmm12, 112[r8] + aesdec xmm1, xmm9 + aesdec xmm2, xmm9 + aesdec xmm3, xmm9 + aesdec xmm4, xmm9 + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 + aesdec xmm1, xmm11 + aesdec xmm2, xmm11 + aesdec xmm3, xmm11 + aesdec xmm4, xmm11 + aesdec xmm1, xmm12 + aesdec xmm2, xmm12 + aesdec xmm3, xmm12 + aesdec xmm4, xmm12 + movdqa xmm9, 128[r8] + movdqa xmm10, 144[r8] + movdqa xmm11, 160[r8] + cmp r9d, 12 + aesdec xmm1, xmm9 + aesdec xmm2, xmm9 + aesdec xmm3, xmm9 + aesdec xmm4, xmm9 + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 + jb DLAST_4 + movdqa xmm9, 160[r8] + movdqa xmm10, 176[r8] + movdqa xmm11, 192[r8] + cmp r9d, 14 + aesdec xmm1, xmm9 + aesdec xmm2, xmm9 + aesdec xmm3, xmm9 + aesdec xmm4, xmm9 + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 + jb DLAST_4 + movdqa xmm9, 192[r8] + movdqa xmm10, 208[r8] + movdqa xmm11, 224[r8] + aesdec xmm1, xmm9 + aesdec xmm2, xmm9 + aesdec xmm3, xmm9 + aesdec xmm4, xmm9 + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 DLAST_4: - add rdi,64 - add rsi,64 - dec rcx - aesdeclast xmm1,xmm11 - aesdeclast xmm2,xmm11 - aesdeclast xmm3,xmm11 - aesdeclast xmm4,xmm11 - pxor xmm1,xmm5 - pxor xmm2,xmm6 - pxor xmm3,xmm7 - pxor xmm4,xmm8 - movdqu [rsi],xmm1 - movdqu 16[rsi],xmm2 - movdqu 32[rsi],xmm3 - movdqu 48[rsi],xmm4 - movdqa xmm5,xmm15 - jne DLOOP_4 - add rsi,64 + add rdi, 64 + add rsi, 64 + dec rcx + aesdeclast xmm1, xmm11 + aesdeclast xmm2, xmm11 + aesdeclast xmm3, xmm11 + aesdeclast xmm4, xmm11 + pxor xmm1, xmm5 + pxor xmm2, xmm6 + pxor xmm3, xmm7 + pxor xmm4, xmm8 + movdqu [rsi], xmm1 + movdqu 16[rsi], xmm2 + movdqu 32[rsi], xmm3 + movdqu 48[rsi], xmm4 + movdqa xmm5, xmm15 + jne DLOOP_4 + add rsi, 64 DREMAINDER_4: - cmp r10,0 - je DEND_4 + cmp r10, 0 + je DEND_4 DLOOP_4_2: - movdqu xmm1,[rdi] - movdqa xmm15,xmm1 - add rdi,16 - pxor xmm1,[r8] - movdqu xmm2,160[r8] - cmp r9d,12 - aesdec xmm1,16[r8] - aesdec xmm1,32[r8] - aesdec xmm1,48[r8] - aesdec xmm1,64[r8] - aesdec xmm1,80[r8] - aesdec xmm1,96[r8] - aesdec xmm1,112[r8] - aesdec xmm1,128[r8] - aesdec xmm1,144[r8] - jb DLAST_4_2 - movdqu xmm2,192[r8] - cmp r9d,14 - aesdec xmm1,160[r8] - aesdec xmm1,176[r8] - jb DLAST_4_2 - movdqu xmm2,224[r8] - aesdec xmm1,192[r8] - aesdec xmm1,208[r8] + movdqu xmm1, [rdi] + movdqa xmm15, xmm1 + add rdi, 16 + pxor xmm1, [r8] + movdqu xmm2, 160[r8] + cmp r9d, 12 + aesdec xmm1, 16[r8] + aesdec xmm1, 32[r8] + aesdec xmm1, 48[r8] + aesdec xmm1, 64[r8] + aesdec xmm1, 80[r8] + aesdec xmm1, 96[r8] + aesdec xmm1, 112[r8] + aesdec xmm1, 128[r8] + aesdec xmm1, 144[r8] + jb DLAST_4_2 + movdqu xmm2, 192[r8] + cmp r9d, 14 + aesdec xmm1, 160[r8] + aesdec xmm1, 176[r8] + jb DLAST_4_2 + movdqu xmm2, 224[r8] + aesdec xmm1, 192[r8] + aesdec xmm1, 208[r8] DLAST_4_2: - aesdeclast xmm1,xmm2 - pxor xmm1,xmm5 - movdqa xmm5,xmm15 - movdqu [rsi],xmm1 - - add rsi,16 - dec r10 - jne DLOOP_4_2 + aesdeclast xmm1, xmm2 + pxor xmm1, xmm5 + movdqa xmm5, xmm15 + movdqu [rsi], xmm1 + add rsi, 16 + dec r10 + jne DLOOP_4_2 DEND_4: - ; restore non volatile rdi,rsi - mov rdi,rax - mov rsi,r11 - ; restore non volatile xmms from stack - movdqa xmm6, [rsp+0] - movdqa xmm7, [rsp+16] - movdqa xmm8, [rsp+32] - movdqa xmm9, [rsp+48] - movdqa xmm10, [rsp+64] - movdqa xmm11, [rsp+80] - movdqa xmm12, [rsp+96] - movdqa xmm15, [rsp+112] - add rsp,8+8*16 ; 8 = align stack , 8 xmm6-12,15 16 bytes each - ret + ; restore non volatile rdi,rsi + mov rdi, rax + mov rsi, r11 + ; restore non volatile xmms from stack + movdqa xmm6, [rsp+0] + movdqa xmm7, [rsp+16] + movdqa xmm8, [rsp+32] + movdqa xmm9, [rsp+48] + movdqa xmm10, [rsp+64] + movdqa xmm11, [rsp+80] + movdqa xmm12, [rsp+96] + movdqa xmm15, [rsp+112] + add rsp, 8+8*16 ; 8 = align stack , 8 xmm6-12,15 16 bytes each + ret AES_CBC_decrypt ENDP + ; /* ; AES_ECB_encrypt[const ,unsigned char*in ; unsigned ,char*out diff --git a/wolfcrypt/src/aes_asm.s b/wolfcrypt/src/aes_asm.s index 3120aef22..208e52dc5 100644 --- a/wolfcrypt/src/aes_asm.s +++ b/wolfcrypt/src/aes_asm.s @@ -105,165 +105,162 @@ AES_CBC_decrypt: # parameter 5: %r8 # parameter 6: %r9d -movq %rcx, %r10 -shrq $4, %rcx -shlq $60, %r10 -je DNO_PARTS_4 -addq $1, %rcx + movq %rcx, %r10 + shrq $4, %rcx + shlq $60, %r10 + je DNO_PARTS_4 + addq $1, %rcx DNO_PARTS_4: -movq %rcx, %r10 -shlq $62, %r10 -shrq $62, %r10 -shrq $2, %rcx -movdqu (%rdx),%xmm5 -je DREMAINDER_4 -subq $64, %rsi + movq %rcx, %r10 + shlq $62, %r10 + shrq $62, %r10 + shrq $2, %rcx + movdqu (%rdx),%xmm5 + je DREMAINDER_4 + subq $64, %rsi DLOOP_4: -movdqu (%rdi), %xmm1 -movdqu 16(%rdi), %xmm2 -movdqu 32(%rdi), %xmm3 -movdqu 48(%rdi), %xmm4 -movdqa %xmm1, %xmm6 -movdqa %xmm2, %xmm7 -movdqa %xmm3, %xmm8 -movdqa %xmm4, %xmm15 -movdqa (%r8), %xmm9 -movdqa 16(%r8), %xmm10 -movdqa 32(%r8), %xmm11 -movdqa 48(%r8), %xmm12 -pxor %xmm9, %xmm1 -pxor %xmm9, %xmm2 -pxor %xmm9, %xmm3 - -pxor %xmm9, %xmm4 -aesdec %xmm10, %xmm1 -aesdec %xmm10, %xmm2 -aesdec %xmm10, %xmm3 -aesdec %xmm10, %xmm4 -aesdec %xmm11, %xmm1 -aesdec %xmm11, %xmm2 -aesdec %xmm11, %xmm3 -aesdec %xmm11, %xmm4 -aesdec %xmm12, %xmm1 -aesdec %xmm12, %xmm2 -aesdec %xmm12, %xmm3 -aesdec %xmm12, %xmm4 -movdqa 64(%r8), %xmm9 -movdqa 80(%r8), %xmm10 -movdqa 96(%r8), %xmm11 -movdqa 112(%r8), %xmm12 -aesdec %xmm9, %xmm1 -aesdec %xmm9, %xmm2 -aesdec %xmm9, %xmm3 -aesdec %xmm9, %xmm4 -aesdec %xmm10, %xmm1 -aesdec %xmm10, %xmm2 -aesdec %xmm10, %xmm3 -aesdec %xmm10, %xmm4 -aesdec %xmm11, %xmm1 -aesdec %xmm11, %xmm2 -aesdec %xmm11, %xmm3 -aesdec %xmm11, %xmm4 -aesdec %xmm12, %xmm1 -aesdec %xmm12, %xmm2 -aesdec %xmm12, %xmm3 -aesdec %xmm12, %xmm4 -movdqa 128(%r8), %xmm9 -movdqa 144(%r8), %xmm10 -movdqa 160(%r8), %xmm11 -cmpl $12, %r9d -aesdec %xmm9, %xmm1 -aesdec %xmm9, %xmm2 -aesdec %xmm9, %xmm3 -aesdec %xmm9, %xmm4 -aesdec %xmm10, %xmm1 -aesdec %xmm10, %xmm2 -aesdec %xmm10, %xmm3 -aesdec %xmm10, %xmm4 -jb DLAST_4 -movdqa 160(%r8), %xmm9 -movdqa 176(%r8), %xmm10 -movdqa 192(%r8), %xmm11 -cmpl $14, %r9d -aesdec %xmm9, %xmm1 -aesdec %xmm9, %xmm2 -aesdec %xmm9, %xmm3 -aesdec %xmm9, %xmm4 -aesdec %xmm10, %xmm1 -aesdec %xmm10, %xmm2 -aesdec %xmm10, %xmm3 -aesdec %xmm10, %xmm4 -jb DLAST_4 - -movdqa 192(%r8), %xmm9 -movdqa 208(%r8), %xmm10 -movdqa 224(%r8), %xmm11 -aesdec %xmm9, %xmm1 -aesdec %xmm9, %xmm2 -aesdec %xmm9, %xmm3 -aesdec %xmm9, %xmm4 -aesdec %xmm10, %xmm1 -aesdec %xmm10, %xmm2 -aesdec %xmm10, %xmm3 -aesdec %xmm10, %xmm4 + movdqu (%rdi), %xmm1 + movdqu 16(%rdi), %xmm2 + movdqu 32(%rdi), %xmm3 + movdqu 48(%rdi), %xmm4 + movdqa %xmm1, %xmm6 + movdqa %xmm2, %xmm7 + movdqa %xmm3, %xmm8 + movdqa %xmm4, %xmm15 + movdqa (%r8), %xmm9 + movdqa 16(%r8), %xmm10 + movdqa 32(%r8), %xmm11 + movdqa 48(%r8), %xmm12 + pxor %xmm9, %xmm1 + pxor %xmm9, %xmm2 + pxor %xmm9, %xmm3 + pxor %xmm9, %xmm4 + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 + aesdec %xmm11, %xmm1 + aesdec %xmm11, %xmm2 + aesdec %xmm11, %xmm3 + aesdec %xmm11, %xmm4 + aesdec %xmm12, %xmm1 + aesdec %xmm12, %xmm2 + aesdec %xmm12, %xmm3 + aesdec %xmm12, %xmm4 + movdqa 64(%r8), %xmm9 + movdqa 80(%r8), %xmm10 + movdqa 96(%r8), %xmm11 + movdqa 112(%r8), %xmm12 + aesdec %xmm9, %xmm1 + aesdec %xmm9, %xmm2 + aesdec %xmm9, %xmm3 + aesdec %xmm9, %xmm4 + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 + aesdec %xmm11, %xmm1 + aesdec %xmm11, %xmm2 + aesdec %xmm11, %xmm3 + aesdec %xmm11, %xmm4 + aesdec %xmm12, %xmm1 + aesdec %xmm12, %xmm2 + aesdec %xmm12, %xmm3 + aesdec %xmm12, %xmm4 + movdqa 128(%r8), %xmm9 + movdqa 144(%r8), %xmm10 + movdqa 160(%r8), %xmm11 + cmpl $12, %r9d + aesdec %xmm9, %xmm1 + aesdec %xmm9, %xmm2 + aesdec %xmm9, %xmm3 + aesdec %xmm9, %xmm4 + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 + jb DLAST_4 + movdqa 160(%r8), %xmm9 + movdqa 176(%r8), %xmm10 + movdqa 192(%r8), %xmm11 + cmpl $14, %r9d + aesdec %xmm9, %xmm1 + aesdec %xmm9, %xmm2 + aesdec %xmm9, %xmm3 + aesdec %xmm9, %xmm4 + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 + jb DLAST_4 + movdqa 192(%r8), %xmm9 + movdqa 208(%r8), %xmm10 + movdqa 224(%r8), %xmm11 + aesdec %xmm9, %xmm1 + aesdec %xmm9, %xmm2 + aesdec %xmm9, %xmm3 + aesdec %xmm9, %xmm4 + aesdec %xmm10, %xmm1 + aesdec %xmm10, %xmm2 + aesdec %xmm10, %xmm3 + aesdec %xmm10, %xmm4 DLAST_4: -addq $64, %rdi -addq $64, %rsi -decq %rcx -aesdeclast %xmm11, %xmm1 -aesdeclast %xmm11, %xmm2 -aesdeclast %xmm11, %xmm3 -aesdeclast %xmm11, %xmm4 -pxor %xmm5 ,%xmm1 -pxor %xmm6 ,%xmm2 -pxor %xmm7 ,%xmm3 -pxor %xmm8 ,%xmm4 -movdqu %xmm1, (%rsi) -movdqu %xmm2, 16(%rsi) -movdqu %xmm3, 32(%rsi) -movdqu %xmm4, 48(%rsi) -movdqa %xmm15,%xmm5 -jne DLOOP_4 -addq $64, %rsi + addq $64, %rdi + addq $64, %rsi + decq %rcx + aesdeclast %xmm11, %xmm1 + aesdeclast %xmm11, %xmm2 + aesdeclast %xmm11, %xmm3 + aesdeclast %xmm11, %xmm4 + pxor %xmm5, %xmm1 + pxor %xmm6, %xmm2 + pxor %xmm7, %xmm3 + pxor %xmm8, %xmm4 + movdqu %xmm1, (%rsi) + movdqu %xmm2, 16(%rsi) + movdqu %xmm3, 32(%rsi) + movdqu %xmm4, 48(%rsi) + movdqa %xmm15,%xmm5 + jne DLOOP_4 + addq $64, %rsi DREMAINDER_4: -cmpq $0, %r10 -je DEND_4 + cmpq $0, %r10 + je DEND_4 DLOOP_4_2: -movdqu (%rdi), %xmm1 -movdqa %xmm1 ,%xmm15 -addq $16, %rdi -pxor (%r8), %xmm1 -movdqu 160(%r8), %xmm2 -cmpl $12, %r9d -aesdec 16(%r8), %xmm1 -aesdec 32(%r8), %xmm1 -aesdec 48(%r8), %xmm1 -aesdec 64(%r8), %xmm1 -aesdec 80(%r8), %xmm1 -aesdec 96(%r8), %xmm1 -aesdec 112(%r8), %xmm1 -aesdec 128(%r8), %xmm1 -aesdec 144(%r8), %xmm1 -jb DLAST_4_2 -movdqu 192(%r8), %xmm2 -cmpl $14, %r9d -aesdec 160(%r8), %xmm1 -aesdec 176(%r8), %xmm1 -jb DLAST_4_2 -movdqu 224(%r8), %xmm2 -aesdec 192(%r8), %xmm1 -aesdec 208(%r8), %xmm1 + movdqu (%rdi), %xmm1 + movdqa %xmm1, %xmm15 + addq $16, %rdi + pxor (%r8), %xmm1 + movdqu 160(%r8), %xmm2 + cmpl $12, %r9d + aesdec 16(%r8), %xmm1 + aesdec 32(%r8), %xmm1 + aesdec 48(%r8), %xmm1 + aesdec 64(%r8), %xmm1 + aesdec 80(%r8), %xmm1 + aesdec 96(%r8), %xmm1 + aesdec 112(%r8), %xmm1 + aesdec 128(%r8), %xmm1 + aesdec 144(%r8), %xmm1 + jb DLAST_4_2 + movdqu 192(%r8), %xmm2 + cmpl $14, %r9d + aesdec 160(%r8), %xmm1 + aesdec 176(%r8), %xmm1 + jb DLAST_4_2 + movdqu 224(%r8), %xmm2 + aesdec 192(%r8), %xmm1 + aesdec 208(%r8), %xmm1 DLAST_4_2: -aesdeclast %xmm2, %xmm1 -pxor %xmm5, %xmm1 -movdqa %xmm15, %xmm5 -movdqu %xmm1, (%rsi) - -addq $16, %rsi -decq %r10 -jne DLOOP_4_2 + aesdeclast %xmm2, %xmm1 + pxor %xmm5, %xmm1 + movdqa %xmm15, %xmm5 + movdqu %xmm1, (%rsi) + addq $16, %rsi + decq %r10 + jne DLOOP_4_2 DEND_4: -ret + ret /* @@ -453,7 +450,7 @@ EREMAINDER_6: je EEND_6 ELOOP_6_2: movdqu (%rdi), %xmm1 - movdqa %xmm1 ,%xmm10 + movdqa %xmm1, %xmm10 addq $16, %rdi pxor (%r8), %xmm1 movdqu 160(%r8), %xmm2 @@ -703,7 +700,7 @@ EREMAINDER_8: je EEND_8 ELOOP_8_2: movdqu (%rdi), %xmm1 - movdqa %xmm1 ,%xmm10 + movdqa %xmm1, %xmm10 addq $16, %rdi pxor (%r8), %xmm1 movdqu 160(%r8), %xmm2 From 13f002f186f440feda6033d0358b961981067200 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 13 Apr 2016 12:00:53 -0700 Subject: [PATCH 108/192] only compile in the AES-CBC decrypt-by-size variant selected by define, default by 8 blocks at a time --- wolfcrypt/src/aes.c | 10 +++++----- wolfcrypt/src/aes_asm.s | 12 ++++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 3ce0fbcde..220eec17d 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -1094,12 +1094,12 @@ void AES_CBC_encrypt(const unsigned char* in, unsigned char* out, XASM_LINK("AES_CBC_encrypt"); #ifdef HAVE_AES_DECRYPT -#if defined(HAVE_AES_DECRYPT_BY8) +#if defined(WOLFSSL_AESNI_BY4) void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, unsigned char* ivec, unsigned long length, const unsigned char* KS, int nr) - XASM_LINK("AES_CBC_decrypt_by8"); -#elif defined(HAVE_AES_DECRYPT_BY6) + XASM_LINK("AES_CBC_decrypt_by4"); +#elif defined(WOLFSSL_AESNI_BY6) void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, unsigned char* ivec, unsigned long length, const unsigned char* KS, int nr) @@ -1108,8 +1108,8 @@ void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, unsigned char* ivec, unsigned long length, const unsigned char* KS, int nr) - XASM_LINK("AES_CBC_decrypt"); -#endif /* HAVE_AES_DECRYPT_BYX */ + XASM_LINK("AES_CBC_decrypt_by8"); +#endif /* WOLFSSL_AESNI_BYx */ #endif /* HAVE_AES_DECRYPT */ #endif /* HAVE_AES_CBC */ diff --git a/wolfcrypt/src/aes_asm.s b/wolfcrypt/src/aes_asm.s index 208e52dc5..85863d3d7 100644 --- a/wolfcrypt/src/aes_asm.s +++ b/wolfcrypt/src/aes_asm.s @@ -86,18 +86,18 @@ jne LOOP ret - +#if defined(WOLFSSL_AESNI_BY4) /* -AES_CBC_decrypt (const unsigned char *in, +AES_CBC_decrypt_by4 (const unsigned char *in, unsigned char *out, unsigned char ivec[16], unsigned long length, const unsigned char *KS, int nr) */ -.globl AES_CBC_decrypt -AES_CBC_decrypt: +.globl AES_CBC_decrypt_by4 +AES_CBC_decrypt_by4: # parameter 1: %rdi # parameter 2: %rsi # parameter 3: %rdx @@ -262,6 +262,7 @@ DLAST_4_2: DEND_4: ret +#elif defined(WOLFSSL_AESNI_BY6) /* AES_CBC_decrypt_by6 (const unsigned char *in, @@ -484,6 +485,7 @@ ELAST_6_2: EEND_6: ret +#else /* WOLFSSL_AESNI_BYx */ /* AES_CBC_decrypt_by8 (const unsigned char *in, @@ -734,6 +736,8 @@ ELAST_8_2: EEND_8: ret +#endif /* WOLFSSL_AESNI_BYx */ + /* AES_ECB_encrypt (const unsigned char *in, From 57fce855317e46f16c38da6033a5691a5b5b7474 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 13 Apr 2016 12:18:59 -0700 Subject: [PATCH 109/192] modify AES-CBC with AESNI test to check all key sizes for each message size checked --- wolfcrypt/test/test.c | 44 +++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 6d97aa0e1..0ce5fe997 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -2722,29 +2722,37 @@ int aes_test(void) 0x70,0x6c,0x61,0x79,0x20,0x6d,0x61,0x6b, 0x65,0x73,0x20,0x4a,0x61,0x63,0x6b,0x20 }; + const byte bigKey[] = "0123456789abcdeffedcba9876543210"; byte bigCipher[sizeof(bigMsg)]; byte bigPlain[sizeof(bigMsg)]; - word32 i; + word32 keySz, msgSz; - for (i = AES_BLOCK_SIZE; i <= sizeof(bigMsg); i += AES_BLOCK_SIZE) { - memset(bigCipher, 0, sizeof(bigCipher)); - memset(bigPlain, 0, sizeof(bigPlain)); - ret = wc_AesSetKey(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION); - if (ret != 0) - return -1030; - ret = wc_AesSetKey(&dec, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION); - if (ret != 0) - return -1031; + /* Iterate from one AES_BLOCK_SIZE of bigMsg through the whole + * message by AES_BLOCK_SIZE for each size of AES key. */ + for (keySz = 16; keySz <= 32; keySz += 8) { + for (msgSz = AES_BLOCK_SIZE; + msgSz <= sizeof(bigMsg); + msgSz += AES_BLOCK_SIZE) { - ret = wc_AesCbcEncrypt(&enc, bigCipher, bigMsg, i); - if (ret != 0) - return -1032; - ret = wc_AesCbcDecrypt(&dec, bigPlain, bigCipher, i); - if (ret != 0) - return -1033; + memset(bigCipher, 0, sizeof(bigCipher)); + memset(bigPlain, 0, sizeof(bigPlain)); + ret = wc_AesSetKey(&enc, bigKey, keySz, iv, AES_ENCRYPTION); + if (ret != 0) + return -1030; + ret = wc_AesSetKey(&dec, bigKey, keySz, iv, AES_DECRYPTION); + if (ret != 0) + return -1031; - if (memcmp(bigPlain, bigMsg, i)) - return -1034; + ret = wc_AesCbcEncrypt(&enc, bigCipher, bigMsg, msgSz); + if (ret != 0) + return -1032; + ret = wc_AesCbcDecrypt(&dec, bigPlain, bigCipher, msgSz); + if (ret != 0) + return -1033; + + if (memcmp(bigPlain, bigMsg, msgSz)) + return -1034; + } } } #endif /* WOLFSSL_AESNI HAVE_AES_DECRYPT */ From 9781fa3dc902b90923241afd51f5cfa5a7f8d602 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 13 Apr 2016 15:51:19 -0700 Subject: [PATCH 110/192] relabel jump points in new code with D (decrypt) mnemonics rather than E (encrypt) --- wolfcrypt/src/aes_asm.s | 64 ++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/wolfcrypt/src/aes_asm.s b/wolfcrypt/src/aes_asm.s index 85863d3d7..ac67a09ee 100644 --- a/wolfcrypt/src/aes_asm.s +++ b/wolfcrypt/src/aes_asm.s @@ -284,9 +284,9 @@ AES_CBC_decrypt_by6: movq %rcx, %r10 shrq $4, %rcx shlq $60, %r10 - je ENO_PARTS_6 + je DNO_PARTS_6 addq $1, %rcx -ENO_PARTS_6: +DNO_PARTS_6: movq %rax, %r12 movq %rdx, %r13 movq %rbx, %r14 @@ -301,9 +301,9 @@ ENO_PARTS_6: movq %r14, %rbx cmpq $0, %rcx movdqu (%rdx), %xmm7 - je EREMAINDER_6 + je DREMAINDER_6 subq $96, %rsi -ELOOP_6: +DLOOP_6: movdqu (%rdi), %xmm1 movdqu 16(%rdi), %xmm2 movdqu 32(%rdi), %xmm3 @@ -382,7 +382,7 @@ ELOOP_6: aesdec %xmm9, %xmm4 aesdec %xmm9, %xmm5 aesdec %xmm9, %xmm6 - jb ELAST_6 + jb DLAST_6 movdqa 160(%r8), %xmm8 movdqa 176(%r8), %xmm9 movdqa 192(%r8), %xmm10 @@ -399,7 +399,7 @@ ELOOP_6: aesdec %xmm9, %xmm4 aesdec %xmm9, %xmm5 aesdec %xmm9, %xmm6 - jb ELAST_6 + jb DLAST_6 movdqa 192(%r8), %xmm8 movdqa 208(%r8), %xmm9 movdqa 224(%r8), %xmm10 @@ -415,7 +415,7 @@ ELOOP_6: aesdec %xmm9, %xmm4 aesdec %xmm9, %xmm5 aesdec %xmm9, %xmm6 -ELAST_6: +DLAST_6: addq $96, %rsi aesdeclast %xmm10, %xmm1 aesdeclast %xmm10, %xmm2 @@ -444,12 +444,12 @@ ELAST_6: movdqu %xmm6, 80(%rsi) addq $96, %rdi decq %rcx - jne ELOOP_6 + jne DLOOP_6 addq $96, %rsi -EREMAINDER_6: +DREMAINDER_6: cmpq $0, %r10 - je EEND_6 -ELOOP_6_2: + je DEND_6 +DLOOP_6_2: movdqu (%rdi), %xmm1 movdqa %xmm1, %xmm10 addq $16, %rdi @@ -465,24 +465,24 @@ ELOOP_6_2: aesdec 112(%r8), %xmm1 aesdec 128(%r8), %xmm1 aesdec 144(%r8), %xmm1 - jb ELAST_6_2 + jb DLAST_6_2 movdqu 192(%r8), %xmm2 cmpl $14, %r9d aesdec 160(%r8), %xmm1 aesdec 176(%r8), %xmm1 - jb ELAST_6_2 + jb DLAST_6_2 movdqu 224(%r8), %xmm2 aesdec 192(%r8), %xmm1 aesdec 208(%r8), %xmm1 -ELAST_6_2: +DLAST_6_2: aesdeclast %xmm2, %xmm1 pxor %xmm7, %xmm1 movdqa %xmm10, %xmm7 movdqu %xmm1, (%rsi) addq $16, %rsi decq %r10 - jne ELOOP_6_2 -EEND_6: + jne DLOOP_6_2 +DEND_6: ret #else /* WOLFSSL_AESNI_BYx */ @@ -507,17 +507,17 @@ AES_CBC_decrypt_by8: movq %rcx, %r10 shrq $4, %rcx shlq $60, %r10 - je ENO_PARTS_8 + je DNO_PARTS_8 addq $1, %rcx -ENO_PARTS_8: +DNO_PARTS_8: movq %rcx, %r10 shlq $61, %r10 shrq $61, %r10 shrq $3, %rcx movdqu (%rdx), %xmm9 - je EREMAINDER_8 + je DREMAINDER_8 subq $128, %rsi -ELOOP_8: +DLOOP_8: movdqu (%rdi), %xmm1 movdqu 16(%rdi), %xmm2 movdqu 32(%rdi), %xmm3 @@ -618,7 +618,7 @@ ELOOP_8: aesdec %xmm11, %xmm6 aesdec %xmm11, %xmm7 aesdec %xmm11, %xmm8 - jb ELAST_8 + jb DLAST_8 movdqa 160(%r8), %xmm10 movdqa 176(%r8), %xmm11 movdqa 192(%r8), %xmm12 @@ -639,7 +639,7 @@ ELOOP_8: aesdec %xmm11, %xmm6 aesdec %xmm11, %xmm7 aesdec %xmm11, %xmm8 - jb ELAST_8 + jb DLAST_8 movdqa 192(%r8), %xmm10 movdqa 208(%r8), %xmm11 movdqa 224(%r8), %xmm12 @@ -659,7 +659,7 @@ ELOOP_8: aesdec %xmm11, %xmm6 aesdec %xmm11, %xmm7 aesdec %xmm11, %xmm8 -ELAST_8: +DLAST_8: addq $128, %rsi aesdeclast %xmm12, %xmm1 aesdeclast %xmm12, %xmm2 @@ -695,12 +695,12 @@ ELAST_8: movdqu %xmm8, 112(%rsi) addq $128, %rdi decq %rcx - jne ELOOP_8 + jne DLOOP_8 addq $128, %rsi -EREMAINDER_8: +DREMAINDER_8: cmpq $0, %r10 - je EEND_8 -ELOOP_8_2: + je DEND_8 +DLOOP_8_2: movdqu (%rdi), %xmm1 movdqa %xmm1, %xmm10 addq $16, %rdi @@ -716,24 +716,24 @@ ELOOP_8_2: aesdec 112(%r8), %xmm1 aesdec 128(%r8), %xmm1 aesdec 144(%r8), %xmm1 - jb ELAST_8_2 + jb DLAST_8_2 movdqu 192(%r8), %xmm2 cmpl $14, %r9d aesdec 160(%r8), %xmm1 aesdec 176(%r8), %xmm1 - jb ELAST_8_2 + jb DLAST_8_2 movdqu 224(%r8), %xmm2 aesdec 192(%r8), %xmm1 aesdec 208(%r8), %xmm1 -ELAST_8_2: +DLAST_8_2: aesdeclast %xmm2, %xmm1 pxor %xmm9, %xmm1 movdqa %xmm10, %xmm9 movdqu %xmm1, (%rsi) addq $16, %rsi decq %r10 - jne ELOOP_8_2 -EEND_8: + jne DLOOP_8_2 +DEND_8: ret #endif /* WOLFSSL_AESNI_BYx */ From c34944e389a1dc4b19b3cf48e3f16825ba562fc6 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 13 Apr 2016 16:02:18 -0700 Subject: [PATCH 111/192] added intel-format translations of new att-format AES-NI decrypt routines --- wolfcrypt/src/aes_asm.asm | 557 +++++++++++++++++++++++++++++++++++++- 1 file changed, 549 insertions(+), 8 deletions(-) diff --git a/wolfcrypt/src/aes_asm.asm b/wolfcrypt/src/aes_asm.asm index 345229037..9bd29b88e 100644 --- a/wolfcrypt/src/aes_asm.asm +++ b/wolfcrypt/src/aes_asm.asm @@ -101,13 +101,13 @@ LAST: AES_CBC_encrypt ENDP -; void AES_CBC_decrypt(const unsigned char* in, -; unsigned char* out, -; unsigned char ivec[16], -; unsigned long length, -; const unsigned char* KS, -; int nr) -AES_CBC_decrypt PROC +; void AES_CBC_decrypt_by4(const unsigned char* in, +; unsigned char* out, +; unsigned char ivec[16], +; unsigned long length, +; const unsigned char* KS, +; int nr) +AES_CBC_decrypt_by4 PROC ; parameter 1: rdi ; parameter 2: rsi ; parameter 3: rdx @@ -136,6 +136,7 @@ AES_CBC_decrypt PROC movdqa [rsp+80], xmm11 movdqa [rsp+96], xmm12 movdqa [rsp+112], xmm15 + ; back to our original code, more or less mov r10, rcx shr rcx, 4 shl r10, 60 @@ -305,7 +306,547 @@ DEND_4: movdqa xmm15, [rsp+112] add rsp, 8+8*16 ; 8 = align stack , 8 xmm6-12,15 16 bytes each ret -AES_CBC_decrypt ENDP +AES_CBC_decrypt_by4 ENDP + + +; void AES_CBC_decrypt_by6(const unsigned char *in, +; unsigned char *out, +; unsigned char ivec[16], +; unsigned long length, +; const unsigned char *KS, +; int nr) +AES_CBC_decrypt_by6 PROC +; parameter 1: rdi - in +; parameter 2: rsi - out +; parameter 3: rdx - ivec +; parameter 4: rcx - length +; parameter 5: r8 - KS +; parameter 6: r9d - nr + + ; save rdi and rsi to rax and r11, restore before ret + mov rax, rdi + mov r11, rsi + ; convert to what we had for att&t convention + mov rdi, rcx + mov rsi, rdx + mov rdx, r8 + mov rcx, r9 + mov r8, [rsp+40] + mov r9d, [rsp+48] + ; on microsoft xmm6-xmm15 are non volatile, + ; let's save on stack and restore at end + sub rsp, 8+9*16 ; 8 = align stack , 9 xmm6-14 16 bytes each + movdqa [rsp+0], xmm6 + movdqa [rsp+16], xmm7 + movdqa [rsp+32], xmm8 + movdqa [rsp+48], xmm9 + movdqa [rsp+64], xmm10 + movdqa [rsp+80], xmm11 + movdqa [rsp+96], xmm12 + movdqa [rsp+112], xmm13 + movdqa [rsp+128], xmm14 + ; back to our original code, more or less + mov r10, rcx + shr rcx, 4 + shl r10, 60 + je DNO_PARTS_6 + add rcx, 1 +DNO_PARTS_6: + movq r12, rax + movq r13, rdx + movq r14, rbx + movq rdx, 0 + movq rax, %rcx + movq rbx, 6 + div rbx + movq rcx, rax + movq r10, rdx + movq rax, r12 + movq rdx, r13 + movq rbx, r14 + cmpq rcx, 0 + movdqu xmm7, [rdx] + je DREMAINDER_6 + subq rsi, 96 +DLOOP_6: + movdqu xmm1, [rdi] + movdqu xmm2, 16[rdi] + movdqu xmm3, 32[rdi] + movdqu xmm4, 48[rdi] + movdqu xmm5, 64[rdi] + movdqu xmm6, 80[rdi] + movdqa xmm8, [r8] + movdqa xmm9, 16[r8] + movdqa xmm10, 32[r8] + movdqa xmm11, 48[r8] + pxor xmm1, xmm8 + pxor xmm2, xmm8 + pxor xmm3, xmm8 + pxor xmm4, xmm8 + pxor xmm5, xmm8 + pxor xmm6, xmm8 + aesdec xmm1, xmm9 + aesdec xmm2, xmm9 + aesdec xmm3, xmm9 + aesdec xmm4, xmm9 + aesdec xmm5, xmm9 + aesdec xmm6, xmm9 + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 + aesdec xmm5, xmm10 + aesdec xmm6, xmm10 + aesdec xmm1, xmm11 + aesdec xmm2, xmm11 + aesdec xmm3, xmm11 + aesdec xmm4, xmm11 + aesdec xmm5, xmm11 + aesdec xmm6, xmm11 + movdqa xmm8, 64[r8] + movdqa xmm9, 80[r8] + movdqa xmm10, 96[r8] + movdqa xmm11, 112[r8] + aesdec xmm1, xmm8 + aesdec xmm2, xmm8 + aesdec xmm3, xmm8 + aesdec xmm4, xmm8 + aesdec xmm5, xmm8 + aesdec xmm6, xmm8 + aesdec xmm1, xmm9 + aesdec xmm2, xmm9 + aesdec xmm3, xmm9 + aesdec xmm4, xmm9 + aesdec xmm5, xmm9 + aesdec xmm6, xmm9 + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 + aesdec xmm5, xmm10 + aesdec xmm6, xmm10 + aesdec xmm1, xmm11 + aesdec xmm2, xmm11 + aesdec xmm3, xmm11 + aesdec xmm4, xmm11 + aesdec xmm5, xmm11 + aesdec xmm6, xmm11 + movdqa xmm8, 128[r8] + movdqa xmm9, 144[r8] + movdqa xmm10, 160[r8] + cmp r9d, 12 + aesdec xmm1, xmm8 + aesdec xmm2, xmm8 + aesdec xmm3, xmm8 + aesdec xmm4, xmm8 + aesdec xmm5, xmm8 + aesdec xmm6, xmm8 + aesdec xmm1, xmm9 + aesdec xmm2, xmm9 + aesdec xmm3, xmm9 + aesdec xmm4, xmm9 + aesdec xmm5, xmm9 + aesdec xmm6, xmm9 + jb DLAST_6 + movdqa xmm8, 160[r8] + movdqa xmm9, 176[r8] + movdqa xmm10, 192[r8] + cmp r9d, 14 + aesdec xmm1, xmm8 + aesdec xmm2, xmm8 + aesdec xmm3, xmm8 + aesdec xmm4, xmm8 + aesdec xmm5, xmm8 + aesdec xmm6, xmm8 + aesdec xmm1, xmm9 + aesdec xmm2, xmm9 + aesdec xmm3, xmm9 + aesdec xmm4, xmm9 + aesdec xmm5, xmm9 + aesdec xmm6, xmm9 + jb DLAST_6 + movdqa xmm8, 192[r8] + movdqa xmm9, 208[r8] + movdqa xmm10, 224[r8] + aesdec xmm1, xmm8 + aesdec xmm2, xmm8 + aesdec xmm3, xmm8 + aesdec xmm4, xmm8 + aesdec xmm5, xmm8 + aesdec xmm6, xmm8 + aesdec xmm1, xmm9 + aesdec xmm2, xmm9 + aesdec xmm3, xmm9 + aesdec xmm4, xmm9 + aesdec xmm5, xmm9 + aesdec xmm6, xmm9 +DLAST_6: + add rsi, 96 + aesdeclast xmm1, xmm10 + aesdeclast xmm2, xmm10 + aesdeclast xmm3, xmm10 + aesdeclast xmm4, xmm10 + aesdeclast xmm5, xmm10 + aesdeclast xmm6, xmm10 + movdqu [rdi], xmm8 + movdqu 16[rdi], xmm9 + movdqu 32[rdi], xmm10 + movdqu 48[rdi], xmm11 + movdqu 64[rdi], xmm12 + movdqu 80[rdi], xmm13 + pxor xmm1, xmm7 + pxor xmm2, xmm8 + pxor xmm3, xmm9 + pxor xmm4, xmm10 + pxor xmm5, xmm11 + pxor xmm6, xmm12 + movdqu xmm7, xmm13 + movdqu [rsi], xmm1 + movdqu 16[rsi], xmm2 + movdqu 32[rsi], xmm3 + movdqu 48[rsi], xmm4 + movdqu 64[rsi], xmm5 + movdqu 80[rsi], xmm6 + add rdi, 96 + dec rcx + jne DLOOP_6 + add rsi, 96 +DREMAINDER_6: + cmp r10, 0 + je DEND_6 +DLOOP_6_2: + movdqu xmm1, [rdi] + movdqa xmm10, xmm1 + add rdi, 16 + pxor xmm1, [r8] + movdqu xmm2, 160[r8] + cmp r9d, 12 + aesdec xmm1, 16[r8] + aesdec xmm1, 32[r8] + aesdec xmm1, 48[r8] + aesdec xmm1, 64[r8] + aesdec xmm1, 80[r8] + aesdec xmm1, 96[r8] + aesdec xmm1, 112[r8] + aesdec xmm1, 128[r8] + aesdec xmm1, 144[r8] + jb DLAST_6_2 + movdqu xmm2, 192[r8] + cmp r9d, 14, r9d + aesdec xmm1, 160[r8] + aesdec xmm1, 176[r8] + jb DLAST_6_2 + movdqu xmm2, 224[r8] + aesdec xmm1, 192[r8] + aesdec xmm1, 208[r8] +DLAST_6_2: + aesdeclast xmm1, xmm2 + pxor xmm1, xmm7 + movdqa xmm7, xmm10 + movdqu [rsi], xmm1 + add rsi, 16 + dec r10 + jne DLOOP_6_2 +DEND_6: + ; restore non volatile rdi,rsi + mov rdi, rax + mov rsi, r11 + ; restore non volatile xmms from stack + movdqa xmm6, [rsp+0] + movdqa xmm7, [rsp+16] + movdqa xmm8, [rsp+32] + movdqa xmm9, [rsp+48] + movdqa xmm10, [rsp+64] + movdqa xmm11, [rsp+80] + movdqa xmm12, [rsp+96] + movdqa xmm13, [rsp+112] + movdqa xmm14, [rsp+128] + add rsp, 8+9*16 ; 8 = align stack , 9 xmm6-14 16 bytes each + ret +AES_CBC_decrypt_by6 ENDP + + +; void AES_CBC_decrypt_by8(const unsigned char *in, +; unsigned char *out, +; unsigned char ivec[16], +; unsigned long length, +; const unsigned char *KS, +; int nr) +AES_CBC_decrypt_by8 PROC +; parameter 1: rdi - in +; parameter 2: rsi - out +; parameter 3: rdx - ivec +; parameter 4: rcx - length +; parameter 5: r8 - KS +; parameter 6: r9d - nr + + ; save rdi and rsi to rax and r11, restore before ret + mov rax, rdi + mov r11, rsi + ; convert to what we had for att&t convention + mov rdi, rcx + mov rsi, rdx + mov rdx, r8 + mov rcx,r9 + mov r8, [rsp+40] + mov r9d, [rsp+48] + ; on microsoft xmm6-xmm15 are non volatile, + ; let's save on stack and restore at end + sub rsp, 8+8*16 ; 8 = align stack , 8 xmm6-13 16 bytes each + movdqa [rsp+0], xmm6 + movdqa [rsp+16], xmm7 + movdqa [rsp+32], xmm8 + movdqa [rsp+48], xmm9 + movdqa [rsp+64], xmm10 + movdqa [rsp+80], xmm11 + movdqa [rsp+96], xmm12 + movdqa [rsp+112], xmm13 + ; back to our original code, more or less + mov r10, rcx + shr rcx, 4 + shl r10, 60 + je DNO_PARTS_8 + add rcx, 1 +DNO_PARTS_8: + mov r10, rcx + shl r10, 61 + shr r10, 61 + shr rcx, 3 + movdqu xmm9, [rdx] + je DREMAINDER_8 + sub rsi, 128 +DLOOP_8: + movdqu xmm1, [rdi] + movdqu xmm2, 16[rdi] + movdqu xmm3, 32[rdi] + movdqu xmm4, 48[rdi] + movdqu xmm5, 64[rdi] + movdqu xmm6, 80[rdi] + movdqu xmm7, 96[rdi] + movdqu xmm8, 112[rdi] + movdqa xmm10, [r8] + movdqa xmm11, 16[r8] + movdqa xmm12, 32[r8] + movdqa xmm13, 48[r8] + pxor xmm1, xmm10 + pxor xmm2, xmm10 + pxor xmm3, xmm10 + pxor xmm4, xmm10 + pxor xmm5, xmm10 + pxor xmm6, xmm10 + pxor xmm7, xmm10 + pxor xmm8, xmm10 + aesdec xmm1, xmm11 + aesdec xmm2, xmm11 + aesdec xmm3, xmm11 + aesdec xmm4, xmm11 + aesdec xmm5, xmm11 + aesdec xmm6, xmm11 + aesdec xmm7, xmm11 + aesdec xmm8, xmm11 + aesdec xmm1, xmm12 + aesdec xmm2, xmm12 + aesdec xmm3, xmm12 + aesdec xmm4, xmm12 + aesdec xmm5, xmm12 + aesdec xmm6, xmm12 + aesdec xmm7, xmm12 + aesdec xmm8, xmm12 + aesdec xmm1, xmm13 + aesdec xmm2, xmm13 + aesdec xmm3, xmm13 + aesdec xmm4, xmm13 + aesdec xmm5, xmm13 + aesdec xmm6, xmm13 + aesdec xmm7, xmm13 + aesdec xmm8, xmm13 + movdqa xmm10, 64[r8] + movdqa xmm11, 80[r8] + movdqa xmm12, 96[r8] + movdqa xmm13, 112[r8] + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 + aesdec xmm5, xmm10 + aesdec xmm6, xmm10 + aesdec xmm7, xmm10 + aesdec xmm8, xmm10 + aesdec xmm1, xmm11 + aesdec xmm2, xmm11 + aesdec xmm3, xmm11 + aesdec xmm4, xmm11 + aesdec xmm5, xmm11 + aesdec xmm6, xmm11 + aesdec xmm7, xmm11 + aesdec xmm8, xmm11 + aesdec xmm1, xmm12 + aesdec xmm2, xmm12 + aesdec xmm3, xmm12 + aesdec xmm4, xmm12 + aesdec xmm5, xmm12 + aesdec xmm6, xmm12 + aesdec xmm7, xmm12 + aesdec xmm8, xmm12 + aesdec xmm1, xmm13 + aesdec xmm2, xmm13 + aesdec xmm3, xmm13 + aesdec xmm4, xmm13 + aesdec xmm5, xmm13 + aesdec xmm6, xmm13 + aesdec xmm7, xmm13 + aesdec xmm8, xmm13 + movdqa xmm10, 128[r8] + movdqa xmm11, 144[r8] + movdqa xmm12, 160[r8] + cmp r9d, 12 + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 + aesdec xmm5, xmm10 + aesdec xmm6, xmm10 + aesdec xmm7, xmm10 + aesdec xmm8, xmm10 + aesdec xmm1, xmm11 + aesdec xmm2, xmm11 + aesdec xmm3, xmm11 + aesdec xmm4, xmm11 + aesdec xmm5, xmm11 + aesdec xmm6, xmm11 + aesdec xmm7, xmm11 + aesdec xmm8, xmm11 + jb DLAST_8 + movdqa xmm10, 160[r8] + movdqa xmm11, 176[r8] + movdqa xmm12, 192[r8] + cmp r9d, 14 + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 + aesdec xmm5, xmm10 + aesdec xmm6, xmm10 + aesdec xmm7, xmm10 + aesdec xmm8, xmm10 + aesdec xmm1, xmm11 + aesdec xmm2, xmm11 + aesdec xmm3, xmm11 + aesdec xmm4, xmm11 + aesdec xmm5, xmm11 + aesdec xmm6, xmm11 + aesdec xmm7, xmm11 + aesdec xmm8, xmm11 + jb DLAST_8 + movdqa xmm10, 192[r8] + movdqa xmm11, 208[r8] + movdqa xmm12, 224[r8] + aesdec xmm1, xmm10 + aesdec xmm2, xmm10 + aesdec xmm3, xmm10 + aesdec xmm4, xmm10 + aesdec xmm5, xmm10 + aesdec xmm6, xmm10 + aesdec xmm7, xmm10 + aesdec xmm8, xmm10 + aesdec xmm1, xmm11 + aesdec xmm2, xmm11 + aesdec xmm3, xmm11 + aesdec xmm4, xmm11 + aesdec xmm5, xmm11 + aesdec xmm6, xmm11 + aesdec xmm7, xmm11 + aesdec xmm8, xmm11 +DLAST_8: + add 128, rsi + aesdeclast xmm1, xmm12 + aesdeclast xmm2, xmm12 + aesdeclast xmm3, xmm12 + aesdeclast xmm4, xmm12 + aesdeclast xmm5, xmm12 + aesdeclast xmm6, xmm12 + aesdeclast xmm7, xmm12 + aesdeclast xmm8, xmm12 + movdqu xmm10, [rdi] + movdqu xmm11, 16[rdi] + movdqu xmm12, 32[rdi] + movdqu xmm13, 48[rdi] + pxor xmm1, xmm9 + pxor xmm2, xmm10 + pxor xmm3, xmm11 + pxor xmm4, xmm12 + pxor xmm5, xmm13 + movdqu xmm10, 64[rdi] + movdqu xmm11, 80[rdi] + movdqu xmm12, 96[rdi] + movdqu xmm9, 112[rdi] + pxor xmm6, xmm10 + pxor xmm7, xmm11 + pxor xmm8, xmm12 + movdqu [rsi], xmm1 + movdqu 16[rsi], xmm2 + movdqu 32[rsi], xmm3 + movdqu 48[rsi], xmm4 + movdqu 64[rsi], xmm5 + movdqu 80[rsi], xmm6 + movdqu 96[rsi], xmm7 + movdqu 112[rsi], xmm8 + add rdi, 128 + dec rcx + jne DLOOP_8 + add rsi, 128 +DREMAINDER_8: + cmp r10, 0 + je DEND_8 +DLOOP_8_2: + movdqu xmm1, [rdi] + movdqa xmm10, xmm1 + add rdi, 16 + pxor xmm1, [r8] + movdqu xmm2, 160[r8] + cmp r9d, 12 + aesdec xmm1, 16[r8] + aesdec xmm1, 32[r8] + aesdec xmm1, 48[r8] + aesdec xmm1, 64[r8] + aesdec xmm1, 80[r8] + aesdec xmm1, 96[r8] + aesdec xmm1, 112[r8] + aesdec xmm1, 128[r8] + aesdec xmm1, 144[r8] + jb DLAST_8_2 + movdqu xmm2, 192[r8] + cmp r9d, 14 + aesdec xmm1, 160[r8] + aesdec xmm1, 176[r8] + jb DLAST_8_2 + movdqu xmm2, 224[r8] + aesdec xmm1, 192[r8] + aesdec xmm1, 208[r8] +DLAST_8_2: + aesdeclast xmm1, xmm2 + pxor xmm1, xmm9 + movdqa xmm9, xmm10 + movdqu [rsi], xmm1 + add rsi, 16 + dec r10 + jne DLOOP_8_2 +DEND_8: + ; restore non volatile rdi,rsi + mov rdi, rax + mov rsi, r11 + ; restore non volatile xmms from stack + movdqa xmm6, [rsp+0] + movdqa xmm7, [rsp+16] + movdqa xmm8, [rsp+32] + movdqa xmm9, [rsp+48] + movdqa xmm10, [rsp+64] + movdqa xmm11, [rsp+80] + movdqa xmm12, [rsp+96] + movdqa xmm13, [rsp+112] + add rsp, 8+8*16 ; 8 = align stack , 8 xmm6-13 16 bytes each + ret +AES_CBC_decrypt_by6 ENDP ; /* From 6f51c2a8f8c023130b10567db61e4d207a20351d Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 13 Apr 2016 16:42:58 -0700 Subject: [PATCH 112/192] 1. Fix bad opcode mnemonics in the intel-format source listing. 2. Update the aes.c file to call both format assembly routines the same way. --- wolfcrypt/src/aes.c | 42 +++++++++++++++++++++++---------------- wolfcrypt/src/aes_asm.asm | 32 ++++++++++++++--------------- 2 files changed, 41 insertions(+), 33 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 220eec17d..6d5d9fa96 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -1094,22 +1094,22 @@ void AES_CBC_encrypt(const unsigned char* in, unsigned char* out, XASM_LINK("AES_CBC_encrypt"); #ifdef HAVE_AES_DECRYPT -#if defined(WOLFSSL_AESNI_BY4) -void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, - unsigned char* ivec, unsigned long length, - const unsigned char* KS, int nr) - XASM_LINK("AES_CBC_decrypt_by4"); -#elif defined(WOLFSSL_AESNI_BY6) -void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, - unsigned char* ivec, unsigned long length, - const unsigned char* KS, int nr) - XASM_LINK("AES_CBC_decrypt_by6"); -#else -void AES_CBC_decrypt(const unsigned char* in, unsigned char* out, - unsigned char* ivec, unsigned long length, - const unsigned char* KS, int nr) - XASM_LINK("AES_CBC_decrypt_by8"); -#endif /* WOLFSSL_AESNI_BYx */ + #if defined(WOLFSSL_AESNI_BY4) + void AES_CBC_decrypt_by4(const unsigned char* in, unsigned char* out, + unsigned char* ivec, unsigned long length, + const unsigned char* KS, int nr) + XASM_LINK("AES_CBC_decrypt_by4"); + #elif defined(WOLFSSL_AESNI_BY6) + void AES_CBC_decrypt_by6(const unsigned char* in, unsigned char* out, + unsigned char* ivec, unsigned long length, + const unsigned char* KS, int nr) + XASM_LINK("AES_CBC_decrypt_by6"); + #else /* WOLFSSL_AESNI_BYx */ + void AES_CBC_decrypt_by8(const unsigned char* in, unsigned char* out, + unsigned char* ivec, unsigned long length, + const unsigned char* KS, int nr) + XASM_LINK("AES_CBC_decrypt_by8"); + #endif /* WOLFSSL_AESNI_BYx */ #endif /* HAVE_AES_DECRYPT */ #endif /* HAVE_AES_CBC */ @@ -2561,8 +2561,16 @@ int wc_AesSetIV(Aes* aes, const byte* iv) /* if input and output same will overwrite input iv */ XMEMCPY(aes->tmp, in + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE); - AES_CBC_decrypt(in, out, (byte*)aes->reg, sz, (byte*)aes->key, + #if defined(WOLFSSL_AESNI_BY4) + AES_CBC_decrypt_by4(in, out, (byte*)aes->reg, sz, (byte*)aes->key, aes->rounds); + #elif defined(WOLFSSL_AESNI_BY6) + AES_CBC_decrypt_by6(in, out, (byte*)aes->reg, sz, (byte*)aes->key, + aes->rounds); + #else /* WOLFSSL_AESNI_BYx */ + AES_CBC_decrypt_by8(in, out, (byte*)aes->reg, sz, (byte*)aes->key, + aes->rounds); + #endif /* WOLFSSL_AESNI_BYx */ /* store iv for next call */ XMEMCPY(aes->reg, aes->tmp, AES_BLOCK_SIZE); return 0; diff --git a/wolfcrypt/src/aes_asm.asm b/wolfcrypt/src/aes_asm.asm index 9bd29b88e..cd3187794 100644 --- a/wolfcrypt/src/aes_asm.asm +++ b/wolfcrypt/src/aes_asm.asm @@ -352,22 +352,22 @@ AES_CBC_decrypt_by6 PROC je DNO_PARTS_6 add rcx, 1 DNO_PARTS_6: - movq r12, rax - movq r13, rdx - movq r14, rbx - movq rdx, 0 - movq rax, %rcx - movq rbx, 6 + mov r12, rax + mov r13, rdx + mov r14, rbx + mov rdx, 0 + mov rax, rcx + mov rbx, 6 div rbx - movq rcx, rax - movq r10, rdx - movq rax, r12 - movq rdx, r13 - movq rbx, r14 - cmpq rcx, 0 + mov rcx, rax + mov r10, rdx + mov rax, r12 + mov rdx, r13 + mov rbx, r14 + cmp rcx, 0 movdqu xmm7, [rdx] je DREMAINDER_6 - subq rsi, 96 + sub rsi, 96 DLOOP_6: movdqu xmm1, [rdi] movdqu xmm2, 16[rdi] @@ -532,7 +532,7 @@ DLOOP_6_2: aesdec xmm1, 144[r8] jb DLAST_6_2 movdqu xmm2, 192[r8] - cmp r9d, 14, r9d + cmp r9d, 14 aesdec xmm1, 160[r8] aesdec xmm1, 176[r8] jb DLAST_6_2 @@ -758,7 +758,7 @@ DLOOP_8: aesdec xmm7, xmm11 aesdec xmm8, xmm11 DLAST_8: - add 128, rsi + add rsi, 128 aesdeclast xmm1, xmm12 aesdeclast xmm2, xmm12 aesdeclast xmm3, xmm12 @@ -846,7 +846,7 @@ DEND_8: movdqa xmm13, [rsp+112] add rsp, 8+8*16 ; 8 = align stack , 8 xmm6-13 16 bytes each ret -AES_CBC_decrypt_by6 ENDP +AES_CBC_decrypt_by8 ENDP ; /* From 35c5353698191e3db3f614c18badefc30110e9c7 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Thu, 14 Apr 2016 16:26:51 +0900 Subject: [PATCH 113/192] fixed current_time argument --- examples/client/client.c | 18 +++++++++--------- examples/server/server.c | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index c96c0f93f..24d5b09b0 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -150,7 +150,7 @@ static void ShowVersions(void) printf("3\n"); } -extern double current_time(void); +extern double current_time(int); int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, int doDTLS, int benchmark, int resumeSession) @@ -168,7 +168,7 @@ int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, #ifndef NO_SESSION_CACHE int benchResume = resumeSession && loops == 0; #endif - double start = current_time(), avg; + double start = current_time(1), avg; for (i = 0; i < times; i++) { SOCKET_T sockfd; @@ -197,7 +197,7 @@ int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, wolfSSL_free(ssl); CloseSocket(sockfd); } - avg = current_time() - start; + avg = current_time(0) - start; avg /= times; avg *= 1000; /* milliseconds */ #ifndef NO_SESSION_CACHE @@ -219,7 +219,7 @@ int ClientBenchmarkThroughput(WOLFSSL_CTX* ctx, char* host, word16 port, WOLFSSL* ssl; int ret; - start = current_time(); + start = current_time(1); ssl = wolfSSL_new(ctx); if (ssl == NULL) err_sys("unable to get SSL object"); @@ -232,7 +232,7 @@ int ClientBenchmarkThroughput(WOLFSSL_CTX* ctx, char* host, word16 port, char *tx_buffer, *rx_buffer; /* Record connection time */ - conn_time = current_time() - start; + conn_time = current_time(0) - start; /* Allocate TX/RX buffers */ tx_buffer = (char*)malloc(TEST_BUFFER_SIZE); @@ -261,18 +261,18 @@ int ClientBenchmarkThroughput(WOLFSSL_CTX* ctx, char* host, word16 port, len = min(TEST_BUFFER_SIZE, throughput - xfer_bytes); /* Perform TX */ - start = current_time(); + start = current_time(1); if (wolfSSL_write(ssl, tx_buffer, len) != len) { int writeErr = wolfSSL_get_error(ssl, 0); printf("wolfSSL_write error %d!\n", writeErr); err_sys("wolfSSL_write failed"); } - tx_time += current_time() - start; + tx_time += current_time(0) - start; /* Perform RX */ select_ret = tcp_select(sockfd, 1); /* Timeout=1 second */ if (select_ret == TEST_RECV_READY) { - start = current_time(); + start = current_time(1); rx_pos = 0; while(rx_pos < len) { ret = wolfSSL_read(ssl, &rx_buffer[rx_pos], len - rx_pos); @@ -287,7 +287,7 @@ int ClientBenchmarkThroughput(WOLFSSL_CTX* ctx, char* host, word16 port, rx_pos += ret; } } - rx_time += current_time() - start; + rx_time += current_time(0) - start; } /* Compare TX and RX buffers */ diff --git a/examples/server/server.c b/examples/server/server.c index 73c90cc31..c8ef0c389 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -125,7 +125,7 @@ static int NonBlockingSSL_Accept(SSL* ssl) return ret; } -extern double current_time(void); +extern double current_time(int); /* Echo number of bytes specified by -e arg */ int ServerEchoData(SSL* ssl, int clientfd, int echoData, int throughput) @@ -141,7 +141,7 @@ int ServerEchoData(SSL* ssl, int clientfd, int echoData, int throughput) int len = min(TEST_BUFFER_SIZE, throughput - xfer_bytes); int rx_pos = 0; if(throughput) { - start = current_time(); + start = current_time(1); } while(rx_pos < len) { ret = SSL_read(ssl, &buffer[rx_pos], len - rx_pos); @@ -157,14 +157,14 @@ int ServerEchoData(SSL* ssl, int clientfd, int echoData, int throughput) } } if(throughput) { - rx_time += current_time() - start; - start = current_time(); + rx_time += current_time(0) - start; + start = current_time(1); } if (SSL_write(ssl, buffer, len) != len) { err_sys("SSL_write failed"); } if(throughput) { - tx_time += current_time() - start; + tx_time += current_time(0) - start; } xfer_bytes += len; From 98dffc070a20a3a65b7b8820d61915b3a82dca5f Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Thu, 14 Apr 2016 18:32:33 +0900 Subject: [PATCH 114/192] current_time in test.h --- wolfssl/test.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wolfssl/test.h b/wolfssl/test.h index 293ef0309..4bde12c99 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -997,11 +997,12 @@ static INLINE unsigned int my_psk_server_cb(WOLFSSL* ssl, const char* identity, #if !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_KEIL_TCP_NET) #include - static INLINE double current_time(void) + static INLINE double current_time(int reset) { struct timeval tv; gettimeofday(&tv, 0); - + (void)reset; + return (double)tv.tv_sec + (double)tv.tv_usec / 1000000; } From cab1ebf2d611404f6db709badbbfc69bd570303f Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Thu, 14 Apr 2016 18:47:16 +0900 Subject: [PATCH 115/192] move MDK5 current_time to test.h --- examples/client/client.c | 2 -- examples/server/server.c | 2 -- wolfssl/test.h | 3 ++- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 24d5b09b0..fc8e1276c 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -150,8 +150,6 @@ static void ShowVersions(void) printf("3\n"); } -extern double current_time(int); - int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, int doDTLS, int benchmark, int resumeSession) { diff --git a/examples/server/server.c b/examples/server/server.c index c8ef0c389..d19f6adf5 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -125,8 +125,6 @@ static int NonBlockingSSL_Accept(SSL* ssl) return ret; } -extern double current_time(int); - /* Echo number of bytes specified by -e arg */ int ServerEchoData(SSL* ssl, int clientfd, int echoData, int throughput) { diff --git a/wolfssl/test.h b/wolfssl/test.h index 4bde12c99..2518744e9 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -1005,7 +1005,8 @@ static INLINE unsigned int my_psk_server_cb(WOLFSSL* ssl, const char* identity, return (double)tv.tv_sec + (double)tv.tv_usec / 1000000; } - +#else + extern double current_time(int reset); #endif #endif /* USE_WINDOWS_API */ From f9988516420577fabd6c8bc3a199d73ad31fc9ce Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 14 Apr 2016 09:33:25 -0600 Subject: [PATCH 116/192] fix check on RSA key size --- wolfcrypt/src/error.c | 3 +++ wolfcrypt/src/rsa.c | 41 +++++++++++++++++++++++++++------ wolfcrypt/user-crypto/src/rsa.c | 32 +++++++++++++++++++++---- wolfssl/wolfcrypt/error-crypt.h | 2 ++ 4 files changed, 66 insertions(+), 12 deletions(-) diff --git a/wolfcrypt/src/error.c b/wolfcrypt/src/error.c index eb28981f1..5ad5d77a5 100644 --- a/wolfcrypt/src/error.c +++ b/wolfcrypt/src/error.c @@ -377,6 +377,9 @@ const char* wc_GetErrorString(int error) case WC_PENDING_E: return "wolfCrypt Operation Pending (would block / eagain) error"; + case WC_KEY_SIZE_E: + return "Key size error, either too small or large"; + default: return "unknown error number"; diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index ea5bf381f..690a7c804 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -413,8 +413,7 @@ static int wc_RsaPad_OAEP(const byte* input, word32 inputLen, byte* pkcsBlock, } #endif - if ((ret = wc_Hash(hType, optLabel, labelLen, - lHash, hLen)) != 0) { + if ((ret = wc_Hash(hType, optLabel, labelLen, lHash, hLen)) != 0) { WOLFSSL_MSG("OAEP hash type possibly not supported or lHash to small"); #ifdef WOLFSSL_SMALL_STACK XFREE(lHash, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -542,21 +541,33 @@ static int wc_RsaPad_OAEP(const byte* input, word32 inputLen, byte* pkcsBlock, static int wc_RsaPad(const byte* input, word32 inputLen, byte* pkcsBlock, word32 pkcsBlockLen, byte padValue, WC_RNG* rng) { - if (inputLen == 0) - return 0; + if (inputLen == 0 || pkcsBlockLen == 0) { + return BAD_FUNC_ARG; + } pkcsBlock[0] = 0x0; /* set first byte to zero and advance */ pkcsBlock++; pkcsBlockLen--; pkcsBlock[0] = padValue; /* insert padValue */ - if (padValue == RSA_BLOCK_TYPE_1) + if (padValue == RSA_BLOCK_TYPE_1) { + if (pkcsBlockLen < inputLen + 2) { + return RSA_PAD_E; + } + /* pad with 0xff bytes */ XMEMSET(&pkcsBlock[1], 0xFF, pkcsBlockLen - inputLen - 2); + } else { /* pad with non-zero random bytes */ - word32 padLen = pkcsBlockLen - inputLen - 1, i; - int ret = wc_RNG_GenerateBlock(rng, &pkcsBlock[1], padLen); + word32 padLen, i; + int ret; + if (pkcsBlockLen < inputLen + 1) { + return RSA_PAD_E; + } + + padLen = pkcsBlockLen - inputLen - 1; + ret = wc_RNG_GenerateBlock(rng, &pkcsBlock[1], padLen); if (ret != 0) return ret; @@ -701,6 +712,10 @@ static int RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen, i = 1, outputLen; + if (pkcsBlockLen == 0) { + return BAD_FUNC_ARG; + } + if (pkcsBlock[0] != 0x0) /* skip past zero */ invalid = 1; pkcsBlock++; pkcsBlockLen--; @@ -882,6 +897,10 @@ int wc_RsaPublicEncrypt(const byte* in, word32 inLen, byte* out, word32 outLen, if (sz > (int)outLen) return RSA_BUFFER_E; + if (sz < RSA_MIN_PAD_SZ) { + return WC_KEY_SIZE_E; + } + if (inLen > (word32)(sz - RSA_MIN_PAD_SZ)) return RSA_BUFFER_E; @@ -925,6 +944,10 @@ int wc_RsaPublicEncrypt_ex(const byte* in, word32 inLen, byte* out, if (sz > (int)outLen) return RSA_BUFFER_E; + if (sz < RSA_MIN_PAD_SZ) { + return WC_KEY_SIZE_E; + } + if (inLen > (word32)(sz - RSA_MIN_PAD_SZ)) return RSA_BUFFER_E; @@ -1180,6 +1203,10 @@ int wc_RsaSSL_Sign(const byte* in, word32 inLen, byte* out, word32 outLen, if (sz > (int)outLen) return RSA_BUFFER_E; + if (sz < RSA_MIN_PAD_SZ) { + return WC_KEY_SIZE_E; + } + if (inLen > (word32)(sz - RSA_MIN_PAD_SZ)) return RSA_BUFFER_E; diff --git a/wolfcrypt/user-crypto/src/rsa.c b/wolfcrypt/user-crypto/src/rsa.c index a3df104a3..748c420c4 100644 --- a/wolfcrypt/user-crypto/src/rsa.c +++ b/wolfcrypt/user-crypto/src/rsa.c @@ -528,20 +528,33 @@ int SetRsaInternal(WOLFSSL_RSA* rsa) static int wc_RsaPad(const byte* input, word32 inputLen, byte* pkcsBlock, word32 pkcsBlockLen, byte padValue, WC_RNG* rng) { - if (inputLen == 0) - return 0; + if (inputLen == 0 || pkcsBlockLen == 0) { + return USER_CRYPTO_ERROR; + } pkcsBlock[0] = 0x0; /* set first byte to zero and advance */ pkcsBlock++; pkcsBlockLen--; pkcsBlock[0] = padValue; /* insert padValue */ - if (padValue == RSA_BLOCK_TYPE_1) + if (padValue == RSA_BLOCK_TYPE_1) { + if (pkcsBlockLen < inputLen + 2) { + return USER_CRYPTO_ERROR; + } + /* pad with 0xff bytes */ XMEMSET(&pkcsBlock[1], 0xFF, pkcsBlockLen - inputLen - 2); + } else { /* pad with non-zero random bytes */ - word32 padLen = pkcsBlockLen - inputLen - 1, i; - int ret = wc_RNG_GenerateBlock(rng, &pkcsBlock[1], padLen); + word32 padLen, i; + int ret; + + if (pkcsBlockLen < inputLen + 1) { + return USER_CRYPTO_ERROR; + } + + padLen = pkcsBlockLen - inputLen - 1; + ret = wc_RNG_GenerateBlock(rng, &pkcsBlock[1], padLen); if (ret != 0) return ret; @@ -568,6 +581,10 @@ static int RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen, i = 1, outputLen; + if (pkcsBlockLen == 0) { + return USER_CRYPTO_ERROR; + } + if (pkcsBlock[0] != 0x0) /* skip past zero */ invalid = 1; pkcsBlock++; pkcsBlockLen--; @@ -1612,6 +1629,11 @@ int wc_RsaSSL_Sign(const byte* in, word32 inLen, byte* out, word32 outLen, return USER_CRYPTO_ERROR; } + if (sz < RSA_MIN_PAD_SZ) { + USER_DEBUG(("Key size is too small\n")); + return USER_CRYPTO_ERROR; + } + if (inLen > (word32)(sz - RSA_MIN_PAD_SZ)) { USER_DEBUG(("Bad argument inLen to wc_RsaSSL_Sign\n")); return USER_CRYPTO_ERROR; diff --git a/wolfssl/wolfcrypt/error-crypt.h b/wolfssl/wolfcrypt/error-crypt.h index 523e380b4..fe1aef3e5 100644 --- a/wolfssl/wolfcrypt/error-crypt.h +++ b/wolfssl/wolfcrypt/error-crypt.h @@ -169,6 +169,8 @@ enum { HASH_TYPE_E = -232, /* Hash Type not enabled/available */ WC_PENDING_E = -233, /* wolfCrypt operation pending (would block) */ + WC_KEY_SIZE_E = -234, /* Key size error, either too small or large */ + MIN_CODE_E = -300 /* errors -101 - -299 */ /* add new companion error id strings for any new error codes From 5340ea0d796ee3a934f7508c4489f999acc902af Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 14 Apr 2016 10:47:14 -0700 Subject: [PATCH 117/192] fixed a missing operand swap in the AES-CBC decrypt by 6 --- wolfcrypt/src/aes_asm.asm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wolfcrypt/src/aes_asm.asm b/wolfcrypt/src/aes_asm.asm index cd3187794..6fe026d5c 100644 --- a/wolfcrypt/src/aes_asm.asm +++ b/wolfcrypt/src/aes_asm.asm @@ -488,12 +488,12 @@ DLAST_6: aesdeclast xmm4, xmm10 aesdeclast xmm5, xmm10 aesdeclast xmm6, xmm10 - movdqu [rdi], xmm8 - movdqu 16[rdi], xmm9 - movdqu 32[rdi], xmm10 - movdqu 48[rdi], xmm11 - movdqu 64[rdi], xmm12 - movdqu 80[rdi], xmm13 + movdqu xmm8, [rdi] + movdqu xmm9, 16[rdi] + movdqu xmm10, 32[rdi] + movdqu xmm11, 48[rdi] + movdqu xmm12, 64[rdi] + movdqu xmm13, 80[rdi] pxor xmm1, xmm7 pxor xmm2, xmm8 pxor xmm3, xmm9 From 526606e42fb9b08c64af2f411071fb76ac355787 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 14 Apr 2016 11:30:10 -0700 Subject: [PATCH 118/192] added conditional assembly for the intel-format AES_NI decrypt procedures --- wolfcrypt/src/aes_asm.asm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wolfcrypt/src/aes_asm.asm b/wolfcrypt/src/aes_asm.asm index 6fe026d5c..cd7bc78a1 100644 --- a/wolfcrypt/src/aes_asm.asm +++ b/wolfcrypt/src/aes_asm.asm @@ -100,6 +100,7 @@ LAST: ret AES_CBC_encrypt ENDP +IFDEF WOLFSSL_AESNI_BY4 ; void AES_CBC_decrypt_by4(const unsigned char* in, ; unsigned char* out, @@ -308,6 +309,8 @@ DEND_4: ret AES_CBC_decrypt_by4 ENDP +ELSE +IFDEF WOLFSSL_AESNI_BY6 ; void AES_CBC_decrypt_by6(const unsigned char *in, ; unsigned char *out, @@ -565,6 +568,7 @@ DEND_6: ret AES_CBC_decrypt_by6 ENDP +ELSE ; void AES_CBC_decrypt_by8(const unsigned char *in, ; unsigned char *out, @@ -848,6 +852,8 @@ DEND_8: ret AES_CBC_decrypt_by8 ENDP +ENDIF +ENDIF ; /* ; AES_ECB_encrypt[const ,unsigned char*in From 4506839c6d2592018a79847043561c54a81969e7 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 14 Apr 2016 11:57:42 -0700 Subject: [PATCH 119/192] back out last commit. it was a pain to use. --- wolfcrypt/src/aes_asm.asm | 6 ------ 1 file changed, 6 deletions(-) diff --git a/wolfcrypt/src/aes_asm.asm b/wolfcrypt/src/aes_asm.asm index cd7bc78a1..6fe026d5c 100644 --- a/wolfcrypt/src/aes_asm.asm +++ b/wolfcrypt/src/aes_asm.asm @@ -100,7 +100,6 @@ LAST: ret AES_CBC_encrypt ENDP -IFDEF WOLFSSL_AESNI_BY4 ; void AES_CBC_decrypt_by4(const unsigned char* in, ; unsigned char* out, @@ -309,8 +308,6 @@ DEND_4: ret AES_CBC_decrypt_by4 ENDP -ELSE -IFDEF WOLFSSL_AESNI_BY6 ; void AES_CBC_decrypt_by6(const unsigned char *in, ; unsigned char *out, @@ -568,7 +565,6 @@ DEND_6: ret AES_CBC_decrypt_by6 ENDP -ELSE ; void AES_CBC_decrypt_by8(const unsigned char *in, ; unsigned char *out, @@ -852,8 +848,6 @@ DEND_8: ret AES_CBC_decrypt_by8 ENDP -ENDIF -ENDIF ; /* ; AES_ECB_encrypt[const ,unsigned char*in From c9891567e85e67c1165db1e6abc182e058cf3994 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 14 Apr 2016 13:35:49 -0600 Subject: [PATCH 120/192] add check for min RSA key size at TLS/SSL level --- examples/server/server.c | 13 +++++- src/internal.c | 58 +++++++++++++++++++++++++- src/ssl.c | 89 ++++++++++++++++++++++++++++++++++++++++ wolfssl/error-ssl.h | 1 + wolfssl/internal.h | 25 +++++++++++ wolfssl/ssl.h | 5 +++ wolfssl/test.h | 5 +++ 7 files changed, 192 insertions(+), 4 deletions(-) diff --git a/examples/server/server.c b/examples/server/server.c index 65845dd0a..64a0a263d 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -276,7 +276,8 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) int loopIndefinitely = 0; int echoData = 0; int throughput = 0; - int minDhKeyBits = DEFAULT_MIN_DHKEY_BITS; + int minDhKeyBits = DEFAULT_MIN_DHKEY_BITS; + int minRsaKeyBits = DEFAULT_MIN_RSAKEY_BITS; int doListen = 1; int crlFlags = 0; int ret; @@ -327,6 +328,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) (void)useNtruKey; (void)doCliCertCheck; (void)minDhKeyBits; + (void)minRsaKeyBits; (void)alpnList; (void)alpn_opt; (void)crlFlags; @@ -642,7 +644,14 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #endif #ifndef NO_DH - wolfSSL_CTX_SetMinDhKey_Sz(ctx, (word16)minDhKeyBits); + if (wolfSSL_CTX_SetMinDhKey_Sz(ctx, (word16)minDhKeyBits) != SSL_SUCCESS) { + err_sys("Error setting minimum DH key size"); + } +#endif +#ifndef NO_RSA + if (wolfSSL_CTX_SetMinRsaKey_Sz(ctx, (word16)minRsaKeyBits) != SSL_SUCCESS){ + err_sys("Error setting minimum RSA key size"); + } #endif #ifdef HAVE_NTRU diff --git a/src/internal.c b/src/internal.c index 9407321da..f6aa4382c 100755 --- a/src/internal.c +++ b/src/internal.c @@ -549,7 +549,10 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method) } #ifndef NO_DH - ctx->minDhKeySz = MIN_DHKEY_SZ; + ctx->minDhKeySz = MIN_DHKEY_SZ; +#endif +#ifndef NO_RSA + ctx->minRsaKeySz = MIN_RSAKEY_SZ; #endif #ifdef HAVE_ECC @@ -2234,6 +2237,9 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx) #ifndef NO_DH ssl->options.minDhKeySz = ctx->minDhKeySz; #endif +#ifndef NO_RSA + ssl->options.minRsaKeySz = ctx->minRsaKeySz; +#endif ssl->options.sessionCacheOff = ctx->sessionCacheOff; ssl->options.sessionCacheFlushOff = ctx->sessionCacheFlushOff; @@ -5130,6 +5136,23 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, subjectHash = dCert->subjectHash; #endif + /* Check key sizes for certs. Is redundent check since ProcessBuffer + also performs this check. */ + switch (dCert->keyOID) { + #ifndef NO_RSA + case RSAk: + if (dCert->pubKeySize < ssl->options.minRsaKeySz) { + WOLFSSL_MSG("RSA key in cert chain was too small"); + ret = RSA_KEY_SIZE_E; + } + break; + #endif /* !NO_RSA */ + + default: + WOLFSSL_MSG("Key size not checked"); + break; /* key is not being checked for size if not in switch */ + } + if (ret == 0 && dCert->isCA == 0) { WOLFSSL_MSG("Chain cert is not a CA, not adding as one"); } @@ -5441,6 +5464,15 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, #endif /* NO_RSA */ #endif /*HAVE_PK_CALLBACKS */ } + + /* check size of peer RSA key */ + if (ret == 0 && ssl->peerRsaKeyPresent && + wc_RsaEncryptSize(ssl->peerRsaKey) + < ssl->options.minRsaKeySz) { + ret = RSA_KEY_SIZE_E; + WOLFSSL_MSG("Peer RSA key is too small"); + } + } break; #endif /* NO_RSA */ @@ -10130,6 +10162,9 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e) case ASYNC_NOT_PENDING: return "Async operation not pending"; + case RSA_KEY_SIZE_E: + return "RSA key too small"; + default : return "unknown error number"; } @@ -13919,8 +13954,13 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) if (ret == 0) ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &idx, &key, ssl->buffers.key->length); - if (ret == 0) + if (ret == 0) { sigOutSz = wc_RsaEncryptSize(&key); + if (sigOutSz < ssl->options.minRsaKeySz) { + WOLFSSL_MSG("RSA key size too small"); + return RSA_KEY_SIZE_E; + } + } else #endif { @@ -14868,6 +14908,11 @@ int DoSessionTicket(WOLFSSL* ssl, goto exit_sske; } sigSz = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); + + if (sigSz < ssl->options.minRsaKeySz) { + WOLFSSL_MSG("RSA signature key size too small"); + goto exit_sske; + } break; } #endif /* !NO_RSA */ @@ -15151,6 +15196,11 @@ int DoSessionTicket(WOLFSSL* ssl, sigSz = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); length += sigSz; + if (sigSz < ssl->options.minRsaKeySz) { + WOLFSSL_MSG("RSA key size too small"); + goto exit_sske; + } + if (IsAtLeastTLSv1_2(ssl)) { length += HASH_SIG_SIZE; } @@ -16971,6 +17021,10 @@ int DoSessionTicket(WOLFSSL* ssl, goto exit_dcke; } length = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); + if (length < ssl->options.minRsaKeySz) { + WOLFSSL_MSG("Peer RSA key is too small"); + goto exit_dcke; + } ssl->arrays->preMasterSz = SECRET_LEN; if (ssl->options.tls) { diff --git a/src/ssl.c b/src/ssl.c index f916c185c..14e993c41 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -480,6 +480,32 @@ int wolfSSL_GetObjectSize(void) #endif +#ifndef NO_RSA +int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX* ctx, word16 keySz) +{ + if (ctx == NULL || keySz % 8 != 0) { + WOLFSSL_MSG("Key size must be divisable by 8 or ctx was null"); + return BAD_FUNC_ARG; + } + + ctx->minRsaKeySz = keySz / 8; + ctx->cm->minRsaKeySz = keySz / 8; + return SSL_SUCCESS; +} + + +int wolfSSL_SetMinRsaKey_Sz(WOLFSSL* ssl, word16 keySz) +{ + if (ssl == NULL || keySz % 8 != 0) { + WOLFSSL_MSG("Key size must be divisable by 8 or ssl was null"); + return BAD_FUNC_ARG; + } + + ssl->options.minRsaKeySz = keySz / 8; + return SSL_SUCCESS; +} +#endif /* !NO_RSA */ + #ifndef NO_DH /* server Diffie-Hellman parameters, SSL_SUCCESS on ok */ int wolfSSL_SetTmpDH(WOLFSSL* ssl, const unsigned char* p, int pSz, @@ -1727,6 +1753,11 @@ WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew(void) return NULL; } #endif + + /* set default minimum key size allowed */ + #ifndef NO_RSA + cm->minRsaKeySz = MIN_RSAKEY_SZ; + #endif } return cm; @@ -2555,6 +2586,22 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify) subjectHash = cert->subjectHash; #endif + /* check CA key size */ + switch (cert->keyOID) { + #ifndef NO_RSA + case RSAk: + if (cert->pubKeySize < cm->minRsaKeySz) { + ret = RSA_KEY_SIZE_E; + WOLFSSL_MSG(" CA RSA key is too small"); + } + break; + #endif /* !NO_RSA */ + + default: + WOLFSSL_MSG(" No key size check done on CA"); + break; /* no size check if key type is not in switch */ + } + if (ret == 0 && cert->isCA == 0 && type != WOLFSSL_USER_CA) { WOLFSSL_MSG(" Can't add as CA if not actually one"); ret = NOT_CA_ERROR; @@ -3428,6 +3475,20 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, if (!eccKey) ret = SSL_BAD_FILE; } else { + /* check that the size of the RSA key is enough */ + int RsaSz = wc_RsaEncryptSize((RsaKey*)key); + if (ssl) { + if (RsaSz < ssl->options.minRsaKeySz) { + ret = RSA_KEY_SIZE_E; + WOLFSSL_MSG("Private Key size too small"); + } + } + else if(ctx) { + if (RsaSz < ctx->minRsaKeySz) { + ret = RSA_KEY_SIZE_E; + WOLFSSL_MSG("Private Key size too small"); + } + } rsaKey = 1; (void)rsaKey; /* for no ecc builds */ } @@ -3527,10 +3588,38 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, } #endif + /* check key size of cert */ + switch (cert->keyOID) { + #ifndef NO_RSA + case RSAk: + if (ssl) { + if (cert->pubKeySize < ssl->options.minRsaKeySz) { + ret = RSA_KEY_SIZE_E; + WOLFSSL_MSG("Certificate RSA key size too small"); + } + } + else if (ctx) { + if (cert->pubKeySize < ctx->minRsaKeySz) { + ret = RSA_KEY_SIZE_E; + WOLFSSL_MSG("Certificate RSA key size too small"); + } + } + break; + #endif /* !NO_RSA */ + + default: + WOLFSSL_MSG("No key size check done on certificate"); + break; /* do no check if not a case for the key */ + } + FreeDecodedCert(cert); #ifdef WOLFSSL_SMALL_STACK XFREE(cert, heap, DYNAMIC_TYPE_TMP_BUFFER); #endif + + if (ret != 0) { + return ret; + } } return SSL_SUCCESS; diff --git a/wolfssl/error-ssl.h b/wolfssl/error-ssl.h index 96a89cf81..19a430a61 100644 --- a/wolfssl/error-ssl.h +++ b/wolfssl/error-ssl.h @@ -144,6 +144,7 @@ enum wolfSSL_ErrorCodes { OCSP_INVALID_STATUS = -407, /* Invalid OCSP Status */ ASYNC_NOT_PENDING = -408, /* Async operation not pending */ + RSA_KEY_SIZE_E = -409, /* RSA key too small */ /* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */ /* begin negotiation parameter errors */ diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 8c88e471e..3fdbe6c3b 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1063,7 +1063,22 @@ enum Misc { /* 150 suites for now! */ #endif +/* set minimum RSA key size allowed */ +#ifndef WOLFSSL_MIN_RSA_BITS + #ifdef WOLFSSL_MAX_STRENGTH + #define WOLFSSL_MIN_RSA_BITS 2048 + #else + #define WOLFSSL_MIN_RSA_BITS 1024 + #endif +#endif /* WOLFSSL_MIN_RSA_BITS */ +#if (WOLFSSL_MIN_RSA_BITS % 8) + /* This is to account for the example case of a min size of 2050 bits but + still allows 2049 bit key. So we need the measurment to be in bytes. */ + #error RSA minimum bit size must be a multiple of 8 +#endif +#define MIN_RSAKEY_SZ (WOLFSSL_MIN_RSA_BITS / 8) +/* set minimum DH key size allowed */ #ifndef WOLFSSL_MIN_DHKEY_BITS #ifdef WOLFSSL_MAX_STRENGTH #define WOLFSSL_MIN_DHKEY_BITS 2048 @@ -1481,6 +1496,10 @@ struct WOLFSSL_CERT_MANAGER { byte ocspSendNonce; /* send the OCSP nonce ? */ byte ocspUseOverrideURL; /* ignore cert's responder, override */ byte ocspStaplingEnabled; /* is OCSP Stapling on ? */ + +#ifndef NO_RSA + word16 minRsaKeySz; /* minimum allowed RSA key size */ +#endif }; WOLFSSL_LOCAL int CM_SaveCertCache(WOLFSSL_CERT_MANAGER*, const char*); @@ -1876,6 +1895,9 @@ struct WOLFSSL_CTX { byte minDowngrade; /* minimum downgrade version */ #ifndef NO_DH word16 minDhKeySz; /* minimum DH key size */ +#endif +#ifndef NO_RSA + word16 minRsaKeySz; /* minimum RSA key size */ #endif CallbackIORecv CBIORecv; CallbackIOSend CBIOSend; @@ -2341,6 +2363,9 @@ typedef struct Options { word16 minDhKeySz; /* minimum DH key size */ word16 dhKeySz; /* actual DH key size */ #endif +#ifndef NO_RSA + word16 minRsaKeySz; /* minimum RSA key size */ +#endif } Options; diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index f7b1373a7..72434bd63 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -938,6 +938,11 @@ WOLFSSL_API int wolfSSL_SetMinDhKey_Sz(WOLFSSL*, unsigned short); WOLFSSL_API int wolfSSL_GetDhKey_Sz(WOLFSSL*); #endif /* NO_DH */ +#ifndef NO_RSA +WOLFSSL_API int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX*, unsigned short); +WOLFSSL_API int wolfSSL_SetMinRsaKey_Sz(WOLFSSL*, unsigned short); +#endif /* NO_RSA */ + WOLFSSL_API int wolfSSL_SetTmpEC_DHE_Sz(WOLFSSL*, unsigned short); WOLFSSL_API int wolfSSL_CTX_SetTmpEC_DHE_Sz(WOLFSSL_CTX*, unsigned short); diff --git a/wolfssl/test.h b/wolfssl/test.h index 293ef0309..7d8ecbf16 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -231,6 +231,11 @@ #else #define DEFAULT_MIN_DHKEY_BITS 1024 #endif +#if !defined(NO_FILESYSTEM) && defined(WOLFSSL_MAX_STRENGTH) + #define DEFAULT_MIN_RSAKEY_BITS 2048 +#else + #define DEFAULT_MIN_RSAKEY_BITS 1024 +#endif /* all certs relative to wolfSSL home directory now */ #if defined(WOLFSSL_NO_CURRDIR) || defined(WOLFSSL_MDK_SHELL) From 1e766b23cfc7312bc597552158a9fbe6495587dd Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 14 Apr 2016 14:42:01 -0600 Subject: [PATCH 121/192] check return value of ping.test --- scripts/external.test | 2 ++ scripts/google.test | 2 ++ scripts/ocsp.test | 2 ++ scripts/ping.test | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/external.test b/scripts/external.test index 3eb84bbc7..9681677d9 100755 --- a/scripts/external.test +++ b/scripts/external.test @@ -17,6 +17,8 @@ fi # is our desired server there? ./scripts/ping.test $server 2 +RESULT=$? +[ $RESULT -ne 0 ] && exit 0 # client test against the server ./examples/client/client -X -C -h $server -p 443 -g -A $ca diff --git a/scripts/google.test b/scripts/google.test index d84b4da2d..ecc126836 100755 --- a/scripts/google.test +++ b/scripts/google.test @@ -8,6 +8,8 @@ server=www.google.com # is our desired server there? ./scripts/ping.test $server 2 +RESULT=$? +[ $RESULT -ne 0 ] && exit 0 # client test against the server ./examples/client/client -X -C -h $server -p 443 -g -d diff --git a/scripts/ocsp.test b/scripts/ocsp.test index 807c80533..97a8af1bc 100755 --- a/scripts/ocsp.test +++ b/scripts/ocsp.test @@ -9,6 +9,8 @@ ca=certs/external/ca-globalsign-root-r2.pem # is our desired server there? ./scripts/ping.test $server 2 +RESULT=$? +[ $RESULT -ne 0 ] && exit 0 # client test against the server ./examples/client/client -X -C -h $server -p 443 -A $ca -g -o diff --git a/scripts/ping.test b/scripts/ping.test index a6e21277f..f1049d48e 100755 --- a/scripts/ping.test +++ b/scripts/ping.test @@ -24,6 +24,6 @@ esac # is our desired server there? ping $PINGSW $tries $server RESULT=$? -[ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 0 +[ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 1 exit 0 From e15aca41890608f32cf3e4814a27e524aed29afb Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 15 Apr 2016 16:04:15 -0600 Subject: [PATCH 122/192] static and shared library with MinGW --- configure.ac | 43 +++++++++++++++++++++++++--------- wolfssl/wolfcrypt/visibility.h | 10 ++++---- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index a9553419e..2f3c57ee6 100644 --- a/configure.ac +++ b/configure.ac @@ -2624,19 +2624,17 @@ AX_HARDEN_CC_COMPILER_FLAGS # if mingw then link to ws2_32 for sockets case $host_os in mingw*) - LDFLAGS="$LDFLAGS -lws2_32" ;; + LDFLAGS="$LDFLAGS -lws2_32" + if test "$enable_shared" = "yes" + then + AC_DEFINE([WOLFSSL_DLL], [1], [Use __declspec(dllexport) when building library]) + if test "$enable_static" = "yes" + then + MINGW_LIB_WARNING="yes" + fi + fi ;; esac -# add wolfSSL defines for shared/static -if test "$enable_shared" = "yes" -then - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHARED" -fi -if test "$enable_static" = "yes" -then - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_STATIC" -fi - # add user C_EXTRA_FLAGS back CFLAGS="$CFLAGS $USER_C_EXTRA_FLAGS" OPTION_FLAGS="$USER_CFLAGS $USER_C_EXTRA_FLAGS $AM_CFLAGS" @@ -2879,8 +2877,31 @@ echo " * Async Crypto: $ENABLED_ASYNCCRYPT" echo "" echo "---" +################################################################################ # Show warnings at bottom so they are noticed +################################################################################ + if test "$ENABLED_ASYNCCRYPT" = "yes" then AC_MSG_WARN([Make sure real async files are loaded. Contact wolfSSL for details on using the asynccrypt option.]) fi + +# MinGW static vs shared library +# The URL I was looking at for this was +# http://www.gnu.org/software/libtool/manual/libtool.html#Cygwin-to-MinGW-Cross +# this allows for not even having dllimport/dllexport on functions +# with recent libtools, only requiring it with global variables. +# The warning is displayed here because if not using "contemporary GNU +# tools" there is the possibility of export/import issues. +# We use __declspec(dllexport) and "contemporary GNU tools" are taking care +# of the case where both static and shared libraries are built. It is also +# placing both __imp__function and function in the lib.dll.a created. Allowing +# users to choose if they use __declspec(dllimport) with defining WOLFSSL_DLL. +# +# More can be found about the MinGW linker at +# https://sourceware.org/binutils/docs/ld/WIN32.html +if test "$MINGW_LIB_WARNING" = "yes" +then + AC_MSG_WARN([Building with shared and static library at the same time on this system may cause export/import problems when using non contemporary GNU tools.]) +fi + diff --git a/wolfssl/wolfcrypt/visibility.h b/wolfssl/wolfcrypt/visibility.h index 90e4c89d5..d77cfde5c 100644 --- a/wolfssl/wolfcrypt/visibility.h +++ b/wolfssl/wolfcrypt/visibility.h @@ -46,9 +46,8 @@ #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) #define WOLFSSL_API __global #define WOLFSSL_LOCAL __hidden - #elif defined(_MSC_VER) - #if defined(WOLFSSL_DLL) || \ - (defined(__MINGW32__) && defined(WOLFSSL_SHARED)) + #elif defined(_MSC_VER) || defined(__MINGW32__) + #if defined(WOLFSSL_DLL) #define WOLFSSL_API __declspec(dllexport) #else #define WOLFSSL_API @@ -59,9 +58,8 @@ #define WOLFSSL_LOCAL #endif /* HAVE_VISIBILITY */ #else /* BUILDING_WOLFSSL */ - #if defined(_MSC_VER) - #if defined(WOLFSSL_DLL) || \ - (defined(__MINGW32__) && defined(WOLFSSL_SHARED)) + #if defined(_MSC_VER) || defined(__MINGW32__) + #if defined(WOLFSSL_DLL) #define WOLFSSL_API __declspec(dllimport) #else #define WOLFSSL_API From 09e4e139589353f1d0854e3e77d957bb2d70a0b9 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 18 Apr 2016 12:14:47 -0600 Subject: [PATCH 123/192] update comment about MinGW --- configure.ac | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 2f3c57ee6..4a9b3d194 100644 --- a/configure.ac +++ b/configure.ac @@ -2887,16 +2887,15 @@ then fi # MinGW static vs shared library -# The URL I was looking at for this was +# Reference URL from libtool for MinGW is located at # http://www.gnu.org/software/libtool/manual/libtool.html#Cygwin-to-MinGW-Cross # this allows for not even having dllimport/dllexport on functions # with recent libtools, only requiring it with global variables. -# The warning is displayed here because if not using "contemporary GNU +# +# The following warning is displayed here because if not using "contemporary GNU # tools" there is the possibility of export/import issues. -# We use __declspec(dllexport) and "contemporary GNU tools" are taking care -# of the case where both static and shared libraries are built. It is also -# placing both __imp__function and function in the lib.dll.a created. Allowing -# users to choose if they use __declspec(dllimport) with defining WOLFSSL_DLL. +# wolfSSL uses __declspec(dllexport) and "contemporary GNU tools" handle the +# case where both static and shared libraries are built. # # More can be found about the MinGW linker at # https://sourceware.org/binutils/docs/ld/WIN32.html From 0eb57ccab0d990b6e55faff9e5fe453d85446343 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 18 Apr 2016 14:27:34 -0600 Subject: [PATCH 124/192] set return error before jumping to end of function --- src/internal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/internal.c b/src/internal.c index f6aa4382c..74a06f506 100755 --- a/src/internal.c +++ b/src/internal.c @@ -14911,6 +14911,7 @@ int DoSessionTicket(WOLFSSL* ssl, if (sigSz < ssl->options.minRsaKeySz) { WOLFSSL_MSG("RSA signature key size too small"); + ret = RSA_KEY_SIZE_E; goto exit_sske; } break; @@ -15198,6 +15199,7 @@ int DoSessionTicket(WOLFSSL* ssl, if (sigSz < ssl->options.minRsaKeySz) { WOLFSSL_MSG("RSA key size too small"); + ret = RSA_KEY_SIZE_E; goto exit_sske; } @@ -17023,6 +17025,7 @@ int DoSessionTicket(WOLFSSL* ssl, length = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); if (length < ssl->options.minRsaKeySz) { WOLFSSL_MSG("Peer RSA key is too small"); + ret = RSA_KEY_SIZE_E; goto exit_dcke; } ssl->arrays->preMasterSz = SECRET_LEN; From 789f346c5f2a6d6a266ec44044beea5c8e41a4b3 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 19 Apr 2016 10:23:01 -0600 Subject: [PATCH 125/192] follow verifyNone variable when checking key size --- src/internal.c | 27 +++++++++++++++------------ src/ssl.c | 32 +++++++++++++++++--------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/internal.c b/src/internal.c index 74a06f506..06fa29237 100755 --- a/src/internal.c +++ b/src/internal.c @@ -5138,19 +5138,21 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, /* Check key sizes for certs. Is redundent check since ProcessBuffer also performs this check. */ - switch (dCert->keyOID) { - #ifndef NO_RSA - case RSAk: - if (dCert->pubKeySize < ssl->options.minRsaKeySz) { - WOLFSSL_MSG("RSA key in cert chain was too small"); - ret = RSA_KEY_SIZE_E; - } - break; - #endif /* !NO_RSA */ + if (!ssl->options.verifyNone) { + switch (dCert->keyOID) { + #ifndef NO_RSA + case RSAk: + if (dCert->pubKeySize < ssl->options.minRsaKeySz) { + WOLFSSL_MSG("RSA key in cert chain was too small"); + ret = RSA_KEY_SIZE_E; + } + break; + #endif /* !NO_RSA */ - default: - WOLFSSL_MSG("Key size not checked"); - break; /* key is not being checked for size if not in switch */ + default: + WOLFSSL_MSG("Key size not checked"); + break; /* key not being checked for size if not in switch */ + } } if (ret == 0 && dCert->isCA == 0) { @@ -5467,6 +5469,7 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, /* check size of peer RSA key */ if (ret == 0 && ssl->peerRsaKeyPresent && + !ssl->options.verifyNone && wc_RsaEncryptSize(ssl->peerRsaKey) < ssl->options.minRsaKeySz) { ret = RSA_KEY_SIZE_E; diff --git a/src/ssl.c b/src/ssl.c index 14e993c41..510326aa3 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2587,19 +2587,21 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify) #endif /* check CA key size */ - switch (cert->keyOID) { - #ifndef NO_RSA - case RSAk: - if (cert->pubKeySize < cm->minRsaKeySz) { - ret = RSA_KEY_SIZE_E; - WOLFSSL_MSG(" CA RSA key is too small"); - } - break; - #endif /* !NO_RSA */ + if (verify) { + switch (cert->keyOID) { + #ifndef NO_RSA + case RSAk: + if (cert->pubKeySize < cm->minRsaKeySz) { + ret = RSA_KEY_SIZE_E; + WOLFSSL_MSG(" CA RSA key is too small"); + } + break; + #endif /* !NO_RSA */ - default: - WOLFSSL_MSG(" No key size check done on CA"); - break; /* no size check if key type is not in switch */ + default: + WOLFSSL_MSG(" No key size check done on CA"); + break; /* no size check if key type is not in switch */ + } } if (ret == 0 && cert->isCA == 0 && type != WOLFSSL_USER_CA) { @@ -3588,17 +3590,17 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, } #endif - /* check key size of cert */ + /* check key size of cert unless specified not to */ switch (cert->keyOID) { #ifndef NO_RSA case RSAk: - if (ssl) { + if (ssl && !ssl->options.verifyNone) { if (cert->pubKeySize < ssl->options.minRsaKeySz) { ret = RSA_KEY_SIZE_E; WOLFSSL_MSG("Certificate RSA key size too small"); } } - else if (ctx) { + else if (ctx && !ctx->verifyNone) { if (cert->pubKeySize < ctx->minRsaKeySz) { ret = RSA_KEY_SIZE_E; WOLFSSL_MSG("Certificate RSA key size too small"); From e0a9b365ccf480c8c0afac804547108ee082fa2c Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 19 Apr 2016 13:17:32 -0600 Subject: [PATCH 126/192] fix NID name in openssl compatibility --- wolfcrypt/src/ecc.c | 2 +- wolfssl/openssl/ec.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index f7b572af3..f3a47793b 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -122,7 +122,7 @@ const ecc_set_type ecc_sets[] = { #ifdef ECC112 { 14, - NID_secp111r1, + NID_secp112r1, "SECP112R1", "DB7C2ABF62E35E668076BEAD208B", "DB7C2ABF62E35E668076BEAD2088", diff --git a/wolfssl/openssl/ec.h b/wolfssl/openssl/ec.h index 2354ada3c..619f704f0 100644 --- a/wolfssl/openssl/ec.h +++ b/wolfssl/openssl/ec.h @@ -13,7 +13,7 @@ extern "C" { /* Map OpenSSL NID value */ enum { POINT_CONVERSION_UNCOMPRESSED = 4, - NID_secp111r1 = 0, + NID_secp112r1 = 0, NID_secp128r1 = 1, NID_secp160r1 = 2, NID_cert192 = 3, From 3129bb22cd67c03fb3181d319e5c8ecf1df5c76f Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 19 Apr 2016 15:50:25 -0600 Subject: [PATCH 127/192] minimum ECC key size check at TLS/SSL level --- examples/server/server.c | 7 ++++ src/internal.c | 45 +++++++++++++++++++++++++- src/ssl.c | 69 ++++++++++++++++++++++++++++++++++++++++ wolfssl/error-ssl.h | 1 + wolfssl/internal.h | 27 ++++++++++++++++ wolfssl/ssl.h | 5 +++ wolfssl/test.h | 5 +++ 7 files changed, 158 insertions(+), 1 deletion(-) diff --git a/examples/server/server.c b/examples/server/server.c index ac39075f3..30b3c8562 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -278,6 +278,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) int throughput = 0; int minDhKeyBits = DEFAULT_MIN_DHKEY_BITS; int minRsaKeyBits = DEFAULT_MIN_RSAKEY_BITS; + int minEccKeyBits = DEFAULT_MIN_ECCKEY_BITS; int doListen = 1; int crlFlags = 0; int ret; @@ -329,6 +330,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) (void)doCliCertCheck; (void)minDhKeyBits; (void)minRsaKeyBits; + (void)minEccKeyBits; (void)alpnList; (void)alpn_opt; (void)crlFlags; @@ -649,6 +651,11 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) err_sys("Error setting minimum RSA key size"); } #endif +#ifdef HAVE_ECC + if (wolfSSL_CTX_SetMinEccKey_Sz(ctx, (word16)minEccKeyBits) != SSL_SUCCESS){ + err_sys("Error setting minimum ECC key size"); + } +#endif #ifdef HAVE_NTRU if (useNtruKey) { diff --git a/src/internal.c b/src/internal.c index 06fa29237..b17aebad7 100755 --- a/src/internal.c +++ b/src/internal.c @@ -554,8 +554,8 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method) #ifndef NO_RSA ctx->minRsaKeySz = MIN_RSAKEY_SZ; #endif - #ifdef HAVE_ECC + ctx->minEccKeySz = MIN_ECCKEY_SZ; ctx->eccTempKeySz = ECDHE_SIZE; #endif @@ -2240,6 +2240,9 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx) #ifndef NO_RSA ssl->options.minRsaKeySz = ctx->minRsaKeySz; #endif +#ifdef HAVE_ECC + ssl->options.minEccKeySz = ctx->minEccKeySz; +#endif ssl->options.sessionCacheOff = ctx->sessionCacheOff; ssl->options.sessionCacheFlushOff = ctx->sessionCacheFlushOff; @@ -5148,6 +5151,14 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, } break; #endif /* !NO_RSA */ + #ifdef HAVE_ECC + case ECDSAk: + if (dCert->pubKeySize < ssl->options.minEccKeySz) { + WOLFSSL_MSG("ECC key in cert chain was too small"); + ret = ECC_KEY_SIZE_E; + } + break; + #endif /* HAVE_ECC */ default: WOLFSSL_MSG("Key size not checked"); @@ -5534,6 +5545,16 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, #endif /* HAVE_ECC */ #endif /*HAVE_PK_CALLBACKS */ } + + /* check size of peer ECC key */ + if (ret == 0 && ssl->peerEccDsaKeyPresent && + !ssl->options.verifyNone && + wc_ecc_size(ssl->peerEccDsaKey) + < ssl->options.minEccKeySz) { + ret = ECC_KEY_SIZE_E; + WOLFSSL_MSG("Peer ECC key is too small"); + } + } break; #endif /* HAVE_ECC */ @@ -10168,6 +10189,9 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e) case RSA_KEY_SIZE_E: return "RSA key too small"; + case ECC_KEY_SIZE_E: + return "ECC key too small"; + default : return "unknown error number"; } @@ -13982,6 +14006,12 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) WOLFSSL_MSG("Using ECC client cert"); usingEcc = 1; sigOutSz = MAX_ENCODED_SIG_SZ; + + /* check minimum size of ECC key */ + if (wc_ecc_size(&eccKey) < ssl->options.minEccKeySz) { + WOLFSSL_MSG("ECC key size too small"); + return ECC_KEY_SIZE_E; + } } else { WOLFSSL_MSG("Bad client cert type"); @@ -14937,6 +14967,14 @@ int DoSessionTicket(WOLFSSL* ssl, goto exit_sske; } sigSz = wc_ecc_sig_size((ecc_key*)ssl->sigKey); /* worst case estimate */ + + /* check the minimum ECC key size */ + if (wc_ecc_size((ecc_key*)ssl->sigKey) < + ssl->options.minEccKeySz) { + WOLFSSL_MSG("ECC key size too small"); + ret = ECC_KEY_SIZE_E; + goto exit_sske; + } break; } default: @@ -17219,6 +17257,11 @@ int DoSessionTicket(WOLFSSL* ssl, ssl->buffers.key->length); if (ret == 0) { private_key = (ecc_key*)ssl->sigKey; + if (wc_ecc_size(private_key) < + ssl->options.minEccKeySz) { + WOLFSSL_MSG("ECC key too small"); + ERROR_OUT(ECC_KEY_SIZE_E, exit_dcke); + } } } else if (ssl->eccTempKeyPresent == 0) { diff --git a/src/ssl.c b/src/ssl.c index 1dab84730..cb082d6d1 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -483,6 +483,31 @@ int wolfSSL_GetObjectSize(void) } #endif +#ifdef HAVE_ECC +int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX* ctx, word16 keySz) +{ + if (ctx == NULL || keySz % 8 != 0) { + WOLFSSL_MSG("Key size must be divisable by 8 or ctx was null"); + return BAD_FUNC_ARG; + } + + ctx->minEccKeySz = keySz / 8; + ctx->cm->minEccKeySz = keySz / 8; + return SSL_SUCCESS; +} + + +int wolfSSL_SetMinEccKey_Sz(WOLFSSL* ssl, word16 keySz) +{ + if (ssl == NULL || keySz % 8 != 0) { + WOLFSSL_MSG("Key size must be divisable by 8 or ssl was null"); + return BAD_FUNC_ARG; + } + + ssl->options.minEccKeySz = keySz / 8; + return SSL_SUCCESS; +} +#endif /* !NO_RSA */ #ifndef NO_RSA int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX* ctx, word16 keySz) @@ -1762,6 +1787,9 @@ WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew(void) #ifndef NO_RSA cm->minRsaKeySz = MIN_RSAKEY_SZ; #endif + #ifdef HAVE_ECC + cm->minEccKeySz = MIN_ECCKEY_SZ; + #endif } return cm; @@ -2603,6 +2631,14 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify) } break; #endif /* !NO_RSA */ + #ifdef HAVE_ECC + case ECDSAk: + if (cert->pubKeySize < cm->minEccKeySz) { + ret = ECC_KEY_SIZE_E; + WOLFSSL_MSG(" CA ECC key is too small"); + } + break; + #endif /* HAVE_ECC */ default: WOLFSSL_MSG(" No key size check done on CA"); @@ -3524,6 +3560,23 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, wc_ecc_free(&key); return SSL_BAD_FILE; } + + /* check for minimum ECC key size and then free */ + if (ssl) { + if (wc_ecc_size(&key) < ssl->options.minEccKeySz) { + wc_ecc_free(&key); + WOLFSSL_MSG("ECC private key too small"); + return ECC_KEY_SIZE_E; + } + } + else if (ctx) { + if (wc_ecc_size(&key) < ctx->minEccKeySz) { + wc_ecc_free(&key); + WOLFSSL_MSG("ECC private key too small"); + return ECC_KEY_SIZE_E; + } + } + wc_ecc_free(&key); eccKey = 1; if (ctx) @@ -3614,6 +3667,22 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, } break; #endif /* !NO_RSA */ + #ifdef HAVE_ECC + case ECDSAk: + if (ssl && !ssl->options.verifyNone) { + if (cert->pubKeySize < ssl->options.minEccKeySz) { + ret = ECC_KEY_SIZE_E; + WOLFSSL_MSG("Certificate ECC key size too small"); + } + } + else if (ctx && !ctx->verifyNone) { + if (cert->pubKeySize < ctx->minEccKeySz) { + ret = ECC_KEY_SIZE_E; + WOLFSSL_MSG("Certificate ECC key size too small"); + } + } + break; + #endif /* HAVE_ECC */ default: WOLFSSL_MSG("No key size check done on certificate"); diff --git a/wolfssl/error-ssl.h b/wolfssl/error-ssl.h index 19a430a61..11aedea53 100644 --- a/wolfssl/error-ssl.h +++ b/wolfssl/error-ssl.h @@ -145,6 +145,7 @@ enum wolfSSL_ErrorCodes { ASYNC_NOT_PENDING = -408, /* Async operation not pending */ RSA_KEY_SIZE_E = -409, /* RSA key too small */ + ECC_KEY_SIZE_E = -410, /* ECC key too small */ /* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */ /* begin negotiation parameter errors */ diff --git a/wolfssl/internal.h b/wolfssl/internal.h index eea8b2908..27b7e5e51 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1063,6 +1063,24 @@ enum Misc { /* 150 suites for now! */ #endif +/* set minimum ECC key size allowed */ +#ifndef WOLFSSL_MIN_ECC_BITS + #ifdef WOLFSSL_MAX_STRENGTH + #define WOLFSSL_MIN_ECC_BITS 256 + #else + #define WOLFSSL_MIN_ECC_BITS 160 + #endif +#endif /* WOLFSSL_MIN_ECC_BITS */ +#if (WOLFSSL_MIN_ECC_BITS % 8) + /* Some ECC keys are not divisable by 8 such as prime239v1 or sect131r1. + In these cases round down to the nearest value divisable by 8. The + restriction of being divisable by 8 is in place to match wc_ecc_size + function from wolfSSL. + */ + #error ECC minimum bit size must be a multiple of 8 +#endif +#define MIN_ECCKEY_SZ (WOLFSSL_MIN_ECC_BITS / 8) + /* set minimum RSA key size allowed */ #ifndef WOLFSSL_MIN_RSA_BITS #ifdef WOLFSSL_MAX_STRENGTH @@ -1500,6 +1518,9 @@ struct WOLFSSL_CERT_MANAGER { #ifndef NO_RSA word16 minRsaKeySz; /* minimum allowed RSA key size */ #endif +#ifdef HAVE_ECC + word16 minEccKeySz; /* minimum allowed ECC key size */ +#endif }; WOLFSSL_LOCAL int CM_SaveCertCache(WOLFSSL_CERT_MANAGER*, const char*); @@ -1898,6 +1919,9 @@ struct WOLFSSL_CTX { #endif #ifndef NO_RSA word16 minRsaKeySz; /* minimum RSA key size */ +#endif +#ifdef HAVE_ECC + word16 minEccKeySz; /* minimum ECC key size */ #endif CallbackIORecv CBIORecv; CallbackIOSend CBIOSend; @@ -2366,6 +2390,9 @@ typedef struct Options { #ifndef NO_RSA word16 minRsaKeySz; /* minimum RSA key size */ #endif +#ifdef HAVE_ECC + word16 minEccKeySz; /* minimum ECC key size */ +#endif } Options; diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 72434bd63..1a8b896d3 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -943,6 +943,11 @@ WOLFSSL_API int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX*, unsigned short); WOLFSSL_API int wolfSSL_SetMinRsaKey_Sz(WOLFSSL*, unsigned short); #endif /* NO_RSA */ +#ifdef HAVE_ECC +WOLFSSL_API int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX*, unsigned short); +WOLFSSL_API int wolfSSL_SetMinEccKey_Sz(WOLFSSL*, unsigned short); +#endif /* NO_RSA */ + WOLFSSL_API int wolfSSL_SetTmpEC_DHE_Sz(WOLFSSL*, unsigned short); WOLFSSL_API int wolfSSL_CTX_SetTmpEC_DHE_Sz(WOLFSSL_CTX*, unsigned short); diff --git a/wolfssl/test.h b/wolfssl/test.h index bace1f322..8fb6a4399 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -236,6 +236,11 @@ #else #define DEFAULT_MIN_RSAKEY_BITS 1024 #endif +#if !defined(NO_FILESYSTEM) && defined(WOLFSSL_MAX_STRENGTH) + #define DEFAULT_MIN_ECCKEY_BITS 256 +#else + #define DEFAULT_MIN_ECCKEY_BITS 112 /* secp112r1 smallest in wolfSSL */ +#endif /* all certs relative to wolfSSL home directory now */ #if defined(WOLFSSL_NO_CURRDIR) || defined(WOLFSSL_MDK_SHELL) From 659d6c068953446b209513bb81138db1ee445a2f Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 19 Apr 2016 17:01:39 -0600 Subject: [PATCH 128/192] update oid value for secp160r1 --- wolfcrypt/src/asn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 517d374ca..d242a946c 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -727,7 +727,7 @@ static const byte hashSha512hOid[] = {96, 134, 72, 1, 101, 3, 4, 2, 3}; static const byte curve256v1Oid[] = {42, 134, 72, 206, 61, 3, 1, 7}; #endif /* HAVE_ALL_CURVES || HAVE_ECC256 */ #if defined(HAVE_ALL_CURVES) || defined(HAVE_ECC160) - static const byte curve160r1Oid[] = {43, 129, 4, 0, 2}; + static const byte curve160r1Oid[] = {43, 129, 4, 0, 8}; #endif /* HAVE_ALL_CURVES || HAVE_ECC160 */ #if defined(HAVE_ALL_CURVES) || defined(HAVE_ECC224) static const byte curve224r1Oid[] = {43, 129, 4, 0, 33}; From 1dac3841cac7916060e6dce580181849082d1b15 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 20 Apr 2016 15:44:45 -0600 Subject: [PATCH 129/192] change type to short for comparision and up default min size --- examples/server/server.c | 4 ++-- src/internal.c | 5 +++-- src/ssl.c | 23 +++++++++++++---------- wolfssl/internal.h | 8 ++++---- wolfssl/ssl.h | 4 ++-- wolfssl/test.h | 2 +- 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/examples/server/server.c b/examples/server/server.c index 30b3c8562..d15217166 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -278,7 +278,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) int throughput = 0; int minDhKeyBits = DEFAULT_MIN_DHKEY_BITS; int minRsaKeyBits = DEFAULT_MIN_RSAKEY_BITS; - int minEccKeyBits = DEFAULT_MIN_ECCKEY_BITS; + short minEccKeyBits = DEFAULT_MIN_ECCKEY_BITS; int doListen = 1; int crlFlags = 0; int ret; @@ -652,7 +652,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) } #endif #ifdef HAVE_ECC - if (wolfSSL_CTX_SetMinEccKey_Sz(ctx, (word16)minEccKeyBits) != SSL_SUCCESS){ + if (wolfSSL_CTX_SetMinEccKey_Sz(ctx, minEccKeyBits) != SSL_SUCCESS){ err_sys("Error setting minimum ECC key size"); } #endif diff --git a/src/internal.c b/src/internal.c index b17aebad7..1e81e3b6e 100755 --- a/src/internal.c +++ b/src/internal.c @@ -5153,8 +5153,9 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, #endif /* !NO_RSA */ #ifdef HAVE_ECC case ECDSAk: - if (dCert->pubKeySize < ssl->options.minEccKeySz) { - WOLFSSL_MSG("ECC key in cert chain was too small"); + if (ssl->options.minEccKeySz < 0 || + dCert->pubKeySize < (word16)ssl->options.minEccKeySz) { + WOLFSSL_MSG("ECC key size in cert chain error"); ret = ECC_KEY_SIZE_E; } break; diff --git a/src/ssl.c b/src/ssl.c index cb082d6d1..1eaca0782 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -484,9 +484,9 @@ int wolfSSL_GetObjectSize(void) #endif #ifdef HAVE_ECC -int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX* ctx, word16 keySz) +int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX* ctx, short keySz) { - if (ctx == NULL || keySz % 8 != 0) { + if (ctx == NULL || keySz < 0 || keySz % 8 != 0) { WOLFSSL_MSG("Key size must be divisable by 8 or ctx was null"); return BAD_FUNC_ARG; } @@ -497,9 +497,9 @@ int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX* ctx, word16 keySz) } -int wolfSSL_SetMinEccKey_Sz(WOLFSSL* ssl, word16 keySz) +int wolfSSL_SetMinEccKey_Sz(WOLFSSL* ssl, short keySz) { - if (ssl == NULL || keySz % 8 != 0) { + if (ssl == NULL || keySz < 0 || keySz % 8 != 0) { WOLFSSL_MSG("Key size must be divisable by 8 or ssl was null"); return BAD_FUNC_ARG; } @@ -2633,9 +2633,10 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify) #endif /* !NO_RSA */ #ifdef HAVE_ECC case ECDSAk: - if (cert->pubKeySize < cm->minEccKeySz) { + if (cm->minEccKeySz < 0 || + cert->pubKeySize < (word16)cm->minEccKeySz) { ret = ECC_KEY_SIZE_E; - WOLFSSL_MSG(" CA ECC key is too small"); + WOLFSSL_MSG(" CA ECC key size error"); } break; #endif /* HAVE_ECC */ @@ -3670,15 +3671,17 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, #ifdef HAVE_ECC case ECDSAk: if (ssl && !ssl->options.verifyNone) { - if (cert->pubKeySize < ssl->options.minEccKeySz) { + if (ssl->options.minEccKeySz < 0 || + cert->pubKeySize < (word16)ssl->options.minEccKeySz) { ret = ECC_KEY_SIZE_E; - WOLFSSL_MSG("Certificate ECC key size too small"); + WOLFSSL_MSG("Certificate ECC key size error"); } } else if (ctx && !ctx->verifyNone) { - if (cert->pubKeySize < ctx->minEccKeySz) { + if (ctx->minEccKeySz < 0 || + cert->pubKeySize < (word16)ctx->minEccKeySz) { ret = ECC_KEY_SIZE_E; - WOLFSSL_MSG("Certificate ECC key size too small"); + WOLFSSL_MSG("Certificate ECC key size error"); } } break; diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 27b7e5e51..e20d28433 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1068,7 +1068,7 @@ enum Misc { #ifdef WOLFSSL_MAX_STRENGTH #define WOLFSSL_MIN_ECC_BITS 256 #else - #define WOLFSSL_MIN_ECC_BITS 160 + #define WOLFSSL_MIN_ECC_BITS 224 #endif #endif /* WOLFSSL_MIN_ECC_BITS */ #if (WOLFSSL_MIN_ECC_BITS % 8) @@ -1519,7 +1519,7 @@ struct WOLFSSL_CERT_MANAGER { word16 minRsaKeySz; /* minimum allowed RSA key size */ #endif #ifdef HAVE_ECC - word16 minEccKeySz; /* minimum allowed ECC key size */ + short minEccKeySz; /* minimum allowed ECC key size */ #endif }; @@ -1921,7 +1921,7 @@ struct WOLFSSL_CTX { word16 minRsaKeySz; /* minimum RSA key size */ #endif #ifdef HAVE_ECC - word16 minEccKeySz; /* minimum ECC key size */ + short minEccKeySz; /* minimum ECC key size */ #endif CallbackIORecv CBIORecv; CallbackIOSend CBIOSend; @@ -2391,7 +2391,7 @@ typedef struct Options { word16 minRsaKeySz; /* minimum RSA key size */ #endif #ifdef HAVE_ECC - word16 minEccKeySz; /* minimum ECC key size */ + short minEccKeySz; /* minimum ECC key size */ #endif } Options; diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 1a8b896d3..755cde40e 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -944,8 +944,8 @@ WOLFSSL_API int wolfSSL_SetMinRsaKey_Sz(WOLFSSL*, unsigned short); #endif /* NO_RSA */ #ifdef HAVE_ECC -WOLFSSL_API int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX*, unsigned short); -WOLFSSL_API int wolfSSL_SetMinEccKey_Sz(WOLFSSL*, unsigned short); +WOLFSSL_API int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX*, short); +WOLFSSL_API int wolfSSL_SetMinEccKey_Sz(WOLFSSL*, short); #endif /* NO_RSA */ WOLFSSL_API int wolfSSL_SetTmpEC_DHE_Sz(WOLFSSL*, unsigned short); diff --git a/wolfssl/test.h b/wolfssl/test.h index 8fb6a4399..140ac64ea 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -239,7 +239,7 @@ #if !defined(NO_FILESYSTEM) && defined(WOLFSSL_MAX_STRENGTH) #define DEFAULT_MIN_ECCKEY_BITS 256 #else - #define DEFAULT_MIN_ECCKEY_BITS 112 /* secp112r1 smallest in wolfSSL */ + #define DEFAULT_MIN_ECCKEY_BITS 224 #endif /* all certs relative to wolfSSL home directory now */ From 27814ca1dfa1c4af3d91bd982944675cbdb5194e Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Thu, 21 Apr 2016 14:32:28 -0600 Subject: [PATCH 130/192] omit NULL AlgorithmIdentifier parameter for ECDSA algoOID types in SetAlgoID --- wolfcrypt/src/asn.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index d242a946c..915776b1c 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -3372,6 +3372,17 @@ static int SetCurve(ecc_key* key, byte* output) #endif /* HAVE_ECC && WOLFSSL_CERT_GEN */ +static INLINE int IsSigAlgoECDSA(int algoOID) +{ + /* ECDSA sigAlgo must not have ASN1 NULL parameters */ + if (algoOID == CTC_SHAwECDSA || algoOID == CTC_SHA256wECDSA || + algoOID == CTC_SHA384wECDSA || algoOID == CTC_SHA512wECDSA) { + return 1; + } + + return 0; +} + WOLFSSL_LOCAL word32 SetAlgoID(int algoOID, byte* output, int type, int curveSz) { word32 tagSz, idSz, seqSz, algoSz = 0; @@ -3379,7 +3390,8 @@ WOLFSSL_LOCAL word32 SetAlgoID(int algoOID, byte* output, int type, int curveSz) byte ID_Length[MAX_LENGTH_SZ]; byte seqArray[MAX_SEQ_SZ + 1]; /* add object_id to end */ - tagSz = (type == oidHashType || type == oidSigType || + tagSz = (type == oidHashType || + (type == oidSigType && !IsSigAlgoECDSA(algoOID)) || (type == oidKeyType && algoOID == RSAk)) ? 2 : 0; algoName = OidFromId(algoOID, type, &algoSz); From 77a934397374e4a71b613bde8d21902045c2af5c Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 22 Apr 2016 12:56:51 -0600 Subject: [PATCH 131/192] use short for RSA min key size and check casts --- examples/server/server.c | 4 +-- src/internal.c | 53 ++++++++++++++++++++++++++++------------ src/ssl.c | 19 ++++++++------ wolfssl/internal.h | 6 ++--- wolfssl/ssl.h | 4 +-- 5 files changed, 55 insertions(+), 31 deletions(-) diff --git a/examples/server/server.c b/examples/server/server.c index d15217166..be5de5c68 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -277,7 +277,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) int echoData = 0; int throughput = 0; int minDhKeyBits = DEFAULT_MIN_DHKEY_BITS; - int minRsaKeyBits = DEFAULT_MIN_RSAKEY_BITS; + short minRsaKeyBits = DEFAULT_MIN_RSAKEY_BITS; short minEccKeyBits = DEFAULT_MIN_ECCKEY_BITS; int doListen = 1; int crlFlags = 0; @@ -647,7 +647,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) } #endif #ifndef NO_RSA - if (wolfSSL_CTX_SetMinRsaKey_Sz(ctx, (word16)minRsaKeyBits) != SSL_SUCCESS){ + if (wolfSSL_CTX_SetMinRsaKey_Sz(ctx, minRsaKeyBits) != SSL_SUCCESS){ err_sys("Error setting minimum RSA key size"); } #endif diff --git a/src/internal.c b/src/internal.c index 1e81e3b6e..b0d0b7f66 100755 --- a/src/internal.c +++ b/src/internal.c @@ -5145,8 +5145,9 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, switch (dCert->keyOID) { #ifndef NO_RSA case RSAk: - if (dCert->pubKeySize < ssl->options.minRsaKeySz) { - WOLFSSL_MSG("RSA key in cert chain was too small"); + if (ssl->options.minRsaKeySz < 0 || + dCert->pubKeySize < (word16)ssl->options.minRsaKeySz) { + WOLFSSL_MSG("RSA key size in cert chain error"); ret = RSA_KEY_SIZE_E; } break; @@ -13983,8 +13984,13 @@ static word32 QSH_KeyExchangeWrite(WOLFSSL* ssl, byte isServer) ret = wc_RsaPrivateKeyDecode(ssl->buffers.key->buffer, &idx, &key, ssl->buffers.key->length); if (ret == 0) { - sigOutSz = wc_RsaEncryptSize(&key); - if (sigOutSz < ssl->options.minRsaKeySz) { + int keySz = wc_RsaEncryptSize(&key); + if (keySz < 0) { /* check if keySz has error case */ + return keySz; + } + + sigOutSz = (word32)keySz; + if (keySz < ssl->options.minRsaKeySz) { WOLFSSL_MSG("RSA key size too small"); return RSA_KEY_SIZE_E; } @@ -14925,6 +14931,8 @@ int DoSessionTicket(WOLFSSL* ssl, case rsa_sa_algo: { word32 i = 0; + int keySz; + ssl->sigKey = XMALLOC(sizeof(RsaKey), NULL, DYNAMIC_TYPE_RSA); if (ssl->sigKey == NULL) { ERROR_OUT(MEMORY_E, exit_sske); @@ -14941,12 +14949,15 @@ int DoSessionTicket(WOLFSSL* ssl, if (ret != 0) { goto exit_sske; } - sigSz = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); + keySz = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); + if (keySz < 0) { /* test if keySz has error */ + ERROR_OUT(keySz, exit_sske); + } - if (sigSz < ssl->options.minRsaKeySz) { + sigSz = (word32)keySz; + if (keySz < ssl->options.minRsaKeySz) { WOLFSSL_MSG("RSA signature key size too small"); - ret = RSA_KEY_SIZE_E; - goto exit_sske; + ERROR_OUT(RSA_KEY_SIZE_E, exit_sske); } break; } @@ -15212,6 +15223,7 @@ int DoSessionTicket(WOLFSSL* ssl, if (!ssl->options.usingAnon_cipher) { word32 i = 0; + int keySz; ssl->sigKey = XMALLOC(sizeof(RsaKey), NULL, DYNAMIC_TYPE_RSA); if (ssl->sigKey == NULL) { @@ -15236,13 +15248,16 @@ int DoSessionTicket(WOLFSSL* ssl, if (ret != 0) { goto exit_sske; } - sigSz = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); + keySz = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); + if (keySz < 0) { /* test if keySz has error */ + ERROR_OUT(keySz, exit_sske); + } + sigSz = (word32)keySz; length += sigSz; - if (sigSz < ssl->options.minRsaKeySz) { + if (keySz < ssl->options.minRsaKeySz) { WOLFSSL_MSG("RSA key size too small"); - ret = RSA_KEY_SIZE_E; - goto exit_sske; + ERROR_OUT(RSA_KEY_SIZE_E, exit_sske); } if (IsAtLeastTLSv1_2(ssl)) { @@ -17048,6 +17063,8 @@ int DoSessionTicket(WOLFSSL* ssl, case rsa_kea: { word32 i = 0; + int keySz; + ssl->sigKey = XMALLOC(sizeof(RsaKey), NULL, DYNAMIC_TYPE_RSA); if (ssl->sigKey == NULL) { ERROR_OUT(MEMORY_E, exit_dcke); @@ -17064,11 +17081,15 @@ int DoSessionTicket(WOLFSSL* ssl, if (ret != 0) { goto exit_dcke; } - length = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); - if (length < ssl->options.minRsaKeySz) { + keySz = wc_RsaEncryptSize((RsaKey*)ssl->sigKey); + if (keySz < 0) { /* test if keySz has error */ + ERROR_OUT(keySz, exit_dcke); + } + length = (word32)keySz; + + if (keySz < ssl->options.minRsaKeySz) { WOLFSSL_MSG("Peer RSA key is too small"); - ret = RSA_KEY_SIZE_E; - goto exit_dcke; + ERROR_OUT(RSA_KEY_SIZE_E, exit_dcke); } ssl->arrays->preMasterSz = SECRET_LEN; diff --git a/src/ssl.c b/src/ssl.c index 1eaca0782..bf4925bb8 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -510,9 +510,9 @@ int wolfSSL_SetMinEccKey_Sz(WOLFSSL* ssl, short keySz) #endif /* !NO_RSA */ #ifndef NO_RSA -int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX* ctx, word16 keySz) +int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX* ctx, short keySz) { - if (ctx == NULL || keySz % 8 != 0) { + if (ctx == NULL || keySz < 0 || keySz % 8 != 0) { WOLFSSL_MSG("Key size must be divisable by 8 or ctx was null"); return BAD_FUNC_ARG; } @@ -523,9 +523,9 @@ int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX* ctx, word16 keySz) } -int wolfSSL_SetMinRsaKey_Sz(WOLFSSL* ssl, word16 keySz) +int wolfSSL_SetMinRsaKey_Sz(WOLFSSL* ssl, short keySz) { - if (ssl == NULL || keySz % 8 != 0) { + if (ssl == NULL || keySz < 0 || keySz % 8 != 0) { WOLFSSL_MSG("Key size must be divisable by 8 or ssl was null"); return BAD_FUNC_ARG; } @@ -2625,9 +2625,10 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify) switch (cert->keyOID) { #ifndef NO_RSA case RSAk: - if (cert->pubKeySize < cm->minRsaKeySz) { + if (cm->minRsaKeySz < 0 || + cert->pubKeySize < (word16)cm->minRsaKeySz) { ret = RSA_KEY_SIZE_E; - WOLFSSL_MSG(" CA RSA key is too small"); + WOLFSSL_MSG(" CA RSA key size error"); } break; #endif /* !NO_RSA */ @@ -3655,13 +3656,15 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, #ifndef NO_RSA case RSAk: if (ssl && !ssl->options.verifyNone) { - if (cert->pubKeySize < ssl->options.minRsaKeySz) { + if (ssl->options.minRsaKeySz < 0 || + cert->pubKeySize < (word16)ssl->options.minRsaKeySz) { ret = RSA_KEY_SIZE_E; WOLFSSL_MSG("Certificate RSA key size too small"); } } else if (ctx && !ctx->verifyNone) { - if (cert->pubKeySize < ctx->minRsaKeySz) { + if (ctx->minRsaKeySz < 0 || + cert->pubKeySize < (word16)ctx->minRsaKeySz) { ret = RSA_KEY_SIZE_E; WOLFSSL_MSG("Certificate RSA key size too small"); } diff --git a/wolfssl/internal.h b/wolfssl/internal.h index e20d28433..cf101366a 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1516,7 +1516,7 @@ struct WOLFSSL_CERT_MANAGER { byte ocspStaplingEnabled; /* is OCSP Stapling on ? */ #ifndef NO_RSA - word16 minRsaKeySz; /* minimum allowed RSA key size */ + short minRsaKeySz; /* minimum allowed RSA key size */ #endif #ifdef HAVE_ECC short minEccKeySz; /* minimum allowed ECC key size */ @@ -1918,7 +1918,7 @@ struct WOLFSSL_CTX { word16 minDhKeySz; /* minimum DH key size */ #endif #ifndef NO_RSA - word16 minRsaKeySz; /* minimum RSA key size */ + short minRsaKeySz; /* minimum RSA key size */ #endif #ifdef HAVE_ECC short minEccKeySz; /* minimum ECC key size */ @@ -2388,7 +2388,7 @@ typedef struct Options { word16 dhKeySz; /* actual DH key size */ #endif #ifndef NO_RSA - word16 minRsaKeySz; /* minimum RSA key size */ + short minRsaKeySz; /* minimum RSA key size */ #endif #ifdef HAVE_ECC short minEccKeySz; /* minimum ECC key size */ diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 755cde40e..34fd8536a 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -939,8 +939,8 @@ WOLFSSL_API int wolfSSL_GetDhKey_Sz(WOLFSSL*); #endif /* NO_DH */ #ifndef NO_RSA -WOLFSSL_API int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX*, unsigned short); -WOLFSSL_API int wolfSSL_SetMinRsaKey_Sz(WOLFSSL*, unsigned short); +WOLFSSL_API int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX*, short); +WOLFSSL_API int wolfSSL_SetMinRsaKey_Sz(WOLFSSL*, short); #endif /* NO_RSA */ #ifdef HAVE_ECC From 5abeeff9198f60bab823067830e7ad80bf09363d Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Fri, 22 Apr 2016 13:46:54 -0600 Subject: [PATCH 132/192] add STARTTLS support to example client --- examples/client/client.c | 106 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 105 insertions(+), 1 deletion(-) diff --git a/examples/client/client.c b/examples/client/client.c index 275c92f95..65fdde9d9 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -364,6 +364,7 @@ static void Usage(void) printf("-N Use Non-blocking sockets\n"); printf("-r Resume session\n"); printf("-w Wait for bidirectional shutdown\n"); + printf("-M Use STARTTLS, using protocol (smtp)\n"); #ifdef HAVE_SECURE_RENEGOTIATION printf("-R Allow Secure Renegotiation\n"); printf("-i Force client Initiated Secure Renegotiation\n"); @@ -465,6 +466,9 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) const char* ourCert = cliCert; const char* ourKey = cliKey; + int doSTARTTLS = 0; + char* starttlsProt = NULL; + #ifdef WOLFSSL_TRUST_PEER_CERT const char* trustCert = NULL; #endif @@ -489,6 +493,17 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) char* ocspUrl = NULL; #endif + /* STARTTLS */ + char recvBuffer[256]; + const char* starttlsCmd[6] = { + "220", + "EHLO mail.example.com\r\n", + "250", + "STARTTLS\r\n", + "220", + "QUIT\r\n", + }; + int argc = ((func_args*)args)->argc; char** argv = ((func_args*)args)->argv; @@ -521,7 +536,8 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) #ifndef WOLFSSL_VXWORKS while ((ch = mygetopt(argc, argv, - "?gdeDusmNrwRitfxXUPCVh:p:v:l:A:c:k:Z:b:zS:F:L:ToO:aB:W:E:")) != -1) { + "?gdeDusmNrwRitfxXUPCVh:p:v:l:A:c:k:Z:b:zS:F:L:ToO:aB:W:E:M:")) + != -1) { switch (ch) { case '?' : Usage(); @@ -762,6 +778,17 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) #endif break; + case 'M' : + doSTARTTLS = 1; + starttlsProt = myoptarg; + + if (XSTRNCMP(starttlsProt, "smtp", 4) != 0) { + Usage(); + exit(MY_EX_USAGE); + } + + break; + default: Usage(); exit(MY_EX_USAGE); @@ -1163,6 +1190,55 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) if (wolfSSL_set_fd(ssl, sockfd) != SSL_SUCCESS) { err_sys("error in setting fd"); } + + /* STARTTLS */ + if (doSTARTTLS) { + + /* S: 220 SMTP service ready */ + if (read(sockfd, recvBuffer, sizeof(recvBuffer)) < 0) + err_sys("failed to read STARTTLS command\n"); + + if (!XSTRNCMP(recvBuffer, starttlsCmd[0], 3)) { + printf("%s\n", recvBuffer); + XMEMSET(recvBuffer, 0, sizeof(recvBuffer)); + } else { + err_sys("incorrect STARTTLS command received"); + } + + /* C: EHLO mail.example.com */ + if (write(sockfd, starttlsCmd[1], XSTRLEN(starttlsCmd[1])) != + (int)XSTRLEN(starttlsCmd[1])) + err_sys("failed to send STARTTLS EHLO command\n"); + + /* S: 250 offers a warm hug of welcome */ + if (read(sockfd, recvBuffer, sizeof(recvBuffer)) < 0) + err_sys("failed to read STARTTLS command\n"); + + if (!XSTRNCMP(recvBuffer, starttlsCmd[2], 3)) { + printf("%s\n", recvBuffer); + XMEMSET(recvBuffer, 0, sizeof(recvBuffer)); + } else { + err_sys("incorrect STARTTLS command received"); + } + + /* C: STARTTLS */ + if (write(sockfd, starttlsCmd[3], XSTRLEN(starttlsCmd[3])) != + (int)XSTRLEN(starttlsCmd[3])) { + err_sys("failed to send STARTTLS command\n"); + } + + /* S: 220 Go ahead */ + if (read(sockfd, recvBuffer, sizeof(recvBuffer)) < 0) + err_sys("failed to read STARTTLS command\n"); + + if (!XSTRNCMP(recvBuffer, starttlsCmd[4], 3)) { + printf("%s\n", recvBuffer); + XMEMSET(recvBuffer, 0, sizeof(recvBuffer)); + } else { + err_sys("incorrect STARTTLS command received, expected 220"); + } + } + #ifdef HAVE_CRL if (disableCRL == 0) { if (wolfSSL_EnableCRL(ssl, WOLFSSL_CRL_CHECKALL) != SSL_SUCCESS) @@ -1225,6 +1301,34 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) #endif showPeer(ssl); + if (doSTARTTLS) { + printf("\nwolfSSL client shutting down SMTP connection\n"); + + /* C: QUIT */ + if (wolfSSL_write(ssl, starttlsCmd[5], (int)XSTRLEN(starttlsCmd[5])) != + (int)XSTRLEN(starttlsCmd[5])) + err_sys("failed to send STARTTLS EHLO command\n"); + + /* S: 221 2.0.0 Service closing transmission channel */ + if (wolfSSL_read(ssl, recvBuffer, sizeof(recvBuffer)) < 0) + err_sys("failed to read STARTTLS command\n"); + + printf("%s\n", recvBuffer); + XMEMSET(recvBuffer, 0, sizeof(recvBuffer)); + + ret = wolfSSL_shutdown(ssl); + if (wc_shutdown && ret == SSL_SHUTDOWN_NOT_DONE) + wolfSSL_shutdown(ssl); /* bidirectional shutdown */ + + wolfSSL_free(ssl); + CloseSocket(sockfd); + + wolfSSL_CTX_free(ctx); + + ((func_args*)args)->return_code = 0; + return 0; + } + #ifdef HAVE_ALPN if (alpnList != NULL) { char *protocol_name = NULL; From 8f8f4129fd1c5ee874a143892d89fe9574523db2 Mon Sep 17 00:00:00 2001 From: lchristina26 Date: Tue, 26 Apr 2016 09:36:01 -0600 Subject: [PATCH 133/192] VxWorks updates: add pthreads define --- IDE/WORKBENCH/README.md | 6 +++--- wolfssl/wolfcrypt/settings.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/IDE/WORKBENCH/README.md b/IDE/WORKBENCH/README.md index c225f40b7..576e3b6af 100644 --- a/IDE/WORKBENCH/README.md +++ b/IDE/WORKBENCH/README.md @@ -27,6 +27,8 @@ then "Browse" and select: #define WOLFSSL_VXWORKS +Note: pthreads defined by default + 5. If using the VxWorks simulator add the following to EXTRA\_DEFINE: -DVXWORKS_SIM /* only if using the VxWorks simulator */ @@ -154,9 +156,7 @@ Note: The wolfSSL example server and client cannot run at the same time on the V 5. There is an example client in ```/wolfssl/examples``` . Again, wolfSSL will first need to be built. Follow the instructions [here](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html) to do so. See the [wolfSSL manual]( https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-3-getting-started.html) for instructions on how to set up the client. From within ```/wolfssl``` , the following command can be used to run the client on the host machine: - ./examples/client/client -h 192.168.200.1 -d - - The -d option disables peer checks. + ./examples/client/client -h 192.168.200.1 6. The following output should be expected in the simulator terminal: diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 97d3b486d..7a66fb754 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -325,6 +325,7 @@ #ifdef VXWORKS_SIM #define TFM_NO_ASM #endif + #define WOLFSSL_PTHREADS #define WOLFSSL_HAVE_MIN #define USE_FAST_MATH #define TFM_TIMING_RESISTANT From 7123b080eda7310be132872349ee7ae154f27a28 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 27 Apr 2016 12:03:37 -0700 Subject: [PATCH 134/192] fix issue with missing client key exchange and duplicate change cipher spec messages. --- src/internal.c | 66 +++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/src/internal.c b/src/internal.c index b0d0b7f66..49fc511ff 100755 --- a/src/internal.c +++ b/src/internal.c @@ -6211,7 +6211,10 @@ static int SanityCheckMsgReceived(WOLFSSL* ssl, byte type) WOLFSSL_MSG("Duplicate ChangeCipher received"); return DUPLICATE_MSG_E; } - ssl->msgsReceived.got_change_cipher = 1; + /* DTLS is going to ignore the CCS message if the client key + * exchange message wasn't received yet. */ + if (!ssl->options.dtls) + ssl->msgsReceived.got_change_cipher = 1; #ifndef NO_WOLFSSL_CLIENT if (ssl->options.side == WOLFSSL_CLIENT_END) { @@ -6231,7 +6234,8 @@ static int SanityCheckMsgReceived(WOLFSSL* ssl, byte type) } } #endif - + if (ssl->options.dtls) + ssl->msgsReceived.got_change_cipher = 1; break; default: @@ -8028,8 +8032,12 @@ int ProcessReply(WOLFSSL* ssl) if (ssl->options.dtls && ret == SEQUENCE_ERROR) { WOLFSSL_MSG("Silently dropping out of order DTLS message"); ssl->options.processReply = doProcessInit; - ssl->buffers.inputBuffer.length = 0; - ssl->buffers.inputBuffer.idx = 0; + ssl->buffers.inputBuffer.idx += ssl->curSize; + + ret = DtlsPoolSend(ssl); + if (ret != 0) + return ret; + continue; } #endif @@ -8161,31 +8169,33 @@ int ProcessReply(WOLFSSL* ssl) } #endif -#ifdef WOLFSSL_DTLS - /* Check for duplicate CCS message in DTLS mode. - * DTLS allows for duplicate messages, and it should be - * skipped. */ - if (ssl->options.dtls && - ssl->msgsReceived.got_change_cipher) { - - WOLFSSL_MSG("Duplicate ChangeCipher msg"); - ret = DtlsPoolSend(ssl); - if (ret != 0) - return ret; - - if (ssl->curSize != 1) { - WOLFSSL_MSG("Malicious or corrupted" - " duplicate ChangeCipher msg"); - return LENGTH_ERROR; - } - ssl->buffers.inputBuffer.idx++; - break; - } -#endif - ret = SanityCheckMsgReceived(ssl, change_cipher_hs); - if (ret != 0) - return ret; + if (ret != 0) { + if (!ssl->options.dtls) { + return ret; + } +#ifdef WOLFSSL_DTLS + else { + /* Check for duplicate CCS message in DTLS mode. + * DTLS allows for duplicate messages, and it should be + * skipped. Also skip if out of order. */ + if (ret != DUPLICATE_MSG_E && ret != OUT_OF_ORDER_E) + return ret; + + ret = DtlsPoolSend(ssl); + if (ret != 0) + return ret; + + if (ssl->curSize != 1) { + WOLFSSL_MSG("Malicious or corrupted" + " duplicate ChangeCipher msg"); + return LENGTH_ERROR; + } + ssl->buffers.inputBuffer.idx++; + break; + } +#endif /* WOLFSSL_DTLS */ + } #ifdef HAVE_SESSION_TICKET if (ssl->options.side == WOLFSSL_CLIENT_END && From 0511c8cac8eebdda10607b585a563d3a9310ac0d Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 27 Apr 2016 14:04:47 -0700 Subject: [PATCH 135/192] delay check of DTLS handshake message's RH version until the handshake header check --- src/internal.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/internal.c b/src/internal.c index 49fc511ff..31ff1879e 100755 --- a/src/internal.c +++ b/src/internal.c @@ -3982,11 +3982,9 @@ static int GetRecordHeader(WOLFSSL* ssl, const byte* input, word32* inOutIdx, ssl->options.downgrade && ssl->options.connectState < FIRST_REPLY_DONE) WOLFSSL_MSG("Server attempting to accept with different version"); - else if (ssl->options.dtls - && (ssl->options.acceptState == ACCEPT_BEGIN - || ssl->options.acceptState == CLIENT_HELLO_SENT)) - /* Do not check version until Server Hello or Hello Again (2) */ - WOLFSSL_MSG("Use version for formatting only in DTLS till "); + else if (ssl->options.dtls && rh->type == handshake) + /* Check the DTLS handshake message RH version later. */ + WOLFSSL_MSG("DTLS handshake, skip RH version number check"); else { WOLFSSL_MSG("SSL version error"); return VERSION_ERROR; /* only use requested version */ @@ -4064,6 +4062,15 @@ static int GetDtlsHandShakeHeader(WOLFSSL* ssl, const byte* input, idx += DTLS_HANDSHAKE_FRAG_SZ; c24to32(input + idx, fragSz); + if (ssl->curRL.pvMajor != ssl->version.major || + ssl->curRL.pvMinor != ssl->version.minor) { + + if (*type != client_hello && *type != hello_verify_request) + return VERSION_ERROR; + else + WOLFSSL_MSG("DTLS Handshake ignoring hello or " + "hello verify version"); + } return 0; } #endif From e0c7739fd60500bc8d36819bd4d7c5a4f4cc9e2c Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 28 Apr 2016 10:28:57 -0700 Subject: [PATCH 136/192] fix bug with non-blocking DTLS where the stored peer messages were deleted after a timeout --- src/ssl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index b433bc034..e83b06401 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -6163,8 +6163,6 @@ int wolfSSL_dtls_got_timeout(WOLFSSL* ssl) { int result = SSL_SUCCESS; - DtlsMsgListDelete(ssl->dtls_msg_list, ssl->heap); - ssl->dtls_msg_list = NULL; if (DtlsPoolTimeout(ssl) < 0 || DtlsPoolSend(ssl) < 0) { result = SSL_FATAL_ERROR; } From 2f05c96004f14b735b9930922257035929974885 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 28 Apr 2016 11:33:29 -0700 Subject: [PATCH 137/192] added braces to else clause for compiler warning differences --- src/internal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/internal.c b/src/internal.c index 31ff1879e..125ea02e6 100755 --- a/src/internal.c +++ b/src/internal.c @@ -4067,9 +4067,9 @@ static int GetDtlsHandShakeHeader(WOLFSSL* ssl, const byte* input, if (*type != client_hello && *type != hello_verify_request) return VERSION_ERROR; - else - WOLFSSL_MSG("DTLS Handshake ignoring hello or " - "hello verify version"); + else { + WOLFSSL_MSG("DTLS Handshake ignoring hello or verify version"); + } } return 0; } From 78e62eddd787650599cecee49e419dfd26f92a91 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Thu, 28 Apr 2016 13:08:50 -0600 Subject: [PATCH 138/192] fix visual studio code analysis warnings --- src/internal.c | 2 +- src/ssl.c | 4 ++++ wolfcrypt/src/coding.c | 10 ++++++++-- wolfcrypt/src/random.c | 20 +++++++++++--------- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/internal.c b/src/internal.c index b0d0b7f66..79a7ac95c 100755 --- a/src/internal.c +++ b/src/internal.c @@ -16044,7 +16044,7 @@ int DoSessionTicket(WOLFSSL* ssl, byte peerCookie[MAX_COOKIE_LEN]; byte peerCookieSz = 0; byte cookieType; - byte cookieSz; + byte cookieSz = 0; #endif /* WOLFSSL_DTLS */ #ifdef WOLFSSL_CALLBACKS diff --git a/src/ssl.c b/src/ssl.c index b433bc034..588bcab22 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2120,6 +2120,10 @@ int wolfSSL_set_group_messages(WOLFSSL* ssl) /* make minVersion the internal equivalent SSL version */ static int SetMinVersionHelper(byte* minVersion, int version) { +#ifdef NO_TLS + (void)minVersion; +#endif + switch (version) { #if defined(WOLFSSL_ALLOW_SSLV3) && !defined(NO_OLD_TLS) case WOLFSSL_SSLV3: diff --git a/wolfcrypt/src/coding.c b/wolfcrypt/src/coding.c index 826e74c85..f144b1130 100644 --- a/wolfcrypt/src/coding.c +++ b/wolfcrypt/src/coding.c @@ -365,6 +365,9 @@ int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen) word32 inIdx = 0; word32 outIdx = 0; + if (in == NULL || out == NULL || outLen == NULL) + return BAD_FUNC_ARG; + if (inLen == 1 && *outLen && in) { byte b = in[inIdx++] - 0x30; /* 0 starts at 0x30 */ @@ -376,7 +379,7 @@ int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen) if (b == BAD) return ASN_INPUT_E; - + out[outIdx++] = b; *outLen = outIdx; @@ -404,7 +407,7 @@ int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen) if (b == BAD || b2 == BAD) return ASN_INPUT_E; - + out[outIdx++] = (byte)((b << 4) | b2); inLen -= 2; } @@ -419,6 +422,9 @@ int Base16_Encode(const byte* in, word32 inLen, byte* out, word32* outLen) word32 i; byte hb, lb; + if (in == NULL || out == NULL || outLen == NULL) + return BAD_FUNC_ARG; + if (*outLen < (2 * inLen + 1)) return BAD_FUNC_ARG; diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 235dce133..c446bb747 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -361,15 +361,17 @@ static int Hash_gen(DRBG* drbg, byte* out, word32 outSz, const byte* V) drbg->lastBlock = checkBlock; } - if (outSz >= OUTPUT_BLOCK_LEN) { - XMEMCPY(out, digest, OUTPUT_BLOCK_LEN); - outSz -= OUTPUT_BLOCK_LEN; - out += OUTPUT_BLOCK_LEN; - array_add_one(data, DRBG_SEED_LEN); - } - else if (out != NULL && outSz != 0) { - XMEMCPY(out, digest, outSz); - outSz = 0; + if (out != NULL) { + if (outSz >= OUTPUT_BLOCK_LEN) { + XMEMCPY(out, digest, OUTPUT_BLOCK_LEN); + outSz -= OUTPUT_BLOCK_LEN; + out += OUTPUT_BLOCK_LEN; + array_add_one(data, DRBG_SEED_LEN); + } + else if (out != NULL && outSz != 0) { + XMEMCPY(out, digest, outSz); + outSz = 0; + } } } ForceZero(data, sizeof(data)); From 46addfb1306474274c7be6e4c739da64df2aa064 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Thu, 28 Apr 2016 14:21:33 -0600 Subject: [PATCH 139/192] move example client STARTTLS into separate funcs --- examples/client/client.c | 171 +++++++++++++++++++++++---------------- examples/client/client.h | 6 ++ 2 files changed, 106 insertions(+), 71 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 65fdde9d9..ab4436341 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -328,6 +328,99 @@ int ClientBenchmarkThroughput(WOLFSSL_CTX* ctx, char* host, word16 port, return EXIT_SUCCESS; } +const char* starttlsCmd[6] = { + "220", + "EHLO mail.example.com\r\n", + "250", + "STARTTLS\r\n", + "220", + "QUIT\r\n", +}; + +int StartTLS_Init(SOCKET_T* sockfd) +{ + char tmpBuf[256]; + + if (sockfd == NULL) + return BAD_FUNC_ARG; + + /* S: 220 SMTP service ready */ + if (read(*sockfd, tmpBuf, sizeof(tmpBuf)) < 0) + err_sys("failed to read STARTTLS command\n"); + + if (!XSTRNCMP(tmpBuf, starttlsCmd[0], XSTRLEN(starttlsCmd[0]))) { + printf("%s\n", tmpBuf); + XMEMSET(tmpBuf, 0, sizeof(tmpBuf)); + } else { + err_sys("incorrect STARTTLS command received"); + } + + /* C: EHLO mail.example.com */ + if (write(*sockfd, starttlsCmd[1], XSTRLEN(starttlsCmd[1])) != + (int)XSTRLEN(starttlsCmd[1])) + err_sys("failed to send STARTTLS EHLO command\n"); + + /* S: 250 offers a warm hug of welcome */ + if (read(*sockfd, tmpBuf, sizeof(tmpBuf)) < 0) + err_sys("failed to read STARTTLS command\n"); + + if (!XSTRNCMP(tmpBuf, starttlsCmd[2], XSTRLEN(starttlsCmd[2]))) { + printf("%s\n", tmpBuf); + XMEMSET(tmpBuf, 0, sizeof(tmpBuf)); + } else { + err_sys("incorrect STARTTLS command received"); + } + + /* C: STARTTLS */ + if (write(*sockfd, starttlsCmd[3], XSTRLEN(starttlsCmd[3])) != + (int)XSTRLEN(starttlsCmd[3])) { + err_sys("failed to send STARTTLS command\n"); + } + + /* S: 220 Go ahead */ + if (read(*sockfd, tmpBuf, sizeof(tmpBuf)) < 0) + err_sys("failed to read STARTTLS command\n"); + + if (!XSTRNCMP(tmpBuf, starttlsCmd[4], XSTRLEN(starttlsCmd[4]))) { + printf("%s\n", tmpBuf); + XMEMSET(tmpBuf, 0, sizeof(tmpBuf)); + } else { + err_sys("incorrect STARTTLS command received, expected 220"); + } + + return SSL_SUCCESS; +} + +int SMTP_Shutdown(WOLFSSL* ssl, int wc_shutdown) +{ + int ret; + char tmpBuf[256]; + + if (ssl == NULL) + return BAD_FUNC_ARG; + + printf("\nwolfSSL client shutting down SMTP connection\n"); + + XMEMSET(tmpBuf, 0, sizeof(tmpBuf)); + + /* C: QUIT */ + if (wolfSSL_write(ssl, starttlsCmd[5], (int)XSTRLEN(starttlsCmd[5])) != + (int)XSTRLEN(starttlsCmd[5])) + err_sys("failed to send SMTP QUIT command\n"); + + /* S: 221 2.0.0 Service closing transmission channel */ + if (wolfSSL_read(ssl, tmpBuf, sizeof(tmpBuf)) < 0) + err_sys("failed to read SMTP closing down response\n"); + + printf("%s\n", tmpBuf); + + ret = wolfSSL_shutdown(ssl); + if (wc_shutdown && ret == SSL_SHUTDOWN_NOT_DONE) + wolfSSL_shutdown(ssl); /* bidirectional shutdown */ + + return SSL_SUCCESS; +} + static void Usage(void) { @@ -493,17 +586,6 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) char* ocspUrl = NULL; #endif - /* STARTTLS */ - char recvBuffer[256]; - const char* starttlsCmd[6] = { - "220", - "EHLO mail.example.com\r\n", - "250", - "STARTTLS\r\n", - "220", - "QUIT\r\n", - }; - int argc = ((func_args*)args)->argc; char** argv = ((func_args*)args)->argv; @@ -1193,49 +1275,8 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) /* STARTTLS */ if (doSTARTTLS) { - - /* S: 220 SMTP service ready */ - if (read(sockfd, recvBuffer, sizeof(recvBuffer)) < 0) - err_sys("failed to read STARTTLS command\n"); - - if (!XSTRNCMP(recvBuffer, starttlsCmd[0], 3)) { - printf("%s\n", recvBuffer); - XMEMSET(recvBuffer, 0, sizeof(recvBuffer)); - } else { - err_sys("incorrect STARTTLS command received"); - } - - /* C: EHLO mail.example.com */ - if (write(sockfd, starttlsCmd[1], XSTRLEN(starttlsCmd[1])) != - (int)XSTRLEN(starttlsCmd[1])) - err_sys("failed to send STARTTLS EHLO command\n"); - - /* S: 250 offers a warm hug of welcome */ - if (read(sockfd, recvBuffer, sizeof(recvBuffer)) < 0) - err_sys("failed to read STARTTLS command\n"); - - if (!XSTRNCMP(recvBuffer, starttlsCmd[2], 3)) { - printf("%s\n", recvBuffer); - XMEMSET(recvBuffer, 0, sizeof(recvBuffer)); - } else { - err_sys("incorrect STARTTLS command received"); - } - - /* C: STARTTLS */ - if (write(sockfd, starttlsCmd[3], XSTRLEN(starttlsCmd[3])) != - (int)XSTRLEN(starttlsCmd[3])) { - err_sys("failed to send STARTTLS command\n"); - } - - /* S: 220 Go ahead */ - if (read(sockfd, recvBuffer, sizeof(recvBuffer)) < 0) - err_sys("failed to read STARTTLS command\n"); - - if (!XSTRNCMP(recvBuffer, starttlsCmd[4], 3)) { - printf("%s\n", recvBuffer); - XMEMSET(recvBuffer, 0, sizeof(recvBuffer)); - } else { - err_sys("incorrect STARTTLS command received, expected 220"); + if (StartTLS_Init(&sockfd) != SSL_SUCCESS) { + err_sys("error during STARTTLS protocol"); } } @@ -1302,23 +1343,11 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) showPeer(ssl); if (doSTARTTLS) { - printf("\nwolfSSL client shutting down SMTP connection\n"); - - /* C: QUIT */ - if (wolfSSL_write(ssl, starttlsCmd[5], (int)XSTRLEN(starttlsCmd[5])) != - (int)XSTRLEN(starttlsCmd[5])) - err_sys("failed to send STARTTLS EHLO command\n"); - - /* S: 221 2.0.0 Service closing transmission channel */ - if (wolfSSL_read(ssl, recvBuffer, sizeof(recvBuffer)) < 0) - err_sys("failed to read STARTTLS command\n"); - - printf("%s\n", recvBuffer); - XMEMSET(recvBuffer, 0, sizeof(recvBuffer)); - - ret = wolfSSL_shutdown(ssl); - if (wc_shutdown && ret == SSL_SHUTDOWN_NOT_DONE) - wolfSSL_shutdown(ssl); /* bidirectional shutdown */ + if (XSTRNCMP(starttlsProt, "smtp", 4) == 0) { + if (SMTP_Shutdown(ssl, wc_shutdown) != SSL_SUCCESS) { + err_sys("error closing STARTTLS connection"); + } + } wolfSSL_free(ssl); CloseSocket(sockfd); diff --git a/examples/client/client.h b/examples/client/client.h index 6b5bd27e4..913339ac0 100644 --- a/examples/client/client.h +++ b/examples/client/client.h @@ -35,6 +35,12 @@ int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, int ClientBenchmarkThroughput(WOLFSSL_CTX* ctx, char* host, word16 port, int doDTLS, int throughput); +/* Initiates the STARTTLS command sequence over TCP */ +int StartTLS_Init(SOCKET_T* sockfd); + +/* Closes down the SMTP connection */ +int SMTP_Shutdown(WOLFSSL* ssl, int wc_shutdown); + #endif /* WOLFSSL_CLIENT_H */ From a94383037c60ae9ad87a0809be436cf3a9e74248 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Mon, 2 May 2016 10:10:25 -0600 Subject: [PATCH 140/192] use send/recv instead of write/read with STARTTLS for winsock compatibility --- examples/client/client.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index ab4436341..639325a03 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -345,7 +345,7 @@ int StartTLS_Init(SOCKET_T* sockfd) return BAD_FUNC_ARG; /* S: 220 SMTP service ready */ - if (read(*sockfd, tmpBuf, sizeof(tmpBuf)) < 0) + if (recv(*sockfd, tmpBuf, sizeof(tmpBuf), 0) < 0) err_sys("failed to read STARTTLS command\n"); if (!XSTRNCMP(tmpBuf, starttlsCmd[0], XSTRLEN(starttlsCmd[0]))) { @@ -356,12 +356,12 @@ int StartTLS_Init(SOCKET_T* sockfd) } /* C: EHLO mail.example.com */ - if (write(*sockfd, starttlsCmd[1], XSTRLEN(starttlsCmd[1])) != - (int)XSTRLEN(starttlsCmd[1])) + if (send(*sockfd, starttlsCmd[1], (int)XSTRLEN(starttlsCmd[1]), 0) != + (word32)XSTRLEN(starttlsCmd[1])) err_sys("failed to send STARTTLS EHLO command\n"); /* S: 250 offers a warm hug of welcome */ - if (read(*sockfd, tmpBuf, sizeof(tmpBuf)) < 0) + if (recv(*sockfd, tmpBuf, sizeof(tmpBuf), 0) < 0) err_sys("failed to read STARTTLS command\n"); if (!XSTRNCMP(tmpBuf, starttlsCmd[2], XSTRLEN(starttlsCmd[2]))) { @@ -372,13 +372,13 @@ int StartTLS_Init(SOCKET_T* sockfd) } /* C: STARTTLS */ - if (write(*sockfd, starttlsCmd[3], XSTRLEN(starttlsCmd[3])) != - (int)XSTRLEN(starttlsCmd[3])) { + if (send(*sockfd, starttlsCmd[3], (int)XSTRLEN(starttlsCmd[3]), 0) != + (word32)XSTRLEN(starttlsCmd[3])) { err_sys("failed to send STARTTLS command\n"); } /* S: 220 Go ahead */ - if (read(*sockfd, tmpBuf, sizeof(tmpBuf)) < 0) + if (recv(*sockfd, tmpBuf, sizeof(tmpBuf), 0) < 0) err_sys("failed to read STARTTLS command\n"); if (!XSTRNCMP(tmpBuf, starttlsCmd[4], XSTRLEN(starttlsCmd[4]))) { From f19541ffe5d47a4f4fd43f15d168bdc62c3e48d5 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 27 Apr 2016 11:29:42 -0600 Subject: [PATCH 141/192] update to MYSQL compatibility --- IDE/MYSQL/CMakeLists_wolfCrypt.txt | 3 +- src/ssl.c | 204 +++++++++++++++++++++++++++-- tests/api.c | 54 ++++++++ wolfssl/internal.h | 4 + wolfssl/openssl/des.h | 33 ++--- wolfssl/openssl/ssl.h | 14 +- wolfssl/ssl.h | 19 ++- 7 files changed, 289 insertions(+), 42 deletions(-) diff --git a/IDE/MYSQL/CMakeLists_wolfCrypt.txt b/IDE/MYSQL/CMakeLists_wolfCrypt.txt index 62184780b..49953507a 100644 --- a/IDE/MYSQL/CMakeLists_wolfCrypt.txt +++ b/IDE/MYSQL/CMakeLists_wolfCrypt.txt @@ -27,7 +27,7 @@ SET(WOLFCRYPT_SOURCES src/aes.c src/arc4.c src/asn.c src/blake2b.c src/camellia.c src/chacha.c src/coding.c src/compress.c src/des3.c src/dh.c src/dsa.c src/ecc.c src/error.c src/hc128.c src/hmac.c src/integer.c src/logging.c src/md2.c src/md4.c src/md5.c src/memory.c - src/misc.c src/pkcs7.c src/poly1305.c src/pwdbased.c src/rabbit.c + src/pkcs7.c src/poly1305.c src/pwdbased.c src/rabbit.c src/random.c src/ripemd.c src/rsa.c src/sha.c src/sha256.c src/sha512.c src/tfm.c src/wc_port.c src/wc_encrypt.c src/hash.c ../wolfssl/wolfcrypt/aes.h ../wolfssl/wolfcrypt/arc4.h ../wolfssl/wolfcrypt/asn.h ../wolfssl/wolfcrypt/blake2.h @@ -39,6 +39,7 @@ SET(WOLFCRYPT_SOURCES src/aes.c src/arc4.c src/asn.c src/blake2b.c ../wolfssl/wolfcrypt/tfm.h ../wolfssl/wolfcrypt/wc_port.h ../wolfssl/wolfcrypt/wc_encrypt.h ../wolfssl/wolfcrypt/hash.h ) +# misc.c is not compiled in since using INLINE ADD_CONVENIENCE_LIBRARY(wolfcrypt ${WOLFCRYPT_SOURCES}) RESTRICT_SYMBOL_EXPORTS(wolfcrypt) diff --git a/src/ssl.c b/src/ssl.c index 3e58df848..411cea572 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -81,6 +81,7 @@ #include #include #include + #include #ifdef HAVE_STUNNEL #include #endif /* WITH_STUNNEL */ @@ -9760,6 +9761,35 @@ int wolfSSL_set_compression(WOLFSSL* ssl) } + /* WOLFSSL_DES_key_schedule is a unsigned char array of size 8 */ + void wolfSSL_DES_ede3_cbc_encrypt(const unsigned char* input, + unsigned char* output, long sz, + WOLFSSL_DES_key_schedule* ks1, + WOLFSSL_DES_key_schedule* ks2, + WOLFSSL_DES_key_schedule* ks3, + WOLFSSL_DES_cblock* ivec, int enc) + { + Des3 des; + byte key[24];/* EDE uses 24 size key */ + + WOLFSSL_ENTER("wolfSSL_DES_ede3_cbc_encrypt"); + + XMEMSET(key, 0, sizeof(key)); + XMEMCPY(key, *ks1, DES_BLOCK_SIZE); + XMEMCPY(&key[DES_BLOCK_SIZE], *ks2, DES_BLOCK_SIZE); + XMEMCPY(&key[DES_BLOCK_SIZE * 2], *ks3, DES_BLOCK_SIZE); + + if (enc) { + wc_Des3_SetKey(&des, key, (const byte*)ivec, DES_ENCRYPTION); + wc_Des3_CbcEncrypt(&des, output, input, (word32)sz); + } + else { + wc_Des3_SetKey(&des, key, (const byte*)ivec, DES_DECRYPTION); + wc_Des3_CbcDecrypt(&des, output, input, (word32)sz); + } + } + + /* correctly sets ivec for next call */ void wolfSSL_DES_ncbc_encrypt(const unsigned char* input, unsigned char* output, long length, @@ -10216,6 +10246,71 @@ static void ExternalFreeX509(WOLFSSL_X509* x509) WOLFSSL_LEAVE("wolfSSL_X509_NAME_get_text_by_NID", textSz); return textSz; } + + int wolfSSL_X509_NAME_get_index_by_NID(WOLFSSL_X509_NAME* name, + int nid, int pos) + { + int ret = -1; + + WOLFSSL_ENTER("wolfSSL_X509_NAME_get_index_by_NID"); + + if (name == NULL) { + return BAD_FUNC_ARG; + } + + /* these index values are already stored in DecodedName + use those when available */ + if (name->fullName.fullName && name->fullName.fullNameLen > 0) { + switch (nid) { + case ASN_COMMON_NAME: + ret = name->fullName.cnIdx; + break; + default: + WOLFSSL_MSG("NID not yet implemented"); + break; + } + } + + WOLFSSL_LEAVE("wolfSSL_X509_NAME_get_index_by_NID", ret); + + (void)pos; + (void)nid; + + return ret; + } + + + WOLFSSL_ASN1_STRING* wolfSSL_X509_NAME_ENTRY_get_data(WOLFSSL_X509_NAME_ENTRY* in) + { + WOLFSSL_ENTER("wolfSSL_X509_NAME_ENTRY_get_data"); + return in->value; + } + + + char* wolfSSL_ASN1_STRING_data(WOLFSSL_ASN1_STRING* asn) + { + WOLFSSL_ENTER("wolfSSL_ASN1_STRING_data"); + + if (asn) { + return asn->data; + } + else { + return NULL; + } + } + + + int wolfSSL_ASN1_STRING_length(WOLFSSL_ASN1_STRING* asn) + { + WOLFSSL_ENTER("wolfSSL_ASN1_STRING_length"); + + if (asn) { + return asn->length; + } + else { + return 0; + } + } #endif @@ -10636,6 +10731,14 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) #endif /* NO_FILESYSTEM */ #endif /* KEEP_PEER_CERT || SESSION_CERTS */ + +#ifdef OPENSSL_EXTRA /* needed for wolfSSL_X509_d21 function */ +WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl) +{ + DerBuffer* cert = ssl->buffers.certificate; + return wolfSSL_X509_d2i(NULL, cert->buffer, cert->length); +} +#endif /* OPENSSL_EXTRA */ #endif /* NO_CERTS */ @@ -11656,7 +11759,6 @@ int wolfSSL_ASN1_TIME_print(WOLFSSL_BIO* bio, const WOLFSSL_ASN1_TIME* asnTime) } - int wolfSSL_ASN1_INTEGER_cmp(const WOLFSSL_ASN1_INTEGER* a, const WOLFSSL_ASN1_INTEGER* b) { @@ -11835,14 +11937,16 @@ long wolfSSL_CTX_sess_number(WOLFSSL_CTX* ctx) void wolfSSL_DES_set_key_unchecked(WOLFSSL_const_DES_cblock* myDes, WOLFSSL_DES_key_schedule* key) { - (void)myDes; - (void)key; + if (myDes != NULL && key != NULL) { + XMEMCPY(key, myDes, sizeof(WOLFSSL_const_DES_cblock)); + } } void wolfSSL_DES_set_odd_parity(WOLFSSL_DES_cblock* myDes) { (void)myDes; + WOLFSSL_STUB("wolfSSL_DES_set_odd_parity"); } @@ -11853,6 +11957,7 @@ void wolfSSL_DES_ecb_encrypt(WOLFSSL_DES_cblock* desa, (void)desb; (void)key; (void)len; + WOLFSSL_STUB("wolfSSL_DES_ecb_encrypt"); } #endif /* NO_DES3 */ @@ -16882,7 +16987,7 @@ void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl) #ifdef OPENSSL_EXTRA /*Lighttp compatibility*/ -#ifdef HAVE_LIGHTY +#if defined(HAVE_LIGHTY) || defined(WOLFSSL_MYSQL_COMPATIBLE) unsigned char *wolfSSL_SHA1(const unsigned char *d, size_t n, unsigned char *md) { @@ -16998,12 +17103,90 @@ void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl) } WOLFSSL_X509_NAME_ENTRY *wolfSSL_X509_NAME_get_entry(WOLFSSL_X509_NAME *name, int loc) { + + int maxLoc = name->fullName.fullNameLen; + char* data = NULL; + int length; + int type; + + WOLFSSL_ASN1_STRING* asnStr; + WOLFSSL_X509_NAME_ENTRY* ret; + + WOLFSSL_ENTER("wolfSSL_X509_NAME_get_entry"); + + if (loc < 0 || loc > maxLoc) { + WOLFSSL_MSG("Bad argument"); + return NULL; + } + + ret = XMALLOC(sizeof(WOLFSSL_X509_NAME_ENTRY), NULL, DYNAMIC_TYPE_X509); + if (ret == NULL) { + return ret; + } + asnStr = XMALLOC(sizeof(WOLFSSL_ASN1_STRING), NULL, + DYNAMIC_TYPE_X509); + if (asnStr == NULL) { + XFREE(ret, NULL, DYNAMIC_TYPE_X509); + ret = NULL; + } + + /* initialize both structures */ + XMEMSET(ret, 0, sizeof(WOLFSSL_X509_NAME_ENTRY)); + XMEMSET(asnStr, 0, sizeof(WOLFSSL_ASN1_STRING)); + + /* common name index case */ + if (loc == name->fullName.cnIdx) { + length = name->fullName.cnLen; + data = name->fullName.fullName + loc; + type = ASN_COMMON_NAME; + } + + /* additionall cases to check for go here */ + + + if (data == NULL) { + WOLFSSL_MSG("Index not found"); + XFREE(asnStr, NULL, DYNAMIC_TYPE_X509); + XFREE(ret, NULL, DYNAMIC_TYPE_X509); + ret = NULL; + } + else { + asnStr->data = XMALLOC(length + 1, NULL, DYNAMIC_TYPE_X509); + if (asnStr->data == NULL) { + XFREE(asnStr, NULL, DYNAMIC_TYPE_X509); + XFREE(ret, NULL, DYNAMIC_TYPE_X509); + ret = NULL; + } + + /* check bounds before copying from fullName */ + if (loc + length > maxLoc) { + XFREE(asnStr, NULL, DYNAMIC_TYPE_X509); + XFREE(ret, NULL, DYNAMIC_TYPE_X509); + ret = NULL; + } + + if (ret != NULL) { + XMEMCPY(asnStr->data, data, length); + asnStr->data[length] = 0; + asnStr->length = length; + asnStr->type = type; + asnStr->flags = 0; + + ret->object = NULL; + ret->value = asnStr; + ret->set = 1; + ret->size = asnStr->length + sizeof(WOLFSSL_ASN1_STRING) + + sizeof(WOLFSSL_X509_NAME_ENTRY); + } + } + (void)name; (void)loc; - WOLFSSL_ENTER("wolfSSL_X509_NAME_get_entry"); - WOLFSSL_STUB("wolfSSL_X509_NAME_get_entry"); + (void)data; + (void)type; + (void)length; - return NULL; + return ret; } #ifndef NO_CERTS @@ -17038,7 +17221,7 @@ void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl) return NULL; } -#endif +#endif /* HAVE_LIGHTY || WOLFSSL_MYSQL_COMPATIBLE */ #endif @@ -17135,7 +17318,8 @@ void* wolfSSL_get_ex_data(const WOLFSSL* ssl, int idx) #endif /* OPENSSL_EXTRA */ -#if defined(HAVE_LIGHTY) || defined(HAVE_STUNNEL) +#if defined(HAVE_LIGHTY) || defined(HAVE_STUNNEL) \ + || defined(WOLFSSL_MYSQL_COMPATIBLE) char * wolf_OBJ_nid2ln(int n) { (void)n; WOLFSSL_ENTER("wolf_OBJ_nid2ln"); @@ -17228,7 +17412,7 @@ long wolfSSL_CTX_set_tmp_dh(WOLFSSL_CTX* ctx, WOLFSSL_DH* dh) return pSz > 0 && gSz > 0 ? ret : SSL_FATAL_ERROR; } #endif /* NO_DH */ -#endif /* HAVE_LIGHTY || HAVE_STUNNEL */ +#endif /* HAVE_LIGHTY || HAVE_STUNNEL || WOLFSSL_MYSQL_COMPATIBLE */ /* stunnel compatibility functions*/ diff --git a/tests/api.c b/tests/api.c index da2273c53..630588d75 100644 --- a/tests/api.c +++ b/tests/api.c @@ -39,6 +39,10 @@ #include #include +#ifdef OPENSSL_EXTRA + #include +#endif + /* enable testing buffer load functions */ #ifndef USE_CERT_BUFFERS_2048 #define USE_CERT_BUFFERS_2048 @@ -1662,6 +1666,53 @@ static void test_wolfSSL_UseALPN(void) #endif } +/*----------------------------------------------------------------------------* + | X509 Tests + *----------------------------------------------------------------------------*/ +static void test_wolfSSL_X509_NAME_get_entry(void) +{ +#ifndef NO_CERTS +#if defined(OPENSSL_EXTRA) && (defined(KEEP_PEER_CERT) || defined(SESSION_CERTS)) \ + && (defined(HAVE_LIGHTY) || defined(WOLFSSL_MYSQL_COMPATIBLE)) + printf(testingFmt, "wolfSSL_X509_NAME_get_entry()"); + + { + /* use openssl like name to test mapping */ + X509_NAME_ENTRY* ne = NULL; + X509_NAME* name = NULL; + char* subCN = NULL; + X509* x509; + ASN1_STRING* asn; + int idx; + + #ifndef NO_FILESYSTEM + x509 = wolfSSL_X509_load_certificate_file(cliCert, SSL_FILETYPE_PEM); + AssertNotNull(x509); + + name = X509_get_subject_name(x509); + + idx = X509_NAME_get_index_by_NID(name, NID_commonName, -1); + AssertIntGE(idx, 0); + + ne = X509_NAME_get_entry(name, idx); + AssertNotNull(ne); + + asn = X509_NAME_ENTRY_get_data(ne); + AssertNotNull(asn); + + subCN = (char*)ASN1_STRING_data(asn); + AssertNotNull(subCN); + + #endif + + } + + printf(resultFmt, passed); +#endif /* OPENSSL_EXTRA */ +#endif /* !NO_CERTS */ +} + + /*----------------------------------------------------------------------------* | Main *----------------------------------------------------------------------------*/ @@ -1692,6 +1743,9 @@ void ApiTest(void) test_wolfSSL_UseSupportedCurve(); test_wolfSSL_UseALPN(); + /* X509 tests */ + test_wolfSSL_X509_NAME_get_entry(); + test_wolfSSL_Cleanup(); printf(" End API Tests\n"); } diff --git a/wolfssl/internal.h b/wolfssl/internal.h index cf101366a..507f152e1 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -873,7 +873,11 @@ enum Misc { ZLIB_COMPRESSION = 221, /* wolfSSL zlib compression */ HELLO_EXT_SIG_ALGO = 13, /* ID for the sig_algo hello extension */ SECRET_LEN = 48, /* pre RSA and all master */ +#if defined(WOLFSSL_MYSQL_COMPATIBLE) + ENCRYPT_LEN = 1024, /* allow larger static buffer with mysql */ +#else ENCRYPT_LEN = 512, /* allow 4096 bit static buffer */ +#endif SIZEOF_SENDER = 4, /* clnt or srvr */ FINISHED_SZ = 36, /* MD5_DIGEST_SIZE + SHA_DIGEST_SIZE */ MAX_RECORD_SIZE = 16384, /* 2^14, max size by standard */ diff --git a/wolfssl/openssl/des.h b/wolfssl/openssl/des.h index e8c2ac42b..14b843b0b 100644 --- a/wolfssl/openssl/des.h +++ b/wolfssl/openssl/des.h @@ -61,6 +61,12 @@ WOLFSSL_API void wolfSSL_DES_cbc_encrypt(const unsigned char* input, unsigned char* output, long length, WOLFSSL_DES_key_schedule* schedule, WOLFSSL_DES_cblock* ivec, int enc); +WOLFSSL_API void wolfSSL_DES_ede3_cbc_encrypt(const unsigned char* input, + unsigned char* output, long sz, + WOLFSSL_DES_key_schedule* ks1, + WOLFSSL_DES_key_schedule* ks2, + WOLFSSL_DES_key_schedule* ks3, + WOLFSSL_DES_cblock* ivec, int enc); WOLFSSL_API void wolfSSL_DES_ncbc_encrypt(const unsigned char* input, unsigned char* output, long length, WOLFSSL_DES_key_schedule* schedule, @@ -76,27 +82,12 @@ typedef WOLFSSL_const_DES_cblock const_DES_cblock; typedef WOLFSSL_DES_key_schedule DES_key_schedule; #define DES_set_key_unchecked wolfSSL_DES_set_key_unchecked -#define DES_key_sched wolfSSL_DES_key_sched -#define DES_cbc_encrypt wolfSSL_DES_cbc_encrypt -#define DES_ncbc_encrypt wolfSSL_DES_ncbc_encrypt -#define DES_set_odd_parity wolfSSL_DES_set_odd_parity -#define DES_ecb_encrypt wolfSSL_DES_ecb_encrypt -#define DES_ede3_cbc_encrypt(input, output, sz, ks1, ks2, ks3, ivec, enc) \ -do { \ - Des3 des; \ - byte key[24];/* EDE uses 24 size key */ \ - memcpy(key, (ks1), DES_BLOCK_SIZE); \ - memcpy(&key[DES_BLOCK_SIZE], (ks2), DES_BLOCK_SIZE); \ - memcpy(&key[DES_BLOCK_SIZE * 2], (ks3), DES_BLOCK_SIZE); \ - if (enc) { \ - wc_Des3_SetKey(&des, key, (const byte*)(ivec), DES_ENCRYPTION); \ - wc_Des3_CbcEncrypt(&des, (output), (input), (sz)); \ - } \ - else { \ - wc_Des3_SetKey(&des, key, (const byte*)(ivec), DES_ENCRYPTION); \ - wc_Des3_CbcDecrypt(&des, (output), (input), (sz)); \ - } \ -} while(0) +#define DES_key_sched wolfSSL_DES_key_sched +#define DES_cbc_encrypt wolfSSL_DES_cbc_encrypt +#define DES_ncbc_encrypt wolfSSL_DES_ncbc_encrypt +#define DES_set_odd_parity wolfSSL_DES_set_odd_parity +#define DES_ecb_encrypt wolfSSL_DES_ecb_encrypt +#define DES_ede3_cbc_encrypt wolfSSL_DES_ede3_cbc_encrypt #ifdef __cplusplus } /* extern "C" */ diff --git a/wolfssl/openssl/ssl.h b/wolfssl/openssl/ssl.h index 67902a679..ce6865909 100644 --- a/wolfssl/openssl/ssl.h +++ b/wolfssl/openssl/ssl.h @@ -104,7 +104,7 @@ typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX; #define SSL_get_verify_depth wolfSSL_get_verify_depth #define SSL_CTX_get_verify_mode wolfSSL_CTX_get_verify_mode #define SSL_CTX_get_verify_depth wolfSSL_CTX_get_verify_depth -#define SSL_get_certificate(ctx) 0 /* used to pass to get_privatekey */ +#define SSL_get_certificate wolfSSL_get_certificate #define SSLv3_server_method wolfSSLv3_server_method #define SSLv3_client_method wolfSSLv3_client_method @@ -409,7 +409,7 @@ typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX; /* Lighthttp compatibility */ -#ifdef HAVE_LIGHTY +#if defined(HAVE_LIGHTY) || defined(WOLFSSL_MYSQL_COMPATIBLE) typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY; #define SSL_CB_HANDSHAKE_START 0x10 @@ -428,14 +428,20 @@ typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY; #define X509_NAME_entry_count wolfSSL_X509_NAME_entry_count #define X509_NAME_ENTRY_get_object wolfSSL_X509_NAME_ENTRY_get_object #define X509_NAME_get_entry wolfSSL_X509_NAME_get_entry +#define ASN1_STRING_data wolfSSL_ASN1_STRING_data +#define ASN1_STRING_length wolfSSL_ASN1_STRING_length +#define X509_NAME_get_index_by_NID wolfSSL_X509_NAME_get_index_by_NID +#define X509_NAME_ENTRY_get_data wolfSSL_X509_NAME_ENTRY_get_data #define sk_X509_NAME_pop_free wolfSSL_sk_X509_NAME_pop_free #define SHA1 wolfSSL_SHA1 #define X509_check_private_key wolfSSL_X509_check_private_key #define SSL_dup_CA_list wolfSSL_dup_CA_list +#define NID_commonName 0x03 /* matchs ASN_COMMON_NAME in asn.h */ #endif -#if defined(HAVE_STUNNEL) || defined(HAVE_LIGHTY) +#if defined(HAVE_STUNNEL) || defined(HAVE_LIGHTY) \ + || defined(WOLFSSL_MYSQL_COMPATIBLE) #define OBJ_nid2ln wolf_OBJ_nid2ln #define OBJ_txt2nid wolf_OBJ_txt2nid @@ -445,7 +451,7 @@ typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY; #define BIO_new_file wolfSSL_BIO_new_file -#endif /* HAVE_STUNNEL || HAVE_LIGHTY */ +#endif /* HAVE_STUNNEL || HAVE_LIGHTY || WOLFSSL_MYSQL_COMPATIBLE */ #ifdef HAVE_STUNNEL #include diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 34fd8536a..2c20f4238 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -70,6 +70,7 @@ typedef struct WOLFSSL_CTX WOLFSSL_CTX; typedef struct WOLFSSL_X509 WOLFSSL_X509; typedef struct WOLFSSL_X509_NAME WOLFSSL_X509_NAME; +typedef struct WOLFSSL_X509_NAME_ENTRY WOLFSSL_X509_NAME_ENTRY; typedef struct WOLFSSL_X509_CHAIN WOLFSSL_X509_CHAIN; typedef struct WOLFSSL_CERT_MANAGER WOLFSSL_CERT_MANAGER; @@ -474,6 +475,11 @@ WOLFSSL_API unsigned char* wolfSSL_X509_get_subjectKeyID( WOLFSSL_API int wolfSSL_X509_NAME_entry_count(WOLFSSL_X509_NAME*); WOLFSSL_API int wolfSSL_X509_NAME_get_text_by_NID( WOLFSSL_X509_NAME*, int, char*, int); +WOLFSSL_API int wolfSSL_X509_NAME_get_index_by_NID( + WOLFSSL_X509_NAME*, int, int); +WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_X509_NAME_ENTRY_get_data(WOLFSSL_X509_NAME_ENTRY*); +WOLFSSL_API char* wolfSSL_ASN1_STRING_data(WOLFSSL_ASN1_STRING*); +WOLFSSL_API int wolfSSL_ASN1_STRING_length(WOLFSSL_ASN1_STRING*); WOLFSSL_API int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX*); WOLFSSL_API const char* wolfSSL_X509_verify_cert_error_string(long); WOLFSSL_API int wolfSSL_X509_get_signature_type(WOLFSSL_X509*); @@ -1004,6 +1010,10 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL*, void* key, unsigned int len, WOLFSSL_API int wolfSSL_use_certificate_chain_buffer(WOLFSSL*, const unsigned char*, long); WOLFSSL_API int wolfSSL_UnloadCertsKeys(WOLFSSL*); + + #ifdef OPENSSL_EXTRA + WOLFSSL_API WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl); + #endif #endif WOLFSSL_API int wolfSSL_CTX_set_group_messages(WOLFSSL_CTX*); @@ -1635,7 +1645,6 @@ WOLFSSL_API int wolfSSL_accept_ex(WOLFSSL*, HandShakeCallBack, TimeoutCallBack, #ifdef OPENSSL_EXTRA /*lighttp compatibility */ -#ifdef HAVE_LIGHTY typedef struct WOLFSSL_X509_NAME_ENTRY { WOLFSSL_ASN1_OBJECT* object; @@ -1644,10 +1653,7 @@ typedef struct WOLFSSL_X509_NAME_ENTRY { int size; } WOLFSSL_X509_NAME_ENTRY; - -#include -#include - +#if defined(HAVE_LIGHTY) || defined(WOLFSSL_MYSQL_COMPATIBLE) WOLFSSL_API void wolfSSL_X509_NAME_free(WOLFSSL_X509_NAME *name); WOLFSSL_API char wolfSSL_CTX_use_certificate(WOLFSSL_CTX *ctx, WOLFSSL_X509 *x); WOLFSSL_API int wolfSSL_CTX_use_PrivateKey(WOLFSSL_CTX *ctx, WOLFSSL_EVP_PKEY *pkey); @@ -1672,7 +1678,8 @@ WOLFSSL_API STACK_OF(WOLFSSL_X509_NAME) *wolfSSL_dup_CA_list( STACK_OF(WOLFSSL_X #endif #endif -#if defined(HAVE_STUNNEL) || defined(HAVE_LIGHTY) +#if defined(HAVE_STUNNEL) || defined(HAVE_LIGHTY) \ + || defined(WOLFSSL_MYSQL_COMPATIBLE) WOLFSSL_API char * wolf_OBJ_nid2ln(int n); WOLFSSL_API int wolf_OBJ_txt2nid(const char *sn); From f88d82375e2dfd32b50a8ccb7f68d41f354d971a Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 28 Apr 2016 09:41:49 -0600 Subject: [PATCH 142/192] add function wolfSSL_ASN1_TIME_to_string --- src/ssl.c | 69 ++++++++++++++++++++++++++++++++++++++- wolfcrypt/src/asn.c | 51 ++++++++++++++++++----------- wolfssl/ssl.h | 4 +++ wolfssl/wolfcrypt/asn.h | 2 ++ wolfssl/wolfcrypt/types.h | 8 +++++ 5 files changed, 114 insertions(+), 20 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 411cea572..ead0271f2 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -10735,7 +10735,13 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) #ifdef OPENSSL_EXTRA /* needed for wolfSSL_X509_d21 function */ WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl) { - DerBuffer* cert = ssl->buffers.certificate; + DerBuffer* cert; + + if (ssl == NULL) { + return NULL; + } + + cert = ssl->buffers.certificate; return wolfSSL_X509_d2i(NULL, cert->buffer, cert->length); } #endif /* OPENSSL_EXTRA */ @@ -11759,6 +11765,67 @@ int wolfSSL_ASN1_TIME_print(WOLFSSL_BIO* bio, const WOLFSSL_ASN1_TIME* asnTime) } +#if defined(WOLFSSL_MYSQL_COMPATIBLE) +char* wolfSSL_ASN1_TIME_to_string(WOLFSSL_ASN1_TIME* time, char* buf, int len) +{ + struct tm t; + int idx = 0; + int format; + int dateLen; + byte* date = (byte*)time; + + WOLFSSL_ENTER("wolfSSL_ASN1_TIME_to_string"); + + if (time == NULL || buf == NULL || len < 5) { + WOLFSSL_MSG("Bad argument"); + return NULL; + } + + format = *date; date++; + dateLen = *date; date++; + if (dateLen > len) { + return "error"; + } + + if (!ExtractDate(date, format, &t, &idx)) { + return "error"; + } + + if (date[idx] != 'Z') { + WOLFSSL_MSG("UTCtime, not Zulu") ; + return "Not Zulu"; + } + + /* place month in buffer */ + buf[0] = '\0'; + switch(t.tm_mon) { + case 0: XSTRNCAT(buf, "Jan ", 4); break; + case 1: XSTRNCAT(buf, "Feb ", 4); break; + case 2: XSTRNCAT(buf, "Mar ", 4); break; + case 3: XSTRNCAT(buf, "Apr ", 4); break; + case 4: XSTRNCAT(buf, "May ", 4); break; + case 5: XSTRNCAT(buf, "Jun ", 4); break; + case 6: XSTRNCAT(buf, "Jul ", 4); break; + case 7: XSTRNCAT(buf, "Aug ", 4); break; + case 8: XSTRNCAT(buf, "Sep ", 4); break; + case 9: XSTRNCAT(buf, "Oct ", 4); break; + case 10: XSTRNCAT(buf, "Nov ", 4); break; + case 11: XSTRNCAT(buf, "Dec ", 4); break; + default: + return "error"; + + } + idx = 4; /* use idx now for char buffer */ + buf[idx] = ' '; + + XSNPRINTF(buf + idx, len - idx, "%2d %02d:%02d:%02d %d GMT", + t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, t.tm_year + 1900); + + return buf; +} +#endif /* WOLFSSL_MYSQL_COMPATIBLE */ + + int wolfSSL_ASN1_INTEGER_cmp(const WOLFSSL_ASN1_INTEGER* a, const WOLFSSL_ASN1_INTEGER* b) { diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 915776b1c..e5fc798e0 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -3000,6 +3000,35 @@ static INLINE int DateLessThan(const struct tm* a, const struct tm* b) return DateGreaterThan(b,a); } + +int ExtractDate(const unsigned char* date, unsigned char format, + struct tm* certTime, int* idx) +{ + XMEMSET(certTime, 0, sizeof(struct tm)); + + if (format == ASN_UTC_TIME) { + if (btoi(date[0]) >= 5) + certTime->tm_year = 1900; + else + certTime->tm_year = 2000; + } + else { /* format == GENERALIZED_TIME */ + certTime->tm_year += btoi(date[*idx++]) * 1000; + certTime->tm_year += btoi(date[*idx++]) * 100; + } + + /* adjust tm_year, tm_mon */ + GetTime((int*)&certTime->tm_year, date, idx); certTime->tm_year -= 1900; + GetTime((int*)&certTime->tm_mon, date, idx); certTime->tm_mon -= 1; + GetTime((int*)&certTime->tm_mday, date, idx); + GetTime((int*)&certTime->tm_hour, date, idx); + GetTime((int*)&certTime->tm_min, date, idx); + GetTime((int*)&certTime->tm_sec, date, idx); + + return 1; +} + + /* like atoi but only use first byte */ /* Make sure before and after dates are valid */ int ValidateDate(const byte* date, byte format, int dateType) @@ -3021,26 +3050,10 @@ int ValidateDate(const byte* date, byte format, int dateType) #endif ltime = XTIME(0); - XMEMSET(&certTime, 0, sizeof(certTime)); - - if (format == ASN_UTC_TIME) { - if (btoi(date[0]) >= 5) - certTime.tm_year = 1900; - else - certTime.tm_year = 2000; + if (!ExtractDate(date, format, &certTime, &i)) { + WOLFSSL_MSG("Error extracting the date"); + return 0; } - else { /* format == GENERALIZED_TIME */ - certTime.tm_year += btoi(date[i++]) * 1000; - certTime.tm_year += btoi(date[i++]) * 100; - } - - /* adjust tm_year, tm_mon */ - GetTime((int*)&certTime.tm_year, date, &i); certTime.tm_year -= 1900; - GetTime((int*)&certTime.tm_mon, date, &i); certTime.tm_mon -= 1; - GetTime((int*)&certTime.tm_mday, date, &i); - GetTime((int*)&certTime.tm_hour, date, &i); - GetTime((int*)&certTime.tm_min, date, &i); - GetTime((int*)&certTime.tm_sec, date, &i); if ((date[i] == '+') || (date[i] == '-')) { WOLFSSL_MSG("Using time differential, not Zulu") ; diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 2c20f4238..30e33fcea 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1643,6 +1643,10 @@ WOLFSSL_API int wolfSSL_accept_ex(WOLFSSL*, HandShakeCallBack, TimeoutCallBack, WOLFSSL_API void wolfSSL_cert_service(void); #endif +#if defined(WOLFSSL_MYSQL_COMPATIBLE) +WOLFSSL_API char* wolfSSL_ASN1_TIME_to_string(WOLFSSL_ASN1_TIME* time, + char* buf, int len); +#endif /* WOLFSSL_MYSQL_COMPATIBLE */ #ifdef OPENSSL_EXTRA /*lighttp compatibility */ diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index dd54ffb5b..de105ab30 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -610,6 +610,8 @@ WOLFSSL_LOCAL void FreeTrustedPeerTable(TrustedPeerCert**, int, void*); WOLFSSL_LOCAL int ToTraditional(byte* buffer, word32 length); WOLFSSL_LOCAL int ToTraditionalEnc(byte* buffer, word32 length,const char*,int); +WOLFSSL_LOCAL int ExtractDate(const unsigned char* date, unsigned char format, + struct tm* certTime, int* idx); WOLFSSL_LOCAL int ValidateDate(const byte* date, byte format, int dateType); /* ASN.1 helper functions */ diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index db9897a1d..2c134d542 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -217,6 +217,14 @@ #define XSTRNCASECMP(s1,s2,n) _strnicmp((s1),(s2),(n)) #endif + #if defined(WOLFSSL_MYSQL_COMPATIBLE) + #ifndef USE_WINDOWS_API + #define XSNPRINTF snprintf + #else + #define XSNPRINTF _snprintf + #endif + #endif /* WOLFSSL_MYSQL_COMPATIBLE */ + #if defined(WOLFSSL_CERT_EXT) || defined(HAVE_ALPN) /* use only Thread Safe version of strtok */ #ifndef USE_WINDOWS_API From 6613ebb642387f0cd58c4bbacbba8709c4c61678 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 28 Apr 2016 13:35:43 -0600 Subject: [PATCH 143/192] persistant X509 struct with ssl session --- src/internal.c | 9 ++++ src/ssl.c | 121 ++++++++++++++++++--------------------------- wolfssl/internal.h | 23 +++++++++ wolfssl/ssl.h | 8 --- 4 files changed, 81 insertions(+), 80 deletions(-) diff --git a/src/internal.c b/src/internal.c index 8694c2329..3eff4849f 100755 --- a/src/internal.c +++ b/src/internal.c @@ -643,6 +643,11 @@ void SSL_CtxResourceFree(WOLFSSL_CTX* ctx) #ifndef NO_CERTS FreeDer(&ctx->privateKey); FreeDer(&ctx->certificate); + #ifdef OPENSSL_EXTRA + if (ctx->ourCert) { + XFREE(ctx->ourCert, ctx->heap, DYNAMIC_TYPE_X509); + } + #endif FreeDer(&ctx->certChain); wolfSSL_CertManagerFree(ctx->cm); #endif @@ -1692,6 +1697,8 @@ void InitX509Name(WOLFSSL_X509_NAME* name, int dynamicFlag) name->dynamicName = 0; #ifdef OPENSSL_EXTRA XMEMSET(&name->fullName, 0, sizeof(DecodedName)); + XMEMSET(&name->cnEntry, 0, sizeof(WOLFSSL_X509_NAME_ENTRY)); + name->x509 = NULL; #endif /* OPENSSL_EXTRA */ } } @@ -4846,6 +4853,7 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert) XMEMCPY(x509->issuer.fullName.fullName, dCert->issuerName.fullName, dCert->issuerName.fullNameLen); } + x509->issuer.x509 = x509; #endif /* OPENSSL_EXTRA */ XSTRNCPY(x509->subject.name, dCert->subject, ASN_NAME_MAX); @@ -4861,6 +4869,7 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert) XMEMCPY(x509->subject.fullName.fullName, dCert->subjectName.fullName, dCert->subjectName.fullNameLen); } + x509->subject.x509 = x509; #endif /* OPENSSL_EXTRA */ XMEMCPY(x509->serial, dCert->serial, EXTERNAL_SERIAL_SIZE); diff --git a/src/ssl.c b/src/ssl.c index ead0271f2..0a16cf123 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -3469,13 +3469,33 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, /* Make sure previous is free'd */ if (ssl->buffers.weOwnCert) { FreeDer(&ssl->buffers.certificate); + #ifdef OPENSSL_EXTRA + if (ssl->ourCert) { + XFREE(ssl->ourCert, ssl->heap, DYNAMIC_TYPE_X509); + } + #endif } XMEMCPY(&ssl->buffers.certificate, &der, sizeof(der)); + #ifdef OPENSSL_EXTRA + ssl->ourCert = wolfSSL_X509_d2i(NULL, + ssl->buffers.certificate->buffer, + ssl->buffers.certificate->length); + #endif ssl->buffers.weOwnCert = 1; } else if (ctx) { FreeDer(&ctx->certificate); /* Make sure previous is free'd */ + #ifdef OPENSSL_EXTRA + if (ctx->ourCert) { + XFREE(ctx->ourCert, ctx->heap, DYNAMIC_TYPE_X509); + } + #endif XMEMCPY(&ctx->certificate, &der, sizeof(der)); + #ifdef OPENSSL_EXTRA + ctx->ourCert = wolfSSL_X509_d2i(NULL, + ctx->certificate->buffer, + ctx->certificate->length); + #endif } } else if (type == PRIVATEKEY_TYPE) { @@ -8021,6 +8041,11 @@ int wolfSSL_set_compression(WOLFSSL* ssl) if (ssl->buffers.weOwnCert) { WOLFSSL_MSG("Unloading cert"); FreeDer(&ssl->buffers.certificate); + #ifdef OPENSSL_EXTRA + if (ssl->ourCert) { + XFREE(ssl->ourCert, ssl->heap, DYNAMIC_TYPE_X509); + } + #endif ssl->buffers.weOwnCert = 0; } @@ -10280,10 +10305,11 @@ static void ExternalFreeX509(WOLFSSL_X509* x509) } - WOLFSSL_ASN1_STRING* wolfSSL_X509_NAME_ENTRY_get_data(WOLFSSL_X509_NAME_ENTRY* in) + WOLFSSL_ASN1_STRING* wolfSSL_X509_NAME_ENTRY_get_data( + WOLFSSL_X509_NAME_ENTRY* in) { WOLFSSL_ENTER("wolfSSL_X509_NAME_ENTRY_get_data"); - return in->value; + return &in->value; } @@ -10735,14 +10761,21 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) #ifdef OPENSSL_EXTRA /* needed for wolfSSL_X509_d21 function */ WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl) { - DerBuffer* cert; - if (ssl == NULL) { return NULL; } - cert = ssl->buffers.certificate; - return wolfSSL_X509_d2i(NULL, cert->buffer, cert->length); + if (ssl->buffers.weOwnCert) { + return ssl->ourCert; + } + else { /* if cert not owned get parent ctx cert or return null */ + if (ssl->ctx) { + return ssl->ctx->ourCert; + } + else { + return NULL; + } + } } #endif /* OPENSSL_EXTRA */ #endif /* NO_CERTS */ @@ -17169,15 +17202,10 @@ void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl) return NULL; } - WOLFSSL_X509_NAME_ENTRY *wolfSSL_X509_NAME_get_entry(WOLFSSL_X509_NAME *name, int loc) { + WOLFSSL_X509_NAME_ENTRY *wolfSSL_X509_NAME_get_entry( + WOLFSSL_X509_NAME *name, int loc) { int maxLoc = name->fullName.fullNameLen; - char* data = NULL; - int length; - int type; - - WOLFSSL_ASN1_STRING* asnStr; - WOLFSSL_X509_NAME_ENTRY* ret; WOLFSSL_ENTER("wolfSSL_X509_NAME_get_entry"); @@ -17186,74 +17214,23 @@ void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl) return NULL; } - ret = XMALLOC(sizeof(WOLFSSL_X509_NAME_ENTRY), NULL, DYNAMIC_TYPE_X509); - if (ret == NULL) { - return ret; - } - asnStr = XMALLOC(sizeof(WOLFSSL_ASN1_STRING), NULL, - DYNAMIC_TYPE_X509); - if (asnStr == NULL) { - XFREE(ret, NULL, DYNAMIC_TYPE_X509); - ret = NULL; - } - - /* initialize both structures */ - XMEMSET(ret, 0, sizeof(WOLFSSL_X509_NAME_ENTRY)); - XMEMSET(asnStr, 0, sizeof(WOLFSSL_ASN1_STRING)); - /* common name index case */ if (loc == name->fullName.cnIdx) { - length = name->fullName.cnLen; - data = name->fullName.fullName + loc; - type = ASN_COMMON_NAME; + /* get CN shortcut from x509 since it has null terminator */ + name->cnEntry.value.data = name->x509->subjectCN; + name->cnEntry.value.length = name->fullName.cnLen; + name->cnEntry.value.type = ASN_COMMON_NAME; + name->cnEntry.set = 1; + return &(name->cnEntry); } /* additionall cases to check for go here */ - - if (data == NULL) { - WOLFSSL_MSG("Index not found"); - XFREE(asnStr, NULL, DYNAMIC_TYPE_X509); - XFREE(ret, NULL, DYNAMIC_TYPE_X509); - ret = NULL; - } - else { - asnStr->data = XMALLOC(length + 1, NULL, DYNAMIC_TYPE_X509); - if (asnStr->data == NULL) { - XFREE(asnStr, NULL, DYNAMIC_TYPE_X509); - XFREE(ret, NULL, DYNAMIC_TYPE_X509); - ret = NULL; - } - - /* check bounds before copying from fullName */ - if (loc + length > maxLoc) { - XFREE(asnStr, NULL, DYNAMIC_TYPE_X509); - XFREE(ret, NULL, DYNAMIC_TYPE_X509); - ret = NULL; - } - - if (ret != NULL) { - XMEMCPY(asnStr->data, data, length); - asnStr->data[length] = 0; - asnStr->length = length; - asnStr->type = type; - asnStr->flags = 0; - - ret->object = NULL; - ret->value = asnStr; - ret->set = 1; - ret->size = asnStr->length + sizeof(WOLFSSL_ASN1_STRING) + - sizeof(WOLFSSL_X509_NAME_ENTRY); - } - } - + WOLFSSL_MSG("Entry not found or implemented"); (void)name; (void)loc; - (void)data; - (void)type; - (void)length; - return ret; + return NULL; } #ifndef NO_CERTS diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 507f152e1..77a070a0e 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -45,6 +45,9 @@ #endif #ifndef NO_ASN #include + #ifdef OPENSSL_EXTRA + #include /* for asn1 string and bit struct */ + #endif #endif #ifndef NO_MD5 #include @@ -1898,6 +1901,9 @@ struct WOLFSSL_CTX { /* chain after self, in DER, with leading size for each cert */ DerBuffer* privateKey; WOLFSSL_CERT_MANAGER* cm; /* our cert manager, ctx owns SSL will use */ +#endif +#ifdef OPENSSL_EXTRA + WOLFSSL_X509* ourCert; /* keep alive a X509 struct of cert */ #endif Suites* suites; /* make dynamic, user may not need/set */ void* heap; /* for user memory overrides */ @@ -2432,6 +2438,16 @@ typedef struct Arrays { #define MAX_DATE_SZ 32 #endif +#ifdef OPENSSL_EXTRA +struct WOLFSSL_X509_NAME_ENTRY { + WOLFSSL_ASN1_OBJECT* object; /* not defined yet */ + WOLFSSL_ASN1_STRING value; + int set; + int size; +}; +#endif /* OPENSSL_EXTRA */ + + struct WOLFSSL_X509_NAME { char *name; char staticName[ASN_NAME_MAX]; @@ -2439,6 +2455,8 @@ struct WOLFSSL_X509_NAME { int sz; #if defined(OPENSSL_EXTRA) && !defined(NO_ASN) DecodedName fullName; + WOLFSSL_X509_NAME_ENTRY cnEntry; + WOLFSSL_X509* x509; /* x509 that struct belongs to */ #endif /* OPENSSL_EXTRA */ }; @@ -2717,6 +2735,11 @@ struct WOLFSSL { #ifdef KEEP_PEER_CERT WOLFSSL_X509 peerCert; /* X509 peer cert */ #endif +#ifdef OPENSSL_EXTRA + WOLFSSL_X509* ourCert; /* keep alive a X509 struct of cert. + points to ctx if not owned (owned + flag found in buffers.weOwnCert) */ +#endif #if defined(FORTRESS) || defined(HAVE_STUNNEL) void* ex_data[MAX_EX_DATA]; /* external data, for Fortress */ #endif diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 30e33fcea..ee45e6224 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1649,14 +1649,6 @@ WOLFSSL_API char* wolfSSL_ASN1_TIME_to_string(WOLFSSL_ASN1_TIME* time, #endif /* WOLFSSL_MYSQL_COMPATIBLE */ #ifdef OPENSSL_EXTRA /*lighttp compatibility */ - -typedef struct WOLFSSL_X509_NAME_ENTRY { - WOLFSSL_ASN1_OBJECT* object; - WOLFSSL_ASN1_STRING* value; - int set; - int size; -} WOLFSSL_X509_NAME_ENTRY; - #if defined(HAVE_LIGHTY) || defined(WOLFSSL_MYSQL_COMPATIBLE) WOLFSSL_API void wolfSSL_X509_NAME_free(WOLFSSL_X509_NAME *name); WOLFSSL_API char wolfSSL_CTX_use_certificate(WOLFSSL_CTX *ctx, WOLFSSL_X509 *x); From bd4e8ac71490beecb1f9fa912a39a0618cca4d28 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 28 Apr 2016 22:45:54 -0600 Subject: [PATCH 144/192] cipher name string format --- src/internal.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/ssl.c | 6 ++++++ wolfssl/internal.h | 1 + wolfssl/openssl/ssl.h | 10 ++++++---- wolfssl/ssl.h | 1 + 5 files changed, 54 insertions(+), 4 deletions(-) diff --git a/src/internal.c b/src/internal.c index 3eff4849f..f9ba832af 100755 --- a/src/internal.c +++ b/src/internal.c @@ -11121,6 +11121,46 @@ int GetCipherNamesSize(void) return (int)(sizeof(cipher_names) / sizeof(char*)); } +/* gets cipher name in the format DHE-RSA-... rather then TLS_DHE... */ +const char* wolfSSL_get_cipher_name_internal(WOLFSSL* ssl) +{ + const char* fullName; + const char* first; + WOLFSSL_CIPHER* cipher; + word32 i; + + if (ssl == NULL) { + WOLFSSL_MSG("Bad argument"); + return NULL; + } + + cipher = wolfSSL_get_current_cipher(ssl); + fullName = wolfSSL_CIPHER_get_name(cipher); + if (fullName) { + first = (XSTRSTR(fullName, "CHACHA")) ? "CHACHA" + : (XSTRSTR(fullName, "EC")) ? "EC" + : (XSTRSTR(fullName, "CCM")) ? "CCM" + : NULL; /* normal */ + + for (i = 0; i < sizeof(cipher_name_idx); i++) { + if (cipher_name_idx[i] == ssl->options.cipherSuite) { + const char* nameFound = cipher_names[i]; + + /* if first is null then not any */ + if (first == NULL && !XSTRSTR(nameFound, "CHACHA") && + !XSTRSTR(nameFound, "EC") && !XSTRSTR(nameFound, "CCM")) { + return cipher_names[i]; + } + else if (XSTRSTR(nameFound, first)) { + return cipher_names[i]; + } + } + } + } + + return NULL; /* error or not found */ +} + /** Set the enabled cipher suites. diff --git a/src/ssl.c b/src/ssl.c index 0a16cf123..ab0a958b1 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -11272,6 +11272,12 @@ const char* wolfSSL_get_cipher(WOLFSSL* ssl) return wolfSSL_CIPHER_get_name(wolfSSL_get_current_cipher(ssl)); } +/* gets cipher name in the format DHE-RSA-... rather then TLS_DHE... */ +const char* wolfSSL_get_cipher_name(WOLFSSL* ssl) +{ + /* get access to cipher_name_idx in internal.c */ + return wolfSSL_get_cipher_name_internal(ssl); +} #ifdef OPENSSL_EXTRA diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 77a070a0e..20791338b 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -3064,6 +3064,7 @@ WOLFSSL_LOCAL void c32to24(word32 in, word24 out); WOLFSSL_LOCAL const char* const* GetCipherNames(void); WOLFSSL_LOCAL int GetCipherNamesSize(void); +WOLFSSL_LOCAL const char* wolfSSL_get_cipher_name_internal(WOLFSSL* ssl); enum encrypt_side { diff --git a/wolfssl/openssl/ssl.h b/wolfssl/openssl/ssl.h index ce6865909..c4672ef0b 100644 --- a/wolfssl/openssl/ssl.h +++ b/wolfssl/openssl/ssl.h @@ -185,12 +185,14 @@ typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX; #define SSL_SESSION_free wolfSSL_SESSION_free #define SSL_is_init_finished wolfSSL_is_init_finished -#define SSL_get_version wolfSSL_get_version +#define SSL_get_version wolfSSL_get_version #define SSL_get_current_cipher wolfSSL_get_current_cipher -#define SSL_get_cipher wolfSSL_get_cipher + +/* use wolfSSL_get_cipher_name for its return format */ +#define SSL_get_cipher wolfSSL_get_cipher_name #define SSL_CIPHER_description wolfSSL_CIPHER_description -#define SSL_CIPHER_get_name wolfSSL_CIPHER_get_name -#define SSL_get1_session wolfSSL_get1_session +#define SSL_CIPHER_get_name wolfSSL_CIPHER_get_name +#define SSL_get1_session wolfSSL_get1_session #define SSL_get_keyblock_size wolfSSL_get_keyblock_size #define SSL_get_keys wolfSSL_get_keys diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index ee45e6224..54ab02125 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -267,6 +267,7 @@ WOLFSSL_API WOLFSSL* wolfSSL_new(WOLFSSL_CTX*); WOLFSSL_API int wolfSSL_set_fd (WOLFSSL*, int); WOLFSSL_API char* wolfSSL_get_cipher_list(int priority); WOLFSSL_API int wolfSSL_get_ciphers(char*, int); +WOLFSSL_API const char* wolfSSL_get_cipher_name(WOLFSSL* ssl); WOLFSSL_API int wolfSSL_get_fd(const WOLFSSL*); WOLFSSL_API void wolfSSL_set_using_nonblock(WOLFSSL*, int); WOLFSSL_API int wolfSSL_get_using_nonblock(WOLFSSL*); From 38bbd41f992b7d496ea1deda8c6711ccf13bd2ec Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 29 Apr 2016 09:17:12 -0600 Subject: [PATCH 145/192] add EDH-RSA-AES256-SHA, used in one mysql test --- src/internal.c | 24 ++++++++++++++++++++++++ src/keys.c | 17 +++++++++++++++++ tests/test.conf | 16 ++++++++++++++++ wolfssl/internal.h | 4 ++++ 4 files changed, 61 insertions(+) diff --git a/src/internal.c b/src/internal.c index f9ba832af..d3543883e 100755 --- a/src/internal.c +++ b/src/internal.c @@ -1300,6 +1300,13 @@ void InitSuites(Suites* suites, ProtocolVersion pv, word16 haveRSA, } #endif +#ifdef BUILD_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA + if (tls && haveDH && haveRSA) { + suites->suites[idx++] = 0; + suites->suites[idx++] = TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA; + } +#endif + #ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 if (tls1_2 && haveDH && haveRSA) { suites->suites[idx++] = 0; @@ -4731,6 +4738,15 @@ static int BuildFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender) if (requirement == REQUIRES_DHE) return 1; break; + + case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA: + if (requirement == REQUIRES_RSA) + return 1; + if (requirement == REQUIRES_RSA_SIG) + return 1; + if (requirement == REQUIRES_DHE) + return 1; + break; #endif #ifdef HAVE_ANON case TLS_DH_anon_WITH_AES_128_CBC_SHA : @@ -10667,6 +10683,10 @@ static const char* const cipher_names[] = #ifdef BUILD_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 "DHE-PSK-CHACHA20-POLY1305", #endif + +#ifdef BUILD_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA + "EDH-RSA-DES-CBC3-SHA", +#endif }; @@ -11105,6 +11125,10 @@ static int cipher_name_idx[] = #ifdef BUILD_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256, #endif + +#ifdef BUILD_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA + TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, +#endif }; diff --git a/src/keys.c b/src/keys.c index 4fe8ef68d..849636ee1 100644 --- a/src/keys.c +++ b/src/keys.c @@ -1551,6 +1551,23 @@ int SetCipherSpecs(WOLFSSL* ssl) break; #endif +#ifdef BUILD_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA + case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA : + ssl->specs.bulk_cipher_algorithm = wolfssl_triple_des; + ssl->specs.cipher_type = block; + ssl->specs.mac_algorithm = sha_mac; + ssl->specs.kea = diffie_hellman_kea; + ssl->specs.sig_algo = rsa_sa_algo; + ssl->specs.hash_size = SHA_DIGEST_SIZE; + ssl->specs.pad_size = PAD_SHA; + ssl->specs.static_ecdh = 0; + ssl->specs.key_size = DES3_KEY_SIZE; + ssl->specs.block_size = DES_BLOCK_SIZE; + ssl->specs.iv_size = DES_IV_SIZE; + + break; +#endif + #ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 : ssl->specs.bulk_cipher_algorithm = wolfssl_aes; diff --git a/tests/test.conf b/tests/test.conf index 1bd560de9..40beed1cc 100644 --- a/tests/test.conf +++ b/tests/test.conf @@ -1126,6 +1126,22 @@ -v 2 -l DHE-RSA-AES256-SHA256 +# server TLSv1.1 DHE 3DES +-v 2 +-l EDH-RSA-DES-CBC3-SHA + +# client TLSv1.1 DHE 3DES +-v 2 +-l EDH-RSA-DES-CBC3-SHA + +# server TLSv1.2 DHE 3DES +-v 3 +-l EDH-RSA-DES-CBC3-SHA + +# client TLSv1.2 DHE 3DES +-v 3 +-l EDH-RSA-DES-CBC3-SHA + # server TLSv1.2 DHE AES128 -v 3 -l DHE-RSA-AES128-SHA diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 20791338b..1de9c874f 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -398,6 +398,9 @@ typedef byte word24[3]; #if !defined(NO_SHA) #define BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA #define BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA + #if !defined(NO_DES3) + #define BUILD_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA + #endif #endif #if !defined(NO_SHA256) #define BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 @@ -703,6 +706,7 @@ typedef byte word24[3]; /* actual cipher values, 2nd byte */ enum { + TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x16, TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x39, TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x33, TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x34, From 05e56b75f68e32ddda843620f63dd22f5930d4c6 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 29 Apr 2016 11:39:09 -0600 Subject: [PATCH 146/192] scan-build, valgrind issues and fix issue with ExtractDate, struct tm --- src/internal.c | 12 ++++++++++-- src/ssl.c | 3 +++ tests/api.c | 1 + wolfcrypt/src/asn.c | 4 ++-- wolfssl/wolfcrypt/asn.h | 5 +++-- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/internal.c b/src/internal.c index d3543883e..0201261ef 100755 --- a/src/internal.c +++ b/src/internal.c @@ -644,6 +644,7 @@ void SSL_CtxResourceFree(WOLFSSL_CTX* ctx) FreeDer(&ctx->privateKey); FreeDer(&ctx->certificate); #ifdef OPENSSL_EXTRA + FreeX509(ctx->ourCert); if (ctx->ourCert) { XFREE(ctx->ourCert, ctx->heap, DYNAMIC_TYPE_X509); } @@ -11170,10 +11171,17 @@ const char* wolfSSL_get_cipher_name_internal(WOLFSSL* ssl) if (cipher_name_idx[i] == ssl->options.cipherSuite) { const char* nameFound = cipher_names[i]; + /* extra sanity check on returned cipher name */ + if (nameFound == NULL) { + continue; + } + /* if first is null then not any */ - if (first == NULL && !XSTRSTR(nameFound, "CHACHA") && + if (first == NULL) { + if (!XSTRSTR(nameFound, "CHACHA") && !XSTRSTR(nameFound, "EC") && !XSTRSTR(nameFound, "CCM")) { - return cipher_names[i]; + return cipher_names[i]; + } } else if (XSTRSTR(nameFound, first)) { return cipher_names[i]; diff --git a/src/ssl.c b/src/ssl.c index ab0a958b1..84aba0757 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -3470,6 +3470,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, if (ssl->buffers.weOwnCert) { FreeDer(&ssl->buffers.certificate); #ifdef OPENSSL_EXTRA + FreeX509(ssl->ourCert); if (ssl->ourCert) { XFREE(ssl->ourCert, ssl->heap, DYNAMIC_TYPE_X509); } @@ -3486,6 +3487,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, else if (ctx) { FreeDer(&ctx->certificate); /* Make sure previous is free'd */ #ifdef OPENSSL_EXTRA + FreeX509(ctx->ourCert); if (ctx->ourCert) { XFREE(ctx->ourCert, ctx->heap, DYNAMIC_TYPE_X509); } @@ -8042,6 +8044,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) WOLFSSL_MSG("Unloading cert"); FreeDer(&ssl->buffers.certificate); #ifdef OPENSSL_EXTRA + FreeX509(ssl->ourCert); if (ssl->ourCert) { XFREE(ssl->ourCert, ssl->heap, DYNAMIC_TYPE_X509); } diff --git a/tests/api.c b/tests/api.c index 630588d75..9e6932941 100644 --- a/tests/api.c +++ b/tests/api.c @@ -1703,6 +1703,7 @@ static void test_wolfSSL_X509_NAME_get_entry(void) subCN = (char*)ASN1_STRING_data(asn); AssertNotNull(subCN); + wolfSSL_FreeX509(x509); #endif } diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index e5fc798e0..17d3aa7eb 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -3013,8 +3013,8 @@ int ExtractDate(const unsigned char* date, unsigned char format, certTime->tm_year = 2000; } else { /* format == GENERALIZED_TIME */ - certTime->tm_year += btoi(date[*idx++]) * 1000; - certTime->tm_year += btoi(date[*idx++]) * 100; + certTime->tm_year += btoi(date[*idx]) * 1000; *idx = *idx + 1; + certTime->tm_year += btoi(date[*idx]) * 100; *idx = *idx + 1; } /* adjust tm_year, tm_mon */ diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index de105ab30..f581f27a9 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -59,7 +59,6 @@ extern "C" { #endif - enum { ISSUER = 0, SUBJECT = 1, @@ -610,8 +609,10 @@ WOLFSSL_LOCAL void FreeTrustedPeerTable(TrustedPeerCert**, int, void*); WOLFSSL_LOCAL int ToTraditional(byte* buffer, word32 length); WOLFSSL_LOCAL int ToTraditionalEnc(byte* buffer, word32 length,const char*,int); +typedef struct tm wolfssl_tm; + WOLFSSL_LOCAL int ExtractDate(const unsigned char* date, unsigned char format, - struct tm* certTime, int* idx); + wolfssl_tm* certTime, int* idx); WOLFSSL_LOCAL int ValidateDate(const byte* date, byte format, int dateType); /* ASN.1 helper functions */ From d1ab51e10f05c61f574eaab79052b87d3bbfb0e0 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 29 Apr 2016 16:47:10 -0600 Subject: [PATCH 147/192] maintain lighttpd port --- src/internal.c | 1 + src/ssl.c | 8 ++++---- wolfssl/internal.h | 13 ------------- wolfssl/ssl.h | 10 ++++++++++ 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/internal.c b/src/internal.c index 0201261ef..6cb32e43c 100755 --- a/src/internal.c +++ b/src/internal.c @@ -1706,6 +1706,7 @@ void InitX509Name(WOLFSSL_X509_NAME* name, int dynamicFlag) #ifdef OPENSSL_EXTRA XMEMSET(&name->fullName, 0, sizeof(DecodedName)); XMEMSET(&name->cnEntry, 0, sizeof(WOLFSSL_X509_NAME_ENTRY)); + name->cnEntry.value = &(name->cnEntry.data); /* point to internal data*/ name->x509 = NULL; #endif /* OPENSSL_EXTRA */ } diff --git a/src/ssl.c b/src/ssl.c index 84aba0757..ce35375c3 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -10312,7 +10312,7 @@ static void ExternalFreeX509(WOLFSSL_X509* x509) WOLFSSL_X509_NAME_ENTRY* in) { WOLFSSL_ENTER("wolfSSL_X509_NAME_ENTRY_get_data"); - return &in->value; + return in->value; } @@ -17226,9 +17226,9 @@ void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl) /* common name index case */ if (loc == name->fullName.cnIdx) { /* get CN shortcut from x509 since it has null terminator */ - name->cnEntry.value.data = name->x509->subjectCN; - name->cnEntry.value.length = name->fullName.cnLen; - name->cnEntry.value.type = ASN_COMMON_NAME; + name->cnEntry.data.data = name->x509->subjectCN; + name->cnEntry.data.length = name->fullName.cnLen; + name->cnEntry.data.type = ASN_COMMON_NAME; name->cnEntry.set = 1; return &(name->cnEntry); } diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 1de9c874f..ed05d313e 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -45,9 +45,6 @@ #endif #ifndef NO_ASN #include - #ifdef OPENSSL_EXTRA - #include /* for asn1 string and bit struct */ - #endif #endif #ifndef NO_MD5 #include @@ -2442,16 +2439,6 @@ typedef struct Arrays { #define MAX_DATE_SZ 32 #endif -#ifdef OPENSSL_EXTRA -struct WOLFSSL_X509_NAME_ENTRY { - WOLFSSL_ASN1_OBJECT* object; /* not defined yet */ - WOLFSSL_ASN1_STRING value; - int set; - int size; -}; -#endif /* OPENSSL_EXTRA */ - - struct WOLFSSL_X509_NAME { char *name; char staticName[ASN_NAME_MAX]; diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 54ab02125..ceea78c31 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1650,6 +1650,16 @@ WOLFSSL_API char* wolfSSL_ASN1_TIME_to_string(WOLFSSL_ASN1_TIME* time, #endif /* WOLFSSL_MYSQL_COMPATIBLE */ #ifdef OPENSSL_EXTRA /*lighttp compatibility */ + +#include +struct WOLFSSL_X509_NAME_ENTRY { + WOLFSSL_ASN1_OBJECT* object; /* not defined yet */ + WOLFSSL_ASN1_STRING data; + WOLFSSL_ASN1_STRING* value; /* points to data, for lighttpd port */ + int set; + int size; +}; + #if defined(HAVE_LIGHTY) || defined(WOLFSSL_MYSQL_COMPATIBLE) WOLFSSL_API void wolfSSL_X509_NAME_free(WOLFSSL_X509_NAME *name); WOLFSSL_API char wolfSSL_CTX_use_certificate(WOLFSSL_CTX *ctx, WOLFSSL_X509 *x); From b2325aad6d0b4269351e84252bec05ccb4fce2dc Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 2 May 2016 17:19:25 -0600 Subject: [PATCH 148/192] option to keepCert for ssl lifetime, refactor of ourCert process --- src/internal.c | 1 + src/ssl.c | 25 +++++++++++++++---------- wolfssl/internal.h | 1 + wolfssl/test.h | 19 +++++++++++++++---- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/internal.c b/src/internal.c index 6cb32e43c..bf78a27a3 100755 --- a/src/internal.c +++ b/src/internal.c @@ -2592,6 +2592,7 @@ void SSL_ResourceFree(WOLFSSL* ssl) } #endif #ifndef NO_CERTS + ssl->keepCert = 0; /* make sure certificate is free'd */ wolfSSL_UnloadCertsKeys(ssl); #endif #ifndef NO_RSA diff --git a/src/ssl.c b/src/ssl.c index ce35375c3..f4c7eb628 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -81,7 +81,6 @@ #include #include #include - #include #ifdef HAVE_STUNNEL #include #endif /* WITH_STUNNEL */ @@ -3473,14 +3472,13 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, FreeX509(ssl->ourCert); if (ssl->ourCert) { XFREE(ssl->ourCert, ssl->heap, DYNAMIC_TYPE_X509); + ssl->ourCert = NULL; } #endif } XMEMCPY(&ssl->buffers.certificate, &der, sizeof(der)); #ifdef OPENSSL_EXTRA - ssl->ourCert = wolfSSL_X509_d2i(NULL, - ssl->buffers.certificate->buffer, - ssl->buffers.certificate->length); + ssl->keepCert = 1; /* hold cert for ssl lifetime */ #endif ssl->buffers.weOwnCert = 1; } @@ -3490,14 +3488,10 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, FreeX509(ctx->ourCert); if (ctx->ourCert) { XFREE(ctx->ourCert, ctx->heap, DYNAMIC_TYPE_X509); + ctx->ourCert = NULL; } #endif XMEMCPY(&ctx->certificate, &der, sizeof(der)); - #ifdef OPENSSL_EXTRA - ctx->ourCert = wolfSSL_X509_d2i(NULL, - ctx->certificate->buffer, - ctx->certificate->length); - #endif } } else if (type == PRIVATEKEY_TYPE) { @@ -8040,13 +8034,14 @@ int wolfSSL_set_compression(WOLFSSL* ssl) return BAD_FUNC_ARG; } - if (ssl->buffers.weOwnCert) { + if (ssl->buffers.weOwnCert && !ssl->keepCert) { WOLFSSL_MSG("Unloading cert"); FreeDer(&ssl->buffers.certificate); #ifdef OPENSSL_EXTRA FreeX509(ssl->ourCert); if (ssl->ourCert) { XFREE(ssl->ourCert, ssl->heap, DYNAMIC_TYPE_X509); + ssl->ourCert = NULL; } #endif ssl->buffers.weOwnCert = 0; @@ -10769,10 +10764,20 @@ WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl) } if (ssl->buffers.weOwnCert) { + if (ssl->ourCert == NULL) { + ssl->ourCert = wolfSSL_X509_d2i(NULL, + ssl->buffers.certificate->buffer, + ssl->buffers.certificate->length); + } return ssl->ourCert; } else { /* if cert not owned get parent ctx cert or return null */ if (ssl->ctx) { + if (ssl->ctx->ourCert == NULL) { + ssl->ctx->ourCert = wolfSSL_X509_d2i(NULL, + ssl->ctx->certificate->buffer, + ssl->ctx->certificate->length); + } return ssl->ctx->ourCert; } else { diff --git a/wolfssl/internal.h b/wolfssl/internal.h index ed05d313e..d24f3fce7 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -2731,6 +2731,7 @@ struct WOLFSSL { points to ctx if not owned (owned flag found in buffers.weOwnCert) */ #endif + byte keepCert; /* keep certificate after handshake */ #if defined(FORTRESS) || defined(HAVE_STUNNEL) void* ex_data[MAX_EX_DATA]; /* external data, for Fortress */ #endif diff --git a/wolfssl/test.h b/wolfssl/test.h index 055222254..8c0468660 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -441,14 +441,22 @@ static INLINE int PasswordCallBack(char* passwd, int sz, int rw, void* userdata) static INLINE void ShowX509(WOLFSSL_X509* x509, const char* hdr) { char* altName; - char* issuer = wolfSSL_X509_NAME_oneline( - wolfSSL_X509_get_issuer_name(x509), 0, 0); - char* subject = wolfSSL_X509_NAME_oneline( - wolfSSL_X509_get_subject_name(x509), 0, 0); + char* issuer; + char* subject; byte serial[32]; int ret; int sz = sizeof(serial); + if (x509 == NULL) { + printf("%s No Cert\n", hdr); + return; + } + + issuer = wolfSSL_X509_NAME_oneline( + wolfSSL_X509_get_issuer_name(x509), 0, 0); + subject = wolfSSL_X509_NAME_oneline( + wolfSSL_X509_get_subject_name(x509), 0, 0); + printf("%s\n issuer : %s\n subject: %s\n", hdr, issuer, subject); while ( (altName = wolfSSL_X509_get_next_altname(x509)) != NULL) @@ -487,6 +495,9 @@ static INLINE void showPeer(WOLFSSL* ssl) printf("peer has no cert!\n"); wolfSSL_FreeX509(peer); #endif +#if defined(SHOW_CERTS) && defined(OPENSSL_EXTRA) + ShowX509(wolfSSL_get_certificate(ssl), "our cert info:"); +#endif /* SHOW_CERTS */ printf("SSL version is %s\n", wolfSSL_get_version(ssl)); cipher = wolfSSL_get_current_cipher(ssl); From 4b166000118784af14f8999d6482e0228e900d34 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Tue, 3 May 2016 13:52:04 -0600 Subject: [PATCH 149/192] fix type comparison on 32bit for starttls, zero tmp buffer --- examples/client/client.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 55bc68476..46b08304f 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -344,6 +344,8 @@ int StartTLS_Init(SOCKET_T* sockfd) if (sockfd == NULL) return BAD_FUNC_ARG; + XMEMSET(tmpBuf, 0, sizeof(tmpBuf)); + /* S: 220 SMTP service ready */ if (recv(*sockfd, tmpBuf, sizeof(tmpBuf), 0) < 0) err_sys("failed to read STARTTLS command\n"); @@ -357,7 +359,7 @@ int StartTLS_Init(SOCKET_T* sockfd) /* C: EHLO mail.example.com */ if (send(*sockfd, starttlsCmd[1], (int)XSTRLEN(starttlsCmd[1]), 0) != - (word32)XSTRLEN(starttlsCmd[1])) + (int)XSTRLEN(starttlsCmd[1])) err_sys("failed to send STARTTLS EHLO command\n"); /* S: 250 offers a warm hug of welcome */ @@ -373,7 +375,7 @@ int StartTLS_Init(SOCKET_T* sockfd) /* C: STARTTLS */ if (send(*sockfd, starttlsCmd[3], (int)XSTRLEN(starttlsCmd[3]), 0) != - (word32)XSTRLEN(starttlsCmd[3])) { + (int)XSTRLEN(starttlsCmd[3])) { err_sys("failed to send STARTTLS command\n"); } From d184f8b1aa81818d60cd530829b1c0e95bc59fc5 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Tue, 3 May 2016 16:43:25 -0600 Subject: [PATCH 150/192] wolfSSL embOS port Initialize self-review complete Removed autogenerated files --- IDE/IAR-EWARM/embOS/README | 23 + IDE/IAR-EWARM/embOS/README_SAMV71 | 104 + IDE/IAR-EWARM/embOS/README_custom_port | 215 ++ .../samv71q21_wolfssl.icf | 57 + .../user_settings.h | 67 + .../user_settings_simple_example.h | 43 + .../user_settings_verbose_example.h | 208 ++ .../Application/runBenchmarks.c | 31 + .../wolfcrypt_benchmark.Debug.driver.xcl | 33 + .../wolfcrypt_benchmark.Debug.general.xcl | 13 + .../settings/wolfcrypt_benchmark.crun | 16 + .../settings/wolfcrypt_benchmark.dbgdt | 115 + .../settings/wolfcrypt_benchmark.dni | 134 + .../settings/wolfcrypt_benchmark_Debug.jlink | 39 + .../wolfcrypt_benchmark.dep | 719 ++++ .../wolfcrypt_benchmark.ewd | 3163 +++++++++++++++++ .../wolfcrypt_benchmark.ewp | 1995 +++++++++++ .../wolfcrypt_benchmark.ewt | 2382 +++++++++++++ .../settings/wolfcrypt_lib.Debug.driver.xcl | 13 + .../settings/wolfcrypt_lib.Debug.general.xcl | 11 + .../settings/wolfcrypt_lib.crun | 16 + .../settings/wolfcrypt_lib.dbgdt | 5 + .../settings/wolfcrypt_lib.dni | 45 + .../wolfcrypt_lib.dep | 906 +++++ .../wolfcrypt_lib.ewd | 3163 +++++++++++++++++ .../wolfcrypt_lib.ewp | 2010 +++++++++++ .../wolfcrypt_lib.ewt | 2400 +++++++++++++ .../Application/runWolfcryptTests.c | 31 + .../settings/wolfcrypt_test.Debug.driver.xcl | 33 + .../settings/wolfcrypt_test.Debug.general.xcl | 13 + .../settings/wolfcrypt_test.crun | 16 + .../settings/wolfcrypt_test.dbgdt | 115 + .../settings/wolfcrypt_test.dni | 134 + .../settings/wolfcrypt_test_Debug.jlink | 39 + .../wolfcrypt_test.dep | 1031 ++++++ .../wolfcrypt_test.ewd | 3163 +++++++++++++++++ .../wolfcrypt_test.ewp | 1995 +++++++++++ .../wolfcrypt_test.ewt | 2382 +++++++++++++ wolfcrypt/benchmark/benchmark.c | 16 + wolfcrypt/src/random.c | 6 +- wolfssl/ssl.h | 3 +- wolfssl/wolfcrypt/settings.h | 11 + 42 files changed, 26911 insertions(+), 3 deletions(-) create mode 100644 IDE/IAR-EWARM/embOS/README create mode 100644 IDE/IAR-EWARM/embOS/README_SAMV71 create mode 100644 IDE/IAR-EWARM/embOS/README_custom_port create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_Linker_Script/samv71q21_wolfssl.icf create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings.h create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings_simple_example.h create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings_verbose_example.h create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/Application/runBenchmarks.c create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.driver.xcl create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.general.xcl create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.crun create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dbgdt create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dni create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark_Debug.jlink create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.dep create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewd create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewp create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewt create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.Debug.driver.xcl create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.Debug.general.xcl create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.crun create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.dbgdt create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.dni create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.dep create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewd create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewp create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewt create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/Application/runWolfcryptTests.c create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.driver.xcl create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.general.xcl create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.crun create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dbgdt create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dni create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test_Debug.jlink create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.dep create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewd create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewp create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewt diff --git a/IDE/IAR-EWARM/embOS/README b/IDE/IAR-EWARM/embOS/README new file mode 100644 index 000000000..7c53221b6 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/README @@ -0,0 +1,23 @@ +#-----------------------------------------------------------------------------# +wolfSSL + embOS + IAR Workbench +#-----------------------------------------------------------------------------# + +#-----------------------------------------------------------------------------# +For building the existing examples on a SAMV71_Explained_Ultra with Cortex M7 +#-----------------------------------------------------------------------------# +see README_SAMV71 + +#-----------------------------------------------------------------------------# +For building wolfssl on a new CPU that is supported by embOS in IAR Workbench +#-----------------------------------------------------------------------------# +see README_custom_port + + + +Thank you for choosing wolfSSL if you ever have any questions please contact us! + +support@wolfssl.com +info@wolfssl.com + +Copyright © 2016 wolfSSL Inc. All rights reserved. + diff --git a/IDE/IAR-EWARM/embOS/README_SAMV71 b/IDE/IAR-EWARM/embOS/README_SAMV71 new file mode 100644 index 000000000..7dce91230 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/README_SAMV71 @@ -0,0 +1,104 @@ +Steps taken to evaluate wolfSSL with the following: + +Required Software for this guide: +IAR Embedded Workbench IDE - ARM v7.60.1 (or similar version) +embOS v4.16 (for Cortex-M and IAR compiler) + +Required items (Hardware) for this guide: +Atmel SAM V71 Xplained Ultra (Or equivelent Cortex-M Evaluation Board) + Note: Must have J-Trace adapter (SWD or SWD + ETM) +j-Trace for ARM Cortex-M Processors + Note: You can see here: https://www.segger.com/j-trace-for-cortex-m.html + Note: You can also purchase other models, we used one from IAR v3.2 +20 pin target ribbon cable +USB Cable with j-Trace adapter end +Micro usb cable + +#--!! NOTE !!--# +For this guide "**SAMV71_DIR" will signify the directory: +C:\\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\ + + +#----------------------------------------------------------------------------# +# Create wolfcrypt_lib.a +#----------------------------------------------------------------------------# + +1. Open IAR Workbench -> Project -> Add Existing Project + a. Browse to **SAMV71_DIR\embOS_wolfcrypt_lib + c. Choose wolfcrypt_lib.ewp and click "Open" + +2. Go to Project -> Rebuild All + +3. Verify the library built, you should no have: + **SAMV71_DIR\embOS_wolfcrypt_lib\Debug\Bin\wolfcrypt_lib.a + + +#----------------------------------------------------------------------------# +# Setup file system to evaluate wolfssl in embOS project: +#----------------------------------------------------------------------------# + +1. On your PC create the empty directory C:\embos-trial\ + +2. go to embOS website and download a trial for your platform + https://www.segger.com/downloads/embos -> + embOS trial for Cortex-M and IAR compiler + +3. Extract (unzip) the download to C:\embos-trial + (Note: you do not need to do anything further in this directory, the + wolfSSL evaluation projects will simply link against it) + +#----------------------------------------------------------------------------# +# Evaluate wolfcrypt_tests in embOS project: +#----------------------------------------------------------------------------# + +1. In IAR Workbench go to Project -> Add Existing Project + a. Browse to **SAMV71_DIR\embOS_wolfcrypt_test_SAMV71_XULT\ + b. Choose wolfcrypt_test.ewp and click "Open" + +2. Go to Project -> Rebuild All + +3. Connect your SAMV71 Xplained Ultra to your PC with micro USB in the "Debug" + port for power and the J-Link hooked up to SWD pins and your PC + +4. Go to Project -> Download and Debug + +5. Once the "Debug" environment has loaded go to: View -> Terminal I/O + (This is where the printf's will be directed to) + +6. Hit "Go" (Debug option with 3 left arrows "→→→") + +7. You should observe the tests run and pass. + +#----------------------------------------------------------------------------# +# Evaluate wolfcrypt_benchmarks in embOS project: +#----------------------------------------------------------------------------# + +1. In IAR Workbench go to Project -> Add Existing Project + a. Browse to **SAMV71_DIR\embOS_wolfcrypt_benchmark_SAMV71_XULT\ + b. Choose wolfcrypt_benchmark.ewp and click "Open" + +2. Go to Project -> Rebuild All + +3. Connect your SAMV71 Xplained Ultra to your PC with micro USB in the "Debug" + port for power and the J-Link hooked up to SWD pins and your PC + +4. Go to Project -> Download and Debug + +5. Once the "Debug" environment has loaded go to: View -> Terminal I/O + (This is where the printf's will be directed to) + +6. Hit "Go" (Debug option with 3 left arrows "→→→") + +7. You should observe the benchmark times for the configured algorithms. + + + + + +Thank you for using this guide and we hope this was helpful to you. If you have +any suggestions / feedback for us please contact us: +support@wolfssl.com +info@wolfssl.com + +Copyright © 2016 wolfSSL Inc. All rights reserved. + diff --git a/IDE/IAR-EWARM/embOS/README_custom_port b/IDE/IAR-EWARM/embOS/README_custom_port new file mode 100644 index 000000000..d62003f25 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/README_custom_port @@ -0,0 +1,215 @@ +Steps taken to evaluate wolfSSL with the following: + +Required Software for this guide: +IAR Embedded Workbench IDE - ARM v7.60.1 (or similar version) +embOS (version that supports your CPU) +wolfssl (latest version) + +#----------------------------------------------------------------------------# +# SECTION 1: +# Setting up the file system +#----------------------------------------------------------------------------# + +1. Browse to wolfssl/IDE/IAR-EWARM/embOS/ + a. create a new directory called + (For this guide we'll call that directory "CUSTOM_DIR" and we will use + the term "CUSTOM_DIR" in other directories to signify if a directory + should be placed inside the new CUSTOM_DIR) + +2. create new directory in CUSTOM_DIR "wolfcrypt_lib_CUSTOM_DIR" +3. create new directory in CUSTOM_DIR "wolfcrypt_tests_CUSTOM_DIR" +4. create new directory in CUSTOM_DIR "CUSTOM_DIR_user_settings" +5. Copy C:\wolfssl\IDE\IAR-EWARM/embOS\SAMV71_XULT\ + embOS_SAMV71_XULT_user_settings\user_settings.h + paste that into the new CUSTOM_DIR\CUSTOM_DIR_user_settings\ + +#----------------------------------------------------------------------------# +# SECTION 2: +# Create wolfcrypt_lib.a +#----------------------------------------------------------------------------# + +1. Open IAR Workbench -> Project -> Create New Project -> Empty Project + c. Browse to CUSTOM_DIR/wolfcrypt_lib_CUSTOM_DIR/ (from section 1) + d. Called it "wolfcrypt_lib" and hit "Save" + +2. Go to Project -> Add Group... + a. call group wolfcrypt_sources + +3. Right click on wolfcrypt_sources group -> Add -> Add Files... + +4. Browse to wolfssl/wolfcrypt/src directory and select the following files: + + #---------------------------------------------# + # aes.c memory.c # + # asn.c misc.c # + # chacha.c poly1305.c # + # chacha20_poly1305.c pwdbased.c # + # coding.c rabbit.c # + # des3.c random.c # + # dh.c rsa.c # + # dsa.c sha.c # + # ecc.c sha256.c # + # hash.c sha512.c # + # hmac.c tfm.c # + # md4.c wc_encrypt.c # + # md5.c wc_port.c # + #---------------------------------------------# + +5. Once those are all added go to + Project -> Properties C/C++ Compiler -> Preprocessor (Tab) + a. In the field "Defined symbols:" add WOLFSSL_USER_SETTINGS + b. In the field "Additional include directories:" + Click the box with "..." + Click + Browse to "wolfssl" directory on your PC and click "Select" then "Ok" + You should now see "C:\\wolfssl" in that field + Click again + Browse to "wolfssl\IDE\IAR-EWARM\CUSTOM_DIR\CUSTOM_DIR_user_settings\" + Hit "Ok", verify the path is correct and hit "Ok" again. + + (Remember we copy and pasted this over in section 1. If you ever need to + change or customize your build settings this is the file that should be + modified: CUSTOM_DIR\CUSTOM_DIR_user_settings\user_settings.h) + +7. In Project -> Options -> General Options -> Output (Tab) + Check the option for "Library" instead of "Executable" + Click "OK" + +8. Go to Project -> Rebuild all (The library should build) + +9. Confirm the library is now located here: + C:\\wolfssl\IDE\IAR-EWARM\wolfcrypt_build_lib\Debug\Exe\ + wolfcrypt_lib.a + +We are now set to link to this library in the evaluation project + +#----------------------------------------------------------------------------# +# Evaluate in embOS project: +#----------------------------------------------------------------------------# + + +1. go to embOS website and download a trial for your platform + https://www.segger.com/downloads/embos -> + embOS trial for Cortex-M and IAR compiler + +2. After download and unzipping open IAR Workbench + a. choose Project -> Add Existing Project + b. Navigate to the downloaded trial then: + Start\BoardSupport\\\Start_.ewp + (For example) Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Start_SAMv71.ewp + +3. Go to Project -> Options -> C/C++ Compiler -> Preprocessor (Tab) + a. Add this to the "Defined symbols: (one per line)" Box: + WOLFSSL_USER_SETTINGS + b. Now in the above box "Additional include directories:" + Click on the box with "..." + Click + Browse to "wolfssl" directory on your computer and click "Select" + c. This project will use the same user_settings.h as in the above project + where we built the library so both have the exact same settings + +4. Go to Project -> Options -> Linker -> Library (Tab) + Next to the field "Additonal libraries: (one per line)" + Click the box with "..." + Click + Browse to C:\\CUSTOM_DIR\wolfcrypt_lib_CUSTOM_DIR\Debug\Exe\wolfcrypt_lib.a + Click "Open" and "OK" (twice) + +5. In the main project file "OS_StartLEDBlick.c" + + #--- Headers ---# + #include + #include + + #--- Task for wolfCrypt ---# + static OS_STACKPTR int StackWOLF[20000]; + static OS_TASK TCWOLF; + static void wolfTestRun(void) { + printf("Begin wolfcrypt tests\n"); + wolfcrypt_test(NULL); + printf("Wolfcrypt tests complete\n"); + } + + #--- Create the task in main() BEFORE calling OS_Start() ---# + OS_CREATETASK(&TCWOLF, "wolfcrypt test Task", wolfTestRun, 100, StackWOLF); + +6. To get Logging working for seeing test results: + a. Go to Project -> Options -> General Options -> Library Configuration (Tab) + b. In the field "Library low-level interface implementation" + Check the radio button for Semihosted + Then in the inner field marked "stdout/stderr" + Check the radio button for "Via semihosting" and click "OK" + +7. Now we're ready to build and debug the project. + a. Project -> Options -> Debugger + In the field marked "Driver" Select drop-down and choose J-Link/J-Trace + Click "OK" + b. Project -> Rebuild All + c. Connect your Cortex-M evaluation board to j-Trace and j-Trace to PC + d. Connect the micro-USB to the debug port of the Cortex-M and PC for power + e. Project -> Download and Debug + +8. Once the Debug environment spawns go to View -> Terminal I/O + This is where the "printf" to stdout will be directed + +9. In the Debug Menu bar look for the little square with three arrows pointing + to the right. When you mouse over it should say "GO" + Click this option and in the Terminal I/O Window you should see something + like this (depends on which functionality you set in user_settings.h) + + SEE NOTE 1 BELOW IF YOU OBSERVE AN ERROR (-40) IN RSA TEST + +Begin wolfcrypt tests +MD5 test passed! +MD4 test passed! +SHA test passed! +SHA-256 test passed! +SHA-384 test passed! +SHA-512 test passed! +HMAC-MD5 test passed! +HMAC-SHA test passed! +HMAC-SHA256 test passed! +HMAC-SHA384 test passed! +HMAC-SHA512 test passed! +GMAC test passed! +HC-128 test passed! +Rabbit test passed! +Chacha test passed! +POLY1305 test passed! +ChaCha20-Poly1305 AEAD test passed! +DES test passed! +DES3 test passed! +AES test passed! +AES-GCM test passed! +RANDOM test passed! +RSA test passed! +DH test passed! +DSA test passed! +PWDBASED test passed! +ECC test passed! + +total Allocs = 988 +total Bytes = 1471829 +peak Bytes = 29576 +current Bytes = 0 + +Thank you for using this guide and we hope this was helpful to you. If you have +any suggestions / feedback for us please contact us: +support@wolfssl.com +info@wolfssl.com + +/* --------------------------------------------------------------------------*/ +#### NOTE 1: #### + +If you are working off of a base example project and you observe memory errors +when malloc is called, make sure that the linker script has set the HEAP high +enough. +Project -> Options -> Linker -> (Config Tab) -> Linker configuration file + +Check this file for __size_heap__ it is typically set to 0x200 by default. +There are places in wolfSSL that malloc as much as 4k at a time and peak usage +can be as high as 29K if using full functionality. +/* --------------------------------------------------------------------------*/ + +Copyright © 2016 wolfSSL Inc. All rights reserved. + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_Linker_Script/samv71q21_wolfssl.icf b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_Linker_Script/samv71q21_wolfssl.icf new file mode 100644 index 000000000..df18243a5 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_Linker_Script/samv71q21_wolfssl.icf @@ -0,0 +1,57 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2014, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ +/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ +/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ +/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ +/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* ---------------------------------------------------------------------------- */ + +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x00400000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_RAM_start__ = 0x20400000; +define symbol __ICFEDIT_region_RAM_end__ = 0x20460000 -1; +define symbol __ICFEDIT_region_ROM_start__ = 0x00400000; +define symbol __ICFEDIT_region_ROM_end__ = 0x00600000 -1; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x400; +define symbol __ICFEDIT_size_heap__ = 0x20000; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; +define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; +place in ROM_region { readonly }; +place in RAM_region { readwrite, block CSTACK, block HEAP }; diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings.h b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings.h new file mode 100644 index 000000000..00f3b7293 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings.h @@ -0,0 +1,67 @@ +#ifndef _EMBOS_USER_SETTINGS_H_ +#define _EMBOS_USER_SETTINGS_H_ + + #undef WOLFSSL_EMBOS + #define WOLFSSL_EMBOS + + #undef WOLFCRYPT_ONLY + #define WOLFCRYPT_ONLY + + #undef NO_64BIT + #define NO_64BIT + + #undef SIZEOF_LONG + #define SIZEOF_LONG 4 + + #undef SIZEOF_LONG_LONG + #define SIZEOF_LONG_LONG 8 + + #undef HAVE_CHACHA + #define HAVE_CHACHA + + #undef HAVE_POLY1305 + #define HAVE_POLY1305 + + #undef ECC_SHAMIR + #define ECC_SHAMIR + + #undef HAVE_ECC + #define HAVE_ECC + + #undef ECC_USER_CURVES + #define ECC_USER_CURVES + + #undef ECC_ALT_SIZE + #define ECC_ALT_SIZE + + #undef FP_MAX_BITS_ECC + #define FP_MAX_BITS_ECC 528 + + #undef TFM_TIMING_RESISTANT + #define TFM_TIMING_RESISTANT + + #undef WOLFSSL_SHA512 + #define WOLFSSL_SHA512 + + #undef WOLFSSL_SHA384 + #define WOLFSSL_SHA384 + + #undef HAVE_AESGCM + #define HAVE_AESGCM + + #undef NO_INLINE + #define NO_INLINE + + #undef BENCH_EMBEDDED + #define BENCH_EMBEDDED + + #undef WOLFSSL_SMALL_STACK + #define WOLFSSL_SMALL_STACK + + #undef USE_WOLFSSL_MEMORY + #define USE_WOLFSSL_MEMORY +/* Uncomment to track memory CAUTION: Can cause excess overhead */ +/* #undef WOLFSSL_TRACK_MEMORY */ +/* #define WOLFSSL_TRACK_MEMORY */ + +#endif /* _EMBOS_USER_SETTINGS_H_ */ diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings_simple_example.h b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings_simple_example.h new file mode 100644 index 000000000..7679f0492 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings_simple_example.h @@ -0,0 +1,43 @@ +#ifndef _EMBOS_USER_SETTINGS_H_ +#define _EMBOS_USER_SETTINGS_H_ + + #undef WOLFCRYPT_ONLY + #define WOLFCRYPT_ONLY + + #undef NO_64BIT + #define NO_64BIT + + #undef SIZEOF_LONG + #define SIZEOF_LONG 4 + + #undef SIZEOF_LONG_LONG + #define SIZEOF_LONG_LONG 8 + + #undef HAVE_CHACHA + #define HAVE_CHACHA + + #undef HAVE_POLY1305 + #define HAVE_POLY1305 + + #undef ECC_SHAMIR + #define ECC_SHAMIR + + #undef HAVE_ECC + #define HAVE_ECC + + #undef WOLFSSL_SHA512 + #define WOLFSSL_SHA512 + + #undef WOLFSSL_SHA384 + #define WOLFSSL_SHA384 + + #undef HAVE_AESGCM + #define HAVE_AESGCM + + #undef NO_INLINE + #define NO_INLINE + + #undef BENCH_EMBEDDED + #define BENCH_EMBEDDED + +#endif /* _EMBOS_USER_SETTINGS_H_ */ diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings_verbose_example.h b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings_verbose_example.h new file mode 100644 index 000000000..d95b64c99 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_SAMV71_XULT_user_settings/user_settings_verbose_example.h @@ -0,0 +1,208 @@ +#ifndef _EMBOS_USER_SETTINGS_H_ +#define _EMBOS_USER_SETTINGS_H_ + +/* ------------------------------------------------------------------------- */ +/* Platform */ +/* ------------------------------------------------------------------------- */ +#undef NO_INLINE +#define NO_INLINE + +#undef SINGLE_THREADED +#define SINGLE_THREADED + +#undef WOLFSSL_SMALL_STACK +#define WOLFSSL_SMALL_STACK + + +/* ------------------------------------------------------------------------- */ +/* Math Configuration */ +/* ------------------------------------------------------------------------- */ +#undef NO_64BIT +#define NO_64BIT + +#ifndef SIZEOF_LONG +#define SIZEOF_LONG 4 +#endif +#ifndef SIZEOF_LONG_LONG +#define SIZEOF_LONG_LONG 8 +#endif + +#undef USE_FAST_MATH +#define USE_FAST_MATH + +#ifdef USE_FAST_MATH + #undef TFM_TIMING_RESISTANT +// #define TFM_TIMING_RESISTANT + + /* Optimizations (TFM_ARM, TFM_ASM or none) */ + #undef TFM_ARM +// #define TFM_ARM + + #undef TFM_ASM + //#define TFM_ASM + + /* Enable extra math checks */ + #undef TFM_CHECK + //#define TFM_CHECK +#endif + +/* Math debugging */ +#undef WOLFSSL_DEBUG_MATH +//#define WOLFSSL_DEBUG_MATH + + +/* ------------------------------------------------------------------------- */ +/* Crypto */ +/* ------------------------------------------------------------------------- */ +#undef WOLFCRYPT_ONLY +#define WOLFCRYPT_ONLY + +/* ECC */ +#if 1 + #undef HAVE_ECC + #define HAVE_ECC + + /* Manually define enabled curves */ + #undef ECC_USER_CURVES + #define ECC_USER_CURVES + + #define HAVE_ECC192 + #define HAVE_ECC224 + #undef NO_ECC256 + #define HAVE_ECC384 + #define HAVE_ECC521 + + /* Fixed point cache (speeds repeated operations against same private key) */ + #undef FP_ECC + //#define FP_ECC + #ifdef FP_ECC + /* Bits / Entries */ + #undef FP_ENTRIES + #define FP_ENTRIES 2 + #undef FP_LUT + #define FP_LUT 4 + #endif + + /* Optional ECC calculation method */ + /* Note: doubles heap usage, but slightly faster */ + #undef ECC_SHAMIR + #define ECC_SHAMIR + + /* Reduces heap usage, but slower */ + #undef ECC_TIMING_RESISTANT + #define ECC_TIMING_RESISTANT + + #ifdef USE_FAST_MATH + /* Max ECC bits (curve size * 8). ECC521 is (66*8) = 528. */ + #undef ALT_ECC_SIZE + #define ALT_ECC_SIZE + #undef FP_MAX_BITS_ECC + #define FP_MAX_BITS_ECC 528 + + /* Enable TFM optimizations for ECC */ + #define TFM_ECC192 + #define TFM_ECC224 + #define TFM_ECC256 + #define TFM_ECC384 + #define TFM_ECC521 + #endif +#endif + +/* RSA */ +#undef NO_RSA +#if 1 + #ifdef USE_FAST_MATH + /* Maximum math bits (Max RSA key bits * 2) */ + #undef FP_MAX_BITS + #define FP_MAX_BITS 4096 + #endif + + /* half as much memory but twice as slow */ + #undef RSA_LOW_MEM + //#define RSA_LOW_MEM +#else + #define NO_RSA +#endif + +/* AES */ +#undef NO_AES +#if 1 + #undef HAVE_AESGCM + #define HAVE_AESGCM + + /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_SMALL */ + #undef GCM_SMALL + #define GCM_SMALL +#else + #define NO_AES +#endif + +/* ChaCha20 / Poly1305 */ +#undef HAVE_CHACHA +#undef HAVE_POLY1305 +#if 1 + #define HAVE_CHACHA + #define HAVE_POLY1305 + + /* Needed for Poly1305 */ + #undef HAVE_ONE_TIME_AUTH + #define HAVE_ONE_TIME_AUTH +#endif + + +/* ------------------------------------------------------------------------- */ +/* Hashing */ +/* ------------------------------------------------------------------------- */ +/* Sha */ +#undef NO_SHA +#if 1 +#else + #define NO_SHA +#endif + +/* Sha256 */ +#undef NO_SHA256 +#if 1 + /* over twice as small, but 50% slower */ + //#define USE_SLOW_SHA2 +#else + #define NO_SHA256 +#endif + +/* Sha512 */ +#undef WOLFSSL_SHA512 +#if 1 + #define WOLFSSL_SHA512 + + /* Sha384 */ + #undef WOLFSSL_SHA384 + #if 1 + #define WOLFSSL_SHA384 + #endif +#endif + +/* MD5 */ +#undef NO_MD5 +#if 1 + #define NO_MD5 +#endif + + +/* ------------------------------------------------------------------------- */ +/* HW Crypto Acceleration */ +/* ------------------------------------------------------------------------- */ +// See README.md for instructions +//#define FREESCALE_MMCAU 1 + + +/* ------------------------------------------------------------------------- */ +/* Benchmark / Test */ +/* ------------------------------------------------------------------------- */ +/* Use reduced benchmark / test sizes */ +#undef BENCH_EMBEDDED +#define BENCH_EMBEDDED + +#undef USE_CERT_BUFFERS_2048 +#define USE_CERT_BUFFERS_2048 + +#endif /* _EMBOS_USER_SETTINGS_H_ */ diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/Application/runBenchmarks.c b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/Application/runBenchmarks.c new file mode 100644 index 000000000..4bb00b69f --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/Application/runBenchmarks.c @@ -0,0 +1,31 @@ +#include "RTOS.h" +#include "BSP.h" +#include + +static OS_STACKPTR int WLFSTACK[20000]; /* Stack Size */ +static OS_TASK WLFTASK; /* Task-control-blocks */ + +static void wolfTask(void) { + benchmark_test(NULL); + while (1) { + BSP_ToggleLED(1); + OS_Delay(200); + } +} + +/********************************************************************* +* +* main() +*/ +int main(void) { + OS_IncDI(); /* Initially disable interrupts */ + OS_InitKern(); /* Initialize OS */ + OS_InitHW(); /* Initialize Hardware for OS */ + BSP_Init(); /* Initialize LED ports */ + /* You need to create at least one task before calling OS_Start() */ + OS_CREATETASK(&WLFTASK, "Tests task", wolfTask, 100, WLFSTACK); + OS_Start(); /* Start multitasking */ + return 0; +} + +/****** End Of File *************************************************/ diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.driver.xcl b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.driver.xcl new file mode 100644 index 000000000..885e2a33f --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.driver.xcl @@ -0,0 +1,33 @@ +"--endian=little" + +"--cpu=Cortex-M7" + +"--jlink_exec_command" + +"device ATSAMV71Q21" + +"--fpu=VFPv5_D16" + +"-p" + +"C:\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\ATSAMV71Q21.svd" + +"--semihosting" + +"--drv_communication=USB0" + +"--drv_interface_speed=auto" + +"--jlink_initial_speed=32" + +"--jlink_reset_strategy=0,0" + +"--drv_interface=SWD" + +"--drv_catch_exceptions=0x000" + +"--drv_swo_clock_setup=72000000,0,2000000" + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.general.xcl b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.general.xcl new file mode 100644 index 000000000..b8ec42cb2 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.general.xcl @@ -0,0 +1,13 @@ +"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armproc.dll" + +"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armjlink2.dll" + +"C:\Users\boz_windows\Desktop\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Debug\Exe\wolfcrypt_benchmark.out" + +--plugin "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armbat.dll" + +--macro "C:\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\samv7-ek-flash.mac" + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.crun b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.crun new file mode 100644 index 000000000..ef39dce8f --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.crun @@ -0,0 +1,16 @@ + + + + 1 + + + * + * + * + 0 + 1 + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dbgdt b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dbgdt new file mode 100644 index 000000000..edfa8fc39 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dbgdt @@ -0,0 +1,115 @@ + + + + + + + + + 201235 + + 20 + 926 + 247 + 61 + + + + + + + + 124272727 + + + + + + Disassembly_I0 + + + + 50020 + + + + 11 + + + + + + + 110$PROJ_DIR$\TermIOInput.txt10 + + + + + + + + + + TabID-12572-5505 + Debug Log + Debug-Log + + + + TabID-12050-5515 + Build + Build + + + + + 0 + + + TabID-23321-5509 + Workspace + Workspace + + + wolfcrypt_benchmark + + + + 0 + + + TabID-1301-5512 + Disassembly + Disassembly + + + + + 0 + + + TabID-11004-5535 + Terminal I/O + TerminalIO + + + + + 0 + + + + + + TextEditor$WS_DIR$\Application\OS_StartLEDBlink.c000004123662366TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\benchmark\benchmark.c00000211000TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfssl\ssl.h000009334117041170TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c000001500TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c000002822082208TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\src\fp_sqr_comba_6.i000001910941094TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\src\tfm.c000004781119511195TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c000009848634863TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c000003281156911569TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Application\OS_StartLEDBlink.c000004928702870TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Application\runBenchmarks.c0000012422422TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c0000012412412TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c000002011114611146TextEditor$WS_DIR$\..\..\..\..\..\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c000006412412TextEditor$WS_DIR$\..\..\..\..\..\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Application\runBenchmarks.c0000012422422TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c000003281156911569150100000010000001 + + + + + + + iaridepm.enu1debuggergui.enu1armjlink2.enu1-2-2304198-2-2200200154560336134154560514286-2-2304417-2-2200200154560336134323802514286-24153041098415-2200200154560336134527821514286-2-21981296-2-212982001003091336134154560336134 + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dni b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dni new file mode 100644 index 000000000..b756ea17d --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dni @@ -0,0 +1,134 @@ +[Stack] +FillEnabled=0 +OverflowWarningsEnabled=1 +WarningThreshold=90 +SpWarningsEnabled=1 +WarnLogOnly=1 +UseTrigger=1 +TriggerName=main +LimitSize=0 +ByteLimit=50 +[DebugChecksum] +Checksum=822032712 +[CodeCoverage] +Enabled=_ 0 +[Exceptions] +StopOnUncaught=_ 0 +StopOnThrow=_ 0 +[CallStack] +ShowArgs=0 +[Disassembly] +MixedMode=1 +[Interrupts] +Enabled=1 +[MemConfig] +Base=1 +Manual=0 +Ddf=1 +TypeViol=0 +Stop=1 +[Simulator] +Freq=10000000 +MultiCoreRunAll=1 +[JLinkDriver] +CStepIntDis=_ 0 +LeaveTargetRunning=_ 0 +TraceBufferSize=0x00010000 +TraceStallIfFIFOFull=0x00000000 +TracePortSize=0x00000000 +[SWOTraceHWSettings] +OverrideDefaultClocks=0 +CpuClock=72000000 +ClockAutoDetect=0 +ClockWanted=2000000 +JtagSpeed=2000000 +Prescaler=36 +TimeStampPrescIndex=0 +TimeStampPrescData=0 +PcSampCYCTAP=1 +PcSampPOSTCNT=15 +PcSampIndex=0 +DataLogMode=0 +ITMportsEnable=0 +ITMportsTermIO=0 +ITMportsLogFile=0 +ITMlogFile=$PROJ_DIR$\ITM.log +[Trace1] +Enabled=0 +ShowSource=1 +[Trace2] +Enabled=0 +ShowSource=0 +[SWOTraceWindow] +PcSampling=0 +InterruptLogs=0 +ForcedTimeStamps=0 +EventCPI=0 +EventEXC=0 +EventFOLD=0 +EventLSU=0 +EventSLEEP=0 +[PowerLog] +Title_0=I0 +Symbol_0=0 4 0 +LogEnabled=0 +GraphEnabled=0 +ShowTimeLog=1 +LiveEnabled=0 +LiveFile=PowerLogLive.log +[DataLog] +LogEnabled=0 +GraphEnabled=0 +ShowTimeLog=1 +SumEnabled=0 +ShowTimeSum=1 +[EventLog] +Title_0=Ch3 +Symbol_0=0 4 1 +Title_1=Ch2 +Symbol_1=0 4 1 +Title_2=Ch1 +Symbol_2=0 4 1 +Title_3=Ch0 +Symbol_3=0 4 1 +LogEnabled=0 +GraphEnabled=0 +ShowTimeLog=1 +SumEnabled=0 +ShowTimeSum=1 +SumSortOrder=0 +[InterruptLog] +LogEnabled=0 +GraphEnabled=0 +ShowTimeLog=1 +SumEnabled=0 +ShowTimeSum=1 +SumSortOrder=0 +[Log file] +LoggingEnabled=_ 0 +LogFile=_ "" +Category=_ 0 +[TermIOLog] +LoggingEnabled=_ 0 +LogFile=_ "" +[DriverProfiling] +Enabled=0 +Mode=1 +Graph=0 +Symbiont=0 +Exclusions= +[CallStackLog] +Enabled=0 +[CallStackStripe] +ShowTiming=1 +[PowerProbe] +Frequency=10000 +Probe0=I0 +ProbeSetup0=2 1 1 2 0 0 +[Disassemble mode] +mode=0 +[Breakpoints2] +Count=0 +[Aliases] +Count=0 +SuppressDialog=0 diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark_Debug.jlink b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark_Debug.jlink new file mode 100644 index 000000000..3a2fb4743 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark_Debug.jlink @@ -0,0 +1,39 @@ +[BREAKPOINTS] +ForceImpTypeAny = 0 +ShowInfoWin = 1 +EnableFlashBP = 2 +BPDuringExecution = 0 +[CFI] +CFISize = 0x00 +CFIAddr = 0x00 +[CPU] +MonModeVTableAddr = 0xFFFFFFFF +MonModeDebug = 0 +MaxNumAPs = 0 +LowPowerHandlingMode = 0 +OverrideMemMap = 0 +AllowSimulation = 1 +ScriptFile="" +[FLASH] +CacheExcludeSize = 0x00 +CacheExcludeAddr = 0x00 +MinNumBytesFlashDL = 0 +SkipProgOnCRCMatch = 1 +VerifyDownload = 1 +AllowCaching = 1 +EnableFlashDL = 2 +Override = 1 +Device="ATSAMV71Q21" +[GENERAL] +WorkRAMSize = 0x00 +WorkRAMAddr = 0x00 +RAMUsageLimit = 0x00 +[SWO] +SWOLogFile="" +[MEM] +RdOverrideOrMask = 0x00 +RdOverrideAndMask = 0xFFFFFFFF +RdOverrideAddr = 0xFFFFFFFF +WrOverrideOrMask = 0x00 +WrOverrideAndMask = 0xFFFFFFFF +WrOverrideAddr = 0xFFFFFFFF diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.dep b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.dep new file mode 100644 index 000000000..5646a0b9f --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.dep @@ -0,0 +1,719 @@ + + + + 2 + 3271176394 + + Debug + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + $PROJ_DIR$\Application\runBenchmarks.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\smc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piod.h + $TOOLKIT_DIR$\CMSIS\Include\core_cmFunc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\efc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pmc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\dacc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mlb.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\twihs.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\aes.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pmc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\isi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\tc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rswdt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\chipid.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\spi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\qspi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\isi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gpbr.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\icm.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\smc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\supc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\uart.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\efc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mcan.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc3.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\ssc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usart.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\xdmac.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rswdt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\matrix.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart2.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\acc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pio.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\utmi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart3.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rstc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\pio\samv71q21.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart4.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gmac.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\hsmci.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\sdramc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs2.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\icm.h + $TOOLKIT_DIR$\CMSIS\Include\core_cm7.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\utmi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\xdmac.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usbhs.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc2.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gpbr.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\matrix.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\trng.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\ssc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rstc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pwm.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart2.h + $TOOLKIT_DIR$\CMSIS\Include\core_cmInstr.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\wdt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piob.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi0.h + $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.__cstat.et + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\supc.h + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.__cstat.et + $PROJ_DIR$\Debug\Obj\runBenchmarks.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioe.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\hsmci.h + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioa.h + $PROJ_DIR$\Debug\Obj\xmtx.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\trng.h + $PROJ_DIR$\Debug\Obj\startup_sam.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\dacc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usbhs.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\sdramc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mlb.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\qspi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\wdt.h + $PROJ_DIR$\Debug\Obj\xmtx2.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gmac.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart1.h + $PROJ_DIR$\Debug\Obj\BSP.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc1.h + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.o + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.pbi + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.pbi + $PROJ_DIR$\Debug\Obj\OS_Error.__cstat.et + $PROJ_DIR$\Debug\Obj\xmtx.o + $PROJ_DIR$\Debug\Obj\HardFaultHandler.o + $PROJ_DIR$\Debug\Obj\xmtx.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.pbi + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.o + $PROJ_DIR$\Debug\Obj\xmtx2.o + $PROJ_DIR$\Debug\Obj\system_sam.__cstat.et + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.pbi + $PROJ_DIR$\Debug\Obj\OS_Error.o + $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.o + $PROJ_DIR$\Debug\Obj\BSP.pbi + $PROJ_DIR$\Debug\Obj\BSP.o + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.o + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\acc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\afec.h + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.__cstat.et + $PROJ_DIR$\Debug\Obj\xmtx2.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.o + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.o + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.o + $PROJ_DIR$\Debug\Obj\OS_Error.pbi + $PROJ_DIR$\Debug\Obj\benchmark.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.o + $TOOLKIT_DIR$\CMSIS\Include\core_cmSimd.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.h + $TOOLKIT_DIR$\inc\c\DLib_Product_string.h + $TOOLKIT_DIR$\inc\c\string.h + $TOOLKIT_DIR$\inc\c\ycheck.h + $TOOLKIT_DIR$\inc\c\intrinsics.h + $TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_Conf.h + $TOOLKIT_DIR$\inc\c\yvals.h + $TOOLKIT_DIR$\inc\c\stdint.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71q21.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\aes.h + $TOOLKIT_DIR$\inc\c\DLib_Threads.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Lib\os7m_tlv_dp.a + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\chipid.h + $TOOLKIT_DIR$\inc\c\ysizet.h + $TOOLKIT_DIR$\lib\rt7M_tl.a + $TOOLKIT_DIR$\lib\dl7M_tln.a + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.h + $PROJ_DIR$\Debug\List\wolfcrypt_benchmark.map + $TOOLKIT_DIR$\inc\c\DLib_Defaults.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\Global.h + $TOOLKIT_DIR$\lib\shb_l.a + $TOOLKIT_DIR$\lib\m7M_tlv.a + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER.h + $TOOLKIT_DIR$\inc\c\xencoding_limits.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_samv71.h + $PROJ_DIR$\..\embOS_SAMV71_XULT_Linker_Script\samv71q21_wolfssl.icf + $TOOLKIT_DIR$\inc\c\DLib_Product.h + $TOOLKIT_DIR$\inc\c\cmsis_iar.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\arc4.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\poly1305.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ecc.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hc128.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rabbit.h + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\benchmark\benchmark.h + $PROJ_DIR$\..\embOS_wolfcrypt_lib_SAMV71_XULT\Debug\Bin\wolfcrypt_lib.a + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn_public.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\BSP.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\logging.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\OS_Config.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md5.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\types.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\des3.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\RTOS.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\integer.h + $TOOLKIT_DIR$\inc\c\xlocale_c.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha256.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha512.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\random.h + $TOOLKIT_DIR$\inc\c\limits.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dsa.h + $TOOLKIT_DIR$\inc\c\xlocale.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\wc_port.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\mem_track.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\camellia.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rsa.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\aes.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\visibility.h + $TOOLKIT_DIR$\inc\c\xmtx.h + $TOOLKIT_DIR$\inc\c\xtls.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.h + $PROJ_DIR$\Debug\Exe\wolfcrypt_benchmark.out + $PROJ_DIR$\Debug\Obj\wolfcrypt_benchmark.pbd + $PROJ_DIR$\Debug\Obj\benchmark.pbi + $TOOLKIT_DIR$\inc\c\ctype.h + $TOOLKIT_DIR$\inc\c\stdio.h + $PROJ_DIR$\..\embOS_SAMV71_XULT_user_settings\user_settings.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\memory.h + $TOOLKIT_DIR$\inc\c\stdarg.h + $PROJ_DIR$\Debug\Obj\runBenchmarks.pbi + $PROJ_DIR$\Debug\Obj\runBenchmarks.o + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_ConfDefaults.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha20_poly1305.h + $TOOLKIT_DIR$\inc\c\xlocaleuse.h + $TOOLKIT_DIR$\inc\c\wchar.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hash.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ripemd.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\settings.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Int.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\certs_test.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dh.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\tfm.h + $TOOLKIT_DIR$\inc\c\stdlib.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Conf.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\JLINKMEM.h + $TOOLKIT_DIR$\inc\c\ystdio.h + $PROJ_DIR$\Debug\Obj\startup_sam.pbi + $PROJ_DIR$\Debug\Obj\system_sam.o + $PROJ_DIR$\Debug\Obj\startup_sam.o + $PROJ_DIR$\Debug\Obj\benchmark.o + $PROJ_DIR$\Debug\Obj\system_sam.pbi + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71.h + + + [ROOT_NODE] + + + ILINK + 215 170 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + + + BICOMP + 245 + + + ICCARM + 242 + + + __cstat + 132 + + + + + BICOMP + 155 160 88 64 59 66 69 75 159 70 57 43 100 108 107 62 142 36 61 42 85 84 105 109 110 116 91 63 83 161 141 24 65 45 81 56 34 77 73 95 118 68 114 104 115 67 101 106 103 97 94 111 82 163 151 177 162 165 44 38 39 52 25 23 35 50 51 17 47 30 26 48 71 49 79 41 74 22 58 53 86 37 55 29 46 54 78 27 72 40 76 28 33 21 87 18 80 20 32 31 60 171 176 157 179 19 156 180 246 + + + ICCARM + 246 161 160 155 159 171 157 179 176 163 70 83 180 156 19 151 177 141 162 142 165 24 44 64 38 65 39 36 52 45 25 57 23 81 35 61 50 56 51 66 17 34 47 42 30 77 26 43 48 73 71 85 49 95 79 88 41 118 74 84 22 68 58 100 53 114 86 105 37 104 55 69 29 115 46 109 54 67 78 108 27 101 72 110 40 106 76 59 28 103 33 116 21 97 87 107 18 94 80 91 20 111 32 75 31 82 60 63 62 + + + + + $PROJ_DIR$\Application\runBenchmarks.c + + + BICOMP + 224 + + + ICCARM + 225 + + + __cstat + 93 + + + + + BICOMP + 155 171 188 154 153 179 191 156 166 176 157 159 197 193 163 + + + ICCARM + 197 154 155 159 171 157 179 176 163 166 153 156 193 191 188 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c + + + BICOMP + 217 + + + ICCARM + 244 + + + __cstat + 149 + + + + + BICOMP + 154 207 201 159 218 212 230 198 195 183 163 213 236 156 196 208 197 166 222 155 202 221 193 219 186 210 181 235 188 200 232 211 228 229 185 182 187 227 184 194 209 231 234 220 153 171 176 157 179 240 206 237 205 199 203 204 190 192 + + + ICCARM + 232 211 220 154 155 159 171 157 179 176 163 166 153 219 240 202 195 206 222 237 218 205 213 212 228 199 229 200 196 182 186 187 183 227 210 184 208 194 221 201 209 198 236 203 230 181 235 204 190 185 231 234 188 207 192 197 156 193 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + + + BICOMP + 241 + + + ICCARM + 243 + + + __cstat + 102 + + + + + BICOMP + 50 20 37 165 49 40 52 30 22 54 21 171 155 19 160 177 38 23 17 48 41 53 29 27 28 18 31 179 162 44 39 25 35 51 47 26 71 79 74 58 86 55 46 78 72 76 33 87 80 32 60 176 157 161 70 141 142 24 64 65 36 45 57 81 61 56 66 34 42 77 43 73 85 95 88 118 84 68 100 114 105 104 69 115 109 67 108 101 110 106 59 103 116 97 107 94 91 111 75 82 63 62 159 163 83 151 156 180 246 + + + ICCARM + 246 161 160 155 159 171 157 179 176 163 70 83 180 156 19 151 177 141 162 142 165 24 44 64 38 65 39 36 52 45 25 57 23 81 35 61 50 56 51 66 17 34 47 42 30 77 26 43 48 73 71 85 49 95 79 88 41 118 74 84 22 68 58 100 53 114 86 105 37 104 55 69 29 115 46 109 54 67 78 108 27 101 72 110 40 106 76 59 28 103 33 116 21 97 87 107 18 94 80 91 20 111 32 75 31 82 60 63 62 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + + + BICOMP + 138 + + + ICCARM + 139 + + + __cstat + 117 + + + + + ICCARM + 191 246 161 160 155 159 171 157 179 176 163 70 83 180 156 19 151 177 141 162 142 165 24 44 64 38 65 39 36 52 45 25 57 23 81 35 61 50 56 51 66 17 34 47 42 30 77 26 43 48 73 71 85 49 95 79 88 41 118 74 84 22 68 58 100 53 114 86 105 37 104 55 69 29 115 46 109 54 67 78 108 27 101 72 110 40 106 76 59 28 103 33 116 21 97 87 107 18 94 80 91 20 111 32 75 31 82 60 63 62 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + BICOMP + 129 + + + ICCARM + 119 + + + __cstat + 96 + + + + + BICOMP + 214 154 159 163 155 169 156 193 172 197 166 153 171 176 157 179 175 + + + ICCARM + 197 154 155 159 171 157 179 176 163 166 153 156 193 169 175 172 214 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + + + BICOMP + 121 + + + ICCARM + 147 + + + __cstat + 99 + + + + + BICOMP + 155 176 223 158 156 159 163 237 166 171 152 157 179 + + + ICCARM + 152 158 156 155 237 159 171 157 179 176 163 166 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + + + BICOMP + 134 + + + ICCARM + 146 + + + __cstat + 113 + + + + + BICOMP + 238 155 223 166 159 154 175 179 152 237 169 226 172 158 156 153 157 233 171 176 163 + + + ICCARM + 233 169 175 172 238 226 158 156 155 152 154 159 171 157 179 176 163 166 153 237 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + + + AARM + 127 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + BICOMP + 148 + + + ICCARM + 136 + + + __cstat + 125 + + + + + BICOMP + 157 159 154 155 156 179 197 193 166 153 171 176 163 + + + ICCARM + 197 154 155 159 171 157 179 176 163 166 153 156 193 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + + + BICOMP + 122 + + + ICCARM + 140 + + + __cstat + 92 + + + + + BICOMP + 65 103 163 159 155 118 34 115 82 151 156 141 81 73 114 101 94 24 45 56 77 95 68 104 67 106 97 111 246 193 172 70 142 64 36 57 61 66 42 43 85 88 84 100 105 69 109 108 110 59 116 107 91 75 63 62 83 180 169 239 154 166 153 171 176 157 179 175 161 160 177 162 165 44 38 39 52 25 23 35 50 51 17 47 30 26 48 71 49 79 41 74 22 58 53 86 37 55 29 46 54 78 27 72 40 76 28 33 21 87 18 80 20 32 31 60 19 197 + + + ICCARM + 197 154 155 159 171 157 179 176 163 166 153 156 193 169 175 172 246 161 160 70 83 180 19 151 177 141 162 142 165 24 44 64 38 65 39 36 52 45 25 57 23 81 35 61 50 56 51 66 17 34 47 42 30 77 26 43 48 73 71 85 49 95 79 88 41 118 74 84 22 68 58 100 53 114 86 105 37 104 55 69 29 115 46 109 54 67 78 108 27 101 72 110 40 106 76 59 28 103 33 116 21 97 87 107 18 94 80 91 20 111 32 75 31 82 60 63 62 239 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + + + BICOMP + 144 + + + ICCARM + 131 + + + __cstat + 112 + + + + + BICOMP + 157 159 155 176 163 154 197 171 179 156 193 166 153 + + + ICCARM + 159 155 171 157 179 176 163 197 154 166 153 156 193 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + + + BICOMP + 135 + + + ICCARM + 137 + + + __cstat + 89 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + BICOMP + 124 + + + ICCARM + 150 + + + __cstat + 123 + + + + + BICOMP + 163 159 155 158 156 154 166 153 152 171 176 157 179 + + + ICCARM + 152 158 156 155 154 159 171 157 179 176 163 166 153 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + + + BICOMP + 133 + + + ICCARM + 130 + + + __cstat + 90 + + + + + BICOMP + 159 155 171 153 156 193 166 176 163 239 154 157 179 197 + + + ICCARM + 197 154 155 159 171 157 179 176 163 166 153 156 193 239 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + BICOMP + 128 + + + ICCARM + 126 + + + __cstat + 98 + + + + + BICOMP + 157 159 155 176 163 154 197 171 179 156 193 166 153 + + + ICCARM + 159 155 171 157 179 176 163 197 154 166 153 156 193 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + + + BICOMP + 120 + + + ICCARM + 145 + + + __cstat + 143 + + + + + BICOMP + 156 159 163 155 152 193 158 169 154 166 153 171 176 157 179 172 197 175 + + + ICCARM + 197 154 155 159 171 157 179 176 163 166 153 156 193 169 175 172 152 158 + + + + + $PROJ_DIR$\Debug\Exe\wolfcrypt_benchmark.out + + + ILINK + 170 + + + + + ILINK + 178 244 139 127 130 136 140 225 137 150 147 146 119 145 243 242 126 131 189 164 173 167 174 168 + + + + + + Release + + + [MULTI_TOOL] + ILINK + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewd b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewd new file mode 100644 index 000000000..56146314e --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewd @@ -0,0 +1,3163 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-SPY + 2 + + 28 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 8 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 3 + 1 + 1 + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + TIFET_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + Release + + ARM + + 0 + + C-SPY + 2 + + 28 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 0 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 0 + + + + + + + + + IJET_ID + 2 + + 8 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 16 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 3 + 1 + 0 + + + + + + + + RDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 0 + + + + + + + + TIFET_ID + 2 + + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewp b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewp new file mode 100644 index 000000000..60588995a --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewp @@ -0,0 +1,1995 @@ + + + + 2 + + Debug + + ARM + + 1 + + General + 3 + + 24 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 24 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\Application\runBenchmarks.c + + + + benchmark + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c + + + + Device_Support + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + + + + Setup + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewt b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewt new file mode 100644 index 000000000..6a4d28f19 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewt @@ -0,0 +1,2382 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-STAT + 259 + + 259 + + 0 + + 1 + 600 + 0 + 2 + 0 + 1 + 100 + + + 1.3.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Release + + ARM + + 0 + + C-STAT + 259 + + 259 + + 0 + + 1 + 600 + 0 + 2 + 0 + 1 + 100 + + + 1.3.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\Application\runBenchmarks.c + + + + benchmark + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c + + + + Device_Support + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + + + + Setup + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.Debug.driver.xcl b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.Debug.driver.xcl new file mode 100644 index 000000000..4c14a8e81 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.Debug.driver.xcl @@ -0,0 +1,13 @@ +"--endian=little" + +"--cpu=Cortex-M7" + +"--fpu=VFPv5_D16" + +"--semihosting" + +"--multicore_nr_of_cores=1" + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.Debug.general.xcl b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.Debug.general.xcl new file mode 100644 index 000000000..c83bfd94c --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.Debug.general.xcl @@ -0,0 +1,11 @@ +"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armproc.dll" + +"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armsim2.dll" + +"C:\Users\boz_windows\Desktop\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_lib_SAMV71_XULT\Debug\Bin\wolfcrypt_lib.a" + +--plugin "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armbat.dll" + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.crun b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.crun new file mode 100644 index 000000000..ef39dce8f --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.crun @@ -0,0 +1,16 @@ + + + + 1 + + + * + * + * + 0 + 1 + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.dbgdt b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.dbgdt new file mode 100644 index 000000000..e068f91d1 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.dbgdt @@ -0,0 +1,5 @@ + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.dni b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.dni new file mode 100644 index 000000000..03820ca9d --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/settings/wolfcrypt_lib.dni @@ -0,0 +1,45 @@ +[Stack] +FillEnabled=0 +OverflowWarningsEnabled=1 +WarningThreshold=90 +SpWarningsEnabled=1 +WarnLogOnly=1 +UseTrigger=1 +TriggerName=main +LimitSize=0 +ByteLimit=50 +[InterruptLog] +LogEnabled=0 +GraphEnabled=0 +ShowTimeLog=1 +SumEnabled=0 +ShowTimeSum=1 +SumSortOrder=0 +[DataLog] +LogEnabled=0 +GraphEnabled=0 +ShowTimeLog=1 +SumEnabled=0 +ShowTimeSum=1 +[Disassemble mode] +mode=0 +[Breakpoints2] +Bp0=_ 1 "STD_CODE2" "{$PROJ_DIR$\..\..\..\..\wolfssl\ssl.h}.977.1" 0 0 1 "" 0 "" +Count=1 +[Interrupts] +Enabled=1 +[MemConfig] +Base=1 +Manual=0 +Ddf=1 +TypeViol=0 +Stop=1 +[Trace1] +Enabled=0 +ShowSource=1 +[Aliases] +Count=0 +SuppressDialog=0 +[Simulator] +Freq=10000000 +MultiCoreRunAll=1 diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.dep b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.dep new file mode 100644 index 000000000..6ae9972f1 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.dep @@ -0,0 +1,906 @@ + + + + 2 + 2537152460 + + Debug + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\aes.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\asn.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha20_poly1305.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dsa.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\des3.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\coding.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dh.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\random.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hmac.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md5.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hash.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\poly1305.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rsa.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha256.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\pwdbased.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rabbit.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\misc.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\memory.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\ecc.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md4.c + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hmac.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md2.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\wc_port.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md4.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn_public.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\aes.h + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_encrypt.c + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha256.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dh.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\random.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\logging.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md5.h + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\tfm.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_port.c + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\integer.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\misc.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\pwdbased.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\coding.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\des3.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rsa.h + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha512.c + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\types.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\error-crypt.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\memory.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\visibility.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\settings.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\openssl\bn.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dsa.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha20_poly1305.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\poly1305.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\ssl.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hash.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\openssl\ssl.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\openssl\ec.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ecc.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\version.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\tfm.h + $PROJ_DIR$\Debug\Obj\dsa.__cstat.et + $TOOLKIT_DIR$\inc\c\ycheck.h + $PROJ_DIR$\Debug\Obj\sha512.__cstat.et + $PROJ_DIR$\Debug\Obj\asn.__cstat.et + $TOOLKIT_DIR$\inc\c\DLib_Defaults.h + $PROJ_DIR$\Debug\Obj\sha.__cstat.et + $TOOLKIT_DIR$\inc\c\ysizet.h + $PROJ_DIR$\Debug\Obj\misc.__cstat.et + $PROJ_DIR$\Debug\Obj\memory.__cstat.et + $PROJ_DIR$\Debug\Obj\coding.__cstat.et + $TOOLKIT_DIR$\inc\c\xencoding_limits.h + $PROJ_DIR$\Debug\Obj\pwdbased.pbi + $PROJ_DIR$\Debug\Obj\hash.__cstat.et + $PROJ_DIR$\..\embOS_SAMV71_XULT_user_settings\user_settings.h + $TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h + $PROJ_DIR$\Debug\Obj\hash.pbi + $TOOLKIT_DIR$\inc\c\yvals.h + $PROJ_DIR$\Debug\Obj\dsa.o + $TOOLKIT_DIR$\inc\c\time.h + $PROJ_DIR$\Debug\Obj\sha512.pbi + $PROJ_DIR$\Debug\Obj\des3.__cstat.et + $PROJ_DIR$\Debug\Obj\sha256.__cstat.et + $PROJ_DIR$\Debug\Obj\wc_encrypt.__cstat.et + $PROJ_DIR$\Debug\Obj\wc_encrypt.pbi + $PROJ_DIR$\Debug\Obj\rsa.__cstat.et + $PROJ_DIR$\Debug\Obj\md5.__cstat.et + $TOOLKIT_DIR$\inc\c\math.h + $TOOLKIT_DIR$\inc\c\DLib_Product.h + $PROJ_DIR$\Debug\Obj\hmac.__cstat.et + $PROJ_DIR$\Debug\Obj\dh.__cstat.et + $PROJ_DIR$\Debug\Obj\sha.pbi + $PROJ_DIR$\Debug\Obj\chacha20_poly1305.__cstat.et + $PROJ_DIR$\Debug\Obj\wc_port.__cstat.et + $PROJ_DIR$\Debug\Obj\rabbit.__cstat.et + $PROJ_DIR$\Debug\Obj\memory.pbi + $PROJ_DIR$\Debug\Obj\wc_port.pbi + $PROJ_DIR$\Debug\Obj\hmac.pbi + $PROJ_DIR$\Debug\Obj\md4.o + $PROJ_DIR$\Debug\Obj\md4.__cstat.et + $TOOLKIT_DIR$\inc\c\limits.h + $TOOLKIT_DIR$\inc\c\xtgmath.h + $PROJ_DIR$\Debug\Obj\sha.o + $PROJ_DIR$\Debug\Obj\aes.__cstat.et + $PROJ_DIR$\Debug\Obj\dsa.pbi + $PROJ_DIR$\Debug\Obj\chacha.__cstat.et + $PROJ_DIR$\Debug\Obj\tfm.__cstat.et + $TOOLKIT_DIR$\inc\c\DLib_Product_string.h + $PROJ_DIR$\Debug\Obj\md5.pbi + $PROJ_DIR$\Debug\Obj\md4.pbi + $PROJ_DIR$\Debug\Obj\random.__cstat.et + $PROJ_DIR$\Debug\Obj\des3.o + $TOOLKIT_DIR$\inc\c\xlocale.h + $PROJ_DIR$\Debug\Obj\poly1305.o + $PROJ_DIR$\Debug\Obj\hmac.o + $PROJ_DIR$\Debug\Obj\dh.pbi + $PROJ_DIR$\Debug\Obj\pwdbased.__cstat.et + $PROJ_DIR$\Debug\Obj\wolfcrypt_lib.pbd + $PROJ_DIR$\Debug\Obj\ecc.pbi + $PROJ_DIR$\Debug\Obj\chacha20_poly1305.pbi + $PROJ_DIR$\Debug\Obj\memory.o + $PROJ_DIR$\Debug\Obj\hash.o + $PROJ_DIR$\Debug\Obj\rabbit.pbi + $PROJ_DIR$\Debug\Obj\asn.o + $PROJ_DIR$\Debug\Obj\aes.pbi + $PROJ_DIR$\Debug\Obj\coding.o + $TOOLKIT_DIR$\inc\c\xlocale_c.h + $PROJ_DIR$\Debug\Obj\coding.pbi + $TOOLKIT_DIR$\inc\c\ctype.h + $TOOLKIT_DIR$\inc\c\stdlib.h + $PROJ_DIR$\Debug\Obj\chacha.o + $PROJ_DIR$\Debug\Obj\tfm.pbi + $TOOLKIT_DIR$\inc\c\string.h + $PROJ_DIR$\Debug\Obj\md5.o + $PROJ_DIR$\Debug\Obj\random.o + $PROJ_DIR$\Debug\Obj\misc.pbi + $PROJ_DIR$\Debug\Obj\poly1305.pbi + $PROJ_DIR$\Debug\Obj\chacha.pbi + $PROJ_DIR$\Debug\Obj\sha256.pbi + $PROJ_DIR$\Debug\Obj\poly1305.__cstat.et + $PROJ_DIR$\Debug\Obj\sha512.o + $PROJ_DIR$\Debug\Bin\wolfcrypt_lib.a + $PROJ_DIR$\Debug\Obj\ecc.__cstat.et + $PROJ_DIR$\Debug\Obj\chacha20_poly1305.o + $PROJ_DIR$\Debug\Obj\pwdbased.o + $PROJ_DIR$\Debug\Obj\rsa.pbi + $PROJ_DIR$\Debug\Obj\wc_encrypt.o + $PROJ_DIR$\Debug\Obj\aes.o + $TOOLKIT_DIR$\inc\c\ymath.h + $PROJ_DIR$\Debug\Obj\misc.o + $PROJ_DIR$\Debug\Obj\dh.o + $PROJ_DIR$\Debug\Obj\ecc.o + $PROJ_DIR$\Debug\Obj\random.pbi + $TOOLKIT_DIR$\inc\c\xlocaleuse.h + $PROJ_DIR$\Debug\Obj\rsa.o + $PROJ_DIR$\Debug\Obj\asn.pbi + $TOOLKIT_DIR$\inc\c\DLib_Threads.h + $TOOLKIT_DIR$\inc\c\xmtx.h + $PROJ_DIR$\Debug\Obj\rabbit.o + $PROJ_DIR$\Debug\Obj\des3.pbi + $TOOLKIT_DIR$\inc\c\wchar.h + $TOOLKIT_DIR$\inc\c\xtls.h + $PROJ_DIR$\Debug\Obj\wc_port.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rabbit.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\wc_encrypt.h + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\asm.c + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha512.h + $PROJ_DIR$\Debug\Obj\tfm.o + $PROJ_DIR$\Debug\Obj\sha256.o + $PROJ_DIR$\..\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c + + + [ROOT_NODE] + + + IARCHIVE + 142 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\aes.c + + + BICOMP + 125 + + + ICCARM + 148 + + + __cstat + 104 + + + + + BICOMP + 63 48 129 133 127 130 47 45 78 108 113 46 75 49 68 157 28 33 38 25 72 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 28 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\asn.c + + + BICOMP + 156 + + + ICCARM + 124 + + + __cstat + 65 + + + + + BICOMP + 37 49 167 61 45 58 33 48 68 22 38 63 40 39 55 80 23 157 78 32 41 24 46 42 30 75 31 47 133 129 108 113 127 130 34 43 51 27 25 72 66 76 89 162 154 158 161 101 + + + ICCARM + 49 48 75 41 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 37 61 101 32 30 43 55 34 23 167 31 51 27 58 40 24 22 46 39 42 33 38 80 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha20_poly1305.c + + + BICOMP + 120 + + + ICCARM + 144 + + + __cstat + 93 + + + + + BICOMP + 78 66 63 46 75 89 59 48 25 130 72 76 162 158 52 33 53 38 45 49 47 133 129 68 157 154 161 108 113 127 + + + ICCARM + 49 48 75 52 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 59 53 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dsa.c + + + BICOMP + 105 + + + ICCARM + 79 + + + __cstat + 62 + + + + + BICOMP + 108 25 72 78 37 33 130 63 113 45 51 127 32 46 23 48 75 30 49 47 133 129 68 157 101 66 76 89 162 154 158 161 61 + + + ICCARM + 49 48 75 32 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 30 37 61 101 46 33 23 51 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha.c + + + BICOMP + 138 + + + ICCARM + 131 + + + __cstat + 106 + + + + + BICOMP + 113 75 133 129 45 33 47 63 78 108 59 38 48 49 68 157 127 130 46 25 72 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 59 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\des3.c + + + BICOMP + 160 + + + ICCARM + 112 + + + __cstat + 82 + + + + + BICOMP + 75 133 129 63 47 127 130 45 46 48 49 78 108 113 42 33 38 25 68 157 72 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 42 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\coding.c + + + BICOMP + 128 + + + ICCARM + 126 + + + __cstat + 71 + + + + + BICOMP + 113 48 63 49 68 45 78 108 46 75 47 133 129 127 130 40 33 25 72 157 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 40 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dh.c + + + BICOMP + 116 + + + ICCARM + 151 + + + __cstat + 91 + + + + + BICOMP + 102 133 45 129 63 127 130 78 32 47 108 113 46 49 48 68 157 61 31 88 75 37 25 72 66 76 89 162 154 158 161 101 30 149 + + + ICCARM + 49 48 75 31 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 37 61 101 32 30 46 88 149 102 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\random.c + + + BICOMP + 153 + + + ICCARM + 135 + + + __cstat + 111 + + + + + BICOMP + 30 108 38 78 48 49 45 63 113 75 47 133 129 127 130 32 46 25 68 157 72 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 32 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 30 46 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hmac.c + + + BICOMP + 98 + + + ICCARM + 115 + + + __cstat + 90 + + + + + BICOMP + 45 113 63 47 78 108 46 23 133 129 127 130 22 48 75 49 68 157 34 30 167 25 72 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 22 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 34 23 30 167 46 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md5.c + + + BICOMP + 109 + + + ICCARM + 134 + + + __cstat + 87 + + + + + BICOMP + 63 162 49 48 68 78 38 157 158 46 45 47 133 129 34 75 25 130 72 66 76 89 154 161 108 113 127 + + + ICCARM + 49 48 75 34 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hash.c + + + BICOMP + 77 + + + ICCARM + 122 + + + __cstat + 74 + + + + + BICOMP + 45 127 130 133 129 63 27 55 47 78 108 113 51 23 32 46 49 48 68 157 43 34 58 101 30 33 41 75 25 72 66 76 89 162 154 158 161 37 31 61 167 + + + ICCARM + 49 48 75 33 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 41 37 61 101 32 30 43 55 34 23 167 31 51 27 58 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\poly1305.c + + + BICOMP + 137 + + + ICCARM + 114 + + + __cstat + 140 + + + + + BICOMP + 133 129 63 33 127 130 45 53 38 47 78 108 113 46 49 48 68 157 75 25 72 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 53 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rsa.c + + + BICOMP + 146 + + + ICCARM + 155 + + + __cstat + 86 + + + + + BICOMP + 63 45 47 34 33 133 129 61 32 38 49 48 68 157 78 30 43 46 75 37 55 25 130 72 108 113 127 23 66 76 89 162 154 158 161 101 167 + + + ICCARM + 49 48 75 43 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 37 61 101 32 30 55 34 23 167 46 33 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha256.c + + + BICOMP + 139 + + + ICCARM + 169 + + + __cstat + 83 + + + + + BICOMP + 38 75 25 72 127 130 76 63 46 48 78 66 89 108 113 45 30 33 49 47 133 129 68 157 162 154 158 161 + + + ICCARM + 49 48 75 30 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 33 46 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\pwdbased.c + + + BICOMP + 73 + + + ICCARM + 145 + + + __cstat + 117 + + + + + BICOMP + 63 162 72 76 78 45 130 158 167 46 25 34 22 23 66 89 154 161 30 101 39 37 38 48 75 49 47 133 129 68 157 108 113 127 61 32 + + + ICCARM + 49 48 75 39 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 34 23 22 30 167 37 61 101 32 46 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rabbit.c + + + BICOMP + 123 + + + ICCARM + 159 + + + __cstat + 95 + + + + + BICOMP + 48 63 49 68 127 130 45 46 75 47 133 129 78 108 113 164 33 38 25 72 157 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 164 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\misc.c + + + BICOMP + 136 + + + ICCARM + 150 + + + __cstat + 69 + + + + + BICOMP + 130 45 72 76 63 158 162 78 38 25 66 89 48 75 49 47 133 129 68 157 108 154 161 113 127 + + + ICCARM + 49 48 75 38 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\memory.c + + + BICOMP + 96 + + + ICCARM + 121 + + + __cstat + 70 + + + + + BICOMP + 72 68 78 46 48 130 76 63 75 66 89 25 108 162 158 47 45 157 49 133 129 154 161 113 127 + + + ICCARM + 49 48 75 47 130 63 78 66 76 89 72 157 68 45 25 133 108 129 113 162 158 154 127 161 46 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha.c + + + BICOMP + 92 + + + ICCARM + 103 + + + __cstat + 67 + + + + + BICOMP + 157 127 130 49 48 68 63 33 45 47 133 129 78 108 113 23 46 38 75 25 72 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 23 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 33 46 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\ecc.c + + + BICOMP + 119 + + + ICCARM + 152 + + + __cstat + 143 + + + + + BICOMP + 78 23 33 157 68 63 32 167 58 48 49 61 50 45 41 38 75 47 133 129 108 113 127 130 54 37 57 46 25 72 66 76 89 162 154 158 161 101 30 56 60 31 55 43 51 34 27 + + + ICCARM + 49 48 75 58 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 37 61 101 32 30 57 56 54 60 50 41 43 55 34 23 167 31 51 27 46 33 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md4.c + + + BICOMP + 110 + + + ICCARM + 99 + + + __cstat + 100 + + + + + BICOMP + 72 76 158 63 130 48 162 78 75 25 66 89 26 38 45 49 47 133 129 68 157 108 154 161 113 127 + + + ICCARM + 49 48 75 26 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 38 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_encrypt.c + + + BICOMP + 85 + + + ICCARM + 147 + + + __cstat + 84 + + + + + BICOMP + 66 63 46 78 42 45 25 130 72 89 154 161 28 165 48 75 49 47 133 129 68 76 162 158 157 108 113 127 + + + ICCARM + 49 48 75 28 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 42 165 46 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\tfm.c + + + BICOMP + 132 + + + ICCARM + 168 + + + __cstat + 107 + + + + + BICOMP + 47 45 63 113 32 75 78 108 38 166 133 129 127 130 49 61 48 68 157 101 25 72 66 76 89 162 154 158 161 30 + + + ICCARM + 49 48 75 38 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 32 30 61 101 166 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_port.c + + + BICOMP + 97 + + + ICCARM + 163 + + + __cstat + 94 + + + + + BICOMP + 49 48 68 45 113 157 78 46 75 47 133 129 63 108 127 130 33 25 72 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha512.c + + + BICOMP + 81 + + + ICCARM + 141 + + + __cstat + 64 + + + + + BICOMP + 25 72 127 130 46 45 63 38 78 108 113 167 33 48 75 49 47 133 129 68 157 66 76 89 162 154 158 161 + + + ICCARM + 49 48 75 167 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 33 46 38 + + + + + [REBUILD_ALL] + + + + Release + + + [MULTI_TOOL] + ILINK + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewd b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewd new file mode 100644 index 000000000..e4e3878a4 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewd @@ -0,0 +1,3163 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-SPY + 2 + + 28 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 8 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 3 + 1 + 1 + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + TIFET_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + Release + + ARM + + 0 + + C-SPY + 2 + + 28 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 0 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 0 + + + + + + + + + IJET_ID + 2 + + 8 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 16 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 3 + 1 + 0 + + + + + + + + RDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 0 + + + + + + + + TIFET_ID + 2 + + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewp b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewp new file mode 100644 index 000000000..3dd4eac93 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewp @@ -0,0 +1,2010 @@ + + + + 2 + + Debug + + ARM + + 1 + + General + 3 + + 24 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 24 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + wolfcrypt_sources + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\aes.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\asn.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha20_poly1305.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\coding.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\des3.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dh.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dsa.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\ecc.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hash.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hmac.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md4.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md5.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\memory.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\misc.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\poly1305.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\pwdbased.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rabbit.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\random.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rsa.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha256.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha512.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\tfm.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_encrypt.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_port.c + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewt b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewt new file mode 100644 index 000000000..8dfc682f0 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/wolfcrypt_lib.ewt @@ -0,0 +1,2400 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-STAT + 259 + + 259 + + 0 + + 1 + 600 + 0 + 2 + 0 + 1 + 100 + + + 1.3.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Release + + ARM + + 0 + + C-STAT + 259 + + 259 + + 0 + + 1 + 600 + 0 + 2 + 0 + 1 + 100 + + + 1.3.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + wolfcrypt_sources + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\aes.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\asn.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha20_poly1305.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\coding.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\des3.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dh.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dsa.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\ecc.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hash.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hmac.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md4.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md5.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\memory.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\misc.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\poly1305.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\pwdbased.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rabbit.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\random.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rsa.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha256.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha512.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\tfm.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_encrypt.c + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_port.c + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/Application/runWolfcryptTests.c b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/Application/runWolfcryptTests.c new file mode 100644 index 000000000..63165c238 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/Application/runWolfcryptTests.c @@ -0,0 +1,31 @@ +#include "RTOS.h" +#include "BSP.h" +#include + +static OS_STACKPTR int WLFSTACK[20000]; /* Stack Size */ +static OS_TASK WLFTASK; /* Task-control-blocks */ + +static void wolfTask(void) { + wolfcrypt_test(NULL); + while (1) { + BSP_ToggleLED(1); + OS_Delay(200); + } +} + +/********************************************************************* +* +* main() +*/ +int main(void) { + OS_IncDI(); /* Initially disable interrupts */ + OS_InitKern(); /* Initialize OS */ + OS_InitHW(); /* Initialize Hardware for OS */ + BSP_Init(); /* Initialize LED ports */ + /* You need to create at least one task before calling OS_Start() */ + OS_CREATETASK(&WLFTASK, "Tests task", wolfTask, 100, WLFSTACK); + OS_Start(); /* Start multitasking */ + return 0; +} + +/****** End Of File *************************************************/ diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.driver.xcl b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.driver.xcl new file mode 100644 index 000000000..80545955e --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.driver.xcl @@ -0,0 +1,33 @@ +"--endian=little" + +"--cpu=Cortex-M7" + +"--jlink_exec_command" + +"device ATSAMV71Q21" + +"--fpu=VFPv5_D16" + +"-p" + +"C:\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\ATSAMV71Q21.svd" + +"--semihosting" + +"--drv_communication=USB0" + +"--drv_interface_speed=auto" + +"--jlink_initial_speed=32" + +"--jlink_reset_strategy=0,0" + +"--drv_interface=SWD" + +"--drv_catch_exceptions=0x000" + +"--drv_swo_clock_setup=72000000,0,1000000" + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.general.xcl b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.general.xcl new file mode 100644 index 000000000..8dfd52a15 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.general.xcl @@ -0,0 +1,13 @@ +"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armproc.dll" + +"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armjlink2.dll" + +"C:\Users\boz_windows\Desktop\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Debug\Exe\wolfcrypt_test.out" + +--plugin "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armbat.dll" + +--macro "C:\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\samv7-ek-flash.mac" + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.crun b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.crun new file mode 100644 index 000000000..ef39dce8f --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.crun @@ -0,0 +1,16 @@ + + + + 1 + + + * + * + * + 0 + 1 + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dbgdt b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dbgdt new file mode 100644 index 000000000..b64932dcf --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dbgdt @@ -0,0 +1,115 @@ + + + + + + + + + 56820 + + + + + + 2061516441 + + + + + + + 124272727 + + + + + + Disassembly_I0 + + + + 50020 + + + + 11 + + + + + + + 110$PROJ_DIR$\TermIOInput.txt10 + + + + + + + + + + TabID-12298-19447 + Debug Log + Debug-Log + + + + TabID-11775-19457 + Build + Build + + + + + 0 + + + TabID-23046-19451 + Workspace + Workspace + + + wolfcrypt_test + + + + 0 + + + TabID-1026-19454 + Disassembly + Disassembly + + + + + 0 + + + TabID-32226-19483 + Terminal I/O + TerminalIO + + + + + 0 + + + + + + TextEditor$WS_DIR$\Application\OS_StartLEDBlink.c000004123662366TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\benchmark\benchmark.c00000211000TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfssl\ssl.h000009334117041170TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c000001500TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c000002822082208TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\src\fp_sqr_comba_6.i000001910941094TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\src\tfm.c000004781119511195TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c000009848634863TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c000003281156911569TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Application\OS_StartLEDBlink.c000004928702870TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Application\runBenchmarks.c0000012422422TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c0000012412412TextEditor$WS_DIR$\..\..\..\..\..\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Application\runBenchmarks.c0000012422422TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c000002011114611146TextEditor$WS_DIR$\..\..\..\..\..\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c000006412412TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c000003281156911569150100000010000001 + + + + + + + iaridepm.enu1debuggergui.enu1armjlink2.enu1-2-2304198-2-2200200154560336134154560514286-2-2304359-2-2200200154560336134278980514286-2357304765357-2200200154560336134315301514286-2-21981296-2-212982001003091336134154560336134 + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dni b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dni new file mode 100644 index 000000000..d8653b199 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dni @@ -0,0 +1,134 @@ +[Stack] +FillEnabled=0 +OverflowWarningsEnabled=1 +WarningThreshold=90 +SpWarningsEnabled=1 +WarnLogOnly=1 +UseTrigger=1 +TriggerName=main +LimitSize=0 +ByteLimit=50 +[DebugChecksum] +Checksum=99633143 +[CodeCoverage] +Enabled=_ 0 +[Exceptions] +StopOnUncaught=_ 0 +StopOnThrow=_ 0 +[CallStack] +ShowArgs=0 +[Disassembly] +MixedMode=1 +[Interrupts] +Enabled=1 +[MemConfig] +Base=1 +Manual=0 +Ddf=1 +TypeViol=0 +Stop=1 +[Simulator] +Freq=10000000 +MultiCoreRunAll=1 +[JLinkDriver] +CStepIntDis=_ 0 +LeaveTargetRunning=_ 0 +TraceBufferSize=0x00010000 +TraceStallIfFIFOFull=0x00000000 +TracePortSize=0x00000000 +[SWOTraceHWSettings] +OverrideDefaultClocks=0 +CpuClock=72000000 +ClockAutoDetect=0 +ClockWanted=1000000 +JtagSpeed=1000000 +Prescaler=72 +TimeStampPrescIndex=0 +TimeStampPrescData=0 +PcSampCYCTAP=0 +PcSampPOSTCNT=0 +PcSampIndex=31 +DataLogMode=0 +ITMportsEnable=0 +ITMportsTermIO=0 +ITMportsLogFile=0 +ITMlogFile=$PROJ_DIR$\ITM.log +[Trace1] +Enabled=0 +ShowSource=1 +[Trace2] +Enabled=0 +ShowSource=0 +[SWOTraceWindow] +PcSampling=0 +InterruptLogs=0 +ForcedTimeStamps=0 +EventCPI=0 +EventEXC=0 +EventFOLD=0 +EventLSU=0 +EventSLEEP=0 +[PowerLog] +Title_0=I0 +Symbol_0=0 4 0 +LogEnabled=0 +GraphEnabled=0 +ShowTimeLog=1 +LiveEnabled=0 +LiveFile=PowerLogLive.log +[DataLog] +LogEnabled=0 +GraphEnabled=0 +ShowTimeLog=1 +SumEnabled=0 +ShowTimeSum=1 +[EventLog] +Title_0=Ch3 +Symbol_0=0 4 1 +Title_1=Ch2 +Symbol_1=0 4 1 +Title_2=Ch1 +Symbol_2=0 4 1 +Title_3=Ch0 +Symbol_3=0 4 1 +LogEnabled=0 +GraphEnabled=0 +ShowTimeLog=1 +SumEnabled=0 +ShowTimeSum=1 +SumSortOrder=0 +[InterruptLog] +LogEnabled=0 +GraphEnabled=0 +ShowTimeLog=1 +SumEnabled=0 +ShowTimeSum=1 +SumSortOrder=0 +[Log file] +LoggingEnabled=_ 0 +LogFile=_ "" +Category=_ 0 +[TermIOLog] +LoggingEnabled=_ 0 +LogFile=_ "" +[DriverProfiling] +Enabled=0 +Mode=1 +Graph=0 +Symbiont=0 +Exclusions= +[CallStackLog] +Enabled=0 +[CallStackStripe] +ShowTiming=1 +[PowerProbe] +Frequency=10000 +Probe0=I0 +ProbeSetup0=2 1 1 2 0 0 +[Disassemble mode] +mode=0 +[Breakpoints2] +Count=0 +[Aliases] +Count=0 +SuppressDialog=0 diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test_Debug.jlink b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test_Debug.jlink new file mode 100644 index 000000000..3a2fb4743 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test_Debug.jlink @@ -0,0 +1,39 @@ +[BREAKPOINTS] +ForceImpTypeAny = 0 +ShowInfoWin = 1 +EnableFlashBP = 2 +BPDuringExecution = 0 +[CFI] +CFISize = 0x00 +CFIAddr = 0x00 +[CPU] +MonModeVTableAddr = 0xFFFFFFFF +MonModeDebug = 0 +MaxNumAPs = 0 +LowPowerHandlingMode = 0 +OverrideMemMap = 0 +AllowSimulation = 1 +ScriptFile="" +[FLASH] +CacheExcludeSize = 0x00 +CacheExcludeAddr = 0x00 +MinNumBytesFlashDL = 0 +SkipProgOnCRCMatch = 1 +VerifyDownload = 1 +AllowCaching = 1 +EnableFlashDL = 2 +Override = 1 +Device="ATSAMV71Q21" +[GENERAL] +WorkRAMSize = 0x00 +WorkRAMAddr = 0x00 +RAMUsageLimit = 0x00 +[SWO] +SWOLogFile="" +[MEM] +RdOverrideOrMask = 0x00 +RdOverrideAndMask = 0xFFFFFFFF +RdOverrideAddr = 0xFFFFFFFF +WrOverrideOrMask = 0x00 +WrOverrideAndMask = 0xFFFFFFFF +WrOverrideAddr = 0xFFFFFFFF diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.dep b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.dep new file mode 100644 index 000000000..b9e151dfb --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.dep @@ -0,0 +1,1031 @@ + + + + 2 + 4231226308 + + Debug + + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ripemd.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dh.h + $PROJ_DIR$\Debug\List\test.lst + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rabbit.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\des3.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\aes.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hmac.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\srp.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\BSP.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\certs_test.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hc128.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\error-crypt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\efc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gpbr.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pmc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usart.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\xdmac.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\mem_track.h + $PROJ_DIR$\..\embOS_SAMV71_XULT_Linker_Script\samv71q21_wolfssl.icf + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\tc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rswdt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\matrix.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\chipid.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_samv71.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\smc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Int.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\logging.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\smc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\matrix.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc3.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71q21.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piod.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rstc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\ssc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piob.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\chipid.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\acc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart3.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\OS_Config.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\acc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\utmi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mlb.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\qspi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\efc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\xdmac.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\aes.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\aes.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\icm.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\ssc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\dacc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\supc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pio.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rstc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rswdt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\hsmci.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\afec.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\isi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart2.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gmac.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\trng.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\twihs.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\wdt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\sdramc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc2.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pmc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\isi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\trng.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mcan.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart2.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pwm.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mlb.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart4.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gpbr.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\utmi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs2.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\spi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\pio\samv71q21.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gmac.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usbhs.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\supc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Conf.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioe.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\dacc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\sdramc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\icm.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\wdt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\qspi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\uart.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\hsmci.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usbhs.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioa.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + $PROJ_DIR$\Application\runWolfcryptTests.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\test\test.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + $PROJ_DIR$\Debug\List\SEGGER_HardFaultHandler.lst + $TOOLKIT_DIR$\inc\c\yvals.h + $PROJ_DIR$\Debug\List\JLINKMEM_Process.lst + $PROJ_DIR$\..\embOS_SAMV71_XULT_user_settings\user_settings.h + $PROJ_DIR$\Debug\List\SEGGER_SYSVIEW_embOS.lst + $TOOLKIT_DIR$\inc\c\wchar.h + $TOOLKIT_DIR$\inc\c\xlocale_c.h + $TOOLKIT_DIR$\inc\c\xtls.h + $TOOLKIT_DIR$\inc\c\intrinsics.h + $TOOLKIT_DIR$\inc\c\DLib_Product_string.h + $TOOLKIT_DIR$\inc\c\ysizet.h + $PROJ_DIR$\Debug\List\runWolfcryptTests.lst + $TOOLKIT_DIR$\inc\c\limits.h + $PROJ_DIR$\Debug\List\SEGGER_SYSVIEW.lst + $TOOLKIT_DIR$\CMSIS\Include\core_cmInstr.h + $TOOLKIT_DIR$\inc\c\xlocale.h + $PROJ_DIR$\Debug\List\BSP.lst + $TOOLKIT_DIR$\inc\c\DLib_Threads.h + $PROJ_DIR$\Debug\List\system_sam.lst + $PROJ_DIR$\Debug\Obj\test.o + $TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h + $TOOLKIT_DIR$\inc\c\stdio.h + $TOOLKIT_DIR$\inc\c\ystdio.h + $TOOLKIT_DIR$\inc\c\ctype.h + $PROJ_DIR$\Debug\List\xmtx2.lst + $TOOLKIT_DIR$\inc\c\DLib_Product.h + $PROJ_DIR$\Debug\Obj.o + $TOOLKIT_DIR$\inc\c\DLib_Defaults.h + $TOOLKIT_DIR$\inc\c\cmsis_iar.h + $TOOLKIT_DIR$\CMSIS\Include\core_cmSimd.h + $TOOLKIT_DIR$\inc\c\xmtx.h + $TOOLKIT_DIR$\inc\c\xlocaleuse.h + $PROJ_DIR$\Debug\List\SEGGER_RTT_printf.lst + $TOOLKIT_DIR$\inc\c\xencoding_limits.h + $PROJ_DIR$\Debug\List\OS_Error.lst + $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.pbi + $TOOLKIT_DIR$\inc\c\stdlib.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + $PROJ_DIR$\Debug\List\wolfcrypt_test.map + $PROJ_DIR$\Debug\Obj\test.pbi + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.pbi + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.pbi + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_ConfDefaults.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + $PROJ_DIR$\Debug\Obj\runWolfcryptTests.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + $PROJ_DIR$\..\..\..\..\wolfcrypt\test\test.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + $PROJ_DIR$\Debug\Obj\OS_Error.pbi + $PROJ_DIR$\Debug\List\RTOSInit_SAMV71_CMSIS.lst + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.pbi + $TOOLKIT_DIR$\lib\shb_l.a + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + $PROJ_DIR$\Debug\Obj\BSP.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.pbi + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + $PROJ_DIR$\Debug\Obj\startup_sam.__cstat.et + $PROJ_DIR$\Debug\Obj\OS_Error.__cstat.et + $PROJ_DIR$\Debug\Obj\xmtx.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.pbi + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.__cstat.et + $PROJ_DIR$\..\embOS_wolfcrypt_lib_SAMV71_XULT\Debug\Bin\wolfcrypt_lib.a + $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.__cstat.et + $TOOLKIT_DIR$\lib\dl7M_tln.a + $TOOLKIT_DIR$\lib\rt7M_tl.a + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.__cstat.et + $PROJ_DIR$\Debug\Exe\wolfcrypt_test.out + $PROJ_DIR$\Debug\Obj\system_sam.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.o + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\test\test.h + $PROJ_DIR$\Debug\Obj\xmtx2.pbi + $PROJ_DIR$\Debug\List\SEGGER_SYSVIEW_Config_embOS.lst + $PROJ_DIR$\Debug\List\xmtx.lst + $TOOLKIT_DIR$\inc\c\stdarg.h + $PROJ_DIR$\Debug\Obj\wolfcrypt_test.pbd + $PROJ_DIR$\Debug\Obj\system_sam.o + $PROJ_DIR$\Debug\Obj\startup_sam.pbi + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.__cstat.et + $PROJ_DIR$\Debug\Obj\startup_sam.o + $PROJ_DIR$\Debug\Obj\BSP.__cstat.et + $PROJ_DIR$\Debug\Obj\system_sam.pbi + $PROJ_DIR$\Debug\Obj\xmtx2.o + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.__cstat.et + $PROJ_DIR$\Debug\Obj\runWolfcryptTests.pbi + $PROJ_DIR$\Debug\Obj\runWolfcryptTests.o + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.o + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.o + $TOOLKIT_DIR$\inc\c\string.h + $PROJ_DIR$\Debug\Obj\xmtx2.__cstat.et + $PROJ_DIR$\Debug\List\SEGGER_RTT.lst + $PROJ_DIR$\Debug\Obj\xmtx.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\visibility.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\types.h + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.__cstat.et + $PROJ_DIR$\Debug\List\startup_sam.lst + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\camellia.h + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.o + $TOOLKIT_DIR$\inc\c\ycheck.h + $PROJ_DIR$\Debug\Obj\xmtx.__cstat.et + $TOOLKIT_DIR$\CMSIS\Include\core_cm7.h + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.o + $PROJ_DIR$\Debug\Obj\BSP.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn_public.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha20_poly1305.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\tfm.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\memory.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\poly1305.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ecc.h + $PROJ_DIR$\Debug\Obj\test.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.o + $TOOLKIT_DIR$\inc\c\stdint.h + $TOOLKIT_DIR$\CMSIS\Include\core_cmFunc.h + $TOOLKIT_DIR$\lib\m7M_tlv.a + $PROJ_DIR$\Debug\Obj\OS_Error.o + $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.o + $PROJ_DIR$\Debug\Obj\HardFaultHandler.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rsa.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\RTOS.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\integer.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\wc_port.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\arc4.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\random.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\coding.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\settings.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha512.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md5.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha256.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md4.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hash.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dsa.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\idea.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\pwdbased.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_Conf.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md2.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\Global.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Lib\os7m_tlv_dp.a + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\JLINKMEM.h + + + [ROOT_NODE] + + + ILINK + 211 172 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + + + BICOMP + 226 + + + ICCARM + 151 220 + + + __cstat + 212 + + + + + BICOMP + 244 257 68 75 91 79 106 90 134 246 64 110 112 88 98 95 70 82 65 62 78 74 113 96 108 100 101 89 147 35 45 61 111 85 87 63 93 76 99 67 73 55 109 104 97 92 84 105 83 114 103 107 86 150 162 27 56 26 51 14 59 25 48 15 50 21 46 32 60 20 77 16 47 17 39 52 80 24 58 72 53 29 42 71 34 22 69 57 54 28 33 81 41 13 40 36 37 23 38 66 43 160 166 153 158 258 141 161 94 + + + ICCARM + 94 35 257 244 134 160 153 158 166 150 246 147 161 141 258 162 27 45 56 70 26 61 51 75 14 111 59 82 25 85 48 64 15 87 50 65 21 63 46 79 32 93 60 62 20 76 77 110 16 99 47 78 17 67 39 68 52 73 80 74 24 55 58 112 72 109 53 113 29 104 42 106 71 97 34 96 22 92 69 88 57 84 54 108 28 105 33 91 81 83 41 100 13 114 40 98 36 103 37 101 23 107 38 90 66 86 43 89 95 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + + + AARM + 262 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + + + BICOMP + 221 + + + ICCARM + 240 224 + + + __cstat + 198 + + + + + BICOMP + 21 23 29 26 17 28 25 20 24 22 13 160 244 258 257 27 14 15 32 16 52 72 71 57 81 36 66 158 56 51 59 48 50 46 60 77 47 39 80 58 53 42 34 69 54 33 41 40 37 38 43 166 153 35 246 45 70 61 75 111 82 85 64 87 65 63 79 93 62 76 110 99 78 67 68 73 74 55 112 109 113 104 106 97 96 92 88 84 108 105 91 83 100 114 98 103 101 107 90 86 89 95 134 150 147 162 141 161 94 + + + ICCARM + 94 35 257 244 134 160 153 158 166 150 246 147 161 141 258 162 27 45 56 70 26 61 51 75 14 111 59 82 25 85 48 64 15 87 50 65 21 63 46 79 32 93 60 62 20 76 77 110 16 99 47 78 17 67 39 68 52 73 80 74 24 55 58 112 72 109 53 113 29 104 42 106 71 97 34 96 22 92 69 88 57 84 54 108 28 105 33 91 81 83 41 100 13 114 40 98 36 103 37 101 23 107 38 90 66 86 43 89 95 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + + + BICOMP + 176 + + + ICCARM + 135 243 + + + __cstat + 222 + + + + + BICOMP + 134 244 160 142 141 44 143 166 150 286 233 153 158 264 + + + ICCARM + 264 233 244 134 160 153 158 166 150 143 142 141 44 286 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + BICOMP + 189 + + + ICCARM + 167 260 + + + __cstat + 199 + + + + + BICOMP + 153 134 233 244 141 158 264 44 143 142 160 166 150 + + + ICCARM + 264 233 244 134 160 153 158 166 150 143 142 141 44 + + + + + $PROJ_DIR$\Application\runWolfcryptTests.c + + + BICOMP + 229 + + + ICCARM + 144 230 + + + __cstat + 180 + + + + + BICOMP + 244 160 214 233 142 158 9 141 143 166 153 134 264 44 150 + + + ICCARM + 264 233 244 134 160 153 158 166 150 143 142 141 44 9 214 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + + + BICOMP + 194 + + + ICCARM + 149 248 + + + __cstat + 225 + + + + + BICOMP + 41 59 80 60 34 43 56 50 47 53 54 37 257 51 48 46 77 39 58 42 69 33 40 38 244 166 153 27 26 14 25 15 21 32 20 16 17 52 24 72 29 71 22 57 28 81 13 36 23 66 160 158 258 94 35 246 45 70 61 75 111 82 85 64 87 65 63 79 93 62 76 110 99 78 67 68 73 74 55 112 109 113 104 106 97 96 92 88 84 108 105 91 83 100 114 98 103 101 107 90 86 89 95 134 150 147 162 141 161 9 + + + ICCARM + 9 94 35 257 244 134 160 153 158 166 150 246 147 161 141 258 162 27 45 56 70 26 61 51 75 14 111 59 82 25 85 48 64 15 87 50 65 21 63 46 79 32 93 60 62 20 76 77 110 16 99 47 78 17 67 39 68 52 73 80 74 24 55 58 112 72 109 53 113 29 104 42 106 71 97 34 96 22 92 69 88 57 84 54 108 28 105 33 91 81 83 41 100 13 114 40 98 36 103 37 101 23 107 38 90 66 86 43 89 95 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + BICOMP + 195 + + + ICCARM + 216 241 + + + __cstat + 239 + + + + + BICOMP + 115 233 134 150 244 282 141 44 283 264 143 142 160 166 153 158 284 + + + ICCARM + 264 233 244 134 160 153 158 166 150 143 142 141 44 282 284 283 115 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + + + BICOMP + 175 + + + ICCARM + 190 231 + + + __cstat + 204 + + + + + BICOMP + 111 83 150 134 244 73 93 97 86 162 141 45 87 99 109 84 103 61 85 63 76 67 55 104 92 105 114 107 94 44 283 246 70 75 82 64 65 79 62 110 78 68 74 112 113 106 96 88 108 91 100 98 101 90 89 95 147 161 282 286 233 143 142 160 166 153 158 284 35 257 27 56 26 51 14 59 25 48 15 50 21 46 32 60 20 77 16 47 17 39 52 80 24 58 72 53 29 42 71 34 22 69 57 54 28 33 81 41 13 40 36 37 23 38 66 43 258 264 + + + ICCARM + 264 233 244 134 160 153 158 166 150 143 142 141 44 282 284 283 94 35 257 246 147 161 258 162 27 45 56 70 26 61 51 75 14 111 59 82 25 85 48 64 15 87 50 65 21 63 46 79 32 93 60 62 20 76 77 110 16 99 47 78 17 67 39 68 52 73 80 74 24 55 58 112 72 109 53 113 29 104 42 106 71 97 34 96 22 92 69 88 57 84 54 108 28 105 33 91 81 83 41 100 13 114 40 98 36 103 37 101 23 107 38 90 66 86 43 89 95 286 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + + + BICOMP + 203 + + + ICCARM + 137 247 + + + __cstat + 228 + + + + + BICOMP + 141 134 150 244 49 44 279 282 233 143 142 160 166 153 158 283 264 284 + + + ICCARM + 264 233 244 134 160 153 158 166 150 143 142 141 44 282 284 283 49 279 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\test\test.c + + + BICOMP + 173 + + + ICCARM + 2 152 + + + __cstat + 255 + + + + + BICOMP + 154 7 169 163 267 250 238 166 153 244 140 134 274 5 277 266 268 281 280 273 269 253 276 3 0 254 160 158 164 138 145 275 272 143 249 271 263 6 242 1 8 11 4 278 12 10 214 18 237 136 270 252 233 156 150 142 148 139 265 251 155 31 + + + ICCARM + 270 237 136 249 238 266 252 169 244 134 160 153 158 166 150 143 233 142 156 148 140 163 164 139 138 254 265 251 145 268 273 280 272 274 281 271 267 269 263 275 5 6 253 242 7 1 276 8 277 11 3 4 250 278 0 12 10 154 155 214 18 31 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + BICOMP + 200 + + + ICCARM + 217 236 + + + __cstat + 245 + + + + + BICOMP + 153 134 244 166 150 233 264 160 158 141 44 143 142 + + + ICCARM + 134 244 160 153 158 166 150 264 233 143 142 141 44 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + BICOMP + 191 + + + ICCARM + 235 213 + + + __cstat + 223 + + + + + BICOMP + 150 134 244 279 141 233 143 142 49 160 166 153 158 + + + ICCARM + 49 279 141 244 233 134 160 153 158 166 150 143 142 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + + + BICOMP + 215 + + + ICCARM + 157 227 + + + __cstat + 234 + + + + + BICOMP + 153 134 244 166 150 233 264 160 158 141 44 143 142 + + + ICCARM + 134 244 160 153 158 166 150 264 233 143 142 141 44 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + + + BICOMP + 201 + + + ICCARM + 146 256 + + + __cstat + 210 + + + + + BICOMP + 102 244 218 143 134 233 284 158 49 169 282 178 283 279 141 142 153 30 160 166 150 + + + ICCARM + 30 282 284 283 102 178 279 141 244 49 233 134 160 153 158 166 150 143 142 169 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + + + BICOMP + 168 + + + ICCARM + 133 261 + + + __cstat + 206 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + + + BICOMP + 202 + + + ICCARM + 165 232 + + + __cstat + 209 + + + + + BICOMP + 244 166 218 279 141 134 150 169 143 160 49 153 158 + + + ICCARM + 49 279 141 244 169 134 160 153 158 166 150 143 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + + + BICOMP + 215 + + + __cstat + 234 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + + + BICOMP + 194 + + + __cstat + 225 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + + + BICOMP + 175 + + + __cstat + 204 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + + + BICOMP + 226 + + + __cstat + 212 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + + + BICOMP + 203 + + + __cstat + 228 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + + + BICOMP + 176 + + + __cstat + 222 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + BICOMP + 195 + + + __cstat + 239 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + + + BICOMP + 168 + + + __cstat + 206 + + + + + $PROJ_DIR$\..\..\..\..\wolfcrypt\test\test.c + + + BICOMP + 173 + + + ICCARM + 152 + + + __cstat + 255 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + + + BICOMP + 202 + + + __cstat + 209 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + BICOMP + 191 + + + __cstat + 223 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + + + BICOMP + 201 + + + __cstat + 210 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + BICOMP + 200 + + + __cstat + 245 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + BICOMP + 189 + + + __cstat + 199 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + + + BICOMP + 221 + + + __cstat + 198 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + + + AARM + 262 159 + + + + + $PROJ_DIR$\Debug\Exe\wolfcrypt_test.out + + + ILINK + 172 + + + + + ILINK + 19 248 262 243 260 231 230 261 213 232 256 241 247 224 220 152 236 227 205 285 192 208 259 207 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\wolfcrypt\test\test.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + ICCARM + + + + Release + + + [MULTI_TOOL] + ILINK + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewd b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewd new file mode 100644 index 000000000..25c4c6aff --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewd @@ -0,0 +1,3163 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-SPY + 2 + + 28 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 8 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 3 + 1 + 1 + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + TIFET_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 1 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + Release + + ARM + + 0 + + C-SPY + 2 + + 28 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 0 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 0 + + + + + + + + + IJET_ID + 2 + + 8 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 16 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 3 + 1 + 0 + + + + + + + + RDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 0 + + + + + + + + TIFET_ID + 2 + + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewp b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewp new file mode 100644 index 000000000..92300a3f8 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewp @@ -0,0 +1,1995 @@ + + + + 2 + + Debug + + ARM + + 1 + + General + 3 + + 24 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 24 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\Application\runWolfcryptTests.c + + + + Device_Support + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + + + + Setup + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + + + + wolfcrypt_test + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\test\test.c + + + + + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewt b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewt new file mode 100644 index 000000000..1c009036c --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewt @@ -0,0 +1,2382 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-STAT + 259 + + 259 + + 0 + + 1 + 600 + 0 + 2 + 0 + 1 + 100 + + + 1.3.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Release + + ARM + + 0 + + C-STAT + 259 + + 259 + + 0 + + 1 + 600 + 0 + 2 + 0 + 1 + 100 + + + 1.3.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\Application\runWolfcryptTests.c + + + + Device_Support + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + + + + Setup + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + + + + wolfcrypt_test + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\test\test.c + + + + + diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 76cd20f71..b78f5887e 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -2108,6 +2108,22 @@ void bench_ed25519KeySign(void) return (double)tv.SECONDS + (double)tv.MILLISECONDS / 1000; } +#elif defined(WOLFSSL_EMBOS) + + #include "RTOS.h" + + double current_time(int reset) + { + double time_now; + double current_s = OS_GetTime() / 1000.0; + double current_us = OS_GetTime_us() / 1000000.0; + time_now = (double)( current_s + current_us); + + (void) reset; + + return time_now; + } + #else #include diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 235dce133..910c06703 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -145,7 +145,8 @@ int wc_FreeRng(WC_RNG* rng) #else #if !defined(NO_DEV_RANDOM) && !defined(CUSTOM_RAND_GENERATE) && \ !defined(WOLFSSL_GENSEED_FORTEST) && !defined(WOLFSSL_MDK_ARM) && \ - !defined(WOLFSSL_IAR_ARM) && !defined(WOLFSSL_ROWLEY_ARM) + !defined(WOLFSSL_IAR_ARM) && !defined(WOLFSSL_ROWLEY_ARM) && \ + !defined(WOLFSSL_EMBOS) #include #ifndef EBSNET #include @@ -1359,7 +1360,8 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) return 0; } -#elif defined(WOLFSSL_LPC43xx) || defined(WOLFSSL_STM32F2xx) || defined(MBED) +#elif defined(WOLFSSL_LPC43xx) || defined(WOLFSSL_STM32F2xx) || defined(MBED) \ + || defined(WOLFSSL_EMBOS) #warning "write a real random seed!!!!, just for testing now" diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 34fd8536a..dfeece18a 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -969,7 +969,8 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL*, void* key, unsigned int len, #include #include #elif !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_IAR_ARM) && \ - !defined(WOLFSSL_PICOTCP) && !defined(WOLFSSL_ROWLEY_ARM) + !defined(WOLFSSL_PICOTCP) && !defined(WOLFSSL_ROWLEY_ARM) && \ + !defined(WOLFSSL_EMBOS) #include #endif /* allow writev style writing */ diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 7a66fb754..3d95efcb4 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -142,6 +142,9 @@ /* Uncomment next line if building for uTasker */ /* #define WOLFSSL_UTASKER */ +/* Uncomment next line if building for embOS */ +/* #define WOLFSSL_EMBOS */ + #include #ifdef WOLFSSL_USER_SETTINGS @@ -409,6 +412,14 @@ #endif #endif +#ifdef WOLFSSL_EMBOS + #define USE_FAST_MATH + #define NO_FILESYSTEM /* Not ported at this time */ + #define USE_CERT_BUFFERS_2048 /* use when NO_FILESYSTEM */ + #define NO_MAIN_DRIVER + #define NO_RC4 + #define SINGLE_THREADED /* Not ported at this time */ +#endif /* Micrium will use Visual Studio for compilation but not the Win32 API */ #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \ From d91ec3ce77162b7aa2826c61346afaee218ae2f5 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Wed, 4 May 2016 09:02:50 -0600 Subject: [PATCH 151/192] fix aes_asm.asm header format --- wolfcrypt/src/aes_asm.asm | 46 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/wolfcrypt/src/aes_asm.asm b/wolfcrypt/src/aes_asm.asm index 6fe026d5c..3c625bc11 100644 --- a/wolfcrypt/src/aes_asm.asm +++ b/wolfcrypt/src/aes_asm.asm @@ -1,28 +1,28 @@ -; /*aes_asm . asm -; * -; *Copyright[C]2006 -2014 wolfSSL Inc . -; * -; *This file is part of wolfssl. (formerly known as CyaSSL) -; * -; *wolfSSL is free software/ you can redistribute it and/or modify -; *it under the terms of the GNU General Public License as published by -; *the Free Software Foundation/ either version 2 of the License, or -; *[at your option]any later version . -; * -; *wolfSSL ,is distributed in the hope that it will be useful -; *but WITHOUT ANY WARRANTY/ without even the implied warranty of -; *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the -; *GNU General Public License for more details . -; * -; *You should have received a copy of the GNU General Public License -; *along with this program/ if not, write to the Free Software -; *Foundation,Inc .,51 Franklin Street,Fifth Floor,Boston,MA 02110-1301,USA -; */ +; /* aes_asm.asm +; * +; * Copyright (C) 2006-2016 wolfSSL Inc. +; * +; * This file is part of wolfssl. (formerly known as CyaSSL) +; * +; * wolfSSL is free software; you can redistribute it and/or modify +; * it under the term of the GNU General Public License as published by +; * the Free Software Foundation/either version 2 of the License, or +; * (at your option) any later version. +; * +; * wolfSSL is distributed in the hope that it will be useful, +; * but WITHOUT ANY WARRANTY; without even the implied warranty of +; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; * GNU General Public License for more details. +; * +; * You should have received a copy of the GNU General Public License +; * along with this program; if not, write to the Free Software +; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +; */ ; ; -; /*See IntelA dvanced Encryption Standard[AES]Instructions Set White Paper -; *by Israel,Intel Mobility Group Development Center,Israel Shay Gueron -; */ +; /* See Intel Advanced Encryption Standard (AES) Instructions Set White Paper +; * by Israel, Intel Mobility Group Development Center, Israel Shay Gueron +; */ ; ; /* This file is in intel asm syntax, see .s for at&t syntax */ ; From 197672d4fc9956950c3adb2cffcc393d9c5a7bda Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 4 May 2016 09:05:11 -0600 Subject: [PATCH 152/192] define KEEP_OUR_CERT to set keeping ssl certificate --- src/internal.c | 2 +- src/ssl.c | 18 ++++++++++++------ wolfssl/internal.h | 4 ++-- wolfssl/ssl.h | 2 +- wolfssl/test.h | 2 +- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/internal.c b/src/internal.c index bf78a27a3..39af8da3d 100755 --- a/src/internal.c +++ b/src/internal.c @@ -643,7 +643,7 @@ void SSL_CtxResourceFree(WOLFSSL_CTX* ctx) #ifndef NO_CERTS FreeDer(&ctx->privateKey); FreeDer(&ctx->certificate); - #ifdef OPENSSL_EXTRA + #ifdef KEEP_OUR_CERT FreeX509(ctx->ourCert); if (ctx->ourCert) { XFREE(ctx->ourCert, ctx->heap, DYNAMIC_TYPE_X509); diff --git a/src/ssl.c b/src/ssl.c index f4c7eb628..21a801259 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -3468,7 +3468,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, /* Make sure previous is free'd */ if (ssl->buffers.weOwnCert) { FreeDer(&ssl->buffers.certificate); - #ifdef OPENSSL_EXTRA + #ifdef KEEP_OUR_CERT FreeX509(ssl->ourCert); if (ssl->ourCert) { XFREE(ssl->ourCert, ssl->heap, DYNAMIC_TYPE_X509); @@ -3477,14 +3477,14 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, #endif } XMEMCPY(&ssl->buffers.certificate, &der, sizeof(der)); - #ifdef OPENSSL_EXTRA + #ifdef KEEP_OUR_CERT ssl->keepCert = 1; /* hold cert for ssl lifetime */ #endif ssl->buffers.weOwnCert = 1; } else if (ctx) { FreeDer(&ctx->certificate); /* Make sure previous is free'd */ - #ifdef OPENSSL_EXTRA + #ifdef KEEP_OUR_CERT FreeX509(ctx->ourCert); if (ctx->ourCert) { XFREE(ctx->ourCert, ctx->heap, DYNAMIC_TYPE_X509); @@ -8037,7 +8037,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) if (ssl->buffers.weOwnCert && !ssl->keepCert) { WOLFSSL_MSG("Unloading cert"); FreeDer(&ssl->buffers.certificate); - #ifdef OPENSSL_EXTRA + #ifdef KEEP_OUR_CERT FreeX509(ssl->ourCert); if (ssl->ourCert) { XFREE(ssl->ourCert, ssl->heap, DYNAMIC_TYPE_X509); @@ -10756,7 +10756,9 @@ WOLFSSL_X509* wolfSSL_X509_load_certificate_file(const char* fname, int format) #endif /* KEEP_PEER_CERT || SESSION_CERTS */ -#ifdef OPENSSL_EXTRA /* needed for wolfSSL_X509_d21 function */ +/* OPENSSL_EXTRA is needed for wolfSSL_X509_d21 function + KEEP_OUR_CERT is to insure ability for returning ssl certificate */ +#if defined(OPENSSL_EXTRA) && defined(KEEP_OUR_CERT) WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl) { if (ssl == NULL) { @@ -10785,7 +10787,7 @@ WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl) } } } -#endif /* OPENSSL_EXTRA */ +#endif /* OPENSSL_EXTRA && KEEP_OUR_CERT */ #endif /* NO_CERTS */ @@ -11192,6 +11194,10 @@ const char* wolfSSL_CIPHER_get_name(const WOLFSSL_CIPHER* cipher) return "TLS_DHE_RSA_WITH_AES_128_CBC_SHA"; case TLS_DHE_RSA_WITH_AES_256_CBC_SHA : return "TLS_DHE_RSA_WITH_AES_256_CBC_SHA"; + #ifndef NO_DES3 + case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA: + return "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA"; + #endif #endif #ifndef NO_HC128 #ifndef NO_MD5 diff --git a/wolfssl/internal.h b/wolfssl/internal.h index d24f3fce7..7047b4567 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1903,7 +1903,7 @@ struct WOLFSSL_CTX { DerBuffer* privateKey; WOLFSSL_CERT_MANAGER* cm; /* our cert manager, ctx owns SSL will use */ #endif -#ifdef OPENSSL_EXTRA +#ifdef KEEP_OUR_CERT WOLFSSL_X509* ourCert; /* keep alive a X509 struct of cert */ #endif Suites* suites; /* make dynamic, user may not need/set */ @@ -2726,7 +2726,7 @@ struct WOLFSSL { #ifdef KEEP_PEER_CERT WOLFSSL_X509 peerCert; /* X509 peer cert */ #endif -#ifdef OPENSSL_EXTRA +#ifdef KEEP_OUR_CERT WOLFSSL_X509* ourCert; /* keep alive a X509 struct of cert. points to ctx if not owned (owned flag found in buffers.weOwnCert) */ diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index ceea78c31..92d783976 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1012,7 +1012,7 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL*, void* key, unsigned int len, const unsigned char*, long); WOLFSSL_API int wolfSSL_UnloadCertsKeys(WOLFSSL*); - #ifdef OPENSSL_EXTRA + #if defined(OPENSSL_EXTRA) && defined(KEEP_OUR_CERT) WOLFSSL_API WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl); #endif #endif diff --git a/wolfssl/test.h b/wolfssl/test.h index 8c0468660..d979872ca 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -495,7 +495,7 @@ static INLINE void showPeer(WOLFSSL* ssl) printf("peer has no cert!\n"); wolfSSL_FreeX509(peer); #endif -#if defined(SHOW_CERTS) && defined(OPENSSL_EXTRA) +#if defined(SHOW_CERTS) && defined(OPENSSL_EXTRA) && defined(KEEP_OUR_CERT) ShowX509(wolfSSL_get_certificate(ssl), "our cert info:"); #endif /* SHOW_CERTS */ printf("SSL version is %s\n", wolfSSL_get_version(ssl)); From 822d71431ee06b51582558db9fbfcbfaa4ae2ece Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 4 May 2016 10:04:38 -0700 Subject: [PATCH 153/192] Moved mem_track.h into wolfssl/wolfcrypt. Added new WOLFSSL_DEBUG_MEMORY option. Added documentation for using mem_track and new debug memory option. --- wolfcrypt/benchmark/benchmark.c | 2 +- wolfcrypt/src/memory.c | 44 +++++++++++++++---- wolfcrypt/test/test.c | 2 +- wolfssl/include.am | 3 +- wolfssl/test.h | 2 +- wolfssl/wolfcrypt/include.am | 3 +- wolfssl/{ => wolfcrypt}/mem_track.h | 65 ++++++++++++++++++++++++++++- wolfssl/wolfcrypt/memory.h | 27 ++++++++---- wolfssl/wolfcrypt/types.h | 12 ++++-- 9 files changed, 134 insertions(+), 26 deletions(-) rename wolfssl/{ => wolfcrypt}/mem_track.h (71%) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 76cd20f71..a30d49513 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -130,7 +130,7 @@ #include "wolfcrypt/benchmark/benchmark.h" #ifdef USE_WOLFSSL_MEMORY - #include "wolfssl/mem_track.h" + #include "wolfssl/wolfcrypt/mem_track.h" #endif void bench_des(void); diff --git a/wolfcrypt/src/memory.c b/wolfcrypt/src/memory.c index 663da8d41..865022923 100644 --- a/wolfcrypt/src/memory.c +++ b/wolfcrypt/src/memory.c @@ -43,6 +43,7 @@ #include #endif + /* Set these to default values initially. */ static wolfSSL_Malloc_cb malloc_function = 0; static wolfSSL_Free_cb free_function = 0; @@ -72,15 +73,24 @@ int wolfSSL_SetAllocators(wolfSSL_Malloc_cb mf, return res; } - +#ifdef WOLFSSL_DEBUG_MEMORY +void* wolfSSL_Malloc(size_t size, const char* func, unsigned int line) +#else void* wolfSSL_Malloc(size_t size) +#endif { void* res = 0; - if (malloc_function) + if (malloc_function) { + #ifdef WOLFSSL_DEBUG_MEMORY + res = malloc_function(size, func, line); + #else res = malloc_function(size); - else + #endif + } + else { res = malloc(size); + } #ifdef WOLFSSL_MALLOC_CHECK if (res == NULL) @@ -90,22 +100,42 @@ void* wolfSSL_Malloc(size_t size) return res; } +#ifdef WOLFSSL_DEBUG_MEMORY +void wolfSSL_Free(void *ptr, const char* func, unsigned int line) +#else void wolfSSL_Free(void *ptr) +#endif { - if (free_function) + if (free_function) { + #ifdef WOLFSSL_DEBUG_MEMORY + free_function(ptr, func, line); + #else free_function(ptr); - else + #endif + } + else { free(ptr); + } } +#ifdef WOLFSSL_DEBUG_MEMORY +void* wolfSSL_Realloc(void *ptr, size_t size, const char* func, unsigned int line) +#else void* wolfSSL_Realloc(void *ptr, size_t size) +#endif { void* res = 0; - if (realloc_function) + if (realloc_function) { + #ifdef WOLFSSL_DEBUG_MEMORY + res = realloc_function(ptr, size, func, line); + #else res = realloc_function(ptr, size); - else + #endif + } + else { res = realloc(ptr, size); + } return res; } diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 6b7ddb1ab..b776a47aa 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -143,7 +143,7 @@ #include "wolfcrypt/test/test.h" #ifdef USE_WOLFSSL_MEMORY - #include "wolfssl/mem_track.h" + #include "wolfssl/wolfcrypt/mem_track.h" #endif diff --git a/wolfssl/include.am b/wolfssl/include.am index bd5abbb6b..a02488fc8 100644 --- a/wolfssl/include.am +++ b/wolfssl/include.am @@ -18,8 +18,7 @@ nobase_include_HEADERS+= \ wolfssl/version.h \ wolfssl/options.h \ wolfssl/ocsp.h \ - wolfssl/crl.h \ - wolfssl/mem_track.h + wolfssl/crl.h noinst_HEADERS+= \ wolfssl/internal.h diff --git a/wolfssl/test.h b/wolfssl/test.h index d979872ca..f8dc9d18f 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #ifdef ATOMIC_USER #include diff --git a/wolfssl/wolfcrypt/include.am b/wolfssl/wolfcrypt/include.am index 14f162a45..db5701f2a 100644 --- a/wolfssl/wolfcrypt/include.am +++ b/wolfssl/wolfcrypt/include.am @@ -54,7 +54,8 @@ nobase_include_HEADERS+= \ wolfssl/wolfcrypt/logging.h \ wolfssl/wolfcrypt/memory.h \ wolfssl/wolfcrypt/mpi_class.h \ - wolfssl/wolfcrypt/mpi_superclass.h + wolfssl/wolfcrypt/mpi_superclass.h \ + wolfssl/wolfcrypt/mem_track.h noinst_HEADERS+= \ wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h \ diff --git a/wolfssl/mem_track.h b/wolfssl/wolfcrypt/mem_track.h similarity index 71% rename from wolfssl/mem_track.h rename to wolfssl/wolfcrypt/mem_track.h index 3b9906505..4d69a565b 100644 --- a/wolfssl/mem_track.h +++ b/wolfssl/wolfcrypt/mem_track.h @@ -20,6 +20,40 @@ */ +/* The memory tracker overrides the wolfSSL memory callback system and uses a + * static to track the total, peak and currently allocated bytes. + * + * If you are already using the memory callbacks then enabling this will + * override the memory callbacks and prevent your memory callbacks from + * working. This assumes malloc() and free() are available. Feel free to + * customize this for your needs. + + * The enable this feature define the following: + * #define USE_WOLFSSL_MEMORY + * #define WOLFSSL_TRACK_MEMORY + * + * On startup call: + * InitMemoryTracker(); + * + * When ready to dump the memory report call: + * ShowMemoryTracker(); + * + * Report example: + * total Allocs = 228 + * total Bytes = 93442 + * peak Bytes = 8840 + * current Bytes = 0 + * + * + * You can also: + * #define WOLFSSL_DEBUG_MEMORY + * + * To print every alloc/free along with the function and line number. + * Example output: + * Alloc: 0x7fa14a500010 -> 120 at wc_InitRng:496 + * Free: 0x7fa14a500010 -> 120 at wc_FreeRng:606 + */ + #ifndef WOLFSSL_MEM_TRACK_H #define WOLFSSL_MEM_TRACK_H @@ -64,7 +98,11 @@ #define STATIC static #endif +#ifdef WOLFSSL_DEBUG_MEMORY + STATIC INLINE void* TrackMalloc(size_t sz, const char* func, unsigned int line) +#else STATIC INLINE void* TrackMalloc(size_t sz) +#endif { memoryTrack* mt; @@ -78,6 +116,10 @@ mt->u.hint.thisSize = sz; mt->u.hint.thisMemory = (byte*)mt + sizeof(memoryTrack); +#ifdef WOLFSSL_DEBUG_MEMORY + printf("Alloc: %p -> %u at %s:%d\n", mt->u.hint.thisMemory, (word32)sz, func, line); +#endif + #ifdef DO_MEM_STATS ourMemStats.totalAllocs++; ourMemStats.totalBytes += sz; @@ -90,7 +132,11 @@ } +#ifdef WOLFSSL_DEBUG_MEMORY + STATIC INLINE void TrackFree(void* ptr, const char* func, unsigned int line) +#else STATIC INLINE void TrackFree(void* ptr) +#endif { memoryTrack* mt; @@ -105,13 +151,25 @@ ourMemStats.currentBytes -= mt->u.hint.thisSize; #endif +#ifdef WOLFSSL_DEBUG_MEMORY + printf("Free: %p -> %u at %s:%d\n", ptr, (word32)mt->u.hint.thisSize, func, line); +#endif + free(mt); } +#ifdef WOLFSSL_DEBUG_MEMORY + STATIC INLINE void* TrackRealloc(void* ptr, size_t sz, const char* func, unsigned int line) +#else STATIC INLINE void* TrackRealloc(void* ptr, size_t sz) +#endif { + #ifdef WOLFSSL_DEBUG_MEMORY + void* ret = TrackMalloc(sz, func, line); + #else void* ret = TrackMalloc(sz); + #endif if (ptr) { /* if realloc is bigger, don't overread old ptr */ @@ -125,8 +183,13 @@ if (ret && ptr) memcpy(ret, ptr, sz); - if (ret) + if (ret) { + #ifdef WOLFSSL_DEBUG_MEMORY + TrackFree(ptr, func, line); + #else TrackFree(ptr); + #endif + } return ret; } diff --git a/wolfssl/wolfcrypt/memory.h b/wolfssl/wolfcrypt/memory.h index 30d5c1626..5bf8c26f6 100644 --- a/wolfssl/wolfcrypt/memory.h +++ b/wolfssl/wolfcrypt/memory.h @@ -33,22 +33,31 @@ extern "C" { #endif -typedef void *(*wolfSSL_Malloc_cb)(size_t size); -typedef void (*wolfSSL_Free_cb)(void *ptr); -typedef void *(*wolfSSL_Realloc_cb)(void *ptr, size_t size); +#ifdef WOLFSSL_DEBUG_MEMORY + typedef void *(*wolfSSL_Malloc_cb)(size_t size, const char* func, unsigned int line); + typedef void (*wolfSSL_Free_cb)(void *ptr, const char* func, unsigned int line); + typedef void *(*wolfSSL_Realloc_cb)(void *ptr, size_t size, const char* func, unsigned int line); + /* Public in case user app wants to use XMALLOC/XFREE */ + WOLFSSL_API void* wolfSSL_Malloc(size_t size, const char* func, unsigned int line); + WOLFSSL_API void wolfSSL_Free(void *ptr, const char* func, unsigned int line); + WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size, const char* func, unsigned int line); +#else + typedef void *(*wolfSSL_Malloc_cb)(size_t size); + typedef void (*wolfSSL_Free_cb)(void *ptr); + typedef void *(*wolfSSL_Realloc_cb)(void *ptr, size_t size); + + /* Public in case user app wants to use XMALLOC/XFREE */ + WOLFSSL_API void* wolfSSL_Malloc(size_t size); + WOLFSSL_API void wolfSSL_Free(void *ptr); + WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size); +#endif /* Public set function */ WOLFSSL_API int wolfSSL_SetAllocators(wolfSSL_Malloc_cb malloc_function, wolfSSL_Free_cb free_function, wolfSSL_Realloc_cb realloc_function); -/* Public in case user app wants to use XMALLOC/XFREE */ -WOLFSSL_API void* wolfSSL_Malloc(size_t size); -WOLFSSL_API void wolfSSL_Free(void *ptr); -WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size); - - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 2c134d542..42d442f8a 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -189,9 +189,15 @@ && !defined(WOLFSSL_uITRON4) && !defined(WOLFSSL_uTKERNEL2) /* default C runtime, can install different routines at runtime via cbs */ #include - #define XMALLOC(s, h, t) ((void)h, (void)t, wolfSSL_Malloc((s))) - #define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp));} - #define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n)) + #ifdef WOLFSSL_DEBUG_MEMORY + #define XMALLOC(s, h, t) ((void)h, (void)t, wolfSSL_Malloc((s), __func__, __LINE__)) + #define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp), __func__, __LINE__);} + #define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n), __func__, __LINE__) + #else + #define XMALLOC(s, h, t) ((void)h, (void)t, wolfSSL_Malloc((s))) + #define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp));} + #define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n)) + #endif #endif #ifndef STRING_USER From 6e26cac686c625336b2cad574a8e02a5a42b75ce Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Wed, 4 May 2016 13:03:05 -0700 Subject: [PATCH 154/192] Reworking directories and simplify README --- IDE/IAR-EWARM/embOS/.gitignore | 1 + IDE/IAR-EWARM/embOS/README | 11 +- IDE/IAR-EWARM/embOS/SAMV71_XULT/README_SAMV71 | 9 + .../Application/runBenchmarks.c | 24 +- .../README_wolfcrypt_benchmark} | 54 +- .../wolfcrypt_benchmark.Debug.driver.xcl | 2 +- .../wolfcrypt_benchmark.Debug.general.xcl | 4 +- .../settings/wolfcrypt_benchmark.dbgdt | 4 +- .../settings/wolfcrypt_benchmark.dni | 2 +- .../wolfcrypt_benchmark.dep | 1243 +++++------ .../wolfcrypt_benchmark.ewd | 4 +- .../wolfcrypt_benchmark.ewp | 38 +- .../wolfcrypt_benchmark.ewt | 30 +- .../README_wolfcrypt_lib | 44 + .../settings/wolfcrypt_lib.Debug.general.xcl | 2 +- .../wolfcrypt_lib.dep | 1387 ++++++------ .../Application/runWolfcryptTests.c | 26 +- .../README_wolfcrypt_test | 69 + .../settings/wolfcrypt_test.Debug.driver.xcl | 2 +- .../settings/wolfcrypt_test.Debug.general.xcl | 4 +- .../settings/wolfcrypt_test.dbgdt | 14 +- .../settings/wolfcrypt_test.dni | 2 +- .../wolfcrypt_test.dep | 1853 +++++++++++------ .../wolfcrypt_test.ewd | 4 +- .../wolfcrypt_test.ewp | 38 +- .../wolfcrypt_test.ewt | 30 +- .../{ => custom_port}/README_custom_port | 145 +- .../samv71q21_wolfssl.icf | 57 + .../custom_port_user_settings/user_settings.h | 67 + .../Application/runBenchmarks.c | 29 + .../Application/runWolfcryptTests.c | 30 + .../README_extract_trial_here | 1 + wolfcrypt/benchmark/benchmark.c | 2 +- 33 files changed, 3026 insertions(+), 2206 deletions(-) create mode 100644 IDE/IAR-EWARM/embOS/.gitignore create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/README_SAMV71 rename IDE/IAR-EWARM/embOS/{README_SAMV71 => SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/README_wolfcrypt_benchmark} (65%) create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_lib_SAMV71_XULT/README_wolfcrypt_lib create mode 100644 IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/README_wolfcrypt_test rename IDE/IAR-EWARM/embOS/{ => custom_port}/README_custom_port (55%) create mode 100644 IDE/IAR-EWARM/embOS/custom_port/custom_port_Linker_Script/samv71q21_wolfssl.icf create mode 100644 IDE/IAR-EWARM/embOS/custom_port/custom_port_user_settings/user_settings.h create mode 100644 IDE/IAR-EWARM/embOS/custom_port/wolfcrypt_benchmark_custom_port/Application/runBenchmarks.c create mode 100644 IDE/IAR-EWARM/embOS/custom_port/wolfcrypt_test_custom_port/Application/runWolfcryptTests.c create mode 100644 IDE/IAR-EWARM/embOS/extract_trial_here/README_extract_trial_here diff --git a/IDE/IAR-EWARM/embOS/.gitignore b/IDE/IAR-EWARM/embOS/.gitignore new file mode 100644 index 000000000..64acf8a62 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/.gitignore @@ -0,0 +1 @@ +*.bat \ No newline at end of file diff --git a/IDE/IAR-EWARM/embOS/README b/IDE/IAR-EWARM/embOS/README index 7c53221b6..4fac7ca47 100644 --- a/IDE/IAR-EWARM/embOS/README +++ b/IDE/IAR-EWARM/embOS/README @@ -1,18 +1,23 @@ -#-----------------------------------------------------------------------------# +#-----------------------------------------------------------------------------# wolfSSL + embOS + IAR Workbench #-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------# For building the existing examples on a SAMV71_Explained_Ultra with Cortex M7 #-----------------------------------------------------------------------------# -see README_SAMV71 + + See SAMV71_XULT\\README_ + + I.E. SAMV71_XULT\embOS_wolfcrypt_lib_SAMV71_XULT\README_wolfcrypt_lib #-----------------------------------------------------------------------------# For building wolfssl on a new CPU that is supported by embOS in IAR Workbench #-----------------------------------------------------------------------------# -see README_custom_port + See custom_port\README_custom_port +#-----------------------------------------------------------------------------# +#-----------------------------------------------------------------------------# Thank you for choosing wolfSSL if you ever have any questions please contact us! diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/README_SAMV71 b/IDE/IAR-EWARM/embOS/SAMV71_XULT/README_SAMV71 new file mode 100644 index 000000000..05532e095 --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/README_SAMV71 @@ -0,0 +1,9 @@ +Each example project here has it's own README please follow them in detail. + +Thank you for using this guide and we hope this is helpful to you. If you have +any suggestions / feedback for us please contact us: +support@wolfssl.com +info@wolfssl.com + +Copyright © 2016 wolfSSL Inc. All rights reserved. + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/Application/runBenchmarks.c b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/Application/runBenchmarks.c index 4bb00b69f..3f36707e9 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/Application/runBenchmarks.c +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/Application/runBenchmarks.c @@ -1,31 +1,29 @@ #include "RTOS.h" #include "BSP.h" +#include #include -static OS_STACKPTR int WLFSTACK[20000]; /* Stack Size */ -static OS_TASK WLFTASK; /* Task-control-blocks */ +static OS_STACKPTR int WLFSTACK[20000]; /* Stack Size for Task */ +static OS_TASK WLFTASK; /* Task */ static void wolfTask(void) { + printf("Begin Benchmark Tests\n"); benchmark_test(NULL); + printf("Benchmark Tests Complete\n"); while (1) { BSP_ToggleLED(1); OS_Delay(200); } } -/********************************************************************* -* -* main() -*/ + int main(void) { - OS_IncDI(); /* Initially disable interrupts */ - OS_InitKern(); /* Initialize OS */ - OS_InitHW(); /* Initialize Hardware for OS */ - BSP_Init(); /* Initialize LED ports */ + OS_IncDI(); /* Disable interrupts */ + OS_InitKern(); /* Initialize OS */ + OS_InitHW(); /* Initialize Hardware */ + BSP_Init(); /* Initialize LED ports */ /* You need to create at least one task before calling OS_Start() */ OS_CREATETASK(&WLFTASK, "Tests task", wolfTask, 100, WLFSTACK); - OS_Start(); /* Start multitasking */ + OS_Start(); /* Start the OS */ return 0; } - -/****** End Of File *************************************************/ diff --git a/IDE/IAR-EWARM/embOS/README_SAMV71 b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/README_wolfcrypt_benchmark similarity index 65% rename from IDE/IAR-EWARM/embOS/README_SAMV71 rename to IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/README_wolfcrypt_benchmark index 7dce91230..fe85473d0 100644 --- a/IDE/IAR-EWARM/embOS/README_SAMV71 +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/README_wolfcrypt_benchmark @@ -3,6 +3,7 @@ Steps taken to evaluate wolfSSL with the following: Required Software for this guide: IAR Embedded Workbench IDE - ARM v7.60.1 (or similar version) embOS v4.16 (for Cortex-M and IAR compiler) +wolfssl (latest version) Required items (Hardware) for this guide: Atmel SAM V71 Xplained Ultra (Or equivelent Cortex-M Evaluation Board) @@ -18,57 +19,23 @@ Micro usb cable For this guide "**SAMV71_DIR" will signify the directory: C:\\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\ - -#----------------------------------------------------------------------------# -# Create wolfcrypt_lib.a -#----------------------------------------------------------------------------# - -1. Open IAR Workbench -> Project -> Add Existing Project - a. Browse to **SAMV71_DIR\embOS_wolfcrypt_lib - c. Choose wolfcrypt_lib.ewp and click "Open" - -2. Go to Project -> Rebuild All - -3. Verify the library built, you should no have: - **SAMV71_DIR\embOS_wolfcrypt_lib\Debug\Bin\wolfcrypt_lib.a - - #----------------------------------------------------------------------------# # Setup file system to evaluate wolfssl in embOS project: +# (If you have not already done so) #----------------------------------------------------------------------------# -1. On your PC create the empty directory C:\embos-trial\ +1. In wolfssl you will notice the directory: + wolfssl\IDE\IAR-EWARM\embOS\extract_trial_here 2. go to embOS website and download a trial for your platform https://www.segger.com/downloads/embos -> embOS trial for Cortex-M and IAR compiler -3. Extract (unzip) the download to C:\embos-trial +3. Extract (unzip) the download to + C:\\wolfssl\IDE\IAR-EWARM\embOS\extract_trial_here\ (Note: you do not need to do anything further in this directory, the wolfSSL evaluation projects will simply link against it) - -#----------------------------------------------------------------------------# -# Evaluate wolfcrypt_tests in embOS project: -#----------------------------------------------------------------------------# - -1. In IAR Workbench go to Project -> Add Existing Project - a. Browse to **SAMV71_DIR\embOS_wolfcrypt_test_SAMV71_XULT\ - b. Choose wolfcrypt_test.ewp and click "Open" - -2. Go to Project -> Rebuild All - -3. Connect your SAMV71 Xplained Ultra to your PC with micro USB in the "Debug" - port for power and the J-Link hooked up to SWD pins and your PC - -4. Go to Project -> Download and Debug - -5. Once the "Debug" environment has loaded go to: View -> Terminal I/O - (This is where the printf's will be directed to) - -6. Hit "Go" (Debug option with 3 left arrows "→→→") - -7. You should observe the tests run and pass. - + #----------------------------------------------------------------------------# # Evaluate wolfcrypt_benchmarks in embOS project: #----------------------------------------------------------------------------# @@ -87,13 +54,12 @@ C:\\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\ 5. Once the "Debug" environment has loaded go to: View -> Terminal I/O (This is where the printf's will be directed to) -6. Hit "Go" (Debug option with 3 left arrows "→→→") +6. Hit "Go" (Debug option with 3 right arrows "→→→") 7. You should observe the benchmark times for the configured algorithms. - - - +#----------------------------------------------------------------------------# +#----------------------------------------------------------------------------# Thank you for using this guide and we hope this was helpful to you. If you have any suggestions / feedback for us please contact us: diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.driver.xcl b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.driver.xcl index 885e2a33f..c88ed70d1 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.driver.xcl +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.driver.xcl @@ -10,7 +10,7 @@ "-p" -"C:\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\ATSAMV71Q21.svd" +"C:\Users\boz_windows\Desktop\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\ATSAMV71Q21.svd" "--semihosting" diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.general.xcl b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.general.xcl index b8ec42cb2..07cf4682d 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.general.xcl +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.Debug.general.xcl @@ -2,11 +2,11 @@ "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armjlink2.dll" -"C:\Users\boz_windows\Desktop\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Debug\Exe\wolfcrypt_benchmark.out" +"C:\Users\boz_windows\Desktop\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Debug\Exe\wolfcrypt_benchmark.out" --plugin "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armbat.dll" ---macro "C:\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\samv7-ek-flash.mac" +--macro "C:\Users\boz_windows\Desktop\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\samv7-ek-flash.mac" diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dbgdt b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dbgdt index edfa8fc39..3817a8646 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dbgdt +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dbgdt @@ -101,14 +101,14 @@ - TextEditor$WS_DIR$\Application\OS_StartLEDBlink.c000004123662366TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\benchmark\benchmark.c00000211000TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfssl\ssl.h000009334117041170TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c000001500TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c000002822082208TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\src\fp_sqr_comba_6.i000001910941094TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\src\tfm.c000004781119511195TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c000009848634863TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c000003281156911569TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Application\OS_StartLEDBlink.c000004928702870TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Application\runBenchmarks.c0000012422422TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c0000012412412TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c000002011114611146TextEditor$WS_DIR$\..\..\..\..\..\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c000006412412TextEditor$WS_DIR$\..\..\..\..\..\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Application\runBenchmarks.c0000012422422TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c000003281156911569150100000010000001 + TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\src\tfm.c0000017113907839078TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c0000012423423TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Application\runBenchmarks.c0000011432432TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c00000328115691156930100000010000001 - iaridepm.enu1debuggergui.enu1armjlink2.enu1-2-2304198-2-2200200154560336134154560514286-2-2304417-2-2200200154560336134323802514286-24153041098415-2200200154560336134527821514286-2-21981296-2-212982001003091336134154560336134 + iaridepm.enu1debuggergui.enu1armjlink2.enu1-2-2304198-2-2200200154560336134154560514286-2-2304417-2-2200200154560336134323802514286-24153041098415-2200200154560336134527821514286-2-21981296-2-212982001003091336134154560336134 diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dni b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dni index b756ea17d..7a5211987 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dni +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/settings/wolfcrypt_benchmark.dni @@ -9,7 +9,7 @@ TriggerName=main LimitSize=0 ByteLimit=50 [DebugChecksum] -Checksum=822032712 +Checksum=-866273587 [CodeCoverage] Enabled=_ 0 [Exceptions] diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.dep b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.dep index 5646a0b9f..ca0bf37d3 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.dep +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.dep @@ -2,291 +2,381 @@ 2 - 3271176394 + 2974958069 Debug - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c - $PROJ_DIR$\Application\runBenchmarks.c $PROJ_DIR$\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\smc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piod.h - $TOOLKIT_DIR$\CMSIS\Include\core_cmFunc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\efc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pmc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\dacc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mlb.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\twihs.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\aes.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pmc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\isi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\tc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rswdt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\chipid.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\spi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\qspi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\isi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gpbr.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\icm.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\smc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\supc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\uart.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\efc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mcan.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc3.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\ssc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usart.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\xdmac.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rswdt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\matrix.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart2.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\acc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pio.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\utmi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart3.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rstc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\pio\samv71q21.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart4.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gmac.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\hsmci.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\sdramc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs2.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\icm.h - $TOOLKIT_DIR$\CMSIS\Include\core_cm7.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\utmi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\xdmac.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usbhs.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc2.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gpbr.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\matrix.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\trng.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\ssc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rstc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pwm.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart2.h - $TOOLKIT_DIR$\CMSIS\Include\core_cmInstr.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\wdt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piob.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi0.h - $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.__cstat.et - $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.__cstat.et - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\supc.h - $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.__cstat.et - $PROJ_DIR$\Debug\Obj\runBenchmarks.__cstat.et - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioe.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\hsmci.h - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.__cstat.et - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioa.h - $PROJ_DIR$\Debug\Obj\xmtx.__cstat.et - $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.__cstat.et - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\trng.h - $PROJ_DIR$\Debug\Obj\startup_sam.__cstat.et - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\dacc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usbhs.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\sdramc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mlb.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\qspi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\wdt.h - $PROJ_DIR$\Debug\Obj\xmtx2.__cstat.et - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.__cstat.et - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gmac.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart1.h - $PROJ_DIR$\Debug\Obj\BSP.__cstat.et - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc1.h - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.o - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.pbi - $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.pbi - $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.pbi - $PROJ_DIR$\Debug\Obj\SEGGER_RTT.__cstat.et - $PROJ_DIR$\Debug\Obj\SEGGER_RTT.pbi - $PROJ_DIR$\Debug\Obj\OS_Error.__cstat.et - $PROJ_DIR$\Debug\Obj\xmtx.o - $PROJ_DIR$\Debug\Obj\HardFaultHandler.o - $PROJ_DIR$\Debug\Obj\xmtx.pbi - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.pbi - $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.o - $PROJ_DIR$\Debug\Obj\xmtx2.o - $PROJ_DIR$\Debug\Obj\system_sam.__cstat.et - $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.pbi - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.pbi - $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.pbi - $PROJ_DIR$\Debug\Obj\OS_Error.o - $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.o - $PROJ_DIR$\Debug\Obj\BSP.pbi - $PROJ_DIR$\Debug\Obj\BSP.o - $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.o - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\acc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\afec.h - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.__cstat.et - $PROJ_DIR$\Debug\Obj\xmtx2.pbi - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.o - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.o - $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.o - $PROJ_DIR$\Debug\Obj\OS_Error.pbi - $PROJ_DIR$\Debug\Obj\benchmark.__cstat.et - $PROJ_DIR$\Debug\Obj\SEGGER_RTT.o - $TOOLKIT_DIR$\CMSIS\Include\core_cmSimd.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.h - $TOOLKIT_DIR$\inc\c\DLib_Product_string.h - $TOOLKIT_DIR$\inc\c\string.h - $TOOLKIT_DIR$\inc\c\ycheck.h - $TOOLKIT_DIR$\inc\c\intrinsics.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + $PROJ_DIR$\Application\runBenchmarks.c $TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_Conf.h - $TOOLKIT_DIR$\inc\c\yvals.h - $TOOLKIT_DIR$\inc\c\stdint.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71q21.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\aes.h + $PROJ_DIR$\Debug\Obj\xmtx2.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.pbi + $PROJ_DIR$\Debug\Obj\BSP.o + $TOOLKIT_DIR$\inc\c\string.h + $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.pbi + $TOOLKIT_DIR$\CMSIS\Include\core_cmSimd.h + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.o + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.o $TOOLKIT_DIR$\inc\c\DLib_Threads.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Lib\os7m_tlv_dp.a - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\chipid.h - $TOOLKIT_DIR$\inc\c\ysizet.h - $TOOLKIT_DIR$\lib\rt7M_tl.a - $TOOLKIT_DIR$\lib\dl7M_tln.a - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.h - $PROJ_DIR$\Debug\List\wolfcrypt_benchmark.map - $TOOLKIT_DIR$\inc\c\DLib_Defaults.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\Global.h - $TOOLKIT_DIR$\lib\shb_l.a - $TOOLKIT_DIR$\lib\m7M_tlv.a - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER.h - $TOOLKIT_DIR$\inc\c\xencoding_limits.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_samv71.h - $PROJ_DIR$\..\embOS_SAMV71_XULT_Linker_Script\samv71q21_wolfssl.icf - $TOOLKIT_DIR$\inc\c\DLib_Product.h - $TOOLKIT_DIR$\inc\c\cmsis_iar.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\arc4.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha.h + $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.o + $PROJ_DIR$\Debug\Obj\OS_Error.o + $PROJ_DIR$\Debug\Obj\system_sam.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.o + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.pbi + $TOOLKIT_DIR$\inc\c\xmtx.h + $PROJ_DIR$\Debug\Obj\OS_Error.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.o + $TOOLKIT_DIR$\inc\c\xtls.h + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.o + $TOOLKIT_DIR$\inc\c\ycheck.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\mem_track.h + $TOOLKIT_DIR$\inc\c\intrinsics.h + $PROJ_DIR$\Debug\Obj\BSP.pbi + $PROJ_DIR$\Debug\Obj\benchmark.__cstat.et + $TOOLKIT_DIR$\inc\c\DLib_Product_string.h + $PROJ_DIR$\Debug\Obj\benchmark.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\integer.h + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\benchmark\benchmark.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn_public.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rabbit.h + $PROJ_DIR$\..\embOS_wolfcrypt_lib_SAMV71_XULT\Debug\Bin\wolfcrypt_lib.a + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\des3.h + $PROJ_DIR$\Debug\Obj\startup_sam.pbi + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\types.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md5.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\poly1305.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ecc.h + $TOOLKIT_DIR$\inc\c\stdlib.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\tfm.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dh.h + $TOOLKIT_DIR$\inc\c\ystdio.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hc128.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rabbit.h - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\benchmark\benchmark.h - $PROJ_DIR$\..\embOS_wolfcrypt_lib_SAMV71_XULT\Debug\Bin\wolfcrypt_lib.a - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn_public.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\BSP.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\logging.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\OS_Config.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md5.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\types.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\des3.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\RTOS.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\integer.h $TOOLKIT_DIR$\inc\c\xlocale_c.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha256.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha512.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\random.h $TOOLKIT_DIR$\inc\c\limits.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dsa.h - $TOOLKIT_DIR$\inc\c\xlocale.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\wc_port.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\mem_track.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\camellia.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rsa.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\aes.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\visibility.h - $TOOLKIT_DIR$\inc\c\xmtx.h - $TOOLKIT_DIR$\inc\c\xtls.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.h - $PROJ_DIR$\Debug\Exe\wolfcrypt_benchmark.out + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dsa.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\random.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha512.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha256.h + $TOOLKIT_DIR$\inc\c\xlocale.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\camellia.h $PROJ_DIR$\Debug\Obj\wolfcrypt_benchmark.pbd - $PROJ_DIR$\Debug\Obj\benchmark.pbi - $TOOLKIT_DIR$\inc\c\ctype.h - $TOOLKIT_DIR$\inc\c\stdio.h - $PROJ_DIR$\..\embOS_SAMV71_XULT_user_settings\user_settings.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\memory.h - $TOOLKIT_DIR$\inc\c\stdarg.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rsa.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\visibility.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\logging.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\wc_port.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\settings.h $PROJ_DIR$\Debug\Obj\runBenchmarks.pbi - $PROJ_DIR$\Debug\Obj\runBenchmarks.o - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_ConfDefaults.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha20_poly1305.h + $PROJ_DIR$\Debug\Obj\system_sam.pbi + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\memory.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\certs_test.h + $TOOLKIT_DIR$\CMSIS\Include\core_cm7.h $TOOLKIT_DIR$\inc\c\xlocaleuse.h $TOOLKIT_DIR$\inc\c\wchar.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hash.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ripemd.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\settings.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Int.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\certs_test.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dh.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\tfm.h - $TOOLKIT_DIR$\inc\c\stdlib.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Conf.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\JLINKMEM.h - $TOOLKIT_DIR$\inc\c\ystdio.h - $PROJ_DIR$\Debug\Obj\startup_sam.pbi + $TOOLKIT_DIR$\inc\c\stdarg.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha20_poly1305.h $PROJ_DIR$\Debug\Obj\system_sam.o + $TOOLKIT_DIR$\inc\c\ctype.h + $PROJ_DIR$\..\embOS_SAMV71_XULT_user_settings\user_settings.h + $TOOLKIT_DIR$\inc\c\stdio.h + $PROJ_DIR$\Debug\Obj\runBenchmarks.o $PROJ_DIR$\Debug\Obj\startup_sam.o - $PROJ_DIR$\Debug\Obj\benchmark.o - $PROJ_DIR$\Debug\Obj\system_sam.pbi - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart2.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\efc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usart.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pmc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gpbr.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_samv71.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mcan.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pwm.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rstc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\smc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pmc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\isi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rswdt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\efc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pio.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart3.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc2.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gmac.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\acc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piod.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\utmi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\twihs.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtc.h + $TOOLKIT_DIR$\CMSIS\Include\core_cmFunc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\aes.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\icm.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\aes.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gmac.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mlb.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\icm.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\xdmac.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc3.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\acc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\sdramc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\ssc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\matrix.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piob.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71q21.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\chipid.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rstc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\afec.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\dacc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\qspi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\hsmci.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mlb.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\ssc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\dacc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\isi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gpbr.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\pio\samv71q21.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioa.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart2.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart4.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\uart.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usbhs.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\hsmci.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\wdt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\trng.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\spi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs2.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\supc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\qspi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\sdramc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioe.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usbhs.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\supc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\utmi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\wdt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\trng.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\Lib\os7m_tlv_dp.a + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\xdmac.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\tc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\chipid.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rswdt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\smc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\matrix.h + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.__cstat.et + $PROJ_DIR$\Debug\Obj\xmtx.o + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.pbi + $PROJ_DIR$\Debug\Obj\xmtx.pbi + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.h + $PROJ_DIR$\Debug\Obj\BSP.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.pbi + $PROJ_DIR$\Debug\Obj\startup_sam.__cstat.et + $PROJ_DIR$\Debug\Obj\xmtx2.o + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Int.h + $TOOLKIT_DIR$\CMSIS\Include\core_cmInstr.h + $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.__cstat.et + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.__cstat.et + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_ConfDefaults.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.h + $PROJ_DIR$\Debug\Obj\HardFaultHandler.o + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.o + $PROJ_DIR$\Debug\Obj\xmtx2.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.o + $PROJ_DIR$\Debug\Obj\xmtx.__cstat.et + $PROJ_DIR$\Debug\Obj\OS_Error.__cstat.et + $PROJ_DIR$\..\..\extract_trial_here\Start\Inc\BSP.h + $PROJ_DIR$\..\..\extract_trial_here\Start\Inc\JLINKMEM.h + $PROJ_DIR$\Debug\Obj\runBenchmarks.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.__cstat.et + $PROJ_DIR$\..\..\extract_trial_here\Start\Inc\RTOS.h + $PROJ_DIR$\..\..\extract_trial_here\Start\Inc\OS_Config.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Conf.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_Conf.h + $TOOLKIT_DIR$\lib\shb_l.a + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.pbi + $TOOLKIT_DIR$\inc\c\ysizet.h + $PROJ_DIR$\Debug\List\wolfcrypt_benchmark.map + $PROJ_DIR$\Debug\Exe\wolfcrypt_benchmark.out + $TOOLKIT_DIR$\inc\c\stdint.h + $TOOLKIT_DIR$\lib\m7M_tlv.a + $TOOLKIT_DIR$\lib\rt7M_tl.a + $TOOLKIT_DIR$\inc\c\DLib_Product.h + $TOOLKIT_DIR$\inc\c\yvals.h + $TOOLKIT_DIR$\inc\c\xencoding_limits.h + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.pbi + $TOOLKIT_DIR$\lib\dl7M_tln.a + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\arc4.h + $TOOLKIT_DIR$\inc\c\cmsis_iar.h + $PROJ_DIR$\..\embOS_SAMV71_XULT_Linker_Script\samv71q21_wolfssl.icf + $PROJ_DIR$\Debug\Obj\benchmark.pbi + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha.h + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.__cstat.et + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn.h + $TOOLKIT_DIR$\inc\c\DLib_Defaults.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\Global.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c [ROOT_NODE] ILINK - 215 170 + 215 214 - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c BICOMP - 245 + 227 ICCARM - 242 + 33 __cstat - 132 + 31 BICOMP - 155 160 88 64 59 66 69 75 159 70 57 43 100 108 107 62 142 36 61 42 85 84 105 109 110 116 91 63 83 161 141 24 65 45 81 56 34 77 73 95 118 68 114 104 115 67 101 106 103 97 94 111 82 163 151 177 162 165 44 38 39 52 25 23 35 50 51 17 47 30 26 48 71 49 79 41 74 22 58 53 86 37 55 29 46 54 78 27 72 40 76 28 33 21 87 18 80 20 32 31 60 171 176 157 179 19 156 180 246 + 41 28 63 42 55 27 221 220 54 62 228 61 232 213 36 10 39 58 32 219 45 51 56 53 34 80 49 52 72 231 47 35 79 6 48 57 50 60 44 224 37 76 43 74 68 207 15 64 67 78 24 70 21 71 73 46 29 208 ICCARM - 246 161 160 155 159 171 157 179 176 163 70 83 180 156 19 151 177 141 162 142 165 24 44 64 38 65 39 36 52 45 25 57 23 81 35 61 50 56 51 66 17 34 47 42 30 77 26 43 48 73 71 85 49 95 79 88 41 118 74 84 22 68 58 100 53 114 86 105 37 104 55 69 29 115 46 109 54 67 78 108 27 101 72 110 40 106 76 59 28 103 33 116 21 97 87 107 18 94 80 91 20 111 32 75 31 82 60 63 62 + 64 61 79 10 27 220 232 6 219 221 15 213 32 80 48 54 41 63 67 45 78 57 24 21 70 50 71 56 39 224 49 37 228 76 52 43 58 42 72 55 60 34 46 51 73 231 47 53 36 44 74 68 35 28 62 207 29 208 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + + + BICOMP + 30 + + + ICCARM + 9 + + + __cstat + 186 + + + + + BICOMP + 129 110 101 123 119 100 109 134 105 124 118 130 216 98 115 112 106 138 113 103 127 125 126 121 27 221 6 89 174 88 179 86 177 93 173 85 172 94 176 83 170 96 87 111 178 95 84 104 175 97 232 219 108 147 128 69 120 131 139 102 136 140 90 99 91 92 107 162 155 160 154 149 165 152 151 159 153 133 116 135 141 150 132 117 114 158 156 137 169 161 122 167 157 164 144 148 163 166 168 142 145 146 143 220 15 191 12 29 225 203 + + + ICCARM + 203 147 128 216 27 220 232 6 219 221 15 69 191 225 29 108 12 89 120 109 131 174 139 98 102 88 136 110 140 179 90 115 99 86 91 134 92 177 107 112 162 93 155 123 160 173 154 106 149 85 165 105 152 172 151 138 159 94 153 101 133 176 116 113 135 83 141 124 150 170 132 103 117 96 114 119 158 87 156 127 137 111 169 118 161 178 122 125 167 95 157 129 164 84 144 126 148 104 163 130 166 175 168 121 142 97 145 100 146 143 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + + + AARM + 197 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + + + BICOMP + 66 + + + ICCARM + 77 + + + __cstat + 18 + + + + + BICOMP + 27 216 159 102 167 162 117 142 220 69 99 149 135 137 148 143 131 140 92 160 152 133 150 158 161 164 166 146 191 128 120 139 136 90 91 107 155 154 165 151 153 116 141 132 114 156 169 122 157 144 163 168 145 15 12 89 109 174 98 88 110 179 115 86 134 177 112 93 123 173 106 85 105 172 138 94 101 176 113 83 124 170 103 96 119 87 127 111 118 178 125 95 129 84 126 104 130 175 121 97 100 232 221 6 219 108 29 225 147 + + + ICCARM + 147 128 216 27 220 232 6 219 221 15 69 191 225 29 108 12 89 120 109 131 174 139 98 102 88 136 110 140 179 90 115 99 86 91 134 92 177 107 112 162 93 155 123 160 173 154 106 149 85 165 105 152 172 151 138 159 94 153 101 133 176 116 113 135 83 141 124 150 170 132 103 117 96 114 119 158 87 156 127 137 111 169 118 161 178 122 125 167 95 157 129 164 84 144 126 148 104 163 130 166 175 168 121 142 97 145 100 146 143 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + + + BICOMP + 40 + + + ICCARM + 82 + + + __cstat + 188 + + + + + BICOMP + 177 175 170 174 172 178 179 173 176 87 84 232 27 108 216 89 88 86 93 85 94 83 96 111 95 104 97 219 109 98 110 115 134 112 123 106 105 138 101 113 124 103 119 127 118 125 129 126 130 121 100 221 6 128 69 120 131 139 102 136 140 90 99 91 92 107 162 155 160 154 149 165 152 151 159 153 133 116 135 141 150 132 117 114 158 156 137 169 161 122 167 157 164 144 148 163 166 168 142 145 146 143 220 15 191 12 29 225 147 + + + ICCARM + 147 128 216 27 220 232 6 219 221 15 69 191 225 29 108 12 89 120 109 131 174 139 98 102 88 136 110 140 179 90 115 99 86 91 134 92 177 107 112 162 93 155 123 160 173 154 106 149 85 165 105 152 172 151 138 159 94 153 101 133 176 116 113 135 83 141 124 150 170 132 103 117 96 114 119 158 87 156 127 137 111 169 118 161 178 122 125 167 95 157 129 164 84 144 126 148 104 163 130 166 175 168 121 142 97 145 100 146 143 @@ -295,398 +385,25 @@ BICOMP - 224 + 65 ICCARM - 225 + 81 __cstat - 93 + 205 BICOMP - 155 171 188 154 153 179 191 156 166 176 157 159 197 193 163 + 220 6 10 80 27 219 203 29 208 213 32 232 221 15 207 35 48 ICCARM - 197 154 155 159 171 157 179 176 163 166 153 156 193 191 188 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c - - - BICOMP - 217 - - - ICCARM - 244 - - - __cstat - 149 - - - - - BICOMP - 154 207 201 159 218 212 230 198 195 183 163 213 236 156 196 208 197 166 222 155 202 221 193 219 186 210 181 235 188 200 232 211 228 229 185 182 187 227 184 194 209 231 234 220 153 171 176 157 179 240 206 237 205 199 203 204 190 192 - - - ICCARM - 232 211 220 154 155 159 171 157 179 176 163 166 153 219 240 202 195 206 222 237 218 205 213 212 228 199 229 200 196 182 186 187 183 227 210 184 208 194 221 201 209 198 236 203 230 181 235 204 190 185 231 234 188 207 192 197 156 193 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c - - - BICOMP - 241 - - - ICCARM - 243 - - - __cstat - 102 - - - - - BICOMP - 50 20 37 165 49 40 52 30 22 54 21 171 155 19 160 177 38 23 17 48 41 53 29 27 28 18 31 179 162 44 39 25 35 51 47 26 71 79 74 58 86 55 46 78 72 76 33 87 80 32 60 176 157 161 70 141 142 24 64 65 36 45 57 81 61 56 66 34 42 77 43 73 85 95 88 118 84 68 100 114 105 104 69 115 109 67 108 101 110 106 59 103 116 97 107 94 91 111 75 82 63 62 159 163 83 151 156 180 246 - - - ICCARM - 246 161 160 155 159 171 157 179 176 163 70 83 180 156 19 151 177 141 162 142 165 24 44 64 38 65 39 36 52 45 25 57 23 81 35 61 50 56 51 66 17 34 47 42 30 77 26 43 48 73 71 85 49 95 79 88 41 118 74 84 22 68 58 100 53 114 86 105 37 104 55 69 29 115 46 109 54 67 78 108 27 101 72 110 40 106 76 59 28 103 33 116 21 97 87 107 18 94 80 91 20 111 32 75 31 82 60 63 62 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c - - - BICOMP - 138 - - - ICCARM - 139 - - - __cstat - 117 - - - - - ICCARM - 191 246 161 160 155 159 171 157 179 176 163 70 83 180 156 19 151 177 141 162 142 165 24 44 64 38 65 39 36 52 45 25 57 23 81 35 61 50 56 51 66 17 34 47 42 30 77 26 43 48 73 71 85 49 95 79 88 41 118 74 84 22 68 58 100 53 114 86 105 37 104 55 69 29 115 46 109 54 67 78 108 27 101 72 110 40 106 76 59 28 103 33 116 21 97 87 107 18 94 80 91 20 111 32 75 31 82 60 63 62 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c - - - BICOMP - 129 - - - ICCARM - 119 - - - __cstat - 96 - - - - - BICOMP - 214 154 159 163 155 169 156 193 172 197 166 153 171 176 157 179 175 - - - ICCARM - 197 154 155 159 171 157 179 176 163 166 153 156 193 169 175 172 214 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c - - - BICOMP - 121 - - - ICCARM - 147 - - - __cstat - 99 - - - - - BICOMP - 155 176 223 158 156 159 163 237 166 171 152 157 179 - - - ICCARM - 152 158 156 155 237 159 171 157 179 176 163 166 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c - - - BICOMP - 134 - - - ICCARM - 146 - - - __cstat - 113 - - - - - BICOMP - 238 155 223 166 159 154 175 179 152 237 169 226 172 158 156 153 157 233 171 176 163 - - - ICCARM - 233 169 175 172 238 226 158 156 155 152 154 159 171 157 179 176 163 166 153 237 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S - - - AARM - 127 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c - - - BICOMP - 148 - - - ICCARM - 136 - - - __cstat - 125 - - - - - BICOMP - 157 159 154 155 156 179 197 193 166 153 171 176 163 - - - ICCARM - 197 154 155 159 171 157 179 176 163 166 153 156 193 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c - - - BICOMP - 122 - - - ICCARM - 140 - - - __cstat - 92 - - - - - BICOMP - 65 103 163 159 155 118 34 115 82 151 156 141 81 73 114 101 94 24 45 56 77 95 68 104 67 106 97 111 246 193 172 70 142 64 36 57 61 66 42 43 85 88 84 100 105 69 109 108 110 59 116 107 91 75 63 62 83 180 169 239 154 166 153 171 176 157 179 175 161 160 177 162 165 44 38 39 52 25 23 35 50 51 17 47 30 26 48 71 49 79 41 74 22 58 53 86 37 55 29 46 54 78 27 72 40 76 28 33 21 87 18 80 20 32 31 60 19 197 - - - ICCARM - 197 154 155 159 171 157 179 176 163 166 153 156 193 169 175 172 246 161 160 70 83 180 19 151 177 141 162 142 165 24 44 64 38 65 39 36 52 45 25 57 23 81 35 61 50 56 51 66 17 34 47 42 30 77 26 43 48 73 71 85 49 95 79 88 41 118 74 84 22 68 58 100 53 114 86 105 37 104 55 69 29 115 46 109 54 67 78 108 27 101 72 110 40 106 76 59 28 103 33 116 21 97 87 107 18 94 80 91 20 111 32 75 31 82 60 63 62 239 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c - - - BICOMP - 144 - - - ICCARM - 131 - - - __cstat - 112 - - - - - BICOMP - 157 159 155 176 163 154 197 171 179 156 193 166 153 - - - ICCARM - 159 155 171 157 179 176 163 197 154 166 153 156 193 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c - - - BICOMP - 135 - - - ICCARM - 137 - - - __cstat - 89 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c - - - BICOMP - 124 - - - ICCARM - 150 - - - __cstat - 123 - - - - - BICOMP - 163 159 155 158 156 154 166 153 152 171 176 157 179 - - - ICCARM - 152 158 156 155 154 159 171 157 179 176 163 166 153 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c - - - BICOMP - 133 - - - ICCARM - 130 - - - __cstat - 90 - - - - - BICOMP - 159 155 171 153 156 193 166 176 163 239 154 157 179 197 - - - ICCARM - 197 154 155 159 171 157 179 176 163 166 153 156 193 239 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c - - - BICOMP - 128 - - - ICCARM - 126 - - - __cstat - 98 - - - - - BICOMP - 157 159 155 176 163 154 197 171 179 156 193 166 153 - - - ICCARM - 159 155 171 157 179 176 163 197 154 166 153 156 193 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c - - - BICOMP - 120 - - - ICCARM - 145 - - - __cstat - 143 - - - - - BICOMP - 156 159 163 155 152 193 158 169 154 166 153 171 176 157 179 172 197 175 - - - ICCARM - 197 154 155 159 171 157 179 176 163 166 153 156 193 169 175 172 152 158 + 207 10 27 220 232 6 219 221 15 213 32 29 208 203 80 48 35 @@ -695,13 +412,300 @@ ILINK - 170 + 214 ILINK - 178 244 139 127 130 136 140 225 137 150 147 146 119 145 243 242 126 131 189 164 173 167 174 168 + 226 33 9 197 198 17 13 81 16 14 26 23 200 19 82 77 182 189 38 171 211 218 217 223 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + + + BICOMP + 8 + + + ICCARM + 23 + + + __cstat + 206 + + + + + BICOMP + 209 27 75 213 220 10 233 219 185 45 235 195 234 210 29 32 6 190 232 221 15 + + + ICCARM + 190 235 233 234 209 195 210 29 27 185 10 220 232 6 219 221 15 213 32 45 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + + + BICOMP + 212 + + + ICCARM + 13 + + + __cstat + 193 + + + + + BICOMP + 136 157 15 220 27 153 155 114 145 12 29 120 91 165 141 169 163 139 90 107 154 151 116 132 156 122 144 168 147 208 234 69 131 102 140 99 92 162 160 149 152 159 133 135 150 117 158 137 161 167 164 148 166 142 146 143 191 225 235 204 10 213 32 232 221 6 219 233 128 216 89 109 174 98 88 110 179 115 86 134 177 112 93 123 173 106 85 105 172 138 94 101 176 113 83 124 170 103 96 119 87 127 111 118 178 125 95 129 84 126 104 130 175 121 97 100 108 207 + + + ICCARM + 207 10 27 220 232 6 219 221 15 213 32 29 208 235 233 234 147 128 216 69 191 225 108 12 89 120 109 131 174 139 98 102 88 136 110 140 179 90 115 99 86 91 134 92 177 107 112 162 93 155 123 160 173 154 106 149 85 165 105 152 172 151 138 159 94 153 101 133 176 116 113 135 83 141 124 150 170 132 103 117 96 114 119 158 87 156 127 137 111 169 118 161 178 122 125 167 95 157 129 164 84 144 126 148 104 163 130 166 175 168 121 142 97 145 100 146 143 204 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + + + BICOMP + 20 + + + ICCARM + 198 + + + __cstat + 180 + + + + + BICOMP + 220 27 232 32 29 208 213 221 15 204 10 6 219 207 + + + ICCARM + 207 10 27 220 232 6 219 221 15 213 32 29 208 204 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + + + BICOMP + 187 + + + ICCARM + 19 + + + __cstat + 25 + + + + + BICOMP + 29 220 15 27 185 208 210 235 10 213 32 232 221 6 219 234 207 233 + + + ICCARM + 207 10 27 220 232 6 219 221 15 213 32 29 208 235 233 234 185 210 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + + + BICOMP + 11 + + + ICCARM + 16 + + + __cstat + 192 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + BICOMP + 229 + + + ICCARM + 14 + + + __cstat + 230 + + + + + BICOMP + 15 220 27 210 29 10 213 32 185 232 221 6 219 + + + ICCARM + 185 210 29 27 10 220 232 6 219 221 15 213 32 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + BICOMP + 184 + + + ICCARM + 182 + + + __cstat + 201 + + + + + BICOMP + 6 220 27 221 15 10 207 232 219 29 208 213 32 + + + ICCARM + 220 27 232 6 219 221 15 207 10 213 32 29 208 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + BICOMP + 183 + + + ICCARM + 200 + + + __cstat + 181 + + + + + BICOMP + 196 10 220 15 27 235 29 208 234 207 213 32 232 221 6 219 233 + + + ICCARM + 207 10 27 220 232 6 219 221 15 213 32 29 208 235 233 234 196 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + BICOMP + 22 + + + ICCARM + 17 + + + __cstat + 202 + + + + + BICOMP + 6 220 10 27 29 219 207 208 213 32 232 221 15 + + + ICCARM + 207 10 27 220 232 6 219 221 15 213 32 29 208 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + + + BICOMP + 222 + + + ICCARM + 26 + + + __cstat + 194 + + + + + BICOMP + 27 221 75 210 29 220 15 45 213 232 185 6 219 + + + ICCARM + 185 210 29 27 45 220 232 6 219 221 15 213 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + + + BICOMP + 7 + + + ICCARM + 189 + + + __cstat + 199 + + + + + BICOMP + 6 220 27 221 15 10 207 232 219 29 208 213 32 + + + ICCARM + 220 27 232 6 219 221 15 207 10 213 32 29 208 @@ -713,6 +717,9 @@ [MULTI_TOOL] ILINK + + [REBUILD_ALL] + diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewd b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewd index 56146314e..f71f565f6 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewd +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_benchmark_SAMV71_XULT/wolfcrypt_benchmark.ewd @@ -37,7 +37,7 @@ @@ -780,7 +780,7 @@ - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\asn.c - - - BICOMP - 156 - - - ICCARM - 124 - - - __cstat - 65 - - - - - BICOMP - 37 49 167 61 45 58 33 48 68 22 38 63 40 39 55 80 23 157 78 32 41 24 46 42 30 75 31 47 133 129 108 113 127 130 34 43 51 27 25 72 66 76 89 162 154 158 161 101 - - - ICCARM - 49 48 75 41 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 37 61 101 32 30 43 55 34 23 167 31 51 27 58 40 24 22 46 39 42 33 38 80 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha20_poly1305.c - - - BICOMP - 120 - - - ICCARM - 144 - - - __cstat - 93 - - - - - BICOMP - 78 66 63 46 75 89 59 48 25 130 72 76 162 158 52 33 53 38 45 49 47 133 129 68 157 154 161 108 113 127 - - - ICCARM - 49 48 75 52 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 59 53 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dsa.c - - - BICOMP - 105 - - - ICCARM - 79 - - - __cstat - 62 - - - - - BICOMP - 108 25 72 78 37 33 130 63 113 45 51 127 32 46 23 48 75 30 49 47 133 129 68 157 101 66 76 89 162 154 158 161 61 - - - ICCARM - 49 48 75 32 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 30 37 61 101 46 33 23 51 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha.c - - - BICOMP - 138 - - - ICCARM - 131 - - - __cstat - 106 - - - - - BICOMP - 113 75 133 129 45 33 47 63 78 108 59 38 48 49 68 157 127 130 46 25 72 66 76 89 162 154 158 161 - - - ICCARM - 49 48 75 59 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\des3.c - - - BICOMP - 160 - - - ICCARM - 112 - - - __cstat - 82 - - - - - BICOMP - 75 133 129 63 47 127 130 45 46 48 49 78 108 113 42 33 38 25 68 157 72 66 76 89 162 154 158 161 - - - ICCARM - 49 48 75 42 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\coding.c - - - BICOMP - 128 - - - ICCARM - 126 - - - __cstat - 71 - - - - - BICOMP - 113 48 63 49 68 45 78 108 46 75 47 133 129 127 130 40 33 25 72 157 66 76 89 162 154 158 161 - - - ICCARM - 49 48 75 40 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dh.c - - - BICOMP - 116 - - - ICCARM - 151 + 130 __cstat @@ -395,376 +205,52 @@ BICOMP - 102 133 45 129 63 127 130 78 32 47 108 113 46 49 48 68 157 61 31 88 75 37 25 72 66 76 89 162 154 158 161 101 30 149 + 67 118 157 147 146 142 117 134 0 85 82 113 34 127 10 159 28 88 99 30 35 65 37 4 152 138 154 155 ICCARM - 49 48 75 31 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 37 61 101 32 30 46 88 149 102 + 127 118 34 28 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 113 88 99 - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\random.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\coding.c BICOMP - 153 + 141 ICCARM - 135 + 125 __cstat - 111 + 9 BICOMP - 30 108 38 78 48 49 45 63 113 75 47 133 129 127 130 32 46 25 68 157 72 66 76 89 162 154 158 161 + 82 118 67 127 10 134 0 85 113 34 117 147 157 146 142 108 88 30 35 159 65 37 4 152 138 154 155 ICCARM - 49 48 75 32 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 30 46 38 + 127 118 34 108 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 113 88 - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hmac.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha.c BICOMP - 98 + 164 ICCARM - 115 - - - __cstat - 90 - - - - - BICOMP - 45 113 63 47 78 108 46 23 133 129 127 130 22 48 75 49 68 157 34 30 167 25 72 66 76 89 162 154 158 161 - - - ICCARM - 49 48 75 22 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 34 23 30 167 46 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md5.c - - - BICOMP - 109 - - - ICCARM - 134 - - - __cstat - 87 - - - - - BICOMP - 63 162 49 48 68 78 38 157 158 46 45 47 133 129 34 75 25 130 72 66 76 89 154 161 108 113 127 - - - ICCARM - 49 48 75 34 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hash.c - - - BICOMP - 77 - - - ICCARM - 122 - - - __cstat - 74 - - - - - BICOMP - 45 127 130 133 129 63 27 55 47 78 108 113 51 23 32 46 49 48 68 157 43 34 58 101 30 33 41 75 25 72 66 76 89 162 154 158 161 37 31 61 167 - - - ICCARM - 49 48 75 33 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 41 37 61 101 32 30 43 55 34 23 167 31 51 27 58 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\poly1305.c - - - BICOMP - 137 - - - ICCARM - 114 - - - __cstat - 140 - - - - - BICOMP - 133 129 63 33 127 130 45 53 38 47 78 108 113 46 49 48 68 157 75 25 72 66 76 89 162 154 158 161 - - - ICCARM - 49 48 75 53 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rsa.c - - - BICOMP - 146 - - - ICCARM - 155 - - - __cstat - 86 - - - - - BICOMP - 63 45 47 34 33 133 129 61 32 38 49 48 68 157 78 30 43 46 75 37 55 25 130 72 108 113 127 23 66 76 89 162 154 158 161 101 167 - - - ICCARM - 49 48 75 43 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 37 61 101 32 30 55 34 23 167 46 33 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha256.c - - - BICOMP - 139 - - - ICCARM - 169 - - - __cstat - 83 - - - - - BICOMP - 38 75 25 72 127 130 76 63 46 48 78 66 89 108 113 45 30 33 49 47 133 129 68 157 162 154 158 161 - - - ICCARM - 49 48 75 30 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 33 46 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\pwdbased.c - - - BICOMP - 73 - - - ICCARM - 145 - - - __cstat - 117 - - - - - BICOMP - 63 162 72 76 78 45 130 158 167 46 25 34 22 23 66 89 154 161 30 101 39 37 38 48 75 49 47 133 129 68 157 108 113 127 61 32 - - - ICCARM - 49 48 75 39 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 34 23 22 30 167 37 61 101 32 46 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rabbit.c - - - BICOMP - 123 - - - ICCARM - 159 - - - __cstat - 95 - - - - - BICOMP - 48 63 49 68 127 130 45 46 75 47 133 129 78 108 113 164 33 38 25 72 157 66 76 89 162 154 158 161 - - - ICCARM - 49 48 75 164 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\misc.c - - - BICOMP 136 - - ICCARM - 150 - - - __cstat - 69 - - - - - BICOMP - 130 45 72 76 63 158 162 78 38 25 66 89 48 75 49 47 133 129 68 157 108 154 161 113 127 - - - ICCARM - 49 48 75 38 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\memory.c - - - BICOMP - 96 - - - ICCARM - 121 - - - __cstat - 70 - - - - - BICOMP - 72 68 78 46 48 130 76 63 75 66 89 25 108 162 158 47 45 157 49 133 129 154 161 113 127 - - - ICCARM - 49 48 75 47 130 63 78 66 76 89 72 157 68 45 25 133 108 129 113 162 158 154 127 161 46 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha.c - - - BICOMP - 92 - - - ICCARM - 103 - - - __cstat - 67 - - - - - BICOMP - 157 127 130 49 48 68 63 33 45 47 133 129 78 108 113 23 46 38 75 25 72 66 76 89 162 154 158 161 - - - ICCARM - 49 48 75 23 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 33 46 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\ecc.c - - - BICOMP - 119 - - - ICCARM - 152 - - - __cstat - 143 - - - - - BICOMP - 78 23 33 157 68 63 32 167 58 48 49 61 50 45 41 38 75 47 133 129 108 113 127 130 54 37 57 46 25 72 66 76 89 162 154 158 161 101 30 56 60 31 55 43 51 34 27 - - - ICCARM - 49 48 75 58 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 37 61 101 32 30 57 56 54 60 50 41 43 55 34 23 167 31 51 27 46 33 38 - - - - - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md4.c - - - BICOMP - 110 - - - ICCARM - 99 - __cstat 100 @@ -773,51 +259,105 @@ BICOMP - 72 76 158 63 130 48 162 78 75 25 66 89 26 38 45 49 47 133 129 68 157 108 154 161 113 127 + 82 34 147 157 134 88 117 67 0 85 63 99 118 127 10 159 146 142 113 30 35 65 37 4 152 138 154 155 ICCARM - 49 48 75 26 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 38 + 127 118 34 63 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 113 88 99 - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_encrypt.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dh.c BICOMP - 85 + 90 ICCARM - 147 + 126 __cstat - 84 + 15 BICOMP - 66 63 46 78 42 45 25 130 72 89 154 161 28 165 48 75 49 47 133 129 68 76 162 158 157 108 113 127 + 79 147 134 157 67 146 142 0 87 117 85 82 113 127 118 10 159 66 98 18 34 115 30 35 65 37 4 152 138 154 155 73 114 119 ICCARM - 49 48 75 28 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 42 165 46 + 127 118 34 98 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 115 66 73 87 114 113 18 119 79 - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\tfm.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\des3.c BICOMP - 132 + 161 ICCARM - 168 + 93 + + + __cstat + 1 + + + + + BICOMP + 34 147 157 67 117 146 142 134 113 118 127 0 85 82 116 88 99 30 10 159 35 65 37 4 152 138 154 155 + + + ICCARM + 127 118 34 116 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 113 88 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\ecc.c + + + BICOMP + 92 + + + ICCARM + 135 + + + __cstat + 148 + + + + + BICOMP + 0 32 88 159 10 67 87 158 64 118 127 66 131 134 111 99 34 117 147 157 85 82 146 142 124 115 112 113 30 35 65 37 4 152 138 154 155 73 114 110 75 98 122 123 121 109 29 + + + ICCARM + 127 118 34 64 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 115 66 73 87 114 112 110 124 75 131 111 123 122 109 32 158 98 121 29 113 88 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\asn.c + + + BICOMP + 162 + + + ICCARM + 69 __cstat @@ -827,38 +367,443 @@ BICOMP - 47 45 63 113 32 75 78 108 38 166 133 129 127 130 49 61 48 68 157 101 25 72 66 76 89 162 154 158 161 30 + 115 127 158 66 134 64 88 118 10 33 99 67 108 106 122 7 32 159 0 87 111 36 113 116 114 34 98 117 147 157 85 82 146 142 109 123 121 29 30 35 65 37 4 152 138 154 155 73 ICCARM - 49 48 75 38 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 32 30 61 101 166 + 127 118 34 111 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 115 66 73 87 114 123 122 109 32 158 98 121 29 64 108 36 33 113 106 116 88 99 7 - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_port.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\chacha20_poly1305.c BICOMP + 81 + + + ICCARM + 139 + + + __cstat + 2 + + + + + BICOMP + 0 65 67 113 34 4 63 118 30 142 35 37 152 154 132 88 128 99 134 127 117 147 157 10 159 138 155 85 82 146 + + + ICCARM + 127 118 34 132 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 113 88 63 128 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\dsa.c + + + BICOMP + 84 + + + ICCARM + 23 + + + __cstat + 78 + + + + + BICOMP + 85 30 35 0 115 88 142 67 82 134 121 146 87 113 32 118 34 114 127 117 147 157 10 159 73 65 37 4 152 138 154 155 66 + + + ICCARM + 127 118 34 87 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 114 115 66 73 113 88 32 121 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hmac.c + + + BICOMP + 72 + + + ICCARM + 96 + + + __cstat + 14 + + + + + BICOMP + 134 82 67 117 0 85 113 32 147 157 146 142 33 118 34 127 10 159 109 114 158 30 35 65 37 4 152 138 154 155 + + + ICCARM + 127 118 34 33 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 109 32 114 158 113 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hash.c + + + BICOMP + 22 + + + ICCARM + 102 + + + __cstat + 38 + + + + + BICOMP + 134 146 142 147 157 67 29 122 117 0 85 82 121 32 87 113 127 118 10 159 123 109 64 73 114 88 111 34 30 35 65 37 4 152 138 154 155 115 98 66 158 + + + ICCARM + 127 118 34 88 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 113 111 115 66 73 87 114 123 122 109 32 158 98 121 29 64 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md4.c + + + BICOMP + 70 + + + ICCARM + 83 + + + __cstat + 77 + + + + + BICOMP + 35 37 154 67 142 118 152 0 34 30 65 4 39 99 134 127 117 147 157 10 159 85 138 155 82 146 + + + ICCARM + 127 118 34 39 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\md5.c + + + BICOMP + 105 + + + ICCARM + 151 + + + __cstat + 16 + + + + + BICOMP + 67 152 127 118 10 0 99 159 154 113 134 117 147 157 109 34 30 142 35 65 37 4 138 155 85 82 146 + + + ICCARM + 127 118 34 109 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 113 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rabbit.c + + + BICOMP + 86 + + + ICCARM + 5 + + + __cstat + 25 + + + + + BICOMP + 118 67 127 10 146 142 134 113 34 117 147 157 0 85 82 20 88 99 30 35 159 65 37 4 152 138 154 155 + + + ICCARM + 127 118 34 20 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 113 88 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\random.c + + + BICOMP + 129 + + + ICCARM + 169 + + + __cstat + 103 + + + + + BICOMP + 85 99 34 147 157 0 117 134 67 82 114 118 127 146 142 87 113 30 10 159 35 65 37 4 152 138 154 155 + + + ICCARM + 127 118 34 87 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 114 113 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha256.c + + + BICOMP + 143 + + + ICCARM + 3 + + + __cstat + 13 + + + + + BICOMP + 99 34 30 35 146 142 37 67 113 118 0 65 4 85 82 134 114 88 127 117 147 157 10 159 152 138 154 155 + + + ICCARM + 127 118 34 114 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 88 113 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\rsa.c + + + BICOMP + 165 + + + ICCARM + 140 + + + __cstat + 8 + + + + + BICOMP + 67 134 117 109 88 147 157 66 87 99 127 118 10 159 0 114 123 113 34 115 122 30 142 35 85 82 146 32 65 37 4 152 138 154 155 73 158 + + + ICCARM + 127 118 34 123 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 115 66 73 87 114 122 109 32 158 113 88 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\pwdbased.c + + + BICOMP + 26 + + + ICCARM + 137 + + + __cstat + 104 + + + + + BICOMP + 67 152 35 37 0 134 142 154 158 113 30 109 33 32 65 4 138 155 114 73 106 115 99 118 34 127 117 147 157 10 159 85 82 146 66 87 + + + ICCARM + 127 118 34 106 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 109 32 33 114 158 115 66 73 87 113 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\memory.c + + + BICOMP + 89 + + + ICCARM 97 + + __cstat + 31 + + + + + BICOMP + 35 10 0 113 118 142 37 67 34 65 4 30 85 152 154 117 134 159 127 147 157 138 155 82 146 + + + ICCARM + 127 118 34 117 142 67 0 65 37 4 35 159 10 134 30 147 85 157 82 152 154 138 146 155 113 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\misc.c + + + BICOMP + 144 + ICCARM 163 __cstat - 94 + 17 BICOMP - 49 48 68 45 113 157 78 46 75 47 133 129 63 108 127 130 33 25 72 66 76 89 162 154 158 161 + 142 134 35 37 67 154 152 0 99 30 65 4 118 34 127 117 147 157 10 159 85 138 155 82 146 ICCARM - 49 48 75 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 46 33 + 127 118 34 99 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\poly1305.c + + + BICOMP + 167 + + + ICCARM + 95 + + + __cstat + 168 + + + + + BICOMP + 147 157 67 88 146 142 134 128 99 117 0 85 82 113 127 118 10 159 34 30 35 65 37 4 152 138 154 155 + + + ICCARM + 127 118 34 128 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 113 88 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\sha.c + + + BICOMP + 19 + + + ICCARM + 94 + + + __cstat + 12 + + + + + BICOMP + 159 146 142 127 118 10 67 88 134 117 147 157 0 85 82 32 113 99 34 30 35 65 37 4 152 138 154 155 + + + ICCARM + 127 118 34 32 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 88 113 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\tfm.c + + + BICOMP + 166 + + + ICCARM + 156 + + + __cstat + 80 + + + + + BICOMP + 117 134 67 82 87 34 0 85 99 6 147 157 146 142 127 66 118 10 159 73 30 35 65 37 4 152 138 154 155 114 + + + ICCARM + 127 118 34 99 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 87 114 66 73 6 @@ -867,25 +812,79 @@ BICOMP - 81 + 21 ICCARM - 141 + 150 __cstat - 64 + 120 BICOMP - 25 72 127 130 46 45 63 38 78 108 113 167 33 48 75 49 47 133 129 68 157 66 76 89 162 154 158 161 + 30 35 146 142 113 134 67 99 0 85 82 158 88 118 34 127 117 147 157 10 159 65 37 4 152 138 154 155 ICCARM - 49 48 75 167 45 25 47 130 63 78 66 76 89 72 157 68 133 108 129 113 162 158 154 127 161 33 46 38 + 127 118 34 158 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 88 113 99 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_port.c + + + BICOMP + 101 + + + ICCARM + 160 + + + __cstat + 24 + + + + + BICOMP + 127 118 10 134 82 159 0 113 34 117 147 157 67 85 146 142 88 30 35 65 37 4 152 138 154 155 + + + ICCARM + 127 118 34 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 113 88 + + + + + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\wc_encrypt.c + + + BICOMP + 27 + + + ICCARM + 133 + + + __cstat + 11 + + + + + BICOMP + 65 67 113 0 116 134 30 142 35 4 138 155 28 153 118 34 127 117 147 157 10 37 152 154 159 85 82 146 + + + ICCARM + 127 118 34 28 134 30 117 142 67 0 65 37 4 35 159 10 147 85 157 82 152 154 138 146 155 116 153 113 diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/Application/runWolfcryptTests.c b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/Application/runWolfcryptTests.c index 63165c238..36937deef 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/Application/runWolfcryptTests.c +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/Application/runWolfcryptTests.c @@ -1,31 +1,29 @@ #include "RTOS.h" #include "BSP.h" +#include #include -static OS_STACKPTR int WLFSTACK[20000]; /* Stack Size */ -static OS_TASK WLFTASK; /* Task-control-blocks */ +static OS_STACKPTR int WLFSTACK[20000]; /* Stack Size for Task */ +static OS_TASK WLFTASK; /* Task */ static void wolfTask(void) { + printf("Begin wolfcrypt tests\n"); wolfcrypt_test(NULL); + printf("wolfcrypt tests complete.\n"); while (1) { BSP_ToggleLED(1); OS_Delay(200); } } -/********************************************************************* -* -* main() -*/ + int main(void) { - OS_IncDI(); /* Initially disable interrupts */ - OS_InitKern(); /* Initialize OS */ - OS_InitHW(); /* Initialize Hardware for OS */ - BSP_Init(); /* Initialize LED ports */ + OS_IncDI(); /* Disable interrupts */ + OS_InitKern(); /* Initialize OS */ + OS_InitHW(); /* Initialize Hardware for OS */ + BSP_Init(); /* Initialize LED ports */ /* You need to create at least one task before calling OS_Start() */ OS_CREATETASK(&WLFTASK, "Tests task", wolfTask, 100, WLFSTACK); - OS_Start(); /* Start multitasking */ + OS_Start(); /* Start the OS */ return 0; -} - -/****** End Of File *************************************************/ +} \ No newline at end of file diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/README_wolfcrypt_test b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/README_wolfcrypt_test new file mode 100644 index 000000000..15a236deb --- /dev/null +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/README_wolfcrypt_test @@ -0,0 +1,69 @@ +Steps taken to evaluate wolfSSL with the following: + +Required Software for this guide: +IAR Embedded Workbench IDE - ARM v7.60.1 (or similar version) +embOS v4.16 (for Cortex-M and IAR compiler) +wolfssl (latest version) + +Required items (Hardware) for this guide: +Atmel SAM V71 Xplained Ultra (Or equivelent Cortex-M Evaluation Board) + Note: Must have J-Trace adapter (SWD or SWD + ETM) +j-Trace for ARM Cortex-M Processors + Note: You can see here: https://www.segger.com/j-trace-for-cortex-m.html + Note: You can also purchase other models, we used one from IAR v3.2 +20 pin target ribbon cable +USB Cable with j-Trace adapter end +Micro usb cable + +#--!! NOTE !!--# +For this guide "**SAMV71_DIR" will signify the directory: +C:\\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\ + +#----------------------------------------------------------------------------# +# Setup file system to evaluate wolfssl in embOS project: +# (If you have not already done so) +#----------------------------------------------------------------------------# + +1. In wolfssl you will notice the directory: + wolfssl\IDE\IAR-EWARM\embOS\extract_trial_here + +2. go to embOS website and download a trial for your platform + https://www.segger.com/downloads/embos -> + embOS trial for Cortex-M and IAR compiler + +3. Extract (unzip) the download to + C:\\wolfssl\IDE\IAR-EWARM\embOS\extract_trial_here\ + (Note: you do not need to do anything further in this directory, the + wolfSSL evaluation projects will simply link against it) + +#----------------------------------------------------------------------------# +# Evaluate wolfcrypt_tests in embOS project: +#----------------------------------------------------------------------------# + +1. In IAR Workbench go to Project -> Add Existing Project + a. Browse to **SAMV71_DIR\embOS_wolfcrypt_test_SAMV71_XULT\ + b. Choose wolfcrypt_test.ewp and click "Open" + +2. Go to Project -> Rebuild All + +3. Connect your SAMV71 Xplained Ultra to your PC with micro USB in the "Debug" + port for power and the J-Link hooked up to SWD pins and your PC + +4. Go to Project -> Download and Debug + +5. Once the "Debug" environment has loaded go to: View -> Terminal I/O + (This is where the printf's will be directed to) + +6. Hit "Go" (Debug option with 3 right arrows "→→→") + +7. You should observe the tests run and pass. + +#----------------------------------------------------------------------------# +#----------------------------------------------------------------------------# + +Thank you for using this guide and we hope this was helpful to you. If you have +any suggestions / feedback for us please contact us: +support@wolfssl.com +info@wolfssl.com + +Copyright © 2016 wolfSSL Inc. All rights reserved. diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.driver.xcl b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.driver.xcl index 80545955e..bb724fe7f 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.driver.xcl +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.driver.xcl @@ -10,7 +10,7 @@ "-p" -"C:\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\ATSAMV71Q21.svd" +"C:\Users\boz_windows\Desktop\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\ATSAMV71Q21.svd" "--semihosting" diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.general.xcl b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.general.xcl index 8dfd52a15..37e74505d 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.general.xcl +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.Debug.general.xcl @@ -2,11 +2,11 @@ "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armjlink2.dll" -"C:\Users\boz_windows\Desktop\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Debug\Exe\wolfcrypt_test.out" +"C:\Users\boz_windows\Desktop\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Debug\Exe\wolfcrypt_test.out" --plugin "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\arm\bin\armbat.dll" ---macro "C:\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\samv7-ek-flash.mac" +--macro "C:\Users\boz_windows\Desktop\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\samv7-ek-flash.mac" diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dbgdt b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dbgdt index b64932dcf..d30fb89aa 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dbgdt +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dbgdt @@ -47,7 +47,7 @@ - + TabID-12298-19447 @@ -63,7 +63,7 @@ - 0 + 0 TabID-23046-19451 @@ -75,7 +75,7 @@ - 0 + 0 TabID-1026-19454 @@ -85,7 +85,7 @@ - 0 + 0 TabID-32226-19483 @@ -95,20 +95,20 @@ - 0 + 0 - TextEditor$WS_DIR$\Application\OS_StartLEDBlink.c000004123662366TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\benchmark\benchmark.c00000211000TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfssl\ssl.h000009334117041170TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c000001500TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c000002822082208TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\src\fp_sqr_comba_6.i000001910941094TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\src\tfm.c000004781119511195TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c000009848634863TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c000003281156911569TextEditor$WS_DIR$\..\..\..\..\..\new-embOS-cortex-m\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Application\OS_StartLEDBlink.c000004928702870TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Application\runBenchmarks.c0000012422422TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c0000012412412TextEditor$WS_DIR$\..\..\..\..\..\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Application\runBenchmarks.c0000012422422TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c000002011114611146TextEditor$WS_DIR$\..\..\..\..\..\embos-wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c000006412412TextEditor$WS_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c000003281156911569150100000010000001 + TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\src\tfm.c0000017113907839078TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_benchmark_SAMV71_XULT\Application\runBenchmarks.c000000432432TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c000003281156911569TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\benchmark\benchmark.c0000014283462334623TextEditor$WS_DIR$\..\..\..\..\..\wolfssl\IDE\IAR-EWARM\embOS\SAMV71_XULT\embOS_wolfcrypt_test_SAMV71_XULT\Application\runWolfcryptTests.c000001242342340100000010000001 - iaridepm.enu1debuggergui.enu1armjlink2.enu1-2-2304198-2-2200200154560336134154560514286-2-2304359-2-2200200154560336134278980514286-2357304765357-2200200154560336134315301514286-2-21981296-2-212982001003091336134154560336134 + iaridepm.enu1debuggergui.enu1armjlink2.enu1-2-2304198-2-2200200154560336134154560514286-2-2304359-2-2200200154560336134278980514286-2357304765357-2200200154560336134315301514286-2-21981296-2-212982001003091336134154560336134 diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dni b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dni index d8653b199..cc77cf2e2 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dni +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/settings/wolfcrypt_test.dni @@ -9,7 +9,7 @@ TriggerName=main LimitSize=0 ByteLimit=50 [DebugChecksum] -Checksum=99633143 +Checksum=1313908777 [CodeCoverage] Enabled=_ 0 [Exceptions] diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.dep b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.dep index b9e151dfb..6be01bc0f 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.dep +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.dep @@ -2,407 +2,473 @@ 2 - 4231226308 + 3672263679 Debug - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ripemd.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dh.h - $PROJ_DIR$\Debug\List\test.lst - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rabbit.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\des3.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\aes.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hmac.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\srp.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\BSP.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + $PROJ_DIR$\Application\runWolfcryptTests.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\test\test.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c $PROJ_DIR$\..\..\..\..\..\wolfssl\certs_test.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\pio\samv71q21.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart4.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ripemd.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hmac.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rabbit.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dh.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hc128.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\error-crypt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\efc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gpbr.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pmc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usart.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\xdmac.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\srp.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\des3.h $PROJ_DIR$\..\..\..\..\..\wolfssl\mem_track.h - $PROJ_DIR$\..\embOS_SAMV71_XULT_Linker_Script\samv71q21_wolfssl.icf - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\tc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rswdt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\matrix.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\chipid.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_samv71.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\smc.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\aes.h + $PROJ_DIR$\Debug\List\test.lst + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\xdmac.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Int.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\logging.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\smc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\matrix.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc3.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71q21.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piod.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rstc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\ssc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piob.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\chipid.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\acc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart3.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\OS_Config.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\acc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\BSP.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\utmi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mlb.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\qspi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\efc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\xdmac.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtt.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm0.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\aes.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\aes.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\matrix.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Int.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\smc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_samv71.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\chipid.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\ssc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rswdt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piod.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\efc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71q21.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\smc.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\error-crypt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pmc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usart.h + $PROJ_DIR$\..\embOS_SAMV71_XULT_Linker_Script\samv71q21_wolfssl.icf + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\tc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gpbr.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtc.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\logging.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\matrix.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc3.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rstc.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\icm.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\ssc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\dacc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\supc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtc.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pio.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rstc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rswdt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\hsmci.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\afec.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\isi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piob.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\icm.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\ssc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rstc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\acc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\chipid.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rswdt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\xdmac.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\supc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\hsmci.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\dacc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mlb.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\qspi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\aes.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\acc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart3.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\OS_Config.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\supc.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart2.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gmac.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\trng.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\twihs.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\wdt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\sdramc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc2.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pmc.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\isi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\trng.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mcan.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart2.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pwm.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mlb.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\efc.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart4.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs0.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioc.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gpbr.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\utmi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs2.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pmc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart0.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\spi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\trng.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\pio\samv71q21.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usbhs.h + $TOOLKIT_DIR$\inc\c\intrinsics.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc2.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\qspi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\wdt.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\utmi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart2.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi1.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gmac.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usbhs.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\supc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Conf.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioe.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\dacc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\sdramc.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\icm.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\wdt.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\qspi.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan0.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\uart.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\hsmci.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart1.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usbhs.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioa.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c - $PROJ_DIR$\Application\runWolfcryptTests.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\test\test.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c - $PROJ_DIR$\Debug\List\SEGGER_HardFaultHandler.lst - $TOOLKIT_DIR$\inc\c\yvals.h - $PROJ_DIR$\Debug\List\JLINKMEM_Process.lst - $PROJ_DIR$\..\embOS_SAMV71_XULT_user_settings\user_settings.h - $PROJ_DIR$\Debug\List\SEGGER_SYSVIEW_embOS.lst - $TOOLKIT_DIR$\inc\c\wchar.h $TOOLKIT_DIR$\inc\c\xlocale_c.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\dacc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioa.h + $PROJ_DIR$\Debug\List\JLINKMEM_Process.lst $TOOLKIT_DIR$\inc\c\xtls.h - $TOOLKIT_DIR$\inc\c\intrinsics.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\isi.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gmac.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\twihs.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pwm.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\sdramc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\trng.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs2.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc1.h + $PROJ_DIR$\Debug\List\runWolfcryptTests.lst + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Conf.h + $TOOLKIT_DIR$\inc\c\yvals.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart1.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\sdramc.h + $TOOLKIT_DIR$\inc\c\wchar.h $TOOLKIT_DIR$\inc\c\DLib_Product_string.h $TOOLKIT_DIR$\inc\c\ysizet.h - $PROJ_DIR$\Debug\List\runWolfcryptTests.lst - $TOOLKIT_DIR$\inc\c\limits.h $PROJ_DIR$\Debug\List\SEGGER_SYSVIEW.lst - $TOOLKIT_DIR$\CMSIS\Include\core_cmInstr.h - $TOOLKIT_DIR$\inc\c\xlocale.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\icm.h + $PROJ_DIR$\Debug\List\SEGGER_HardFaultHandler.lst + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\uart.h $PROJ_DIR$\Debug\List\BSP.lst + $TOOLKIT_DIR$\inc\c\xlocale.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\hsmci.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usbhs.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan0.h + $PROJ_DIR$\Debug\List\OS_Error.lst + $PROJ_DIR$\..\embOS_SAMV71_XULT_user_settings\user_settings.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\wdt.h + $TOOLKIT_DIR$\inc\c\limits.h + $TOOLKIT_DIR$\CMSIS\Include\core_cmInstr.h $TOOLKIT_DIR$\inc\c\DLib_Threads.h - $PROJ_DIR$\Debug\List\system_sam.lst - $PROJ_DIR$\Debug\Obj\test.o - $TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h - $TOOLKIT_DIR$\inc\c\stdio.h - $TOOLKIT_DIR$\inc\c\ystdio.h - $TOOLKIT_DIR$\inc\c\ctype.h - $PROJ_DIR$\Debug\List\xmtx2.lst - $TOOLKIT_DIR$\inc\c\DLib_Product.h - $PROJ_DIR$\Debug\Obj.o - $TOOLKIT_DIR$\inc\c\DLib_Defaults.h + $PROJ_DIR$\Debug\List\SEGGER_SYSVIEW_embOS.lst $TOOLKIT_DIR$\inc\c\cmsis_iar.h + $TOOLKIT_DIR$\inc\c\stdio.h + $TOOLKIT_DIR$\inc\c\ctype.h $TOOLKIT_DIR$\CMSIS\Include\core_cmSimd.h $TOOLKIT_DIR$\inc\c\xmtx.h - $TOOLKIT_DIR$\inc\c\xlocaleuse.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioe.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + $PROJ_DIR$\Debug\List\wolfcrypt_test.map + $TOOLKIT_DIR$\inc\c\ystdio.h + $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.__cstat.et + $PROJ_DIR$\Debug\Obj\test.o + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c $PROJ_DIR$\Debug\List\SEGGER_RTT_printf.lst + $TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h + $PROJ_DIR$\Debug\Obj.o + $PROJ_DIR$\Debug\Obj\test.pbi $TOOLKIT_DIR$\inc\c\xencoding_limits.h - $PROJ_DIR$\Debug\List\OS_Error.lst $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.pbi $TOOLKIT_DIR$\inc\c\stdlib.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c - $PROJ_DIR$\Debug\List\wolfcrypt_test.map - $PROJ_DIR$\Debug\Obj\test.pbi + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_ConfDefaults.h + $PROJ_DIR$\Debug\List\xmtx2.lst + $TOOLKIT_DIR$\inc\c\xlocaleuse.h $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.pbi + $PROJ_DIR$\Debug\List\system_sam.lst $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.pbi $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_ConfDefaults.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c - $PROJ_DIR$\Debug\Obj\runWolfcryptTests.__cstat.et $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c - $PROJ_DIR$\..\..\..\..\wolfcrypt\test\test.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c - $PROJ_DIR$\Debug\Obj\OS_Error.pbi - $PROJ_DIR$\Debug\List\RTOSInit_SAMV71_CMSIS.lst - $PROJ_DIR$\Debug\Obj\SEGGER_RTT.pbi - $TOOLKIT_DIR$\lib\shb_l.a - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c - $PROJ_DIR$\Debug\Obj\BSP.pbi - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.pbi - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S - $PROJ_DIR$\Debug\Obj\startup_sam.__cstat.et - $PROJ_DIR$\Debug\Obj\OS_Error.__cstat.et - $PROJ_DIR$\Debug\Obj\xmtx.pbi - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.pbi - $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.pbi - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.pbi - $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.__cstat.et - $PROJ_DIR$\..\embOS_wolfcrypt_lib_SAMV71_XULT\Debug\Bin\wolfcrypt_lib.a - $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.__cstat.et - $TOOLKIT_DIR$\lib\dl7M_tln.a - $TOOLKIT_DIR$\lib\rt7M_tl.a - $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.pbi + $TOOLKIT_DIR$\inc\c\DLib_Defaults.h + $TOOLKIT_DIR$\lib\shb_l.a + $PROJ_DIR$\Debug\Obj\BSP.pbi + $PROJ_DIR$\Debug\Obj\runWolfcryptTests.__cstat.et + $TOOLKIT_DIR$\inc\c\DLib_Product.h + $TOOLKIT_DIR$\lib\rt7M_tl.a + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + $PROJ_DIR$\..\..\..\..\wolfcrypt\test\test.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.pbi + $PROJ_DIR$\Debug\Obj\OS_Error.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + $PROJ_DIR$\..\..\..\..\..\wolfcrypt\test\test.h + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.pbi + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.o + $PROJ_DIR$\Debug\Obj\OS_Error.pbi + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\types.h + $PROJ_DIR$\Debug\List\RTOSInit_SAMV71_CMSIS.lst + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.__cstat.et + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + $PROJ_DIR$\Debug\Obj\startup_sam.__cstat.et + $PROJ_DIR$\Debug\Obj\xmtx.pbi + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + $PROJ_DIR$\..\embOS_wolfcrypt_lib_SAMV71_XULT\Debug\Bin\wolfcrypt_lib.a + $TOOLKIT_DIR$\lib\dl7M_tln.a + $PROJ_DIR$\Debug\Obj\HardFaultHandler.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\tfm.h + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_RTT.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn_public.h + $PROJ_DIR$\Debug\List\SEGGER_SYSVIEW_Config_embOS.lst + $PROJ_DIR$\Debug\Obj\xmtx2.pbi + $PROJ_DIR$\Debug\Obj\startup_sam.o + $TOOLKIT_DIR$\inc\c\stdarg.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\visibility.h + $PROJ_DIR$\Debug\Obj\xmtx2.o $PROJ_DIR$\Debug\Exe\wolfcrypt_test.out $PROJ_DIR$\Debug\Obj\system_sam.__cstat.et - $PROJ_DIR$\Debug\Obj\SEGGER_RTT.o - $PROJ_DIR$\..\..\..\..\..\wolfcrypt\test\test.h - $PROJ_DIR$\Debug\Obj\xmtx2.pbi - $PROJ_DIR$\Debug\List\SEGGER_SYSVIEW_Config_embOS.lst - $PROJ_DIR$\Debug\List\xmtx.lst - $TOOLKIT_DIR$\inc\c\stdarg.h - $PROJ_DIR$\Debug\Obj\wolfcrypt_test.pbd - $PROJ_DIR$\Debug\Obj\system_sam.o - $PROJ_DIR$\Debug\Obj\startup_sam.pbi - $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.__cstat.et - $PROJ_DIR$\Debug\Obj\SEGGER_RTT.__cstat.et - $PROJ_DIR$\Debug\Obj\startup_sam.o - $PROJ_DIR$\Debug\Obj\BSP.__cstat.et - $PROJ_DIR$\Debug\Obj\system_sam.pbi - $PROJ_DIR$\Debug\Obj\xmtx2.o - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.__cstat.et - $PROJ_DIR$\Debug\Obj\runWolfcryptTests.pbi - $PROJ_DIR$\Debug\Obj\runWolfcryptTests.o - $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.o - $PROJ_DIR$\Debug\Obj\SEGGER_RTT_printf.o $TOOLKIT_DIR$\inc\c\string.h - $PROJ_DIR$\Debug\Obj\xmtx2.__cstat.et - $PROJ_DIR$\Debug\List\SEGGER_RTT.lst + $PROJ_DIR$\Debug\Obj\BSP.__cstat.et $PROJ_DIR$\Debug\Obj\xmtx.o - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\visibility.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\types.h - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.__cstat.et - $PROJ_DIR$\Debug\List\startup_sam.lst - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.o - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\camellia.h - $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.o - $TOOLKIT_DIR$\inc\c\ycheck.h - $PROJ_DIR$\Debug\Obj\xmtx.__cstat.et - $TOOLKIT_DIR$\CMSIS\Include\core_cm7.h - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.o - $PROJ_DIR$\Debug\Obj\BSP.o - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\asn_public.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha20_poly1305.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\tfm.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\memory.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\poly1305.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ecc.h - $PROJ_DIR$\Debug\Obj\test.__cstat.et - $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.o + $PROJ_DIR$\Debug\Obj\system_sam.pbi + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.__cstat.et + $PROJ_DIR$\Debug\Obj\wolfcrypt_test.pbd + $PROJ_DIR$\Debug\Obj\xmtx2.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.__cstat.et + $PROJ_DIR$\Debug\Obj\runWolfcryptTests.o + $PROJ_DIR$\Debug\List\SEGGER_RTT.lst + $PROJ_DIR$\Debug\Obj\system_sam.o + $PROJ_DIR$\Debug\List\xmtx.lst + $PROJ_DIR$\Debug\Obj\startup_sam.pbi + $PROJ_DIR$\Debug\Obj\runWolfcryptTests.pbi + $PROJ_DIR$\Debug\Obj\RTOSInit_SAMV71_CMSIS.o $TOOLKIT_DIR$\inc\c\stdint.h - $TOOLKIT_DIR$\CMSIS\Include\core_cmFunc.h + $PROJ_DIR$\Debug\Obj\JLINKMEM_Process.o + $PROJ_DIR$\Debug\List\startup_sam.lst + $TOOLKIT_DIR$\CMSIS\Include\core_cm7.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\memory.h + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW.o + $TOOLKIT_DIR$\inc\c\ycheck.h + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_embOS.o $TOOLKIT_DIR$\lib\m7M_tlv.a - $PROJ_DIR$\Debug\Obj\OS_Error.o $PROJ_DIR$\Debug\Obj\SEGGER_HardFaultHandler.o - $PROJ_DIR$\Debug\Obj\HardFaultHandler.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\poly1305.h + $PROJ_DIR$\Debug\Obj\test.__cstat.et + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\chacha20_poly1305.h + $PROJ_DIR$\Debug\Obj\SEGGER_SYSVIEW_Config_embOS.__cstat.et + $PROJ_DIR$\Debug\Obj\BSP.o + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\camellia.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\rsa.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\ecc.h + $PROJ_DIR$\Debug\Obj\xmtx.__cstat.et + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md5.h + $PROJ_DIR$\Debug\Obj\OS_Error.o + $TOOLKIT_DIR$\CMSIS\Include\core_cmFunc.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\arc4.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\settings.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\random.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha512.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\coding.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dsa.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\RTOS.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\integer.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\wc_port.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\arc4.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\random.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\coding.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\settings.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha512.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md5.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha256.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md4.h $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\hash.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\dsa.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\idea.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\pwdbased.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_Conf.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md2.h - $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\Global.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha256.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\wc_port.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER.h - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Lib\os7m_tlv_dp.a + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\sha.h + $PROJ_DIR$\Debug\List\SEGGER_RTT_Syscalls_IAR.lst + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_Conf.h + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_Syscalls_IAR.__cstat.et + $PROJ_DIR$\..\..\extract_trial_here\Start\Inc\BSP.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\idea.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.h + $PROJ_DIR$\..\..\extract_trial_here\Start\Lib\os7m_tlv_dp.a + $PROJ_DIR$\..\..\extract_trial_here\Start\Inc\RTOS.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\Global.h + $PROJ_DIR$\..\..\extract_trial_here\Start\Inc\OS_Config.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\pwdbased.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\supc.h + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\wdt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\Inc\JLINKMEM.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gpbr.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\icm.h + $PROJ_DIR$\..\..\..\..\..\wolfssl\wolfcrypt\md2.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart2.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\qspi.h $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\Inc\JLINKMEM.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\trng.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\dacc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\chipid.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usbhs.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\trng.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\wdt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioe.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\gmac.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usbhs.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\spi0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\supc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mlb.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\utmi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\hsmci.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\sdramc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rswdt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\uart.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pioa.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_samv71.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\smc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs2.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\efc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\aes.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\usart.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rswdt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc2.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\matrix.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pmc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\mcan1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\isi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\xdmac.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pmc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\aes.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piod.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gpbr.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\efc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\tc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\icm.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\pwm1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mlb.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\utmi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc0.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\ssc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\ssc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtt.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\smc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\matrix.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\twihs1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\twihs.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\usart2.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\qspi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\Global.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_Conf.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\isi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\acc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\gmac.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pio.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\samv71q21.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.h + $TOOLKIT_DIR$\inc\c\yfuns.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\dacc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\pwm.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\afec.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rstc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\afec1.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\uart3.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\chipid.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\piob.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\sdramc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\hsmci.h + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_Syscalls_IAR.pbi + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\spi.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\xdmac.h + $PROJ_DIR$\Debug\Obj\SEGGER_RTT_Syscalls_IAR.o + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\rtc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_Syscalls_IAR.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\acc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\tc3.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rstc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\instance\rtc.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\component\mcan.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Conf.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Int.h + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_ConfDefaults.h [ROOT_NODE] ILINK - 211 172 + 243 176 - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c BICOMP - 226 + 213 ICCARM - 151 220 + 182 221 __cstat - 212 + 220 BICOMP - 244 257 68 75 91 79 106 90 134 246 64 110 112 88 98 95 70 82 65 62 78 74 113 96 108 100 101 89 147 35 45 61 111 85 87 63 93 76 99 67 73 55 109 104 97 92 84 105 83 114 103 107 86 150 162 27 56 26 51 14 59 25 48 15 50 21 46 32 60 20 77 16 47 17 39 52 80 24 58 72 53 29 42 71 34 22 69 57 54 28 33 81 41 13 40 36 37 23 38 66 43 160 166 153 158 258 141 161 94 + 266 186 240 383 122 146 167 188 152 201 390 183 205 ICCARM - 94 35 257 244 134 160 153 158 166 150 246 147 161 141 258 162 27 45 56 70 26 61 51 75 14 111 59 82 25 85 48 64 15 87 50 65 21 63 46 79 32 93 60 62 20 76 77 110 16 99 47 78 17 67 39 68 52 73 80 74 24 55 58 112 72 109 53 113 29 104 42 106 71 97 34 96 22 92 69 88 57 84 54 108 28 105 33 91 81 83 41 100 13 114 40 98 36 103 37 101 23 107 38 90 66 86 43 89 95 + 390 383 122 266 188 146 201 183 205 186 167 152 - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S - - - AARM - 262 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c BICOMP - 221 + 218 ICCARM - 240 224 - - - __cstat - 198 - - - - - BICOMP - 21 23 29 26 17 28 25 20 24 22 13 160 244 258 257 27 14 15 32 16 52 72 71 57 81 36 66 158 56 51 59 48 50 46 60 77 47 39 80 58 53 42 34 69 54 33 41 40 37 38 43 166 153 35 246 45 70 61 75 111 82 85 64 87 65 63 79 93 62 76 110 99 78 67 68 73 74 55 112 109 113 104 106 97 96 92 88 84 108 105 91 83 100 114 98 103 101 107 90 86 89 95 134 150 147 162 141 161 94 - - - ICCARM - 94 35 257 244 134 160 153 158 166 150 246 147 161 141 258 162 27 45 56 70 26 61 51 75 14 111 59 82 25 85 48 64 15 87 50 65 21 63 46 79 32 93 60 62 20 76 77 110 16 99 47 78 17 67 39 68 52 73 80 74 24 55 58 112 72 109 53 113 29 104 42 106 71 97 34 96 22 92 69 88 57 84 54 108 28 105 33 91 81 83 41 100 13 114 40 98 36 103 37 101 23 107 38 90 66 86 43 89 95 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c - - - BICOMP - 176 - - - ICCARM - 135 243 - - - __cstat - 222 - - - - - BICOMP - 134 244 160 142 141 44 143 166 150 286 233 153 158 264 - - - ICCARM - 264 233 244 134 160 153 158 166 150 143 142 141 44 286 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c - - - BICOMP - 189 - - - ICCARM - 167 260 + 153 265 __cstat @@ -412,11 +478,178 @@ BICOMP - 153 134 233 244 141 158 264 44 143 142 160 166 150 + 413 266 240 152 146 245 384 205 390 188 381 415 382 383 122 151 183 414 201 186 167 ICCARM - 264 233 244 134 160 153 158 166 150 143 142 141 44 + 414 381 384 382 413 415 383 122 266 390 245 146 201 183 205 186 167 152 151 188 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + + + BICOMP + 219 + + + ICCARM + 168 267 + + + __cstat + 252 + + + + + BICOMP + 122 146 167 266 390 306 383 381 245 152 151 201 186 183 205 382 304 384 + + + ICCARM + 304 245 266 146 201 183 205 186 167 152 151 122 306 381 384 382 390 383 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + BICOMP + 212 + + + ICCARM + 237 272 + + + __cstat + 274 + + + + + BICOMP + 302 245 146 167 266 381 122 306 382 304 152 151 201 186 183 205 384 + + + ICCARM + 304 245 266 146 201 183 205 186 167 152 151 122 306 381 384 382 302 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + BICOMP + 228 + + + ICCARM + 256 247 + + + __cstat + 279 + + + + + BICOMP + 183 146 266 186 167 245 304 201 205 122 306 152 151 + + + ICCARM + 146 266 201 183 205 186 167 304 245 152 151 122 306 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + + + BICOMP + 238 + + + ICCARM + 190 242 + + + __cstat + 251 + + + + + BICOMP + 183 146 266 186 167 245 304 201 205 122 306 152 151 + + + ICCARM + 146 266 201 183 205 186 167 304 245 152 151 122 306 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + + + BICOMP + 195 + + + ICCARM + 134 261 + + + __cstat + 249 + + + + + ICCARM + 304 245 266 146 201 183 205 186 167 152 151 122 306 311 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + + + AARM + 232 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + + + BICOMP + 257 + + + ICCARM + 262 239 + + + __cstat + 227 + + + + + BICOMP + 339 340 342 322 359 345 355 365 377 367 364 201 266 282 260 344 363 356 375 352 371 379 358 351 360 362 353 205 361 350 366 368 380 374 372 378 369 373 354 370 357 408 409 396 404 376 398 399 410 411 397 186 183 389 263 386 394 392 387 401 385 412 388 393 395 406 400 403 333 318 341 331 326 336 332 321 319 325 346 327 323 320 313 329 330 349 334 324 316 337 335 347 348 343 338 328 308 310 312 315 26 21 146 167 166 172 122 169 17 + + + ICCARM + 17 389 260 266 146 201 183 205 186 167 263 166 169 122 282 172 344 386 361 394 322 392 350 387 363 401 366 385 355 412 368 388 356 393 380 395 339 406 374 400 375 403 372 333 365 318 378 341 352 331 369 326 359 336 373 332 371 321 354 319 377 325 370 346 379 327 357 323 342 320 408 313 358 329 409 330 367 349 396 334 351 324 404 316 345 337 376 335 360 347 398 348 364 343 399 338 362 328 410 308 340 310 411 312 353 315 397 26 21 @@ -425,92 +658,11 @@ BICOMP - 229 + 258 ICCARM - 144 230 - - - __cstat - 180 - - - - - BICOMP - 244 160 214 233 142 158 9 141 143 166 153 134 264 44 150 - - - ICCARM - 264 233 244 134 160 153 158 166 150 143 142 141 44 9 214 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c - - - BICOMP - 194 - - - ICCARM - 149 248 - - - __cstat - 225 - - - - - BICOMP - 41 59 80 60 34 43 56 50 47 53 54 37 257 51 48 46 77 39 58 42 69 33 40 38 244 166 153 27 26 14 25 15 21 32 20 16 17 52 24 72 29 71 22 57 28 81 13 36 23 66 160 158 258 94 35 246 45 70 61 75 111 82 85 64 87 65 63 79 93 62 76 110 99 78 67 68 73 74 55 112 109 113 104 106 97 96 92 88 84 108 105 91 83 100 114 98 103 101 107 90 86 89 95 134 150 147 162 141 161 9 - - - ICCARM - 9 94 35 257 244 134 160 153 158 166 150 246 147 161 141 258 162 27 45 56 70 26 61 51 75 14 111 59 82 25 85 48 64 15 87 50 65 21 63 46 79 32 93 60 62 20 76 77 110 16 99 47 78 17 67 39 68 52 73 80 74 24 55 58 112 72 109 53 113 29 104 42 106 71 97 34 96 22 92 69 88 57 84 54 108 28 105 33 91 81 83 41 100 13 114 40 98 36 103 37 101 23 107 38 90 66 86 43 89 95 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c - - - BICOMP - 195 - - - ICCARM - 216 241 - - - __cstat - 239 - - - - - BICOMP - 115 233 134 150 244 282 141 44 283 264 143 142 160 166 153 158 284 - - - ICCARM - 264 233 244 134 160 153 158 166 150 143 142 141 44 282 284 283 115 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c - - - BICOMP - 175 - - - ICCARM - 190 231 + 144 253 __cstat @@ -520,16 +672,43 @@ BICOMP - 111 83 150 134 244 73 93 97 86 162 141 45 87 99 109 84 103 61 85 63 76 67 55 104 92 105 114 107 94 44 283 246 70 75 82 64 65 79 62 110 78 68 74 112 113 106 96 88 108 91 100 98 101 90 89 95 147 161 282 286 233 143 142 160 166 153 158 284 35 257 27 56 26 51 14 59 25 48 15 50 21 46 32 60 20 77 16 47 17 39 52 80 24 58 72 53 29 42 71 34 22 69 57 54 28 33 81 41 13 40 36 37 23 38 66 43 258 264 + 146 183 245 170 266 205 300 122 306 152 151 201 186 167 304 217 177 ICCARM - 264 233 244 134 160 153 158 166 150 143 142 141 44 282 284 283 94 35 257 246 147 161 258 162 27 45 56 70 26 61 51 75 14 111 59 82 25 85 48 64 15 87 50 65 21 63 46 79 32 93 60 62 20 76 77 110 16 99 47 78 17 67 39 68 52 73 80 74 24 55 58 112 72 109 53 113 29 104 42 106 71 97 34 96 22 92 69 88 57 84 54 108 28 105 33 91 81 83 41 100 13 114 40 98 36 103 37 101 23 107 38 90 66 86 43 89 95 286 + 304 245 266 146 201 183 205 186 167 152 151 122 306 300 170 177 217 - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + + + BICOMP + 248 + + + ICCARM + 194 255 + + + __cstat + 244 + + + + + BICOMP + 266 260 332 387 335 400 313 312 146 263 388 341 346 334 338 21 394 385 395 333 326 319 323 330 316 348 308 26 166 389 386 392 401 412 393 406 403 318 331 336 321 325 327 320 329 349 324 337 347 343 328 310 315 167 172 344 361 322 350 363 366 355 368 356 380 339 374 375 372 365 378 352 369 359 373 371 354 377 370 379 357 342 408 358 409 367 396 351 404 345 376 360 398 364 399 362 410 340 411 353 397 201 186 183 205 282 122 169 17 + + + ICCARM + 17 389 260 266 146 201 183 205 186 167 263 166 169 122 282 172 344 386 361 394 322 392 350 387 363 401 366 385 355 412 368 388 356 393 380 395 339 406 374 400 375 403 372 333 365 318 378 341 352 331 369 326 359 336 373 332 371 321 354 319 377 325 370 346 379 327 357 323 342 320 408 313 358 329 409 330 367 349 396 334 351 324 404 316 345 337 376 335 360 347 398 348 364 343 399 338 362 328 410 308 340 310 411 312 353 315 397 26 21 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c BICOMP @@ -537,21 +716,119 @@ ICCARM - 137 247 + 157 275 __cstat - 228 + 246 BICOMP - 141 134 150 244 49 44 279 282 233 143 142 160 166 153 158 283 264 284 + 398 366 354 372 409 397 361 380 369 357 404 410 260 350 368 374 378 373 370 408 396 376 399 411 266 186 183 344 322 363 355 356 339 375 365 352 359 371 377 379 342 358 367 351 345 360 364 362 340 353 201 205 282 17 389 263 386 394 392 387 401 385 412 388 393 395 406 400 403 333 318 341 331 326 336 332 321 319 325 346 327 323 320 313 329 330 349 334 324 316 337 335 347 348 343 338 328 308 310 312 315 26 21 146 167 166 172 122 169 300 ICCARM - 264 233 244 134 160 153 158 166 150 143 142 141 44 282 284 283 49 279 + 300 17 389 260 266 146 201 183 205 186 167 263 166 169 122 282 172 344 386 361 394 322 392 350 387 363 401 366 385 355 412 368 388 356 393 380 395 339 406 374 400 375 403 372 333 365 318 378 341 352 331 369 326 359 336 373 332 371 321 354 319 377 325 370 346 379 327 357 323 342 320 408 313 358 329 409 330 367 349 396 334 351 324 404 316 345 337 376 335 360 347 398 348 364 343 399 338 362 328 410 308 340 310 411 312 353 315 397 26 21 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + + + BICOMP + 193 + + + ICCARM + 224 259 + + + __cstat + 225 + + + + + BICOMP + 401 347 167 146 266 321 403 329 315 172 122 386 393 331 327 324 328 392 412 406 318 336 325 320 349 337 343 310 17 306 382 263 394 387 385 388 395 400 333 341 326 332 319 346 323 313 330 334 316 335 348 338 308 312 26 21 166 169 381 311 245 152 151 201 186 183 205 384 389 260 344 361 322 350 363 366 355 368 356 380 339 374 375 372 365 378 352 369 359 373 371 354 377 370 379 357 342 408 358 409 367 396 351 404 345 376 360 398 364 399 362 410 340 411 353 397 282 304 + + + ICCARM + 304 245 266 146 201 183 205 186 167 152 151 122 306 381 384 382 17 389 260 263 166 169 282 172 344 386 361 394 322 392 350 387 363 401 366 385 355 412 368 388 356 393 380 395 339 406 374 400 375 403 372 333 365 318 378 341 352 331 369 326 359 336 373 332 371 321 354 319 377 325 370 346 379 327 357 323 342 320 408 313 358 329 409 330 367 349 396 334 351 324 404 316 345 337 376 335 360 347 398 348 364 343 399 338 362 328 410 308 340 310 411 312 353 315 397 26 21 311 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + + + BICOMP + 187 + + + ICCARM + 155 269 + + + __cstat + 178 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + BICOMP + 222 + + + ICCARM + 162 281 + + + __cstat + 214 + + + + + BICOMP + 183 146 245 266 122 205 304 306 152 151 201 186 167 + + + ICCARM + 304 245 266 146 201 183 205 186 167 152 151 122 306 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + BICOMP + 200 + + + ICCARM + 254 235 + + + __cstat + 234 + + + + + BICOMP + 167 146 266 383 122 245 152 151 390 201 186 183 205 + + + ICCARM + 390 383 122 266 245 146 201 183 205 186 167 152 151 @@ -560,133 +837,25 @@ BICOMP - 173 + 185 ICCARM - 2 152 + 46 179 __cstat - 255 + 271 BICOMP - 154 7 169 163 267 250 238 166 153 244 140 134 274 5 277 266 268 281 280 273 269 253 276 3 0 254 160 158 164 138 145 275 272 143 249 271 263 6 242 1 8 11 4 278 12 10 214 18 237 136 270 252 233 156 150 142 148 139 265 251 155 31 + 170 37 188 173 283 273 223 186 183 266 135 146 291 43 301 294 285 296 314 293 287 270 288 38 36 278 201 205 191 150 165 292 280 152 236 286 277 45 276 39 42 41 40 307 65 20 217 44 241 163 284 264 245 171 167 151 158 131 290 233 177 73 ICCARM - 270 237 136 249 238 266 252 169 244 134 160 153 158 166 150 143 233 142 156 148 140 163 164 139 138 254 265 251 145 268 273 280 272 274 281 271 267 269 263 275 5 6 253 242 7 1 276 8 277 11 3 4 250 278 0 12 10 154 155 214 18 31 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c - - - BICOMP - 200 - - - ICCARM - 217 236 - - - __cstat - 245 - - - - - BICOMP - 153 134 244 166 150 233 264 160 158 141 44 143 142 - - - ICCARM - 134 244 160 153 158 166 150 264 233 143 142 141 44 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c - - - BICOMP - 191 - - - ICCARM - 235 213 - - - __cstat - 223 - - - - - BICOMP - 150 134 244 279 141 233 143 142 49 160 166 153 158 - - - ICCARM - 49 279 141 244 233 134 160 153 158 166 150 143 142 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c - - - BICOMP - 215 - - - ICCARM - 157 227 - - - __cstat - 234 - - - - - BICOMP - 153 134 244 166 150 233 264 160 158 141 44 143 142 - - - ICCARM - 134 244 160 153 158 166 150 264 233 143 142 141 44 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c - - - BICOMP - 201 - - - ICCARM - 146 256 - - - __cstat - 210 - - - - - BICOMP - 102 244 218 143 134 233 284 158 49 169 282 178 283 279 141 142 153 30 160 166 150 - - - ICCARM - 30 282 284 283 102 178 279 141 244 49 233 134 160 153 158 166 150 143 142 169 + 284 241 163 236 223 294 264 188 266 146 201 183 205 186 167 152 245 151 171 158 135 173 191 131 150 278 290 233 165 285 293 314 280 291 296 286 283 287 277 292 43 45 270 276 37 39 288 42 301 41 38 40 273 307 36 65 20 170 177 217 44 73 @@ -695,42 +864,323 @@ BICOMP - 168 + 187 ICCARM - 133 261 + 155 269 __cstat - 206 + 178 + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + + + BICOMP + 219 + + + ICCARM + 168 267 + + + __cstat + 252 + + + + + ICCARM + 289 245 266 146 201 183 205 186 167 152 151 122 104 309 295 305 81 298 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + BICOMP + 200 + + + ICCARM + 254 235 + + + __cstat + 234 + + + + + ICCARM + 81 298 122 266 245 146 201 183 205 186 167 152 151 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + BICOMP + 212 + + + ICCARM + 237 272 + + + __cstat + 274 + + + + + ICCARM + 289 245 266 146 201 183 205 186 167 152 151 122 104 309 295 305 147 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + + + BICOMP + 248 + + + ICCARM + 194 255 + + + __cstat + 244 + + + + + ICCARM + 127 63 260 266 146 201 183 205 186 167 263 166 169 122 282 172 57 101 53 82 58 96 111 137 71 159 84 108 76 109 97 80 66 139 98 87 60 105 100 140 64 118 86 94 70 141 138 156 67 121 50 125 47 95 59 89 102 143 123 113 69 52 79 148 107 161 74 160 48 132 88 154 136 130 77 129 75 142 92 110 99 119 93 124 56 149 54 126 116 117 90 85 62 133 83 114 61 174 78 106 51 164 72 115 91 128 103 112 120 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + BICOMP + 222 + + + ICCARM + 162 281 + + + __cstat + 214 + + + + + ICCARM + 289 245 266 146 201 183 205 186 167 152 151 122 104 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + + + BICOMP + 195 + + + ICCARM + 134 261 + + + __cstat + 249 + + + + + ICCARM + 289 245 266 146 201 183 205 186 167 152 151 122 104 317 + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c BICOMP - 202 + 213 ICCARM - 165 232 + 182 221 __cstat - 209 + 220 + + ICCARM + 81 298 122 266 188 146 201 183 205 186 167 152 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\HardFaultHandler.S + + + AARM + 232 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + BICOMP - 244 166 218 279 141 134 150 169 143 160 49 153 158 + 193 ICCARM - 49 279 141 244 169 134 160 153 158 166 150 143 + 224 259 + + + __cstat + 225 + + + + + ICCARM + 289 245 266 146 201 183 205 186 167 152 151 122 104 309 295 305 127 63 260 263 166 169 282 172 57 101 53 82 58 96 111 137 71 159 84 108 76 109 97 80 66 139 98 87 60 105 100 140 64 118 86 94 70 141 138 156 67 121 50 125 47 95 59 89 102 143 123 113 69 52 79 148 107 161 74 160 48 132 88 154 136 130 77 129 75 142 92 110 99 119 93 124 56 149 54 126 116 117 90 85 62 133 83 114 61 174 78 106 51 164 72 115 91 128 103 112 120 317 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + + + BICOMP + 218 + + + ICCARM + 153 265 + + + __cstat + 199 + + + + + ICCARM + 55 309 295 305 145 189 298 122 266 81 245 146 201 183 205 186 167 152 151 188 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + BICOMP + 228 + + + ICCARM + 256 247 + + + __cstat + 279 + + + + + ICCARM + 146 266 201 183 205 186 167 289 245 152 151 122 104 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + + + BICOMP + 238 + + + ICCARM + 190 242 + + + __cstat + 251 + + + + + ICCARM + 146 266 201 183 205 186 167 289 245 152 151 122 104 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + + + BICOMP + 257 + + + ICCARM + 262 239 + + + __cstat + 227 + + + + + ICCARM + 127 63 260 266 146 201 183 205 186 167 263 166 169 122 282 172 57 101 53 82 58 96 111 137 71 159 84 108 76 109 97 80 66 139 98 87 60 105 100 140 64 118 86 94 70 141 138 156 67 121 50 125 47 95 59 89 102 143 123 113 69 52 79 148 107 161 74 160 48 132 88 154 136 130 77 129 75 142 92 110 99 119 93 124 56 149 54 126 116 117 90 85 62 133 83 114 61 174 78 106 51 164 72 115 91 128 103 112 120 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + + + BICOMP + 203 + + + ICCARM + 157 275 + + + __cstat + 246 + + + + + ICCARM + 49 127 63 260 266 146 201 183 205 186 167 263 166 169 122 282 172 57 101 53 82 58 96 111 137 71 159 84 108 76 109 97 80 66 139 98 87 60 105 100 140 64 118 86 94 70 141 138 156 67 121 50 125 47 95 59 89 102 143 123 113 69 52 79 148 107 161 74 160 48 132 88 154 136 130 77 129 75 142 92 110 99 119 93 124 56 149 54 126 116 117 90 85 62 133 83 114 61 174 78 106 51 164 72 115 91 128 103 112 120 @@ -739,7 +1189,20 @@ BICOMP - 215 + 238 + + + __cstat + 251 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + + + BICOMP + 200 __cstat @@ -752,11 +1215,11 @@ BICOMP - 194 + 203 __cstat - 225 + 246 @@ -765,11 +1228,11 @@ BICOMP - 175 + 193 __cstat - 204 + 225 @@ -778,42 +1241,16 @@ BICOMP - 226 + 248 __cstat - 212 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c - - - BICOMP - 203 - - - __cstat - 228 + 244 $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c - - - BICOMP - 176 - - - __cstat - 222 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c BICOMP @@ -821,102 +1258,20 @@ __cstat - 239 + 249 - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c BICOMP - 168 + 219 __cstat - 206 - - - - - $PROJ_DIR$\..\..\..\..\wolfcrypt\test\test.c - - - BICOMP - 173 - - - ICCARM - 152 - - - __cstat - 255 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c - - - BICOMP - 202 - - - __cstat - 209 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c - - - BICOMP - 191 - - - __cstat - 223 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c - - - BICOMP - 201 - - - __cstat - 210 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c - - - BICOMP - 200 - - - __cstat - 245 - - - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c - - - BICOMP - 189 - - - __cstat - 199 + 252 @@ -925,11 +1280,67 @@ BICOMP - 221 + 257 __cstat - 198 + 227 + + + + + $PROJ_DIR$\..\..\..\..\wolfcrypt\test\test.c + + + BICOMP + 185 + + + ICCARM + 179 + + + __cstat + 271 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + + + BICOMP + 218 + + + __cstat + 199 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + + + BICOMP + 187 + + + __cstat + 178 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + + + BICOMP + 222 + + + __cstat + 214 @@ -938,7 +1349,46 @@ AARM - 262 159 + 232 184 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + + + BICOMP + 228 + + + __cstat + 279 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + + + BICOMP + 213 + + + __cstat + 220 + + + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + + + BICOMP + 212 + + + __cstat + 274 @@ -947,20 +1397,107 @@ ILINK - 172 + 176 ILINK - 19 248 262 243 260 231 230 261 213 232 256 241 247 224 220 152 236 227 205 285 192 208 259 207 + 68 275 232 261 281 259 253 269 235 221 265 272 267 239 255 179 247 242 230 303 202 206 268 231 + + + + + $PROJ_DIR$\..\..\extract_trial_here\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_Syscalls_IAR.c + + + BICOMP + 402 + + + ICCARM + 297 405 + + + __cstat + 299 + + + + + BICOMP + 266 146 167 390 152 201 186 183 205 391 383 122 + + + ICCARM + 391 152 266 146 201 183 205 186 167 390 383 122 + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\OS_Error.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\RTOSInit_SAMV71_CMSIS.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c + ICCARM + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx2.c ICCARM + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c + ICCARM + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\BSP.c ICCARM @@ -973,40 +1510,28 @@ $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\system_sam.c ICCARM - - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c - ICCARM - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\JLINKMEM_Process.c ICCARM - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_embOS.c ICCARM - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c ICCARM $PROJ_DIR$\..\..\..\..\wolfcrypt\test\test.c ICCARM - - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c - ICCARM - - - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT.c - ICCARM - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW.c ICCARM - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_HardFaultHandler.c ICCARM @@ -1014,7 +1539,15 @@ ICCARM - $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\DeviceSupport\startup_sam.c + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\xmtx.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_RTT_printf.c + ICCARM + + + $PROJ_DIR$\..\..\..\..\..\..\..\..\embos-trial\Start\BoardSupport\Atmel\SAMV71_XPlainedUltra\Setup\SEGGER_SYSVIEW_Config_embOS.c ICCARM diff --git a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewd b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewd index 25c4c6aff..9dbb61443 100644 --- a/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewd +++ b/IDE/IAR-EWARM/embOS/SAMV71_XULT/embOS_wolfcrypt_test_SAMV71_XULT/wolfcrypt_test.ewd @@ -37,7 +37,7 @@ @@ -780,7 +780,7 @@