summaryrefslogtreecommitdiffstats
path: root/modules/mbedtls
Commit message (Collapse)AuthorAgeFilesLines
...
* Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde2021-04-272-6/+6
| | | | | | | | We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
* Fixes small typos and grammar correctionAnshul7sp12021-03-121-1/+1
|
* Initialize class/struct variables with default values in modules/Rafał Mikrut2021-02-086-8/+4
|
* Cleanup: Remove executable bit from files which don't need itRémi Verschelde2021-01-195-0/+0
| | | | Drop unused xpmfix.sh script.
* Update copyright statements to 2021Rémi Verschelde2021-01-0114-28/+28
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-2/+2
|
* SCons: Add explicit dependencies on thirdparty code in cloned envRémi Verschelde2020-12-181-5/+18
| | | | | | | | | | | | | | Since we clone the environments to build thirdparty code, we don't get an explicit dependency on the build objects produced by that environment. So when we update thirdparty code, Godot code using it is not necessarily rebuilt (I think it is for changed headers, but not for changed .c/.cpp files), which can lead to an invalid compilation output (linking old Godot .o files with a newer, potentially ABI breaking version of thirdparty code). This was only seen as really problematic with bullet updates (leading to crashes when rebuilding Godot after a bullet update without cleaning .o files), but it's safer to fix it everywhere, even if it's a LOT of hacky boilerplate.
* feat: HMAC support in Crypto APIsJon Bonazza2020-11-266-4/+220
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-073-4/+4
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Fix certificate generation with mbedtls 2.16.8 .Fabio Alessandrelli2020-09-151-13/+8
| | | | | | | | | | | | | | When generating certificates with `Crypto.generate_self_signed_certificate` we generate the PEM in a buffer via `mbedtls_x509write_crt_pem`. Since version 2.16.8, mbedtls adds spurious data at the end of the buffer due to internal optimizations, this breaks our logic when we try to immediately parse it and return a proper `X509Certificate` object. This commit updates the code to find the actual PEM length to parse using `strlen`, takes extra caution always adding the terminator to the buffer, and slightly improve error messages.
* Implement RSA encryption/decryption.Fabio Alessandrelli2020-06-182-0/+29
|
* Implement sign and verify in crypto.Fabio Alessandrelli2020-06-182-0/+48
|
* CryptoKey supports public keys.Fabio Alessandrelli2020-06-182-8/+55
|
* Better zeroizing in CryptoKey.Fabio Alessandrelli2020-06-181-15/+8
| | | | Small code clenup (after PoolByteArray change).
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-143-16/+30
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-149-45/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-102-4/+8
| | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* Replace NULL with nullptrlupoDharkael2020-04-026-38/+38
|
* SCons: Format buildsystem files with psf/blackRémi Verschelde2020-03-302-4/+5
| | | | | | | | | | | | | | | | | | | | | Configured for a max line length of 120 characters. psf/black is very opinionated and purposely doesn't leave much room for configuration. The output is mostly OK so that should be fine for us, but some things worth noting: - Manually wrapped strings will be reflowed, so by using a line length of 120 for the sake of preserving readability for our long command calls, it also means that some manually wrapped strings are back on the same line and should be manually merged again. - Code generators using string concatenation extensively look awful, since black puts each operand on a single line. We need to refactor these generators to use more pythonic string formatting, for which many options are available (`%`, `format` or f-strings). - CI checks and a pre-commit hook will be added to ensure that future buildsystem changes are well-formatted.
* Adding missing include guards to header files identified by LGTM.Rajat Goswami2020-03-231-0/+5
| | | | This addresses the issue godotengine/godot#37143
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-1/+1
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* Changed default for p_validate_certs to true.simpuid2020-03-171-1/+1
| | | | Fixes #37084
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-204-8/+8
| | | | objects and made them default.
* Merge pull request #36296 from Faless/dtls/enet_vulkanRémi Verschelde2020-02-188-12/+615
|\ | | | | DTLS support + optional ENet encryption
| * New PacketPeerDTLS and DTLSServer classes.Fabio Alessandrelli2020-02-177-3/+604
| | | | | | | | Custom instance implementation via the mbedtls module.
| * Move mbedlts print func to SSLMbedTLSContext.Fabio Alessandrelli2020-02-163-9/+11
| |
* | PoolVector is gone, replaced by VectorJuan Linietsky2020-02-183-19/+19
|/ | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Remove duplicate ERR_PRINT macro.Marcel Admiraal2020-02-052-3/+3
|
* Update copyright statements to 2020Rémi Verschelde2020-01-018-16/+16
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Removed unused variables, add some constants numbersRafał Mikrut2019-12-102-5/+2
|
* Fix crash when passing invalid key to Crypto.Fabio Alessandrelli2019-10-091-0/+1
| | | | In generate_self_signed_certificate
* Added some obvious errors explanationsqarmin2019-09-251-7/+7
|
* Style: Fix copyright headers in new filesRémi Verschelde2019-08-284-4/+4
|
* Better error handling in SSLContext, CryptoFabio Alessandrelli2019-08-222-5/+8
|
* Fix StreamPeerSSL connect_to_stream w/ custom certFabio Alessandrelli2019-08-221-1/+1
| | | | | | Follow up on #29871. Was checking the wrong parameter, causing the code to ignore provided stream-specific SSL certificate.
* Fix regression in StreamPeerSSLFabio Alessandrelli2019-08-223-10/+4
| | | | | Validate that base stream is valid before accepting/connecting. Also remove unnecessary includes.
* Rewrite StreamPeerSSL with SSLContext helper classFabio Alessandrelli2019-08-215-80/+256
| | | | | | | connect_to_stream now accepts optional parameter to specify which certificates to trust. Implement accept_stream (SSL server) with key/cert parameters to specify the RSA key and X509 certificate resources.
* New CryptoMbedTLS Crypto implementation.Fabio Alessandrelli2019-08-213-1/+412
| | | | Allows random bytes, RSA keys, and X509 certificates generation.
* CryptoCore class to access to base crypto utils.Fabio Alessandrelli2019-07-022-3/+0
| | | | | | | | | | | | | | | | | | Godot core needs MD5/SHA256/AES/Base64 which used to be provided by separate libraries. Since we bundle mbedtls in most cases, and we can easily only include the needed sources if we so desire, let's use it. To simplify library changes in the future, and better isolate header dependencies all functions have been wrapped around inside a class in `core/math/crypto_base.h`. If the mbedtls module is disabled, we only bundle the needed source files independently of the `builtin_mbedtls` option. If the module is enabled, the `builtin_mbedtls` option works as usual. Also remove some unused headers from StreamPeerMbedTLS which were causing build issues.
* Add NULL check in SSL connect_to_streamFabio Alessandrelli2019-06-241-0/+2
|
* Small hack to avoid runtime error when using ubsanFabio Alessandrelli2019-02-201-1/+4
| | | | | | mbedtls_ssl_read cannot be called with a NULL buffer even if len is 0, as those are passed to memcpy and compilers doesn't like that. Always pass a single byte (still len 0 so nothing is actually copied)
* Fix typos with codespellRémi Verschelde2019-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | Using codespell 1.14.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang doubleclick lod nd numer que te unselect EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* Update copyright statements to 2019Rémi Verschelde2019-01-014-8/+8
| | | | Happy new year to the wonderful Godot community!
* Fix missing/malformed license headersRémi Verschelde2019-01-012-2/+2
|
* SCons: Build thirdparty code in own env, disable warningsRémi Verschelde2018-09-281-1/+5
| | | | | Also remove unnecessary `Export('env')` in other SCsubs, Export should only be used when exporting *new* objects.
* Fix invalid comparison warnings: [-Wbool-compare] and [-Wenum-compare]Rémi Verschelde2018-09-272-9/+11
| | | | | | | | | | | | | Fixes the following GCC 5 warnings and actual bugs: ``` drivers/unix/net_socket_posix.cpp:562:28: warning: comparison between 'enum IP::Type' and 'enum NetSocket::Type' [-Wenum-compare] modules/gdscript/gdscript_function.cpp:792:26: warning: comparison of constant '17' with boolean expression is always true [-Wbool-compare] modules/gdscript/gdscript_function.cpp:792:26: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] modules/gdscript/gdscript_parser.cpp:5082:58: warning: comparison of constant '6' with boolean expression is always false [-Wbool-compare] modules/gdscript/gdscript_parser.cpp:5082:58: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] modules/mbedtls/stream_peer_mbed_tls.cpp:286:45: warning: comparison between 'enum StreamPeerTCP::Status' and 'enum StreamPeerSSL::Status' [-Wenum-compare] modules/mbedtls/stream_peer_mbed_tls.cpp:313:45: warning: comparison between 'enum StreamPeerTCP::Status' and 'enum StreamPeerSSL::Status' [-Wenum-compare] ```
* Add checks for clean disconnect in HTTP/TCP/SSL.Fabio Alessandrelli2018-09-211-3/+36
| | | | | Half-open TCP connection can, of course, only be detected by writing the socket, or waiting for TCP timeout.
* Allow system certs file to be used by Editor.Fabio Alessandrelli2018-09-151-5/+3
| | | | | | Note, it will only used by the Editor, not when running the game. This allows package maintainer to compile Godot to use system installed certificates when accessing the AssetLib.
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-122-2/+2
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.