Compare commits

...

983 Commits

Author SHA1 Message Date
16db0c234e bump dev version 2013-08-06 15:08:05 -07:00
3378f8f25e add DTLS cookie ctx geter 2013-08-06 15:06:33 -07:00
5c5cee0789 use external CYASSL_MAX_ERROR_SZ for buffer size 2013-08-06 11:48:00 -07:00
427a421ec5 fix rpm with .pc install, from Brian 2013-08-06 11:29:37 -07:00
831d9cf640 SEP Profile
1. Changed session index shift values to constants.
2. Added bounds checking when retrieving a session.
3. Added function to retrieve the peer cert chain from
   a CYASSL_SESSION record.
2013-08-02 16:03:41 -07:00
3b4ff94931 add paramter validation to SSL I/O calls 2013-08-02 12:12:51 -07:00
1357cdb0e4 SEP Profile
1. Add session cache index to CYASSL structure.
2. Add accessor for cache index in CYASSL structure.
3. Add copy function for session cache item.
2013-07-28 17:11:22 -07:00
505b1a8a67 fix ecc sign/hash truncation with odd bit sizes when hash length is longer than key size 2013-07-25 15:59:09 -07:00
55401c13dd Truncated HMAC first part (protocol). Extension processing will be coded later. 2013-07-23 15:42:43 -03:00
14b100fee6 fix savecert with no_skid, gcc warnings 2013-07-22 14:30:35 -07:00
37a9a7a457 add IOCb Ctx getters 2013-07-22 11:01:00 -07:00
1b5bc04e4a Merge pull request #47 from kojo1/master
RTX aware flag for MDK-ARM projects
2013-07-18 08:49:36 -07:00
d04c915227 MKD-ARM proj name fixed 2013-07-18 09:39:20 +09:00
e6c80f0725 RTX aware flag for MDK-ARM projects 2013-07-18 09:25:49 +09:00
5e633ea6fd Merge pull request #45 from kojo1/master
MDK-ARM LCP43xx project fixed
2013-07-16 18:24:52 -07:00
37c5ba26bf MDK-ARM LCP43xx project fixed 2013-07-17 09:34:06 +09:00
7db3116ae4 update rpm version 2013-07-11 16:33:27 -07:00
f3a707724b README typo fixes 2013-07-11 10:17:29 -06:00
43f320d5e2 SEP Extensions
1. Added configure option to enable SEP extensions.
2. Enabled KEEP_PEER_CERT for the SEP configuration.
3. Copy the Certificate Policy extension into the cert as the
   device type.
4. Copy an other type Alt Name extension into the cert as the
   hwType and hwSerialNumber, if the alt name has a
   hardwareModuleName OID.
2013-07-09 13:23:56 -07:00
99b6c1d3c3 fix GCC warning 2013-07-09 09:57:55 -07:00
f9bf003718 allow NULL IVs for CBC mode, same as all zero IV 2013-07-08 11:52:00 -07:00
b66cb11cb8 Fixed bug in DecodeAltNames() where idx wasn't advanced past the length. 2013-07-05 10:10:38 -07:00
705aa0f453 fix user malloc define w/ opensslextra 2013-07-05 09:42:49 -07:00
226f018829 Fixed memory leak of http buffer in OCSP lookup. 2013-07-02 17:35:30 -07:00
b3d99f2d32 only have fastmath on by default on x86_64 2013-07-01 12:10:59 -07:00
593e466a44 limiting max_fragment API for client side only. 2013-07-01 10:13:43 -03:00
98e6ad3ee9 add comverge switch for settings 2013-06-27 10:28:58 -07:00
307c71d9cb add CyaSSL_UnloadCertsKeys to free SSL certs and keys after handshake 2013-06-27 10:26:04 -07:00
773d0da1bc Fixed issue with the DTLS EmbedReceiveFrom() callback using IPv6. 2013-06-26 17:40:21 -07:00
fdb2416e49 Merge branch 'master' of github.com:cyassl/cyassl 2013-06-26 17:06:49 -07:00
d0c2e9b7a2 switch comverge settings to ecc by default 2013-06-26 17:05:30 -07:00
29b32e582a DTLS IPv6 Hello Cookie Update
1. Add support for IPv6 addresses when calculating DTLS Cookie.
2. Simplify cookie calculation.
2013-06-26 16:32:01 -07:00
0d0fc27e42 Fixed DecodeAuthKeyId fail case not returning. 2013-06-26 11:16:17 -07:00
ed82f06382 Merge branch 'master' of github.com:cyassl/cyassl 2013-06-26 11:05:00 -07:00
60c2388ae7 fix potential NetX packet memory leak 2013-06-26 11:03:54 -07:00
f3af0124e4 Fixed DecodeAltNames extension falling through to next case. 2013-06-25 13:37:43 -07:00
7fd3b8a993 Fixed error string for example server private key file failure. 2013-06-25 13:14:24 -07:00
87eb94b7c4 Merge branch 'master' of github.com:cyassl/cyassl 2013-06-24 14:02:40 -07:00
b51d6f3b8f add NetX default IO context handling 2013-06-24 14:00:48 -07:00
c3cb9b3b43 add IDE files to distribution 2013-06-24 12:00:21 -07:00
0c34ecb451 OCSP Updates
1. Add option to example server and client to check the OCSP responder.
2. Add option to example server and client to override the URL to use
   when checking the OCSP responder.
3. Copy the certificate serial number correctly into OCSP request.
   Add leading zero only if MS bit is set.
4. Fix responder address used when Auth Info extension is present.
5. Update EmbedOcspLookup callback to better handle the HTTP
   response and obtain the complete OCSP response.
2013-06-24 10:47:24 -07:00
e0a84521c5 Make alert description and level enumerations public. 2013-06-21 14:56:42 -07:00
17ab84eb07 Update call to DoAlert()
When handling the alerts, the return code wasn't checked for error codes. A corrupted alert message could cause a control flow issue.
2013-06-19 15:01:13 -07:00
42a0f3500f Update AES-GCM and AES-CCM to use AES-NI
1. Added the assembly functions to do AES-ECB.
2. Updated AesEncrypt and AesDecrypt to use the assembly functions
   if available.
3. Modified the AES-GCM and AES-CCM key setup functions to use the
   the AES-NI key setup if availble.
4. Added tests for the AES-ECB encrypt and decrypt.
5. Only include stdio.h for AES when DEBUG_AESNI is enabled
6. If using local key setup, skip using AES-NI for basic Encrypt
   and Decrypt.
2013-06-19 14:52:58 -07:00
affbb3ef27 Merge branch 'master' of https://github.com/cyassl/cyassl 2013-06-19 17:20:48 -03:00
4502716fc4 Merge branch 'master' of https://github.com/cyassl/cyassl 2013-06-19 17:04:43 -03:00
b5ba31501c make stacksize more portable 2013-06-19 12:56:25 -07:00
25e910a0a9 max fragment length tests and fixes 2013-06-19 16:38:57 -03:00
5f3ee80407 added:
- max fragment length extension;
 - CyaSSL_SNI_GetRequest() to get client's request at server side;
 - Automated tests for SNI;
2013-06-19 15:45:06 -03:00
85d25798a5 update ntru cert expires dates, update crls while at it, don't turn on skid for crls since openssl/firefox don't use by default and cyassl needs crl extension parsing 2013-06-17 14:48:51 -07:00
d02af46256 windows build warning fixes 2013-06-17 12:26:21 -07:00
a1f25a9299 release 2.7.0 init 2013-06-17 12:06:37 -07:00
8c70b11528 add newSession flag to SetServerID to do full handshake w/ new session 2013-06-14 15:29:18 -07:00
7f7c595d10 differentiate between THREADX and RTP_SYS 2013-06-14 13:45:25 -07:00
9559f09028 warning fixes 2013-06-13 12:13:46 -07:00
b40c2c0b1f Fixed issue with no_server/no_client optional compile losing two functions 2013-06-06 21:59:05 +02:00
33a7d7481d Merge branch 'master' of github.com:cyassl/cyassl 2013-06-03 14:57:40 -07:00
ae84982777 add STACK_TRAP to track stack use on client, will seqfault if exceed limit to see where use is too high, doesn't work with pthread_create() 2013-06-03 14:56:37 -07:00
f1d1898ddf Added new option to SNI: CYASSL_SNI_ANSWER_ON_MISMATCH
Added new function to SNI API: CyaSSL_SNI_Matched()
2013-06-03 17:55:06 -03:00
cb2082edee changed CYASSL_SNI_ABORT_ON_MISMATCH to CYASSL_SNI_CONTINUE_ON_MISMATCH 2013-06-03 10:04:49 -03:00
4ad91673ca fixed description for filesystem configure option to match default 2013-05-31 17:57:08 -07:00
ebd03368c7 for DTLS handshakes, put change cipher spec and finished messages in same datagram 2013-05-31 13:48:49 -07:00
79fad81c32 shrinking function names 2013-05-30 15:40:10 -03:00
5c665fe614 Added options to SNI (now it is possible to choose whether or not to abort on a SNI Host Name mismatch)
Exposed SNI Type at ssl.h
2013-05-30 15:26:41 -03:00
baa012b1d9 change = to space for user options defines with = value 2013-05-29 15:03:27 -07:00
b2ef938cbe fix CYASSL_MALLOC_CHECK hard tabs and extra function not needed 2013-05-29 11:18:16 -07:00
af48800c58 Merge branch 'MDK.STM.LPC' of https://github.com/kojo1/cyassl-test 2013-05-28 11:59:52 -07:00
2b59554245 fix cipherSuite0 byte in sniffer, so ECC is recognised correctly. 2013-05-28 10:56:13 +02:00
cf25dfb16e Config-BARE-METAL default 2013-05-26 14:02:58 +09:00
1680b47ac6 Release for STM/LPC 2013-05-26 12:17:06 +09:00
e4a95342f1 Merging cyassl/master and STM.LPC 2013-05-26 10:05:35 +09:00
9382f74f2e Marging cyassl/master and STM.LPC 2013-05-26 09:47:51 +09:00
4b9c3d3512 Merge remote-tracking branch 'cyassl/master' into STM.LPC
Conflicts:
	IDE/MDK-ARM/MDK-ARM/CyaSSL/config-FS.h
	IDE/MDK-ARM/MDK-ARM/CyaSSL/config-RTX-TCP-FS.h
	IDE/MDK-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.c
	IDE/MDK-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.h
	IDE/MDK-ARM/MDK-ARM/CyaSSL/main.c
	IDE/MDK-ARM/MDK-ARM/CyaSSL/shell.c
	IDE/MDK-ARM/MDK-ARM/CyaSSL/ssl-dummy.c
	IDE/MDK-ARM/MDK-ARM/config/File_Config.c
	IDE/MDK-ARM/MDK-ARM/config/RTX_Conf_CM.c
	IDE/MDK-ARM/Projects/MDK-ARM-STM32F2xx.uvopt
	IDE/MDK-ARM/Projects/MDK-ARM-STM32F2xx.uvproj
	ctaocrypt/src/random.c
	src/internal.c
2013-05-26 09:27:06 +09:00
9753e46721 minor OCSP update
1. When doing the HTTP transaction, use recv() and send().
2. When a cert doesn't have an Auth Info extension, and not using
   an override server, it is considered good.
3. decode_url() should return -1 in case of error.
4. When decoding HTTP response, process all the headers, skipping all
   of those that are not-processed.
2013-05-24 17:23:07 -07:00
616e4a66dd Merge branch 'master' of github.com:cyassl/cyassl 2013-05-23 15:57:00 -07:00
8b90414f2a add POSITIVE_EXP_ONLY for fastmath stack reduction when positive exponents only 2013-05-23 15:55:22 -07:00
2030bab8d8 fixed shift, cast and name for extensions semaphore. 2013-05-23 17:02:39 -03:00
4ed2cf4b6e Earlier DTLS transmit patch, moved local variable definition to top of block 2013-05-22 18:36:13 -07:00
8df0e43384 fix merge differences from this week 2013-05-22 15:50:13 -07:00
acaa2c02bf Fixed unencrypted TLS alerts having extra data, ssn12 2013-05-21 18:21:22 -07:00
80225e58aa updated the formatting from the patch 2013-05-21 17:39:11 -07:00
c325436712 Merge branch 'master' of git://github.com/JonasNorling/cyassl into JonasNorling-master 2013-05-21 17:27:11 -07:00
abed4cf669 Fix DTLS server memory leak, ssn11 2013-05-21 16:21:49 -07:00
d2003bb8b7 merge in sni 2013-05-21 14:37:50 -07:00
b347df8d9a DTLS rx size check, ssn10
Allows for receiving datagrams larger than the MTU that are reassembled
by the IP stack.
2013-05-21 13:52:22 -07:00
a243281ca9 MDK-ARM for LPC/STM 2013-05-21 19:14:14 +09:00
4b3c3c92b3 MDK-ARM for LCP/STM 2013-05-21 19:02:34 +09:00
ff68942ce4 MDK-ARM ready for LCP/STM 2013-05-21 18:47:54 +09:00
082f5643ed OK for LCP43xx project 2013-05-21 17:13:12 +09:00
7252b7ecd4 additional files for MDK-ARM/LPC43xx, STM32F2xx 2013-05-21 09:58:56 +09:00
fd5937b599 MDK-ARM updates 2013-05-20 17:56:27 -07:00
da342ea079 initial attempt for MDK-ARM/LPC43xx: 2013-05-21 09:39:09 +09:00
7693b4282a turn on large static buffers for callbacks, easier for user 2013-05-20 12:46:54 -07:00
10e6e7fbb5 check error_string_n size and truncate if too short 2013-05-20 10:36:06 -07:00
c2a82bce3d make up for MDK-ARM 2013-05-19 11:36:55 +09:00
926a62b458 make up for MDK-ARM 2013-05-19 11:22:08 +09:00
04c6a447ab make up #3 for MDK-ARM 2013-05-19 10:56:42 +09:00
d3ceb89fb0 make up #2 for MDK-ARM 2013-05-19 10:47:35 +09:00
b430a14032 make up for MDK-ARM release 2013-05-19 10:33:32 +09:00
55763ef318 Commit 2.6.2 2013-05-19 10:02:13 +09:00
8f5e98486f fix MPLAB X windows warnings 2013-05-17 11:13:47 -07:00
a4c6ed0dda add support for Microchip TCP/IP 6.0 beta 2013-05-17 10:59:18 -06:00
dcf88daae7 fix KEIL warnings 2013-05-17 09:49:46 -07:00
2051ee49b7 Increment record layer sequence number when retransmitting DTLS packets (as per the RFC). Send the Finished message in the next epoch, but don't commit to using the next epoch until the other end indicates that the CCS message has been received.
Tested against an OpenSSL server, this change makes it a bit happier.
2013-05-17 16:47:55 +02:00
4dbb2d6d3b fix valgrind prog check, catch more failures 2013-05-16 16:20:51 -07:00
cfdfa7b2b3 pull in Kojo MDK-ARM projects, changes 2013-05-16 09:47:27 -07:00
05f11c4bca DTLS Finished send duplication
1. Only add the encrypted Finished message to DTLS retransmit pool.
2. Don't increment the epoch or sequence number when retransmitting.
2013-05-15 10:31:42 -07:00
091c7a7ef3 separate STM32F2 hardware hash support, disable by default 2013-05-15 10:48:35 -06:00
ac716c96d3 Output buffer size check when sending transmit pool.
1. Added a call to CheckAvailableSize() when sending the DTLS transmit pool.
2. Rename CheckAvailableSize().
2013-05-13 12:32:47 -07:00
9905787f4a update make rpm per Brian's changes 2013-05-13 11:24:28 -07:00
2a741ba469 Merge branch 'master' of github.com:cyassl/cyassl 2013-05-10 17:34:32 -06:00
f5c3458795 fix typos 2013-05-10 17:31:50 -06:00
61bf080290 fix serverhello extensions idx bug 2013-05-10 15:52:32 -07:00
871c116395 fix enable inline default message to enabled 2013-05-10 12:34:00 -07:00
32705fb380 make sure pwdbased w/o fastmath works like fastmath define wise 2013-05-10 11:00:37 -07:00
d7e74d0383 allow sniffer to sniff known testsuite, no port 0 2013-05-09 18:42:24 -07:00
07407bbdaa rename sniffer bornOn to lastUsed to reflect new usage 2013-05-09 17:58:48 -07:00
712b3dd17c remove some not compiled ins 2013-05-09 15:33:37 -07:00
8f0b695249 fix leanpsk build with keep cert / session cert 2013-05-09 15:29:25 -07:00
83b96d748e external API use SSL_FATAL_ERROR instead of -1 cases 2013-05-09 13:17:07 -07:00
ca4b2b3f90 keep sniffer sessions alive as used, and prevent remove stale from removing active ones 2013-05-09 11:48:02 -07:00
f4c379cb96 minor typo fix 2013-05-09 11:23:07 -06:00
47b468d14f add dtls recv timeout max user setting too 2013-05-08 12:49:55 -07:00
8cb5f6d5d4 add user setting for dtls recv timeout init value 2013-05-07 16:14:26 -07:00
9c9c59cec3 update sevrver session cert w/ old client hello too 2013-05-06 18:11:14 -07:00
9505f92bd1 restore session certs when resuming session 2013-05-06 17:25:50 -07:00
018d1684c9 add camellia to sniffer 2013-05-06 15:37:58 -07:00
fa35353e75 cleaup memsave cert cache 2013-05-02 12:23:49 -07:00
a7228d0463 Merge branch 'master' of github.com:cyassl/cyassl 2013-05-02 11:35:56 -07:00
a0c630b4ee add cert cache persistence 2013-05-02 11:34:26 -07:00
a56544c8b8 update README 2013-05-02 09:58:29 -06:00
a0dc1b6f47 update README with Mingw note 2013-05-01 14:29:31 -06:00
864f0468aa Cygwin/Mingw64 fixes 2013-05-01 14:17:11 -06:00
bc1a6282eb bump dev version 2013-04-30 12:56:28 -07:00
5104f4ea7a fix typos 2013-04-29 20:17:43 -07:00
57512c46e8 Merge branch 'master' of github.com:cyassl/cyassl 2013-04-29 20:09:24 -07:00
1e6119bb0d always try most recent used session on row first for match 2013-04-29 20:08:21 -07:00
42b937b8f3 Merge branch 'master' of github.com:cyassl/cyassl 2013-04-29 17:09:58 -07:00
d2d25b9b83 refine the SKID/AKID support 2013-04-29 17:09:15 -07:00
8c1310e376 fix mem save/restore size with clientcache 2013-04-29 16:56:30 -07:00
aebd926472 better endif ids 2013-04-29 14:52:28 -07:00
8e64f9903d fix typos 2013-04-29 14:48:03 -07:00
5a1886656a Merge branch 'master' of github.com:cyassl/cyassl 2013-04-29 14:23:22 -07:00
5c4fdb30ad add client session table lookup based on serverID, use CyaSSL_SetServerID to set/store with serverid 2013-04-29 14:22:32 -07:00
87048698e5 use subject key id and authentication key id to ID CA certs in the signers list instead of subject name hashes. 2013-04-29 12:08:16 -07:00
791767e026 make sure unloadcas works w/o filesystem 2013-04-26 10:28:30 -07:00
411a096b2b add memory versions of session cache save/restore 2013-04-25 17:23:58 -07:00
05dd84598b turn CA signer list into CA signer hash table, defaults CA_TABLE_SIZE to 11 2013-04-25 15:36:33 -07:00
9dbf6a5e10 fix Signer hash size w/o SHA, fix GetCA caList b4 lock 2013-04-25 14:47:09 -07:00
98b7ed9d47 more consistent SSL_SUCCESS for external SSL() returns 2013-04-25 11:36:38 -07:00
942480e6ba fix save cache file problem, version id, and match cache separarte error 2013-04-24 14:17:50 -07:00
477129b53e fix conversion warning 2013-04-24 13:35:28 -07:00
158029752c only reset session cache with lock 2013-04-24 11:20:54 -07:00
f12ba533e2 Merge branch 'master' of github.com:cyassl/cyassl 2013-04-24 11:16:35 -07:00
956ac08cab add persistent session cache, ssn9 2013-04-24 11:10:23 -07:00
8e5532eb42 Merge branch 'master' of github.com:cyassl/cyassl 2013-04-24 10:37:55 -07:00
c27ebe546d find the subject id and authority subject id extentions when decoding a certificate 2013-04-24 10:37:11 -07:00
65913b0d6c error out earlier in get_chain_X509 2013-04-23 13:21:00 -07:00
bad1c32df2 add session cert conversion to x509, and free x509 for dynamic variety 2013-04-23 11:50:06 -07:00
4491de3b77 add UnloadCAs ability for CTX or CertManager 2013-04-22 13:18:08 -07:00
8c0ee8a6f7 make sure all external APIs at SSL level return SSL_SUCCESS instead of sometimes 0 from old CyaSSL API 2013-04-22 12:43:57 -07:00
11d81b86de change windows low res timer return 2013-04-22 10:52:38 -07:00
b5ac92bcd1 commit tests basic turns off fastmath since default now 2013-04-19 13:51:53 -07:00
24ec09ef7a change big int cast in comparison after 64/128 changes 2013-04-19 13:49:26 -07:00
702c1b044d add fewerPacket/group messages to example client/server and disalbe client cert/key load 2013-04-19 13:10:19 -07:00
d665e16bd8 add user ctx to verify callback with CyaSSL_SetCertCbCtx 2013-04-18 10:37:10 -07:00
729fc1e603 add discardSessionCerts flag for verify callback 2013-04-18 09:11:35 -07:00
71a1abebf5 break up sig confirm errors into no sig, crl, and ocsp specific 2013-04-18 08:38:28 -07:00
f8ba117cef cleanup 64/128bit type decls for big int libs 2013-04-17 17:26:33 -07:00
e38b4d5868 free CyaSSL CTX count mutex 2013-04-17 13:25:02 -07:00
38dec0b932 bump dev version 2013-04-17 09:41:43 -07:00
1f09e35ccd Merge branch 'master' of github.com:cyassl/cyassl 2013-04-17 09:39:05 -07:00
dafcd8782a add altnames check to domain match 2013-04-17 09:37:57 -07:00
62a071262c move CYASSL_USER_IO back to MICROCHIP_PIC32 2013-04-17 10:19:18 -06:00
d50b388a33 add wildcard check to domain name match 2013-04-17 09:07:26 -07:00
b806ca3c2f help compiler with fp_div cast to 32bit 2013-04-16 15:29:03 -07:00
fe13b4b6c6 moved and renamed the CBIO error codes so they are publically available 2013-04-16 12:32:55 -07:00
d279695314 changed ENDIAN_* to *_ENDIAN_ORDER 2013-04-16 12:12:49 -07:00
8eee0b1d4c add blake2 headers to dist 2013-04-15 13:22:11 -07:00
79432d9017 fix README typos, minor additions 2013-04-15 11:49:33 -07:00
f29da112c6 version.h update for non autoconf 2013-04-15 11:23:14 -07:00
4da114354b release 2.6.0 README 2013-04-15 11:20:57 -07:00
7c003c5755 add sanity check on cleanup for possible no init 2013-04-12 17:07:00 -07:00
fe0cd26b1e make clear where options.h came from 2013-04-12 16:50:16 -07:00
991a9094e6 trying moving options save earlier, autogen sometimes 2013-04-12 13:18:53 -07:00
b90d0d305d add wolfSSL header to configure generated options.h 2013-04-12 12:56:44 -07:00
3cfb270a4d make sure commit tests don't overwrite options.h 2013-04-12 12:19:46 -07:00
0b7e18040c generate cyassl/options.h based on ./configure flags/settings for user app use 2013-04-12 11:21:38 -07:00
f6edc37549 change fastmath opt to 2 instead of 3, causes potential confilicts with aesni on non-aesni systems with gcc 4.6.3 2013-04-12 09:29:31 -07:00
ba3e089596 add USE_ANY_ADDR for bind to any with echoserver 2013-04-11 21:51:17 -07:00
8a6bd081c4 Merge branch 'master' of github.com:cyassl/cyassl 2013-04-11 15:00:42 -07:00
997d6dccf3 fix windows ipv6 test w/ getaddrinfo 2013-04-11 14:52:04 -07:00
6d49631170 Merge branch 'master' of github.com:cyassl/cyassl 2013-04-11 14:10:32 -07:00
a74ac2b22c added case to DerToPem() to add EC header and footer to the PEM output 2013-04-11 14:03:18 -07:00
12f00a7acc change ipv6 tests to use getaddrinfo for better scope id % handling, inet_pton doesn't always work depending on system 2013-04-11 12:30:09 -07:00
b5c43d8ad4 don't default to loopback only for ipv6 tests, if inet_pton available allow lookups 2013-04-11 10:12:15 -07:00
576cb10732 fix port 0 hack for unit tests with ipv6 2013-04-10 17:09:53 -07:00
a2bd6e786d fix leanpsk NO_SHA build 2013-04-10 12:42:51 -07:00
f535e5428e make sure all tests/examples *.c use settings.h correctly 2013-04-10 12:17:23 -07:00
97e0ec073f make sure all lib proper *.c files have config.h then settings.h then checks for defines in case user using settings.h for lib config 2013-04-10 11:04:29 -07:00
185331f007 fix shadow on decl 2013-04-10 10:24:33 -07:00
1ff98154e5 remove serial-tests and downgrade automake/autoconf version requirements 2013-04-10 10:21:56 -07:00
27d6c727e0 add MICROCHIP_TCPIP 2013-04-10 09:16:11 -06:00
0edc19feb2 converting DerToPem, readjust output buffer size to account for size of header and footer when calling Base64_Encode 2013-04-09 19:03:21 -07:00
e98193000a KEEP_PEER_CERT includes the function CyaSSL_X509_get_subjectCN 2013-04-09 09:45:25 -07:00
bea9084071 Merge branch 'master' of github.com:cyassl/cyassl 2013-04-08 16:03:27 -07:00
b0dca8ea69 updated SHOW_SIZES, opionally adds sizes as available, added flag to example client to print sizes 2013-04-08 16:01:52 -07:00
9b0ffa0249 brought CYASSL_CALLBACK code up to current standard 2013-04-08 15:34:54 -07:00
eeb8cdccde s_fp_sub() bug fix 2013-04-05 13:44:53 -06:00
2dd22938d6 rearranged the HMAC header to tolerate having missing hash types 2013-04-03 17:33:50 -07:00
bf69de7054 if using SHA-512 but not SHA-384, fix so that HMAC still works 2013-04-03 16:41:44 -07:00
786e4d9462 fixed leak of method when ctx malloc fails; implemented get_shutdown 2013-04-03 16:35:19 -07:00
217254b533 check CBIOCookie for NULL before trying to call it 2013-04-02 16:36:07 -07:00
f73585eec8 HP/UX fixes, strsep impl 2013-04-02 16:27:53 -06:00
0480b2b60e update test crls 2013-04-01 15:55:03 -07:00
1224d3d907 Merge branch 'master' of github.com:cyassl/cyassl 2013-04-01 15:52:23 -07:00
0005b4cbe4 move pthread flags/libs to autoconf defines so available to library proper and external tests/examples 2013-04-01 15:50:13 -07:00
13fb56d88e add SHA-384/512 to the full test case 2013-04-01 15:42:57 -07:00
e9bc868dbb AES-GCM does not require SHA-384, but will use it if enabled in build; reorder some of the requirement checks to regroup some NO_RSA suite checks 2013-04-01 14:25:20 -07:00
7004b2eafc certs still use SHA hash for names 2013-04-01 13:49:21 -07:00
30553a43ed when disabling arc4, ignores contents of arc4.c 2013-04-01 13:42:41 -07:00
9975d1d675 Merge branch 'master' of github.com:cyassl/cyassl 2013-04-01 13:39:09 -07:00
44352b5673 don't return closed alert if peer sends fatal alert; respond to closed alert with closed alert 2013-04-01 13:37:25 -07:00
4b90474581 move CM VerifyBuffer out of no filesystem 2013-04-01 11:59:17 -07:00
367429410f Merge branch 'master' of github.com:cyassl/cyassl 2013-03-29 14:07:41 -07:00
f8848aaa1b lower example client/server stack buffer sizes 2013-03-29 14:06:36 -07:00
a572967017 when checking for DTLS, only need to compare against major version 2013-03-28 13:28:12 -07:00
332fd68347 add lowmem to stacksize build 2013-03-28 11:38:27 -07:00
c5385f902c Merge branch 'master' of github.com:cyassl/cyassl 2013-03-28 11:30:10 -07:00
ee0595f543 add --enable-stacksize to print out stack use info with pthreads for example client/server 2013-03-28 11:28:38 -07:00
b6d49c5725 when using clang, dropped a compile flag that was causing errors on link 2013-03-28 11:07:43 -07:00
6aaf484b90 add mcapi MPLAB X project files 2013-03-28 11:12:19 -06:00
f396de1191 add DTLS support for alignment 2013-03-27 16:58:27 -07:00
3db8935093 configure switch to enable_static on if shared off when hardsetting for valgrind or cavium 2013-03-27 15:17:21 -07:00
8a2936ebd4 Merge branch 'master' of github.com:cyassl/cyassl 2013-03-27 15:12:44 -07:00
82e3c00075 add CYASSL_GENERAL_ALIGNMENT detection and setting for TLS alignment attempt 2013-03-27 15:11:49 -07:00
4a5a251e80 Merge branch 'master' of github.com:cyassl/cyassl 2013-03-27 13:36:07 -07:00
6d8246e98c fix scan-build 272 warnings 2013-03-27 12:32:22 -07:00
8732fcddd9 replaced the serial-tests in configure.ac for now 2013-03-27 12:12:16 -07:00
2f6636559d Merge branch 'master' of github.com:cyassl/cyassl 2013-03-27 10:22:56 -07:00
547872683f adjustments to the example tests for Windows 2013-03-27 10:22:50 -07:00
7d287a6ba9 modified test port number to allow concurrent testing 2013-03-26 22:00:39 -07:00
7d82bec7fc do rabbit/hc128 alignment at crypto layer for non intel 2013-03-26 18:16:15 -07:00
14b4bb3b0f change rabbit and hc128 to return values for key and process, will add error rets for alignment issues 2013-03-26 14:42:09 -07:00
f601b7bfda move aesni cbc encrypt align check down to crypto layer 2013-03-26 14:13:01 -07:00
6bc7ba1592 change AesCBC end/dec to return status, will add failure cases with align checks 2013-03-26 12:36:39 -07:00
8e53c7a62e fix inline type spot 2013-03-25 11:50:15 -07:00
72926b1eed make sure blake2 calls denote it's the 'b' version, blake2b 2013-03-25 11:35:33 -07:00
7279d3bf85 passed the -d and -N flags into the test executor 2013-03-25 08:41:44 -07:00
9d77ca744f fix C++ cast problem on make_eap 2013-03-24 13:06:22 -07:00
cb311e5708 explain C aesni asm naming fix in code too 2013-03-24 12:59:30 -07:00
8a924244c5 change aesni asm function name to explicit asm for ABI underscore conflicts with clang/gcc differences 2013-03-24 12:53:35 -07:00
80e3c85737 change inline assembly to more generic condition code in clobber list, clang likes it better this way 2013-03-24 11:09:58 -07:00
75bb1a8fa7 only 1 LT_INIT in configure.ac, pass options there w/ prereq check 2013-03-23 12:15:02 -07:00
2c452b305f Merge branch 'master' of github.com:cyassl/cyassl 2013-03-23 12:03:42 -07:00
d33f180760 blake2 32bit build warning fix 2013-03-23 12:02:14 -07:00
436a51a0d7 Merge branch 'ccm' 2013-03-22 17:29:30 -07:00
d7c01be8bb blake2 ctc api, test vecs 2013-03-22 13:30:44 -07:00
d8b85da693 remove c++ comments, switch to c 2013-03-22 12:10:53 -07:00
f65f86bb88 improvements to CCM, ssn6 2013-03-22 11:30:12 -07:00
d6deb690e6 Merge branch 'master' into blake2 2013-03-22 10:20:01 -07:00
7522550cbf add plib.h to mcapi test, optimize MPLAB ctaocrypt_test project 2013-03-22 10:45:19 -06:00
ace69d1c77 bump dev branch 2013-03-21 19:27:29 -07:00
359803fc7d add mcapi test performance tune, chris 2013-03-21 19:13:49 -07:00
4d5712ca93 add mcapi pointer arg sanity checks 2013-03-21 13:39:13 -07:00
e63fa491aa add mcapi ecc with tests 2013-03-21 13:20:23 -07:00
4210716c22 add mcapi rsa with test 2013-03-21 10:28:55 -07:00
965b70c32f add mcapi aes direct with tests 2013-03-21 08:49:12 -07:00
3ecab06841 add mcapi aes ctr with test 2013-03-21 08:33:02 -07:00
ea9784b32b cast size_t for printf mem output, c99 may not be available 2013-03-21 07:58:53 -07:00
c4714f71db add mcapi aes-cbc 2013-03-20 19:21:04 -07:00
46442075f4 add mcapi tdes with tests 2013-03-20 18:35:26 -07:00
a6d29aa628 enable mc dbinit for mcapi test, chris 2013-03-20 15:54:08 -07:00
dc55de007d add mcapi rng with test 2013-03-20 15:02:03 -07:00
ae9265fa44 add macpi huffman 2013-03-20 14:37:05 -07:00
7d7a72f2a6 add hmac sha512 2013-03-20 12:26:55 -07:00
3af1275f5d Merge branch 'master' of github.com:cyassl/cyassl 2013-03-20 12:00:28 -07:00
2d72bfe0eb macpi hmac with tests 2013-03-20 11:59:27 -07:00
2360c038be Merge branch 'master' of github.com:cyassl/cyassl 2013-03-20 11:29:31 -07:00
02581a3da2 added control of compress memory usage via build setting 2013-03-20 11:28:45 -07:00
e19c65da8b Merge branch 'master' of github.com:cyassl/cyassl 2013-03-20 10:21:05 -07:00
8564014983 add mcapi hash with tests 2013-03-20 10:14:06 -07:00
692dc09d10 Merge branch 'compress' 2013-03-20 10:05:49 -07:00
615f652bd0 filled out our Compress and DeCompress functions, updated the test case 2013-03-20 09:58:31 -07:00
72c5a92bde add ecc to commit tests, fastmath now on by default 2013-03-20 09:19:59 -07:00
f878dbcef2 fix ecc key load w/ no rsa, ssn5 2013-03-20 09:18:05 -07:00
0f8111fc77 zero out psk keys asap, ssn4 2013-03-20 09:12:00 -07:00
e8b9651075 hid the internal compress functions from the cryptlib versions 2013-03-19 16:44:50 -07:00
fc928e7725 added stubs and a test for ctaocrypt compress 2013-03-19 16:25:58 -07:00
4f9e915bc1 add KEEP_PEER_CERT flag for non opensslextra peer cert storage, ssn3 2013-03-19 12:18:52 -07:00
a5d9005ac7 change autconf system to default to fastmath now 2013-03-18 15:32:04 -07:00
88938390ba fix track memroy overread on realloc example problem 2013-03-18 11:17:34 -07:00
b5d3613946 added new iOS project to automake include list 2013-03-18 09:49:23 -07:00
fa520f753d Merge branch 'master' of github.com:cyassl/cyassl 2013-03-18 09:37:26 -07:00
6ba3ae51f9 added Xcode v4.6 project for iOS v6.1 to build CyaSSL 2013-03-18 09:27:38 -07:00
e3f72effb2 fix memory track free return warning 2013-03-15 15:30:03 -07:00
8e3f83e152 bump dev branch version 2013-03-15 15:13:08 -07:00
6ba7743fb3 fix fastmath no asm casts to shorter sizes 2013-03-15 15:11:21 -07:00
31b03c8a2d dtls defaults to no static buffers now, fix valgrind errors with dtls 2013-03-15 14:21:36 -07:00
ae63878700 fix unused memory tracker warning is disable-memory 2013-03-15 13:22:35 -07:00
0bcaf12bf4 Merge branch 'master' of github.com:cyassl/cyassl 2013-03-15 13:17:58 -07:00
543108bdcc add memory tracker to example client and server if using default memory cbs 2013-03-15 13:17:05 -07:00
e12f947c4f fix TRUE/FALSE clash in asn.c 2013-03-15 11:50:45 -06:00
dd4be2496a client example shouldn't use set_verify w/ no certs 2013-03-14 17:13:11 -07:00
2d9ed696c6 fix USER_TIME casts 2013-03-14 10:51:06 -07:00
4e99c7ac99 check TRUE/FALSE and move after all includes in ssl.c 2013-03-14 09:34:29 -07:00
bb103561ae fix non DTLS USER_IO cb 2013-03-14 09:16:47 -07:00
2e980423ec hash session IDs since some aren't random afterall 2013-03-13 17:19:36 -07:00
2dfec3c6f1 add CYASSL prefix to WORD/BIT enums 2013-03-13 16:49:20 -07:00
e515638503 make EmbedGenerateCookie a callback, USER_IO can install their own or default to ours 2013-03-13 16:41:50 -07:00
b9a7407d31 make sure FreeRTOS defines aren't redefs 2013-03-13 13:14:01 -07:00
30b9033216 switch enable names to no uppercase to match others 2013-03-13 12:58:50 -07:00
129de03da0 switch --enable-noInline to enable/disable-inline to match all others 2013-03-13 12:25:34 -07:00
975ffe693b switch --enable-noFilesystem to --enable-filesystem / --disable-filesystem to match others 2013-03-13 12:14:05 -07:00
7cabbb4b54 add --enable-oldtls, build and leanpsk check 2013-03-13 11:49:11 -07:00
99ef1a8d7e add --enable-errorstrings and build check 2013-03-13 11:27:14 -07:00
0a63898f5b make sure stat uses full path for REG check 2013-03-13 11:17:14 -07:00
f0c48fba45 bump version for tag download 2013-03-13 10:14:06 -07:00
e482c00cb1 only setup precommit hook for git, github allows non git downloads through tags and zips 2013-03-13 10:06:08 -07:00
25b4fed7b3 add --enable-null 2013-03-12 18:49:59 -07:00
d0e16d25b4 add error message for correct snifftest dir to run from 2013-03-12 16:32:16 -07:00
11ffca451a make readdir file type check more generic 2013-03-12 16:21:07 -07:00
dbe83c7405 fix typos 2013-03-12 15:56:58 -07:00
a868451d72 add NO_64BIT flag to normal and fastmath to use a 32 bit accumulator for multiply when 64 bit actually slows it down 2013-03-12 15:52:47 -07:00
a4c8d0e76c make sure no asn doesn't build big int 2013-03-12 15:14:03 -07:00
ec0a4d45cb add --enable-memory, build, disable runtime memory cbs, check leanpsk 2013-03-12 13:31:14 -07:00
4774f1b285 add --enable-coding, build, leanpsk check 2013-03-12 13:12:10 -07:00
e8ce0b7f51 add --enable-dh, build, checks w/o asn 2013-03-12 13:03:42 -07:00
9a1b32d830 add --enable-asn, build, and checks for rsa / psk w/o asn 2013-03-12 12:48:41 -07:00
86f7d48c7e fix comment set but unused new gcc warning 2013-03-12 09:52:16 -07:00
6773287895 add --enable-des3 and build, no strnstr in tests 2013-03-12 09:46:15 -07:00
1628b6f83f add --enable-sha and build, disables examples for now since certs still use sha, when add --disable-certs add more thorough check 2013-03-11 17:53:38 -07:00
7914938e60 --enable-md5 and build, needs NO_OLD_TLS, suite test version check 2013-03-11 17:37:08 -07:00
894a35a0f2 add --enable-arc4 and build 2013-03-11 17:13:24 -07:00
5a0d108cd9 add --enable-aes and build 2013-03-11 17:07:37 -07:00
f232ff84b4 add --enable-pwdbased and build, opensslextra needs 2013-03-11 17:01:05 -07:00
7719cd9faa add --enable-dsa 2013-03-11 16:39:06 -07:00
2ab409df96 add --enable-md4 2013-03-11 16:26:08 -07:00
49e62f0858 fix general NO_SHA NO_ASN NO_CERTS NO_SESSION_CACHE builds/examples 2013-03-11 16:07:46 -07:00
285ca36ca2 fix normal psk no rsa examples 2013-03-11 13:19:43 -07:00
895944c04a fix distcheck 2013-03-11 12:53:38 -07:00
87ad65d33f add --disable-rsa, bump dev version 2013-03-11 12:49:59 -07:00
9210395c57 init alert history state 2013-03-11 12:28:17 -07:00
6b67d5e931 even cleaner output 2013-03-11 12:12:04 -07:00
ebf25c5c4b cleanup suite test output 2013-03-11 12:09:49 -07:00
d1277b1343 cleanup not supported suite test output to 1 warning 2013-03-11 12:02:22 -07:00
71f9ee4f2e remove non blocking suite test cases since now automatic 2013-03-11 11:53:40 -07:00
b24f7f502c consolidate suite tests into normal and dtls files 2013-03-11 11:46:28 -07:00
3f4c570aa1 have suite tests self repeat non blocking 2013-03-11 11:07:46 -07:00
7ce9315173 Merge branch 'master' of github.com:cyassl/cyassl 2013-03-11 11:00:47 -07:00
47e7e27bb2 add cipher suite check to suite tests to make adding test cases easier 2013-03-11 10:59:08 -07:00
ec3d060691 fixed a cygwin bug for the build test. recv() was returning an unexpected error code for non-blocking sockets. 2013-03-08 18:09:52 -08:00
20e4889092 Merge branch 'dtls'
Conflicts:
	src/ssl.c
2013-03-08 17:45:35 -08:00
73f0395ca9 added psk-dtls test cases 2013-03-08 17:35:03 -08:00
e1a73c1769 added more dtls test cases 2013-03-08 17:19:04 -08:00
01a5368ffc rest of ECC no error strings for cipher names 2013-03-08 12:11:49 -08:00
43ed4a7424 added test cases and fixed a bug with AEAD ciphers with DTLSv1.2. 2013-03-07 22:52:51 -08:00
f65dcd1378 fix NO_RSA ecc command line examples default certs 2013-03-07 18:20:29 -08:00
6b3a80366f NO_RSA with ecc build fixes 2013-03-07 18:10:18 -08:00
85b3346bbf NO_RSA build, cipher suite tests need work for this build optoin, ssn2 2013-03-07 17:44:40 -08:00
23d6c70d3e allow for extra bytes in sig encoding for conforming signed big int, patch ssn1 2013-03-07 10:47:01 -08:00
591e1fc772 DTLSv1.2, fixed DTLS socket timeout 2013-03-06 23:02:33 -08:00
49e67487e7 Merge branch 'master' of github.com:cyassl/cyassl 2013-03-04 17:16:32 -08:00
01e9a246cd added build test cases for ECC-SHA384 test suites. 2013-03-04 17:14:19 -08:00
b9ab09a5a6 added test cases for SHA-256 cipher suites, fixed a bug in ECDH-RSA-AES128-SHA256 picking 2013-03-04 16:16:34 -08:00
d52fe96063 added AES-CBC-SHA256 and SHA384 cipher suites. 2013-03-04 13:25:46 -08:00
43b8300896 windows shadow fix 2013-03-04 12:30:36 -08:00
12371d1c3b fix windows build warnings 2013-03-04 12:18:21 -08:00
2667b8b542 fix base64 decode white space loop 2013-03-04 11:36:07 -08:00
98e766e770 our type changes 2013-02-28 17:51:35 -08:00
3319ed9921 Merge branch 'master' into blake2 2013-02-28 16:50:45 -08:00
b4584e0a93 added missing test config files to the configure include list 2013-02-28 11:39:33 -08:00
cc9ac1846d fix ecc w/ no rsa send cert verify and server flag for missing cert verify 2013-02-26 22:24:34 -08:00
b397f89b27 better inits for sniffer use 2013-02-26 09:00:46 -08:00
f3a16e56c7 help static analysis 2013-02-25 10:47:55 -08:00
4fe2a1ec42 fix sigAlgo unused-but-set gcc 4.6 warning 2013-02-25 10:42:51 -08:00
e947c86e67 add license, bring up to date 2013-02-22 15:52:20 -08:00
48303918c2 Merge branch 'master' into blake2 2013-02-22 15:22:02 -08:00
88ba790930 added an additional failure case log output to InitSSL() for the RNG initialize failing 2013-02-22 09:51:07 -08:00
6ff39cffe4 Merge branch 'dtls'
Conflicts:
	cyassl/ctaocrypt/types.h
2013-02-20 17:08:22 -08:00
f4082f83e5 sb fixes for certgen + keygen 2013-02-20 15:45:10 -08:00
b2b45d3f4a sb fixes for crl and ocsp 2013-02-20 15:26:22 -08:00
ffc67892a4 allow for 0 length handshake messages, still need to store the message header 2013-02-20 10:43:50 -08:00
598043dd6f drains the DTLS message store once an in-order message is received. 2013-02-20 09:28:09 -08:00
2c1ed7c11c removed old defragmentation code. fixed new defragment code. 2013-02-20 08:35:33 -08:00
04d0c581b1 set output test size to real size, no strlen, make sure input strlens don't have 0x00 2013-02-19 16:16:40 -08:00
bdadeab342 added storing of out-of-order and fragmented message, missing processing of the stored list 2013-02-19 16:06:02 -08:00
07baa27b20 fix scan build for fastmath, dtls, ecc, psk, sha512 2013-02-19 12:53:58 -08:00
116f2403d0 updated the list for storing out of order messages 2013-02-19 12:51:02 -08:00
7e29b8d2a6 Merge branch 'master' of github.com:cyassl/cyassl 2013-02-18 15:20:25 -08:00
59af8944cb fix opensslextra sb issue 2013-02-18 15:11:33 -08:00
abe921d703 Merge branch 'tls12' 2013-02-18 14:42:53 -08:00
87cad7a966 merge branch tls12 into master 2013-02-18 14:36:50 -08:00
a8f6baf37c repeat each cipher suite test with client cert request off 2013-02-18 14:12:03 -08:00
d9a9982bc8 length check the hello extensions 2013-02-18 12:52:08 -08:00
df011b2e40 Server and client tell each other which sig/hash algos they support, peers pick from the list and use it indicating which one they used as appropriate. 2013-02-18 11:54:23 -08:00
0acd8f0670 added sig_algo for rsa for missing cases in SetCipherSpecs() 2013-02-15 12:16:19 -08:00
dfa1553548 3rd scan build fixes 2013-02-14 16:23:48 -08:00
9ea3371079 2nd round scan build 2013-02-14 16:00:45 -08:00
cdc651a75a coverity ignores 2013-02-14 14:13:19 -08:00
62ef5de25c scan build fixes 2013-02-14 14:09:41 -08:00
657b10c8b2 client sends sig/hash hello extension to server, server sends a selection (hardcoded) back, and both use the selection 2013-02-13 15:30:46 -08:00
d65e5ef3e4 bug fix 2013-02-13 12:05:56 -08:00
afb0cb3e20 Fixed merge conflict with stashed code 2013-02-12 14:57:39 -08:00
5f7359be7e Builds the hash/sig algorithm extension list based on the available cipher suites and hashes 2013-02-12 13:47:13 -08:00
8ace08499b make sure example CyaSSL_read()s that fill buffer don't overrun by 1 byte if trying to output with null terminator 2013-02-08 11:21:48 -08:00
982b72796e added list for DTLS handshake datagram reordering 2013-02-07 11:26:02 -08:00
30004498c5 For TLSv1.2, cert and key messages use SHA-256 or SHA-384 as expected. 2013-02-06 13:08:28 -08:00
44e0d7543c change copyright name with name change 2013-02-05 12:44:17 -08:00
834ebe5bd8 BUGFIX: Fixed segmentation fault on CyaSSL_BIO_free().
In CyaSSL_BIO_new_socket() bio->mem is never initialized. This will cause freeing of unallocated memory in CyaSSL_BIO_free:

if (bio->mem)
  XFREE(bio->mem, 0, DYNAMIC_TYPE_OPENSSL);

since bio->mem is not NULL, resulting in a crash.
2013-02-05 11:22:36 +00:00
f4f13371f9 update copyright date 2013-02-04 14:51:41 -08:00
36f62a5707 fix CyaSSL_write memory error return, bump dev version 2013-02-04 14:11:20 -08:00
543d81ba97 release 2.5.0 2013-02-04 13:11:21 -08:00
24e22d4b6e add cavium notes and free ssl cavium ciphers 2013-02-01 16:26:42 -08:00
44b6593fe5 add cavium ciphers to SSL, and example client 2013-02-01 12:21:38 -08:00
defe5b4e31 Merge branch 'master' of github.com:cyassl/cyassl 2013-01-31 15:55:42 -08:00
01703281cc add cavium RSA to ctaocrypt 2013-01-31 15:55:29 -08:00
ba26b4b4e2 fix to prevent --disable-debug from enabling it 2013-01-31 13:44:38 -07:00
d799898a36 update README 2013-01-31 11:14:17 -07:00
a3caa03381 tie MQX directory into automake, update docs 2013-01-31 10:20:29 -07:00
7f4b0d1d3a add missing MPLAB X project files 2013-01-30 22:13:42 -07:00
5d29bf1e49 add MPLAB X projects, PIC32 GenerateSeed() 2013-01-30 18:02:18 -07:00
b3ffcbd5b4 fix DH key size output in benchmark 2013-01-30 16:54:43 -07:00
2fc54ad751 add PIC32 current_time() to benchmark 2013-01-30 16:29:15 -07:00
95e7226447 add BENCH_EMBEDDED flag to CTaoCrypt benchmark app 2013-01-30 16:19:19 -07:00
b91f3c7c6d add NO_MAIN_DRIVER to CTaoCrypt benchmark 2013-01-30 10:20:39 -07:00
3ff842168e add cert/key buffer flags in CTaoCrypt benchmark for RSA, DH 2013-01-30 10:13:56 -07:00
6edfb2a601 Merge branch 'master' of github.com:cyassl/cyassl 2013-01-29 16:25:35 -08:00
91b800ea46 no sha384 for cavium now 2013-01-29 16:25:09 -08:00
a361f5c4bf initial cavium, crypto only, no rsa 2013-01-29 16:22:49 -08:00
532f0aaee7 add ability to use cert/key buffers in CTaoCrypt test app 2013-01-28 17:15:28 -07:00
ef644d4de0 fix libz warning 2013-01-25 13:06:44 -08:00
b17b81ef43 added sanity check on return from recv callback 2013-01-24 14:44:08 -08:00
6616975f81 added AES-CCM-8 ECC cipher suites, and more test cases 2013-01-21 15:19:45 -08:00
0e3a093cc5 renamed the Camellia cipher suites, dropped CBC and RSA from the strings 2013-01-21 11:10:11 -08:00
9f77aea1f8 Merge branch 'master' into blake2 2013-01-21 10:56:46 -08:00
a453ccba57 Added TLS support for Camellia 2013-01-21 10:53:42 -08:00
2e2de4cf4d added the cammelia cipher, updated the test cases 2013-01-18 17:26:49 -08:00
b8b968d77f added tests for setting Camellia key and IV 2013-01-18 13:48:30 -08:00
f65b0fc092 brought the camellia interface to match AES's more 2013-01-18 09:57:41 -08:00
d5bf944630 enabled the proper Camellia test, but mocked the encrypt and decrypt functions to pass the test 2013-01-17 22:09:55 -08:00
425d418dee added stubs, tests, and benchmark for Camellia to ctaocrypt 2013-01-17 21:52:31 -08:00
fe0772bcbf Merge branch 'master' into blake2 2013-01-17 16:08:47 -08:00
dfca5f82dd Merge branch 'master' of github.com:cyassl/cyassl 2013-01-17 06:51:59 -08:00
86c20f0e38 fix dtls server example to bind to any when specified 2013-01-17 06:51:37 -08:00
3f77a2c8c9 fixed bug where alerts sent during DTLS handshaking are malformed. check for out of order Server Hello Done during DTLS 2013-01-16 17:25:20 -08:00
b327925a1b Merge branch 'ccm' 2013-01-15 16:37:37 -08:00
c7b5fbe552 fixed a bug involving const nonces for CCM. Added AES-CCM to the full commit test case. 2013-01-15 16:16:48 -08:00
ccff37f4b1 added TLS support for AES-CCM-8 2013-01-15 15:20:30 -08:00
1139ad76aa automake really needs 1.12, autoconf works with 2.65 2013-01-15 14:33:29 -08:00
6993bc58b1 require automake 1.11 for serial-tests 2013-01-15 14:08:49 -08:00
9053a8c0ec uninstall generic config for distcheck 2013-01-15 13:21:26 -08:00
4567e05851 require newer autconf 2013-01-15 11:50:23 -08:00
eb221238c2 separated TLS-AEAD and AES-GCM so TLS-AEAD can also use AES-CCM 2013-01-14 15:59:53 -08:00
209e64ea79 Merge branch 'master' of github.com:cyassl/cyassl 2013-01-14 15:49:29 -08:00
d9a8bfbb80 Merge branch 'master' into ccm 2013-01-14 15:22:00 -08:00
5889b5d96d fix rsa benchmark decrypt buffer 2013-01-14 15:14:46 -08:00
59e381d9db updated automake options to disable parallel-tests 2013-01-14 15:12:30 -08:00
c75d738531 added a failure test case to the AES-CCM test 2013-01-11 09:15:15 -08:00
fa9126c2be added AES-CCM as a configure option 2013-01-10 16:46:47 -08:00
d1515f8ee6 Merge branch 'ccm' 2013-01-10 16:42:03 -08:00
05165bc09e Added AES-CCM encrypt/decrypt, test fuction, benchmark function. 2013-01-10 16:38:52 -08:00
e85caee845 added tests, prototypes, and stubs for AES-CCM 2013-01-08 12:16:53 -08:00
51c56051fb use dynamic buffer for AES-NI encrypt 2013-01-07 14:11:52 -08:00
7f701ca194 align RSA benchmark buffer 2013-01-07 14:08:56 -08:00
eeb11a6e51 fix rabbit and hc128 CTaoCrypt test buffers for aligned access only, allow TLS on intel w/o aligned stream buffers, otherwise align 2013-01-07 14:06:58 -08:00
f3a0d311a0 don't output debug messages in testsuite if valgrind on 2013-01-04 15:52:46 -08:00
f756573401 Merge branch 'ocsp-test' 2013-01-04 14:11:47 -08:00
ac885c40f0 fix a memory leak when OCSP lookup fails 2013-01-04 13:13:20 -08:00
3b6ba7935d default ocsp lookup callback returns an error if unable to connect to a responder 2013-01-04 10:34:29 -08:00
a695599667 bug fix in default ocsp lookup function 2013-01-03 17:58:45 -08:00
ac227910f1 modify OCSP to use a replacable callback to perform the OCSP transaction 2013-01-03 17:19:56 -08:00
53e4c2ed72 fix pvs studio warnings 2013-01-02 11:39:12 -08:00
0c363a17f1 init blake2 2012-12-31 13:10:47 -08:00
acb3e446ab typo 2012-12-29 13:33:13 -08:00
27a7cf609b only do Init once per compression rounds 2012-12-29 13:30:23 -08:00
3d88d8851a sslv3 may have bad padding, can't verify 2012-12-29 13:11:31 -08:00
640a0cb0e3 fix stream hmac check on multi data 2012-12-28 18:55:18 -08:00
44bf986827 no DTLS streaming checks 2012-12-28 17:54:19 -08:00
4c453d4d69 have server side reply unexpected_message for hello_request 2012-12-28 14:36:19 -08:00
f073f49ead make sure handshake complete before sending encrypted alert 2012-12-28 14:29:15 -08:00
6d3728fe61 fix ripemd compression round 2012-12-28 14:19:28 -08:00
4c9595c419 bump version 2012-12-28 14:07:49 -08:00
23ff36075b check RSA explicit size 2012-12-28 12:28:25 -08:00
09ea7169d7 use exisiting dummy data for compression round 2012-12-28 11:48:30 -08:00
7ac6a21af5 updated comment for aead in SanityCheckCipherText() 2012-12-27 19:51:06 -08:00
561906cffd Merge branch 'master' of github.com:cyassl/cyassl 2012-12-27 16:36:48 -08:00
f0bc61a5d3 add more robust pad/verify checks 2012-12-27 16:35:43 -08:00
724297a127 asn should use the validate date macro, not call the function directly. 2012-12-27 11:57:41 -08:00
e70838e984 Merge branch 'ecc' 2012-12-27 11:41:20 -08:00
581f91b984 Merge branch 'master' of github.com:cyassl/cyassl 2012-12-27 11:40:17 -08:00
03f9cafa4b ecc_verify_hash was leaking two mp_ints 2012-12-27 11:18:29 -08:00
0cfa423566 fixed mp_add_d overflow 2012-12-27 10:08:44 -08:00
60f4919ee6 add STM32 to README 2012-12-27 10:16:08 -07:00
254d53bb18 add CYASSL_STM32F2 define, LwIP errno.h 2012-12-27 10:06:29 -07:00
d993ee1969 Merge branch 'master' of github.com:cyassl/cyassl 2012-12-26 21:53:20 -08:00
baf9bef8a3 Revert "changed polarity on ocsp thisDate check to allow very timely responses"
This reverts commit afbc34f0e0.
2012-12-26 21:41:12 -08:00
cf114b92df made the ecc keys in the CYASSL struct dynamic 2012-12-26 16:39:19 -08:00
ea3dc3d834 add STM32F2 AES, DES, 3DES support 2012-12-26 15:18:57 -07:00
a7e0f4e483 add STM32F2 SHA1, MD5 support 2012-12-26 15:16:39 -07:00
acf1d07eea add STM32F2 RNG support 2012-12-26 15:08:33 -07:00
6913a46331 Merge branch 'master' of github.com:cyassl/cyassl 2012-12-26 10:40:28 -08:00
59419bef89 non block type ciphertext sanity checks 2012-12-26 10:11:15 -08:00
5bc976ee0f free ecc keys at the end of handshaking 2012-12-26 09:49:53 -08:00
dc88a7e8eb Merge branch 'timing' 2012-12-24 15:41:23 -08:00
9c58f70e29 add ciphertext size sanity checks 2012-12-24 15:40:09 -08:00
6b15443a3b fix clang using -pthreads flags on lion or greater 2012-12-24 14:37:03 -08:00
76bbcbb7b2 fix clang warning on api test 2012-12-20 18:38:48 -08:00
66a66c8905 valgrind needs .sh 2012-12-20 18:29:25 -08:00
831c760edc Merge branch 'ocsp'
Fixes some bugs in the ocsp code, and adds a new option to skip nonces.
2012-12-20 16:26:49 -08:00
afbc34f0e0 changed polarity on ocsp thisDate check to allow very timely responses 2012-12-20 15:56:57 -08:00
5164c15216 fixed missed initialization when not using ocsp nonces 2012-12-20 15:29:15 -08:00
541deaa0c0 release 2.4.6 2012-12-20 13:25:32 -08:00
902069783e allow leanpsk dist to build 2012-12-20 11:46:25 -08:00
51787db76b changed ocsp lookup to use dynamic mem for request rather than stack 2012-12-19 18:09:05 -08:00
26cf98c878 removed check against producedAt date in ocsp, check not required 2012-12-19 11:28:33 -08:00
4e657debfc added the ability to disable OCSP nonces 2012-12-19 10:18:11 -08:00
96cc05b7b1 fix shadow warning 2012-12-18 11:40:45 -08:00
b36bc55197 Merge branch 'ocsp' 2012-12-17 22:23:31 -08:00
359e86adf6 1. When OCSP and CRL enabled, checks CRL if unable to contact OCSP responder
and OCSP was enabled.
2. Fixed a couple string typos.
3. Only check OCSP if cert successfully parsed.
2012-12-17 22:19:20 -08:00
b25061844c remove hmac array initializers to 0 when non full because of reported compiler weirdness from user 2012-12-14 16:47:03 -08:00
c314dc3940 Merge branch 'master' into ocsp 2012-12-14 14:23:53 -08:00
f82324a081 README typo 2012-12-12 20:06:55 -08:00
0e67cd17d6 clang opensslExtra fix 2012-12-12 20:04:10 -08:00
726d686b07 fix clang scan-build problems 2012-12-12 18:03:32 -08:00
a108c5565e get release 2.4.4 ready 2012-12-12 17:13:33 -08:00
c49e7a85f7 fix configure.ac quoting 2012-12-12 14:33:21 -08:00
3a98eb7578 fix for current working directory, relative path instead of absolute, suggestion from SpamapS 2012-12-12 10:57:05 -08:00
831e643a24 fixed file name in comment 2012-12-12 10:14:38 -08:00
977ff51ad5 Merge branch 'master' of github.com:cyassl/cyassl 2012-12-12 09:42:21 -08:00
ed39a1652c deleted a stray index increment throwing off DecodeResposeData processing 2012-12-12 09:21:57 -08:00
ac1890922b removed unused variable from lookup cert 2012-12-12 08:53:51 -08:00
7e8438b7b4 fix pvs studio warnings 2012-12-11 11:33:49 -08:00
e925fbdbd6 check correct pointer before freeing when done looking up cert 2012-12-07 15:49:43 -08:00
87fbf7df80 fix libtool leftovers for distclen when shared mode 2012-12-06 17:52:36 -08:00
da8eba2603 fix distcheck pathing, cyassl-config distclean 2012-12-06 10:01:01 -08:00
5ecca5a89d user no longer has to call CyaSSL_Init 2012-12-06 09:26:59 -08:00
ca7e5d2463 valgrind config output 2012-12-05 10:50:04 -08:00
067f10ae8e add enable-valgrind 2012-12-04 21:28:18 -08:00
9005d2b54b removed XMALLOC_USER from the leanpsk compile flags 2012-11-30 16:43:03 -08:00
f71376a42b Merge branch 'master' of github.com:cyassl/cyassl 2012-11-30 15:48:56 -08:00
8c97675979 Lean PSK trimming
1. leave out memory and io callback functions, expect user supplied
2. leave out cert and DTLS related functions
3. SHA-1 compile option to use slower, rolled-up transform
2012-11-30 15:45:43 -08:00
f23013b8a7 remove runtime memory callback use for leanpsk 2012-11-30 15:41:01 -08:00
c50f73b4cb fix valgrind leanpsk read error 2012-11-29 17:18:41 -08:00
ea3dc2361d fix rpm license description 2012-11-29 14:58:22 -08:00
92c5167327 commit tests no longer need make clean after configure 2012-11-29 12:07:32 -08:00
584520fbc1 hide make clean output 2012-11-29 12:05:34 -08:00
8c1d342715 Merge branch 'master' of github.com:cyassl/cyassl 2012-11-29 11:51:10 -08:00
5e4c0c426c update test CRLs 2012-11-29 11:49:57 -08:00
0c9fe151de added configure option --disable-examples to remove example code build, configure runs make clean at the end, sniffer test isn't built if sniffer disabled 2012-11-29 11:31:57 -08:00
6e4d33eb00 move ProtocolVersion struct members directly into RecordLayerHeader 2012-11-28 16:34:41 -08:00
6280aa9c91 make sure converted errors are handled by string output 2012-11-28 11:54:25 -08:00
77bf77dfd7 Merge branch 'master' of github.com:cyassl/cyassl 2012-11-27 22:19:01 -08:00
66a3ce2ec1 added SHA-256 based RNG when setting NO_RC4 compile flag 2012-11-27 22:17:25 -08:00
4af555b502 unused no_session_cache fix 2012-11-27 15:39:40 -08:00
faa7283ff3 fix crl resource leaks 2012-11-27 11:36:36 -08:00
f5590f0abd crl unused fix 2012-11-27 11:13:28 -08:00
7d4a5a6ec8 added a missed break to a switch case 2012-11-26 21:49:31 -08:00
f8f7f69f48 compile option to leave out MD5 and SSL code 2012-11-26 18:40:43 -08:00
b828ac047a Merge branch 'master' of github.com:cyassl/cyassl 2012-11-26 16:32:20 -08:00
f046e1d0be Merge branch 'new-random' 2012-11-26 16:31:33 -08:00
8b8c6bfa0f optionally remove MD5 benchmark 2012-11-26 16:28:22 -08:00
e5266f6640 remove -floop-parallelize-all, causes x64 optimization problem with RSA verify 2012-11-26 15:39:38 -08:00
7459b5b892 removed the use psk identity hint from the test client code 2012-11-22 21:11:34 -08:00
699b794a4a Added tests for HMAC-SHA256 and HMAC-SHA384 2012-11-21 14:30:20 -08:00
b96f0c6386 added HMAC-SHA test cases, made the HMAC-MD5 test cases conditional on NO_MD5 flag 2012-11-21 14:02:47 -08:00
78c1d592cc Merge branch 'master' of github.com:cyassl/cyassl 2012-11-20 14:54:59 -08:00
a89398fdbc added the cipher suites PSK-NULL-SHA256 and PSK-AES128-CBC-SHA256 2012-11-20 14:52:17 -08:00
da386691a1 allow no end of line on last line of PEMs 2012-11-20 12:45:24 -08:00
d4035e5f62 add freebsd crl-monitor support 2012-11-16 13:25:45 -08:00
dd259b12c7 add CyaSSL_peek() 2012-11-16 12:16:00 -08:00
5d912d4c2b shadow crl-monitor linux fix 2012-11-16 10:54:36 -08:00
9ac2eaa3d6 fix ipv6 unused warning, add os check for crl monitor 2012-11-16 10:47:13 -08:00
4a7e56442a bump dev version 2012-11-14 17:57:27 -08:00
3130f0da28 allow ecc.c to read settings 2012-11-14 17:55:20 -08:00
5767db4cb5 minor warnings fixes 2012-11-13 18:32:13 -08:00
54a7740cfe substitue posix.h for errno.h in MQX build 2012-11-12 14:25:59 -07:00
53c14bdf1f fix XMALLOC_USER typos 2012-11-07 17:10:34 -08:00
d6c4b37112 Merge branch 'nopb' 2012-11-06 14:33:56 -08:00
d4c99ae663 added the rabbit and null cipher test configs to the dist build 2012-11-06 14:30:52 -08:00
557c2ae469 add CodeWarrior MQX example projects 2012-11-05 15:55:08 -07:00
21768d9626 test cert tmp fix 2012-11-05 14:15:38 -08:00
4a007a2fa0 make MAX_CHAIN_DEPTH a build time define and default to 9 2012-11-05 10:40:06 -08:00
b8c9247769 for lean-psk build: remove big int math, MD4, error strings 2012-11-02 16:49:31 -07:00
11c8e5afb8 add support for Kinetis K70 HW RNGA 2012-11-02 17:49:30 -06:00
917bc83c60 Merge branch 'master' of github.com:cyassl/cyassl 2012-11-01 16:52:26 -07:00
e2ac17deb6 added ctaocrypt error.c to Windows projects 2012-11-01 16:49:12 -07:00
a8c0351fe4 added pragma to new errors.c to hush a warning in Windows build 2012-11-01 16:40:59 -07:00
b21bf90e1b update CTaoCrypt test for MQX example 2012-11-01 17:08:07 -06:00
5e48dcbeeb fixed build warning with Fortress build 2012-11-01 15:59:13 -07:00
9aa8b71525 Merge branch 'nocerts' 2012-11-01 15:47:02 -07:00
90e6a4dd8c linux build warnings fix 2012-11-01 15:27:05 -07:00
134c6b8b1b cleaning warnings in OCSP build 2012-11-01 15:03:29 -07:00
ae905d70c4 crl warning fixes 2012-11-01 14:14:40 -07:00
85e8f1988a leanpsk build removes cert code, moved ctaocrypt error strings to own file 2012-11-01 12:36:47 -07:00
0e2c236e77 fix x64 windows warnings, make sure word is 64bit 2012-11-01 12:21:47 -07:00
dc83cc6a0e fix VS2008 asn.c warning, CTaoCrypt RSA test 2012-11-01 11:29:11 -06:00
f6304ae37a add support for Freescale MQX 2012-11-01 11:23:42 -06:00
a4220120ba remove memset for setcokopt uninit 2012-10-31 15:43:08 -07:00
d732a2ef07 make suite test file name input arg longer 2012-10-31 15:25:39 -07:00
6348f3f2c7 fix valgrind uninit warning on dtls setsockopt 2012-10-31 13:26:03 -07:00
905cf9c018 fix valgrind warnings from yesterday changes 2012-10-31 12:54:56 -07:00
01138a5c53 fix stack-check warnings for newer versions but fastmath still has some so take away warning for now 2012-10-30 17:35:12 -07:00
f175bd302d bump dev version 2012-10-30 16:23:59 -07:00
a6b201c051 added the PSK Null cipher test script to the release build 2012-10-30 15:09:31 -07:00
9871b13480 build test covers leanpsk 2012-10-30 12:51:14 -07:00
174618ebfb added build option for leanPSK 2012-10-29 15:39:42 -07:00
cf1f1f3ae7 turn jobserver back on 2012-10-26 15:38:37 -07:00
335de43333 Merge https://github.com/BrianAker/cyassl 2012-10-26 15:29:36 -07:00
ce297f67af Add in missing files for JOBSERVER. 2012-10-26 15:10:42 -07:00
35b4f08049 add CyaSSL_send()/recv() with flags parameter 2012-10-26 15:09:58 -07:00
91f075a5cf Add in m4/ax_print_to_file.m4 2012-10-26 15:20:44 -04:00
a1e8cd532d disable jobserver for now, is broken on some systems 2012-10-26 10:36:20 -07:00
994fc1f8e3 This add the generic structure required to have pkgconfig work.
I also fixed autogen.sh to do some magic on warnings/errors based on whether code comes from github or not.
2012-10-26 02:06:06 -04:00
767b452d61 This dramatically speeds up the time taken to compile cyassl (assuming you have multiple cores...). 2012-10-26 00:35:52 -04:00
60f28f322e Fixes install issue with rpm (I didn't notice that I got the install wrong until I tried to use it...). 2012-10-25 23:53:21 -04:00
d4d5243f4d add user ability to set IO read/write flags 2012-10-25 14:17:11 -07:00
01ae0696af shorten64 fixes for key-gen/cert-gen 2012-10-25 12:31:11 -07:00
0bbbea20be switch sniffer buffers to dynamic, reduce holding memory if large number of sessions cached 2012-10-24 17:37:57 -07:00
3e7619c785 make sure sniffer frees handhsake resources early 2012-10-24 14:51:04 -07:00
f969bc3645 if sniffer sees ACK for missing packet(s) set to error, can't recover 2012-10-24 13:33:11 -07:00
bb5280d0e4 remove mktime check since takes forever on some systems 2012-10-24 12:09:53 -07:00
0b4ed2c633 change to C_EXTRA_FLAGS for user addtions to CFLAGS since CFLAGS may contain -g -O2 even if user doesn't override, no way to tell 2012-10-24 12:01:11 -07:00
6737f5beb9 Brian changes 2012-10-24 11:53:33 -07:00
ba2a7f2627 Merge branch 'master' of github.com:cyassl/cyassl 2012-10-24 11:27:05 -07:00
936d0ff7a9 fixed off-by-one dtls cookie size check. fixed some warnings when disabling features 2012-10-24 11:05:50 -07:00
2885d66b17 remove fatal sniffer error sessions right away 2012-10-23 16:32:47 -07:00
1cb2f28308 align rabbit test keys and ivs 2012-10-23 13:48:16 -07:00
57c6d46ea7 add more features output to end of configure 2012-10-22 17:39:50 -07:00
4d719897a5 Merge branch 'master' of github.com:cyassl/cyassl 2012-10-22 17:29:19 -07:00
aef97af361 make rabbit optional with configure option 2012-10-22 17:28:46 -07:00
5a421c04e7 Merge branch 'master' of github.com:cyassl/cyassl 2012-10-22 14:50:02 -07:00
d78770c1e5 change null cipher to allow different buffers 2012-10-22 14:48:27 -07:00
3461c12083 Brian's c++/clang fixes, minor adjustments 2012-10-22 11:37:46 -07:00
cb08eb672e Merge branch 'master' of https://github.com/BrianAker/cyassl 2012-10-22 10:56:53 -07:00
10306013bb Merge branch 'master' of github.com:cyassl/cyassl 2012-10-22 10:37:58 -07:00
b09d902ef4 add in ecc impl 2012-10-22 10:37:40 -07:00
ac998a0f7c Remove version (it is a generated file), also updated how visibility is done. 2012-10-20 21:24:28 -04:00
db8bd91488 Fix for some platforms that didn't want to insert the harden LIB in some cases. 2012-10-20 20:07:30 -04:00
1be873533e This adds support for "make rpm" 2012-10-20 04:42:34 -04:00
a92b639155 add optional null cipher support for RSA 2012-10-19 20:52:22 -07:00
f3b14343a5 Add support for correctly compiling on darwin12 2012-10-19 20:21:35 -07:00
b883cc55a4 Fix rules around pthread usage to fix clang warning. 2012-10-19 20:09:17 -07:00
1bc0dc53f9 Fixes for hardening flags.
Additional fixes for using C++ compiler to compile.

Include file pcap.h now gates sniffer for build.
2012-10-19 22:00:17 -04:00
a5d7a3ea8f fix opensslExtra with psk server example, add psk to commit tests 2012-10-19 12:54:15 -07:00
c974d77213 add shorten 64 to 32 warnings back on with fixes 2012-10-19 12:44:23 -07:00
ba4d058ba7 commit Brian Aker configure stuff plus remove old debug.m4 and switch -g to only debug and turn off -O2 without since we use -Os and -O3 instead 2012-10-19 11:44:16 -07:00
218ae522c6 Merge https://github.com/BrianAker/cyassl 2012-10-19 11:17:42 -07:00
114436e587 Merge branch 'master' of github.com:cyassl/cyassl 2012-10-19 10:40:59 -07:00
346a52a58c add optional null cipher support for PSK 2012-10-19 10:37:21 -07:00
a89ec1ac91 show server read/write block message in server example 2012-10-19 10:14:26 -07:00
afe043ee6c This should fix the issue around compiling cyassl with a C++ compiler. 2012-10-19 00:30:21 -04:00
32dd1ab006 fix example/client non-blocking usage flag to big N 2012-10-17 14:06:50 -07:00
e3f54f332e Merge branch 'master' of github.com:cyassl/cyassl 2012-10-17 13:38:58 -07:00
cc0c89b02d psk test warning fixes 2012-10-17 13:38:49 -07:00
454bfa4abd Merge branch 'master' of github.com:cyassl/cyassl 2012-10-17 13:14:34 -07:00
fe632a3f77 added non-blocking and session resume as example server and client command line options 2012-10-17 13:13:58 -07:00
ef47f1a25e fix with libz dynamic type 2012-10-17 10:09:28 -07:00
c11620f9b4 Merge branch 'master' of github.com:cyassl/cyassl 2012-10-17 10:05:05 -07:00
dc708f4f5b turn on webserver build for some settings 2012-10-17 10:04:44 -07:00
d99c5d8e06 fixed aes-ctr test case 2012-10-10 14:07:10 -07:00
8760e6ac3e fixed build warnings & aes-gcm/ni conflict 2012-10-10 12:15:13 -07:00
a503f13321 update readme and version number 2012-10-10 08:55:53 -07:00
6c0d473027 Merge branch 'master' of github.com:cyassl/cyassl 2012-10-09 16:20:53 -07:00
e673b1852a fixed windows build warnings 2012-10-09 16:13:05 -07:00
6abadd2f2a fix ecc warnings 2012-10-09 14:04:27 -07:00
b76c42da7b fix bump test warnings 2012-10-09 11:33:09 -07:00
400b1f1ae6 test client and server use select in non-blocking mode 2012-10-08 15:49:30 -07:00
4a739f6bc7 sniffer handshake state fix for sanity checks 2012-10-05 13:39:11 -07:00
57e7e28d6d Merge branch 'master' of github.com:cyassl/cyassl 2012-10-03 17:10:05 -07:00
9ca07d1f4d dtls may have different first handshake message 2012-10-03 17:09:45 -07:00
0d80343073 Merge branch 'master' of github.com:cyassl/cyassl 2012-10-03 16:53:55 -07:00
257d10a69f sanity check for out of order handshake messages 2012-10-03 16:44:08 -07:00
66c95b0c15 DoAppData sanity check for handshake complete 2012-10-03 16:36:00 -07:00
397fbb743f Merge branch 'master' of github.com:cyassl/cyassl 2012-10-03 15:33:23 -07:00
95a30e3f0a windows bug fix on dtls retry 2012-10-03 15:29:28 -07:00
e970cdfbc0 init cipher specs, check client key exchange state b4 process 2012-10-03 11:57:20 -07:00
f7c740df8f Merge branch 'master' of github.com:cyassl/cyassl 2012-10-03 09:36:43 -07:00
5f598e2649 SIGPIPE ignore if no SO_NOSIGPIPE 2012-10-02 22:02:50 -07:00
9bbca6acfb Merge branch 'master' of github.com:cyassl/cyassl 2012-10-02 14:42:06 -07:00
829126f04d fix the client resume test case for DTLS 2012-10-02 14:41:28 -07:00
6d1e485ef4 DTLS to use recvfrom and sendto in embed recv and send callbacks. Added support for storing dtls peer address. 2012-10-02 09:15:50 -07:00
36eeab927b fix sniffer assert comparison on newer gcc 2012-10-01 13:16:37 -07:00
e0413df92a add key setup flag for malicious or misbehaving handshake messages with new memory system 2012-10-01 11:32:05 -07:00
e5c04e70a7 make sure existing nonblocking users still work 2012-09-28 15:10:35 -07:00
2c25481e7d add AesSetKeyDirect for Ctr and Direct when also using aesni 2012-09-28 15:01:07 -07:00
dd421ebb7d cleaner sniffer mem fix 2012-09-28 11:04:20 -07:00
30bec6c193 fix sniffer out of memory potential problem 2012-09-28 10:58:33 -07:00
bd849ea9d7 Merge branch 'master' of github.com:cyassl/cyassl 2012-09-27 14:40:28 -07:00
c9617e86d6 fix bug with aesgcm and aesni conflict 2012-09-27 14:38:48 -07:00
0fc6c8a07d fix nonblocking setters 2012-09-27 13:38:45 -07:00
07c37ed50c Merge branch 'master' of github.com:cyassl/cyassl 2012-09-27 11:42:57 -07:00
d5d24df32a nonblocking warning fixes 2012-09-27 10:31:38 -07:00
f044fbc1fe Merge branch 'master' of github.com:cyassl/cyassl 2012-09-26 13:02:20 -07:00
51a8901f6a update sslSniffer/Test windows projects 2012-09-26 12:21:16 -07:00
dfb84dff37 added accessors for CYASSL members for use in send/recv callbacks 2012-09-25 15:51:56 -07:00
d0affb0d0e fix snifftest and aesni with new warnings 2012-09-25 11:14:21 -07:00
2c0e7fd8e9 Merge branch 'master' of github.com:cyassl/cyassl 2012-09-24 12:43:49 -07:00
d3b01f9c56 remove automatic O2 opts for non debug, could be Os or O3, remove simple debug m4 2012-09-24 12:43:32 -07:00
cd0226924a Merge branch 'master' of github.com:cyassl/cyassl 2012-09-21 16:37:34 -07:00
9643e58dad fixed bug for Windows build 2012-09-21 16:36:48 -07:00
4e19c234f4 fix new warnings on linux64 2012-09-21 13:29:04 -07:00
ce2c76fd42 Merge branch 'master' of github.com:cyassl/cyassl 2012-09-21 09:36:34 -07:00
c3aedc940f improved dtls retry on connect 2012-09-21 09:36:01 -07:00
4433fde099 c++ warning fix 2012-09-20 15:42:18 -07:00
7716da0881 warn fix 2012-09-20 15:39:15 -07:00
bd0f508a0f don't turn on warnings as erros before old-style because tests use main() 2012-09-20 12:22:19 -07:00
19e50cd46a fix old-style warnings 2012-09-20 12:11:42 -07:00
3ef8f65229 remove sasl and put black vcs_checkout if on same line for older autoconf 2012-09-20 11:13:27 -07:00
5fce4edb68 This adds more compiler hardening flags (and fixes all of the issues
found in the process).
2012-09-19 23:38:41 -07:00
1cfd4e01cb Merge branch 'master' of github.com:cyassl/cyassl 2012-09-19 10:24:58 -07:00
afb559fddb allow huge Cert Names, just don't copy into name buffer past max 2012-09-19 10:24:34 -07:00
08a3423f43 changed error return code for dtls functions to NOT_COMPILED_IN 2012-09-19 09:09:27 -07:00
059db7f69c check the return code of DtlsPoolSave() 2012-09-18 16:00:30 -07:00
d1068d25d1 fixed another compile warning 2012-09-18 12:05:16 -07:00
68cb6044cb Merge branch 'master' of github.com:cyassl/cyassl 2012-09-18 11:41:25 -07:00
989d7f4aad fixed windows build warning 2012-09-18 11:11:45 -07:00
206f565820 add password to snifftest command line 2012-09-18 09:34:45 -07:00
f6c5bf032d update sniffer more memory changes 2012-09-18 09:08:40 -07:00
d1baa9f541 Merge branch 'master' of github.com:cyassl/cyassl 2012-09-18 08:46:11 -07:00
53ccbddd01 allow meta PEM data at end of file too 2012-09-17 17:25:38 -07:00
88bba146ae fixed bug with handshake defragmentation and ordering 2012-09-17 11:32:36 -07:00
40eb5b3cc5 DTLS resend allocates only enough buffer when needed 2012-09-17 09:52:20 -07:00
e9c7cbf803 fixing merge 2012-09-14 21:35:39 -07:00
40972868ce fix merge conflicts 2012-09-14 21:19:06 -07:00
7899252104 dtls handshake improvement 2012-09-14 19:30:50 -07:00
b160f8c486 make peerRsaKey dynamic, free at end of handshake 2012-09-14 16:52:39 -07:00
cfd5a20e48 make static buffers length 1 (zero may not be supported) unless LARGE_STATIC, SNIFFER, or DTLS 2012-09-14 16:14:38 -07:00
66bbb44f44 make arrays temporary, freed at end of handshake unless user calls KeepArrays for get_keys or psk hints 2012-09-14 15:22:51 -07:00
56ee2eaba8 added dtls message retry 2012-09-14 09:35:34 -07:00
97ca8439a4 Merge branch 'master' of github.com:cyassl/cyassl 2012-09-07 08:30:03 -07:00
407397e8be adding DTLS retry timeout, added CYASSL pointer to recv/send callbacks 2012-09-06 22:41:55 -07:00
8c32a5a2ed make RNG in ssl dynamic, release after hs if stream or < tls1.1 2012-09-05 16:18:29 -07:00
9ddf43268d use dynamic memory for ssl ciphers, only use what needed 2012-09-05 12:30:51 -07:00
c47afaf84f make suites object dynamic, only use during handshake 2012-09-05 10:17:48 -07:00
56960ef1cc cyassl object size debug output 2012-09-05 09:02:51 -07:00
43a0a21fb6 add GetOjbectSize for CYASSL* 2012-09-05 08:26:08 -07:00
982526ed13 go straight to p_hash in TLS 1.2 to remove PRF stack use 2012-09-04 16:34:26 -07:00
0ee22d8f94 don't use SSL Master Secret stack space in TLS mode 2012-09-04 16:03:45 -07:00
6943229f87 reduce client key exchange stack use in non NTRU mode 2012-09-04 15:56:52 -07:00
b1e603ae6b opensslextra clang static fixes 2012-09-04 15:47:40 -07:00
1ba8aff525 don't allow corrupted change cipher (fix by antoxa), don't allow multiple decryptions of corrupted messages 2012-09-04 11:37:47 -07:00
2bee126062 clang scan-build fixes 2012-09-04 10:48:26 -07:00
f8b106601b fix sniffer cipher suite tests with user override 2012-08-31 13:28:07 -07:00
3361f7b7fe Merge branch 'master' of github.com:cyassl/cyassl 2012-08-30 14:27:56 -07:00
69afab58a5 don't include stdio.h unless debug output 2012-08-28 16:46:27 -07:00
6ce42706fe Merge branch 'master' of github.com:cyassl/cyassl 2012-08-28 15:58:38 -07:00
bdac618c3a track version.h for pure windows build 2012-08-28 12:48:19 -07:00
820d934ae8 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-28 09:37:02 -07:00
c9625789cd allow early DTLS datagrams, but drop late ones. 2012-08-28 08:55:31 -07:00
30a264eb65 make sure mp_init return always checked 2012-08-27 11:30:22 -07:00
0534d44c9e don't assume non-Intel CodeWarrior BigEndian anymore 2012-08-23 17:05:58 -07:00
98bc1f8c46 fix build warning 2012-08-23 16:28:24 -07:00
457e214777 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-23 16:05:09 -07:00
561a7fc35d drop out of order dtls packets 2012-08-23 15:50:56 -07:00
2db5d29893 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-23 09:49:48 -07:00
f8ffb086ec tcp errno for SafeRTOS/lwip 2012-08-23 09:45:23 -07:00
f6cca6049f Merge branch 'master' of github.com:cyassl/cyassl 2012-08-22 16:16:49 -07:00
79c14dc825 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-22 15:36:07 -07:00
31d036178e fix DTLS cookies and session resumption 2012-08-22 14:06:08 -07:00
87762e9012 SafeRTOS client test fixes 2012-08-22 11:07:40 -07:00
501c6a67e7 client to use non-blocking sockets in resume test if enabled 2012-08-20 17:02:25 -07:00
7a12fb3e6b IAR inlining and enum warning off 2012-08-20 16:58:11 -07:00
e2ae36f149 add multi job support to first precommit make test 2012-08-20 16:40:41 -07:00
f1ed3cefc4 SafeRTOS memory macros 2012-08-20 16:38:43 -07:00
c20eb88d3d Merge branch 'master' of github.com:cyassl/cyassl 2012-08-17 14:21:17 -07:00
690938ffd4 lsr fs macros 2012-08-17 13:45:31 -07:00
03356be00b fix verify_callback local declaration after beginning 2012-08-17 12:51:37 -07:00
4b8fdb4371 fix examples client DTLS resume 2012-08-17 12:43:36 -07:00
925ddb6626 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-15 17:00:34 -07:00
05692e1d6a IAR fixes, SafeRTOS port, better LWIP support 2012-08-15 17:00:11 -07:00
c42792e0f1 fix compiler warnings 2012-08-14 13:51:56 -07:00
198e48fa94 minor RTIP adjustments 2012-08-14 13:10:27 -06:00
9d912970c8 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-13 17:33:20 -07:00
7ec04c16b6 EBSnet RTIP support 2012-08-13 17:10:05 -06:00
c08debf236 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-13 16:04:41 -07:00
bfd510b919 cleaned up the cookie generator for Windows and IPv4 only 2012-08-13 15:05:28 -07:00
4c66c4c3b5 use XBADFILE for init in bad state 2012-08-13 10:59:34 -07:00
a39f540c5a increment dev version 2012-08-13 10:57:07 -07:00
220bd66a63 allow XFILE to work with non pointer types 2012-08-13 10:53:47 -07:00
1c2a3eddc1 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-10 14:15:31 -07:00
d5fdb74d9a fix small build proper 2012-08-10 12:40:22 -07:00
8b968d234a Merge branch 'master' of github.com:cyassl/cyassl 2012-08-10 11:44:25 -07:00
15fe7f4d94 update CRLs switch to 120 days, add gen script 2012-08-10 11:02:46 -07:00
3d90c359cd Merge branch 'master' of github.com:cyassl/cyassl 2012-08-10 10:26:24 -07:00
70552ef8e1 added DTLS handshake message defragmentation 2012-08-10 10:24:31 -07:00
8343317e1b make domain name cert check an option on client 2012-08-10 10:15:37 -07:00
ecd007b287 2.3.0 release 2012-08-10 09:38:56 -07:00
8d2dc095dd Merge branch 'master' of github.com:cyassl/cyassl 2012-08-09 17:48:39 -07:00
aafe14ebc4 add pre-commit hook and tests, put into autogen 2012-08-09 16:42:18 -07:00
11df1d25d4 fixed the dtls handshake header handling 2012-08-09 13:27:30 -07:00
93c89ccc35 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-09 11:02:27 -07:00
6722022201 splitting off dtls handshake header to be handled differently 2012-08-09 11:02:21 -07:00
80326fa1fa pub EmbedGenerateCookie around dtls for now 2012-08-08 17:21:03 -07:00
73349ec0d3 add DTLS basic cipher suite tests 2012-08-08 17:09:09 -07:00
18c3679444 fix DLTS cookieSz init problem 2012-08-08 16:56:19 -07:00
16ac91e6de add aesgcm ecc cipher suite tests 2012-08-08 15:57:18 -07:00
17a92e76d3 add aesgcm openssl, and fix requires to use our local enum for aesgcm 2012-08-08 15:37:00 -07:00
6defed64cd add basic aescgm cipher suite tests 2012-08-08 15:22:41 -07:00
08ff33894f add ECDH static cipher suite tests including RSA signed ECDH, clean up code with haveECDSA -> haveECDSAsig 2012-08-08 15:09:26 -07:00
bbde70c6fc Merge branch 'master' of github.com:cyassl/cyassl 2012-08-08 11:52:31 -07:00
dac47627b8 added the clang output files to gitignore 2012-08-08 11:51:13 -07:00
e601b37a32 fix --enable-debug warning 2012-08-08 11:47:44 -07:00
d494254864 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-08 11:36:08 -07:00
eedc2f3e47 fix SESSION_CERTS and SHOW_CERTS example with CyaSSL API 2012-08-08 11:35:39 -07:00
3747246133 added the generation, verification, and client usage of DTLS handshake cookies 2012-08-08 10:38:12 -07:00
169331cf81 add ecc dhe cipher suite tests, static next 2012-08-07 18:09:03 -07:00
c4674c0cc3 add ntru cipher suite tests 2012-08-07 17:18:56 -07:00
a7aaf4fcaf add psk cipher suite tests 2012-08-07 17:01:59 -07:00
8bfd6c0e7e add hc128 cipher suite tests 2012-08-07 16:53:50 -07:00
d66722af15 all opensslExtra only SSLv3-TLSv1.2 cipher suites tests 2012-08-07 15:36:06 -07:00
435c1ae76c add all basic build SSLv3 - TLSv1.2 cipher suite test 2012-08-07 15:27:46 -07:00
efb6932d8e add client test harness parsing, may use different certs/keys/CAs etc 2012-08-07 15:06:53 -07:00
820edc0299 fix make dist unit test path 2012-08-06 19:08:16 -07:00
706bd8a910 add cipher suite client/server driver 2012-08-06 17:14:31 -07:00
cf4ea232e3 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-06 09:53:02 -07:00
ba0d887369 fix non-blocking example client compile 2012-08-06 09:52:43 -07:00
b83e1765da adding scriptable suite test to the unit test 2012-08-03 23:19:24 -07:00
644726a3fc fix clang warnings on test.h 2012-08-02 17:37:08 -07:00
802d62513f fix debug build 2012-08-02 13:41:40 -07:00
901730e86e make sure client GET reads as much as possible 2012-08-02 12:15:42 -07:00
bdf11587c2 Merge branch 'master' of github.com:cyassl/cyassl 2012-08-02 11:55:07 -07:00
90446c3c5f add -u for DTLS UPD command line client/server examples 2012-08-02 11:54:49 -07:00
afa27f0021 FreeRTOS threads support, windows simulator support 2012-08-02 09:54:41 -06:00
90385bb4b3 fix windows build with command line examples 2012-08-01 17:33:49 -07:00
aecdb33e4e Merge branch 'master' of github.com:cyassl/cyassl 2012-08-01 12:55:32 -07:00
68e5124644 change example client to command line options too, same as server 2012-08-01 12:55:13 -07:00
b8b5e7b873 Merge branch 'master' of github.com:cyassl/cyassl 2012-07-31 18:42:44 -07:00
a5af2e3d51 add altname retrieval from peer cert 2012-07-31 17:45:48 -07:00
ab570a2130 aes-gcm wrap two new aes-gcm code bits with ifdef option 2012-07-31 16:26:17 -07:00
368afbb815 Merge branch 'master' of github.com:cyassl/cyassl 2012-07-31 10:11:21 -07:00
e716380bad fixed a bug where aes-gcm required opensslExtra at build configure 2012-07-31 10:07:33 -07:00
9b8c5fb40e aes-gcm: modified to use sequence number rather that a random explicit IV 2012-07-31 09:32:29 -07:00
45dde2da89 better error checking on server example 2012-07-30 18:15:08 -07:00
3401bba8a2 Merge branch 'master' of github.com:cyassl/cyassl 2012-07-30 11:59:11 -07:00
f904c598ed make server example more generic with short command opts 2012-07-30 11:58:57 -07:00
e0328ef78a allow zero legnth asn names, remove weird subjectcn len as zero means we own, use stored flag instead 2012-07-27 16:51:46 -07:00
85889f7fb9 add md2 signature hash support 2012-07-27 14:01:02 -07:00
e2eb1b78cc Merge branch 'master' of github.com:cyassl/cyassl 2012-07-27 12:32:42 -07:00
6e84ab1271 add max chain depth unique error, increase depth to 6 2012-07-27 12:32:22 -07:00
3cd231bdfc Merge branch 'master' of github.com:cyassl/cyassl 2012-07-24 15:04:16 -07:00
cf7e8baa19 moved aes-gcm cipher suites around in the list to follow the existing suites 2012-07-23 15:15:40 -07:00
aa164e5266 make compression more standard, no size prefix, default zlib comp, check verify before overwrite w/ decomp... still needs FIN and ALERT processing 2012-07-23 13:47:30 -07:00
6d3c7d8c59 allow bigger MTU record for sniffer 2012-07-20 13:04:03 -07:00
489fbf17fe Merge branch 'master' of github.com:cyassl/cyassl 2012-07-19 17:22:16 -07:00
07ca2bce56 added endinanness protection to AES-GCM 2012-07-19 17:19:39 -07:00
cb178856a8 added 64-bit (default), 32-bit version, and 8-bit table based AES-GCM for faster operation. Selection made at configure. 2012-07-19 14:44:08 -07:00
6f2b1b90a9 move check_priv for libdrizzle 2012-07-17 15:55:20 -07:00
d408f01863 add mystrnstr for buffer searching of PEM with no null terminator 2012-07-17 12:01:37 -07:00
d607ffaf02 fix MAX_MSG_EXTRA for SHA-256 digest with IV with dynamic buffers 2012-07-17 11:52:13 -07:00
ac79d3b145 replaced magic numbers with named constants, renamed some constants 2012-07-17 10:00:45 -07:00
c9a4e9d56b fix DHE client side leak 2012-07-13 16:54:31 -07:00
4ffb3bbaae make sure ssl init does all inits before erroring out 2012-07-13 12:31:15 -07:00
87a8cfadd3 Used consistent constants. 2012-07-12 15:20:56 -07:00
aaad893804 fixed merge conflict 2012-07-12 08:39:57 -07:00
1f0a32a7e3 use internal enum for cipher requires, move external enums back to starting at zero 2012-07-11 17:00:16 -07:00
bdacd5e8c4 cleaned up lots-o-warnings build 2012-07-09 10:33:05 -07:00
1ac6db9d1d added basic hello extension support for TLSv1.2, renumbered the algorithm enumerations to match RFC 2012-07-09 10:02:34 -07:00
56d2180cf3 use CyaSSLv23_client_method() rather than TLSv1_1_client_method() to parallel echoserver.c 2012-07-09 09:50:26 -07:00
fe64523480 backed out an earlier change pending more research 2012-07-02 12:36:28 -07:00
1f6c24f15a added aes-gcm to the benchmark tests 2012-06-30 16:55:29 -07:00
eb302b91b0 Merge branch 'master' of github.com:cyassl/cyassl 2012-06-30 16:29:10 -07:00
be4ce974d0 Updated to use TLSv1.2. Changed the string scanning to play better with other echo servers. 2012-06-30 15:51:18 -07:00
b1e39f66a3 fixed a cipher suite name typo, changed the selection of the ECDH-RSA ciphers in InitSuites() 2012-06-30 15:50:25 -07:00
638c095737 better error output for temp keys or compression on sniffer 2012-06-29 10:59:48 -07:00
5dc0303dee cipher suite setup oversight fixes 2012-06-28 23:09:13 -07:00
2ce28d0328 clean up from lots-o-warnings build 2012-06-28 15:13:41 -07:00
22cb11f304 add hello_request and session_ticket handling to sniffer 2012-06-28 13:37:19 -07:00
9295917ef2 Separated out the AES-GCM test as its own test case. 2012-06-28 11:28:41 -07:00
6cdd8f46fa needed a bigger handshake hash array for SHA-384 cipher suites 2012-06-28 09:06:24 -07:00
00cda6ab72 tied SHA-384 into TLSv1.2 as appropriate 2012-06-27 14:41:16 -07:00
c2cf1fb708 added HMAC-SHA-384 2012-06-27 10:34:43 -07:00
4e3d7f494b AES-GCM: fixed the encryption/decryption bug 2012-06-26 15:51:40 -07:00
3a9a195683 Initial draft of AES GCM cipher suites. Missing SHA-384 support. 2012-06-26 09:30:48 -07:00
737cd127e8 Changed AesGcmEncrypt and Decrypt to allow the same pointer to write and read buffers. 2012-06-26 09:29:48 -07:00
918ea3a074 added the library framework for handling aes-gcm in TLS 2012-06-18 15:57:37 -07:00
4e73ad8547 AES-GCM requires SHA-384, configure adds it automatically 2012-06-18 14:31:46 -07:00
eecdfe1648 added test case for AES-GCM 2012-06-15 16:05:47 -07:00
e39e27bb5b implemented AES-GCM Decrypt 2012-06-15 15:12:56 -07:00
bac34015cc implemented AES-GCM Encrypt 2012-06-15 14:38:11 -07:00
76bb3b2558 added stubs for AES-GCM processing and build option 2012-06-13 21:31:32 -07:00
31bf833239 have separate --enable-crl-monitor 2012-06-05 11:31:00 -07:00
59e4c346f0 Merge branch 'master' of github.com:cyassl/cyassl 2012-06-05 10:38:46 -07:00
c08486e5e2 bump library version number 2012-06-05 10:38:39 -07:00
8f30850840 CRL fix label in debug output 2012-06-05 10:35:30 -07:00
cb3d998301 asn checks 2012-06-01 15:55:41 -07:00
3d91a55b88 tls sanity check 2012-06-01 15:37:51 -07:00
ba2d7f590e internal sanity checks on memcmp 2012-06-01 15:25:46 -07:00
217053a780 integer comba array sanity check 2012-06-01 14:49:07 -07:00
32fc5daf43 64 decoding sanity checks 2012-06-01 14:37:59 -07:00
8a52cd3780 byte warning casts 2012-06-01 14:37:39 -07:00
7edd1bd843 don't use -Warray-bounds except on linux with lots-o-warnings 2012-06-01 12:14:30 -07:00
87b3df8621 Merge branch 'master' of github.com:cyassl/cyassl 2012-06-01 11:57:09 -07:00
6120f03173 ocsp response date checking 2012-06-01 11:57:03 -07:00
6dd7eff1a8 add 64 bit misc prototypes for NO_INLINE 2012-06-01 11:07:29 -07:00
ca7bf0d01e Merge branch 'master' of github.com:cyassl/cyassl 2012-05-31 17:29:41 -07:00
6d76b2f247 dynamic allocation of OCSP responses, response signature check 2012-05-31 17:29:32 -07:00
fbc5c8d6dc add SSL set version, different from ctx version 2012-05-31 15:24:25 -07:00
a1157da304 move HAVE_OCSP to top of source for different build envs 2012-05-30 14:40:25 -07:00
458302f9fe warning cast 2012-05-30 10:03:05 -07:00
f528f5a7d3 add CertManager Verify with Buffer 2012-05-29 12:04:48 -07:00
4b8bb6cdfe fixed merge conflicts 2012-05-29 09:19:53 -07:00
9818fe4f55 changed DN hashing to cover the whole DER encoding per OCSP-RFC, OCSP changes towards dynamic storage of responses 2012-05-29 09:11:37 -07:00
c2292c31b0 fixed ASN.1 decoding bug in the basic ca constraint certificate extension 2012-05-25 16:32:10 -07:00
28fb9fb0f7 new dev version 2012-05-25 14:43:36 -07:00
02079a2f79 c++ cast fix 2012-05-25 13:38:44 -07:00
82a56daaaf ecc crls 2012-05-25 13:26:28 -07:00
a1bb4e3f93 gcc-lots-o-warnings fixes 2012-05-25 13:09:27 -07:00
6a62623c64 verify suite validity before server picks 2012-05-25 12:18:18 -07:00
7332b4843c remove hard tabs, bad sublime setting 2012-05-24 20:10:38 -07:00
3f35c86520 crl signature check, be sure to load CAs first 2012-05-24 15:49:38 -07:00
0a31dc3a37 renumbered new error codes and dynamic data types 2012-05-24 14:36:40 -07:00
e8e575fd58 public OCSP functions are available, just return errors when OCSP not compiled in 2012-05-24 14:12:28 -07:00
baddc07300 check next crl date status 2012-05-24 14:07:59 -07:00
f2110487b6 added dynamic types for OCSP data 2012-05-24 14:07:11 -07:00
73ddd32539 add crl checkall processing 2012-05-24 12:45:10 -07:00
db7773aa54 linux crl dir monitoring fixes 2012-05-23 16:55:26 -07:00
0aea2607b5 don't install example certs and keys 2012-05-23 10:28:02 -07:00
2b48f248c4 crl dir monitoring for linux and mac 2012-05-22 17:25:15 -07:00
97042d8661 OCSP use URL from cert as appropriate 2012-05-22 15:54:27 -07:00
708f38ac8d added OCSP error codes 2012-05-22 15:52:08 -07:00
09e24d5469 OCSP set option bug fix 2012-05-22 15:38:12 -07:00
e48f5a31d6 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-21 14:21:34 -07:00
4c79ac1f88 windows build fix 2012-05-21 15:13:11 -06:00
2ed143bee0 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-20 14:53:07 -07:00
2b6044c6ee add dump file option to snifftest, along with keyfile, optional server and port arguments 2012-05-20 12:46:50 -07:00
ba6d956d02 fix sniffer resumption for new sessionId flag in 2.2.0 2012-05-19 14:37:26 -07:00
387d9400b9 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-18 17:06:09 -07:00
5b5b7e231d fix crl dist and dev build 2012-05-18 16:35:19 -07:00
86408406fd add metatdata to crls 2012-05-18 16:29:57 -07:00
3d67caa353 normal crl doesn't revoke test certs, crl.revoked revokes test server 2012-05-18 16:24:23 -07:00
ecef0e38d5 fix configure sha-512 message 2012-05-18 16:18:53 -07:00
ddb5c3a2aa crl potential memory leak fix 2012-05-18 16:01:21 -07:00
8bf2d13f89 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-18 15:33:54 -07:00
88b46d58d7 small warning fix 2012-05-18 12:10:04 -07:00
c3627df018 README fix 2012-05-18 11:50:08 -07:00
314630d0e3 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-18 11:48:57 -07:00
7e322558ef windows build fixes 2012-05-18 11:48:38 -07:00
6f90cdd465 update README for 2.2.0 release 2012-05-18 12:43:56 -06:00
2806c995a8 pre release 2.2.0 2012-05-18 11:06:32 -07:00
fd70122378 add external der CRL checker 2012-05-18 11:03:44 -07:00
26153ffad6 add crl monitor flag, handle no revoked case 2012-05-18 10:52:32 -07:00
a3e94f335b fixed merge conflict 2012-05-18 10:25:16 -07:00
4b3a362705 adding OcspRequest data, check OCSP nonce extension, made ConfirmSignature generic, bug fixes 2012-05-18 10:18:56 -07:00
a697a60bfd fixed a bounds check error 2012-05-18 10:06:06 -07:00
5bc728b882 fix lots o warnings 2012-05-17 17:44:54 -07:00
7c91372621 skip crl revoked entry extensions 2012-05-17 15:16:53 -07:00
839b5a4478 add set dates from buffer 2012-05-17 14:41:45 -07:00
4b8ab62bd1 don't retrieve or cache null sessions 2012-05-17 10:55:42 -07:00
e5953ce6f6 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-17 10:05:37 -07:00
146e7ff1f4 c++ build fixes 2012-05-17 10:05:24 -07:00
b9773673f7 minor typo fix in PSK build 2012-05-17 10:20:51 -06:00
ac92d30955 fix else braces 2012-05-17 07:55:25 -07:00
08d9e57bf6 add crl missing url callback 2012-05-16 17:35:51 -07:00
c4ea674fc8 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-16 17:05:03 -07:00
3ec2b9dbbc crl stage 2 2012-05-16 17:04:56 -07:00
43592def99 Certificate extension parsing addition 2012-05-14 15:38:59 -07:00
32095795f2 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-11 12:22:23 -07:00
6210ff78aa init crl 2012-05-11 12:22:16 -07:00
7b2d62f4f7 don't compare session id if server rejects 2012-05-11 12:21:17 -07:00
89b0c932a5 bump version number to v2.1.5 2012-05-10 13:55:34 -07:00
b26f577454 ocsp build fix 2012-05-09 20:45:56 -07:00
07990acaa6 fixed off-by-one bug when encoding serial number as ASN.1 2012-05-09 16:40:36 -07:00
59e0181c8d checked the bytes written to the OCSP socket 2012-05-08 19:12:35 -07:00
ea2585963f flattens the serial number 2012-05-08 19:02:25 -07:00
4feeeeda55 OCSP request creation almost complete, added ocsp revoke error code 2012-05-08 18:32:57 -07:00
81a6ed4577 added the hash of the issuer's public key to the decoded cert 2012-05-08 15:12:33 -07:00
4d9fe4dafe Merge branch 'master' of github.com:cyassl/cyassl 2012-05-08 14:05:35 -07:00
833552ebac OCSP tweak to clean warnings from build 2012-05-08 14:05:26 -07:00
306a2013a9 ecc client cert dist 2012-05-08 11:38:31 -07:00
b8411f1217 fixed compile flag for SHA-384 when enabling Fortress 2012-05-08 09:35:18 -07:00
344b60eb92 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-07 20:16:21 -07:00
d7d898697a updated OCSP, processes response 2012-05-07 17:19:52 -07:00
5aad32eb28 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-07 17:02:47 -07:00
7d1d277535 OCSP: opening socket, starting to build request 2012-05-05 23:38:28 -07:00
f9985f5399 merge fix 2012-05-05 14:49:17 -07:00
7ee09ea23c Merge branch 'master' of github.com:cyassl/cyassl 2012-05-02 21:59:54 -07:00
669fbf2a14 Merge branch 'master' of github.com:cyassl/cyassl 2012-05-02 14:45:37 -07:00
9c5bcca1ab updates to OCSP 2012-05-02 14:45:30 -07:00
ec5b3fe313 Merge branch 'master' of github.com:cyassl/cyassl 2012-04-27 15:46:27 -07:00
f987da38d8 Merge branch 'master' of github.com:cyassl/cyassl 2012-04-27 10:08:09 -07:00
27f9cf01af Changed the OCSP fcn protos to be LOCAL, not API 2012-04-26 14:16:34 -07:00
cbde04a06b added OCSP Response simple parsing 2012-04-26 13:52:48 -07:00
311 changed files with 72924 additions and 5047 deletions

21
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.swp
*.lo
*.la
*.o
@ -11,9 +12,13 @@ config*
*Release/
*.ncb
*.suo
build-aux/
rpm/spec
stamp-h
cyassl/options.h
libtool.m4
aclocal.m4
aminclude.am
lt*.m4
INSTALL
Makefile.in
@ -23,6 +28,7 @@ missing
libtool
tags
.tags*
cyassl-config
cyassl.sublime*
ctaocrypt/benchmark/benchmark
ctaocrypt/test/testctaocrypt
@ -32,6 +38,7 @@ examples/echoserver/echoserver
examples/server/server
snifftest
output
mcapi/test
testsuite/testsuite
tests/unit
testsuite/*.der
@ -61,11 +68,21 @@ cyassl*rc*
autoscan.log
TAGS
.DS_Store
support/libcyassl.pc
cyassl/version.h
support/cyassl.pc
cyassl/ctaocrypt/stamp-h1
swig/_cyassl.so
swig/cyassl.py
swig/cyassl.pyc
swig/cyassl_wrap.c
stamp-h1
clang_output_*
internal.plist
cov-int
cyassl.tgz
*.log
*.trs
IDE\MDK-ARM\Projects/
IDE\MDK-ARM\STM32F2xx_StdPeriph_Lib/inc
IDE\MDK-ARM\STM32F2xx_StdPeriph_Lib/src
IDE\MDK-ARM\LPC43xx\Drivers/
IDE\MDK-ARM\LPC43xx\LPC43xx/

View File

@ -0,0 +1,338 @@
;/***********************************************************************
; * $Id: startup_LPC43xx.s 6473 2011-02-16 17:40:54Z nxp27266 $
; *
; * Project: LPC43xx CMSIS Package
; *
; * Description: Cortex-M3 Core Device Startup File for the NXP LPC43xx
; * Device Series.
; *
; * Copyright(C) 2011, NXP Semiconductor
; * All rights reserved.
; *
; * modified by KEIL
; ***********************************************************************
; * Software that is described herein is for illustrative purposes only
; * which provides customers with programming information regarding the
; * products. This software is supplied "AS IS" without any warranties.
; * NXP Semiconductors assumes no responsibility or liability for the
; * use of the software, conveys no license or title under any patent,
; * copyright, or mask work right to the product. NXP Semiconductors
; * reserves the right to make changes in the software without
; * notification. NXP Semiconductors also make no representation or
; * warranty that such application will be suitable for the specified
; * use without further testing or modification.
; **********************************************************************/
; <h> Stack Configuration
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Stack_Size EQU 0x00003000
AREA STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem SPACE Stack_Size
__initial_sp
; <h> Heap Configuration
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Heap_Size EQU 0x0000a000
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem SPACE Heap_Size
__heap_limit
PRESERVE8
THUMB
; Vector Table Mapped to Address 0 at Reset
AREA RESET, DATA, READONLY
EXPORT __Vectors
Sign_Value EQU 0x5A5A5A5A
__Vectors DCD __initial_sp ; 0 Top of Stack
DCD Reset_Handler ; 1 Reset Handler
DCD NMI_Handler ; 2 NMI Handler
DCD HardFault_Handler ; 3 Hard Fault Handler
DCD MemManage_Handler ; 4 MPU Fault Handler
DCD BusFault_Handler ; 5 Bus Fault Handler
DCD UsageFault_Handler ; 6 Usage Fault Handler
DCD Sign_Value ; 7 Reserved
DCD 0 ; 8 Reserved
DCD 0 ; 9 Reserved
DCD 0 ; 10 Reserved
DCD SVC_Handler ; 11 SVCall Handler
DCD DebugMon_Handler ; 12 Debug Monitor Handler
DCD 0 ; 13 Reserved
DCD PendSV_Handler ; 14 PendSV Handler
DCD SysTick_Handler ; 15 SysTick Handler
; External Interrupts
DCD DAC_IRQHandler ; 16 D/A Converter
DCD M0CORE_IRQHandler ; 17 M0 Core
DCD DMA_IRQHandler ; 18 General Purpose DMA
DCD EZH_IRQHandler ; 19 EZH/EDM
DCD FLASH_EEPROM_IRQHandler ; 20 Reserved for Typhoon
DCD ETH_IRQHandler ; 21 Ethernet
DCD SDIO_IRQHandler ; 22 SD/MMC
DCD LCD_IRQHandler ; 23 LCD
DCD USB0_IRQHandler ; 24 USB0
DCD USB1_IRQHandler ; 25 USB1
DCD SCT_IRQHandler ; 26 State Configurable Timer
DCD RIT_IRQHandler ; 27 Repetitive Interrupt Timer
DCD TIMER0_IRQHandler ; 28 Timer0
DCD TIMER1_IRQHandler ; 29 Timer1
DCD TIMER2_IRQHandler ; 30 Timer2
DCD TIMER3_IRQHandler ; 31 Timer3
DCD MCPWM_IRQHandler ; 32 Motor Control PWM
DCD ADC0_IRQHandler ; 33 A/D Converter 0
DCD I2C0_IRQHandler ; 34 I2C0
DCD I2C1_IRQHandler ; 35 I2C1
DCD SPI_IRQHandler ; 36 SPI
DCD ADC1_IRQHandler ; 37 A/D Converter 1
DCD SSP0_IRQHandler ; 38 SSP0
DCD SSP1_IRQHandler ; 39 SSP1
DCD UART0_IRQHandler ; 40 UART0
DCD UART1_IRQHandler ; 41 UART1
DCD UART2_IRQHandler ; 42 UART2
DCD UART3_IRQHandler ; 43 UART3
DCD I2S0_IRQHandler ; 44 I2S0
DCD I2S1_IRQHandler ; 45 I2S1
DCD SPIFI_IRQHandler ; 46 SPI Flash Interface
DCD SGPIO_IRQHandler ; 47 SGPIO
DCD GPIO0_IRQHandler ; 48 GPIO0
DCD GPIO1_IRQHandler ; 49 GPIO1
DCD GPIO2_IRQHandler ; 50 GPIO2
DCD GPIO3_IRQHandler ; 51 GPIO3
DCD GPIO4_IRQHandler ; 52 GPIO4
DCD GPIO5_IRQHandler ; 53 GPIO5
DCD GPIO6_IRQHandler ; 54 GPIO6
DCD GPIO7_IRQHandler ; 55 GPIO7
DCD GINT0_IRQHandler ; 56 GINT0
DCD GINT1_IRQHandler ; 57 GINT1
DCD EVRT_IRQHandler ; 58 Event Router
DCD CAN1_IRQHandler ; 59 C_CAN1
DCD 0 ; 60 Reserved
DCD VADC_IRQHandler ; 61 VADC
DCD ATIMER_IRQHandler ; 62 ATIMER
DCD RTC_IRQHandler ; 63 RTC
DCD 0 ; 64 Reserved
DCD WDT_IRQHandler ; 65 WDT
DCD M0s_IRQHandler ; 66 M0s
DCD CAN0_IRQHandler ; 67 C_CAN0
DCD QEI_IRQHandler ; 68 QEI
;CRP address at offset 0x2FC relative to the BOOT Bank address
IF :LNOT::DEF:NO_CRP
SPACE (0x2FC - (. - __Vectors))
; EXPORT CRP_Key
CRP_Key DCD 0xFFFFFFFF
; 0xFFFFFFFF => CRP Disabled
; 0x12345678 => CRP Level 1
; 0x87654321 => CRP Level 2
; 0x43218765 => CRP Level 3 (ARE YOU SURE?)
; 0x4E697370 => NO ISP (ARE YOU SURE?)
ENDIF
AREA |.text|, CODE, READONLY
; Reset Handler
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
; Dummy Exception Handlers (infinite loops which can be modified)
NMI_Handler PROC
EXPORT NMI_Handler [WEAK]
B .
ENDP
HardFault_Handler\
PROC
EXPORT HardFault_Handler [WEAK]
B .
ENDP
MemManage_Handler\
PROC
EXPORT MemManage_Handler [WEAK]
B .
ENDP
BusFault_Handler\
PROC
EXPORT BusFault_Handler [WEAK]
B .
ENDP
UsageFault_Handler\
PROC
EXPORT UsageFault_Handler [WEAK]
B .
ENDP
SVC_Handler PROC
EXPORT SVC_Handler [WEAK]
B .
ENDP
DebugMon_Handler\
PROC
EXPORT DebugMon_Handler [WEAK]
B .
ENDP
PendSV_Handler PROC
EXPORT PendSV_Handler [WEAK]
B .
ENDP
SysTick_Handler PROC
EXPORT SysTick_Handler [WEAK]
B .
ENDP
Default_Handler PROC
EXPORT DAC_IRQHandler [WEAK]
EXPORT M0CORE_IRQHandler [WEAK]
EXPORT DMA_IRQHandler [WEAK]
EXPORT EZH_IRQHandler [WEAK]
EXPORT FLASH_EEPROM_IRQHandler [WEAK]
EXPORT ETH_IRQHandler [WEAK]
EXPORT SDIO_IRQHandler [WEAK]
EXPORT LCD_IRQHandler [WEAK]
EXPORT USB0_IRQHandler [WEAK]
EXPORT USB1_IRQHandler [WEAK]
EXPORT SCT_IRQHandler [WEAK]
EXPORT RIT_IRQHandler [WEAK]
EXPORT TIMER0_IRQHandler [WEAK]
EXPORT TIMER1_IRQHandler [WEAK]
EXPORT TIMER2_IRQHandler [WEAK]
EXPORT TIMER3_IRQHandler [WEAK]
EXPORT MCPWM_IRQHandler [WEAK]
EXPORT ADC0_IRQHandler [WEAK]
EXPORT I2C0_IRQHandler [WEAK]
EXPORT I2C1_IRQHandler [WEAK]
EXPORT SPI_IRQHandler [WEAK]
EXPORT ADC1_IRQHandler [WEAK]
EXPORT SSP0_IRQHandler [WEAK]
EXPORT SSP1_IRQHandler [WEAK]
EXPORT UART0_IRQHandler [WEAK]
EXPORT UART1_IRQHandler [WEAK]
EXPORT UART2_IRQHandler [WEAK]
EXPORT UART3_IRQHandler [WEAK]
EXPORT I2S0_IRQHandler [WEAK]
EXPORT I2S1_IRQHandler [WEAK]
EXPORT SPIFI_IRQHandler [WEAK]
EXPORT SGPIO_IRQHandler [WEAK]
EXPORT GPIO0_IRQHandler [WEAK]
EXPORT GPIO1_IRQHandler [WEAK]
EXPORT GPIO2_IRQHandler [WEAK]
EXPORT GPIO3_IRQHandler [WEAK]
EXPORT GPIO4_IRQHandler [WEAK]
EXPORT GPIO5_IRQHandler [WEAK]
EXPORT GPIO6_IRQHandler [WEAK]
EXPORT GPIO7_IRQHandler [WEAK]
EXPORT GINT0_IRQHandler [WEAK]
EXPORT GINT1_IRQHandler [WEAK]
EXPORT EVRT_IRQHandler [WEAK]
EXPORT CAN1_IRQHandler [WEAK]
EXPORT VADC_IRQHandler [WEAK]
EXPORT ATIMER_IRQHandler [WEAK]
EXPORT RTC_IRQHandler [WEAK]
EXPORT WDT_IRQHandler [WEAK]
EXPORT M0s_IRQHandler [WEAK]
EXPORT CAN0_IRQHandler [WEAK]
EXPORT QEI_IRQHandler [WEAK]
DAC_IRQHandler
M0CORE_IRQHandler
DMA_IRQHandler
EZH_IRQHandler
FLASH_EEPROM_IRQHandler
ETH_IRQHandler
SDIO_IRQHandler
LCD_IRQHandler
USB0_IRQHandler
USB1_IRQHandler
SCT_IRQHandler
RIT_IRQHandler
TIMER0_IRQHandler
TIMER1_IRQHandler
TIMER2_IRQHandler
TIMER3_IRQHandler
MCPWM_IRQHandler
ADC0_IRQHandler
I2C0_IRQHandler
I2C1_IRQHandler
SPI_IRQHandler
ADC1_IRQHandler
SSP0_IRQHandler
SSP1_IRQHandler
UART0_IRQHandler
UART1_IRQHandler
UART2_IRQHandler
UART3_IRQHandler
I2S0_IRQHandler
I2S1_IRQHandler
SPIFI_IRQHandler
SGPIO_IRQHandler
GPIO0_IRQHandler
GPIO1_IRQHandler
GPIO2_IRQHandler
GPIO3_IRQHandler
GPIO4_IRQHandler
GPIO5_IRQHandler
GPIO6_IRQHandler
GPIO7_IRQHandler
GINT0_IRQHandler
GINT1_IRQHandler
EVRT_IRQHandler
CAN1_IRQHandler
VADC_IRQHandler
ATIMER_IRQHandler
RTC_IRQHandler
WDT_IRQHandler
M0s_IRQHandler
CAN0_IRQHandler
QEI_IRQHandler
B .
ENDP
ALIGN
; User Initial Stack & Heap
IF :DEF:__MICROLIB
EXPORT __initial_sp
EXPORT __heap_base
EXPORT __heap_limit
ELSE
IMPORT __use_two_region_memory
EXPORT __user_initial_stackheap
__user_initial_stackheap
LDR R0, = Heap_Mem
LDR R1, =(Stack_Mem + Stack_Size)
LDR R2, = (Heap_Mem + Heap_Size)
LDR R3, = Stack_Mem
BX LR
ALIGN
ENDIF
END

View File

@ -0,0 +1,170 @@
/* time.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/*-----------------------------------------------------------------------------
* initialize RTC
*----------------------------------------------------------------------------*/
#include <stdio.h>
#include "lpc43xx_rtc.h"
#include "lpc43xx_cgu.h"
static void init_RTC()
{
/* Enable GPIO register interface clock */
LPC_CCU1->CLK_M4_GPIO_CFG |= 1;
while (!(LPC_CCU1->CLK_M4_GPIO_STAT & 1)) ;
/* RTC Block section ------------------------------------------------------ */
/* Init RTC module */
RTC_Init(LPC_RTC);
/* Set ALARM time for second */
RTC_SetAlarmTime (LPC_RTC, RTC_TIMETYPE_SECOND, 30);
/* Set the AMR for 30s match alarm interrupt */
RTC_AlarmIntConfig (LPC_RTC, RTC_TIMETYPE_SECOND, ENABLE);
/* Set the CIIR for minute counter interrupt*/
RTC_CntIncrIntConfig (LPC_RTC, RTC_TIMETYPE_MINUTE, ENABLE);
/* Enable rtc (starts increase the tick counter and second counter register) */
RTC_Cmd(LPC_RTC, ENABLE);
}
/*-----------------------------------------------------------------------------
* initialize TIM
*----------------------------------------------------------------------------*/
#include "lpc43xx_timer.h"
//#include "lpc43xx_cgu.h"
//#include "lpc43xx_scu.h"
//#include "lpc43xx_libcfg.h"
//#include "debug_frmwrk.h"
static void init_TIM()
{
TIM_TIMERCFG_Type TIM_ConfigStruct;
/* Initialize timer 0, prescale count time of 1uS */
TIM_ConfigStruct.PrescaleOption = TIM_PRESCALE_TICKVAL;
TIM_ConfigStruct.PrescaleValue = 204; /* 204MHz */
/* Set configuration for Tim_config and Tim_MatchConfig */
TIM_Init(LPC_TIMER2, TIM_TIMER_MODE,&TIM_ConfigStruct);
TIM_ResetCounter(LPC_TIMER2);
/* To start timer 2 */
TIM_Cmd(LPC_TIMER2,ENABLE);
}
double current_time()
{
return (double)LPC_TIMER2->TC/1000000.0;
}
void init_time(void) {
init_RTC() ;
init_TIM() ;
}
#include <time.h>
struct tm *Cyassl_MDK_gmtime(const time_t *c)
{
static struct tm date ;
RTC_TIME_Type RTCFullTime;
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
date.tm_year = RTCFullTime.YEAR + 100 ;
date.tm_mon = RTCFullTime.MONTH - 1 ;
date.tm_mday = RTCFullTime.DOM ;
date.tm_hour = RTCFullTime.HOUR ;
date.tm_min = RTCFullTime.MIN ;
date.tm_sec = RTCFullTime.SEC ;
#if defined(DEBUG_CYASSL)
{
extern void CYASSL_MSG(char *msg) ;
char msg[100] ;
sprintf(msg, "Debug::Cyassl_KEIL_gmtime(DATE=/%4d/%02d/%02d TIME=%02d:%02d:%02d)\n",
RTCFullTime.YEAR+2000, RTCFullTime.MONTH, RTCFullTime.DOM,
RTCFullTime.HOUR, RTCFullTime.MIN, RTCFullTime.SEC) ;
CYASSL_MSG(msg) ;
}
#endif
return(&date) ;
}
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
#include <stdio.h>
void time_main(void *args)
{
char * datetime ;
int year ;
RTC_TIME_Type RTCFullTime;
if( args == NULL || ((func_args *)args)->argc == 1) {
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
printf("Date: %d/%d/%d, Time: %02d:%02d:%02d\n",
RTCFullTime.MONTH, RTCFullTime.DOM, RTCFullTime.YEAR+2000,
RTCFullTime.HOUR, RTCFullTime.MIN, RTCFullTime.SEC) ;
} else if(((func_args *)args)->argc == 3 &&
((func_args *)args)->argv[1][0] == '-' &&
((func_args *)args)->argv[1][1] == 'd' ) {
datetime = ((func_args *)args)->argv[2];
sscanf(datetime, "%d/%d/%d",
(int *)&RTCFullTime.MONTH, (int *)&RTCFullTime.DOM, &year) ;
RTCFullTime.YEAR = year - 2000 ;
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_MONTH, RTCFullTime.MONTH);
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_YEAR, RTCFullTime.YEAR);
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_DAYOFMONTH, RTCFullTime.DOM);
} else if(((func_args *)args)->argc == 3 &&
((func_args *)args)->argv[1][0] == '-' &&
((func_args *)args)->argv[1][1] == 't' ) {
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
datetime = ((func_args *)args)->argv[2];
sscanf(datetime, "%d:%d:%d",
(int *)&RTCFullTime.HOUR,
(int *)&RTCFullTime.MIN,
(int *)&RTCFullTime.SEC
) ;
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_SECOND, RTCFullTime.SEC);
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_MINUTE, RTCFullTime.MIN);
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_HOUR, RTCFullTime.HOUR);
} else printf("Invalid argument\n") ;
}

View File

@ -0,0 +1,269 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rt_sys.h>
#include <File_Config.h>
#pragma import(__use_no_semihosting_swi)
/* The following macro definitions may be used to translate this file:
STDIO - use standard Input/Output device
(default is NOT used)
*/
/* Standard IO device handles. */
#define STDIN 0x8001
#define STDOUT 0x8002
#define STDERR 0x8003
/* Standard IO device name defines. */
const char __stdin_name[] = "STDIN";
const char __stdout_name[] = "STDOUT";
const char __stderr_name[] = "STDERR";
struct __FILE { int handle; /* Add whatever you need here */ };
#ifdef STDIO
extern int SER_GetChar (void);
extern int SER_PutChar (int ch);
/*-----------------------------------------------------------------------------
Write character to the Serial Port
*----------------------------------------------------------------------------*/
int sendchar (int c)
{
if (c == '\n') {
SER_PutChar ('\r');
}
SER_PutChar (c);
return (c);
}
/*-----------------------------------------------------------------------------
Read character from the Serial Port
*----------------------------------------------------------------------------*/
int getkey (void)
{
int ch = SER_GetChar();
if (ch < 0) {
return 0;
}
return ch;
}
#endif
/*--------------------------- _ttywrch ---------------------------------------*/
void _ttywrch (int ch)
{
#ifdef STDIO
sendchar (ch);
#endif
}
/*--------------------------- _sys_open --------------------------------------*/
#ifndef NO_FILESYSTEM
static int KEIL_FS_open(const char *name, int openmode)
{
int i ; int ret ;
#define PATHSIZE 100
char path[PATHSIZE] ; char *p ;
if(strlen(name) > PATHSIZE)return(-1) ;
for(i = 0; i<= strlen(name); i++) {
if(name[i] == '/')path[i] = '\\' ;
else path[i] = name[i] ;
}
if(path[0] == '.' && path[1] == '\\') p = path + 2 ;
else p = path ;
ret = __sys_open (p, openmode) ;
return(ret) ;
}
#endif
FILEHANDLE _sys_open (const char *name, int openmode)
{
/* Register standard Input Output devices. */
if (strcmp(name, "STDIN") == 0) {
return (STDIN);
}
if (strcmp(name, "STDOUT") == 0) {
return (STDOUT);
}
if (strcmp(name, "STDERR") == 0) {
return (STDERR);
}
#ifndef NO_FILESYSTEM
return (KEIL_FS_open(name, openmode));
#else
return(0) ;
#endif
}
/*--------------------------- _sys_close -------------------------------------*/
int _sys_close (FILEHANDLE fh)
{
if (fh > 0x8000) {
return (0);
}
#ifndef NO_FILESYSTEM
return (__sys_close (fh));
#else
return(0) ;
#endif
}
/*--------------------------- _sys_write -------------------------------------*/
int _sys_write (FILEHANDLE fh, const U8 *buf, U32 len, int mode)
{
#ifdef STDIO
if (fh == STDOUT) {
/* Standard Output device. */
for ( ; len; len--) {
sendchar (*buf++);
}
return (0);
}
#endif
if (fh > 0x8000) {
return (-1);
}
#ifndef NO_FILESYSTEM
return (__sys_write (fh, buf, len));
#else
return(0) ;
#endif
}
/*--------------------------- _sys_read --------------------------------------*/
int _sys_read (FILEHANDLE fh, U8 *buf, U32 len, int mode)
{
#ifdef STDIO
if (fh == STDIN) {
/* Standard Input device. */
int sz ;
while((buf[0] = getkey()) == 0) ;
;
for (sz = 0 ; sz <= len ; sz ++ ) {
if(buf[sz] == 0) break ;
else sz++ ;
buf[sz] = getkey ();
}
return (sz);
}
#endif
if (fh > 0x8000) {
return (-1);
}
#ifndef NO_FILESYSTEM
return (__sys_read (fh, buf, len));
#else
return(0) ;
#endif
}
/*--------------------------- _sys_istty -------------------------------------*/
int _sys_istty (FILEHANDLE fh)
{
if (fh > 0x8000) {
return (1);
}
return (0);
}
/*--------------------------- _sys_seek --------------------------------------*/
int _sys_seek (FILEHANDLE fh, long pos)
{
if (fh > 0x8000) {
return (-1);
}
#ifndef NO_FILESYSTEM
return (__sys_seek (fh, pos));
#else
return(0) ;
#endif
}
/*--------------------------- _sys_ensure ------------------------------------*/
int _sys_ensure (FILEHANDLE fh)
{
if (fh > 0x8000) {
return (-1);
}
#ifndef NO_FILESYSTEM
return (__sys_ensure (fh));
#else
return(0) ;
#endif
}
/*--------------------------- _sys_flen --------------------------------------*/
long _sys_flen (FILEHANDLE fh)
{
if (fh > 0x8000) {
return (0);
}
#ifndef NO_FILESYSTEM
return (__sys_flen (fh));
#else
return(0) ;
#endif
}
/*--------------------------- _sys_tmpnam ------------------------------------*/
int _sys_tmpnam (char *name, int sig, unsigned maxlen)
{
return (1);
}
/*--------------------------- _sys_command_string ----------------------------*/
char *_sys_command_string (char *cmd, int len)
{
return (cmd);
}
/*--------------------------- _sys_exit --------------------------------------*/
void _sys_exit (int return_code)
{
#ifdef CYASSL_MDK_SHELL
return ;
#else
/* Endless loop. */
while (1);
#endif
}
/*--------------------------- time -----------------------------------------*/
long time(long *t)
{
return ((long) 0) ; /** DUMMY TIME() **/
}
/*-----------------------------------------------------------------------------
* end of file
*----------------------------------------------------------------------------*/

View File

@ -0,0 +1,28 @@
/* certs_test.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* Define initial data for cert buffers */
#include <cyassl/certs_test.h>

View File

@ -0,0 +1,39 @@
#ifndef CYASSL_CERT_DATA_H
#define CYASSL_CERT_DATA_H
#ifdef USE_CERT_BUFFERS_1024
extern const unsigned char client_key_der_1024[] ;
extern int sizeof_client_key_der_1024 ;
/* ./certs/1024/client-cert.der, 1024-bit */
extern const unsigned char client_cert_der_1024[] ;
extern int sizeof_client_cert_der_1024 ;
/* ./certs/1024/dh1024.der, 1024-bit */
extern const unsigned char dh_key_der_1024[] ;
extern int sizeof_dh_key_der_1024 ;
/* ./certs/1024/dsa1024.der, 1024-bit */
extern const unsigned char dsa_key_der_1024[] ;
extern int sizeof_dsa_key_der_1024 ;
/* ./certs/1024/rsa1024.der, 1024-bit */
extern const unsigned char rsa_key_der_1024[] ;
extern int sizeof_rsa_key_der_1024 ;
#elif defined(USE_CERT_BUFFERS_2048)
/* ./certs/client-key.der, 2048-bit */
extern const unsigned char client_key_der_2048[] ;
extern int sizeof_client_key_der_2048 ;
/* ./certs/client-cert.der, 2048-bit */
extern const unsigned char client_cert_der_2048[] ;
extern int sizeof_client_cert_der_2048 ;
/* ./certs/dh2048.der, 2048-bit */
extern const unsigned char dh_key_der_2048[] ;
extern int sizeof_dh_key_der_2048 ;
/* ./certs/dsa2048.der, 2048-bit */
extern const unsigned char dsa_key_der_2048[] ;
extern int sizeof_dsa_key_der_2048;
/* ./certs/rsa2048.der, 2048-bit */
extern const unsigned char rsa_key_der_2048[] ;
extern int sizeof_rsa_key_der_2048 ;
#endif
#endif

View File

@ -0,0 +1,291 @@
/* config-BEREFOOT.h
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/**** CyaSSL for KEIL-RL Configuration ****/
#define __CORTEX_M3__
#define CYASSL_MDK_ARM
#define NO_WRITEV
#define NO_CYASSL_DIR
#define NO_MAIN_DRIVER
#define CYASSL_DER_LOAD
#define HAVE_NULL_CIPHER
#define SINGLE_THREADED
#define NO_FILESYSTEM
#define NO_TLS
#define NO_ECHOSERVER
#define NO_ECHOCLIENT
#define NO_SIMPLE_SERVER
#define NO_SIMPLE_CLIENT
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Build Target: KEIL-BAREFOOT
// <h> Single Threaded, No File System, No TCP-net
// </h>
// <e>Command Shell
#define MDK_CONF_SHELL 1
#if MDK_CONF_SHELL == 1
#define CYASSL_MDK_SHELL
#endif
// </e>
// <h>CyaSSL Apps
// <h>Crypt/Cipher
// <o>Cert Storage <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
#define MDK_CONF_CERT_BUFF 1
#if MDK_CONF_CERT_BUFF == 1
#define USE_CERT_BUFFERS_1024
#elif MDK_CONF_CERT_BUFF == 2
#define USE_CERT_BUFFERS_2048
#endif
// <e>Crypt/Cipher Test Suite
#define MDK_CONF_CTaoCryptTest 1
#if MDK_CONF_CTaoCryptTest == 0
#define NO_CRYPT_TEST
#endif
// </e>
// <e>Crypt/Cipher Benchmark
#define MDK_CONF_CTaoCryptBenchmark 1
#if MDK_CONF_CTaoCryptBenchmark == 0
#define NO_CRYPT_BENCHMARK
#define BENCH_EMBEDDED
#endif
// </e>
// </h>
// <h>STM32 Hardware Crypt
// <e>STM32F2 Hardware RNG
#define MDK_CONF_STM32F2_RNG 0
#if MDK_CONF_STM32F2_RNG == 1
#define STM32F2_RNG
#else
#define NO_DEV_RANDOM
#endif
// </e>
// <e>STM32F2 Hardware Crypt
#define MDK_CONF_STM32F2_CRYPTO 0
#if MDK_CONF_STM32F2_CRYPTO == 1
#define STM32F2_CRYPTO
#endif
// </e>
// </h>
// <h>CTaoCrypt Library
// <h>MD5, SHA, SHA-256, AES, RC4, ASN, RSA
// </h>
// <e>MD2
#define MDK_CONF_MD2 0
#if MDK_CONF_MD2 == 1
#define CYASSL_MD2
#endif
// </e>
// <e>MD4
#define MDK_CONF_MD4 1
#if MDK_CONF_MD4 == 0
#define NO_MD4
#endif
// </e>
// <e>SHA-384
// <i>This has to be with SHA512
#define MDK_CONF_SHA384 0
#if MDK_CONF_SHA384 == 1
#define CYASSL_SHA384
#endif
// </e>
// <e>SHA-512
#define MDK_CONF_SHA512 0
#if MDK_CONF_SHA512 == 1
#define CYASSL_SHA512
#endif
// </e>
// <e>RIPEMD
#define MDK_CONF_RIPEMD 0
#if MDK_CONF_RIPEMD == 1
#define CYASSL_RIPEMD
#endif
// </e>
// <e>HMAC
#define MDK_CONF_HMAC 1
#if MDK_CONF_HMAC == 0
#define NO_HMAC
#endif
// </e>
// <e>HC128
#define MDK_CONF_HC128 0
#if MDK_CONF_HC128 == 1
#define HAVE_HC128
#endif
// </e>
// <e>RABBIT
#define MDK_CONF_RABBIT 1
#if MDK_CONF_RABBI == 0
#define NO_RABBIT
#endif
// </e>
// <e>AEAD
#define MDK_CONF_AEAD 0
#if MDK_CONF_AEAD == 1
#define HAVE_AEAD
#endif
// </e>
// <e>DES3
#define MDK_CONF_DES3 1
#if MDK_CONF_DES3 == 0
#define NO_DES3
#endif
// </e>
// <e>CAMELLIA
#define MDK_CONF_CAMELLIA 0
#if MDK_CONF_CAMELLIA == 1
#define HAVE_CAMELLIA
#endif
// </e>
// <e>DH
// <i>need this for CYASSL_SERVER, OPENSSL_EXTRA
#define MDK_CONF_DH 1
#if MDK_CONF_DH == 0
#define NO_DH
#endif
// </e>
// <e>DSA
#define MDK_CONF_DSA 1
#if MDK_CONF_DSA == 0
#define NO_DSA
#endif
// </e>
// <e>PWDBASED
#define MDK_CONF_PWDBASED 1
#if MDK_CONF_PWDBASED == 0
#define NO_PWDBASED
#endif
// </e>
// <e>ECC
#define MDK_CONF_ECC 0
#if MDK_CONF_ECC == 1
#define HAVE_ECC
#endif
// </e>
// <e>PSK
#define MDK_CONF_PSK 1
#if MDK_CONF_PSK == 0
#define NO_PSK
#endif
// </e>
// <e>AESCCM (Turn off Hardware Crypt)
#define MDK_CONF_AESCCM 0
#if MDK_CONF_AESCCM == 1
#define HAVE_AESCCM
#endif
// </e>
// <e>AESGCM (Turn off Hardware Crypt)
#define MDK_CONF_AESGCM 0
#if MDK_CONF_AESGCM == 1
#define HAVE_AESGCM
#define BUILD_AESGCM
#endif
// </e>
// <e>NTRU (need License, "crypto_ntru.h")
#define MDK_CONF_NTRU 0
#if MDK_CONF_NTRU == 1
#define HAVE_NTRU
#endif
// </e>
// </h>
// <h>Others
// <e>Inline
#define MDK_CONF_INLINE 0
#if MDK_CONF_INLINE == 0
#define NO_INLINE
#endif
// </e>
// <h>Debug
// <e>Debug Message
#define MDK_CONF_DebugMessage 0
#if MDK_CONF_DebugMessage == 1
#define DEBUG_CYASSL
#endif
// </e>
// <e>Check malloc
#define MDK_CONF_CheckMalloc 1
#if MDK_CONF_CheckMalloc == 1
#define CYASSL_MALLOC_CHECK
#endif
// </e>
// </h>
// <e>ErrNo.h
#define MDK_CONF_ErrNo 0
#if MDK_CONF_ErrNo == 1
#define HAVE_ERRNO
#endif
// </e>
// <e>zlib (need "zlib.h")
#define MDK_CONF_LIBZ 0
#if MDK_CONF_LIBZ == 1
#define HAVE_LIBZ
#endif
// </e>
// <e>CAVIUM (need CAVIUM headers)
#define MDK_CONF_CAVIUM 0
#if MDK_CONF_CAVIUM == 1
#define HAVE_CAVIUM
#endif
// </e>
// <e>Error Strings
#define MDK_CONF_ErrorStrings 1
#if MDK_CONF_ErrorStrings == 0
#define NO_ERROR_STRINGS
#endif
// </e>
// <e>Small Stack
#define MDK_CONF_SmallStack 1
#if MDK_CONF_SmallStack == 0
#define NO_CYASSL_SMALL_STACK
#endif
// </e>
// <e>Use Fast Math
#define MDK_CONF_FASTMATH 0
#if MDK_CONF_FASTMATH == 1
#define USE_FAST_MATH
#endif
// </e>
// </h>
//</h>
// <<< end of configuration section >>>

View File

@ -0,0 +1,329 @@
/* config-FS.h
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/**** CyaSSL for KEIL-RL Configuration ****/
#define __CORTEX_M3__
#define CYASSL_KEIL_RL
#define NO_WRITEV
#define NO_CYASSL_DIR
#define NO_MAIN_DRIVER
#define CYASSL_DER_LOAD
#define HAVE_NULL_CIPHER
#define SINGLE_THREADED
#define NO_ECHOSERVER
#define NO_ECHOCLIENT
#define NO_SIMPLE_SERVER
#define NO_SIMPLE_CLIENT
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Build Target: KEIL-FS
// <h> Single Threaded, With File System, No TCP-net
// </h>
// <e>Command Shell
#define MDK_CONF_SHELL 1
#if MDK_CONF_SHELL == 1
#define CYASSL_MDK_SHELL
#endif
// </e>
// <h>CyaSSL Apps
// <h>Crypt/Cipher
// <o>Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
#define MDK_CONF_CERT_BUFF 0
#if MDK_CONF_CERT_BUFF== 1
#define USE_CERT_BUFFERS_1024
#elif MDK_CONF_CERT_BUFF == 2
#define USE_CERT_BUFFERS_2048
#endif
// <e>Crypt/Cipher Test Suite
#define MDK_CONF_CTaoCryptTest 1
#if MDK_CONF_CTaoCryptTest == 0
#define NO_CRYPT_TEST
#endif
// </e>
// <e>Crypt/Cipher Benchmark
#define MDK_CONF_CTaoCryptBenchmark 1
#if MDK_CONF_CTaoCryptBenchmark == 0
#define NO_CRYPT_BENCHMARK
#endif
// </e>
// </h>
// <h>STM32 Hardware Crypt
// <e>STM32F2 Hardware RNG
#define MDK_CONF_STM32F2_RNG 0
#if MDK_CONF_STM32F2_RNG == 1
#define STM32F2_RNG
#else
#define NO_DEV_RANDOM
#endif
// </e>
// <e>STM32F2 Hardware Crypt
#define MDK_CONF_STM32F2_CRYPTO 0
#if MDK_CONF_STM32F2_CRYPTO == 1
#define STM32F2_CRYPTO
#endif
// </e>
// </h>
// <h>CyaSSL Library
// <h>SSL (Included by default)
// </h>
// <e>TLS
#define MDK_CONF_TLS 1
#if MDK_CONF_TLS == 0
#define NO_TLS
#endif
// </e>
// <e>CertGen
#define MDK_CONF_CERT_GEN 0
#if MDK_CONF_CERT_GEN == 1
#define CYASSL_CERT_GEN
#endif
// </e>
// <e>KeyGen
#define MDK_CONF_KEY_GEN 0
#if MDK_CONF_KEY_GEN == 1
#define CYASSL_KEY_GEN
#endif
// </e>
// <e>CRL
#define MDK_CONF_DER_LOAD 0
#if MDK_CONF_DER_LOAD == 1
#define CYASSL_DER_LOAD
#endif
// </e>
// <e>OpenSSL Extra
#define MDK_CONF_OPENSSL_EXTRA 0
#if MDK_CONF_OPENSSL_EXTRA == 1
#define OPENSSL_EXTRA
#endif
// </e>
// <h>CRL Monitor, OCSP (not supported with KEIL)
// </h>
// </h>
// <h>CTaoCrypt Library
// <h>MD5, SHA, SHA-256, AES, RC4, ASN, RSA
// </h>
// <e>MD2
#define MDK_CONF_MD2 0
#if MDK_CONF_MD2 == 1
#define CYASSL_MD2
#endif
// </e>
// <e>MD4
#define MDK_CONF_MD4 1
#if MDK_CONF_MD4 == 0
#define NO_MD4
#endif
// </e>
// <e>SHA-384
// <i>This has to be with SHA512
#define MDK_CONF_SHA384 0
#if MDK_CONF_SHA384 == 1
#define CYASSL_SHA384
#endif
// </e>
// <e>SHA-512
#define MDK_CONF_SHA512 0
#if MDK_CONF_SHA512 == 1
#define CYASSL_SHA512
#endif
// </e>
// <e>RIPEMD
#define MDK_CONF_RIPEMD 0
#if MDK_CONF_RIPEMD == 1
#define CYASSL_RIPEMD
#endif
// </e>
// <e>HMAC
#define MDK_CONF_HMAC 1
#if MDK_CONF_HMAC == 0
#define NO_HMAC
#endif
// </e>
// <e>HC128
#define MDK_CONF_HC128 0
#if MDK_CONF_HC128 == 1
#define HAVE_HC128
#endif
// </e>
// <e>RABBIT
#define MDK_CONF_RABBIT 1
#if MDK_CONF_RABBI == 0
#define NO_RABBIT
#endif
// </e>
// <e>AEAD
#define MDK_CONF_AEAD 0
#if MDK_CONF_AEAD == 1
#define HAVE_AEAD
#endif
// </e>
// <e>DES3
#define MDK_CONF_DES3 1
#if MDK_CONF_DES3 == 0
#define NO_DES3
#endif
// </e>
// <e>CAMELLIA
#define MDK_CONF_CAMELLIA 0
#if MDK_CONF_CAMELLIA == 1
#define HAVE_CAMELLIA
#endif
// </e>
// <e>DH
// <i>need this for CYASSL_SERVER, OPENSSL_EXTRA
#define MDK_CONF_DH 1
#if MDK_CONF_DH == 0
#define NO_DH
#endif
// </e>
// <e>DSA
#define MDK_CONF_DSA 1
#if MDK_CONF_DSA == 0
#define NO_DSA
#endif
// </e>
// <e>PWDBASED
#define MDK_CONF_PWDBASED 1
#if MDK_CONF_PWDBASED == 0
#define NO_PWDBASED
#endif
// </e>
// <e>ECC
#define MDK_CONF_ECC 0
#if MDK_CONF_ECC == 1
#define HAVE_ECC
#endif
// </e>
// <e>PSK
#define MDK_CONF_PSK 1
#if MDK_CONF_PSK == 0
#define NO_PSK
#endif
// </e>
// <e>AESCCM (Turn off Hardware Crypt)
#define MDK_CONF_AESCCM 0
#if MDK_CONF_AESCCM == 1
#define HAVE_AESCCM
#endif
// </e>
// <e>AESGCM (Turn off Hardware Crypt)
#define MDK_CONF_AESGCM 0
#if MDK_CONF_AESGCM == 1
#define HAVE_AESGCM
#define BUILD_AESGCM
#endif
// </e>
// <e>NTRU (need License, "crypto_ntru.h")
#define MDK_CONF_NTRU 0
#if MDK_CONF_NTRU == 1
#define HAVE_NTRU
#endif
// </e>
// </h>
// <h>Others
// <e>Inline
#define MDK_CONF_INLINE 0
#if MDK_CONF_INLINE == 0
#define NO_INLINE
#endif
// </e>
// <h>Debug
// <e>Debug Message
#define MDK_CONF_DebugMessage 0
#if MDK_CONF_DebugMessage == 1
#define DEBUG_CYASSL
#endif
// </e>
// <e>Check malloc
#define MDK_CONF_CheckMalloc 1
#if MDK_CONF_CheckMalloc == 1
#define CYASSL_MALLOC_CHECK
#endif
// </e>
// </h>
// <e>ErrNo.h
#define MDK_CONF_ErrNo 0
#if MDK_CONF_ErrNo == 1
#define HAVE_ERRNO
#endif
// </e>
// <e>zlib (need "zlib.h")
#define MDK_CONF_LIBZ 0
#if MDK_CONF_LIBZ == 1
#define HAVE_LIBZ
#endif
// </e>
// <e>CAVIUM (need CAVIUM headers)
#define MDK_CONF_CAVIUM 0
#if MDK_CONF_CAVIUM == 1
#define HAVE_CAVIUM
#endif
// </e>
// <e>Error Strings
#define MDK_CONF_ErrorStrings 1
#if MDK_CONF_ErrorStrings == 0
#define NO_ERROR_STRINGS
#endif
// </e>
// <e>Small Stack
#define MDK_CONF_SmallStack 1
#if MDK_CONF_SmallStack == 0
#define NO_CYASSL_SMALL_STACK
#endif
// </e>
// <e>Use Fast Math
#define MDK_CONF_FASTMATH 0
#if MDK_CONF_FASTMATH == 1
#define USE_FAST_MATH
#endif
// </e>
// </h>
//</h>
// <<< end of configuration section >>>

View File

@ -0,0 +1,351 @@
/* config-RTX-TCP-FS.h
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/**** CyaSSL for KEIL-RL Configuration ****/
#define __CORTEX_M3__
#define CYASSL_MDK_ARM
#define NO_WRITEV
#define NO_CYASSL_DIR
#define NO_MAIN_DRIVER
#define CYASSL_DER_LOAD
#define HAVE_NULL_CIPHER
#define HAVE_KEIL_RTX
#define CYASSL_KEIL_TCP_NET
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Build Target: KEIL-RTX-TCP-FS
// <h> RTOS, File System and TCP-net
// </h>
// <e>Command Shell
#define MDK_CONF_SHELL 1
#if MDK_CONF_SHELL == 1
#define CYASSL_MDK_SHELL
#endif
// </e>
// <h>CyaSSL Apps
// <h>Crypt/Cipher
// <o>Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
#define MDK_CONF_CERT_BUFF 0
#if MDK_CONF_CERT_BUFF== 1
#define USE_CERT_BUFFERS_1024
#elif MDK_CONF_CERT_BUFF == 2
#define USE_CERT_BUFFERS_2048
#endif
// <e>Crypt/Cipher Test Suite
#define MDK_CONF_CTaoCryptTest 1
#if MDK_CONF_CTaoCryptTest == 0
#define NO_CRYPT_TEST
#endif
// </e>
// <e>Crypt/Cipher Benchmark
#define MDK_CONF_CTaoCryptBenchmark 1
#if MDK_CONF_CTaoCryptBenchmark == 0
#define NO_CRYPT_BENCHMARK
#define BENCH_EMBEDDED
#endif
// </e>
// </h>
// <h>SSL/TLS Server/Client
// <e>echoServer
#define MDK_CONF_echoServer 1
#if MDK_CONF_echoServer == 0
#define NO_ECHOSERVER
#endif
// </e>
// <e>echoClient
#define MDK_CONF_echoClient 1
#if MDK_CONF_echoClient == 0
#define NO_ECHOCLIENT
#endif
// </e>
// <e>SimpleServer
#define MDK_CONF_simpleServer 1
#if MDK_CONF_simpleServer == 0
#define NO_SIMPLE_SERVER
#endif
// </e>
// <e>SimpleCliet
#define MDK_CONF_simpleClient 1
#if MDK_CONF_simpleClient == 0
#define NO_SIMPLE_CLIENT
#endif
// </e>
// </h>
// </h>
// <h>STM32 Hardware Crypt
// <e>STM32F2 Hardware RNG
#define MDK_CONF_STM32F2_RNG 0
#if MDK_CONF_STM32F2_RNG == 1
#define STM32F2_RNG
#else
#define NO_DEV_RANDOM
#endif
// </e>
// <e>STM32F2 Hardware Crypt
#define MDK_CONF_STM32F2_CRYPTO 0
#if MDK_CONF_STM32F2_CRYPTO == 1
#define STM32F2_CRYPTO
#endif
// </e>
// </h>
// <h>CyaSSL Library
// <h>SSL (Included by default)
// </h>
// <e>TLS
#define MDK_CONF_TLS 1
#if MDK_CONF_TLS == 0
#define NO_TLS
#endif
// </e>
// <e>CertGen
#define MDK_CONF_CERT_GEN 0
#if MDK_CONF_CERT_GEN == 1
#define CYASSL_CERT_GEN
#endif
// </e>
// <e>KeyGen
#define MDK_CONF_KEY_GEN 0
#if MDK_CONF_KEY_GEN == 1
#define CYASSL_KEY_GEN
#endif
// </e>
// <e>CRL
#define MDK_CONF_DER_LOAD 0
#if MDK_CONF_DER_LOAD == 1
#define CYASSL_DER_LOAD
#endif
// </e>
// <e>OpenSSL Extra
#define MDK_CONF_OPENSSL_EXTRA 1
#if MDK_CONF_OPENSSL_EXTRA == 1
#define OPENSSL_EXTRA
#endif
// </e>
// <h>CRL Monitor, OCSP (not supported with KEIL)
// </h>
// </h>
// <h>CTaoCrypt Library
// <h>MD5, SHA, SHA-256, AES, RC4, ASN, RSA
// </h>
// <e>MD2
#define MDK_CONF_MD2 0
#if MDK_CONF_MD2 == 1
#define CYASSL_MD2
#endif
// </e>
// <e>MD4
#define MDK_CONF_MD4 1
#if MDK_CONF_MD4 == 0
#define NO_MD4
#endif
// </e>
// <e>SHA-384
// <i>This has to be with SHA512
#define MDK_CONF_SHA384 0
#if MDK_CONF_SHA384 == 1
#define CYASSL_SHA384
#endif
// </e>
// <e>SHA-512
#define MDK_CONF_SHA512 0
#if MDK_CONF_SHA512 == 1
#define CYASSL_SHA512
#endif
// </e>
// <e>RIPEMD
#define MDK_CONF_RIPEMD 1
#if MDK_CONF_RIPEMD == 1
#define CYASSL_RIPEMD
#endif
// </e>
// <e>HMAC
#define MDK_CONF_HMAC 1
#if MDK_CONF_HMAC == 0
#define NO_HMAC
#endif
// </e>
// <e>HC128
#define MDK_CONF_HC128 0
#if MDK_CONF_HC128 == 1
#define HAVE_HC128
#endif
// </e>
// <e>RABBIT
#define MDK_CONF_RABBIT 1
#if MDK_CONF_RABBI == 0
#define NO_RABBIT
#endif
// </e>
// <e>AEAD
#define MDK_CONF_AEAD 0
#if MDK_CONF_AEAD == 1
#define HAVE_AEAD
#endif
// </e>
// <e>DES3
#define MDK_CONF_DES3 1
#if MDK_CONF_DES3 == 0
#define NO_DES3
#endif
// </e>
// <e>CAMELLIA
#define MDK_CONF_CAMELLIA 0
#if MDK_CONF_CAMELLIA == 1
#define HAVE_CAMELLIA
#endif
// </e>
// <e>DH
// <i>need this for CYASSL_SERVER, OPENSSL_EXTRA
#define MDK_CONF_DH 1
#if MDK_CONF_DH == 0
#define NO_DH
#endif
// </e>
// <e>DSA
#define MDK_CONF_DSA 1
#if MDK_CONF_DSA == 0
#define NO_DSA
#endif
// </e>
// <e>PWDBASED
#define MDK_CONF_PWDBASED 1
#if MDK_CONF_PWDBASED == 0
#define NO_PWDBASED
#endif
// </e>
// <e>ECC
#define MDK_CONF_ECC 1
#if MDK_CONF_ECC == 1
#define HAVE_ECC
#endif
// </e>
// <e>PSK
#define MDK_CONF_PSK 1
#if MDK_CONF_PSK == 0
#define NO_PSK
#endif
// </e>
// <e>AESCCM (Turn off Hardware Crypt)
#define MDK_CONF_AESCCM 0
#if MDK_CONF_AESCCM == 1
#define HAVE_AESCCM
#endif
// </e>
// <e>AESGCM (Turn off Hardware Crypt)
#define MDK_CONF_AESGCM 0
#if MDK_CONF_AESGCM == 1
#define HAVE_AESGCM
#define BUILD_AESGCM
#endif
// </e>
// <e>NTRU (need License, "crypto_ntru.h")
#define MDK_CONF_NTRU 0
#if MDK_CONF_NTRU == 1
#define HAVE_NTRU
#endif
// </e>
// </h>
// <h>Others
// <e>Inline
#define MDK_CONF_INLINE 0
#if MDK_CONF_INLINE == 0
#define NO_INLINE
#endif
// </e>
// <h>Debug
// <e>Debug Message
#define MDK_CONF_DEBUG_MSG 0
#if MDK_CONF_DEBUG_MSG == 1
#define DEBUG_CYASSL
#endif
// </e>
// <e>Check malloc
#define MDK_CONF_CHECK_MALLOC 1
#if MDK_CONF_CHECK_MALLOC == 1
#define CYASSL_MALLOC_CHECK
#endif
// </e>
// </h>
// <e>ErrNo.h
#define MDK_CONF_ERR_NO 0
#if MDK_CONF_ERR_NO == 1
#define HAVE_ERRNO
#endif
// </e>
// <e>zlib (need "zlib.h")
#define MDK_CONF_LIBZ 0
#if MDK_CONF_LIBZ == 1
#define HAVE_LIBZ
#endif
// </e>
// <e>CAVIUM (need CAVIUM headers)
#define MDK_CONF_CAVIUM 0
#if MDK_CONF_CAVIUM == 1
#define HAVE_CAVIUM
#endif
// </e>
// <e>Error Strings
#define MDK_CONF_ErrorStrings 1
#if MDK_CONF_ErrorStrings == 0
#define NO_ERROR_STRINGS
#endif
// </e>
// <e>Small Stack
#define MDK_CONF_SMALL_STACK 1
#if MDK_CONF_SMALL_STACK == 0
#define NO_CYASSL_SMALL_STACK
#endif
// </e>
// <e>Use Fast Math
#define MDK_CONF_FASTMATH 0
#if MDK_CONF_FASTMATH == 1
#define USE_FAST_MATH
#endif
// </e>
// </h>
//</h>
// <<< end of configuration section >>>

View File

@ -0,0 +1,46 @@
/* config.h
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/**** CyaSSL for KEIL-RL Configuration ****/
#define __CORTEX_M3__
#define CYASSL_MDK_ARM
#define NO_WRITEV
#define NO_CYASSL_DIR
/* for Retarget.c */
#define STDIO
#define BENCH_EMBEDDED
#define CYASSL_DER_LOAD
#define HAVE_NULL_CIPHER
#if defined(MDK_CONF_RTX_TCP_FS)
#include "config-RTX-TCP-FS.h"
#elif defined(MDK_CONF_TCP_FS)
#include "config-TCP-FS.h"
#elif defined(MDK_CONF_FS)
#include "config-FS.h"
#elif defined(MDK_CONF_BARE_METAL)
#include "config-BARE-METAL.h"
#endif

View File

@ -0,0 +1,201 @@
/* cyassl_KEIL_RL.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/***************************************************************************************/
/** This file is for defining functions for specific to KEIL-RL. **/
/***************************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <rtl.h>
#include "cyassl_MDK_ARM.h"
#include <cyassl/ctaocrypt/visibility.h>
#include <cyassl/ctaocrypt/logging.h>
/** KEIL-RL TCPnet ****/
/** TCPnet BSD socket does not have following functions. **/
char *inet_ntoa(struct in_addr in)
{
#define NAMESIZE 16
static char name[NAMESIZE] ;
sprintf(name, "%d.%d.%d.%d", (in.s_addr>>24)&0xff, (in.s_addr>>16)&0xff, (in.s_addr>>8)&0xff, in.s_addr&0xff) ;
return name ;
}
unsigned long inet_addr(const char *cp)
{
unsigned int a[4] ; unsigned long ret ;
sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]) ;
ret = ((a[3]<<24) + (a[2]<<16) + (a[1]<<8) + a[0]) ;
return(ret) ;
}
/*** tcp_connect is actually associated with following syassl_tcp_connect. ***/
int Cyassl_connect(int sd, const struct sockaddr* sa, int sz)
{
int ret = 0 ;
#if defined(CYASSL_KEIL_TCP_NET)
SOCKADDR_IN addr ;
addr = *(SOCKADDR_IN *)sa ;
do {
#undef connect /* Go to KEIL TCPnet connect */
ret = connect(sd, (SOCKADDR *)&addr, sizeof(addr)) ;
os_dly_wait(50);
} while(ret == SCK_EWOULDBLOCK) ;
#ifdef DEBUG_CYASSL
{
char msg[50] ;
sprintf(msg, "BSD Connect return code: %d\n", ret) ;
CYASSL_MSG(msg) ;
}
#endif
#endif /* CYASSL_KEIL_TCP_NET */
return(ret ) ;
}
int Cyassl_accept(int sd, struct sockaddr *addr, int *addrlen)
{
int ret = 0 ;
#if defined(CYASSL_KEIL_TCP_NET)
while(1) {
#undef accept /* Go to KEIL TCPnet accept */
ret = accept(sd, addr, addrlen) ;
if(ret != SCK_EWOULDBLOCK) break ;
os_dly_wait(1);
}
#ifdef DEBUG_CYASSL
{
char msg[50] ;
sprintf(msg, "BSD Accept return code: %d\n", ret) ;
CYASSL_MSG(msg) ;
}
#endif
#endif /* CYASSL_KEIL_TCP_NET */
return(ret ) ;
}
int Cyassl_recv(int sd, void *buf, size_t len, int flags)
{
int ret = 0;
#if defined(CYASSL_KEIL_TCP_NET)
while(1) {
#undef recv /* Go to KEIL TCPnet recv */
ret = recv(sd, buf, len, flags) ;
if(ret != SCK_EWOULDBLOCK) break ;
os_dly_wait(1);
}
#ifdef DEBUG_CYASSL
{
char msg[50] ;
sprintf(msg, "BSD Recv return code: %d\n", ret) ;
CYASSL_MSG(msg) ;
}
#endif
#endif /* CYASSL_KEIL_TCP_NET */
return(ret ) ;
}
int Cyassl_send(int sd, const void *buf, size_t len, int flags)
{
int ret = 0 ;
#if defined(CYASSL_KEIL_TCP_NET)
while(1) {
#undef send /* Go to KEIL TCPnet send */
ret = send(sd, buf, len, flags) ;
if(ret != SCK_EWOULDBLOCK) break ;
os_dly_wait(1);
}
#ifdef DEBUG_CYASSL
{
char msg[50] ;
sprintf(msg, "BSD Send return code: %d\n", ret) ;
CYASSL_MSG(msg) ;
}
#endif
#endif /* CYASSL_KEIL_TCP_NET */
return(ret) ;
}
#if defined(CYASSL_KEIL_TCP_NET)
void Cyassl_sleep(int t)
{
#if defined(HAVE_KEIL_RTX)
os_dly_wait(t/1000+1) ;
#endif
}
int Cyassl_tcp_select(int sd, int timeout)
{
return 0 ;
}
#endif
extern int getkey(void) ;
extern int sendchar(int c) ;
char * Cyassl_fgets ( char * str, int num, FILE * f )
{
int i ;
for(i = 0 ; i< num ; i++) {
while((str[i] = getkey()) == 0) ;
if(str[i] == '\n' || str[i] == '\012' || str[i] == '\015') {
sendchar('\n') ;
str[i++] = '\n' ;
str[i] = '\0' ;
break ;
} else if(str[i] == '\010') { /* BS */
if(i) { /* erace one char */
sendchar('\010') ; sendchar(' ') ; sendchar('\010') ;
i = (i>0 ? (i-2) : -1 ) ;
continue ;
}
} else if(str[i] == '\033' || str[i] == '\004' ) { /* ESC or ^D */
str[i] = '\0' ;
return(0) ;
}
sendchar(str[i]) ;
}
return(str) ;
}

View File

@ -0,0 +1,103 @@
/* cyassl_KEIL_RL.h
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/******************************************************************************/
/** This file is for defining types, values for specific to KEIL-MDK-ARM. **/
/******************************************************************************/
#ifndef CYASSL_KEIL_RL_H
#define CYASSL_KEIL_RL_H
#include <stdio.h>
/* Go to STDIN */
#define fgets(buff, sz, fd) Cyassl_fgets(buff, sz, fd)
extern char * Cyassl_fgets ( char * str, int num, FILE * f ) ;
#define SOCKET_T int
/*** #include <socket.h> ***/
#define NUMBITSPERBYTE 8
#define FD_SETSIZE 10
typedef long fd_mask;
#define NFDBITS (sizeof(fd_mask) * NUMBITSPERBYTE) /* bits per mask */
typedef struct fd_set {
fd_mask fds_bits[(FD_SETSIZE + NFDBITS - 1) / NFDBITS];
} fd_set;
/*** #include <sys/types.h> ***/
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
/*** #include <unistd.h> **/
/*
int select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, const struct timeval *timeout);
void FD_CLR(int fd, fd_set *set);
int FD_ISSET(int fd, fd_set *set);
void FD_SET(int fd, fd_set *set);
void FD_ZERO(fd_set *set);
*/
typedef int socklen_t ;
/* for avoiding conflict with KEIL-TCPnet BSD socket */
/* Bodies are in cyassl_KEIL_RL.c */
#define connect Cyassl_connect
#define accept Cyassl_accept
#define recv Cyassl_recv
#define send Cyassl_send
#define sleep Cyassl_sleep
/* for avoiding conflicting with KEIL-TCPnet TCP socket */
/* Bodies are in test.h */
#define tcp_connect Cyassl_tcp_connect
#define tcp_socket Cyassl_tcp_soket
#define tcp_listen Cyassl_tcp_listen
#define tcp_select Cyassl_tcp_select
extern int Cyassl_connect(int sd, const struct sockaddr * sa, int sz) ;
extern int Cyassl_accept(int sd, struct sockaddr *addr, socklen_t *addrlen);
extern int Cyassl_recv(int sd, void *buf, size_t len, int flags);
extern int Cyassl_send(int sd, const void *buf, size_t len, int flags);
extern void Cyassl_sleep(int sec) ;
extern int Cyassl_tcp_select(int sd, int timeout) ;
/** KEIL-RL TCPnet ****/
/* TCPnet BSD socket does not have following functions. */
extern char *inet_ntoa(struct in_addr in);
extern unsigned long inet_addr(const char *cp);
extern int setsockopt(int sockfd, int level, int optname,
const void *optval, socklen_t optlen);
extern int select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, const struct timeval *timeout);
/* CyaSSL MDK-ARM time functions */
#include <time.h>
struct tm *Cyassl_MDK_gmtime(const time_t *c) ;
extern double current_time(void) ;
#endif /* CYASSL_KEIL_RL_H */

View File

@ -0,0 +1,173 @@
/* main.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cyassl/ctaocrypt/visibility.h>
#include <cyassl/ctaocrypt/logging.h>
#include <RTL.h>
#include <stdio.h>
#include "cyassl_MDK_ARM.h"
/*-----------------------------------------------------------------------------
* Initialize a Flash Memory Card
*----------------------------------------------------------------------------*/
#if !defined(NO_FILESYSTEM)
static void init_card (void)
{
U32 retv;
while ((retv = finit (NULL)) != 0) { /* Wait until the Card is ready */
if (retv == 1) {
printf ("\nSD/MMC Init Failed");
printf ("\nInsert Memory card and press key...\n");
} else {
printf ("\nSD/MMC Card is Unformatted");
}
}
}
#endif
/*-----------------------------------------------------------------------------
* TCP/IP tasks
*----------------------------------------------------------------------------*/
#ifdef CYASSL_KEIL_TCP_NET
__task void tcp_tick (void)
{
CYASSL_MSG("Time tick started.") ;
#if defined (HAVE_KEIL_RTX)
os_itv_set (10);
#endif
while (1) {
#if defined (HAVE_KEIL_RTX)
os_itv_wait ();
#endif
/* Timer tick every 100 ms */
timer_tick ();
}
}
__task void tcp_poll (void)
{
CYASSL_MSG("TCP polling started.\n") ;
while (1) {
main_TcpNet ();
#if defined (HAVE_KEIL_RTX)
os_tsk_pass ();
#endif
}
}
#endif
#if defined(HAVE_KEIL_RTX) && defined(CYASSL_MDK_SHELL)
#define SHELL_STACKSIZE 1000
static unsigned char Shell_stack[SHELL_STACKSIZE] ;
#endif
#if defined(CYASSL_MDK_SHELL)
extern void shell_main(void) ;
#endif
extern void time_main(int) ;
extern void benchmark_test(void) ;
extern void SER_Init(void) ;
/*-----------------------------------------------------------------------------
* mian entry
*----------------------------------------------------------------------------*/
/*** This is the parent task entry ***/
void main_task (void)
{
#ifdef CYASSL_KEIL_TCP_NET
init_TcpNet ();
os_tsk_create (tcp_tick, 2);
os_tsk_create (tcp_poll, 1);
#endif
#ifdef CYASSL_MDK_SHELL
#ifdef HAVE_KEIL_RTX
os_tsk_create_user(shell_main, 1, Shell_stack, SHELL_STACKSIZE) ;
#else
shell_main() ;
#endif
#else
/************************************/
/*** USER APPLICATION HERE ***/
/************************************/
printf("USER LOGIC STARTED\n") ;
#endif
#ifdef HAVE_KEIL_RTX
CYASSL_MSG("Terminating tcp_main\n") ;
os_tsk_delete_self ();
#endif
}
int myoptind = 0;
char* myoptarg = NULL;
#if defined(DEBUG_CYASSL)
extern void CyaSSL_Debugging_ON(void) ;
#endif
/*** main entry ***/
extern void init_time(void) ;
extern void SystemInit(void);
int main() {
SystemInit();
SER_Init() ;
#if !defined(NO_FILESYSTEM)
init_card () ; /* initializing SD card */
#endif
init_time() ;
#if defined(DEBUG_CYASSL)
printf("Turning ON Debug message\n") ;
CyaSSL_Debugging_ON() ;
#endif
#ifdef HAVE_KEIL_RTX
os_sys_init (main_task) ;
#else
main_task() ;
#endif
return 0 ; /* There should be no return here */
}

View File

@ -0,0 +1,595 @@
/*shell.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/*** tiny Shell for CyaSSL apps ***/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "cyassl/internal.h"
#undef RNG
#include <cyassl/ctaocrypt/logging.h>
#if defined(CYASSL_MDK_ARM)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <rtl.h>
#include "cyassl_MDK_ARM.h"
#endif
#ifdef CYASSL_KEIL_NET
#include "cyassl/test.h"
#else
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
#endif
#ifdef NO_ECHOCLIENT
#define echoclient_test command_not_found
#endif
#ifdef NO_ECHOSERVER
#define echoserver_test command_not_found
#endif
#ifdef NO_SIMPLE_CLIENT
#define client_test command_not_found
#endif
#ifdef NO_SIMPLE_SERVER
#define server_test command_not_found
#endif
#ifdef NO_CRYPT_BENCHMARK
#define benchmark_test command_not_found
#endif
#ifdef NO_CRYPT_TEST
#define ctaocrypt_test command_not_found
#endif
#ifndef CYASSL_KEIL_NET
#define ipaddr_comm command_not_found
#endif
#if !defined(HAVE_KEIL_RTX)
#define stack_comm command_not_found
#endif
#if !defined(DEBUG_CYASSL)
#define dbg_comm command_not_found
#endif
void command_not_found(void *argv) {
printf("Command not found\n") ;
}
extern void echoclient_test(void *args) ;
extern void echoserver_test(void *args) ;
extern void benchmark_test(void *args) ;
extern void ctaocrypt_test(void *args) ;
extern void client_test(void *args) ;
extern void server_test(void *args) ;
extern void kill_task(void *args) ;
extern void time_main(void *args) ;
extern void ipaddr_comm(void *args) ;
extern void stack_comm(void *args) ;
extern void for_command(void *args) ;
extern void dbg_comm(void *arg) ;
extern void help_comm(void *arg) ;
#if !defined(NO_CRYPT_TEST)
#ifndef NO_MD5
extern void md5_test(void *arg) ;
#endif
#ifdef CYASSL_MD2
extern void md2_test(void *arg) ;
#endif
#ifndef NO_MD4
extern void md4_test(void *arg) ;
#endif
extern void sha_test(void *arg) ;
#ifndef NO_SHA256
extern void sha256_test(void *arg) ;
#endif
#ifdef CYASSL_SHA384
extern void sha384_test(void *arg) ;
#endif
#ifdef CYASSL_SHA512
extern void sha512_test(void *arg) ;
#endif
#ifdef CYASSL_RIPEMD
extern void ripemd_test(void *arg) ;
#endif
#ifndef NO_HMAC
#ifndef NO_MD5
extern void hmac_md5_test(void *arg) ;
#endif
extern void hmac_sha_test(void *arg) ;
#ifndef NO_SHA256
extern void hmac_sha256_test(void *arg) ;
#endif
#ifdef CYASSL_SHA384
extern void hmac_sha384_test(void *arg) ;
#endif
#endif
#ifndef NO_RC4
extern void arc4_test(void *arg) ;
#endif
#ifndef NO_HC128
extern void hc128_test(void *arg) ;
#endif
#ifndef NO_RABBIT
extern void rabbit_test(void *arg) ;
#endif
#ifndef NO_DES3
extern void des_test(void *arg) ;
extern void des3_test(void *arg) ;
#endif
#ifndef NO_AES
extern void aes_test(void *arg) ;
#ifdef HAVE_AESGCM
extern void aesgcm_test(void *arg) ;
#endif
#ifdef HAVE_AESCCM
extern void aesccm_test(void *arg) ;
#endif
#endif
#ifdef HAVE_CAMELLIA
extern void camellia_test(void *arg) ;
#endif
extern void random_test(void *arg) ;
#ifndef NO_RSA
extern void rsa_test(void *arg) ;
#endif
#ifndef NO_DH
extern void dh_test(void *arg) ;
#endif
#ifndef NO_DSA
extern void dsa_test(void *arg) ;
#endif
#ifndef NO_PWDBASED
extern void pwdbased_test(void *arg) ;
#endif
#ifdef HAVE_ECC
extern void openssl_test(void *arg) ;
#endif
#ifdef HAVE_ECC
extern void ecc_test(void *arg) ;
#endif
#endif /* NO_CRYPT_TEST */
static struct {
const char *command ;
void (*func)(void *args) ;
} commandTable[] = {
"echoclient", echoclient_test,
"echoserver", echoserver_test,
"benchmark", benchmark_test,
"test", ctaocrypt_test,
"client", client_test,
"server", server_test,
"time", time_main, /* get/set RTC: [-d yy/mm/dd] [-t hh:mm:ss]*/
"ipaddr", ipaddr_comm, /* TBD */
"stack", stack_comm, /* On/Off check stack size */
"for", for_command, /* iterate next command X times */
"debug", dbg_comm, /* On/Off debug message */
"help", help_comm, /* Breif description about the commands */
/** short name **/
"ec", echoclient_test,
"es", echoserver_test,
"bm", benchmark_test,
"te", ctaocrypt_test,
"cl", client_test,
"sv", server_test,
"ip", ipaddr_comm,
"st", stack_comm,
"dbg", dbg_comm,
"?", help_comm,
/*** test suites ****/
#if !defined(NO_CRYPT_TEST)
#ifndef NO_MD5
"md5", md5_test,
#endif
#ifdef CYASSL_MD2
"md2", md2_test,
#endif
#ifndef NO_MD4
"md4", md4_test,
#endif
"sha", sha_test,
#ifndef NO_SHA256
"sha256", sha256_test,
#endif
#ifdef CYASSL_SHA384
"sha384", sha384_test,
#endif
#ifdef CYASSL_SHA512
"sha512", sha512_test,
#endif
#ifdef CYASSL_RIPEMD
"ripemd", ripemd_test,
#endif
#ifndef NO_HMAC
#ifndef NO_MD5
"hmac_md5", hmac_md5_test,
#endif
"hmac_sha", hmac_sha_test,
#ifndef NO_SHA256
"hmac_sha256", hmac_sha256_test,
#endif
#ifdef CYASSL_SHA384
"hmac_sha384", hmac_sha384_test,
#endif
#endif
#ifndef NO_RC4
"arc4", arc4_test,
#endif
#ifndef NO_HC128
"hc128", hc128_test,
#endif
#ifndef NO_RABBIT
"rabbit", rabbit_test,
#endif
#ifndef NO_DES3
"des", des_test,
"des3", des3_test,
#endif
#ifndef NO_AES
"aes", aes_test,
#ifdef HAVE_AESGCM
"aesgcm", aesgcm_test,
#endif
#ifdef HAVE_AESCCM
"aesccm", aesccm_test,
#endif
#endif
#ifdef HAVE_CAMELLIA
"camellia", camellia_test,
#endif
"random", random_test,
#ifndef NO_RSA
"rsa", rsa_test,
#endif
#ifndef NO_DH
"dh", dh_test,
#endif
#ifndef NO_DSA
"dsa", dsa_test,
#endif
#ifndef NO_PWDBASED
"pwdbased", pwdbased_test,
#endif
#ifdef OPENSSL_EXTRA
"openssl", openssl_test,
#endif
#ifdef HAVE_ECC
"ecc", ecc_test,
#endif
#endif /* NO_CRYPT_TEST */
"", NULL
} ;
enum jobtype { FORGROUND, BACKGROUND } ;
#define IF_DELIMITER(ch) ((ch) == ' ' || (ch) == '\n')
/******* Get Command Line *****************************/
static int getline(char * line, int sz, func_args *args, int*bf_flg)
{
char * ret ;
int i ;
#define MAXARGS 10
#define MAXARGLEN 30
static char *argv[MAXARGS] ;
args->argv = argv ;
putchar('>') ;
fflush(stdout) ;
ret = fgets(line, sz, stdin) ;
#define SHELL_ERROR_FGETS -102
if(ret != line) return(SHELL_ERROR_FGETS) ;
if(line[strlen(line)-2] == '&') {
(*bf_flg) = BACKGROUND ;
line[strlen(line)-2] = '\n' ;
} else {
(*bf_flg) = FORGROUND ;
}
args->argc = 0 ;
for(i=0; i<sz; i++) {
args->argv[args->argc] = &(line[i]) ;
while(!IF_DELIMITER(line[i])) i++ ;
args->argc++ ;
if(line[i] == '\n') {
line[i] = '\0' ;
break ;
} else {
line[i] = '\0' ;
}
}
return i ;
}
static int BackGround = 0 ; /* 1: background job is running */
/************* Embedded Shell Commands **********************************/
#define IP_SIZE 16
#ifdef CYASSL_KEIL_NET
static void ipaddr_comm(void *args)
{
if(((func_args *)args)->argc == 1) {
printf("IP addr: %s, port %d\n", yasslIP, yasslPort) ;
} else {
if(BackGround != 0) {
printf("Cannot change IP addr while background server is running\n") ;
} else if(((func_args *)args)->argc == 3 &&
((func_args *)args)->argv[1][0] == '-'&&
((func_args *)args)->argv[1][1] == 'a' ) {
/* strcpy(yasslIP, ((func_args *)args)->argv[2]) ; */
} else if(((func_args *)args)->argc == 3 &&
((func_args *)args)->argv[1][0] == '-' &&
((func_args *)args)->argv[1][1] == 'p' ) {
/* yasslPort = atoi(((func_args *)args)->argv[2]) ; */
} else printf("Invalid argument\n") ;
}
}
#endif
#if defined(HAVE_KEIL_RTX)
static int stack_ck = 0 ;
static void stack_comm(void *args)
{
if(stack_ck) {
printf("Stack Check: Off\n") ;
stack_ck = 0 ;
} else {
printf("Stack Check: On\n") ;
stack_ck = 1 ;
}
}
#define FILL_PATTERN 0xa596695a
void stack_fill(char * stack, int size)
{
int i ;
if(stack_ck == 0)return ;
for(i=1; i<size/4-10; i++)
((int *)stack)[i] = FILL_PATTERN ;
}
void stack_check(char * stack, int size)
{
int i ;
if(stack_ck == 0)return ;
if(stack_ck == 1) {
stack_ck ++ ; return ;
}
for(i=1; i<size/4 ; i++) {
if(((int *)stack)[i] != FILL_PATTERN) break ;
}
if(i < size/4) {
printf("Stack is used %d bytes out of %d\n", size - i*4, size) ;
} else {
printf("Stack overflow. Stack size: %d\n", size) ;
}
}
#endif /* HAVE_KEIL_RTX */
static int for_iteration = 1 ;
static void for_command(void *args)
{
if( args == NULL || ((func_args *)args)->argc == 1) {
printf("For %d times\n", for_iteration) ;
} else if( args == NULL || ((func_args *)args)->argc == 2) {
for_iteration = atoi(((func_args *)args)->argv[1]) ;
} else printf("Invalid argument\n") ;
}
#if defined(DEBUG_CYASSL)
static int CyasslDebug = 1 ;
static void dbg_comm(void *args)
{
if(CyasslDebug == 1) {
CyasslDebug = 0 ;
printf("Turning OFF Debug message\n") ;
CyaSSL_Debugging_OFF() ;
} else {
CyasslDebug = 1 ;
printf("Turning ON Debug message\n") ;
CyaSSL_Debugging_ON() ;
}
}
#endif
static void help_comm(void *args)
{
}
#define BG_JOB_STACK_SIZE 12000
#if (!defined(NO_SIMPLE_SERVER) && !defined(NO_ECHOSERVER)) && \
defined(HAVE_KEIL_RTX)
static char bg_job_stack[BG_JOB_STACK_SIZE] ;
#endif
#define COMMAND_STACK_SIZE 12000
#if defined(HAVE_KEIL_RTX)
static char command_stack[COMMAND_STACK_SIZE] ;
#endif
#ifdef HAVE_KEIL_RTX
static CyaSSL_Mutex command_mutex ;
#endif
/*********** Invoke Forground Command *********************/
static void command_invoke(void *args)
{
void (*func)(void * ) ;
int i,iteration ;
func = (void(*)(void *))((func_args *)args)->argv[0] ;
#ifdef HAVE_KEIL_RTX
LockMutex((CyaSSL_Mutex *)&command_mutex) ;
#endif
iteration = for_iteration ;
for(i=0; i< iteration; i++) {
if(iteration > 1) printf("--- Start for %d ---->\n", i) ;
#if defined(HAVE_KEIL_RTX)
stack_fill(command_stack, COMMAND_STACK_SIZE) ;
#endif
func(args) ; /* invoke command */
#if defined(HAVE_KEIL_RTX)
stack_check(command_stack, COMMAND_STACK_SIZE) ;
#endif
}
if(iteration > 1)
for_iteration = 1 ;
#ifdef HAVE_KEIL_RTX
UnLockMutex((CyaSSL_Mutex *)&command_mutex) ;
os_tsk_delete_self() ;
#endif
}
#if (!defined(NO_SIMPLE_SERVER) && !defined(NO_ECHOSERVER)) && \
defined(HAVE_KEIL_RTX)
/******* Invoke Background Job *******************************/
static void bg_job_invoke(void *args)
{
void (*func)(void * ) ;
BackGround = 1 ;
stack_fill(bg_job_stack, BG_JOB_STACK_SIZE) ;
func = (void(*)(void *))((func_args *)args)->argv[0] ;
func(args) ; /* invoke command */
stack_check(bg_job_stack, BG_JOB_STACK_SIZE) ;
#ifdef CYASSL_KEIL_NET
init_TcpNet ();
#endif
BackGround = 0 ;
os_tsk_delete_self() ; ;
}
#endif
#define LINESIZE 100
static char line[LINESIZE] ;
/********* SHEULL MAIN LOOP ***********************************/
void shell_main(void) {
int i ;
func_args args ;
int bf_flg ;
i = BackGround ;
/* Dummy for avoiding warning: BackGround is defined but not used. */
#if defined(HAVE_KEIL_RTX)
InitMutex(&command_mutex) ;
#endif
time_main(NULL) ;
printf("Starting Shell\n") ;
while(1) {
if(getline(line, LINESIZE, &args, &bf_flg) > 0) {
for(i=0; commandTable[i].func != NULL; i++) {
if(strcmp(commandTable[i].command, args.argv[0]) == 0) {
args.argv[0] = (char *) commandTable[i].func ;
if(bf_flg == FORGROUND) {
#ifdef HAVE_KEIL_RTX
UnLockMutex((CyaSSL_Mutex *)&command_mutex) ;
os_tsk_create_user_ex( (void(*)(void *))&command_invoke, 7,
command_stack, COMMAND_STACK_SIZE, &args) ;
#else
command_invoke(&args) ;
#endif
#ifdef HAVE_KEIL_RTX
LockMutex((CyaSSL_Mutex *)&command_mutex) ;
#endif
} else {
#if (!defined(NO_SIMPLE_SERVER) && \
!defined(NO_ECHOSERVER)) && \
defined(HAVE_KEIL_RTX)
if(BackGround != 0) {
printf("Multiple background servers not supported.\n") ;
} else {
printf("\"%s\" is running with the background mode.\n",
commandTable[i].command) ;
os_tsk_create_user_ex( (void(*)(void *))&bg_job_invoke,
6, bg_job_stack, BG_JOB_STACK_SIZE, &args) ;
}
#else
printf("Invalid Command: no background job\n") ;
#endif
}
break ;
}
}
if(commandTable[i].func == NULL)
printf("Command not found\n") ;
}
}
}

View File

@ -0,0 +1,53 @@
/* ssl-dummy.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cyassl/ssl.h>
#include <cyassl/internal.h>
#include <cyassl/error.h>
#include <cyassl/ctaocrypt/coding.h>
Signer* GetCA(void* vp, byte* hash)
{
Signer*s ;
return s ;
}
int CyaSSL_dtls(CYASSL* ssl)
{
return ssl->options.dtls;
}
int CyaSSL_get_using_nonblock(CYASSL* ssl)
{
CYASSL_ENTER("CyaSSL_get_using_nonblock");
CYASSL_LEAVE("CyaSSL_get_using_nonblock", ssl->options.usingNonblock);
return ssl->options.usingNonblock;
}
Signer* GetCAByName(void* vp, byte* hash)
{
Signer * ca ;
return(ca) ;
}

View File

@ -0,0 +1,22 @@
/******************************************************************************/
/* Dbg_Flash.ini Initialization File for Debugging from Internal */
/* Flash for NXP LPC18xx/LPC43xx */
/******************************************************************************/
/* This file is part of the uVision/ARM development tools. */
/* Copyright (c) 2005-2012 Keil Software. All rights reserved. */
/* This software may only be used under the terms of a valid, current, */
/* end user licence from KEIL for a compatible version of KEIL software */
/* development tools. Nothing else gives you the right to use this software. */
/******************************************************************************/
FUNC void Per_Reset (void) {
// Reset peripherals: LCD, USB0, USB1, DMA, SDIO, ETHERNET
_WDWORD(0x40053100, 0x005F0000); // Issue reset
_sleep_(1);
}
Per_Reset(); // Reset some peripherals
KILL BUTTON * // Kill all buttons
DEFINE BUTTON "Reset Peripherals", "Per_Reset()" // Create peripheral reset button

View File

@ -0,0 +1,401 @@
/*----------------------------------------------------------------------------
* RL-ARM - FlashFS
*----------------------------------------------------------------------------
* Name: FILE_CONFIG.C
* Purpose: Configuration of RL FlashFS by user
* Rev.: V4.70
*----------------------------------------------------------------------------
* This code is part of the RealView Run-Time Library.
* Copyright (c) 2004-2013 KEIL - An ARM Company. All rights reserved.
*---------------------------------------------------------------------------*/
#include <File_Config.h>
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
//
// <h>File System
// ==============
// <i> Define File System global parameters
// <o>Number of open files <4-16>
// <i>Define number of files that can be
// <i>opened at the same time.
// <i>Default: 8
#define N_FILES 6
// <o>FAT Name Cache Size <0-1000000>
// <i>Define number of cached FAT file or directory names.
// <i>48 bytes of RAM is required for each cached name.
#define FAT_NAME_CACNT 0
// <e>Relocate FAT Name Cache Buffer
// <i>Locate Cache Buffer at a specific address.
#define FAT_NAME_RELOC 0
// <o>Base address <0x0000-0xFFFFFE00:0x200>
// <i>Define the Cache buffer base address.
#define FAT_NAME_CADR 0x60000000
// </e>
// <o>CPU Clock Frequency [Hz]<0-1000000000>
// <i>Define the CPU Clock frequency used for
// <i>flash programming and erasing.
#define CPU_CLK 180000000
// </h>
// <e>Flash Drive
// ==============
// <i>Enable Embedded Flash Drive [F:]
#define FL0_EN 0
// <o>Base address <0x0-0xFFFFF000:0x1000>
// <i>Define the target device Base address
// <i>Default: 0x80000000
#define FL0_BADR 0x80000000
// <o>Device Size <0x4000-0xFFFFF000:0x4000>
// <i>Define the size of Flash device in bytes
// <i>Default: 0x100000 (1MB)
#define FL0_SIZE 0x0200000
// <o>Content of Erased Memory <0=>0x00 <0xFF=>0xFF
// <i>Define the initial value for erased Flash data
// <i>Default: 0xFF
#define FL0_INITV 0xFF
// <s.80>Device Description file
// <i>Specify a file name with a relative path
// <i>Default: FS_FlashDev.h
#define FL0_HFILE "FS_FlashDev.h"
// <q>Default Drive [F:]
// <i>Used when Drive letter not specified
#define FL0_DEF 1
// </e>
// <e>SPI Flash Drive
// ==================
// <i>Enable SPI Flash Drive [S:]
#define SF0_EN 0
// <o>Device Size <0x10000-0xFFFFF000:0x8000>
// <i>Define the size of SPI Flash device in bytes
// <i>Default: 0x100000 (1MB)
#define SF0_SIZE 0x0200000
// <o>Content of Erased Memory <0=>0x00 <0xFF=>0xFF
// <i>Define the initial value for erased Flash data
// <i>Default: 0xFF
#define SF0_INITV 0xFF
// <s.80>Device Description file
// <i>Specify a file name with a relative path
// <i>Default: FS_SPI_FlashDev.h
#define SF0_HFILE "FS_SPI_FlashDev.h"
// <q>Default Drive [S:]
// <i>Used when Drive letter not specified
#define SF0_DEF 0
// </e>
// <e>RAM Drive
// ============
// <i>Enable Embedded RAM Drive [R:]
#define RAM0_EN 0
// <o>Device Size <0x4000-0xFFFFF000:0x4000>
// <i>Define the size of RAM device in bytes
// <i>Default: 0x40000
#define RAM0_SIZE 0x004000
// <o>Number of Sectors <8=>8 <16=>16 <32=>32 <64=>64 <128=>128
// <i>Define number of virtual sectors for RAM device
// <i>Default: 32
#define RAM0_NSECT 64
// <e>Relocate Device Buffer
// <i>Locate RAM Device Buffer at a specific address.
// <i>If not enabled, the linker selects base address.
#define RAM0_RELOC 1
// <o>Base address <0x0-0xFFFFF000:0x1000>
// <i>Define the target device Base address.
// <i>Default: 0x81000000
#define RAM0_BADR 0x81010000
// </e>
// <q>Default Drive [R:]
// <i>Used when Drive letter not specified
#define RAM0_DEF 0
// </e>
// <e>Memory Card Drive 0
// ======================
// <i>Enable Memory Card Drive [M0:]
#define MC0_EN 1
// <o>Bus Mode <0=>SD-Native <1=>SPI
// <i>Define Memory Card bus interface mode.
// <i>SD-Native mode needs MCI peripheral.
// <i>SPI mode uses SD Card in SPI mode.
#define MC0_SPI 0
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
// <8=>8 KB <16=>16 KB <32=>32 KB
// <i>Define System Cache buffer size for file IO.
// <i>Increase this number for faster r/w access.
// <i>Default: 4 kB
#define MC0_CASZ 4
// <e>Relocate Cache Buffer
// <i>Locate Cache Buffer at a specific address.
// <i>Some devices like NXP LPC23xx require a Cache buffer
// <i>for DMA transfer located at specific address.
#define MC0_RELOC 0
// <o>Base address <0x0000-0xFFFFFE00:0x200>
// <i>Define the Cache buffer base address.
// <i>For LPC23xx/24xx devices this is USB RAM
// <i>starting at 0x7FD00000.
#define MC0_CADR 0x7FD00000
// </e>
// <q>FAT Journal
// <i>Enable FAT Journal in order to guarantee
// <i>fail-safe FAT file system operation.
#define MC0_FSJ 0
// <q>Default Drive [M0:]
// <i>Used when Drive letter not specified
#define MC0_DEF 1
// </e>
// <e>Memory Card Drive 1
// ======================
// <i>Enable Memory Card Drive [M1:]
#define MC1_EN 0
// <o>Bus Mode <0=>SD-Native <1=>SPI
// <i>Define Memory Card bus interface mode.
// <i>SD-Native mode needs MCI peripheral.
// <i>SPI mode uses SD Card in SPI mode.
#define MC1_SPI 1
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
// <8=>8 KB <16=>16 KB <32=>32 KB
// <i>Define System Cache buffer size for file IO.
// <i>Increase this number for faster r/w access.
// <i>Default: 4 kB
#define MC1_CASZ 0
// <e>Relocate Cache Buffer
// <i>Locate Cache Buffer at a specific address.
// <i>Some devices like NXP LPC23xx require a Cache buffer
// <i>for DMA transfer located at specific address.
#define MC1_RELOC 0
// <o>Base address <0x0000-0xFFFFFE00:0x200>
// <i>Define the Cache buffer base address.
// <i>For LPC23xx/24xx devices this is USB RAM
// <i>starting at 0x7FD00000.
#define MC1_CADR 0x7FD00000
// </e>
// <q>FAT Journal
// <i>Enable FAT Journal in order to guarantee
// <i>fail-safe FAT file system operation.
#define MC1_FSJ 0
// <q>Default Drive [M1:]
// <i>Used when Drive letter not specified
#define MC1_DEF 0
// </e>
// <e>USB Flash Drive 0
// ====================
// <i>Enable USB Flash Drive [U0:]
#define USB0_EN 0
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
// <8=>8 KB <16=>16 KB <32=>32 KB
// <i>Define System Cache buffer size for file IO.
// <i>Increase this number for faster r/w access.
// <i>Default: 4 kB
#define USB0_CASZ 8
// <q>FAT Journal
// <i>Enable FAT Journal in order to guarantee
// <i>fail-safe FAT file system operation.
#define USB0_FSJ 0
// <q>Default Drive [U0:]
// <i>Used when Drive letter not specified
#define USB0_DEF 0
// </e>
// <e>USB Flash Drive 1
// ====================
// <i>Enable USB Flash Drive [U1:]
#define USB1_EN 0
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
// <8=>8 KB <16=>16 KB <32=>32 KB
// <i>Define System Cache buffer size for file IO.
// <i>Increase this number for faster r/w access.
// <i>Default: 4 kB
#define USB1_CASZ 8
// <q>FAT Journal
// <i>Enable FAT Journal in order to guarantee
// <i>fail-safe FAT file system operation.
#define USB1_FSJ 0
// <q>Default Drive [U1:]
// <i>Used when Drive letter not specified
#define USB1_DEF 0
// </e>
// <e>NAND Flash Drive 0
// ===================
// <i>Enable NAND Flash Drive [N0:]
#define NAND0_EN 0
// <o>Page size <528=> 512 + 16 bytes
// <2112=>2048 + 64 bytes
// <4224=>4096 + 128 bytes
// <8448=>8192 + 256 bytes
// <i>Define program Page size in bytes (User + Spare area).
#define NAND0_PGSZ 2112
// <o>Block Size <8=>8 pages <16=>16 pages <32=>32 pages
// <64=>64 pages <128=>128 pages <256=>256 pages
// <i>Define number of pages in a block.
#define NAND0_PGCNT 64
// <o>Device Size [blocks] <512-32768>
// <i>Define number of blocks in NAND Flash device.
#define NAND0_BLCNT 4096
// <o>Page Caching <0=>OFF <1=>1 page <2=>2 pages <4=>4 pages
// <8=>8 pages <16=>16 pages <32=>32 pages
// <i>Define number of cached Pages.
// <i>Default: 4 pages
#define NAND0_CAPG 2
// <o>Block Indexing <0=>OFF <1=>1 block <2=>2 blocks <4=>4 blocks
// <8=>8 blocks <16=>16 blocks <32=>32 blocks
// <64=>64 blocks <128=>128 blocks <256=>256 blocks
// <i>Define number of indexed Flash Blocks.
// <i>Increase this number for better performance.
// <i>Default: 16 blocks
#define NAND0_CABL 16
// <o>Software ECC <0=>None <1=>Hamming (SLC)
// <i>Enable software ECC calculation only,
// <i>if not supported by hardware.
#define NAND0_SWECC 1
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
// <8=>8 KB <16=>16 KB <32=>32 KB
// <i>Define System Cache buffer size for file IO.
// <i>Increase this number for faster r/w access.
// <i>Default: 4 kB
#define NAND0_CASZ 4
// <e>Relocate Cache Buffers
// <i>Use this option to locate Cache buffers
// <i>at specific address in RAM or SDRAM.
#define NAND0_RELOC 0
// <o>Base address <0x0000-0xFFFFFE00:0x200>
// <i>Define base address for Cache Buffers.
#define NAND0_CADR 0x80000000
// </e>
// <q>FAT Journal
// <i>Enable FAT Journal in order to guarantee
// <i>fail-safe FAT file system operation.
#define NAND0_FSJ 0
// <q>Default Drive [N0:]
// <i>Used when Drive letter not specified
#define NAND0_DEF 0
// </e>
// <e>NAND Flash Drive 1
// ===================
// <i>Enable NAND Flash Drive [N1:]
#define NAND1_EN 0
// <o>Page size <528=> 512 + 16 bytes
// <2112=>2048 + 64 bytes
// <4224=>4096 + 128 bytes
// <8448=>8192 + 256 bytes
// <i>Define program Page size in bytes (User + Spare area).
#define NAND1_PGSZ 2112
// <o>Block Size <8=>8 pages <16=>16 pages <32=>32 pages
// <64=>64 pages <128=>128 pages <256=>256 pages
// <i>Define number of pages in a block.
#define NAND1_PGCNT 32
// <o>Device Size [blocks] <512-32768>
// <i>Define number of blocks in NAND Flash device.
#define NAND1_BLCNT 512
// <o>Page Caching <0=>OFF <1=>1 page <2=>2 pages <4=>4 pages
// <8=>8 pages <16=>16 pages <32=>32 pages
// <i>Define number of cached Pages.
// <i>Default: 4 pages
#define NAND1_CAPG 4
// <o>Block Indexing <0=>OFF <1=>1 block <2=>2 blocks <4=>4 blocks
// <8=>8 blocks <16=>16 blocks <32=>32 blocks
// <64=>64 blocks <128=>128 blocks <256=>256 blocks
// <i>Define number of indexed Flash Blocks.
// <i>Increase this number for better performance.
// <i>Default: 16 blocks
#define NAND1_CABL 16
// <o>Software ECC <0=>None <1=>Hamming (SLC)
// <i>Enable software ECC calculation only,
// <i>if not supported by hardware.
#define NAND1_SWECC 0
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
// <8=>8 KB <16=>16 KB <32=>32 KB
// <i>Define System Cache buffer size for file IO.
// <i>Increase this number for faster r/w access.
// <i>Default: 4 kB
#define NAND1_CASZ 4
// <e>Relocate Cache Buffers
// <i>Use this option to locate Cache buffers
// <i>at specific address in RAM or SDRAM.
#define NAND1_RELOC 0
// <o>Base address <0x0000-0xFFFFFE00:0x200>
// <i>Define base address for Cache Buffers.
#define NAND1_CADR 0x80000000
// </e>
// <q>FAT Journal
// <i>Enable FAT Journal in order to guarantee
// <i>fail-safe FAT file system operation.
#define NAND1_FSJ 0
// <q>Default Drive [N1:]
// <i>Used when Drive letter not specified
#define NAND1_DEF 0
// </e>
//------------- <<< end of configuration section >>> -----------------------
#ifndef __NO_FILE_LIB_C
#include <File_lib.c>
#endif
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,892 @@
/*----------------------------------------------------------------------------
* RL-ARM - TCPnet
*----------------------------------------------------------------------------
* Name: NET_CONFIG.C
* Purpose: Configuration of RL TCPnet by user.
* Rev.: V4.60
*----------------------------------------------------------------------------
* This code is part of the RealView Run-Time Library.
* Copyright (c) 2004-2012 KEIL - An ARM Company. All rights reserved.
*---------------------------------------------------------------------------*/
#include <Net_Config.h>
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
//
// <h>System Definitions
// =====================
// <i> Global TCPnet System definitions
// <s.15>Local Host Name
// <i> This is the name under which embedded host can be
// <i> accessed on a local area network.
// <i> Default: "mcb2300"
#define LHOST_NAME "mcb2300"
// <o>Memory Pool size <1500-64000:4><#/4>
// <i> This is the size of a memory pool in bytes. Buffers for
// <i> TCPnet packets are allocated from this memory pool.
// <i> Default: 8000 bytes
#define MEM_SIZE 4000
// <o>Tick Timer interval <10=> 10 ms <20=> 20 ms <25=> 25 ms
// <40=> 40 ms <50=> 50 ms <100=> 100 ms
// <200=> 200 ms
// <i> System Tick Timer interval for software timers
// <i> Default: 100 ms
#define TICK_INTERVAL 10
// </h>
// <e>Ethernet Network Interface
// =============================
// <i> Enable or disable Ethernet Network Interface
#define ETH_ENABLE 1
// <h>MAC Address
// ==============
// <i> Local Ethernet MAC Address
// <i> Value FF:FF:FF:FF:FF:FF is not allowed.
// <i> It is an ethernet Broadcast MAC address.
// <o>Address byte 1 <0x00-0xff:2>
// <i> LSB is an ethernet Multicast bit.
// <i> Must be 0 for local MAC address.
// <i> Default: 0x00
#define _MAC1 0x30
// <o>Address byte 2 <0x00-0xff>
// <i> Default: 0x30
#define _MAC2 0x06
// <o>Address byte 3 <0x00-0xff>
// <i> Default: 0x6C
#define _MAC3 0x6C
// <o>Address byte 4 <0x00-0xff>
// <i> Default: 0x00
#define _MAC4 0x00
// <o>Address byte 5 <0x00-0xff>
// <i> Default: 0x00
#define _MAC5 0x00
// <o>Address byte 6 <0x00-0xff>
// <i> Default: 0x01
#define _MAC6 0x01
// </h>
// <h>IP Address
// =============
// <i> Local Static IP Address
// <i> Value 255.255.255.255 is not allowed.
// <i> It is a Broadcast IP address.
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define _IP1 192
// <o>Address byte 2 <0-255>
// <i> Default: 168
#define _IP2 168
// <o>Address byte 3 <0-255>
// <i> Default: 0
#define _IP3 0
// <o>Address byte 4 <0-255>
// <i> Default: 100
#define _IP4 100
// </h>
// <h>Subnet mask
// ==============
// <i> Local Subnet mask
// <o>Mask byte 1 <0-255>
// <i> Default: 255
#define _MSK1 255
// <o>Mask byte 2 <0-255>
// <i> Default: 255
#define _MSK2 255
// <o>Mask byte 3 <0-255>
// <i> Default: 255
#define _MSK3 255
// <o>Mask byte 4 <0-255>
// <i> Default: 0
#define _MSK4 0
// </h>
// <h>Default Gateway
// ==================
// <i> Default Gateway IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define _GW1 192
// <o>Address byte 2 <0-255>
// <i> Default: 168
#define _GW2 168
// <o>Address byte 3 <0-255>
// <i> Default: 0
#define _GW3 0
// <o>Address byte 4 <0-255>
// <i> Default: 254
#define _GW4 254
// </h>
// <h>Primary DNS Server
// =====================
// <i> Primary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _pDNS1 194
// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _pDNS2 25
// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _pDNS3 2
// <o>Address byte 4 <0-255>
// <i> Default: 129
#define _pDNS4 129
// </h>
// <h>Secondary DNS Server
// =======================
// <i> Secondary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _sDNS1 194
// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _sDNS2 25
// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _sDNS3 2
// <o>Address byte 4 <0-255>
// <i> Default: 130
#define _sDNS4 130
// </h>
// <h>ARP Definitions
// ==================
// <i> Address Resolution Protocol Definitions
// <o>Cache Table size <5-100>
// <i> Number of cached hardware/IP addresses
// <i> Default: 10
#define ARP_TABSIZE 10
// <o>Cache Timeout in seconds <5-255>
// <i> A timeout for a cached hardware/IP addresses
// <i> Default: 150
#define ARP_TIMEOUT 150
// <o>Number of Retries <0-20>
// <i> Number of Retries to resolve an IP address
// <i> before ARP module gives up
// <i> Default: 4
#define ARP_MAXRETRY 4
// <o>Resend Timeout in seconds <1-10>
// <i> A timeout to resend the ARP Request
// <i> Default: 2
#define ARP_RESEND 10
// <q>Send Notification on Address changes
// <i> When this option is enabled, the embedded host
// <i> will send a Gratuitous ARP notification at startup,
// <i> or when the device IP address has changed.
// <i> Default: Disabled
#define ARP_NOTIFY 1
// </h>
// <e>IGMP Group Management
// ========================
// <i> Enable or disable Internet Group Management Protocol
#define IGMP_ENABLE 0
// <o>Membership Table size <2-50>
// <i> Number of Groups this host can join
// <i> Default: 5
#define IGMP_TABSIZE 5
// </e>
// <q>NetBIOS Name Service
// =======================
// <i> When this option is enabled, the embedded host can be
// <i> accessed by his name on the local LAN using NBNS protocol.
// <i> You need to modify also the number of UDP Sockets,
// <i> because NBNS protocol uses one UDP socket to run.
#define NBNS_ENABLE 0
// <e>Dynamic Host Configuration
// =============================
// <i> When this option is enabled, local IP address, Net Mask
// <i> and Default Gateway are obtained automatically from
// <i> the DHCP Server on local LAN.
// <i> You need to modify also the number of UDP Sockets,
// <i> because DHCP protocol uses one UDP socket to run.
#define DHCP_ENABLE 1
// <s.40>Vendor Class Identifier
// <i> This value is optional. If specified, it is added
// <i> to DHCP request message, identifying vendor type.
// <i> Default: ""
#define DHCP_VCID ""
// <q>Bootfile Name
// <i> This value is optional. If enabled, the Bootfile Name
// <i> (option 67) is also requested from DHCP server.
// <i> Default: disabled
#define DHCP_BOOTF 1
// </e>
// </e>
// <e>PPP Network Interface
// ========================
// <i> Enable or disable PPP Network Interface
#define PPP_ENABLE 0
// <h>IP Address
// =============
// <i> Local Static IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define _IP1P 192
// <o>Address byte 2 <0-255>
// <i> Default: 168
#define _IP2P 168
// <o>Address byte 3 <0-255>
// <i> Default: 125
#define _IP3P 125
// <o>Address byte 4 <0-255>
// <i> Default: 1
#define _IP4P 1
// </h>
// <h>Subnet mask
// ==============
// <i> Local Subnet mask
// <o>Mask byte 1 <0-255>
// <i> Default: 255
#define _MSK1P 255
// <o>Mask byte 2 <0-255>
// <i> Default: 255
#define _MSK2P 255
// <o>Mask byte 3 <0-255>
// <i> Default: 255
#define _MSK3P 255
// <o>Mask byte 4 <0-255>
// <i> Default: 0
#define _MSK4P 0
// </h>
// <h>Primary DNS Server
// =====================
// <i> Primary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _pDNS1P 194
// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _pDNS2P 25
// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _pDNS3P 2
// <o>Address byte 4 <0-255>
// <i> Default: 129
#define _pDNS4P 129
// </h>
// <h>Secondary DNS Server
// =======================
// <i> Secondary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _sDNS1P 194
// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _sDNS2P 25
// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _sDNS3P 2
// <o>Address byte 4 <0-255>
// <i> Default: 130
#define _sDNS4P 130
// </h>
// <e>Logon Authentication
// =======================
// <i> Enable or disable user authentication
#define PPP_AUTHEN 1
// <q>Unsecured password (PAP)
// <i>Allow or use Password Authentication Protocol.
#define PPP_PAPEN 1
// <q>Secured password (CHAP-MD5)
// <i>Request or use Challenge Handshake Authentication
// <i>Protocol with MD5 digest algorithm.
#define PPP_CHAPEN 1
// </e>
// <q>Obtain Client IP address automatically
// =========================================
// <i> This option only applies when PPP Dial-up is used to dial
// <i> to remote PPP Server. If checked, network connection
// <i> dynamically obtains an IP address from remote PPP Server.
#define PPP_GETIP 1
// <q>Use Default Gateway on remote Network
// ========================================
// <i> This option only applies when both Ethernet and PPP Dial-up
// <i> are used. If checked, data that cannot be sent to local LAN
// <i> is forwarded to Dial-up network instead.
#define PPP_DEFGW 1
// <o>Async Control Character Map <0x0-0xffffffff>
// <i> A bit-map of control characters 0-31, which are
// <i> transmitted escaped as a 2 byte sequence.
// <i> For XON/XOFF set this value to: 0x000A 0000
// <i> Default: 0x00000000
#define PPP_ACCM 0x00000000
// <o>LCP Echo Interval in seconds <0-3600>
// <i> If no frames are received within this interval, PPP sends an
// <i> Echo Request and expects an Echo Response from the peer.
// <i> If the response is not received, the link is terminated.
// <i> A value of 0 disables the LCP Echo test.
// <i> Default: 30
#define PPP_ECHOTOUT 30
// <o>Number of Retries <0-20>
// <i> How many times PPP will try to retransmit data
// <i> before giving up. Increase this value for links
// <i> with low baud rates or high latency.
// <i> Default: 3
#define PPP_MAXRETRY 3
// <o>Retry Timeout in seconds <1-10>
// <i> If no response received within this time frame,
// <i> PPP module will try to resend the data again.
// <i> Default: 2
#define PPP_RETRYTOUT 2
// </e>
// <e>SLIP Network Interface
// ========================
// <i> Enable or disable SLIP Network Interface
#define SLIP_ENABLE 0
// <h>IP Address
// =============
// <i> Local Static IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define _IP1S 192
// <o>Address byte 2 <0-255>
// <i> Default: 168
#define _IP2S 168
// <o>Address byte 3 <0-255>
// <i> Default: 225
#define _IP3S 225
// <o>Address byte 4 <0-255>
// <i> Default: 1
#define _IP4S 1
// </h>
// <h>Subnet mask
// ==============
// <i> Local Subnet mask
// <o>Mask byte 1 <0-255>
// <i> Default: 255
#define _MSK1S 255
// <o>Mask byte 2 <0-255>
// <i> Default: 255
#define _MSK2S 255
// <o>Mask byte 3 <0-255>
// <i> Default: 255
#define _MSK3S 255
// <o>Mask byte 4 <0-255>
// <i> Default: 0
#define _MSK4S 0
// </h>
// <h>Primary DNS Server
// =====================
// <i> Primary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _pDNS1S 194
// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _pDNS2S 25
// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _pDNS3S 2
// <o>Address byte 4 <0-255>
// <i> Default: 129
#define _pDNS4S 129
// </h>
// <h>Secondary DNS Server
// =======================
// <i> Secondary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _sDNS1S 194
// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _sDNS2S 25
// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _sDNS3S 2
// <o>Address byte 4 <0-255>
// <i> Default: 130
#define _sDNS4S 130
// </h>
// <q>Use Default Gateway on remote Network
// ========================================
// <i> This option only applies when both Ethernet and SLIP Dial-up
// <i> are used. If checked, data that cannot be sent to local LAN
// <i> is forwarded to Dial-up network instead.
#define SLIP_DEFGW 1
// </e>
// <e>UDP Sockets
// ==============
// <i> Enable or disable UDP Sockets
#define UDP_ENABLE 1
// <o>Number of UDP Sockets <1-20>
// <i> Number of available UDP sockets
// <i> Default: 5
#define UDP_NUMSOCKS 20
// </e>
// <e>TCP Sockets
// ==============
// <i> Enable or disable TCP Sockets
#define TCP_ENABLE 1
// <o>Number of TCP Sockets <1-20>
// <i> Number of available TCP sockets
// <i> Default: 5
#define TCP_NUMSOCKS 10
// <o>Number of Retries <0-20>
// <i> How many times TCP module will try to retransmit data
// <i> before giving up. Increase this value for high-latency
// <i> and low_throughput networks.
// <i> Default: 5
#define TCP_MAXRETRY 20
// <o>Retry Timeout in seconds <1-10>
// <i> If data frame not acknowledged within this time frame,
// <i> TCP module will try to resend the data again.
// <i> Default: 4
#define TCP_RETRYTOUT 4
// <o>Default Connect Timeout in seconds <1-600>
// <i> Default TCP Socket Keep Alive timeout. When it expires
// <i> with no TCP data frame send, TCP Connection is closed.
// <i> Default: 120
#define TCP_DEFTOUT 120
// <o>Maximum Segment Size <536-1460>
// <i> The Maximum Segment Size specifies the maximum
// <i> number of bytes in the TCP segment's Data field.
// <i> Default: 1460
#define TCP_MAXSEGSZ 1460
/* TCP fixed timeouts */
#define TCP_INIT_RETRY_TOUT 1 /* TCP initial Retransmit period in sec. */
#define TCP_SYN_RETRY_TOUT 2 /* TCP SYN frame retransmit period in sec. */
#define TCP_CONRETRY 7 /* Number of retries to establish a conn. */
// </e>
// <e>HTTP Server
// ==============
// <i> Enable or disable HTTP Server
#define HTTP_ENABLE 0
// <o>Number of HTTP Sessions <1-10>
// <i> Number of simultaneously active HTTP Sessions.
// <i> Default: 3
#define HTTP_NUMSESS 3
// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 80
#define HTTP_PORTNUM 80
// <s.50>Server-Id header
// <i> This value is optional. If specified, it overrides
// <i> the default HTTP Server header from the library.
// <i> Default: ""
#define HTTP_SRVID ""
// <e>Enable User Authentication
// <i> When enabled, the user will have to authenticate
// <i> himself by username and password before accessing
// <i> any page on this Embedded WEB server.
#define HTTP_ENAUTH 1
// <s.20>Authentication Realm
// <i> Default: "Embedded WEB Server"
#define HTTP_AUTHREALM "Embedded WEB Server"
// <s.15>Authentication Username
// <i> Default: "admin"
#define HTTP_AUTHUSER "admin"
// <s.15>Authentication Password
// <i> Default: ""
#define HTTP_AUTHPASSW ""
// </e>
// </e>
// <e>Telnet Server
// ================
// <i> Enable or disable Telnet Server
#define TNET_ENABLE 0
// <o>Number of Telnet Connections <1-10>
// <i> Number of simultaneously active Telnet Connections.
// <i> Default: 1
#define TNET_NUMSESS 1
// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 23
#define TNET_PORTNUM 23
// <o>Idle Connection Timeout in seconds <0-3600>
// <i> When timeout expires, the connection is closed.
// <i> A value of 0 disables disconnection on timeout.
// <i> Default: 120
#define TNET_IDLETOUT 120
// <q>Disable Echo
// <i> When disabled, the server will not echo
// <i> characters it receives.
// <i> Default: Not disabled
#define TNET_NOECHO 0
// <e>Enable User Authentication
// <i> When enabled, the user will have to authenticate
// <i> himself by username and password before access
// <i> to the system is allowed.
#define TNET_ENAUTH 1
// <s.15>Authentication Username
// <i> Default: "admin"
#define TNET_AUTHUSER "admin"
// <s.15>Authentication Password
// <i> Default: ""
#define TNET_AUTHPASSW ""
// </e>
// </e>
// <e>TFTP Server
// ==============
// <i> Enable or disable TFTP Server
#define TFTP_ENABLE 0
// <o>Number of TFTP Sessions <1-10>
// <i> Number of simultaneously active TFTP Sessions
// <i> Default: 1
#define TFTP_NUMSESS 1
// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 69
#define TFTP_PORTNUM 69
// <q>Enable Firewall Support
// <i> Use the same Port Number to receive
// <i> requests and send answers to clients.
// <i> Default: Not Enabled
#define TFTP_ENFWALL 0
// <o>Inactive Session Timeout in seconds <5-120>
// <i> When timeout expires TFTP Session is closed.
// <i> Default: 15
#define TFTP_DEFTOUT 15
// <o>Number of Retries <1-10>
// <i> How many times TFTP Server will try to
// <i> retransmit the data before giving up.
// <i> Default: 4
#define TFTP_MAXRETRY 4
// </e>
// <e>TFTP Client
// ==============
// <i> Enable or disable TFTP Client
#define TFTPC_ENABLE 0
// <o>Block Size <128=>128 <256=>256 <512=>512
// <1024=>1024 <1428=>1428
// <i> Size of transfer block in bytes.
// <i> Default: 512
#define TFTPC_BLOCKSZ 512
// <o>Number of Retries <1-10>
// <i> How many times TFTP Client will try to
// <i> retransmit the data before giving up.
// <i> Default: 4
#define TFTPC_MAXRETRY 4
// <o>Retry Timeout <2=>200 ms <5=>500 ms <10=>1 sec
// <20=>2 sec <50=>5 sec <100=>10 sec
// <i> If data frame not acknowledged within this time frame,
// <i> TFTP Client will try to resend the data again.
// <i> Default: 500 ms
#define TFTPC_RETRYTO 5
// </e>
// <e>FTP Server
// ==============
// <i> Enable or disable FTP Server
#define FTP_ENABLE 0
// <o>Number of FTP Sessions <1-10>
// <i> Number of simultaneously active FTP Sessions
// <i> Default: 1
#define FTP_NUMSESS 1
// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 21
#define FTP_PORTNUM 21
// <s.50>Welcome Message
// <i> This value is optional. If specified,
// <i> it overrides the default welcome message.
// <i> Default: ""
#define FTP_WELMSG ""
// <o>Idle Session Timeout in seconds <0-3600>
// <i> When timeout expires, the connection is closed.
// <i> A value of 0 disables disconnection on timeout.
// <i> Default: 120
#define FTP_IDLETOUT 120
// <e>Enable User Authentication
// <i> When enabled, the user will have to authenticate
// <i> himself by username and password before access
// <i> to the system is allowed.
#define FTP_ENAUTH 1
// <s.15>Authentication Username
// <i> Default: "admin"
#define FTP_AUTHUSER "admin"
// <s.15>Authentication Password
// <i> Default: ""
#define FTP_AUTHPASSW ""
// </e>
// </e>
// <e>FTP Client
// =============
// <i> Enable or disable FTP Client
#define FTPC_ENABLE 0
// <o>Response Timeout in seconds <1-120>
// <i> This is a time for FTP Client to wait for a response from
// <i> the Server. If timeout expires, Client aborts operation.
// <i> Default: 10
#define FTPC_DEFTOUT 10
// <q>Passive mode (PASV)
// <i> The client initiates a data connection to the server.
// <i> Default: Not passive (Active)
#define FTPC_PASVMODE 0
// </e>
// <e>DNS Client
// =============
// <i> Enable or disable DNS Client
#define DNS_ENABLE 1
// <o>Cache Table size <5-100>
// <i> Number of cached DNS host names/IP addresses
// <i> Default: 20
#define DNS_TABSIZE 20
// </e>
// <e>SMTP Client
// ==============
// <i> Enable or disable SMTP Client
#define SMTP_ENABLE 0
// <o>Response Timeout in seconds <5-120>
// <i> This is a time for SMTP Client to wait for a response from
// <i> SMTP Server. If timeout expires, Client aborts operation.
// <i> Default: 20
#define SMTP_DEFTOUT 20
// </e>
// <e>SNMP Agent
// =============
// <i> Enable or disable SNMP Agent
#define SNMP_ENABLE 0
// <s.15>Community Name
// <i> Defines where an SNMP message is destined for.
// <i> Default: "public"
#define SNMP_COMMUNITY "public"
// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 161
#define SNMP_PORTNUM 161
// <o>Trap Port Number <1-65535>
// <i> Port number for Trap operations.
// <i> Default: 162
#define SNMP_TRAPPORT 162
// <h>Trap Server
// ==============
// <i> Trap Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define SNMP_TRAPIP1 192
// <o>Address byte 2 <0-255>
// <i> Default: 168
#define SNMP_TRAPIP2 168
// <o>Address byte 3 <0-255>
// <i> Default: 0
#define SNMP_TRAPIP3 0
// <o>Address byte 4 <0-255>
// <i> Default: 100
#define SNMP_TRAPIP4 100
// </h>
// </e>
// <e>BSD Socket Interface
// =======================
// <i> Enable or disable Berkeley Socket Programming Interface
#define BSD_ENABLE 1
// <o>Number of BSD Sockets <1-20>
// <i> Number of available Berkeley Sockets
// <i> Default: 2
#define BSD_NUMSOCKS 10
// <o>Number of Streaming Server Sockets <0-20>
// <i> Defines a number of Streaming (TCP) Server sockets,
// <i> that listen for an incoming connection from the client.
// <i> Default: 1
#define BSD_SRVSOCKS 2
// <o>Receive Timeout in seconds <0-600>
// <i> A timeout for socket receive in blocking mode.
// <i> Timeout value of 0 means indefinite timeout.
// <i> Default: 20
#define BSD_RCVTOUT 20
// <q>Hostname Resolver
// <i> Enable or disable Berkeley style hostname resolver.
#define BSD_GETHOSTEN 1
// </e>
//------------- <<< end of configuration section >>> -----------------------
/*----------------------------------------------------------------------------
* Fatal Error Handler
*---------------------------------------------------------------------------*/
void sys_error (ERROR_CODE code) {
/* This function is called when a fatal error is encountered. The normal */
/* program execution is not possible anymore. Add your crytical error .*/
/* handler code here. */
switch (code) {
case ERR_MEM_ALLOC:
/* Out of memory. */
break;
case ERR_MEM_FREE:
/* Trying to release non existing memory block. */
break;
case ERR_MEM_CORRUPT:
/* Memory Link pointer is Corrupted. */
/* More data written than the size of allocated mem block. */
break;
case ERR_MEM_LOCK:
/* Locked Memory management function (alloc/free) re-entered. */
/* RTX multithread protection malfunctioning, not implemented */
/* or interrupt disable is not functioning correctly. */
break;
case ERR_UDP_ALLOC:
/* Out of UDP Sockets. */
break;
case ERR_TCP_ALLOC:
/* Out of TCP Sockets. */
break;
case ERR_TCP_STATE:
/* TCP State machine in undefined state. */
break;
}
/* End-less loop */
while (1);
}
/*----------------------------------------------------------------------------
* TCPnet Config Functions
*---------------------------------------------------------------------------*/
#define __NET_CONFIG__
#include <Net_lib.c>
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,139 @@
/*----------------------------------------------------------------------------
* RL-ARM - TCPnet
*----------------------------------------------------------------------------
* Name: NET_DEBUG.C
* Purpose: Debug Module
* Rev.: V4.60
*----------------------------------------------------------------------------
* This code is part of the RealView Run-Time Library.
* Copyright (c) 2004-2012 KEIL - An ARM Company. All rights reserved.
*---------------------------------------------------------------------------*/
#include <Net_Config.h>
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
// <q>Print Time Stamp
// ===================
// <i> Enable printing the time-info in debug messages
#define DBG_TIME 1
// <h>TCPnet Debug Definitions
// ===========================
// <o>Memory Management Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off Dynamic Memory debug messages
#define DBG_MEM 1
// <o>Ethernet Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off Ethernet debug messages
#define DBG_ETH 1
// <o>PPP Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off PPP debug messages
#define DBG_PPP 0
// <o>SLIP Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off SLIP debug messages
#define DBG_SLIP 0
// <o>ARP Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off ARP debug messages
#define DBG_ARP 1
// <o>IP Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off IP debug messages
#define DBG_IP 1
// <o>ICMP Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off ICMP debug messages
#define DBG_ICMP 1
// <o>IGMP Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off IGMP debug messages
#define DBG_IGMP 1
// <o>UDP Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off UDP debug messages
#define DBG_UDP 1
// <o>TCP Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off TCP debug messages
#define DBG_TCP 2
// <o>NBNS Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off NetBIOS Name Service debug messages
#define DBG_NBNS 1
// <o>DHCP Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off Dynamic Host Configuration debug messages
#define DBG_DHCP 2
// <o>DNS Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off Domain Name Service debug messages
#define DBG_DNS 1
// <o>SNMP Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off Simple Network Management debug messages
#define DBG_SNMP 1
// <o>BSD Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off BSD Interface debug messages
#define DBG_BSD 2
// </h>
// <h>Application Debug Definitions
// ================================
// <o>HTTP Server Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off Web Server debug messages
#define DBG_HTTP 1
// <o>FTP Server Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off FTP Server debug messages
#define DBG_FTP 1
// <o>FTP Client Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off FTP Client debug messages
#define DBG_FTPC 1
// <o>Telnet Server Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off Telnet Server debug messages
#define DBG_TNET 1
// <o>TFTP Server Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off TFTP Server debug messages
#define DBG_TFTP 1
// <o>TFTP Client Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off TFTP Client debug messages
#define DBG_TFTPC 1
// <o>SMTP Client Debug <0=> Off <1=> Errors only <2=> Full debug
// <i> Turn On/Off SMTP Client debug messages
#define DBG_SMTP 1
// </h>
//------------- <<< end of configuration section >>> -----------------------
/*--------------------------- init_debug ------------------------------------*/
void init_debug (void) {
/* Add your code to initialize the Debug output. This is usually the */
/* serial interface. The function is called at TCPnet system startup. */
/* You may need to customize also the 'putchar()' function. */
}
/*----------------------------------------------------------------------------
* TCPnet Debug Functions
*---------------------------------------------------------------------------*/
#define __NET_DEBUG__
#include <Net_lib.c>
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,205 @@
/*----------------------------------------------------------------------------
* RL-ARM - RTX
*----------------------------------------------------------------------------
* Name: RTX_CONFIG.C
* Purpose: Configuration of RTX Kernel for Cortex-M
* Rev.: V4.60
*----------------------------------------------------------------------------
* This code is part of the RealView Run-Time Library.
* Copyright (c) 2004-2012 KEIL - An ARM Company. All rights reserved.
*---------------------------------------------------------------------------*/
#include <RTL.h>
/*----------------------------------------------------------------------------
* RTX User configuration part BEGIN
*---------------------------------------------------------------------------*/
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
//
// <h>Task Configuration
// =====================
//
// <o>Number of concurrent running tasks <0-250>
// <i> Define max. number of tasks that will run at the same time.
// <i> Default: 6
#ifndef OS_TASKCNT
#define OS_TASKCNT 6
#endif
// <o>Number of tasks with user-provided stack <0-250>
// <i> Define the number of tasks that will use a bigger stack.
// <i> The memory space for the stack is provided by the user.
// <i> Default: 0
#ifndef OS_PRIVCNT
#define OS_PRIVCNT 2
#endif
// <o>Task stack size [bytes] <20-4096:8><#/4>
// <i> Set the stack size for tasks which is assigned by the system.
// <i> Default: 512
#ifndef OS_STKSIZE
#define OS_STKSIZE 499
#endif
// <q>Check for the stack overflow
// ===============================
// <i> Include the stack checking code for a stack overflow.
// <i> Note that additional code reduces the Kernel performance.
#ifndef OS_STKCHECK
#define OS_STKCHECK 1
#endif
// <q>Run in privileged mode
// =========================
// <i> Run all Tasks in privileged mode.
// <i> Default: Unprivileged
#ifndef OS_RUNPRIV
#define OS_RUNPRIV 1
#endif
// </h>
// <h>Tick Timer Configuration
// =============================
// <o>Hardware timer <0=> Core SysTick <1=> Peripheral Timer
// <i> Define the on-chip timer used as a time-base for RTX.
// <i> Default: Core SysTick
#ifndef OS_TIMER
#define OS_TIMER 0
#endif
// <o>Timer clock value [Hz] <1-1000000000>
// <i> Set the timer clock value for selected timer.
// <i> Default: 6000000 (6MHz)
#ifndef OS_CLOCK
#define OS_CLOCK 120000000
#endif
// <o>Timer tick value [us] <1-1000000>
// <i> Set the timer tick value for selected timer.
// <i> Default: 10000 (10ms)
#ifndef OS_TICK
#define OS_TICK 1000
#endif
// </h>
// <h>System Configuration
// =======================
// <e>Round-Robin Task switching
// =============================
// <i> Enable Round-Robin Task switching.
#ifndef OS_ROBIN
#define OS_ROBIN 1
#endif
// <o>Round-Robin Timeout [ticks] <1-1000>
// <i> Define how long a task will execute before a task switch.
// <i> Default: 5
#ifndef OS_ROBINTOUT
#define OS_ROBINTOUT 5
#endif
// </e>
// <o>Number of user timers <0-250>
// <i> Define max. number of user timers that will run at the same time.
// <i> Default: 0 (User timers disabled)
#ifndef OS_TIMERCNT
#define OS_TIMERCNT 1
#endif
// <o>ISR FIFO Queue size<4=> 4 entries <8=> 8 entries
// <12=> 12 entries <16=> 16 entries
// <24=> 24 entries <32=> 32 entries
// <48=> 48 entries <64=> 64 entries
// <96=> 96 entries
// <i> ISR functions store requests to this buffer,
// <i> when they are called from the iterrupt handler.
// <i> Default: 16 entries
#ifndef OS_FIFOSZ
#define OS_FIFOSZ 16
#endif
// </h>
//------------- <<< end of configuration section >>> -----------------------
// Standard library system mutexes
// ===============================
// Define max. number system mutexes that are used to protect
// the arm standard runtime library. For microlib they are not used.
#ifndef OS_MUTEXCNT
#define OS_MUTEXCNT 8
#endif
/*----------------------------------------------------------------------------
* RTX User configuration part END
*---------------------------------------------------------------------------*/
#define OS_TRV ((U32)(((double)OS_CLOCK*(double)OS_TICK)/1E6)-1)
/*----------------------------------------------------------------------------
* Global Functions
*---------------------------------------------------------------------------*/
/*--------------------------- os_idle_demon ---------------------------------*/
__task void os_idle_demon (void) {
/* The idle demon is a system task, running when no other task is ready */
/* to run. The 'os_xxx' function calls are not allowed from this task. */
for (;;) {
/* HERE: include optional user code to be executed when no task runs.*/
}
}
/*--------------------------- os_tick_init ----------------------------------*/
#if (OS_TIMER != 0)
int os_tick_init (void) {
/* Initialize hardware timer as system tick timer. */
/* ... */
return (-1); /* Return IRQ number of timer (0..239) */
}
#endif
/*--------------------------- os_tick_irqack --------------------------------*/
#if (OS_TIMER != 0)
void os_tick_irqack (void) {
/* Acknowledge timer interrupt. */
/* ... */
}
#endif
/*--------------------------- os_tmr_call -----------------------------------*/
void os_tmr_call (U16 info) {
/* This function is called when the user timer has expired. Parameter */
/* 'info' holds the value, defined when the timer was created. */
/* HERE: include optional user code to be executed on timeout. */
}
/*--------------------------- os_error --------------------------------------*/
void os_error (U32 err_code) {
/* This function is called when a runtime error is detected. Parameter */
/* 'err_code' holds the runtime error code (defined in RTL.H). */
/* HERE: include optional code to be executed on runtime error. */
for (;;);
}
/*----------------------------------------------------------------------------
* RTX Configuration Functions
*---------------------------------------------------------------------------*/
#include <RTX_lib.c>
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,36 @@
/******************************************************************************/
/* STM32_SWO.ini: STM32 Debugger Initialization File */
/******************************************************************************/
// <<< Use Configuration Wizard in Context Menu >>> //
/******************************************************************************/
/* This file is part of the uVision/ARM development tools. */
/* Copyright (c) 2005-2009 Keil Software. All rights reserved. */
/* This software may only be used under the terms of a valid, current, */
/* end user licence from KEIL for a compatible version of KEIL software */
/* development tools. Nothing else gives you the right to use this software. */
/******************************************************************************/
FUNC void DebugSetup (void) {
// <h> Debug MCU Configuration
// <o1.0> DBG_SLEEP <i> Debug Sleep Mode
// <o1.1> DBG_STOP <i> Debug Stop Mode
// <o1.2> DBG_STANDBY <i> Debug Standby Mode
// <o1.5> TRACE_IOEN <i> Trace I/O Enable
// <o1.6..7> TRACE_MODE <i> Trace Mode
// <0=> Asynchronous
// <1=> Synchronous: TRACEDATA Size 1
// <2=> Synchronous: TRACEDATA Size 2
// <3=> Synchronous: TRACEDATA Size 4
// <o1.8> DBG_IWDG_STOP <i> Independant Watchdog Stopped when Core is halted
// <o1.9> DBG_WWDG_STOP <i> Window Watchdog Stopped when Core is halted
// <o1.10> DBG_TIM1_STOP <i> Timer 1 Stopped when Core is halted
// <o1.11> DBG_TIM2_STOP <i> Timer 2 Stopped when Core is halted
// <o1.12> DBG_TIM3_STOP <i> Timer 3 Stopped when Core is halted
// <o1.13> DBG_TIM4_STOP <i> Timer 4 Stopped when Core is halted
// <o1.14> DBG_CAN_STOP <i> CAN Stopped when Core is halted
// </h>
_WDWORD(0xE0042004, 0x00000027); // DBGMCU_CR
}
DebugSetup(); // Debugger Setup

View File

@ -0,0 +1,419 @@
;******************** (C) COPYRIGHT 2011 STMicroelectronics ********************
;* File Name : startup_stm32f2xx.s
;* Author : MCD Application Team
;* Version : V1.0.0
;* Date : 18-April-2011
;* Description : STM32F2xx devices vector table for MDK-ARM toolchain.
;* This module performs:
;* - Set the initial SP
;* - Set the initial PC == Reset_Handler
;* - Set the vector table entries with the exceptions ISR address
;* - Branches to __main in the C library (which eventually
;* calls main()).
;* After Reset the CortexM3 processor is in Thread mode,
;* priority is Privileged, and the Stack is set to Main.
;* <<< Use Configuration Wizard in Context Menu >>>
;*******************************************************************************
; THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
; WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
; AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
; INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
; CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
; INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
;*******************************************************************************
; Amount of memory (in bytes) allocated for Stack
; Tailor this value to your application needs
; <h> Stack Configuration
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Stack_Size EQU 0x00001000
AREA STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem SPACE Stack_Size
__initial_sp
; <h> Heap Configuration
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Heap_Size EQU 0x00009000
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem SPACE Heap_Size
__heap_limit
PRESERVE8
THUMB
; Vector Table Mapped to Address 0 at Reset
AREA RESET, DATA, READONLY
EXPORT __Vectors
EXPORT __Vectors_End
EXPORT __Vectors_Size
__Vectors DCD __initial_sp ; Top of Stack
DCD Reset_Handler ; Reset Handler
DCD NMI_Handler ; NMI Handler
DCD HardFault_Handler ; Hard Fault Handler
DCD MemManage_Handler ; MPU Fault Handler
DCD BusFault_Handler ; Bus Fault Handler
DCD UsageFault_Handler ; Usage Fault Handler
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD SVC_Handler ; SVCall Handler
DCD DebugMon_Handler ; Debug Monitor Handler
DCD 0 ; Reserved
DCD PendSV_Handler ; PendSV Handler
DCD SysTick_Handler ; SysTick Handler
; External Interrupts
DCD WWDG_IRQHandler ; Window WatchDog
DCD PVD_IRQHandler ; PVD through EXTI Line detection
DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line
DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line
DCD FLASH_IRQHandler ; FLASH
DCD RCC_IRQHandler ; RCC
DCD EXTI0_IRQHandler ; EXTI Line0
DCD EXTI1_IRQHandler ; EXTI Line1
DCD EXTI2_IRQHandler ; EXTI Line2
DCD EXTI3_IRQHandler ; EXTI Line3
DCD EXTI4_IRQHandler ; EXTI Line4
DCD DMA1_Stream0_IRQHandler ; DMA1 Stream 0
DCD DMA1_Stream1_IRQHandler ; DMA1 Stream 1
DCD DMA1_Stream2_IRQHandler ; DMA1 Stream 2
DCD DMA1_Stream3_IRQHandler ; DMA1 Stream 3
DCD DMA1_Stream4_IRQHandler ; DMA1 Stream 4
DCD DMA1_Stream5_IRQHandler ; DMA1 Stream 5
DCD DMA1_Stream6_IRQHandler ; DMA1 Stream 6
DCD ADC_IRQHandler ; ADC1, ADC2 and ADC3s
DCD CAN1_TX_IRQHandler ; CAN1 TX
DCD CAN1_RX0_IRQHandler ; CAN1 RX0
DCD CAN1_RX1_IRQHandler ; CAN1 RX1
DCD CAN1_SCE_IRQHandler ; CAN1 SCE
DCD EXTI9_5_IRQHandler ; External Line[9:5]s
DCD TIM1_BRK_TIM9_IRQHandler ; TIM1 Break and TIM9
DCD TIM1_UP_TIM10_IRQHandler ; TIM1 Update and TIM10
DCD TIM1_TRG_COM_TIM11_IRQHandler ; TIM1 Trigger and Commutation and TIM11
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
DCD TIM2_IRQHandler ; TIM2
DCD TIM3_IRQHandler ; TIM3
DCD TIM4_IRQHandler ; TIM4
DCD I2C1_EV_IRQHandler ; I2C1 Event
DCD I2C1_ER_IRQHandler ; I2C1 Error
DCD I2C2_EV_IRQHandler ; I2C2 Event
DCD I2C2_ER_IRQHandler ; I2C2 Error
DCD SPI1_IRQHandler ; SPI1
DCD SPI2_IRQHandler ; SPI2
DCD USART1_IRQHandler ; USART1
DCD USART2_IRQHandler ; USART2
DCD USART3_IRQHandler ; USART3
DCD EXTI15_10_IRQHandler ; External Line[15:10]s
DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line
DCD OTG_FS_WKUP_IRQHandler ; USB OTG FS Wakeup through EXTI line
DCD TIM8_BRK_TIM12_IRQHandler ; TIM8 Break and TIM12
DCD TIM8_UP_TIM13_IRQHandler ; TIM8 Update and TIM13
DCD TIM8_TRG_COM_TIM14_IRQHandler ; TIM8 Trigger and Commutation and TIM14
DCD TIM8_CC_IRQHandler ; TIM8 Capture Compare
DCD DMA1_Stream7_IRQHandler ; DMA1 Stream7
DCD FSMC_IRQHandler ; FSMC
DCD SDIO_IRQHandler ; SDIO
DCD TIM5_IRQHandler ; TIM5
DCD SPI3_IRQHandler ; SPI3
DCD UART4_IRQHandler ; UART4
DCD UART5_IRQHandler ; UART5
DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors
DCD TIM7_IRQHandler ; TIM7
DCD DMA2_Stream0_IRQHandler ; DMA2 Stream 0
DCD DMA2_Stream1_IRQHandler ; DMA2 Stream 1
DCD DMA2_Stream2_IRQHandler ; DMA2 Stream 2
DCD DMA2_Stream3_IRQHandler ; DMA2 Stream 3
DCD DMA2_Stream4_IRQHandler ; DMA2 Stream 4
DCD ETH_IRQHandler ; Ethernet
DCD ETH_WKUP_IRQHandler ; Ethernet Wakeup through EXTI line
DCD CAN2_TX_IRQHandler ; CAN2 TX
DCD CAN2_RX0_IRQHandler ; CAN2 RX0
DCD CAN2_RX1_IRQHandler ; CAN2 RX1
DCD CAN2_SCE_IRQHandler ; CAN2 SCE
DCD OTG_FS_IRQHandler ; USB OTG FS
DCD DMA2_Stream5_IRQHandler ; DMA2 Stream 5
DCD DMA2_Stream6_IRQHandler ; DMA2 Stream 6
DCD DMA2_Stream7_IRQHandler ; DMA2 Stream 7
DCD USART6_IRQHandler ; USART6
DCD I2C3_EV_IRQHandler ; I2C3 event
DCD I2C3_ER_IRQHandler ; I2C3 error
DCD OTG_HS_EP1_OUT_IRQHandler ; USB OTG HS End Point 1 Out
DCD OTG_HS_EP1_IN_IRQHandler ; USB OTG HS End Point 1 In
DCD OTG_HS_WKUP_IRQHandler ; USB OTG HS Wakeup through EXTI
DCD OTG_HS_IRQHandler ; USB OTG HS
DCD DCMI_IRQHandler ; DCMI
DCD CRYP_IRQHandler ; CRYP crypto
DCD HASH_RNG_IRQHandler ; Hash and Rng
__Vectors_End
__Vectors_Size EQU __Vectors_End - __Vectors
AREA |.text|, CODE, READONLY
; Reset handler
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
; Dummy Exception Handlers (infinite loops which can be modified)
NMI_Handler PROC
EXPORT NMI_Handler [WEAK]
B .
ENDP
HardFault_Handler\
PROC
EXPORT HardFault_Handler [WEAK]
B .
ENDP
MemManage_Handler\
PROC
EXPORT MemManage_Handler [WEAK]
B .
ENDP
BusFault_Handler\
PROC
EXPORT BusFault_Handler [WEAK]
B .
ENDP
UsageFault_Handler\
PROC
EXPORT UsageFault_Handler [WEAK]
B .
ENDP
SVC_Handler PROC
EXPORT SVC_Handler [WEAK]
B .
ENDP
DebugMon_Handler\
PROC
EXPORT DebugMon_Handler [WEAK]
B .
ENDP
PendSV_Handler PROC
EXPORT PendSV_Handler [WEAK]
B .
ENDP
SysTick_Handler PROC
EXPORT SysTick_Handler [WEAK]
B .
ENDP
Default_Handler PROC
EXPORT WWDG_IRQHandler [WEAK]
EXPORT PVD_IRQHandler [WEAK]
EXPORT TAMP_STAMP_IRQHandler [WEAK]
EXPORT RTC_WKUP_IRQHandler [WEAK]
EXPORT FLASH_IRQHandler [WEAK]
EXPORT RCC_IRQHandler [WEAK]
EXPORT EXTI0_IRQHandler [WEAK]
EXPORT EXTI1_IRQHandler [WEAK]
EXPORT EXTI2_IRQHandler [WEAK]
EXPORT EXTI3_IRQHandler [WEAK]
EXPORT EXTI4_IRQHandler [WEAK]
EXPORT DMA1_Stream0_IRQHandler [WEAK]
EXPORT DMA1_Stream1_IRQHandler [WEAK]
EXPORT DMA1_Stream2_IRQHandler [WEAK]
EXPORT DMA1_Stream3_IRQHandler [WEAK]
EXPORT DMA1_Stream4_IRQHandler [WEAK]
EXPORT DMA1_Stream5_IRQHandler [WEAK]
EXPORT DMA1_Stream6_IRQHandler [WEAK]
EXPORT ADC_IRQHandler [WEAK]
EXPORT CAN1_TX_IRQHandler [WEAK]
EXPORT CAN1_RX0_IRQHandler [WEAK]
EXPORT CAN1_RX1_IRQHandler [WEAK]
EXPORT CAN1_SCE_IRQHandler [WEAK]
EXPORT EXTI9_5_IRQHandler [WEAK]
EXPORT TIM1_BRK_TIM9_IRQHandler [WEAK]
EXPORT TIM1_UP_TIM10_IRQHandler [WEAK]
EXPORT TIM1_TRG_COM_TIM11_IRQHandler [WEAK]
EXPORT TIM1_CC_IRQHandler [WEAK]
EXPORT TIM2_IRQHandler [WEAK]
EXPORT TIM3_IRQHandler [WEAK]
EXPORT TIM4_IRQHandler [WEAK]
EXPORT I2C1_EV_IRQHandler [WEAK]
EXPORT I2C1_ER_IRQHandler [WEAK]
EXPORT I2C2_EV_IRQHandler [WEAK]
EXPORT I2C2_ER_IRQHandler [WEAK]
EXPORT SPI1_IRQHandler [WEAK]
EXPORT SPI2_IRQHandler [WEAK]
EXPORT USART1_IRQHandler [WEAK]
EXPORT USART2_IRQHandler [WEAK]
EXPORT USART3_IRQHandler [WEAK]
EXPORT EXTI15_10_IRQHandler [WEAK]
EXPORT RTC_Alarm_IRQHandler [WEAK]
EXPORT OTG_FS_WKUP_IRQHandler [WEAK]
EXPORT TIM8_BRK_TIM12_IRQHandler [WEAK]
EXPORT TIM8_UP_TIM13_IRQHandler [WEAK]
EXPORT TIM8_TRG_COM_TIM14_IRQHandler [WEAK]
EXPORT TIM8_CC_IRQHandler [WEAK]
EXPORT DMA1_Stream7_IRQHandler [WEAK]
EXPORT FSMC_IRQHandler [WEAK]
EXPORT SDIO_IRQHandler [WEAK]
EXPORT TIM5_IRQHandler [WEAK]
EXPORT SPI3_IRQHandler [WEAK]
EXPORT UART4_IRQHandler [WEAK]
EXPORT UART5_IRQHandler [WEAK]
EXPORT TIM6_DAC_IRQHandler [WEAK]
EXPORT TIM7_IRQHandler [WEAK]
EXPORT DMA2_Stream0_IRQHandler [WEAK]
EXPORT DMA2_Stream1_IRQHandler [WEAK]
EXPORT DMA2_Stream2_IRQHandler [WEAK]
EXPORT DMA2_Stream3_IRQHandler [WEAK]
EXPORT DMA2_Stream4_IRQHandler [WEAK]
EXPORT ETH_IRQHandler [WEAK]
EXPORT ETH_WKUP_IRQHandler [WEAK]
EXPORT CAN2_TX_IRQHandler [WEAK]
EXPORT CAN2_RX0_IRQHandler [WEAK]
EXPORT CAN2_RX1_IRQHandler [WEAK]
EXPORT CAN2_SCE_IRQHandler [WEAK]
EXPORT OTG_FS_IRQHandler [WEAK]
EXPORT DMA2_Stream5_IRQHandler [WEAK]
EXPORT DMA2_Stream6_IRQHandler [WEAK]
EXPORT DMA2_Stream7_IRQHandler [WEAK]
EXPORT USART6_IRQHandler [WEAK]
EXPORT I2C3_EV_IRQHandler [WEAK]
EXPORT I2C3_ER_IRQHandler [WEAK]
EXPORT OTG_HS_EP1_OUT_IRQHandler [WEAK]
EXPORT OTG_HS_EP1_IN_IRQHandler [WEAK]
EXPORT OTG_HS_WKUP_IRQHandler [WEAK]
EXPORT OTG_HS_IRQHandler [WEAK]
EXPORT DCMI_IRQHandler [WEAK]
EXPORT CRYP_IRQHandler [WEAK]
EXPORT HASH_RNG_IRQHandler [WEAK]
WWDG_IRQHandler
PVD_IRQHandler
TAMP_STAMP_IRQHandler
RTC_WKUP_IRQHandler
FLASH_IRQHandler
RCC_IRQHandler
EXTI0_IRQHandler
EXTI1_IRQHandler
EXTI2_IRQHandler
EXTI3_IRQHandler
EXTI4_IRQHandler
DMA1_Stream0_IRQHandler
DMA1_Stream1_IRQHandler
DMA1_Stream2_IRQHandler
DMA1_Stream3_IRQHandler
DMA1_Stream4_IRQHandler
DMA1_Stream5_IRQHandler
DMA1_Stream6_IRQHandler
ADC_IRQHandler
CAN1_TX_IRQHandler
CAN1_RX0_IRQHandler
CAN1_RX1_IRQHandler
CAN1_SCE_IRQHandler
EXTI9_5_IRQHandler
TIM1_BRK_TIM9_IRQHandler
TIM1_UP_TIM10_IRQHandler
TIM1_TRG_COM_TIM11_IRQHandler
TIM1_CC_IRQHandler
TIM2_IRQHandler
TIM3_IRQHandler
TIM4_IRQHandler
I2C1_EV_IRQHandler
I2C1_ER_IRQHandler
I2C2_EV_IRQHandler
I2C2_ER_IRQHandler
SPI1_IRQHandler
SPI2_IRQHandler
USART1_IRQHandler
USART2_IRQHandler
USART3_IRQHandler
EXTI15_10_IRQHandler
RTC_Alarm_IRQHandler
OTG_FS_WKUP_IRQHandler
TIM8_BRK_TIM12_IRQHandler
TIM8_UP_TIM13_IRQHandler
TIM8_TRG_COM_TIM14_IRQHandler
TIM8_CC_IRQHandler
DMA1_Stream7_IRQHandler
FSMC_IRQHandler
SDIO_IRQHandler
TIM5_IRQHandler
SPI3_IRQHandler
UART4_IRQHandler
UART5_IRQHandler
TIM6_DAC_IRQHandler
TIM7_IRQHandler
DMA2_Stream0_IRQHandler
DMA2_Stream1_IRQHandler
DMA2_Stream2_IRQHandler
DMA2_Stream3_IRQHandler
DMA2_Stream4_IRQHandler
ETH_IRQHandler
ETH_WKUP_IRQHandler
CAN2_TX_IRQHandler
CAN2_RX0_IRQHandler
CAN2_RX1_IRQHandler
CAN2_SCE_IRQHandler
OTG_FS_IRQHandler
DMA2_Stream5_IRQHandler
DMA2_Stream6_IRQHandler
DMA2_Stream7_IRQHandler
USART6_IRQHandler
I2C3_EV_IRQHandler
I2C3_ER_IRQHandler
OTG_HS_EP1_OUT_IRQHandler
OTG_HS_EP1_IN_IRQHandler
OTG_HS_WKUP_IRQHandler
OTG_HS_IRQHandler
DCMI_IRQHandler
CRYP_IRQHandler
HASH_RNG_IRQHandler
B .
ENDP
ALIGN
;*******************************************************************************
; User Stack and Heap initialization
;*******************************************************************************
IF :DEF:__MICROLIB
EXPORT __initial_sp
EXPORT __heap_base
EXPORT __heap_limit
ELSE
IMPORT __use_two_region_memory
EXPORT __user_initial_stackheap
__user_initial_stackheap
LDR R0, = Heap_Mem
LDR R1, =(Stack_Mem + Stack_Size)
LDR R2, = (Heap_Mem + Heap_Size)
LDR R3, = Stack_Mem
BX LR
ALIGN
ENDIF
END
;******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE*****

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,185 @@
/* main.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "time.h"
#include "stm32f2xx_tim.h"
#include "stm32f2xx_rcc.h"
/*-----------------------------------------------------------------------------
* initialize RTC
*----------------------------------------------------------------------------*/
#include "stm32f2xx_rtc.h"
#include "stm32f2xx_rcc.h"
#include "stm32f2xx_pwr.h"
static init_RTC()
{
RTC_InitTypeDef RTC_InitStruct ;
RTC_TimeTypeDef RTC_Time ;
RTC_DateTypeDef RTC_Date ;
/* Enable the PWR clock */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
/* Allow access to RTC */
PWR_BackupAccessCmd(ENABLE);
/***Configures the External Low Speed oscillator (LSE)****/
RCC_LSEConfig(RCC_LSE_ON);
/* Wait till LSE is ready */
while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)
{
}
/* Select the RTC Clock Source */
RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE);
/* Enable the RTC Clock */
RCC_RTCCLKCmd(ENABLE);
/* Wait for RTC APB registers synchronisation */
RTC_WaitForSynchro();
/* Calendar Configuration with LSI supposed at 32KHz */
RTC_InitStruct.RTC_AsynchPrediv = 0x7F;
RTC_InitStruct.RTC_SynchPrediv = 0xFF;
RTC_InitStruct.RTC_HourFormat = RTC_HourFormat_24;
RTC_Init(&RTC_InitStruct);
RTC_GetTime(RTC_Format_BIN, &RTC_Time) ;
RTC_GetDate(RTC_Format_BIN, &RTC_Date) ;
}
/*-----------------------------------------------------------------------------
* initialize TIM
*----------------------------------------------------------------------------*/
static void init_TIM()
{
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure ;
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE) ;
TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);
TIM_TimeBaseStructure.TIM_Prescaler = 60;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseStructure.TIM_Period = 0xffffffff;
TIM_TimeBaseStructure.TIM_ClockDivision = 0;
TIM_TimeBaseStructure.TIM_RepetitionCounter = 0;
TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure);
TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure) ;
TIM_Cmd(TIM2, ENABLE) ;
}
void init_time(void) {
init_RTC() ;
init_TIM() ;
}
struct tm *Cyassl_MDK_gmtime(const time_t *c)
{
RTC_TimeTypeDef RTC_Time ;
RTC_DateTypeDef RTC_Date ;
static struct tm date ;
RTC_GetTime(RTC_Format_BIN, &RTC_Time) ;
RTC_GetDate(RTC_Format_BIN, &RTC_Date) ;
date.tm_year = RTC_Date.RTC_Year + 100 ;
date.tm_mon = RTC_Date.RTC_Month - 1 ;
date.tm_mday = RTC_Date.RTC_Date ;
date.tm_hour = RTC_Time.RTC_Hours ;
date.tm_min = RTC_Time.RTC_Minutes ;
date.tm_sec = RTC_Time.RTC_Seconds ;
#if defined(DEBUG_CYASSL)
{
char msg[100] ;
sprintf(msg, "Debug::Cyassl_KEIL_gmtime(DATE=/%4d/%02d/%02d TIME=%02d:%02d:%02d)\n",
RTC_Date.RTC_Year+2000, RTC_Date.RTC_Month, RTC_Date.RTC_Date,
RTC_Time.RTC_Hours, RTC_Time.RTC_Minutes, RTC_Time.RTC_Seconds) ;
CYASSL_MSG(msg) ;
}
#endif
return(&date) ;
}
double current_time()
{
return ((double)TIM2->CNT/1000000.0) ;
}
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
#include <stdio.h>
void time_main(void *args)
{
char * datetime ;
RTC_TimeTypeDef RTC_Time ;
RTC_DateTypeDef RTC_Date ;
int year ;
if( args == NULL || ((func_args *)args)->argc == 1) {
RTC_GetTime(RTC_Format_BIN, &RTC_Time) ;
RTC_GetDate(RTC_Format_BIN, &RTC_Date) ;
printf("Date: %d/%d/%d, Time: %02d:%02d:%02d\n",
RTC_Date.RTC_Month, RTC_Date.RTC_Date, RTC_Date.RTC_Year+2000,
RTC_Time.RTC_Hours, RTC_Time.RTC_Minutes, RTC_Time.RTC_Seconds) ;
} else if(((func_args *)args)->argc == 3 &&
((func_args *)args)->argv[1][0] == '-' &&
((func_args *)args)->argv[1][1] == 'd' ) {
datetime = ((func_args *)args)->argv[2];
sscanf(datetime, "%d/%d/%d",
(int *)&RTC_Date.RTC_Month, (int *)&RTC_Date.RTC_Date, &year) ;
RTC_Date.RTC_Year = year - 2000 ;
RTC_Date.RTC_WeekDay = 0 ;
RTC_SetDate(RTC_Format_BIN, &RTC_Date) ;
} else if(((func_args *)args)->argc == 3 &&
((func_args *)args)->argv[1][0] == '-' &&
((func_args *)args)->argv[1][1] == 't' ) {
datetime = ((func_args *)args)->argv[2];
sscanf(datetime, "%d:%d:%d",
(int *)&RTC_Time.RTC_Hours,
(int *)&RTC_Time.RTC_Minutes,
(int *)&RTC_Time.RTC_Seconds
) ;
RTC_SetTime(RTC_Format_BIN, &RTC_Time) ;
} else printf("Invalid argument\n") ;
}

View File

@ -15,34 +15,38 @@ check_PROGRAMS =
EXTRA_HEADERS =
BUILT_SOURCES=
EXTRA_DIST=
doc_DATA=
dist_doc_DATA=
exampledir = $(docdir)/@PACKAGE@/example
example_DATA=
EXTRA_DIST+= $(example_DATA)
#includes additional rules from aminclude.am
@INC_AMINCLUDE@
DISTCLEANFILES+= aminclude.am
certsdir = $(sysconfdir)/ssl/certs
certs_DATA=
EXTRA_DIST+= $(certs_DATA)
exampledir = $(docdir)/example
dist_example_DATA=
EXTRA_DIST+= $(doc_DATA)
ACLOCAL_AMFLAGS= -I m4 --install
ACLOCAL_AMFLAGS= -I m4
EXTRA_DIST+= lib/dummy
EXTRA_DIST+= cyassl-ntru.vcproj
EXTRA_DIST+= cyassl.vcproj
EXTRA_DIST+= cyassl-iphone.xcodeproj/project.pbxproj
EXTRA_DIST+= cyassl-ios.xcodeproj/project.pbxproj
EXTRA_DIST+= cyassl-ntru.sln
EXTRA_DIST+= cyassl.sln
EXTRA_DIST+= valgrind-error.sh
EXTRA_DIST+= gencertbuf.pl
EXTRA_DIST+= IDE
include cyassl/include.am
include certs/include.am
include certs/1024/include.am
include certs/crl/include.am
include doc/include.am
include swig/include.am
include src/include.am
include support/include.am
include ctaocrypt/benchmark/include.am
include ctaocrypt/src/include.am
include ctaocrypt/test/include.am
@ -53,10 +57,55 @@ include examples/echoserver/include.am
include testsuite/include.am
include tests/include.am
include sslSniffer/sslSnifferTest/include.am
include rpm/include.am
include mqx/ctaocrypt_test/Sources/include.am
include mqx/cyassl/include.am
include mqx/cyassl_client/Sources/include.am
include mqx/util_lib/Sources/include.am
include mplabx/ctaocrypt_benchmark.X/nbproject/include.am
include mplabx/ctaocrypt_test.X/nbproject/include.am
include mplabx/cyassl.X/nbproject/include.am
include mcapi/include.am
include mcapi/ctaocrypt_mcapi.X/nbproject/include.am
include mcapi/ctaocrypt_test.X/nbproject/include.am
include mcapi/cyassl.X/nbproject/include.am
include mcapi/zlib.X/nbproject/include.am
if USE_VALGRIND
TESTS_ENVIRONMENT=./valgrind-error.sh
endif
TESTS += $(check_PROGRAMS)
test: check
DISTCLEANFILES+= cyassl-config
maintainer-clean-local:
-rm Makefile.in
-rm aclocal.m4
-rm build-aux/compile
-rm build-aux/config.guess
-rm build-aux/config.sub
-rm build-aux/depcomp
-rm build-aux/install-sh
-rm build-aux/ltmain.sh
-rm build-aux/missing
-rm cyassl-config
-rmdir build-aux
-rm configure
-rm config.log
-rm config.status
-rm config.in
-rm m4/libtool.m4
-rm m4/ltoptions.m4
-rm m4/ltsugar.m4
-rm m4/ltversion.m4
-rm m4/lt~obsolete.m4
-rm support/cyassl.pc
find . -type f -name '*~' -exec rm -f '{}' \;
-rm -f @PACKAGE@-*.tar.gz
-rm -f @PACKAGE@-*.rpm
# !!!! first line of rule has to start with a hard (real) tab, not spaces
egs:
$(MAKE) examples/client/client; \
@ -68,6 +117,15 @@ ctc:
$(MAKE) ctaocrypt/test/testctaocrypt; \
$(MAKE) ctaocrypt/benchmark/benchmark;
install-exec-local: install-generic-config
install-generic-config:
$(mkinstalldirs) $(DESTDIR)$(bindir)
$(INSTALL_SCRIPT) @GENERIC_CONFIG@ $(DESTDIR)$(bindir)
uninstall-local:
-rm -f $(DESTDIR)$(bindir)/@GENERIC_CONFIG@
merge-clean:
@find ./ | $(GREP) \.gcda | xargs rm -f
@find ./ | $(GREP) \.gcno | xargs rm -f

225
README
View File

@ -12,7 +12,7 @@ harder. Now to run testsuite just do:
or
make test (when using autoconf)
make check (when using autoconf)
On *nix or Windows the examples and testsuite will check to see if the current
directory is the source directory and if so, attempt to change to the CyaSSL
@ -32,9 +32,224 @@ SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
before calling SSL_new(); Though it's not recommended.
*** end Note ***
*** end Notes ***
CyaSSL Release 2.0.8 (2/24/2012)
CyaSSL Release 2.7.0 (6/17/2013)
Release 2.7.0 CyaSSL has bug fixes and new features including:
- SNI support for client and server
- KEIL MDK-ARM projects
- Wildcard check to domain name match, and Subject altnames are checked too
- Better error messages for certificate verification errors
- Ability to discard session during handshake verify
- More consistent error returns across all APIs
- Ability to unload CAs at the CTX or CertManager level
- Authority subject id support for Certificate matching
- Persistent session cache functionality
- Persistent CA cache functionality
- Client session table lookups to push serverID table to library level
- Camellia support to sniffer
- User controllable settings for DTLS timeout values
- Sniffer fixes for caching long lived sessions
- DTLS reliability enhancements for the handshake
- Better ThreadX support
When compiling with Mingw, libtool may give the following warning due to
path conversion errors:
libtool: link: Could not determine host file name corresponding to **
libtool: link: Continuing, but uninstalled executables may not work.
If so, examples and testsuite will have problems when run, showing an
error while loading shared libraries. To resolve, please run "make install".
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
************** CyaSSL Release 2.6.0 (04/15/2013)
Release 2.6.0 CyaSSL has bug fixes and new features including:
- DTLS 1.2 support including AEAD ciphers
- SHA-3 finalist Blake2 support, it's fast and uses little resources
- SHA-384 cipher suites including ECC ones
- HMAC now supports SHA-512
- Track memory use for example client/server with -t option
- Better IPv6 examples with --enable-ipv6, before if ipv6 examples/tests were
turned on, localhost only was used. Now link-local (with scope ids) and ipv6
hosts can be used as well.
- Xcode v4.6 project for iOS v6.1 update
- settings.h is now checked in all *.c files for true one file setting detection
- Better alignment at SSL layer for hardware crypto alignment needs
* Note, SSL itself isn't friendly to alignment with 5 byte TLS headers and
13 bytes DTLS headers, but every effort is now made to align with the
CYASSL_GENERAL_ALIGNMENT flag which sets desired alignment requirement
- NO_64BIT flag to turn off 64bit data type accumulators in public key code
* Note, some systems are faster with 32bit accumulators
- --enable-stacksize for example client/server stack use
* Note, modern desktop Operating Systems may add bytes to each stack frame
- Updated compression/decompression with direct crypto access
- All ./configure options are now lowercase only for consistency
- ./configure builds default to fastmath option
* Note, if on ia32 and building in shared mode this may produce a problem
with a missing register being available because of PIC, there are at least
5 solutions to this:
1) --disable-fastmath , don't use fastmath
2) --disable-shared, don't build a shared library
3) C_EXTRA_FLAGS=-DTFM_NO_ASM , turn off assembly use
4) use clang, it just seems to work
5) play around with no PIC options to force all registers being open
- Many new ./configure switches for option enable/disable for example
* rsa
* dh
* dsa
* md5
* sha
* arc4
* null (allow NULL ciphers)
* oldtls (only use TLS 1.2)
* asn (no certs or public keys allowed)
- ./configure generates cyassl/options.h which allows a header the user can
include in their app to make sure the same options are set at the app and
CyaSSL level.
- autoconf no longer needs serial-tests which lowers version requirements of
automake to 1.11 and autoconf to 2.63
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
************** CyaSSL Release 2.5.0 (02/04/2013)
Release 2.5.0 CyaSSL has bug fixes and new features including:
- Fix for TLS CBC padding timing attack identified by Nadhem Alfardan and
Kenny Paterson: http://www.isg.rhul.ac.uk/tls/
- Microchip PIC32 (MIPS16, MIPS32) support
- Microchip MPLAB X example projects for PIC32 Ethernet Starter Kit
- Updated CTaoCrypt benchmark app for embedded systems
- 1024-bit test certs/keys and cert/key buffers
- AES-CCM-8 crypto and cipher suites
- Camellia crypto and cipher suites
- Bumped minimum autoconf version to 2.65, automake version to 1.12
- Addition of OCSP callbacks
- STM32F2 support with hardware crypto and RNG
- Cavium NITROX support
CTaoCrypt now has support for the Microchip PIC32 and has been tested with
the Microchip PIC32 Ethernet Starter Kit, the XC32 compiler and
MPLAB X IDE in both MIPS16 and MIPS32 instruction set modes. See the README
located under the <cyassl_root>/mplabx directory for more details.
To add Cavium NITROX support do:
./configure --with-cavium=/home/user/cavium/software
pointing to your licensed cavium/software directory. Since Cavium doesn't
build a library we pull in the cavium_common.o file which gives a libtool
warning about the portability of this. Also, if you're using the github source
tree you'll need to remove the -Wredundant-decls warning from the generated
Makefile because the cavium headers don't conform to this warning. Currently
CyaSSL supports Cavium RNG, AES, 3DES, RC4, HMAC, and RSA directly at the crypto
layer. Support at the SSL level is partial and currently just does AES, 3DES,
and RC4. RSA and HMAC are slower until the Cavium calls can be utilized in non
blocking mode. The example client turns on cavium support as does the crypto
test and benchmark. Please see the HAVE_CAVIUM define.
CyaSSL is able to use the STM32F2 hardware-based cryptography and random number
generator through the STM32F2 Standard Peripheral Library. For necessary
defines, see the CYASSL_STM32F2 define in settings.h. Documentation for the
STM32F2 Standard Peripheral Library can be found in the following document:
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/USER_MANUAL/DM00023896.pdf
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
*************** CyaSSL Release 2.4.6 (12/20/2012)
Release 2.4.6 CyaSSL has bug fixes and a few new features including:
- ECC into main version
- Lean PSK build (reduced code size, RAM usage, and stack usage)
- FreeBSD CRL monitor support
- CyaSSL_peek()
- CyaSSL_send() and CyaSSL_recv() for I/O flag setting
- CodeWarrior Support
- MQX Support
- Freescale Kinetis support including Hardware RNG
- autoconf builds use jobserver
- cyassl-config
- Sniffer memory reductions
Thanks to Brian Aker for the improved autoconf system, make rpm, cyassl-config,
warning system, and general good ideas for improving CyaSSL!
The Freescale Kinetis K70 RNGA documentation can be found in Chapter 37 of the
K70 Sub-Family Reference Manual:
http://cache.freescale.com/files/microcontrollers/doc/ref_manual/K70P256M150SF3RM.pdf
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
*************** CyaSSL Release 2.4.0 (10/10/2012)
Release 2.4.0 CyaSSL has bug fixes and a few new features including:
- DTLS reliability
- Reduced memory usage after handshake
- Updated build process
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
*************** CyaSSL Release 2.3.0 (8/10/2012)
Release 2.3.0 CyaSSL has bug fixes and a few new features including:
- AES-GCM crypto and cipher suites
- make test cipher suite checks
- Subject AltName processing
- Command line support for client/server examples
- Sniffer SessionTicket support
- SHA-384 cipher suites
- Verify cipher suite validity when user overrides
- CRL dir monitoring
- DTLS Cookie support, reliability coming soon
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
***************CyaSSL Release 2.2.0 (5/18/2012)
Release 2.2.0 CyaSSL has bug fixes and a few new features including:
- Initial CRL support (--enable-crl)
- Initial OCSP support (--enable-ocsp)
- Add static ECDH suites
- SHA-384 support
- ECC client certificate support
- Add medium session cache size (1055 sessions)
- Updated unit tests
- Protection against mutex reinitialization
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
***************CyaSSL Release 2.0.8 (2/24/2012)
Release 2.0.8 CyaSSL has bug fixes and a few new features including:
- A fix for malicious certificates pointed out by Remi Gacogne (thanks)
@ -96,7 +311,7 @@ Release 2.0.0rc3 for CyaSSL has bug fixes and a few new features including:
- CyaSSL headers now in <cyassl/*.h>
- CTaocrypt headers now in <cyassl/ctaocrypt/*.h>
- OpenSSL compatibility headers now in <cyassl/openssl/*.h>
- examples and tests all run from home diretory so can use certs in ./certs
- examples and tests all run from home directory so can use certs in ./certs
(see note 1)
So previous applications that used the OpenSSL compatibility header
@ -118,7 +333,7 @@ Release 2.0.0rc2 for CyaSSL has bug fixes and a few new features including:
- Wshadow warnings removed
- asn public header
- CTaoCrypt public headers now all have ctc_ prefix (the manual is still being
updated to relfect this change)
updated to reflect this change)
- and more.
This is the 2nd and perhaps final release candidate for version 2.

View File

@ -3,4 +3,14 @@
# Create configure and makefile stuff...
#
autoreconf -ivf -Wall
if test -d .git; then
WARNINGS="all,error"
else
WARNINGS="all"
fi
autoreconf --install --force --verbose
if test -d .git; then
ln -s -f ../../pre-commit.sh .git/hooks/pre-commit
fi

BIN
certs/1024/client-cert.der Normal file

Binary file not shown.

View File

@ -0,0 +1,59 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 10163970144298616102 (0x8d0dacfec6984526)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=Programming, CN=www.yassl.com/emailAddress=info@yassl.com
Validity
Not Before: Jan 18 21:42:49 2013 GMT
Not After : Oct 15 21:42:49 2015 GMT
Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=Programming, CN=www.yassl.com/emailAddress=info@yassl.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:bc:73:0e:a8:49:f3:74:a2:a9:ef:18:a5:da:55:
99:21:f9:c8:ec:b3:6d:48:e5:35:35:75:77:37:ec:
d1:61:90:5f:3e:d9:e4:d5:df:94:ca:c1:a9:d7:19:
da:86:c9:e8:4d:c4:61:36:82:fe:ab:ad:7e:77:25:
bb:8d:11:a5:bc:62:3a:a8:38:cc:39:a2:04:66:b4:
f7:f7:f3:aa:da:4d:02:0e:bb:5e:8d:69:48:dc:77:
c9:28:0e:22:e9:6b:a4:26:ba:4c:e8:c1:fd:4a:6f:
2b:1f:ef:8a:ae:f6:90:62:e5:64:1e:eb:2b:3c:67:
c8:dc:27:00:f6:91:68:65:a9
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
81:69:0F:F8:DF:DD:CF:34:29:D5:67:75:71:85:C7:75:10:69:59:EC
X509v3 Authority Key Identifier:
keyid:81:69:0F:F8:DF:DD:CF:34:29:D5:67:75:71:85:C7:75:10:69:59:EC
X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
72:66:0f:6a:a1:85:95:06:e6:87:1a:ed:2b:da:ed:84:90:89:
a6:31:4d:60:f2:7b:63:0c:dc:9b:44:4c:d6:62:41:24:74:30:
70:4e:07:10:05:12:5e:14:b3:dd:cf:58:27:93:cf:aa:4f:85:
2c:35:0e:ff:5b:a8:6b:b5:95:32:d5:cc:73:68:5b:1b:c4:f8:
89:5e:3d:f8:02:39:32:7d:06:a4:32:e9:b3:ef:62:a0:43:5d:
4f:fb:ce:3d:08:33:af:3d:7f:12:cb:8a:5a:c2:63:db:3e:dd:
ea:5b:67:10:49:9f:5b:96:1b:4e:5d:bc:4e:9a:7c:1f:ab:56:
47:4a
-----BEGIN CERTIFICATE-----
MIIC7DCCAlWgAwIBAgIJAI0NrP7GmEUmMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYD
VQQGEwJVUzEPMA0GA1UECAwGT3JlZ29uMREwDwYDVQQHDAhQb3J0bGFuZDEOMAwG
A1UECgwFeWFTU0wxFDASBgNVBAsMC1Byb2dyYW1taW5nMRYwFAYDVQQDDA13d3cu
eWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0xMzAx
MTgyMTQyNDlaFw0xNTEwMTUyMTQyNDlaMIGOMQswCQYDVQQGEwJVUzEPMA0GA1UE
CAwGT3JlZ29uMREwDwYDVQQHDAhQb3J0bGFuZDEOMAwGA1UECgwFeWFTU0wxFDAS
BgNVBAsMC1Byb2dyYW1taW5nMRYwFAYDVQQDDA13d3cueWFzc2wuY29tMR0wGwYJ
KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
gYkCgYEAvHMOqEnzdKKp7xil2lWZIfnI7LNtSOU1NXV3N+zRYZBfPtnk1d+UysGp
1xnahsnoTcRhNoL+q61+dyW7jRGlvGI6qDjMOaIEZrT39/Oq2k0CDrtejWlI3HfJ
KA4i6WukJrpM6MH9Sm8rH++KrvaQYuVkHusrPGfI3CcA9pFoZakCAwEAAaNQME4w
HQYDVR0OBBYEFIFpD/jf3c80KdVndXGFx3UQaVnsMB8GA1UdIwQYMBaAFIFpD/jf
3c80KdVndXGFx3UQaVnsMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEA
cmYPaqGFlQbmhxrtK9rthJCJpjFNYPJ7Ywzcm0RM1mJBJHQwcE4HEAUSXhSz3c9Y
J5PPqk+FLDUO/1uoa7WVMtXMc2hbG8T4iV49+AI5Mn0GpDLps+9ioENdT/vOPQgz
rz1/EsuKWsJj2z7d6ltnEEmfW5YbTl28Tpp8H6tWR0o=
-----END CERTIFICATE-----

BIN
certs/1024/client-key.der Normal file

Binary file not shown.

15
certs/1024/client-key.pem Normal file
View File

@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQC8cw6oSfN0oqnvGKXaVZkh+cjss21I5TU1dXc37NFhkF8+2eTV
35TKwanXGdqGyehNxGE2gv6rrX53JbuNEaW8YjqoOMw5ogRmtPf386raTQIOu16N
aUjcd8koDiLpa6Qmukzowf1Kbysf74qu9pBi5WQe6ys8Z8jcJwD2kWhlqQIDAQAB
AoGAE5fq6Dh4JaJcBM4NQHwx5cRwzZuCO1gJhjtmX9wxkPFP1dsV3d7XO5WTMRgx
Dl6j1qIacW6BSBxLz9uOeoZhMtz7VcEWbSeSJEWL8bhIsUsdrN7a3Y4vwpH7palu
+Dpq8f1QGO+f58PKeOpW09NyW5bdTgZOOsPZvnK2ZQcHTAECQQD6R9R6fJI8Ve+B
8EEwLaPPjxzmhycFcA3fmDXW8Ys4LyS10IS2eU9xKZRa8GRqrOdyxu1NWZg+Zzrz
dCz5YRdpAkEAwMGCDQzrxi/ckvmdghox6en3S/KChxzuFmrRHRiCcPPAti/28/cd
8YYjyE7rj1aOj/W/8fcrtcw9xlc5DBtUQQJBAJ1+Bd7t9Ley+/wwS1Ud4y8BR5Zp
Bc0OLiy9g2O2q3y3bcpbZKfOvobfO1PeYdIe66X2N+2sq3jZTOdV+9cRmcECQBiY
GCnmHic5cCForAovoXLBIYaVOMZYkKBXnLrjp7EVyN72G8JhI3bvsJ0cRL4TQzln
F8idyvv1RWSLOIIs8oECQDmJ5ZwZVTC6t0iMSBQO9J9+d5dD4bQZNTEjdZw7RK1p
ElbuAGFkFmbTfHQrFbSi/r8IaxpdP5ASsQWGMSnb2eI=
-----END RSA PRIVATE KEY-----

BIN
certs/1024/dh1024.der Normal file

Binary file not shown.

17
certs/1024/dh1024.pem Normal file
View File

@ -0,0 +1,17 @@
PKCS#3 DH Parameters: (1024 bit)
prime:
00:a4:d2:b8:6e:78:f5:d9:ed:2d:7c:dd:b6:16:86:
5a:4b:05:76:90:dd:66:61:b9:6d:52:a7:1c:af:62:
c6:69:47:7b:39:f2:fb:94:ec:bc:79:ff:24:5e:ef:
79:bb:59:b2:fc:ca:07:d6:f4:e9:34:f7:e8:38:e7:
d7:33:44:1d:a3:64:76:1a:84:97:54:74:40:84:1f:
15:fe:7c:25:2a:2b:25:fd:9e:c1:89:33:8c:39:25:
2b:40:e6:cd:f8:a8:a1:8a:53:c6:47:b2:a0:d7:8f:
eb:2e:60:0a:0d:4b:f8:b4:94:8c:63:0a:ad:c7:10:
ea:c7:a1:b9:9d:f2:a8:37:73
generator: 2 (0x2)
-----BEGIN DH PARAMETERS-----
MIGHAoGBAKTSuG549dntLXzdthaGWksFdpDdZmG5bVKnHK9ixmlHezny+5TsvHn/
JF7vebtZsvzKB9b06TT36Djn1zNEHaNkdhqEl1R0QIQfFf58JSorJf2ewYkzjDkl
K0DmzfiooYpTxkeyoNeP6y5gCg1L+LSUjGMKrccQ6sehuZ3yqDdzAgEC
-----END DH PARAMETERS-----

BIN
certs/1024/dsa1024.der Normal file

Binary file not shown.

12
certs/1024/dsa1024.pem Normal file
View File

@ -0,0 +1,12 @@
-----BEGIN DSA PRIVATE KEY-----
MIIBvAIBAAKBgQD3S/m7FZjr3d4eTnGIhfK3uuJK2nZAzWlInoN8EfdlMXj1JS33
t/hSP77YtsX+GBVbudWShryyF3zYsL6gfPLVc3pYj43lSgCZg0rAnhYJoRA01Rm7
Y+Pdg3R/EMpzde4xSt2f4AJqne6yS6drKmzHhnfoBBXckrR6KR9Og2OFVQIVANIF
5HP7wZnF3GikjZInPeJSX4mLAoGBAKohAglDbvuiVBSFCvQofMvM2/UeohipId6I
iDOMLuuNo/AdyI/2fvjPEvW0oRFvDNTwBq3E/BRFx5QVvBlLru+Tak/MFNhHizlm
hwLUKAq47gk39ACgBKd5p9I89zRDVo7QfMLYTQ+J7RTBLJxMGZue3FMJn98t8Awn
VDp3FC3eAoGBAOgffLfAVFGnKC1YfN7UXN3VdoQ8NiDAwyXXOjjhVMj9QGgaIVQm
ORS/9qOcXtkr98klugAJy38MSiT9FRYVSM0LUkRAe5BjK5AixRgFgFOvgx9U4rCi
C1qSJOFiKD+3yrmJ1qC3ra4F4cFZQO1KG2ine/vDIIHvS/NpkbDOOrA4AhQlODuh
GXXfm/VyU0854RzsE4SCGA==
-----END DSA PRIVATE KEY-----

17
certs/1024/include.am Normal file
View File

@ -0,0 +1,17 @@
# vim:ft=automake
# All paths should be given relative to the root
#
EXTRA_DIST += \
certs/1024/client-cert.pem \
certs/1024/client-key.pem \
certs/1024/dh1024.pem \
certs/1024/dsa1024.pem
EXTRA_DIST += \
certs/1024/client-cert.der \
certs/1024/client-key.der \
certs/1024/dh1024.der \
certs/1024/dsa1024.der \
certs/1024/rsa1024.der

BIN
certs/1024/rsa1024.der Normal file

Binary file not shown.

View File

@ -1,3 +1,30 @@
-----BEGIN CERTIFICATE-----
MIIEnjCCA4agAwIBAgIJAOnQp195JfQ8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD
VQQGEwJVUzEQMA4GA1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8G
A1UEChMIU2F3dG9vdGgxEzARBgNVBAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3
dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTEx
MTAyNDE4MTgxNVoXDTE0MDcyMDE4MTgxNVowgZAxCzAJBgNVBAYTAlVTMRAwDgYD
VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggEiMA0GCSqGSIb3DQEBAQUA
A4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgfSvJNdRDxtjWf38p9A5jTrN4DZu4q
8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLqypC7aVIQAy+o85XF8YtiVhvvZ2+k
EEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04KRysx+3yfJWwlYJ9SVw4zXcl772A
dVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC19pAb9gh3HMbQi1TnP4a/H2rejY/
mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VWL6Mm0rdvsVoX1ziZCP6TWG/+wxNJ
CBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u97TZ5AgMBAAGjgfgwgfUwHQYDVR0O
BBYEFCeOZxF0wyYdP+0zY7Ok2B0w5ejVMIHFBgNVHSMEgb0wgbqAFCeOZxF0wyYd
P+0zY7Ok2B0w5ejVoYGWpIGTMIGQMQswCQYDVQQGEwJVUzEQMA4GA1UECBMHTW9u
dGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8GA1UEChMIU2F3dG9vdGgxEzARBgNV
BAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG
9w0BCQEWDmluZm9AeWFzc2wuY29tggkA6dCnX3kl9DwwDAYDVR0TBAUwAwEB/zAN
BgkqhkiG9w0BAQUFAAOCAQEAX4YU9FGLvKVOMNperJr4bNkmS5P54xyJb57us513
PokgdqPm6IYVIdviM7I01dCf88Gkh5Jc+dH/MC+OA7yzPAwyo5BfGpAer53zntcH
Aql9J2ZjL68Y16wYmIyDjzjzC6w2EHX7ynYTUFsCj3O/46Dug1IlVM4mzpy9L3mr
G2C4kvEDwPw7CNnArdVyCCWAYS3cn6eDYgdH4AdMSwcwBKmHHFV/BxLQy0Jdy89m
ARoX7vkPYLfbb2jlTkFibtNvYE9LJ97PGAfxE13LP6klRNpSXMgE4VYS9SqQTtHi
rwG1I6HsMdp7Y2nEuPPnzqE9wNtt87LZRsifw7hwWh9/yg==
-----END CERTIFICATE-----
Certificate:
Data:
Version: 3 (0x2)
@ -58,30 +85,3 @@ Certificate:
f5:2a:90:4e:d1:e2:af:01:b5:23:a1:ec:31:da:7b:63:69:c4:
b8:f3:e7:ce:a1:3d:c0:db:6d:f3:b2:d9:46:c8:9f:c3:b8:70:
5a:1f:7f:ca
-----BEGIN CERTIFICATE-----
MIIEnjCCA4agAwIBAgIJAOnQp195JfQ8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD
VQQGEwJVUzEQMA4GA1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8G
A1UEChMIU2F3dG9vdGgxEzARBgNVBAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3
dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTEx
MTAyNDE4MTgxNVoXDTE0MDcyMDE4MTgxNVowgZAxCzAJBgNVBAYTAlVTMRAwDgYD
VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggEiMA0GCSqGSIb3DQEBAQUA
A4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgfSvJNdRDxtjWf38p9A5jTrN4DZu4q
8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLqypC7aVIQAy+o85XF8YtiVhvvZ2+k
EEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04KRysx+3yfJWwlYJ9SVw4zXcl772A
dVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC19pAb9gh3HMbQi1TnP4a/H2rejY/
mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VWL6Mm0rdvsVoX1ziZCP6TWG/+wxNJ
CBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u97TZ5AgMBAAGjgfgwgfUwHQYDVR0O
BBYEFCeOZxF0wyYdP+0zY7Ok2B0w5ejVMIHFBgNVHSMEgb0wgbqAFCeOZxF0wyYd
P+0zY7Ok2B0w5ejVoYGWpIGTMIGQMQswCQYDVQQGEwJVUzEQMA4GA1UECBMHTW9u
dGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8GA1UEChMIU2F3dG9vdGgxEzARBgNV
BAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG
9w0BCQEWDmluZm9AeWFzc2wuY29tggkA6dCnX3kl9DwwDAYDVR0TBAUwAwEB/zAN
BgkqhkiG9w0BAQUFAAOCAQEAX4YU9FGLvKVOMNperJr4bNkmS5P54xyJb57us513
PokgdqPm6IYVIdviM7I01dCf88Gkh5Jc+dH/MC+OA7yzPAwyo5BfGpAer53zntcH
Aql9J2ZjL68Y16wYmIyDjzjzC6w2EHX7ynYTUFsCj3O/46Dug1IlVM4mzpy9L3mr
G2C4kvEDwPw7CNnArdVyCCWAYS3cn6eDYgdH4AdMSwcwBKmHHFV/BxLQy0Jdy89m
ARoX7vkPYLfbb2jlTkFibtNvYE9LJ97PGAfxE13LP6klRNpSXMgE4VYS9SqQTtHi
rwG1I6HsMdp7Y2nEuPPnzqE9wNtt87LZRsifw7hwWh9/yg==
-----END CERTIFICATE-----

39
certs/crl/cliCrl.pem Normal file
View File

@ -0,0 +1,39 @@
Certificate Revocation List (CRL):
Version 2 (0x1)
Signature Algorithm: sha1WithRSAEncryption
Issuer: /C=US/ST=Oregon/L=Portland/O=yaSSL/OU=Programming/CN=www.yassl.com/emailAddress=info@yassl.com
Last Update: Jun 17 21:32:30 2013 GMT
Next Update: Dec 14 21:32:30 2013 GMT
CRL extensions:
X509v3 CRL Number:
87
No Revoked Certificates.
Signature Algorithm: sha1WithRSAEncryption
0f:16:d2:d6:62:f8:c0:db:b2:2c:de:9d:0a:10:72:0e:85:6e:
25:1d:38:20:1b:d5:66:d9:d3:9e:0e:a6:9e:e8:60:20:1c:b5:
c9:ab:09:c3:a5:d5:c3:91:a3:9a:ff:44:40:68:da:7b:da:4a:
3c:15:17:89:0a:49:b9:af:b2:ac:f0:e2:b5:0e:4d:c0:22:d7:
5e:c1:02:9e:f3:95:20:62:7c:88:d9:32:97:12:04:1a:6f:8c:
d8:7b:9f:0c:1e:91:fe:98:52:17:de:f2:ee:7c:66:e7:db:91:
99:7a:f7:09:c9:15:16:3d:a2:1c:13:af:ad:e0:70:b8:6b:e5:
dc:8e:f8:b5:ec:ff:f7:88:1b:ce:46:eb:22:ff:10:2f:ea:53:
f0:86:62:1a:ab:6f:4d:05:45:e8:5c:ba:b5:8d:0d:38:72:cd:
df:a1:74:31:bb:ad:68:7d:56:be:d8:7e:7a:f5:ef:52:be:14:
5c:6d:ed:b4:2a:c9:ab:97:ba:e8:93:c5:6b:79:66:c7:52:a8:
0d:62:dc:cb:e2:4c:e6:53:f4:c3:5c:ce:47:0f:39:46:9a:cb:
82:d9:98:7d:69:41:aa:ac:6a:7a:e9:02:c9:9b:77:59:7f:6a:
90:54:10:8a:45:c7:49:5f:ca:be:66:6a:20:e1:cd:e8:10:09:
30:7e:16:44
-----BEGIN X509 CRL-----
MIIB6DCB0QIBATANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxDzANBgNV
BAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxDjAMBgNVBAoTBXlhU1NMMRQw
EgYDVQQLEwtQcm9ncmFtbWluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsG
CSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20XDTEzMDYxNzIxMzIzMFoXDTEzMTIx
NDIxMzIzMFqgDjAMMAoGA1UdFAQDAgFXMA0GCSqGSIb3DQEBBQUAA4IBAQAPFtLW
YvjA27Is3p0KEHIOhW4lHTggG9Vm2dOeDqae6GAgHLXJqwnDpdXDkaOa/0RAaNp7
2ko8FReJCkm5r7Ks8OK1Dk3AItdewQKe85UgYnyI2TKXEgQab4zYe58MHpH+mFIX
3vLufGbn25GZevcJyRUWPaIcE6+t4HC4a+Xcjvi17P/3iBvORusi/xAv6lPwhmIa
q29NBUXoXLq1jQ04cs3foXQxu61ofVa+2H569e9SvhRcbe20Ksmrl7rok8VreWbH
UqgNYtzL4kzmU/TDXM5HDzlGmsuC2Zh9aUGqrGp66QLJm3dZf2qQVBCKRcdJX8q+
Zmog4c3oEAkwfhZE
-----END X509 CRL-----

39
certs/crl/crl.pem Normal file
View File

@ -0,0 +1,39 @@
Certificate Revocation List (CRL):
Version 2 (0x1)
Signature Algorithm: sha1WithRSAEncryption
Issuer: /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
Last Update: Jun 17 21:32:30 2013 GMT
Next Update: Dec 14 21:32:30 2013 GMT
CRL extensions:
X509v3 CRL Number:
85
No Revoked Certificates.
Signature Algorithm: sha1WithRSAEncryption
4d:9c:63:22:02:91:fe:52:35:93:7c:b6:5b:e8:86:5a:29:a2:
4d:9a:bc:d9:16:e0:8a:04:90:4d:ae:21:00:be:9c:81:5b:68:
6e:90:1a:fd:1a:37:70:85:50:f2:02:87:1c:38:f4:ef:9d:41:
f5:4f:53:66:d4:c0:22:80:00:82:7a:09:42:49:c3:1c:c9:4c:
9f:92:f9:66:f4:21:1f:24:67:4f:83:6a:bd:3a:19:f1:04:99:
ea:30:05:bf:a7:3d:bf:71:ac:3e:3a:ba:2a:c5:05:12:53:eb:
5c:6f:ed:2d:4b:c0:f5:00:e1:95:45:c9:62:b5:89:66:4b:2b:
01:fc:66:29:a3:0a:9a:05:ae:f7:9f:51:2a:9c:3b:18:03:ed:
c4:7c:33:62:93:30:49:ab:c4:d1:07:f4:18:ac:96:24:1e:c2:
fa:37:ed:82:db:06:66:8d:fb:25:93:35:7b:39:88:e8:8e:70:
e9:c8:be:00:c4:f7:a7:67:83:f8:3d:af:8b:71:5b:25:3b:1d:
56:cd:d0:15:86:31:d1:cb:57:3a:00:b5:1c:7c:3e:99:44:ce:
bc:89:a7:78:37:50:ed:a1:b6:16:cd:72:20:c9:1f:60:b2:8a:
c5:62:30:26:f0:aa:b6:73:ca:8e:d6:ba:31:0a:21:a2:6e:40:
4b:66:30:11
-----BEGIN X509 CRL-----
MIIB6jCB0wIBATANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMCVVMxEDAOBgNV
BAgTB01vbnRhbmExEDAOBgNVBAcTB0JvemVtYW4xETAPBgNVBAoTCFNhd3Rvb3Ro
MRMwEQYDVQQLEwpDb25zdWx0aW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbRcNMTMwNjE3MjEzMjMwWhcNMTMx
MjE0MjEzMjMwWqAOMAwwCgYDVR0UBAMCAVUwDQYJKoZIhvcNAQEFBQADggEBAE2c
YyICkf5SNZN8tlvohlopok2avNkW4IoEkE2uIQC+nIFbaG6QGv0aN3CFUPIChxw4
9O+dQfVPU2bUwCKAAIJ6CUJJwxzJTJ+S+Wb0IR8kZ0+Dar06GfEEmeowBb+nPb9x
rD46uirFBRJT61xv7S1LwPUA4ZVFyWK1iWZLKwH8ZimjCpoFrvefUSqcOxgD7cR8
M2KTMEmrxNEH9BisliQewvo37YLbBmaN+yWTNXs5iOiOcOnIvgDE96dng/g9r4tx
WyU7HVbN0BWGMdHLVzoAtRx8PplEzryJp3g3UO2hthbNciDJH2CyisViMCbwqrZz
yo7WujEKIaJuQEtmMBE=
-----END X509 CRL-----

41
certs/crl/crl.revoked Normal file
View File

@ -0,0 +1,41 @@
Certificate Revocation List (CRL):
Version 2 (0x1)
Signature Algorithm: sha1WithRSAEncryption
Issuer: /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
Last Update: Jun 17 21:32:30 2013 GMT
Next Update: Dec 14 21:32:30 2013 GMT
CRL extensions:
X509v3 CRL Number:
86
Revoked Certificates:
Serial Number: 02
Revocation Date: Jun 17 21:32:30 2013 GMT
Signature Algorithm: sha1WithRSAEncryption
87:3b:bb:ac:6b:1a:e8:96:87:6f:a3:8e:39:77:28:01:a7:ea:
76:36:c2:48:e2:41:02:3f:f3:f7:64:09:60:91:87:9e:57:74:
38:a0:c3:20:47:7d:82:4b:2c:34:23:fe:66:dc:2b:3e:8a:a1:
d9:e3:06:ec:75:0f:b1:ef:32:e2:28:ab:7d:40:2c:82:59:74:
c9:95:b5:62:a6:6a:8e:34:e6:f6:f8:91:ff:aa:c1:21:93:79:
cb:6f:dc:be:94:21:b1:c8:dd:9e:b8:fe:ad:e8:50:6e:0d:76:
92:32:54:51:96:cd:c7:be:d2:0f:6f:63:69:5f:b3:28:c1:57:
0e:61:f7:62:81:9f:ea:e7:a5:14:89:41:56:63:46:da:bc:d8:
e0:78:44:c6:c7:1a:ab:1b:f1:0b:59:d5:4e:6d:14:bc:16:c2:
02:43:06:0b:f4:16:6e:26:8c:36:09:61:0c:53:3f:72:85:64:
33:4d:bf:70:44:c8:23:83:c3:51:98:a8:14:f7:b2:03:a1:7b:
72:48:4d:24:d0:a8:a9:22:3d:9b:94:bf:24:24:01:6f:2e:4b:
2b:21:24:8f:64:46:20:79:45:b3:45:1a:4f:93:10:e1:8d:04:
4c:8d:83:63:96:9f:28:c5:37:0f:10:8e:02:9b:4d:96:8b:ea:
a3:31:88:9f
-----BEGIN X509 CRL-----
MIICADCB6QIBATANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMCVVMxEDAOBgNV
BAgTB01vbnRhbmExEDAOBgNVBAcTB0JvemVtYW4xETAPBgNVBAoTCFNhd3Rvb3Ro
MRMwEQYDVQQLEwpDb25zdWx0aW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbRcNMTMwNjE3MjEzMjMwWhcNMTMx
MjE0MjEzMjMwWjAUMBICAQIXDTEzMDYxNzIxMzIzMFqgDjAMMAoGA1UdFAQDAgFW
MA0GCSqGSIb3DQEBBQUAA4IBAQCHO7usaxrolodvo445dygBp+p2NsJI4kECP/P3
ZAlgkYeeV3Q4oMMgR32CSyw0I/5m3Cs+iqHZ4wbsdQ+x7zLiKKt9QCyCWXTJlbVi
pmqONOb2+JH/qsEhk3nLb9y+lCGxyN2euP6t6FBuDXaSMlRRls3HvtIPb2NpX7Mo
wVcOYfdigZ/q56UUiUFWY0bavNjgeETGxxqrG/ELWdVObRS8FsICQwYL9BZuJow2
CWEMUz9yhWQzTb9wRMgjg8NRmKgU97IDoXtySE0k0KipIj2blL8kJAFvLksrISSP
ZEYgeUWzRRpPkxDhjQRMjYNjlp8oxTcPEI4Cm02Wi+qjMYif
-----END X509 CRL-----

24
certs/crl/eccCliCRL.pem Normal file
View File

@ -0,0 +1,24 @@
Certificate Revocation List (CRL):
Version 2 (0x1)
Signature Algorithm: ecdsa-with-SHA1
Issuer: /C=US/ST=Oregon/L=Salem/O=Client ECC/OU=Fast/CN=www.yassl.com/emailAddress=info@yassl.com
Last Update: Jun 17 21:32:30 2013 GMT
Next Update: Dec 14 21:32:30 2013 GMT
CRL extensions:
X509v3 CRL Number:
88
No Revoked Certificates.
Signature Algorithm: ecdsa-with-SHA1
30:45:02:21:00:eb:6e:1b:5d:f9:43:f9:67:5b:4e:d1:6d:30:
c7:c1:57:a3:e6:25:af:87:7a:77:8d:d9:89:47:1d:a4:64:0e:
21:02:20:11:20:49:d5:84:47:fa:12:61:46:ec:b6:db:0e:d0:
9d:3d:95:24:4f:a3:43:ab:d0:ad:dd:d9:61:b7:49:e2:5e
-----BEGIN X509 CRL-----
MIIBIDCByAIBATAJBgcqhkjOPQQBMIGJMQswCQYDVQQGEwJVUzEPMA0GA1UECBMG
T3JlZ29uMQ4wDAYDVQQHEwVTYWxlbTETMBEGA1UEChMKQ2xpZW50IEVDQzENMAsG
A1UECxMERmFzdDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJ
ARYOaW5mb0B5YXNzbC5jb20XDTEzMDYxNzIxMzIzMFoXDTEzMTIxNDIxMzIzMFqg
DjAMMAoGA1UdFAQDAgFYMAkGByqGSM49BAEDSAAwRQIhAOtuG135Q/lnW07RbTDH
wVej5iWvh3p3jdmJRx2kZA4hAiARIEnVhEf6EmFG7LbbDtCdPZUkT6NDq9Ct3dlh
t0niXg==
-----END X509 CRL-----

24
certs/crl/eccSrvCRL.pem Normal file
View File

@ -0,0 +1,24 @@
Certificate Revocation List (CRL):
Version 2 (0x1)
Signature Algorithm: ecdsa-with-SHA1
Issuer: /C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC/CN=www.yassl.com/emailAddress=info@yassl.com
Last Update: Jun 17 21:32:30 2013 GMT
Next Update: Dec 14 21:32:30 2013 GMT
CRL extensions:
X509v3 CRL Number:
89
No Revoked Certificates.
Signature Algorithm: ecdsa-with-SHA1
30:44:02:20:0c:78:df:c4:4b:8b:e0:70:15:4f:f6:7d:82:d6:
0d:dd:a5:a0:e2:6a:95:4b:2b:6b:29:14:15:ba:51:0d:e3:1f:
02:20:2b:4b:1d:7c:9d:2f:5a:01:3d:9b:c1:94:cd:10:86:fe:
e2:9d:a0:b2:3c:97:10:ba:a6:56:43:78:b3:92:9b:0b
-----BEGIN X509 CRL-----
MIIBITCBygIBATAJBgcqhkjOPQQBMIGLMQswCQYDVQQGEwJVUzETMBEGA1UECBMK
V2FzaGluZ3RvbjEQMA4GA1UEBxMHU2VhdHRsZTEQMA4GA1UEChMHRWxpcHRpYzEM
MAoGA1UECxMDRUNDMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcN
AQkBFg5pbmZvQHlhc3NsLmNvbRcNMTMwNjE3MjEzMjMwWhcNMTMxMjE0MjEzMjMw
WqAOMAwwCgYDVR0UBAMCAVkwCQYHKoZIzj0EAQNHADBEAiAMeN/ES4vgcBVP9n2C
1g3dpaDiapVLK2spFBW6UQ3jHwIgK0sdfJ0vWgE9m8GUzRCG/uKdoLI8lxC6plZD
eLOSmws=
-----END X509 CRL-----

57
certs/crl/gencrls.sh Executable file
View File

@ -0,0 +1,57 @@
#!/bin/bash
# gencrls, crl config already done, see taoCerts.txt for setup
# caCrl
openssl ca -gencrl -crldays 180 -out crl.pem -keyfile ~/cyassl/certs/ca-key.pem -cert ~/cyassl/certs/ca-cert.pem
# metadata
openssl crl -in crl.pem -text > tmp
mv tmp crl.pem
# install
cp crl.pem ~/cyassl/certs/crl/crl.pem
# caCrl server revoked
openssl ca -revoke ~/cyassl/certs/server-cert.pem -keyfile ~/cyassl/certs/ca-key.pem -cert ~/cyassl/certs/ca-cert.pem
# caCrl server revoked generation
openssl ca -gencrl -crldays 180 -out crl.revoked -keyfile ~/cyassl/certs/ca-key.pem -cert ~/cyassl/certs/ca-cert.pem
# metadata
openssl crl -in crl.revoked -text > tmp
mv tmp crl.revoked
# install
cp crl.revoked ~/cyassl/certs/crl/crl.revoked
# remove revoked so next time through the normal CA won't have server revoked
cp blank.index.txt demoCA/index.txt
# cliCrl
openssl ca -gencrl -crldays 180 -out cliCrl.pem -keyfile ~/cyassl/certs/client-key.pem -cert ~/cyassl/certs/client-cert.pem
# metadata
openssl crl -in cliCrl.pem -text > tmp
mv tmp cliCrl.pem
# install
cp cliCrl.pem ~/cyassl/certs/crl/cliCrl.pem
# eccCliCRL
openssl ca -gencrl -crldays 180 -out eccCliCRL.pem -keyfile ~/cyassl/certs/ecc-client-key.pem -cert ~/cyassl/certs/client-ecc-cert.pem
# metadata
openssl crl -in eccCliCRL.pem -text > tmp
mv tmp eccCliCRL.pem
# install
cp eccCliCRL.pem ~/cyassl/certs/crl/eccCliCRL.pem
# eccSrvCRL
openssl ca -gencrl -crldays 180 -out eccSrvCRL.pem -keyfile ~/cyassl/certs/ecc-key.pem -cert ~/cyassl/certs/server-ecc.pem
# metadata
openssl crl -in eccSrvCRL.pem -text > tmp
mv tmp eccSrvCRL.pem
# install
cp eccSrvCRL.pem ~/cyassl/certs/crl/eccSrvCRL.pem

14
certs/crl/include.am Normal file
View File

@ -0,0 +1,14 @@
# vim:ft=automake
# All paths should be given relative to the root
#
EXTRA_DIST += \
certs/crl/crl.pem \
certs/crl/cliCrl.pem \
certs/crl/eccSrvCRL.pem \
certs/crl/eccCliCRL.pem
EXTRA_DIST += \
certs/crl/crl.revoked

View File

@ -2,7 +2,7 @@
# All paths should be given relative to the root
#
certs_DATA+= \
EXTRA_DIST += \
certs/ca-cert.pem \
certs/ca-key.pem \
certs/client-cert.pem \
@ -10,10 +10,13 @@ certs_DATA+= \
certs/client-key.pem \
certs/ecc-key.pem \
certs/ecc-keyPkcs8.pem \
certs/ecc-client-key.pem \
certs/client-ecc-cert.pem \
certs/ntru-cert.pem \
certs/dh2048.pem \
certs/server-cert.pem \
certs/server-ecc.pem \
certs/server-ecc-rsa.pem \
certs/server-keyEnc.pem \
certs/server-key.pem \
certs/server-keyPkcs8Enc12.pem \
@ -21,7 +24,7 @@ certs_DATA+= \
certs/server-keyPkcs8Enc.pem \
certs/server-keyPkcs8.pem
certs_DATA+= \
EXTRA_DIST += \
certs/ca-key.der \
certs/client-cert.der \
certs/client-key.der \
@ -30,9 +33,8 @@ certs_DATA+= \
certs/dsa2048.der \
certs/ecc-key.der
EXTRA_DIST+= ${certs_DATA}
doc_DATA+= certs/taoCert.txt
dist_doc_DATA+= certs/taoCert.txt
EXTRA_DIST+= certs/ntru-key.raw

View File

@ -1,28 +1,28 @@
-----BEGIN CERTIFICATE-----
MIIEyTCCA7GgAwIBAgIIASZ+ezr7rN0wDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNV
MIIEyTCCA7GgAwIBAgIIAfivVvmTrhEwDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNV
BAYTAlVTMRAwDgYDVQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYD
VQQKEwhTYXd0b290aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3
Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wIhgPMjAx
MTEyMDUwMDE2MzdaGA8yMDEzMDQxOTAxMTYzN1owgYoxCzAJBgNVBAYTAlVTMQsw
MzA2MTYyMTE1NTdaGA8yMDE0MTAzMDIxMTU1N1owgYoxCzAJBgNVBAYTAlVTMQsw
CQYDVQQIEwJPUjERMA8GA1UEBxMIUG9ydGxhbmQxDjAMBgNVBAoTBXlhU1NMMRQw
EgYDVQQLEwtEZXZlbG9wbWVudDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsG
CSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggJLMBgGCisGAQQBwXABAQIGCisG
AQQBwXABAi4DggItAASCAihFDRAy0fOBZth/IRQFJeuEUgrViJfGvKOUuNW6yYmn
9/YXT2I3/aiBZ/udSehoEFVPNgLs/ZWwNrsIuETH5TPkS1e9Ig4I5G839deKT89M
Qpq7GiKLwlLY3He/a6O+/UMEFH4ShdhDopsH2+IsWCX0H7Lvp8L8RqURrQNFXvlr
xRAFiBixEQNry2HyEcVz/9TQSdifE4KGUtneErqsk1/Sms1m1/NqW30H77YerJfs
QWsOEgasoJnYWS6knJC4XsUbJKqKcHRc6XeODOyf72J3ESvES2C+cqEsShxVP7zG
hDiHurwfyvIAUL4bZSBtlAqt60iOEsXScXwdbNrj+4iuFAyjX8+JrxGMbDNi3X5l
L2RLUiEIKUSGUozbDlR3jU2WoHUm76mZwjGe1+vOKpvqh5yrRoyqiDERj8wsGrDO
MdoheW1xSjQ3p5fQ/UOtagWA5Lh/MqbCIHdMzMLpbOmfhFJA5BXaNg/qThhjpmvf
csYfwWCWukKKbjfY7cxOVMuUN0VvoYBjOxt5UQhXuPjH/+5s4J7E/IxQrWz6fhcG
wfvJjWJjedfhP23Jm4zodbwtU6MgPF641DcAwcnBqSi/Ugi7d0YeHMqTJkSnIJZV
r3v1YLuqiFDzB6bx69DGpCxFMxIpdOPq4a9WpeQQ9H7cBK0HFl4tRPNnQ2XCrKMc
86gQ35aaM2vPvgj0d/zgC0AG8WFQEG1wYBvLEgfiQsi7auXoScYZA8AwDQYJKoZI
hvcNAQEFBQADggEBAJ7eyiJIGiyyrhAdaYOit3U3CUkGSatNXTkn8PRO8SwzPWCi
FQ+4AePYV+/ovtNZiqLwm7mVa3s2CS8LCk2s9/ld22cDJNV+gDkzrelUyTLUi0jr
zZJwEiaNXIEkYrLGifSzoNUgQBTzDmOSkm2UpIX70GTsXF73FKdqonf1VTnopVKa
XZDpIG3/TKyh8jCwowMrkxnHS886FhXiHGCBzM1rnp3S+r3b+rTqoKoeuZQnDgJP
IZwnZL6agtwbUfmZj6/868irlsLtC9M5nKBtj/U/tQIrW52XEhBqChmTXIq0JNL1
++kWLLeu9t0T53Pth3VxMT/ePV0aURQvjINm60o=
AQQBwXABAi4DggItAASCAij5Bo9I8+pNpd+UbAjYSxjlZ9p6zo855iaDFlgwp1mU
pJEDcr3RE218YmGaZL9vjqso/rNvP1MOv2GvGkcWU10gc+uD1bdvK8sBLNlm2LXI
4x7uaiPZNQSDpHM8NA4sawN7dHir/Xk199qYbG/w3xK3PBZevul1CRob1CjAa9bY
K84qC0z1BsGGodP0Lyv2vC5JHxCdh7cUvfElea8lMAbYyzFmrdjxfErj98bq7VNE
wAPjwSEzlmTaGZ2BV7R1Gs1HeM6ZV17xzWxcdSf3kPJFYw35+ouhrre7SxxTnJAX
65Y+qXj4xChKta1KI3WBrO1DDd0axxPaqw/jGZi1/X3C0sAaG3acyPEq++4GS0Zv
eveLZ3OzC5D4qtYe+V4GXtChB+341shmAG9YFo4ot/98u3TwAdO1XSgaP4UYfxMK
SNXOFdwRpy+FCjms8b9Qsk8mSj7WVv4+FVr017ce+yFyE0IHeiuRuvZ+QRraqwLI
XOfAvp2/PWmlovdk7PKADFSV+Znx+coH4PR0enLq9wkVVAFyFCmCKxpOd+15/1JD
Fqtb2+HV7W8254OB70vzzVo9eVzn9DUYA04HHYqN9mY7RB2cHZ5lJa3awKESlg7a
7IUfBy3l+q+FdEnNtiz0sAXua3oJgMxagJcIb5FSVMBy8f40ertb6VhDFvlniuNL
xE2MAmriJeFaJyO2sXFJByHOwEwxj4+rteeUrmTfCamx5EDG5pN8noAwDQYJKoZI
hvcNAQEFBQADggEBAISRCm3JpSm6YoLDgrL0ytSibcAFP9Mtua0ocYy00O2SJ8yM
Me+OGE1u89Nj317gPMeDskI2Ifkl80o8l6Gik3jLDGlaRvrlH0iT3B+HFSVGwir9
T5agGjVpjcrWZi9BENRtLS8ILttjd0UvkpsR4QViIc50KAyhC4ogut8rsYLBUP87
K8iGV/MVWa1COx0WLfIMlSCiz6ryh4aLfFB55kPWfSTOHAIbUZ82mPozJ+MmC1P2
EzEhN4Usp+Q3GmikyXcefm8DSUpayN6bXlZ14ikTLFtTw0v/Upgr+MdfKH+SrK4Z
lQQlbfJKww4sWKoEfZMFhZco6qOrF7iHo/vmpOc=
-----END CERTIFICATE-----

Binary file not shown.

54
certs/server-ecc-rsa.pem Normal file
View File

@ -0,0 +1,54 @@
Certificate:
Data:
Version: 1 (0x0)
Serial Number: 9 (0x9)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
Validity
Not Before: Aug 8 21:58:29 2012 GMT
Not After : May 5 21:58:29 2015 GMT
Subject: C=US, ST=Washington, L=Seattle, O=Elliptic - RSAsig, OU=ECC-RSAsig, CN=www.yassl.com/emailAddress=info@yassl.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
EC Public Key:
pub:
04:bb:33:ac:4c:27:50:4a:c6:4a:a5:04:c3:3c:de:
9f:36:db:72:2d:ce:94:ea:2b:fa:cb:20:09:39:2c:
16:e8:61:02:e9:af:4d:d3:02:93:9a:31:5b:97:92:
21:7f:f0:cf:18:da:91:11:02:34:86:e8:20:58:33:
0b:80:34:89:d8
ASN1 OID: prime256v1
Signature Algorithm: sha1WithRSAEncryption
a0:1c:de:98:e8:61:c8:fb:0a:0e:af:ea:99:4b:c0:49:e6:66:
68:5e:7a:18:b8:0c:e3:0f:16:86:bc:b5:86:79:02:69:1c:b7:
e7:ff:53:d9:05:5d:27:39:24:54:67:14:de:ef:8e:c2:a0:11:
ca:c8:27:99:b9:d6:e9:71:1f:86:c9:8f:b1:74:a2:9f:93:6a:
0c:74:cf:17:77:8c:26:08:6e:a8:ac:69:d4:55:15:a2:95:87:
43:7a:ab:72:93:73:40:58:c2:bb:9c:89:f2:73:20:69:df:f1:
f3:65:08:9c:00:67:97:a6:71:00:2b:31:84:10:ac:bd:54:ac:
fd:b3:eb:12:36:77:f6:0a:e3:9a:96:d2:a6:22:bc:1d:6b:ce:
3c:0d:7b:d9:1c:1d:f1:ee:ec:ce:83:c8:98:c9:65:3e:06:31:
c3:b2:87:da:09:b4:90:0b:e2:6b:29:0e:d6:ae:53:1d:10:98:
e2:dc:f9:63:38:a1:a2:af:46:23:a4:4c:ab:0c:0b:08:be:cd:
a4:a6:6d:46:f0:f8:e0:31:99:85:39:10:4a:a0:04:54:3b:21:
e1:e9:b4:f3:a5:06:cd:37:ae:2c:ca:5d:ac:90:b5:ab:92:81:
aa:bf:2d:3f:8e:ee:4d:12:81:0a:8e:a4:ca:87:93:af:b0:25:
7e:e2:07:f7
-----BEGIN CERTIFICATE-----
MIIC1zCCAb8CAQkwDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNVBAYTAlVTMRAwDgYD
VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wHhcNMTIwODA4MjE1ODI5WhcN
MTUwNTA1MjE1ODI5WjCBnDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0
b24xEDAOBgNVBAcTB1NlYXR0bGUxGjAYBgNVBAoTEUVsbGlwdGljIC0gUlNBc2ln
MRMwEQYDVQQLEwpFQ0MtUlNBc2lnMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
AwEHA0IABLszrEwnUErGSqUEwzzenzbbci3OlOor+ssgCTksFuhhAumvTdMCk5ox
W5eSIX/wzxjakRECNIboIFgzC4A0idgwDQYJKoZIhvcNAQEFBQADggEBAKAc3pjo
Ycj7Cg6v6plLwEnmZmheehi4DOMPFoa8tYZ5Amkct+f/U9kFXSc5JFRnFN7vjsKg
EcrIJ5m51ulxH4bJj7F0op+Tagx0zxd3jCYIbqisadRVFaKVh0N6q3KTc0BYwruc
ifJzIGnf8fNlCJwAZ5emcQArMYQQrL1UrP2z6xI2d/YK45qW0qYivB1rzjwNe9kc
HfHu7M6DyJjJZT4GMcOyh9oJtJAL4mspDtauUx0QmOLc+WM4oaKvRiOkTKsMCwi+
zaSmbUbw+OAxmYU5EEqgBFQ7IeHptPOlBs03rizKXayQtauSgaq/LT+O7k0SgQqO
pMqHk6+wJX7iB/c=
-----END CERTIFICATE-----

View File

@ -30,6 +30,22 @@ same as self signed, use ca prefix instead of client
3) openssl x509 -req -in server-req.pem -days 1000 -md5 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > server-cert.pem
***** Adding Subject Key ID and Authentication Key ID extensions to a cert *****
Create a config file for OpenSSL with the example contents:
[skidakid]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid
Add to the openssl command for creating a cert signed by a CA step 3 the
following options:
-extfile <file.cnf> -extensions skidakid
anywhere before the redirect. This will add the cert's public key hash as the
Subject Key Identifier, and the signer's SKID as the Authentication Key ID.
***** To create a dsa cert ********************
@ -112,7 +128,7 @@ openssl dhparam -in dh2048.param -text > dh2048.pem
1) create a crl
a) openssl ca -gencrl -out crl.pem -keyfile ./ca-key.pem -cert ./ca-cert.pem
a) openssl ca -gencrl -crldays 120 -out crl.pem -keyfile ./ca-key.pem -cert ./ca-cert.pem
Error No ./CA root/index.txt so:

34
commit-tests.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
#commit-tests.sh
# make sure current config is ok
echo -e "\n\nTesting current config...\n\n"
make clean; make -j 8 test;
RESULT=$?
[ $RESULT -ne 0 ] && echo -e "\n\nCurrent config make test failed" && exit 1
# make sure basic config is ok
echo -e "\n\nTesting basic config too...\n\n"
./configure --disable-fastmath;
RESULT=$?
[ $RESULT -ne 0 ] && echo -e "\n\nBasic config ./configure failed" && exit 1
make -j 8 test;
RESULT=$?
[ $RESULT -ne 0 ] && echo -e "\n\nBasic config make test failed" && exit 1
# make sure full config is ok
echo -e "\n\nTesting full config as well...\n\n"
./configure --enable-opensslextra --enable-ecc --enable-dtls --enable-aesgcm --enable-aesccm --enable-hc128 --enable-sniffer --enable-psk --enable-rabbit --enable-camellia --enable-sha512;
RESULT=$?
[ $RESULT -ne 0 ] && echo -e "\n\nFull config ./configure failed" && exit 1
make -j 8 test;
RESULT=$?
[ $RESULT -ne 0 ] && echo -e "\n\nFull config make test failed" && exit 1
exit 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -7,3 +7,4 @@ ctaocrypt_benchmark_benchmark_LDADD = src/libcyassl.la
ctaocrypt_benchmark_benchmark_DEPENDENCIES = src/libcyassl.la
EXTRA_DIST += ctaocrypt/benchmark/benchmark.sln
EXTRA_DIST += ctaocrypt/benchmark/benchmark.vcproj
DISTCLEANFILES+= ctaocrypt/benchmark/.libs/benchmark

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* aes_asm.s
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
@ -25,12 +25,14 @@
*/
//AES_CBC_encrypt (const unsigned char *in,
// unsigned char *out,
// unsigned char ivec[16],
// unsigned long length,
// const unsigned char *KS,
// int nr)
/*
AES_CBC_encrypt (const unsigned char *in,
unsigned char *out,
unsigned char ivec[16],
unsigned long length,
const unsigned char *KS,
int nr)
*/
.globl AES_CBC_encrypt
AES_CBC_encrypt:
# parameter 1: %rdi
@ -82,12 +84,15 @@ ret
//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 (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:
# parameter 1: %rdi
@ -258,10 +263,331 @@ DEND_4:
ret
/*
AES_ECB_encrypt (const unsigned char *in,
unsigned char *out,
unsigned long length,
const unsigned char *KS,
int nr)
*/
.globl AES_ECB_encrypt
AES_ECB_encrypt:
# parameter 1: %rdi
# parameter 2: %rsi
# parameter 3: %rdx
# parameter 4: %rcx
# parameter 5: %r8d
movq %rdx, %r10
shrq $4, %rdx
shlq $60, %r10
je EECB_NO_PARTS_4
addq $1, %rdx
EECB_NO_PARTS_4:
movq %rdx, %r10
shlq $62, %r10
shrq $62, %r10
shrq $2, %rdx
je EECB_REMAINDER_4
subq $64, %rsi
EECB_LOOP_4:
movdqu (%rdi), %xmm1
movdqu 16(%rdi), %xmm2
movdqu 32(%rdi), %xmm3
movdqu 48(%rdi), %xmm4
movdqa (%rcx), %xmm9
movdqa 16(%rcx), %xmm10
movdqa 32(%rcx), %xmm11
movdqa 48(%rcx), %xmm12
pxor %xmm9, %xmm1
pxor %xmm9, %xmm2
pxor %xmm9, %xmm3
pxor %xmm9, %xmm4
aesenc %xmm10, %xmm1
aesenc %xmm10, %xmm2
aesenc %xmm10, %xmm3
aesenc %xmm10, %xmm4
aesenc %xmm11, %xmm1
aesenc %xmm11, %xmm2
aesenc %xmm11, %xmm3
aesenc %xmm11, %xmm4
aesenc %xmm12, %xmm1
aesenc %xmm12, %xmm2
aesenc %xmm12, %xmm3
aesenc %xmm12, %xmm4
movdqa 64(%rcx), %xmm9
movdqa 80(%rcx), %xmm10
movdqa 96(%rcx), %xmm11
movdqa 112(%rcx), %xmm12
aesenc %xmm9, %xmm1
aesenc %xmm9, %xmm2
aesenc %xmm9, %xmm3
aesenc %xmm9, %xmm4
aesenc %xmm10, %xmm1
aesenc %xmm10, %xmm2
aesenc %xmm10, %xmm3
aesenc %xmm10, %xmm4
aesenc %xmm11, %xmm1
aesenc %xmm11, %xmm2
aesenc %xmm11, %xmm3
aesenc %xmm11, %xmm4
aesenc %xmm12, %xmm1
aesenc %xmm12, %xmm2
aesenc %xmm12, %xmm3
aesenc %xmm12, %xmm4
movdqa 128(%rcx), %xmm9
movdqa 144(%rcx), %xmm10
movdqa 160(%rcx), %xmm11
cmpl $12, %r8d
aesenc %xmm9, %xmm1
aesenc %xmm9, %xmm2
aesenc %xmm9, %xmm3
aesenc %xmm9, %xmm4
aesenc %xmm10, %xmm1
aesenc %xmm10, %xmm2
aesenc %xmm10, %xmm3
aesenc %xmm10, %xmm4
jb EECB_LAST_4
movdqa 160(%rcx), %xmm9
movdqa 176(%rcx), %xmm10
movdqa 192(%rcx), %xmm11
cmpl $14, %r8d
aesenc %xmm9, %xmm1
aesenc %xmm9, %xmm2
aesenc %xmm9, %xmm3
aesenc %xmm9, %xmm4
aesenc %xmm10, %xmm1
aesenc %xmm10, %xmm2
aesenc %xmm10, %xmm3
aesenc %xmm10, %xmm4
jb EECB_LAST_4
movdqa 192(%rcx), %xmm9
movdqa 208(%rcx), %xmm10
movdqa 224(%rcx), %xmm11
aesenc %xmm9, %xmm1
aesenc %xmm9, %xmm2
aesenc %xmm9, %xmm3
aesenc %xmm9, %xmm4
aesenc %xmm10, %xmm1
aesenc %xmm10, %xmm2
aesenc %xmm10, %xmm3
aesenc %xmm10, %xmm4
EECB_LAST_4:
addq $64, %rdi
addq $64, %rsi
decq %rdx
aesenclast %xmm11, %xmm1
aesenclast %xmm11, %xmm2
aesenclast %xmm11, %xmm3
aesenclast %xmm11, %xmm4
movdqu %xmm1, (%rsi)
movdqu %xmm2, 16(%rsi)
movdqu %xmm3, 32(%rsi)
movdqu %xmm4, 48(%rsi)
jne EECB_LOOP_4
addq $64, %rsi
EECB_REMAINDER_4:
cmpq $0, %r10
je EECB_END_4
EECB_LOOP_4_2:
movdqu (%rdi), %xmm1
addq $16, %rdi
pxor (%rcx), %xmm1
movdqu 160(%rcx), %xmm2
aesenc 16(%rcx), %xmm1
aesenc 32(%rcx), %xmm1
aesenc 48(%rcx), %xmm1
aesenc 64(%rcx), %xmm1
aesenc 80(%rcx), %xmm1
aesenc 96(%rcx), %xmm1
aesenc 112(%rcx), %xmm1
aesenc 128(%rcx), %xmm1
aesenc 144(%rcx), %xmm1
cmpl $12, %r8d
jb EECB_LAST_4_2
movdqu 192(%rcx), %xmm2
aesenc 160(%rcx), %xmm1
aesenc 176(%rcx), %xmm1
cmpl $14, %r8d
jb EECB_LAST_4_2
movdqu 224(%rcx), %xmm2
aesenc 192(%rcx), %xmm1
aesenc 208(%rcx), %xmm1
EECB_LAST_4_2:
aesenclast %xmm2, %xmm1
movdqu %xmm1, (%rsi)
addq $16, %rsi
decq %r10
jne EECB_LOOP_4_2
EECB_END_4:
ret
//void AES_128_Key_Expansion(const unsigned char* userkey,
// unsigned char* key_schedule);
/*
AES_ECB_decrypt (const unsigned char *in,
unsigned char *out,
unsigned long length,
const unsigned char *KS,
int nr)
*/
.globl AES_ECB_decrypt
AES_ECB_decrypt:
# parameter 1: %rdi
# parameter 2: %rsi
# parameter 3: %rdx
# parameter 4: %rcx
# parameter 5: %r8d
movq %rdx, %r10
shrq $4, %rdx
shlq $60, %r10
je DECB_NO_PARTS_4
addq $1, %rdx
DECB_NO_PARTS_4:
movq %rdx, %r10
shlq $62, %r10
shrq $62, %r10
shrq $2, %rdx
je DECB_REMAINDER_4
subq $64, %rsi
DECB_LOOP_4:
movdqu (%rdi), %xmm1
movdqu 16(%rdi), %xmm2
movdqu 32(%rdi), %xmm3
movdqu 48(%rdi), %xmm4
movdqa (%rcx), %xmm9
movdqa 16(%rcx), %xmm10
movdqa 32(%rcx), %xmm11
movdqa 48(%rcx), %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(%rcx), %xmm9
movdqa 80(%rcx), %xmm10
movdqa 96(%rcx), %xmm11
movdqa 112(%rcx), %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(%rcx), %xmm9
movdqa 144(%rcx), %xmm10
movdqa 160(%rcx), %xmm11
cmpl $12, %r8d
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 DECB_LAST_4
movdqa 160(%rcx), %xmm9
movdqa 176(%rcx), %xmm10
movdqa 192(%rcx), %xmm11
cmpl $14, %r8d
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 DECB_LAST_4
movdqa 192(%rcx), %xmm9
movdqa 208(%rcx), %xmm10
movdqa 224(%rcx), %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
DECB_LAST_4:
addq $64, %rdi
addq $64, %rsi
decq %rdx
aesdeclast %xmm11, %xmm1
aesdeclast %xmm11, %xmm2
aesdeclast %xmm11, %xmm3
aesdeclast %xmm11, %xmm4
movdqu %xmm1, (%rsi)
movdqu %xmm2, 16(%rsi)
movdqu %xmm3, 32(%rsi)
movdqu %xmm4, 48(%rsi)
jne DECB_LOOP_4
addq $64, %rsi
DECB_REMAINDER_4:
cmpq $0, %r10
je DECB_END_4
DECB_LOOP_4_2:
movdqu (%rdi), %xmm1
addq $16, %rdi
pxor (%rcx), %xmm1
movdqu 160(%rcx), %xmm2
cmpl $12, %r8d
aesdec 16(%rcx), %xmm1
aesdec 32(%rcx), %xmm1
aesdec 48(%rcx), %xmm1
aesdec 64(%rcx), %xmm1
aesdec 80(%rcx), %xmm1
aesdec 96(%rcx), %xmm1
aesdec 112(%rcx), %xmm1
aesdec 128(%rcx), %xmm1
aesdec 144(%rcx), %xmm1
jb DECB_LAST_4_2
cmpl $14, %r8d
movdqu 192(%rcx), %xmm2
aesdec 160(%rcx), %xmm1
aesdec 176(%rcx), %xmm1
jb DECB_LAST_4_2
movdqu 224(%rcx), %xmm2
aesdec 192(%rcx), %xmm1
aesdec 208(%rcx), %xmm1
DECB_LAST_4_2:
aesdeclast %xmm2, %xmm1
movdqu %xmm1, (%rsi)
addq $16, %rsi
decq %r10
jne DECB_LOOP_4_2
DECB_END_4:
ret
/*
void AES_128_Key_Expansion(const unsigned char* userkey,
unsigned char* key_schedule);
*/
.align 16,0x90
.globl AES_128_Key_Expansion
AES_128_Key_Expansion:
@ -319,8 +645,10 @@ pxor %xmm2, %xmm1
ret
//void AES_192_Key_Expansion (const unsigned char *userkey,
// unsigned char *key)
/*
void AES_192_Key_Expansion (const unsigned char *userkey,
unsigned char *key)
*/
.globl AES_192_Key_Expansion
AES_192_Key_Expansion:
# parameter 1: %rdi
@ -403,8 +731,10 @@ pxor %xmm2, %xmm3
ret
//void AES_256_Key_Expansion (const unsigned char *userkey,
// unsigned char *key)
/*
void AES_256_Key_Expansion (const unsigned char *userkey,
unsigned char *key)
*/
.globl AES_256_Key_Expansion
AES_256_Key_Expansion:
# parameter 1: %rdi

View File

@ -1,6 +1,6 @@
/* arc4.c
*
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
@ -23,14 +23,30 @@
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#ifndef NO_RC4
#include <cyassl/ctaocrypt/arc4.h>
#ifdef HAVE_CAVIUM
static void Arc4CaviumSetKey(Arc4* arc4, const byte* key, word32 length);
static void Arc4CaviumProcess(Arc4* arc4, byte* out, const byte* in,
word32 length);
#endif
void Arc4SetKey(Arc4* arc4, const byte* key, word32 length)
{
word32 i;
word32 keyIndex = 0, stateIndex = 0;
#ifdef HAVE_CAVIUM
if (arc4->magic == CYASSL_ARC4_CAVIUM_MAGIC)
return Arc4CaviumSetKey(arc4, key, length);
#endif
arc4->x = 1;
arc4->y = 0;
@ -66,8 +82,16 @@ static INLINE byte MakeByte(word32* x, word32* y, byte* s)
void Arc4Process(Arc4* arc4, byte* out, const byte* in, word32 length)
{
word32 x = arc4->x;
word32 y = arc4->y;
word32 x;
word32 y;
#ifdef HAVE_CAVIUM
if (arc4->magic == CYASSL_ARC4_CAVIUM_MAGIC)
return Arc4CaviumProcess(arc4, out, in, length);
#endif
x = arc4->x;
y = arc4->y;
while(length--)
*out++ = *in++ ^ MakeByte(&x, &y, arc4->state);
@ -76,3 +100,80 @@ void Arc4Process(Arc4* arc4, byte* out, const byte* in, word32 length)
arc4->y = (byte)y;
}
#ifdef HAVE_CAVIUM
#include <cyassl/ctaocrypt/logging.h>
#include "cavium_common.h"
/* Initiliaze Arc4 for use with Nitrox device */
int Arc4InitCavium(Arc4* arc4, int devId)
{
if (arc4 == NULL)
return -1;
if (CspAllocContext(CONTEXT_SSL, &arc4->contextHandle, devId) != 0)
return -1;
arc4->devId = devId;
arc4->magic = CYASSL_ARC4_CAVIUM_MAGIC;
return 0;
}
/* Free Arc4 from use with Nitrox device */
void Arc4FreeCavium(Arc4* arc4)
{
if (arc4 == NULL)
return;
if (arc4->magic != CYASSL_ARC4_CAVIUM_MAGIC)
return;
CspFreeContext(CONTEXT_SSL, arc4->contextHandle, arc4->devId);
arc4->magic = 0;
}
static void Arc4CaviumSetKey(Arc4* arc4, const byte* key, word32 length)
{
word32 requestId;
if (CspInitializeRc4(CAVIUM_BLOCKING, arc4->contextHandle, length,
(byte*)key, &requestId, arc4->devId) != 0) {
CYASSL_MSG("Bad Cavium Arc4 Init");
}
}
static void Arc4CaviumProcess(Arc4* arc4, byte* out, const byte* in,
word32 length)
{
word offset = 0;
word32 requestId;
while (length > CYASSL_MAX_16BIT) {
word16 slen = (word16)CYASSL_MAX_16BIT;
if (CspEncryptRc4(CAVIUM_BLOCKING, arc4->contextHandle,CAVIUM_UPDATE,
slen, (byte*)in + offset, out + offset, &requestId,
arc4->devId) != 0) {
CYASSL_MSG("Bad Cavium Arc4 Encrypt");
}
length -= CYASSL_MAX_16BIT;
offset += CYASSL_MAX_16BIT;
}
if (length) {
word16 slen = (word16)length;
if (CspEncryptRc4(CAVIUM_BLOCKING, arc4->contextHandle,CAVIUM_UPDATE,
slen, (byte*)in + offset, out + offset, &requestId,
arc4->devId) != 0) {
CYASSL_MSG("Bad Cavium Arc4 Encrypt");
}
}
}
#endif /* HAVE_CAVIUM */
#endif /* NO_ARC4 */

View File

@ -1,6 +1,6 @@
/* asm.c
*
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
@ -23,6 +23,8 @@
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
/*
* Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,
* http://math.libtomcrypt.com
@ -41,7 +43,7 @@
mu = c[x] * mp
#define INNERMUL \
asm( \
__asm__( \
"movl %5,%%eax \n\t" \
"mull %4 \n\t" \
"addl %1,%%eax \n\t" \
@ -51,16 +53,16 @@ asm( \
"movl %%edx,%1 \n\t" \
:"=g"(_c[LO]), "=r"(cy) \
:"0"(_c[LO]), "1"(cy), "g"(mu), "g"(*tmpm++) \
: "%eax", "%edx", "%cc")
: "%eax", "%edx", "cc")
#define PROPCARRY \
asm( \
__asm__( \
"addl %1,%0 \n\t" \
"setb %%al \n\t" \
"movzbl %%al,%1 \n\t" \
:"=g"(_c[LO]), "=r"(cy) \
:"0"(_c[LO]), "1"(cy) \
: "%eax", "%cc")
: "%eax", "cc")
/******************************************************************/
#elif defined(TFM_X86_64)
@ -73,7 +75,7 @@ asm( \
mu = c[x] * mp
#define INNERMUL \
asm( \
__asm__( \
"movq %5,%%rax \n\t" \
"mulq %4 \n\t" \
"addq %1,%%rax \n\t" \
@ -83,10 +85,10 @@ asm( \
"movq %%rdx,%1 \n\t" \
:"=g"(_c[LO]), "=r"(cy) \
:"0"(_c[LO]), "1"(cy), "r"(mu), "r"(*tmpm++) \
: "%rax", "%rdx", "%cc")
: "%rax", "%rdx", "cc")
#define INNERMUL8 \
asm( \
__asm__( \
"movq 0(%5),%%rax \n\t" \
"movq 0(%2),%%r10 \n\t" \
"movq 0x8(%5),%%r11 \n\t" \
@ -176,17 +178,17 @@ asm( \
\
:"=r"(_c), "=r"(cy) \
: "0"(_c), "1"(cy), "g"(mu), "r"(tmpm)\
: "%rax", "%rdx", "%r10", "%r11", "%cc")
: "%rax", "%rdx", "%r10", "%r11", "cc")
#define PROPCARRY \
asm( \
__asm__( \
"addq %1,%0 \n\t" \
"setb %%al \n\t" \
"movzbq %%al,%1 \n\t" \
:"=g"(_c[LO]), "=r"(cy) \
:"0"(_c[LO]), "1"(cy) \
: "%rax", "%cc")
: "%rax", "cc")
/******************************************************************/
#elif defined(TFM_SSE2)
@ -200,13 +202,13 @@ asm( \
*/
#define MONT_START \
asm("movd %0,%%mm2"::"g"(mp))
__asm__("movd %0,%%mm2"::"g"(mp))
#define MONT_FINI \
asm("emms")
__asm__("emms")
#define LOOP_START \
asm( \
__asm__( \
"movd %0,%%mm1 \n\t" \
"pxor %%mm3,%%mm3 \n\t" \
"pmuludq %%mm2,%%mm1 \n\t" \
@ -214,7 +216,7 @@ asm( \
/* pmuludq on mmx registers does a 32x32->64 multiply. */
#define INNERMUL \
asm( \
__asm__( \
"movd %1,%%mm4 \n\t" \
"movd %2,%%mm0 \n\t" \
"paddq %%mm4,%%mm3 \n\t" \
@ -225,7 +227,7 @@ asm( \
:"=g"(_c[LO]) : "0"(_c[LO]), "g"(*tmpm++) );
#define INNERMUL8 \
asm( \
__asm__( \
"movd 0(%1),%%mm4 \n\t" \
"movd 0(%2),%%mm0 \n\t" \
"paddq %%mm4,%%mm3 \n\t" \
@ -295,16 +297,16 @@ asm( \
pointer */
#define LOOP_END \
asm( "movd %%mm3,%0 \n" :"=r"(cy))
__asm__( "movd %%mm3,%0 \n" :"=r"(cy))
#define PROPCARRY \
asm( \
__asm__( \
"addl %1,%0 \n\t" \
"setb %%al \n\t" \
"movzbl %%al,%1 \n\t" \
:"=g"(_c[LO]), "=r"(cy) \
:"0"(_c[LO]), "1"(cy) \
: "%eax", "%cc")
: "%eax", "cc")
/******************************************************************/
#elif defined(TFM_ARM)
@ -317,23 +319,23 @@ asm( \
mu = c[x] * mp
#define INNERMUL \
asm( \
__asm__( \
" LDR r0,%1 \n\t" \
" ADDS r0,r0,%0 \n\t" \
" MOVCS %0,#1 \n\t" \
" MOVCC %0,#0 \n\t" \
" UMLAL r0,%0,%3,%4 \n\t" \
" STR r0,%1 \n\t" \
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(*tmpm++),"1"(_c[0]):"r0","%cc");
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(*tmpm++),"1"(_c[0]):"r0","cc");
#define PROPCARRY \
asm( \
__asm__( \
" LDR r0,%1 \n\t" \
" ADDS r0,r0,%0 \n\t" \
" STR r0,%1 \n\t" \
" MOVCS %0,#1 \n\t" \
" MOVCC %0,#0 \n\t" \
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"r0","%cc");
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"r0","cc");
#elif defined(TFM_PPC32)
@ -345,7 +347,7 @@ asm( \
mu = c[x] * mp
#define INNERMUL \
asm( \
__asm__( \
" mullw 16,%3,%4 \n\t" \
" mulhwu 17,%3,%4 \n\t" \
" addc 16,16,%0 \n\t" \
@ -354,16 +356,16 @@ asm( \
" addc 16,16,18 \n\t" \
" addze %0,17 \n\t" \
" stw 16,%1 \n\t" \
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","%cc"); ++tmpm;
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","cc"); ++tmpm;
#define PROPCARRY \
asm( \
__asm__( \
" lwz 16,%1 \n\t" \
" addc 16,16,%0 \n\t" \
" stw 16,%1 \n\t" \
" xor %0,%0,%0 \n\t" \
" addze %0,%0 \n\t" \
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"16","%cc");
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"16","cc");
#elif defined(TFM_PPC64)
@ -375,7 +377,7 @@ asm( \
mu = c[x] * mp
#define INNERMUL \
asm( \
__asm__( \
" mulld 16,%3,%4 \n\t" \
" mulhdu 17,%3,%4 \n\t" \
" addc 16,16,%0 \n\t" \
@ -384,16 +386,16 @@ asm( \
" addc 16,16,18 \n\t" \
" addze %0,17 \n\t" \
" sdx 16,0,%1 \n\t" \
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","%cc"); ++tmpm;
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","cc"); ++tmpm;
#define PROPCARRY \
asm( \
__asm__( \
" ldx 16,0,%1 \n\t" \
" addc 16,16,%0 \n\t" \
" sdx 16,0,%1 \n\t" \
" xor %0,%0,%0 \n\t" \
" addze %0,%0 \n\t" \
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"16","%cc");
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"16","cc");
/******************************************************************/
@ -407,7 +409,7 @@ asm( \
mu = c[x] * mp
#define INNERMUL \
asm( \
__asm__( \
" ld.w r2,%1 \n\t" \
" add r2,%0 \n\t" \
" eor r3,r3 \n\t" \
@ -418,13 +420,13 @@ asm( \
:"=r"(cy),"=r"(_c):"0"(cy),"r"(mu),"r"(*tmpm++),"1"(_c):"r2","r3");
#define PROPCARRY \
asm( \
__asm__( \
" ld.w r2,%1 \n\t" \
" add r2,%0 \n\t" \
" st.w %1,r2 \n\t" \
" eor %0,%0 \n\t" \
" acr %0 \n\t" \
:"=r"(cy),"=r"(&_c[0]):"0"(cy),"1"(&_c[0]):"r2","%cc");
:"=r"(cy),"=r"(&_c[0]):"0"(cy),"1"(&_c[0]):"r2","cc");
#else
@ -437,9 +439,10 @@ asm( \
#define INNERMUL \
do { fp_word t; \
_c[0] = t = ((fp_word)_c[0] + (fp_word)cy) + \
t = ((fp_word)_c[0] + (fp_word)cy) + \
(((fp_word)mu) * ((fp_word)*tmpm++)); \
cy = (t >> DIGIT_BIT); \
_c[0] = (fp_digit)t; \
cy = (fp_digit)(t >> DIGIT_BIT); \
} while (0)
#define PROPCARRY \
@ -475,16 +478,16 @@ asm( \
#define COMBA_FINI
#define SQRADD(i, j) \
asm( \
__asm__( \
"movl %6,%%eax \n\t" \
"mull %%eax \n\t" \
"addl %%eax,%0 \n\t" \
"adcl %%edx,%1 \n\t" \
"adcl $0,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","cc");
#define SQRADD2(i, j) \
asm( \
__asm__( \
"movl %6,%%eax \n\t" \
"mull %7 \n\t" \
"addl %%eax,%0 \n\t" \
@ -493,37 +496,37 @@ asm( \
"addl %%eax,%0 \n\t" \
"adcl %%edx,%1 \n\t" \
"adcl $0,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx", "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx", "cc");
#define SQRADDSC(i, j) \
asm( \
__asm__( \
"movl %3,%%eax \n\t" \
"mull %4 \n\t" \
"movl %%eax,%0 \n\t" \
"movl %%edx,%1 \n\t" \
"xorl %2,%2 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","cc");
/* TAO removed sc0,1,2 as input to remove warning so %6,%7 become %3,%4 */
#define SQRADDAC(i, j) \
asm( \
__asm__( \
"movl %6,%%eax \n\t" \
"mull %7 \n\t" \
"addl %%eax,%0 \n\t" \
"adcl %%edx,%1 \n\t" \
"adcl $0,%2 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","cc");
#define SQRADDDB \
asm( \
__asm__( \
"addl %6,%0 \n\t" \
"adcl %7,%1 \n\t" \
"adcl %8,%2 \n\t" \
"addl %6,%0 \n\t" \
"adcl %7,%1 \n\t" \
"adcl %8,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc");
#elif defined(TFM_X86_64)
/* x86-64 optimized */
@ -545,16 +548,16 @@ asm( \
#define COMBA_FINI
#define SQRADD(i, j) \
asm( \
__asm__( \
"movq %6,%%rax \n\t" \
"mulq %%rax \n\t" \
"addq %%rax,%0 \n\t" \
"adcq %%rdx,%1 \n\t" \
"adcq $0,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx","cc");
#define SQRADD2(i, j) \
asm( \
__asm__( \
"movq %6,%%rax \n\t" \
"mulq %7 \n\t" \
"addq %%rax,%0 \n\t" \
@ -563,37 +566,37 @@ asm( \
"addq %%rax,%0 \n\t" \
"adcq %%rdx,%1 \n\t" \
"adcq $0,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","cc");
#define SQRADDSC(i, j) \
asm( \
__asm__( \
"movq %3,%%rax \n\t" \
"mulq %4 \n\t" \
"movq %%rax,%0 \n\t" \
"movq %%rdx,%1 \n\t" \
"xorq %2,%2 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%rax","%rdx","%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%rax","%rdx","cc");
/* TAO removed sc0,1,2 as input to remove warning so %6,%7 become %3,%4 */
#define SQRADDAC(i, j) \
asm( \
__asm__( \
"movq %6,%%rax \n\t" \
"mulq %7 \n\t" \
"addq %%rax,%0 \n\t" \
"adcq %%rdx,%1 \n\t" \
"adcq $0,%2 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","cc");
#define SQRADDDB \
asm( \
__asm__( \
"addq %6,%0 \n\t" \
"adcq %7,%1 \n\t" \
"adcq %8,%2 \n\t" \
"addq %6,%0 \n\t" \
"adcq %7,%1 \n\t" \
"adcq %8,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc");
#elif defined(TFM_SSE2)
@ -613,10 +616,10 @@ asm( \
do { c0 = c1; c1 = c2; c2 = 0; } while (0);
#define COMBA_FINI \
asm("emms");
__asm__("emms");
#define SQRADD(i, j) \
asm( \
__asm__( \
"movd %6,%%mm0 \n\t" \
"pmuludq %%mm0,%%mm0\n\t" \
"movd %%mm0,%%eax \n\t" \
@ -625,10 +628,10 @@ asm( \
"movd %%mm0,%%eax \n\t" \
"adcl %%eax,%1 \n\t" \
"adcl $0,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","cc");
#define SQRADD2(i, j) \
asm( \
__asm__( \
"movd %6,%%mm0 \n\t" \
"movd %7,%%mm1 \n\t" \
"pmuludq %%mm1,%%mm0\n\t" \
@ -641,10 +644,10 @@ asm( \
"addl %%eax,%0 \n\t" \
"adcl %%edx,%1 \n\t" \
"adcl $0,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","cc");
#define SQRADDSC(i, j) \
asm( \
__asm__( \
"movd %3,%%mm0 \n\t" \
"movd %4,%%mm1 \n\t" \
"pmuludq %%mm1,%%mm0\n\t" \
@ -657,7 +660,7 @@ asm( \
/* TAO removed sc0,1,2 as input to remove warning so %6,%7 become %3,%4 */
#define SQRADDAC(i, j) \
asm( \
__asm__( \
"movd %6,%%mm0 \n\t" \
"movd %7,%%mm1 \n\t" \
"pmuludq %%mm1,%%mm0\n\t" \
@ -667,17 +670,17 @@ asm( \
"addl %%eax,%0 \n\t" \
"adcl %%edx,%1 \n\t" \
"adcl $0,%2 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "m"(i), "m"(j) :"%eax","%edx","%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "m"(i), "m"(j) :"%eax","%edx","cc");
#define SQRADDDB \
asm( \
__asm__( \
"addl %6,%0 \n\t" \
"adcl %7,%1 \n\t" \
"adcl %8,%2 \n\t" \
"addl %6,%0 \n\t" \
"adcl %7,%1 \n\t" \
"adcl %8,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc");
#elif defined(TFM_ARM)
@ -701,16 +704,16 @@ asm( \
/* multiplies point i and j, updates carry "c1" and digit c2 */
#define SQRADD(i, j) \
asm( \
__asm__( \
" UMULL r0,r1,%6,%6 \n\t" \
" ADDS %0,%0,r0 \n\t" \
" ADCS %1,%1,r1 \n\t" \
" ADC %2,%2,#0 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i) : "r0", "r1", "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i) : "r0", "r1", "cc");
/* for squaring some of the terms are doubled... */
#define SQRADD2(i, j) \
asm( \
__asm__( \
" UMULL r0,r1,%6,%7 \n\t" \
" ADDS %0,%0,r0 \n\t" \
" ADCS %1,%1,r1 \n\t" \
@ -718,31 +721,31 @@ asm( \
" ADDS %0,%0,r0 \n\t" \
" ADCS %1,%1,r1 \n\t" \
" ADC %2,%2,#0 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "cc");
#define SQRADDSC(i, j) \
asm( \
__asm__( \
" UMULL %0,%1,%6,%7 \n\t" \
" SUB %2,%2,%2 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "cc");
#define SQRADDAC(i, j) \
asm( \
__asm__( \
" UMULL r0,r1,%6,%7 \n\t" \
" ADDS %0,%0,r0 \n\t" \
" ADCS %1,%1,r1 \n\t" \
" ADC %2,%2,#0 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "r0", "r1", "%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "r0", "r1", "cc");
#define SQRADDDB \
asm( \
__asm__( \
" ADDS %0,%0,%3 \n\t" \
" ADCS %1,%1,%4 \n\t" \
" ADC %2,%2,%5 \n\t" \
" ADDS %0,%0,%3 \n\t" \
" ADCS %1,%1,%4 \n\t" \
" ADC %2,%2,%5 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "cc");
#elif defined(TFM_PPC32)
@ -766,17 +769,17 @@ asm( \
/* multiplies point i and j, updates carry "c1" and digit c2 */
#define SQRADD(i, j) \
asm( \
__asm__( \
" mullw 16,%6,%6 \n\t" \
" addc %0,%0,16 \n\t" \
" mulhwu 16,%6,%6 \n\t" \
" adde %1,%1,16 \n\t" \
" addze %2,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"16","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"16","cc");
/* for squaring some of the terms are doubled... */
#define SQRADD2(i, j) \
asm( \
__asm__( \
" mullw 16,%6,%7 \n\t" \
" mulhwu 17,%6,%7 \n\t" \
" addc %0,%0,16 \n\t" \
@ -785,33 +788,33 @@ asm( \
" addc %0,%0,16 \n\t" \
" adde %1,%1,17 \n\t" \
" addze %2,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16", "17","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16", "17","cc");
#define SQRADDSC(i, j) \
asm( \
__asm__( \
" mullw %0,%6,%7 \n\t" \
" mulhwu %1,%6,%7 \n\t" \
" xor %2,%2,%2 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "cc");
#define SQRADDAC(i, j) \
asm( \
__asm__( \
" mullw 16,%6,%7 \n\t" \
" addc %0,%0,16 \n\t" \
" mulhwu 16,%6,%7 \n\t" \
" adde %1,%1,16 \n\t" \
" addze %2,%2 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"16", "%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"16", "cc");
#define SQRADDDB \
asm( \
__asm__( \
" addc %0,%0,%3 \n\t" \
" adde %1,%1,%4 \n\t" \
" adde %2,%2,%5 \n\t" \
" addc %0,%0,%3 \n\t" \
" adde %1,%1,%4 \n\t" \
" adde %2,%2,%5 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "cc");
#elif defined(TFM_PPC64)
/* PPC64 */
@ -834,17 +837,17 @@ asm( \
/* multiplies point i and j, updates carry "c1" and digit c2 */
#define SQRADD(i, j) \
asm( \
__asm__( \
" mulld 16,%6,%6 \n\t" \
" addc %0,%0,16 \n\t" \
" mulhdu 16,%6,%6 \n\t" \
" adde %1,%1,16 \n\t" \
" addze %2,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"16","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"16","cc");
/* for squaring some of the terms are doubled... */
#define SQRADD2(i, j) \
asm( \
__asm__( \
" mulld 16,%6,%7 \n\t" \
" mulhdu 17,%6,%7 \n\t" \
" addc %0,%0,16 \n\t" \
@ -853,33 +856,33 @@ asm( \
" addc %0,%0,16 \n\t" \
" adde %1,%1,17 \n\t" \
" addze %2,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16", "17","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16", "17","cc");
#define SQRADDSC(i, j) \
asm( \
__asm__( \
" mulld %0,%6,%7 \n\t" \
" mulhdu %1,%6,%7 \n\t" \
" xor %2,%2,%2 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "cc");
#define SQRADDAC(i, j) \
asm( \
__asm__( \
" mulld 16,%6,%7 \n\t" \
" addc %0,%0,16 \n\t" \
" mulhdu 16,%6,%7 \n\t" \
" adde %1,%1,16 \n\t" \
" addze %2,%2 \n\t" \
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"16", "%cc");
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"16", "cc");
#define SQRADDDB \
asm( \
__asm__( \
" addc %0,%0,%3 \n\t" \
" adde %1,%1,%4 \n\t" \
" adde %2,%2,%5 \n\t" \
" addc %0,%0,%3 \n\t" \
" adde %1,%1,%4 \n\t" \
" adde %2,%2,%5 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "cc");
#elif defined(TFM_AVR32)
@ -904,7 +907,7 @@ asm( \
/* multiplies point i and j, updates carry "c1" and digit c2 */
#define SQRADD(i, j) \
asm( \
__asm__( \
" mulu.d r2,%6,%6 \n\t" \
" add %0,%0,r2 \n\t" \
" adc %1,%1,r3 \n\t" \
@ -913,7 +916,7 @@ asm( \
/* for squaring some of the terms are doubled... */
#define SQRADD2(i, j) \
asm( \
__asm__( \
" mulu.d r2,%6,%7 \n\t" \
" add %0,%0,r2 \n\t" \
" adc %1,%1,r3 \n\t" \
@ -924,7 +927,7 @@ asm( \
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"r2", "r3");
#define SQRADDSC(i, j) \
asm( \
__asm__( \
" mulu.d r2,%6,%7 \n\t" \
" mov %0,r2 \n\t" \
" mov %1,r3 \n\t" \
@ -932,7 +935,7 @@ asm( \
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "r2", "r3");
#define SQRADDAC(i, j) \
asm( \
__asm__( \
" mulu.d r2,%6,%7 \n\t" \
" add %0,%0,r2 \n\t" \
" adc %1,%1,r3 \n\t" \
@ -940,14 +943,14 @@ asm( \
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"r2", "r3");
#define SQRADDDB \
asm( \
__asm__( \
" add %0,%0,%3 \n\t" \
" adc %1,%1,%4 \n\t" \
" adc %2,%2,%5 \n\t" \
" add %0,%0,%3 \n\t" \
" adc %1,%1,%4 \n\t" \
" adc %2,%2,%5 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "cc");
#else
@ -975,8 +978,9 @@ asm( \
/* multiplies point i and j, updates carry "c1" and digit c2 */
#define SQRADD(i, j) \
do { fp_word t; \
t = c0 + ((fp_word)i) * ((fp_word)j); c0 = t; \
t = c1 + (t >> DIGIT_BIT); c1 = t; c2 += t >> DIGIT_BIT; \
t = c0 + ((fp_word)i) * ((fp_word)j); c0 = (fp_digit)t; \
t = c1 + (t >> DIGIT_BIT); c1 = (fp_digit)t; \
c2 +=(fp_digit) (t >> DIGIT_BIT); \
} while (0);
@ -984,10 +988,12 @@ asm( \
#define SQRADD2(i, j) \
do { fp_word t; \
t = ((fp_word)i) * ((fp_word)j); \
tt = (fp_word)c0 + t; c0 = tt; \
tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = tt; c2 += tt >> DIGIT_BIT; \
tt = (fp_word)c0 + t; c0 = tt; \
tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = tt; c2 += tt >> DIGIT_BIT; \
tt = (fp_word)c0 + t; c0 = (fp_digit)tt; \
tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = (fp_digit)tt; \
c2 +=(fp_digit)( tt >> DIGIT_BIT); \
tt = (fp_word)c0 + t; c0 = (fp_digit)tt; \
tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = (fp_digit)tt; \
c2 +=(fp_digit) (tt >> DIGIT_BIT); \
} while (0);
#define SQRADDSC(i, j) \
@ -1059,13 +1065,13 @@ asm( \
/* this should multiply i and j */
#define MULADD(i, j) \
asm( \
__asm__( \
"movl %6,%%eax \n\t" \
"mull %7 \n\t" \
"addl %%eax,%0 \n\t" \
"adcl %%edx,%1 \n\t" \
"adcl $0,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","cc");
#elif defined(TFM_X86_64)
/* x86-64 optimized */
@ -1094,13 +1100,13 @@ asm( \
/* this should multiply i and j */
#define MULADD(i, j) \
asm ( \
__asm__ ( \
"movq %6,%%rax \n\t" \
"mulq %7 \n\t" \
"addq %%rax,%0 \n\t" \
"adcq %%rdx,%1 \n\t" \
"adcq $0,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","cc");
#elif defined(TFM_SSE2)
/* use SSE2 optimizations */
@ -1126,11 +1132,11 @@ asm ( \
/* anything you need at the end */
#define COMBA_FINI \
asm("emms");
__asm__("emms");
/* this should multiply i and j */
#define MULADD(i, j) \
asm( \
__asm__( \
"movd %6,%%mm0 \n\t" \
"movd %7,%%mm1 \n\t" \
"pmuludq %%mm1,%%mm0\n\t" \
@ -1140,7 +1146,7 @@ asm( \
"movd %%mm0,%%eax \n\t" \
"adcl %%eax,%1 \n\t" \
"adcl $0,%2 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%cc");
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","cc");
#elif defined(TFM_ARM)
/* ARM code */
@ -1162,12 +1168,12 @@ asm( \
#define COMBA_FINI
#define MULADD(i, j) \
asm( \
__asm__( \
" UMULL r0,r1,%6,%7 \n\t" \
" ADDS %0,%0,r0 \n\t" \
" ADCS %1,%1,r1 \n\t" \
" ADC %2,%2,#0 \n\t" \
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "%cc");
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "cc");
#elif defined(TFM_PPC32)
/* For 32-bit PPC */
@ -1190,7 +1196,7 @@ asm( \
/* untested: will mulhwu change the flags? Docs say no */
#define MULADD(i, j) \
asm( \
__asm__( \
" mullw 16,%6,%7 \n\t" \
" addc %0,%0,16 \n\t" \
" mulhwu 16,%6,%7 \n\t" \
@ -1219,7 +1225,7 @@ asm( \
/* untested: will mulhwu change the flags? Docs say no */
#define MULADD(i, j) \
asm( \
____asm__( \
" mulld 16,%6,%7 \n\t" \
" addc %0,%0,16 \n\t" \
" mulhdu 16,%6,%7 \n\t" \
@ -1248,7 +1254,7 @@ asm( \
#define COMBA_FINI
#define MULADD(i, j) \
asm( \
____asm__( \
" mulu.d r2,%6,%7 \n\t"\
" add %0,r2 \n\t"\
" adc %1,%1,r3 \n\t"\
@ -1274,10 +1280,11 @@ asm( \
#define COMBA_FINI
#define MULADD(i, j) \
do { fp_word t; \
t = (fp_word)c0 + ((fp_word)i) * ((fp_word)j); c0 = t; \
t = (fp_word)c1 + (t >> DIGIT_BIT); c1 = t; c2 += t >> DIGIT_BIT; \
#define MULADD(i, j) \
do { fp_word t; \
t = (fp_word)c0 + ((fp_word)i) * ((fp_word)j); c0 = (fp_digit)t; \
t = (fp_word)c1 + (t >> DIGIT_BIT); \
c1 = (fp_digit)t; c2 += (fp_digit)(t >> DIGIT_BIT); \
} while (0);
#endif

File diff suppressed because it is too large Load Diff

467
ctaocrypt/src/blake2b.c Normal file
View File

@ -0,0 +1,467 @@
/*
BLAKE2 reference source code package - reference C implementations
Written in 2012 by Samuel Neves <sneves@dei.uc.pt>
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with
this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
/* blake2b.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#ifdef HAVE_BLAKE2
#include <cyassl/ctaocrypt/blake2.h>
#include <cyassl/ctaocrypt/blake2-impl.h>
static const word64 blake2b_IV[8] =
{
0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL,
0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL,
0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL,
0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL
};
static const byte blake2b_sigma[12][16] =
{
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } ,
{ 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } ,
{ 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } ,
{ 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } ,
{ 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } ,
{ 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } ,
{ 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } ,
{ 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } ,
{ 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } ,
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }
};
static INLINE int blake2b_set_lastnode( blake2b_state *S )
{
S->f[1] = ~0ULL;
return 0;
}
static INLINE int blake2b_clear_lastnode( blake2b_state *S )
{
S->f[1] = 0ULL;
return 0;
}
/* Some helper functions, not necessarily useful */
static INLINE int blake2b_set_lastblock( blake2b_state *S )
{
if( S->last_node ) blake2b_set_lastnode( S );
S->f[0] = ~0ULL;
return 0;
}
static INLINE int blake2b_clear_lastblock( blake2b_state *S )
{
if( S->last_node ) blake2b_clear_lastnode( S );
S->f[0] = 0ULL;
return 0;
}
static INLINE int blake2b_increment_counter( blake2b_state *S, const word64
inc )
{
S->t[0] += inc;
S->t[1] += ( S->t[0] < inc );
return 0;
}
/* Parameter-related functions */
static INLINE int blake2b_param_set_digest_length( blake2b_param *P,
const byte digest_length )
{
P->digest_length = digest_length;
return 0;
}
static INLINE int blake2b_param_set_fanout( blake2b_param *P, const byte fanout)
{
P->fanout = fanout;
return 0;
}
static INLINE int blake2b_param_set_max_depth( blake2b_param *P,
const byte depth )
{
P->depth = depth;
return 0;
}
static INLINE int blake2b_param_set_leaf_length( blake2b_param *P,
const word32 leaf_length )
{
store32( &P->leaf_length, leaf_length );
return 0;
}
static INLINE int blake2b_param_set_node_offset( blake2b_param *P,
const word64 node_offset )
{
store64( &P->node_offset, node_offset );
return 0;
}
static INLINE int blake2b_param_set_node_depth( blake2b_param *P,
const byte node_depth )
{
P->node_depth = node_depth;
return 0;
}
static INLINE int blake2b_param_set_inner_length( blake2b_param *P,
const byte inner_length )
{
P->inner_length = inner_length;
return 0;
}
static INLINE int blake2b_param_set_salt( blake2b_param *P,
const byte salt[BLAKE2B_SALTBYTES] )
{
XMEMCPY( P->salt, salt, BLAKE2B_SALTBYTES );
return 0;
}
static INLINE int blake2b_param_set_personal( blake2b_param *P,
const byte personal[BLAKE2B_PERSONALBYTES] )
{
XMEMCPY( P->personal, personal, BLAKE2B_PERSONALBYTES );
return 0;
}
static INLINE int blake2b_init0( blake2b_state *S )
{
int i;
XMEMSET( S, 0, sizeof( blake2b_state ) );
for( i = 0; i < 8; ++i ) S->h[i] = blake2b_IV[i];
return 0;
}
/* init xors IV with input parameter block */
int blake2b_init_param( blake2b_state *S, const blake2b_param *P )
{
word32 i;
blake2b_init0( S );
byte *p = ( byte * )( P );
/* IV XOR ParamBlock */
for( i = 0; i < 8; ++i )
S->h[i] ^= load64( p + sizeof( S->h[i] ) * i );
return 0;
}
int blake2b_init( blake2b_state *S, const byte outlen )
{
blake2b_param P[1];
if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;
P->digest_length = outlen;
P->key_length = 0;
P->fanout = 1;
P->depth = 1;
store32( &P->leaf_length, 0 );
store64( &P->node_offset, 0 );
P->node_depth = 0;
P->inner_length = 0;
XMEMSET( P->reserved, 0, sizeof( P->reserved ) );
XMEMSET( P->salt, 0, sizeof( P->salt ) );
XMEMSET( P->personal, 0, sizeof( P->personal ) );
return blake2b_init_param( S, P );
}
int blake2b_init_key( blake2b_state *S, const byte outlen, const void *key,
const byte keylen )
{
blake2b_param P[1];
if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;
if ( !key || !keylen || keylen > BLAKE2B_KEYBYTES ) return -1;
P->digest_length = outlen;
P->key_length = keylen;
P->fanout = 1;
P->depth = 1;
store32( &P->leaf_length, 0 );
store64( &P->node_offset, 0 );
P->node_depth = 0;
P->inner_length = 0;
XMEMSET( P->reserved, 0, sizeof( P->reserved ) );
XMEMSET( P->salt, 0, sizeof( P->salt ) );
XMEMSET( P->personal, 0, sizeof( P->personal ) );
if( blake2b_init_param( S, P ) < 0 ) return -1;
{
byte block[BLAKE2B_BLOCKBYTES];
XMEMSET( block, 0, BLAKE2B_BLOCKBYTES );
XMEMCPY( block, key, keylen );
blake2b_update( S, block, BLAKE2B_BLOCKBYTES );
secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from */
/*stack */
}
return 0;
}
static int blake2b_compress( blake2b_state *S,
const byte block[BLAKE2B_BLOCKBYTES] )
{
word64 m[16];
word64 v[16];
int i;
for( i = 0; i < 16; ++i )
m[i] = load64( block + i * sizeof( m[i] ) );
for( i = 0; i < 8; ++i )
v[i] = S->h[i];
v[ 8] = blake2b_IV[0];
v[ 9] = blake2b_IV[1];
v[10] = blake2b_IV[2];
v[11] = blake2b_IV[3];
v[12] = S->t[0] ^ blake2b_IV[4];
v[13] = S->t[1] ^ blake2b_IV[5];
v[14] = S->f[0] ^ blake2b_IV[6];
v[15] = S->f[1] ^ blake2b_IV[7];
#define G(r,i,a,b,c,d) \
do { \
a = a + b + m[blake2b_sigma[r][2*i+0]]; \
d = rotr64(d ^ a, 32); \
c = c + d; \
b = rotr64(b ^ c, 24); \
a = a + b + m[blake2b_sigma[r][2*i+1]]; \
d = rotr64(d ^ a, 16); \
c = c + d; \
b = rotr64(b ^ c, 63); \
} while(0)
#define ROUND(r) \
do { \
G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
G(r,2,v[ 2],v[ 6],v[10],v[14]); \
G(r,3,v[ 3],v[ 7],v[11],v[15]); \
G(r,4,v[ 0],v[ 5],v[10],v[15]); \
G(r,5,v[ 1],v[ 6],v[11],v[12]); \
G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
} while(0)
ROUND( 0 );
ROUND( 1 );
ROUND( 2 );
ROUND( 3 );
ROUND( 4 );
ROUND( 5 );
ROUND( 6 );
ROUND( 7 );
ROUND( 8 );
ROUND( 9 );
ROUND( 10 );
ROUND( 11 );
for( i = 0; i < 8; ++i )
S->h[i] = S->h[i] ^ v[i] ^ v[i + 8];
#undef G
#undef ROUND
return 0;
}
/* inlen now in bytes */
int blake2b_update( blake2b_state *S, const byte *in, word64 inlen )
{
while( inlen > 0 )
{
word64 left = S->buflen;
word64 fill = 2 * BLAKE2B_BLOCKBYTES - left;
if( inlen > fill )
{
XMEMCPY( S->buf + left, in, (word)fill ); /* Fill buffer */
S->buflen += fill;
blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
blake2b_compress( S, S->buf ); /* Compress */
XMEMCPY( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES );
/* Shift buffer left */
S->buflen -= BLAKE2B_BLOCKBYTES;
in += fill;
inlen -= fill;
}
else /* inlen <= fill */
{
XMEMCPY( S->buf + left, in, (word)inlen );
S->buflen += inlen; /* Be lazy, do not compress */
in += inlen;
inlen -= inlen;
}
}
return 0;
}
/* Is this correct? */
int blake2b_final( blake2b_state *S, byte *out, byte outlen )
{
byte buffer[BLAKE2B_OUTBYTES];
int i;
if( S->buflen > BLAKE2B_BLOCKBYTES )
{
blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
blake2b_compress( S, S->buf );
S->buflen -= BLAKE2B_BLOCKBYTES;
XMEMCPY( S->buf, S->buf + BLAKE2B_BLOCKBYTES, (word)S->buflen );
}
blake2b_increment_counter( S, S->buflen );
blake2b_set_lastblock( S );
XMEMSET( S->buf + S->buflen, 0, (word)(2 * BLAKE2B_BLOCKBYTES - S->buflen) );
/* Padding */
blake2b_compress( S, S->buf );
for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
store64( buffer + sizeof( S->h[i] ) * i, S->h[i] );
XMEMCPY( out, buffer, outlen );
return 0;
}
/* inlen, at least, should be word64. Others can be size_t. */
int blake2b( byte *out, const void *in, const void *key, const byte outlen,
const word64 inlen, byte keylen )
{
blake2b_state S[1];
/* Verify parameters */
if ( NULL == in ) return -1;
if ( NULL == out ) return -1;
if( NULL == key ) keylen = 0;
if( keylen > 0 )
{
if( blake2b_init_key( S, outlen, key, keylen ) < 0 ) return -1;
}
else
{
if( blake2b_init( S, outlen ) < 0 ) return -1;
}
blake2b_update( S, ( byte * )in, inlen );
blake2b_final( S, out, outlen );
return 0;
}
#if defined(BLAKE2B_SELFTEST)
#include <string.h>
#include "blake2-kat.h"
int main( int argc, char **argv )
{
byte key[BLAKE2B_KEYBYTES];
byte buf[KAT_LENGTH];
for( word32 i = 0; i < BLAKE2B_KEYBYTES; ++i )
key[i] = ( byte )i;
for( word32 i = 0; i < KAT_LENGTH; ++i )
buf[i] = ( byte )i;
for( word32 i = 0; i < KAT_LENGTH; ++i )
{
byte hash[BLAKE2B_OUTBYTES];
blake2b( hash, buf, key, BLAKE2B_OUTBYTES, i, BLAKE2B_KEYBYTES );
if( 0 != memcmp( hash, blake2b_keyed_kat[i], BLAKE2B_OUTBYTES ) )
{
puts( "error" );
return -1;
}
}
puts( "ok" );
return 0;
}
#endif
/* CTaoCrypt API */
/* Init Blake2b digest, track size incase final doesn't want to "remember" */
int InitBlake2b(Blake2b* b2b, word32 digestSz)
{
b2b->digestSz = digestSz;
return blake2b_init(b2b->S, (byte)digestSz);
}
/* Blake2b Update */
int Blake2bUpdate(Blake2b* b2b, const byte* data, word32 sz)
{
return blake2b_update(b2b->S, data, sz);
}
/* Blake2b Final, if pass in zero size we use init digestSz */
int Blake2bFinal(Blake2b* b2b, byte* final, word32 requestSz)
{
word32 sz = requestSz ? requestSz : b2b->digestSz;
return blake2b_final(b2b->S, final, (byte)sz);
}
/* end CTaoCrypt API */
#endif /* HAVE_BLAKE2 */

1572
ctaocrypt/src/camellia.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* coding.c
*
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
@ -23,6 +23,10 @@
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#ifndef NO_CODING
#include <cyassl/ctaocrypt/coding.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/logging.h>
@ -54,6 +58,7 @@ int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
word32 i = 0;
word32 j = 0;
word32 plainSz = inLen - ((inLen + (PEM_LINE_SZ - 1)) / PEM_LINE_SZ );
const byte maxIdx = (byte)sizeof(base64Decode) + 0x2B - 1;
plainSz = (plainSz * 3 + 3) / 4;
if (plainSz > *outLen) return BAD_FUNC_ARG;
@ -75,6 +80,16 @@ int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
if (e4 == PAD)
pad4 = 1;
if (e1 < 0x2B || e2 < 0x2B || e3 < 0x2B || e4 < 0x2B) {
CYASSL_MSG("Bad Base64 Decode data, too small");
return ASN_INPUT_E;
}
if (e1 > maxIdx || e2 > maxIdx || e3 > maxIdx || e4 > maxIdx) {
CYASSL_MSG("Bad Base64 Decode data, too big");
return ASN_INPUT_E;
}
e1 = base64Decode[e1 - 0x2B];
e2 = base64Decode[e2 - 0x2B];
e3 = (e3 == PAD) ? 0 : base64Decode[e3 - 0x2B];
@ -93,16 +108,18 @@ int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
break;
inLen -= 4;
if (in[j] == ' ' || in[j] == '\r' || in[j] == '\n') {
if (inLen && (in[j] == ' ' || in[j] == '\r' || in[j] == '\n')) {
byte endLine = in[j++];
inLen--;
while (endLine == ' ') { /* allow trailing whitespace */
while (inLen && endLine == ' ') { /* allow trailing whitespace */
endLine = in[j++];
inLen--;
}
if (endLine == '\r') {
endLine = in[j++];
inLen--;
if (inLen) {
endLine = in[j++];
inLen--;
}
}
if (endLine != '\n') {
CYASSL_MSG("Bad end of line in Base64 Decode");
@ -251,4 +268,5 @@ int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
}
#endif /* OPENSSL_EXTRA */
#endif /* defined(OPENSSL_EXTRA) || defined (SESSION_CERTS) || defined(CYASSL_KEY_GEN) || defined(CYASSL_CERT_GEN) || defined(HAVE_WEBSERVER) */
#endif /* NO_CODING */

169
ctaocrypt/src/compress.c Normal file
View File

@ -0,0 +1,169 @@
/* compress.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#ifdef HAVE_LIBZ
#include <cyassl/ctaocrypt/compress.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/logging.h>
#ifdef NO_INLINE
#include <cyassl/ctaocrypt/misc.h>
#else
#include <ctaocrypt/src/misc.c>
#endif
#include <zlib.h>
/* alloc user allocs to work with zlib */
static void* myAlloc(void* opaque, unsigned int item, unsigned int size)
{
(void)opaque;
return XMALLOC(item * size, opaque, DYNAMIC_TYPE_LIBZ);
}
static void myFree(void* opaque, void* memory)
{
(void)opaque;
XFREE(memory, opaque, DYNAMIC_TYPE_LIBZ);
}
#ifdef HAVE_MCAPI
#define DEFLATE_DEFAULT_WINDOWBITS 11
#define DEFLATE_DEFAULT_MEMLEVEL 1
#else
#define DEFLATE_DEFAULT_WINDOWBITS 15
#define DEFLATE_DEFAULT_MEMLEVEL 8
#endif
int Compress(byte* out, word32 outSz, const byte* in, word32 inSz, word32 flags)
/*
* out - pointer to destination buffer
* outSz - size of destination buffer
* in - pointer to source buffer to compress
* inSz - size of source to compress
* flags - flags to control how compress operates
*
* return:
* negative - error code
* positive - bytes stored in out buffer
*
* Note, the output buffer still needs to be larger than the input buffer.
* The right chunk of data won't compress at all, and the lookup table will
* add to the size of the output. The libz code says the compressed
* buffer should be srcSz + 0.1% + 12.
*/
{
z_stream stream;
int result = 0;
stream.next_in = (Bytef*)in;
stream.avail_in = (uInt)inSz;
#ifdef MAXSEG_64K
/* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != inSz) return COMPRESS_INIT_E;
#endif
stream.next_out = out;
stream.avail_out = (uInt)outSz;
if ((uLong)stream.avail_out != outSz) return COMPRESS_INIT_E;
stream.zalloc = (alloc_func)myAlloc;
stream.zfree = (free_func)myFree;
stream.opaque = (voidpf)0;
if (deflateInit2(&stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
DEFLATE_DEFAULT_WINDOWBITS, DEFLATE_DEFAULT_MEMLEVEL,
flags ? Z_FIXED : Z_DEFAULT_STRATEGY) != Z_OK)
return COMPRESS_INIT_E;
if (deflate(&stream, Z_FINISH) != Z_STREAM_END) {
deflateEnd(&stream);
return COMPRESS_E;
}
result = (int)stream.total_out;
if (deflateEnd(&stream) != Z_OK)
result = COMPRESS_E;
return result;
}
int DeCompress(byte* out, word32 outSz, const byte* in, word32 inSz)
/*
* out - pointer to destination buffer
* outSz - size of destination buffer
* in - pointer to source buffer to compress
* inSz - size of source to compress
* flags - flags to control how compress operates
*
* return:
* negative - error code
* positive - bytes stored in out buffer
*/
{
z_stream stream;
int result = 0;
stream.next_in = (Bytef*)in;
stream.avail_in = (uInt)inSz;
/* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != inSz) return DECOMPRESS_INIT_E;
stream.next_out = out;
stream.avail_out = (uInt)outSz;
if ((uLong)stream.avail_out != outSz) return DECOMPRESS_INIT_E;
stream.zalloc = (alloc_func)myAlloc;
stream.zfree = (free_func)myFree;
stream.opaque = (voidpf)0;
if (inflateInit2(&stream, DEFLATE_DEFAULT_WINDOWBITS) != Z_OK)
return DECOMPRESS_INIT_E;
if (inflate(&stream, Z_FINISH) != Z_STREAM_END) {
inflateEnd(&stream);
return DECOMPRESS_E;
}
result = (int)stream.total_out;
if (inflateEnd(&stream) != Z_OK)
result = DECOMPRESS_E;
return result;
}
#endif /* HAVE_LIBZ */

View File

@ -1,6 +1,6 @@
/* des3.c
*
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
@ -23,6 +23,8 @@
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#ifndef NO_DES3
#include <cyassl/ctaocrypt/des3.h>
@ -34,6 +36,232 @@
#endif
#ifdef HAVE_CAVIUM
static void Des3_CaviumSetKey(Des3* des3, const byte* key, const byte* iv);
static void Des3_CaviumCbcEncrypt(Des3* des3, byte* out, const byte* in,
word32 length);
static void Des3_CaviumCbcDecrypt(Des3* des3, byte* out, const byte* in,
word32 length);
#endif
#ifdef STM32F2_CRYPTO
/*
* STM32F2 hardware DES/3DES support through the STM32F2 standard
* peripheral library. Documentation located in STM32F2xx Standard
* Peripheral Library document (See note in README).
*/
#include "stm32f2xx.h"
#include "stm32f2xx_cryp.h"
void Des_SetKey(Des* des, const byte* key, const byte* iv, int dir)
{
word32 *dkey = des->key;
XMEMCPY(dkey, key, 8);
ByteReverseWords(dkey, dkey, 8);
Des_SetIV(des, iv);
}
void Des3_SetKey(Des3* des, const byte* key, const byte* iv, int dir)
{
word32 *dkey1 = des->key[0];
word32 *dkey2 = des->key[1];
word32 *dkey3 = des->key[2];
XMEMCPY(dkey1, key, 8); /* set key 1 */
XMEMCPY(dkey2, key + 8, 8); /* set key 2 */
XMEMCPY(dkey3, key + 16, 8); /* set key 3 */
ByteReverseWords(dkey1, dkey1, 8);
ByteReverseWords(dkey2, dkey2, 8);
ByteReverseWords(dkey3, dkey3, 8);
Des3_SetIV(des, iv);
}
void DesCrypt(Des* des, byte* out, const byte* in, word32 sz,
int dir, int mode)
{
word32 *dkey, *iv;
CRYP_InitTypeDef DES_CRYP_InitStructure;
CRYP_KeyInitTypeDef DES_CRYP_KeyInitStructure;
CRYP_IVInitTypeDef DES_CRYP_IVInitStructure;
dkey = des->key;
iv = des->reg;
/* crypto structure initialization */
CRYP_KeyStructInit(&DES_CRYP_KeyInitStructure);
CRYP_StructInit(&DES_CRYP_InitStructure);
CRYP_IVStructInit(&DES_CRYP_IVInitStructure);
/* reset registers to their default values */
CRYP_DeInit();
/* set direction, mode, and datatype */
if (dir == DES_ENCRYPTION) {
DES_CRYP_InitStructure.CRYP_AlgoDir = CRYP_AlgoDir_Encrypt;
} else { /* DES_DECRYPTION */
DES_CRYP_InitStructure.CRYP_AlgoDir = CRYP_AlgoDir_Decrypt;
}
if (mode == DES_CBC) {
DES_CRYP_InitStructure.CRYP_AlgoMode = CRYP_AlgoMode_DES_CBC;
} else { /* DES_ECB */
DES_CRYP_InitStructure.CRYP_AlgoMode = CRYP_AlgoMode_DES_ECB;
}
DES_CRYP_InitStructure.CRYP_DataType = CRYP_DataType_8b;
CRYP_Init(&DES_CRYP_InitStructure);
/* load key into correct registers */
DES_CRYP_KeyInitStructure.CRYP_Key1Left = dkey[0];
DES_CRYP_KeyInitStructure.CRYP_Key1Right = dkey[1];
CRYP_KeyInit(&DES_CRYP_KeyInitStructure);
/* set iv */
ByteReverseWords(iv, iv, DES_BLOCK_SIZE);
DES_CRYP_IVInitStructure.CRYP_IV0Left = iv[0];
DES_CRYP_IVInitStructure.CRYP_IV0Right = iv[1];
CRYP_IVInit(&DES_CRYP_IVInitStructure);
/* enable crypto processor */
CRYP_Cmd(ENABLE);
while (sz > 0)
{
/* flush IN/OUT FIFOs */
CRYP_FIFOFlush();
/* if input and output same will overwrite input iv */
XMEMCPY(des->tmp, in + sz - DES_BLOCK_SIZE, DES_BLOCK_SIZE);
CRYP_DataIn(*(uint32_t*)&in[0]);
CRYP_DataIn(*(uint32_t*)&in[4]);
/* wait until the complete message has been processed */
while(CRYP_GetFlagStatus(CRYP_FLAG_BUSY) != RESET) {}
*(uint32_t*)&out[0] = CRYP_DataOut();
*(uint32_t*)&out[4] = CRYP_DataOut();
/* store iv for next call */
XMEMCPY(des->reg, des->tmp, DES_BLOCK_SIZE);
sz -= DES_BLOCK_SIZE;
in += DES_BLOCK_SIZE;
out += DES_BLOCK_SIZE;
}
/* disable crypto processor */
CRYP_Cmd(DISABLE);
}
void Des_CbcEncrypt(Des* des, byte* out, const byte* in, word32 sz)
{
DesCrypt(des, out, in, sz, DES_ENCRYPTION, DES_CBC);
}
void Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz)
{
DesCrypt(des, out, in, sz, DES_DECRYPTION, DES_CBC);
}
void Des_EcbEncrypt(Des* des, byte* out, const byte* in, word32 sz)
{
DesCrypt(des, out, in, sz, DES_ENCRYPTION, DES_ECB);
}
void Des3Crypt(Des3* des, byte* out, const byte* in, word32 sz,
int dir)
{
word32 *dkey1, *dkey2, *dkey3, *iv;
CRYP_InitTypeDef DES3_CRYP_InitStructure;
CRYP_KeyInitTypeDef DES3_CRYP_KeyInitStructure;
CRYP_IVInitTypeDef DES3_CRYP_IVInitStructure;
dkey1 = des->key[0];
dkey2 = des->key[1];
dkey3 = des->key[2];
iv = des->reg;
/* crypto structure initialization */
CRYP_KeyStructInit(&DES3_CRYP_KeyInitStructure);
CRYP_StructInit(&DES3_CRYP_InitStructure);
CRYP_IVStructInit(&DES3_CRYP_IVInitStructure);
/* reset registers to their default values */
CRYP_DeInit();
/* set direction, mode, and datatype */
if (dir == DES_ENCRYPTION) {
DES3_CRYP_InitStructure.CRYP_AlgoDir = CRYP_AlgoDir_Encrypt;
} else {
DES3_CRYP_InitStructure.CRYP_AlgoDir = CRYP_AlgoDir_Decrypt;
}
DES3_CRYP_InitStructure.CRYP_AlgoMode = CRYP_AlgoMode_TDES_CBC;
DES3_CRYP_InitStructure.CRYP_DataType = CRYP_DataType_8b;
CRYP_Init(&DES3_CRYP_InitStructure);
/* load key into correct registers */
DES3_CRYP_KeyInitStructure.CRYP_Key1Left = dkey1[0];
DES3_CRYP_KeyInitStructure.CRYP_Key1Right = dkey1[1];
DES3_CRYP_KeyInitStructure.CRYP_Key2Left = dkey2[0];
DES3_CRYP_KeyInitStructure.CRYP_Key2Right = dkey2[1];
DES3_CRYP_KeyInitStructure.CRYP_Key3Left = dkey3[0];
DES3_CRYP_KeyInitStructure.CRYP_Key3Right = dkey3[1];
CRYP_KeyInit(&DES3_CRYP_KeyInitStructure);
/* set iv */
ByteReverseWords(iv, iv, DES_BLOCK_SIZE);
DES3_CRYP_IVInitStructure.CRYP_IV0Left = iv[0];
DES3_CRYP_IVInitStructure.CRYP_IV0Right = iv[1];
CRYP_IVInit(&DES3_CRYP_IVInitStructure);
/* enable crypto processor */
CRYP_Cmd(ENABLE);
while (sz > 0)
{
/* flush IN/OUT FIFOs */
CRYP_FIFOFlush();
CRYP_DataIn(*(uint32_t*)&in[0]);
CRYP_DataIn(*(uint32_t*)&in[4]);
/* wait until the complete message has been processed */
while(CRYP_GetFlagStatus(CRYP_FLAG_BUSY) != RESET) {}
*(uint32_t*)&out[0] = CRYP_DataOut();
*(uint32_t*)&out[4] = CRYP_DataOut();
/* store iv for next call */
XMEMCPY(des->reg, out + sz - DES_BLOCK_SIZE, DES_BLOCK_SIZE);
sz -= DES_BLOCK_SIZE;
in += DES_BLOCK_SIZE;
out += DES_BLOCK_SIZE;
}
/* disable crypto processor */
CRYP_Cmd(DISABLE);
}
void Des3_CbcEncrypt(Des3* des, byte* out, const byte* in, word32 sz)
{
Des3Crypt(des, out, in, sz, DES_ENCRYPTION);
}
void Des3_CbcDecrypt(Des3* des, byte* out, const byte* in, word32 sz)
{
Des3Crypt(des, out, in, sz, DES_DECRYPTION);
}
#else /* CTaoCrypt software implementation */
/* permuted choice table (key) */
static const byte pc1[] = {
57, 49, 41, 33, 25, 17, 9,
@ -327,20 +555,6 @@ static INLINE int Reverse(int dir)
}
void Des_SetIV(Des* des, const byte* iv)
{
if (des && iv)
XMEMCPY(des->reg, iv, DES_BLOCK_SIZE);
}
void Des3_SetIV(Des3* des, const byte* iv)
{
if (des && iv)
XMEMCPY(des->reg, iv, DES_BLOCK_SIZE);
}
void Des_SetKey(Des* des, const byte* key, const byte* iv, int dir)
{
DesSetKey(key, dir, des->key);
@ -351,6 +565,11 @@ void Des_SetKey(Des* des, const byte* key, const byte* iv, int dir)
void Des3_SetKey(Des3* des, const byte* key, const byte* iv, int dir)
{
#ifdef HAVE_CAVIUM
if (des->magic == CYASSL_3DES_CAVIUM_MAGIC)
return Des3_CaviumSetKey(des, key, iv);
#endif
DesSetKey(key + (dir == DES_ENCRYPTION ? 0 : 16), dir, des->key[0]);
DesSetKey(key + 8, Reverse(dir), des->key[1]);
DesSetKey(key + (dir == DES_DECRYPTION ? 0 : 16), dir, des->key[2]);
@ -460,7 +679,7 @@ void Des_CbcEncrypt(Des* des, byte* out, const byte* in, word32 sz)
void Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz)
{
word32 blocks = sz / DES_BLOCK_SIZE;
byte hold[16];
byte hold[DES_BLOCK_SIZE];
while (blocks--) {
XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
@ -479,8 +698,14 @@ void Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz)
void Des3_CbcEncrypt(Des3* des, byte* out, const byte* in, word32 sz)
{
word32 blocks = sz / DES_BLOCK_SIZE;
word32 blocks;
#ifdef HAVE_CAVIUM
if (des->magic == CYASSL_3DES_CAVIUM_MAGIC)
return Des3_CaviumCbcEncrypt(des, out, in, sz);
#endif
blocks = sz / DES_BLOCK_SIZE;
while (blocks--) {
xorbuf((byte*)des->reg, in, DES_BLOCK_SIZE);
Des3ProcessBlock(des, (byte*)des->reg, (byte*)des->reg);
@ -494,8 +719,14 @@ void Des3_CbcEncrypt(Des3* des, byte* out, const byte* in, word32 sz)
void Des3_CbcDecrypt(Des3* des, byte* out, const byte* in, word32 sz)
{
word32 blocks = sz / DES_BLOCK_SIZE;
word32 blocks;
#ifdef HAVE_CAVIUM
if (des->magic == CYASSL_3DES_CAVIUM_MAGIC)
return Des3_CaviumCbcDecrypt(des, out, in, sz);
#endif
blocks = sz / DES_BLOCK_SIZE;
while (blocks--) {
XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
Des3ProcessBlock(des, (byte*)des->tmp, out);
@ -524,5 +755,136 @@ void Des_EcbEncrypt(Des* des, byte* out, const byte* in, word32 sz)
#endif /* CYASSL_DES_ECB */
#endif /* STM32F2_CRYPTO */
void Des_SetIV(Des* des, const byte* iv)
{
if (des && iv)
XMEMCPY(des->reg, iv, DES_BLOCK_SIZE);
else if (des)
XMEMSET(des->reg, 0, DES_BLOCK_SIZE);
}
void Des3_SetIV(Des3* des, const byte* iv)
{
if (des && iv)
XMEMCPY(des->reg, iv, DES_BLOCK_SIZE);
else if (des)
XMEMSET(des->reg, 0, DES_BLOCK_SIZE);
}
#ifdef HAVE_CAVIUM
#include <cyassl/ctaocrypt/logging.h>
#include "cavium_common.h"
/* Initiliaze Des3 for use with Nitrox device */
int Des3_InitCavium(Des3* des3, int devId)
{
if (des3 == NULL)
return -1;
if (CspAllocContext(CONTEXT_SSL, &des3->contextHandle, devId) != 0)
return -1;
des3->devId = devId;
des3->magic = CYASSL_3DES_CAVIUM_MAGIC;
return 0;
}
/* Free Des3 from use with Nitrox device */
void Des3_FreeCavium(Des3* des3)
{
if (des3 == NULL)
return;
if (des3->magic != CYASSL_3DES_CAVIUM_MAGIC)
return;
CspFreeContext(CONTEXT_SSL, des3->contextHandle, des3->devId);
des3->magic = 0;
}
static void Des3_CaviumSetKey(Des3* des3, const byte* key, const byte* iv)
{
if (des3 == NULL)
return;
/* key[0] holds key, iv in reg */
XMEMCPY(des3->key[0], key, DES_BLOCK_SIZE*3);
Des3_SetIV(des3, iv);
}
static void Des3_CaviumCbcEncrypt(Des3* des3, byte* out, const byte* in,
word32 length)
{
word offset = 0;
word32 requestId;
while (length > CYASSL_MAX_16BIT) {
word16 slen = (word16)CYASSL_MAX_16BIT;
if (CspEncrypt3Des(CAVIUM_BLOCKING, des3->contextHandle,
CAVIUM_NO_UPDATE, slen, (byte*)in + offset,
out + offset, (byte*)des3->reg, (byte*)des3->key[0],
&requestId, des3->devId) != 0) {
CYASSL_MSG("Bad Cavium 3DES Cbc Encrypt");
}
length -= CYASSL_MAX_16BIT;
offset += CYASSL_MAX_16BIT;
XMEMCPY(des3->reg, out + offset - DES_BLOCK_SIZE, DES_BLOCK_SIZE);
}
if (length) {
word16 slen = (word16)length;
if (CspEncrypt3Des(CAVIUM_BLOCKING, des3->contextHandle,
CAVIUM_NO_UPDATE, slen, (byte*)in + offset,
out + offset, (byte*)des3->reg, (byte*)des3->key[0],
&requestId, des3->devId) != 0) {
CYASSL_MSG("Bad Cavium 3DES Cbc Encrypt");
}
XMEMCPY(des3->reg, out+offset+length - DES_BLOCK_SIZE, DES_BLOCK_SIZE);
}
}
static void Des3_CaviumCbcDecrypt(Des3* des3, byte* out, const byte* in,
word32 length)
{
word32 requestId;
word offset = 0;
while (length > CYASSL_MAX_16BIT) {
word16 slen = (word16)CYASSL_MAX_16BIT;
XMEMCPY(des3->tmp, in + offset + slen - DES_BLOCK_SIZE, DES_BLOCK_SIZE);
if (CspDecrypt3Des(CAVIUM_BLOCKING, des3->contextHandle,
CAVIUM_NO_UPDATE, slen, (byte*)in+offset, out+offset,
(byte*)des3->reg, (byte*)des3->key[0], &requestId,
des3->devId) != 0) {
CYASSL_MSG("Bad Cavium 3Des Decrypt");
}
length -= CYASSL_MAX_16BIT;
offset += CYASSL_MAX_16BIT;
XMEMCPY(des3->reg, des3->tmp, DES_BLOCK_SIZE);
}
if (length) {
word16 slen = (word16)length;
XMEMCPY(des3->tmp, in + offset + slen - DES_BLOCK_SIZE,DES_BLOCK_SIZE);
if (CspDecrypt3Des(CAVIUM_BLOCKING, des3->contextHandle,
CAVIUM_NO_UPDATE, slen, (byte*)in+offset, out+offset,
(byte*)des3->reg, (byte*)des3->key[0], &requestId,
des3->devId) != 0) {
CYASSL_MSG("Bad Cavium 3Des Decrypt");
}
XMEMCPY(des3->reg, des3->tmp, DES_BLOCK_SIZE);
}
}
#endif /* HAVE_CAVIUM */
#endif /* NO_DES3 */

View File

@ -1,6 +1,6 @@
/* dh.c
*
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
@ -23,6 +23,8 @@
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#ifndef NO_DH
#include <cyassl/ctaocrypt/dh.h>
@ -83,8 +85,8 @@ static word32 DiscreteLogWorkFactor(word32 n)
static void GeneratePrivate(DhKey* key, RNG* rng, byte* priv, word32* privSz)
{
word32 sz = mp_unsigned_bin_size(&key->p);
sz = min(sz, 2 * DiscreteLogWorkFactor(sz * BIT_SIZE) / BIT_SIZE + 1);
sz = min(sz, 2 * DiscreteLogWorkFactor(sz * CYASSL_BIT_SIZE) /
CYASSL_BIT_SIZE + 1);
RNG_GenerateBlock(rng, priv, sz);
priv[0] |= 0x0C;

View File

@ -1,6 +1,6 @@
/* dsa.c
*
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
@ -23,6 +23,8 @@
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#ifndef NO_DSA
#include <cyassl/ctaocrypt/dsa.h>

File diff suppressed because it is too large Load Diff

329
ctaocrypt/src/error.c Normal file
View File

@ -0,0 +1,329 @@
/* error.c
*
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
* CyaSSL 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.
*
* CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#include <cyassl/ctaocrypt/error.h>
#ifdef _MSC_VER
/* 4996 warning to use MS extensions e.g., strcpy_s instead of XSTRNCPY */
#pragma warning(disable: 4996)
#endif
void CTaoCryptErrorString(int error, char* buffer)
{
const int max = CYASSL_MAX_ERROR_SZ; /* shorthand */
#ifdef NO_ERROR_STRINGS
(void)error;
XSTRNCPY(buffer, "no support for error strings built in", max);
#else
switch (error) {
case OPEN_RAN_E :
XSTRNCPY(buffer, "opening random device error", max);
break;
case READ_RAN_E :
XSTRNCPY(buffer, "reading random device error", max);
break;
case WINCRYPT_E :
XSTRNCPY(buffer, "windows crypt init error", max);
break;
case CRYPTGEN_E :
XSTRNCPY(buffer, "windows crypt generation error", max);
break;
case RAN_BLOCK_E :
XSTRNCPY(buffer, "random device read would block error", max);
break;
case MP_INIT_E :
XSTRNCPY(buffer, "mp_init error state", max);
break;
case MP_READ_E :
XSTRNCPY(buffer, "mp_read error state", max);
break;
case MP_EXPTMOD_E :
XSTRNCPY(buffer, "mp_exptmod error state", max);
break;
case MP_TO_E :
XSTRNCPY(buffer, "mp_to_xxx error state, can't convert", max);
break;
case MP_SUB_E :
XSTRNCPY(buffer, "mp_sub error state, can't subtract", max);
break;
case MP_ADD_E :
XSTRNCPY(buffer, "mp_add error state, can't add", max);
break;
case MP_MUL_E :
XSTRNCPY(buffer, "mp_mul error state, can't multiply", max);
break;
case MP_MULMOD_E :
XSTRNCPY(buffer, "mp_mulmod error state, can't multiply mod", max);
break;
case MP_MOD_E :
XSTRNCPY(buffer, "mp_mod error state, can't mod", max);
break;
case MP_INVMOD_E :
XSTRNCPY(buffer, "mp_invmod error state, can't inv mod", max);
break;
case MP_CMP_E :
XSTRNCPY(buffer, "mp_cmp error state", max);
break;
case MP_ZERO_E :
XSTRNCPY(buffer, "mp zero result, not expected", max);
break;
case MEMORY_E :
XSTRNCPY(buffer, "out of memory error", max);
break;
case RSA_WRONG_TYPE_E :
XSTRNCPY(buffer, "RSA wrong block type for RSA function", max);
break;
case RSA_BUFFER_E :
XSTRNCPY(buffer, "RSA buffer error, output too small or input too big",
max);
break;
case BUFFER_E :
XSTRNCPY(buffer, "Buffer error, output too small or input too big",max);
break;
case ALGO_ID_E :
XSTRNCPY(buffer, "Setting Cert AlogID error", max);
break;
case PUBLIC_KEY_E :
XSTRNCPY(buffer, "Setting Cert Public Key error", max);
break;
case DATE_E :
XSTRNCPY(buffer, "Setting Cert Date validity error", max);
break;
case SUBJECT_E :
XSTRNCPY(buffer, "Setting Cert Subject name error", max);
break;
case ISSUER_E :
XSTRNCPY(buffer, "Setting Cert Issuer name error", max);
break;
case CA_TRUE_E :
XSTRNCPY(buffer, "Setting basic constraint CA true error", max);
break;
case EXTENSIONS_E :
XSTRNCPY(buffer, "Setting extensions error", max);
break;
case ASN_PARSE_E :
XSTRNCPY(buffer, "ASN parsing error, invalid input", max);
break;
case ASN_VERSION_E :
XSTRNCPY(buffer, "ASN version error, invalid number", max);
break;
case ASN_GETINT_E :
XSTRNCPY(buffer, "ASN get big int error, invalid data", max);
break;
case ASN_RSA_KEY_E :
XSTRNCPY(buffer, "ASN key init error, invalid input", max);
break;
case ASN_OBJECT_ID_E :
XSTRNCPY(buffer, "ASN object id error, invalid id", max);
break;
case ASN_TAG_NULL_E :
XSTRNCPY(buffer, "ASN tag error, not null", max);
break;
case ASN_EXPECT_0_E :
XSTRNCPY(buffer, "ASN expect error, not zero", max);
break;
case ASN_BITSTR_E :
XSTRNCPY(buffer, "ASN bit string error, wrong id", max);
break;
case ASN_UNKNOWN_OID_E :
XSTRNCPY(buffer, "ASN oid error, unknown sum id", max);
break;
case ASN_DATE_SZ_E :
XSTRNCPY(buffer, "ASN date error, bad size", max);
break;
case ASN_BEFORE_DATE_E :
XSTRNCPY(buffer, "ASN date error, current date before", max);
break;
case ASN_AFTER_DATE_E :
XSTRNCPY(buffer, "ASN date error, current date after", max);
break;
case ASN_SIG_OID_E :
XSTRNCPY(buffer, "ASN signature error, mismatched oid", max);
break;
case ASN_TIME_E :
XSTRNCPY(buffer, "ASN time error, unkown time type", max);
break;
case ASN_INPUT_E :
XSTRNCPY(buffer, "ASN input error, not enough data", max);
break;
case ASN_SIG_CONFIRM_E :
XSTRNCPY(buffer, "ASN sig error, confirm failure", max);
break;
case ASN_SIG_HASH_E :
XSTRNCPY(buffer, "ASN sig error, unsupported hash type", max);
break;
case ASN_SIG_KEY_E :
XSTRNCPY(buffer, "ASN sig error, unsupported key type", max);
break;
case ASN_DH_KEY_E :
XSTRNCPY(buffer, "ASN key init error, invalid input", max);
break;
case ASN_NTRU_KEY_E :
XSTRNCPY(buffer, "ASN NTRU key decode error, invalid input", max);
break;
case ECC_BAD_ARG_E :
XSTRNCPY(buffer, "ECC input argument wrong type, invalid input", max);
break;
case ASN_ECC_KEY_E :
XSTRNCPY(buffer, "ECC ASN1 bad key data, invalid input", max);
break;
case ECC_CURVE_OID_E :
XSTRNCPY(buffer, "ECC curve sum OID unsupported, invalid input", max);
break;
case BAD_FUNC_ARG :
XSTRNCPY(buffer, "Bad function argument", max);
break;
case NOT_COMPILED_IN :
XSTRNCPY(buffer, "Feature not compiled in", max);
break;
case UNICODE_SIZE_E :
XSTRNCPY(buffer, "Unicode password too big", max);
break;
case NO_PASSWORD :
XSTRNCPY(buffer, "No password provided by user", max);
break;
case ALT_NAME_E :
XSTRNCPY(buffer, "Alt Name problem, too big", max);
break;
case AES_GCM_AUTH_E:
XSTRNCPY(buffer, "AES-GCM Authentication check fail", max);
break;
case AES_CCM_AUTH_E:
XSTRNCPY(buffer, "AES-CCM Authentication check fail", max);
break;
case CAVIUM_INIT_E:
XSTRNCPY(buffer, "Cavium Init type error", max);
break;
case COMPRESS_INIT_E:
XSTRNCPY(buffer, "Compress Init error", max);
break;
case COMPRESS_E:
XSTRNCPY(buffer, "Compress error", max);
break;
case DECOMPRESS_INIT_E:
XSTRNCPY(buffer, "DeCompress Init error", max);
break;
case DECOMPRESS_E:
XSTRNCPY(buffer, "DeCompress error", max);
break;
case BAD_ALIGN_E:
XSTRNCPY(buffer, "Bad alignment error, no alloc help", max);
break;
case ASN_NO_SIGNER_E :
XSTRNCPY(buffer, "ASN no signer error to confirm failure", max);
break;
case ASN_CRL_CONFIRM_E :
XSTRNCPY(buffer, "ASN CRL sig error, confirm failure", max);
break;
case ASN_CRL_NO_SIGNER_E :
XSTRNCPY(buffer, "ASN CRL no signer error to confirm failure", max);
break;
case ASN_OCSP_CONFIRM_E :
XSTRNCPY(buffer, "ASN OCSP sig error, confirm failure", max);
break;
default:
XSTRNCPY(buffer, "unknown error number", max);
}
#endif /* NO_ERROR_STRINGS */
}

View File

@ -1,6 +1,6 @@
/* fp_mont_small.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_12.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_17.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_20.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_24.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_28.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_3.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_32.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_4.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_48.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_6.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_64.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_7.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_8.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_9.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_mul_comba_small_set.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_12.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_17.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_20.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_24.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_28.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_3.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_32.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_4.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_48.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_6.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_64.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_7.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

View File

@ -1,6 +1,6 @@
/* fp_sqr_comba_8.i
*
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
* Copyright (C) 2006-2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
*

Some files were not shown because too many files have changed in this diff Show More