Skip to content

Commit

Permalink
mbedtls: Update to upstream version 2.16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored and myhalibobo committed Sep 3, 2019
1 parent a1151a3 commit fd564fb
Show file tree
Hide file tree
Showing 86 changed files with 3,009 additions and 891 deletions.
6 changes: 3 additions & 3 deletions thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ changes are marked with `// -- GODOT --` comments.
- Version: 1.1.0
- License: MIT

File extracted from upstream releaze tarball:
File extracted from upstream release tarball:

- All `*.c` and `*.h` in `lib/` and `lib/includes/`
- `wslay.h` has a small Godot addition to fix MSVC build.
Expand All @@ -277,10 +277,10 @@ File extracted from upstream releaze tarball:
## mbedtls

- Upstream: https://tls.mbed.org/
- Version: 2.16.0
- Version: 2.16.2
- License: Apache 2.0

File extracted from upstream release tarball `mbedtls-2.16.0-apache.tgz`:
File extracted from upstream release tarball (`-apache.tgz` variant):
- All `*.h` from `include/mbedtls/` to `thirdparty/mbedtls/include/mbedtls/`
- All `*.c` from `library/` to `thirdparty/mbedtls/library/`
- Applied the patch in `thirdparty/mbedtls/1453.diff` (PR 1453).
Expand Down
4 changes: 4 additions & 0 deletions thirdparty/mbedtls/include/mbedtls/aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,8 @@ MBEDTLS_DEPRECATED void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
#undef MBEDTLS_DEPRECATED
#endif /* !MBEDTLS_DEPRECATED_REMOVED */


#if defined(MBEDTLS_SELF_TEST)
/**
* \brief Checkup routine.
*
Expand All @@ -663,6 +665,8 @@ MBEDTLS_DEPRECATED void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
*/
int mbedtls_aes_self_test( int verbose );

#endif /* MBEDTLS_SELF_TEST */

#ifdef __cplusplus
}
#endif
Expand Down
6 changes: 6 additions & 0 deletions thirdparty/mbedtls/include/mbedtls/aesni.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
#ifndef MBEDTLS_AESNI_H
#define MBEDTLS_AESNI_H

#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif

#include "aes.h"

#define MBEDTLS_AESNI_AES 0x02000000u
Expand Down
4 changes: 4 additions & 0 deletions thirdparty/mbedtls/include/mbedtls/arc4.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
unsigned char *output );

#if defined(MBEDTLS_SELF_TEST)

/**
* \brief Checkup routine
*
Expand All @@ -135,6 +137,8 @@ int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned
*/
int mbedtls_arc4_self_test( int verbose );

#endif /* MBEDTLS_SELF_TEST */

#ifdef __cplusplus
}
#endif
Expand Down
13 changes: 10 additions & 3 deletions thirdparty/mbedtls/include/mbedtls/asn1write.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,21 @@
#ifndef MBEDTLS_ASN1_WRITE_H
#define MBEDTLS_ASN1_WRITE_H

#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif

#include "asn1.h"

#define MBEDTLS_ASN1_CHK_ADD(g, f) \
do { \
if( ( ret = f ) < 0 ) \
do \
{ \
if( ( ret = (f) ) < 0 ) \
return( ret ); \
else \
g += ret; \
(g) += ret; \
} while( 0 )

#ifdef __cplusplus
Expand Down
9 changes: 9 additions & 0 deletions thirdparty/mbedtls/include/mbedtls/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
#ifndef MBEDTLS_BASE64_H
#define MBEDTLS_BASE64_H

#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif

#include <stddef.h>

#define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */
Expand Down Expand Up @@ -75,13 +81,16 @@ int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen,
int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen,
const unsigned char *src, size_t slen );

#if defined(MBEDTLS_SELF_TEST)
/**
* \brief Checkup routine
*
* \return 0 if successful, or 1 if the test failed
*/
int mbedtls_base64_self_test( int verbose );

#endif /* MBEDTLS_SELF_TEST */

#ifdef __cplusplus
}
#endif
Expand Down
11 changes: 10 additions & 1 deletion thirdparty/mbedtls/include/mbedtls/bignum.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@
#define MBEDTLS_ERR_MPI_NOT_ACCEPTABLE -0x000E /**< The input arguments are not acceptable. */
#define MBEDTLS_ERR_MPI_ALLOC_FAILED -0x0010 /**< Memory allocation failed. */

#define MBEDTLS_MPI_CHK(f) do { if( ( ret = f ) != 0 ) goto cleanup; } while( 0 )
#define MBEDTLS_MPI_CHK(f) \
do \
{ \
if( ( ret = (f) ) != 0 ) \
goto cleanup; \
} while( 0 )

/*
* Maximum size MPIs are allowed to grow to in number of limbs.
Expand Down Expand Up @@ -943,13 +948,17 @@ int mbedtls_mpi_gen_prime( mbedtls_mpi *X, size_t nbits, int flags,
int (*f_rng)(void *, unsigned char *, size_t),
void *p_rng );

#if defined(MBEDTLS_SELF_TEST)

/**
* \brief Checkup routine
*
* \return 0 if successful, or 1 if the test failed
*/
int mbedtls_mpi_self_test( int verbose );

#endif /* MBEDTLS_SELF_TEST */

#ifdef __cplusplus
}
#endif
Expand Down
8 changes: 7 additions & 1 deletion thirdparty/mbedtls/include/mbedtls/bn_mul.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
#ifndef MBEDTLS_BN_MUL_H
#define MBEDTLS_BN_MUL_H

#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif

#include "bignum.h"

#if defined(MBEDTLS_HAVE_ASM)
Expand Down Expand Up @@ -750,7 +756,7 @@
"sw $10, %2 \n\t" \
: "=m" (c), "=m" (d), "=m" (s) \
: "m" (s), "m" (d), "m" (c), "m" (b) \
: "$9", "$10", "$11", "$12", "$13", "$14", "$15" \
: "$9", "$10", "$11", "$12", "$13", "$14", "$15", "lo", "hi" \
);

#endif /* MIPS */
Expand Down
4 changes: 4 additions & 0 deletions thirdparty/mbedtls/include/mbedtls/camellia.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,17 @@ int mbedtls_camellia_crypt_ctr( mbedtls_camellia_context *ctx,
unsigned char *output );
#endif /* MBEDTLS_CIPHER_MODE_CTR */

#if defined(MBEDTLS_SELF_TEST)

/**
* \brief Checkup routine
*
* \return 0 if successful, or 1 if the test failed
*/
int mbedtls_camellia_self_test( int verbose );

#endif /* MBEDTLS_SELF_TEST */

#ifdef __cplusplus
}
#endif
Expand Down
6 changes: 6 additions & 0 deletions thirdparty/mbedtls/include/mbedtls/ccm.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
#ifndef MBEDTLS_CCM_H
#define MBEDTLS_CCM_H

#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif

#include "cipher.h"

#define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D /**< Bad input parameters to the function. */
Expand Down
Loading

0 comments on commit fd564fb

Please sign in to comment.