Граф коммитов

153 Коммитов

Автор SHA1 Сообщение Дата
snofz a57482e350 DH cleanup 2021-09-20 14:02:56 -07:00
Spencer Nofzinger c23f80fc0b
Merge pull request #9 from microsoft/spnofzin/quality
Code quality: RSA and rand
2021-09-20 10:13:51 -07:00
snofz c4c1f88018 Handle unsigned return value, and siglen 2021-09-10 15:57:41 -07:00
snofz 5cfc632012 cbResult type change, various fixes 2021-09-09 17:27:08 -07:00
snofz 53d175ed2a Feedback 2021-09-08 14:04:52 -07:00
snofz f99872a953 Fix typo 2021-09-07 15:34:55 -07:00
snofz 6735612749 Feedback 2021-09-07 15:12:46 -07:00
snofz 1122f0f99b SAL for rand.c 2021-09-03 16:22:28 -07:00
snofz 31aec91daf RSA code quality 2021-09-03 16:09:40 -07:00
snofz 4dacd1de6a SAL for sc_ossl_rand.c 2021-09-03 16:09:40 -07:00
Samuel Lee 321c424691
Merge pull request #8 from microsoft/saml-UpdateREADME
Update building instructions in README
2021-09-03 14:10:16 +01:00
Samuel Lee 1fd4f860ed Update building instructions in README 2021-09-02 06:29:48 -07:00
Spencer Nofzinger d843fc8ec9
Merge pull request #6 from microsoft/spnofzin/digest
Digests: SAL annotations for parameters
2021-08-31 15:41:10 -07:00
snofz 1949a43420 Function declarations 2021-08-30 14:16:24 -07:00
snofz 5a1fb81a2e Add SCOSSL_STATUS for functions that return 1 for success 2021-08-27 17:08:35 -07:00
snofz 4dc557f47b Feedback on _in_reads_bytes_, typo 2021-08-26 17:12:16 -07:00
Mitch Lindgren 33b9b539b2
Merge pull request #7 from xumia/fix-load-lib-issue
[build]: Fix the loading symcryengine issue
2021-08-24 16:53:06 -07:00
XuHui Miao f4bf47e079 Change the crypto to use the variable OPENSSL_CRYPTO_LIBRARY 2021-08-24 08:39:29 +00:00
XuHui Miao bd96afeb56 Fix the loading symcryengine issue 2021-08-24 06:33:00 +00:00
spnofzin de0f4dace5 Digests: SAL annotations for parameters 2021-08-10 15:05:54 -07:00
Samuel Lee cfac8bbd26
Merge pull request #5 from microsoft/saml-TidyUpDigestCodeAndSomeUnitTestFixes
Simplify digest memory allocation
2021-07-09 15:16:56 +01:00
Samuel Lee 2b1eac5fc8 Move magic minimum padding sizes into #defines w/ comments 2021-07-09 07:13:16 -07:00
Samuel Lee d06331a93c Simplify digest memory allocation
+ Hopefully handing allocation/freeing of SymCrypt digest state entirely
  to OpenSSL should avoid leaks in HMAC which Ming-Wei observes but I
  have not been able to reproduce
  + Reduces complexity and lines of code anyway, so seems like a step in
    the right direction
+ Free allocated public key on successful ECDH
+ Error in the engine when flen provided to RSA is too big, rather than
  changing the value to read a prefix of the provided buffer
  + Also explicitly write to the amount of memory that is specified in
    the RSA documentation:
    https://www.openssl.org/docs/man1.1.1/man3/RSA_private_decrypt.html
2021-07-08 08:50:48 -07:00
Samuel Lee 74a8913680
Merge pull request #4 from microsoft/saml-FixSomeMemoryLeaks
Fixes for some memory leaks
2021-06-29 10:11:38 +01:00
Samuel Lee e9bd8af8cc Fixes for some memory leaks
+ In sc_ossl_rsa_finish free exdata if it is non-NULL
  + And do not dereference exdata if it is NULL
+ In ECC, do not initialize exdata until we know we will definitely be
  using it (and not falling back to default implementation)
  + Rather than using the curve to determine whether to free exdata
    members, use the initialized field
  + Always free the exdata if it is non-NULL
+ Also in ECDSA, handle DER encoded ECDSA signatures for P192 and P224
2021-06-28 09:07:18 -07:00
Samuel Lee b9c6499f24
Merge pull request #3 from microsoft/saml-rename-symbols-to-sc_ossl
Rename symbols to disambiguate Engine & SymCrypt symbols
2021-06-23 18:57:40 +01:00
Samuel Lee 53cd3d972f Return more meaningful value for SC_OSSL_ENGINE_Initialize 2021-06-23 01:26:26 -07:00
Samuel Lee b0431c2faa Rename symbols to disambiguate Engine & SymCrypt symbols
+ Use sc_ossl almost everywhere - do not use e_symcrypt or symcrypt
+ Tweak README
2021-06-23 01:26:15 -07:00
Samuel Lee f77a5c0f95 Rename source files - NON-FUNCTIONAL COMMIT
+ Renaming all the files separately to renaming all the symbols to help
  git track file history - the source will not build with this commit as
  the file contents have not been modified
2021-06-23 01:26:00 -07:00
Samuel Lee ea2efcea15
Merge pull request #2 from microsoft/saml-publish-latest-to-github
Publish latest to GitHub
2021-06-22 12:52:00 +01:00
Samuel Lee 9be8384368 Use CRLF in all files 2021-06-21 06:50:12 -07:00
Samuel Lee c8462fff35 Update README with limitations of current engine 2021-06-21 05:54:50 -07:00
Samuel Lee f3a56da80b Merged PR 4677683: Enable various TLS features
+ Special AES-GCM codepaths for handling ESP buffers which have 8B of IV
  at the start, then the payload, then 16B of tag (or ICV)
  + Requires 2 new CTRL methods - one to set AAD, one to set the
    constant part of the IV (4B)
+ In AES-CBC use the default IV handling area to enable easy export of
  the IV in the CMS API test
+ Try to enable use of MD5+SHA1 hash everywhere as it seems to be
  important for TLS tests (log info messages in these cases)
  + Though it is hard to fallback to OpenSSL in RSA sign/verify, it turns
    out to be easy to support MD5+SHA1 signatures using SymCrypt
  + Similarly for TLS PRF - there is an existing SymCrypt functions for
    TLSPRF1_1 which handles the MD5+SHA1 hash
  + For HKDF fallback to performing the operation using OpenSSL APIs in
    the engine if the digest is not supported by SymCrypt (already being
    done for the cases where we do not perform full HKDF)
+ Reduce noisy INFO logs from RSA_PSS
2021-06-21 05:29:14 -07:00
Samuel Lee 4303578fbb Merged PR 4583253: Initial support for ECC in SymCrypt engine
+ Support NIST prime curves for ECDSA and ECDH
2021-06-21 05:28:36 -07:00
spnofzin aeb43437f5 Merged PR 4629047: RNG: plug symcrypt functions into engine's rng functions
Hooking up SymCrypt RNG functions to OpenSSL engine
2021-06-21 05:27:57 -07:00
Samuel Lee 37a5df36b0 Merged PR 4550147: Fixes for RSA PSS, use default ctrl_str methods, and fix for AES-GCM state
+ Introduce RSA pmeths which reroute calls to sign/verify PSS to SymCrypt, rather than using
OpenSSL's padding handling which could not be within our FIPS boundary
  + Mostly should be as in default OpenSSL, just with sign/verify methods replaced
+ Still just using RSA method for everything else - PKCS1 and OAEP padding can be routed appropriately just at the RSA method level
+ Fallback to OpenSSL for priv_enc and pub_dec RSA methods
+ Introduce SymCrypt error logging macro
+ Default to falling back to OpenSSL for unknown padding schemes for RSA encrypt and decrypt
+ Hook up hkdf and tls1prf to use OpenSSL's ctrl_str methods - which in turn call our ctrl method
+ Update SslPlay tests to exercise PSS
2021-06-21 05:20:14 -07:00
Mitch Lindgren daac412fa6
Merge pull request #1 from microsoft/mitchl/update-readme
Update README
2021-06-10 12:50:33 -07:00
Mitch Lindgren cfdeac6ef0
Update README.md
Fix typo

Co-authored-by: Samuel Lee <56448320+samuel-lee-msft@users.noreply.github.com>
2021-06-10 12:17:36 -07:00
Mitch Lindgren 8b3d3ac163 Add note to README that code is not production ready 2021-06-10 12:09:01 -07:00
Mitch Lindgren e713516091 Fix typo 2021-05-26 17:15:34 -07:00
Mitch Lindgren 3a0abf9d80 Remove SUPPORT.md 2021-05-26 17:10:24 -07:00
Mitch Lindgren 63d9e763ec Merge remote-tracking branch 'github/main' into user/mitchl/prepare-for-github 2021-05-26 17:09:55 -07:00
Mitch Lindgren 131a3129a9 Add copyright headers 2021-05-26 16:13:55 -07:00
Mitch Lindgren 🦎 e1701cfaa7 Merged PR 4509649: Add NOTICE
Add a NOTICE file with OpenSSL copyright information. I didn't add the LICENSE, README or other files since I figure we'll pick those up from GitHub when we merge our code into that repo.
2021-05-26 16:08:22 -07:00
Samuel Lee b731b585f0 Merged PR 4502434: Add AES Custom Copy
+ When SymCrypt AES context is copied, we need to fix up the start and
  end pointers into the expanded key.
  + Use the SymCrypt key copy functions
+ Disable AES-XTS again for now
  + Needs some thought about how to handle gracefully
+ Add explicit error message when trying to initialize an RSA key for
  multi-prime RSA. We should consider the best way to fall back to
  OpenSSL here (if necessary)
2021-05-26 16:08:22 -07:00
Samuel Lee d7ca105ba6 Merged PR 4473361: Fixes for memory issues and AES-XTS/AES-GCM wiring
+ Looks like the EVP interface expects callers to do one En/Decrypt call per XTS data unit, rather than using the block size to indicate the data unit size
+ Fixes for some typos
+ For AES-GCM - remove `EVP_CIPH_CUSTOM_COPY` flag, and fix return values for `symcrypt_aes_gcm_cipher` (-1 is error, >= 0 is success, and finalize call which handles the tag should return 0)
+ Fix up some issues identified by sanitizers when running SslPlay
  + We still seem some apparent leaks from OpenSSL (a few hundred bytes) - it seems to be a known thing where `EVP_PKEY_keygen` can increase the size of an OpenSSL internal buffer ([reference](https://stackoverflow.com/questions/21532371/memory-leak-in-openssl-function-evp-pkey-keygen)). I'm not sure we can do anything about it in the engine
2021-05-26 16:08:22 -07:00
Mitch Lindgren 🦎 2f6c8b2468 Merged PR 4430726: Various small fixes
Removed most checked-in binaries, changes alloc/free implementation, adjusted casing for consistency with SymCrypt, partial fixups of CMakeLists
2021-05-26 16:08:22 -07:00
Akshay Kumar d9f5d13ef6 Initial commit 2021-05-26 16:08:02 -07:00
Microsoft Open Source ed317018db Initial SUPPORT.md commit 2021-04-30 16:18:36 -07:00
Microsoft Open Source 80df3a53ec Initial SECURITY.md commit 2021-04-30 16:18:35 -07:00