Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mbedtls
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
external
mbedtls
Commits
0bd101e9
Commit
0bd101e9
authored
Apr 09, 2019
by
Simon Morlat
Browse files
Options
Browse Files
Download
Plain Diff
Merge tag 'mbedtls-2.16.1' into pr1813-2.16.0
Mbed TLS version 2.16.1
parents
15cdb75b
9f4f8eec
Changes
98
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
98 changed files
with
4662 additions
and
1271 deletions
+4662
-1271
ChangeLog
ChangeLog
+43
-1
README.md
README.md
+7
-0
doc_mainpage.h
doxygen/input/doc_mainpage.h
+1
-1
mbedtls.doxyfile
doxygen/mbedtls.doxyfile
+1
-1
aesni.h
include/mbedtls/aesni.h
+6
-0
asn1write.h
include/mbedtls/asn1write.h
+6
-0
base64.h
include/mbedtls/base64.h
+6
-0
bn_mul.h
include/mbedtls/bn_mul.h
+7
-1
ccm.h
include/mbedtls/ccm.h
+6
-0
certs.h
include/mbedtls/certs.h
+6
-0
cipher.h
include/mbedtls/cipher.h
+1
-1
cmac.h
include/mbedtls/cmac.h
+6
-0
compat-1.3.h
include/mbedtls/compat-1.3.h
+6
-0
config.h
include/mbedtls/config.h
+20
-0
ctr_drbg.h
include/mbedtls/ctr_drbg.h
+6
-0
ecdh.h
include/mbedtls/ecdh.h
+6
-0
ecdsa.h
include/mbedtls/ecdsa.h
+6
-0
ecjpake.h
include/mbedtls/ecjpake.h
+5
-0
ecp.h
include/mbedtls/ecp.h
+6
-0
ecp_internal.h
include/mbedtls/ecp_internal.h
+6
-0
error.h
include/mbedtls/error.h
+6
-0
gcm.h
include/mbedtls/gcm.h
+6
-0
havege.h
include/mbedtls/havege.h
+6
-0
hkdf.h
include/mbedtls/hkdf.h
+6
-0
hmac_drbg.h
include/mbedtls/hmac_drbg.h
+6
-0
net.h
include/mbedtls/net.h
+5
-0
nist_kw.h
include/mbedtls/nist_kw.h
+6
-0
padlock.h
include/mbedtls/padlock.h
+6
-0
pem.h
include/mbedtls/pem.h
+6
-0
pkcs12.h
include/mbedtls/pkcs12.h
+6
-0
pkcs5.h
include/mbedtls/pkcs5.h
+6
-0
platform_util.h
include/mbedtls/platform_util.h
+2
-2
poly1305.h
include/mbedtls/poly1305.h
+1
-1
ssl_cache.h
include/mbedtls/ssl_cache.h
+6
-0
ssl_ciphersuites.h
include/mbedtls/ssl_ciphersuites.h
+6
-0
ssl_cookie.h
include/mbedtls/ssl_cookie.h
+6
-0
ssl_internal.h
include/mbedtls/ssl_internal.h
+6
-0
ssl_ticket.h
include/mbedtls/ssl_ticket.h
+6
-0
version.h
include/mbedtls/version.h
+4
-4
x509_csr.h
include/mbedtls/x509_csr.h
+8
-0
CMakeLists.txt
library/CMakeLists.txt
+9
-3
asn1write.c
library/asn1write.c
+17
-11
bignum.c
library/bignum.c
+25
-13
ecdsa.c
library/ecdsa.c
+7
-2
ssl_ciphersuites.c
library/ssl_ciphersuites.c
+35
-22
version_features.c
library/version_features.c
+3
-0
x509_crt.c
library/x509_crt.c
+1
-1
x509_csr.c
library/x509_csr.c
+12
-3
x509write_crt.c
library/x509write_crt.c
+39
-8
x509write_csr.c
library/x509write_csr.c
+32
-4
.gitignore
programs/.gitignore
+1
-0
Makefile
programs/Makefile
+9
-4
rsa_sign_pss.c
programs/pkey/rsa_sign_pss.c
+0
-1
CMakeLists.txt
programs/ssl/CMakeLists.txt
+2
-0
query_config.c
programs/ssl/query_config.c
+2515
-0
ssl_client2.c
programs/ssl/ssl_client2.c
+10
-0
ssl_server2.c
programs/ssl/ssl_server2.c
+16
-2
CMakeLists.txt
programs/test/CMakeLists.txt
+5
-1
query_compile_time_config.c
programs/test/query_compile_time_config.c
+56
-0
cert_req.c
programs/x509/cert_req.c
+30
-2
bump_version.sh
scripts/bump_version.sh
+3
-0
config.pl
scripts/config.pl
+2
-0
query_config.fmt
scripts/data_files/query_config.fmt
+139
-0
vs2010-app-template.vcxproj
scripts/data_files/vs2010-app-template.vcxproj
+1
-2
generate_query_config.pl
scripts/generate_query_config.pl
+75
-0
generate_visualc_files.pl
scripts/generate_visualc_files.pl
+7
-1
compat.sh
tests/compat.sh
+2
-1
Makefile
tests/data_files/Makefile
+31
-1
server1-ms.req.sha256
tests/data_files/server1-ms.req.sha256
+16
-0
server1.cert_type.crt
tests/data_files/server1.cert_type.crt
+6
-6
server1.cert_type_noauthid.crt
tests/data_files/server1.cert_type_noauthid.crt
+7
-7
server1.key_usage.crt
tests/data_files/server1.key_usage.crt
+7
-7
server1.key_usage_noauthid.crt
tests/data_files/server1.key_usage_noauthid.crt
+7
-7
server1.req.cert_type
tests/data_files/server1.req.cert_type
+7
-7
server1.req.cert_type_empty
tests/data_files/server1.req.cert_type_empty
+17
-0
server1.req.key_usage
tests/data_files/server1.req.key_usage
+7
-7
server1.req.key_usage_empty
tests/data_files/server1.req.key_usage_empty
+17
-0
server1.req.ku-ct
tests/data_files/server1.req.ku-ct
+7
-7
server5.req.ku.sha1
tests/data_files/server5.req.ku.sha1
+3
-3
all.sh
tests/scripts/all.sh
+859
-657
basic-build-test.sh
tests/scripts/basic-build-test.sh
+1
-1
check-generated-files.sh
tests/scripts/check-generated-files.sh
+1
-0
generate_test_code.py
tests/scripts/generate_test_code.py
+21
-4
mbedtls_test.py
tests/scripts/mbedtls_test.py
+8
-6
test_zeroize.gdb
tests/scripts/test_zeroize.gdb
+0
-2
ssl-opt.sh
tests/ssl-opt.sh
+43
-33
test_suite_ecp.function
tests/suites/test_suite_ecp.function
+2
-0
test_suite_rsa.data
tests/suites/test_suite_rsa.data
+1
-0
test_suite_timing.data
tests/suites/test_suite_timing.data
+12
-36
test_suite_timing.function
tests/suites/test_suite_timing.function
+31
-360
test_suite_version.data
tests/suites/test_suite_version.data
+2
-2
test_suite_x509parse.data
tests/suites/test_suite_x509parse.data
+4
-0
test_suite_x509write.data
tests/suites/test_suite_x509write.data
+27
-19
test_suite_x509write.function
tests/suites/test_suite_x509write.function
+8
-6
mbedTLS.sln
visualc/VS2010/mbedTLS.sln
+13
-0
query_compile_time_config.vcxproj
visualc/VS2010/query_compile_time_config.vcxproj
+175
-0
ssl_client2.vcxproj
visualc/VS2010/ssl_client2.vcxproj
+1
-0
ssl_server2.vcxproj
visualc/VS2010/ssl_server2.vcxproj
+1
-0
No files found.
ChangeLog
View file @
0bd101e9
mbed TLS ChangeLog (Sorted per branch, date)
= mbed TLS 2.x.x branch released xxxx-xx-xx
= mbed TLS 2.16.1 branch released 2019-03-19
Features
* Add MBEDTLS_REMOVE_3DES_CIPHERSUITES to allow removing 3DES ciphersuites
from the default list (enabled by default). See
https://sweet32.info/SWEET32_CCS16.pdf.
Bugfix
* Fix a compilation issue with mbedtls_ecp_restart_ctx not being defined
...
...
@@ -15,6 +20,43 @@ Bugfix
Features
* Add support for DTLS-SRTP as defined in RFC 5764. Based on #361 contributed
by Johan Pascal.
* Fix clobber list in MIPS assembly for large integer multiplication.
Previously, this could lead to functionally incorrect assembly being
produced by some optimizing compilers, showing up as failures in
e.g. RSA or ECC signature operations. Reported in #1722, fix suggested
by Aurelien Jarno and submitted by Jeffrey Martin.
* Fix signed-to-unsigned integer conversion warning
in X.509 module. Fixes #2212.
* Reduce stack usage of `mpi_write_hlp()` by eliminating recursion.
Fixes #2190.
* Remove a duplicate #include in a sample program. Fixed by Masashi Honma #2326.
* Remove the mbedtls namespacing from the header file, to fix a "file not found"
build error. Fixed by Haijun Gu #2319.
* Fix returning the value 1 when mbedtls_ecdsa_genkey failed.
* Fix false failure in all.sh when backup files exist in include/mbedtls
(e.g. config.h.bak). Fixed by Peter Kolbus (Garmin) #2407.
* Ensure that unused bits are zero when writing ASN.1 bitstrings when using
mbedtls_asn1_write_bitstring().
* Fix issue when writing the named bitstrings in KeyUsage and NsCertType
extensions in CSRs and CRTs that caused these bitstrings to not be encoded
correctly as trailing zeroes were not accounted for as unused bits in the
leading content octet. Fixes #1610.
Changes
* Include configuration file in all header files that use configuration,
instead of relying on other header files that they include.
Inserted as an enhancement for #1371
* Add support for alternative CSR headers, as used by Microsoft and defined
in RFC 7468. Found by Michael Ernst. Fixes #767.
* Fix configuration queries in ssl-opt.h. #2030
* Ensure that ssl-opt.h can be run in OS X. #2029
* Reduce the complexity of the timing tests. They were assuming more than the
underlying OS actually guarantees.
* Re-enable certain interoperability tests in ssl-opt.sh which had previously
been disabled for lack of a sufficiently recent version of GnuTLS on the CI.
* Ciphersuites based on 3DES now have the lowest priority by default when
they are enabled.
>>>>>>> mbedtls-2.16.1
= mbed TLS 2.16.0 branch released 2018-12-21
...
...
README.md
View file @
0bd101e9
README for Mbed TLS
===================
Important
---------
This version of mbedtls is an aggregation of LTS mbedtls version together with pr1813 (for SRTP-DTLS support), a pull request
maintained by Belledonne Communications SARL.
Configuration
-------------
...
...
doxygen/input/doc_mainpage.h
View file @
0bd101e9
...
...
@@ -24,7 +24,7 @@
*/
/**
* @mainpage mbed TLS v2.16.
0
source code documentation
* @mainpage mbed TLS v2.16.
1
source code documentation
*
* This documentation describes the internal structure of mbed TLS. It was
* automatically generated from specially formatted comment blocks in
...
...
doxygen/mbedtls.doxyfile
View file @
0bd101e9
...
...
@@ -28,7 +28,7 @@ DOXYFILE_ENCODING = UTF-8
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.
PROJECT_NAME = "mbed TLS v2.16.
0
"
PROJECT_NAME = "mbed TLS v2.16.
1
"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
...
...
include/mbedtls/aesni.h
View file @
0bd101e9
...
...
@@ -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
...
...
include/mbedtls/asn1write.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#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) \
...
...
include/mbedtls/base64.h
View file @
0bd101e9
...
...
@@ -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. */
...
...
include/mbedtls/bn_mul.h
View file @
0bd101e9
...
...
@@ -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)
...
...
@@ -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 */
...
...
include/mbedtls/ccm.h
View file @
0bd101e9
...
...
@@ -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. */
...
...
include/mbedtls/certs.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_CERTS_H
#define MBEDTLS_CERTS_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include <stddef.h>
#ifdef __cplusplus
...
...
include/mbedtls/cipher.h
View file @
0bd101e9
...
...
@@ -36,7 +36,7 @@
#endif
#include <stddef.h>
#include "
mbedtls/
platform_util.h"
#include "platform_util.h"
#if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C)
#define MBEDTLS_CIPHER_MODE_AEAD
...
...
include/mbedtls/cmac.h
View file @
0bd101e9
...
...
@@ -28,6 +28,12 @@
#ifndef MBEDTLS_CMAC_H
#define MBEDTLS_CMAC_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "cipher.h"
#ifdef __cplusplus
...
...
include/mbedtls/compat-1.3.h
View file @
0bd101e9
...
...
@@ -25,6 +25,12 @@
* This file is part of mbed TLS (https://tls.mbed.org)
*/
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#if ! defined(MBEDTLS_DEPRECATED_REMOVED)
#if defined(MBEDTLS_DEPRECATED_WARNING)
...
...
include/mbedtls/config.h
View file @
0bd101e9
...
...
@@ -686,6 +686,26 @@
*/
#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
/**
* \def MBEDTLS_REMOVE_3DES_CIPHERSUITES
*
* Remove 3DES ciphersuites by default in SSL / TLS.
* This flag removes the ciphersuites based on 3DES from the default list as
* returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible
* to enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including
* them explicitly.
*
* A man-in-the-browser attacker can recover authentication tokens sent through
* a TLS connection using a 3DES based cipher suite (see "On the Practical
* (In-)Security of 64-bit Block Ciphers" by Karthikeyan Bhargavan and Gaëtan
* Leurent, see https://sweet32.info/SWEET32_CCS16.pdf). If this attack falls
* in your threat model or you are unsure, then you should keep this option
* enabled to remove 3DES based cipher suites.
*
* Comment this macro to keep 3DES in the default ciphersuite list.
*/
#define MBEDTLS_REMOVE_3DES_CIPHERSUITES
/**
* \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
*
...
...
include/mbedtls/ctr_drbg.h
View file @
0bd101e9
...
...
@@ -36,6 +36,12 @@
#ifndef MBEDTLS_CTR_DRBG_H
#define MBEDTLS_CTR_DRBG_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "aes.h"
#if defined(MBEDTLS_THREADING_C)
...
...
include/mbedtls/ecdh.h
View file @
0bd101e9
...
...
@@ -34,6 +34,12 @@
#ifndef MBEDTLS_ECDH_H
#define MBEDTLS_ECDH_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "ecp.h"
/*
...
...
include/mbedtls/ecdsa.h
View file @
0bd101e9
...
...
@@ -32,6 +32,12 @@
#ifndef MBEDTLS_ECDSA_H
#define MBEDTLS_ECDSA_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "ecp.h"
#include "md.h"
...
...
include/mbedtls/ecjpake.h
View file @
0bd101e9
...
...
@@ -40,6 +40,11 @@
* The payloads are serialized in a way suitable for use in TLS, but could
* also be use outside TLS.
*/
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "ecp.h"
#include "md.h"
...
...
include/mbedtls/ecp.h
View file @
0bd101e9
...
...
@@ -36,6 +36,12 @@
#ifndef MBEDTLS_ECP_H
#define MBEDTLS_ECP_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "bignum.h"
/*
...
...
include/mbedtls/ecp_internal.h
View file @
0bd101e9
...
...
@@ -61,6 +61,12 @@
#ifndef MBEDTLS_ECP_INTERNAL_H
#define MBEDTLS_ECP_INTERNAL_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#if defined(MBEDTLS_ECP_INTERNAL_ALT)
/**
...
...
include/mbedtls/error.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_ERROR_H
#define MBEDTLS_ERROR_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include <stddef.h>
/**
...
...
include/mbedtls/gcm.h
View file @
0bd101e9
...
...
@@ -33,6 +33,12 @@
#ifndef MBEDTLS_GCM_H
#define MBEDTLS_GCM_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "cipher.h"
#include <stdint.h>
...
...
include/mbedtls/havege.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_HAVEGE_H
#define MBEDTLS_HAVEGE_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include <stddef.h>
#define MBEDTLS_HAVEGE_COLLECT_SIZE 1024
...
...
include/mbedtls/hkdf.h
View file @
0bd101e9
...
...
@@ -27,6 +27,12 @@
#ifndef MBEDTLS_HKDF_H
#define MBEDTLS_HKDF_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "md.h"
/**
...
...
include/mbedtls/hmac_drbg.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_HMAC_DRBG_H
#define MBEDTLS_HMAC_DRBG_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "md.h"
#if defined(MBEDTLS_THREADING_C)
...
...
include/mbedtls/net.h
View file @
0bd101e9
...
...
@@ -23,6 +23,11 @@
*
* This file is part of mbed TLS (https://tls.mbed.org)
*/
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
#include "net_sockets.h"
...
...
include/mbedtls/nist_kw.h
View file @
0bd101e9
...
...
@@ -37,6 +37,12 @@
#ifndef MBEDTLS_NIST_KW_H
#define MBEDTLS_NIST_KW_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "cipher.h"
#ifdef __cplusplus
...
...
include/mbedtls/padlock.h
View file @
0bd101e9
...
...
@@ -28,6 +28,12 @@
#ifndef MBEDTLS_PADLOCK_H
#define MBEDTLS_PADLOCK_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "aes.h"
#define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030
/**< Input data should be aligned. */
...
...
include/mbedtls/pem.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_PEM_H
#define MBEDTLS_PEM_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include <stddef.h>
/**
...
...
include/mbedtls/pkcs12.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_PKCS12_H
#define MBEDTLS_PKCS12_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "md.h"
#include "cipher.h"
#include "asn1.h"
...
...
include/mbedtls/pkcs5.h
View file @
0bd101e9
...
...
@@ -26,6 +26,12 @@
#ifndef MBEDTLS_PKCS5_H
#define MBEDTLS_PKCS5_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "asn1.h"
#include "md.h"
...
...
include/mbedtls/platform_util.h
View file @
0bd101e9
...
...
@@ -26,14 +26,14 @@
#define MBEDTLS_PLATFORM_UTIL_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "
mbedtls/
config.h"
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include <stddef.h>
#if defined(MBEDTLS_HAVE_TIME_DATE)
#include "
mbedtls/
platform_time.h"
#include "platform_time.h"
#include <time.h>
#endif
/* MBEDTLS_HAVE_TIME_DATE */
...
...
include/mbedtls/poly1305.h
View file @
0bd101e9
...
...
@@ -34,7 +34,7 @@
#define MBEDTLS_POLY1305_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "
mbedtls/
config.h"
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
...
...
include/mbedtls/ssl_cache.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_SSL_CACHE_H
#define MBEDTLS_SSL_CACHE_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "ssl.h"
#if defined(MBEDTLS_THREADING_C)
...
...
include/mbedtls/ssl_ciphersuites.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_SSL_CIPHERSUITES_H
#define MBEDTLS_SSL_CIPHERSUITES_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "pk.h"
#include "cipher.h"
#include "md.h"
...
...
include/mbedtls/ssl_cookie.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_SSL_COOKIE_H
#define MBEDTLS_SSL_COOKIE_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "ssl.h"
#if defined(MBEDTLS_THREADING_C)
...
...
include/mbedtls/ssl_internal.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_SSL_INTERNAL_H
#define MBEDTLS_SSL_INTERNAL_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "ssl.h"
#include "cipher.h"
...
...
include/mbedtls/ssl_ticket.h
View file @
0bd101e9
...
...
@@ -24,6 +24,12 @@
#ifndef MBEDTLS_SSL_TICKET_H
#define MBEDTLS_SSL_TICKET_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
/*
* This implementation of the session ticket callbacks includes key
* management, rotating the keys periodically in order to preserve forward
...
...
include/mbedtls/version.h
View file @
0bd101e9
...
...
@@ -40,16 +40,16 @@
*/
#define MBEDTLS_VERSION_MAJOR 2
#define MBEDTLS_VERSION_MINOR 16
#define MBEDTLS_VERSION_PATCH
0
#define MBEDTLS_VERSION_PATCH
1
/**
* The single version number has the following structure:
* MMNNPP00
* Major version | Minor version | Patch version
*/
#define MBEDTLS_VERSION_NUMBER 0x02100
0
00
#define MBEDTLS_VERSION_STRING "2.16.
0
"
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.16.
0
"
#define MBEDTLS_VERSION_NUMBER 0x02100
1
00
#define MBEDTLS_VERSION_STRING "2.16.
1
"
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.16.
1
"
#if defined(MBEDTLS_VERSION_C)
...
...
include/mbedtls/x509_csr.h
View file @
0bd101e9
...
...
@@ -205,6 +205,14 @@ void mbedtls_x509write_csr_set_md_alg( mbedtls_x509write_csr *ctx, mbedtls_md_ty
* \param key_usage key usage flags to set
*
* \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
*
* \note The <code>decipherOnly</code> flag from the Key Usage
* extension is represented by bit 8 (i.e.
* <code>0x8000</code>), which cannot typically be represented
* in an unsigned char. Therefore, the flag
* <code>decipherOnly</code> (i.e.
* #MBEDTLS_X509_KU_DECIPHER_ONLY) cannot be set using this
* function.
*/
int
mbedtls_x509write_csr_set_key_usage
(
mbedtls_x509write_csr
*
ctx
,
unsigned
char
key_usage
);
...
...
library/CMakeLists.txt
View file @
0bd101e9
...
...
@@ -98,6 +98,12 @@ if(CMAKE_COMPILER_IS_CLANG)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code"
)
endif
(
CMAKE_COMPILER_IS_CLANG
)
if
(
UNSAFE_BUILD
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-Wno-error"
)
set
(
CMAKE_C_FLAGS_ASAN
"
${
CMAKE_C_FLAGS_ASAN
}
-Wno-error"
)
set
(
CMAKE_C_FLAGS_ASANDBG
"
${
CMAKE_C_FLAGS_ASANDBG
}
-Wno-error"
)
endif
(
UNSAFE_BUILD
)
if
(
WIN32
)
set
(
libs
${
libs
}
ws2_32
)
endif
(
WIN32
)
...
...
@@ -159,15 +165,15 @@ endif(USE_STATIC_MBEDTLS_LIBRARY)
if
(
USE_SHARED_MBEDTLS_LIBRARY
)
add_library
(
mbedcrypto SHARED
${
src_crypto
}
)
set_target_properties
(
mbedcrypto PROPERTIES VERSION 2.16.
0
SOVERSION 3
)
set_target_properties
(
mbedcrypto PROPERTIES VERSION 2.16.
1
SOVERSION 3
)
target_link_libraries
(
mbedcrypto
${
libs
}
)
add_library
(
mbedx509 SHARED
${
src_x509
}
)
set_target_properties
(
mbedx509 PROPERTIES VERSION 2.16.
0
SOVERSION 0
)
set_target_properties
(
mbedx509 PROPERTIES VERSION 2.16.
1
SOVERSION 0
)
target_link_libraries
(
mbedx509
${
libs
}
mbedcrypto
)
add_library
(
mbedtls SHARED
${
src_tls
}
)
set_target_properties
(
mbedtls PROPERTIES VERSION 2.16.
0
SOVERSION 12
)
set_target_properties
(
mbedtls PROPERTIES VERSION 2.16.
1
SOVERSION 12
)
target_link_libraries
(
mbedtls
${
libs
}
mbedx509
)
install
(
TARGETS mbedtls mbedx509 mbedcrypto
...
...
library/asn1write.c
View file @
0bd101e9
...
...
@@ -294,22 +294,28 @@ int mbedtls_asn1_write_bitstring( unsigned char **p, unsigned char *start,
const
unsigned
char
*
buf
,
size_t
bits
)
{
int
ret
;
size_t
len
=
0
,
size
;
size_t
len
=
0
;
size_t
unused_bits
,
byte_len
;
size
=
(
bits
/
8
)
+
(
(
bits
%
8
)
?
1
:
0
);
byte_len
=
(
bits
+
7
)
/
8
;
unused_bits
=
(
byte_len
*
8
)
-
bits
;
// Calculate byte length
//
if
(
*
p
<
start
||
(
size_t
)(
*
p
-
start
)
<
size
+
1
)
if
(
*
p
<
start
||
(
size_t
)(
*
p
-
start
)
<
byte_len
+
1
)
return
(
MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
);
len
=
size
+
1
;
(
*
p
)
-=
size
;
memcpy
(
*
p
,
buf
,
size
);
len
=
byte_len
+
1
;
// Write unused bits
//
*--
(
*
p
)
=
(
unsigned
char
)
(
size
*
8
-
bits
);
/* Write the bitstring. Ensure the unused bits are zeroed */
if
(
byte_len
>
0
)
{
byte_len
--
;
*--
(
*
p
)
=
buf
[
byte_len
]
&
~
(
(
0x1
<<
unused_bits
)
-
1
);
(
*
p
)
-=
byte_len
;
memcpy
(
*
p
,
buf
,
byte_len
);
}
/* Write unused bits */
*--
(
*
p
)
=
(
unsigned
char
)
unused_bits
;
MBEDTLS_ASN1_CHK_ADD
(
len
,
mbedtls_asn1_write_len
(
p
,
start
,
len
)
);
MBEDTLS_ASN1_CHK_ADD
(
len
,
mbedtls_asn1_write_tag
(
p
,
start
,
MBEDTLS_ASN1_BIT_STRING
)
);
...
...
library/bignum.c
View file @
0bd101e9
...
...
@@ -527,26 +527,38 @@ cleanup:
}
/*
* Helper to write the digits high-order first
* Helper to write the digits high-order first
.
*/
static
int
mpi_write_hlp
(
mbedtls_mpi
*
X
,
int
radix
,
char
**
p
)
static
int
mpi_write_hlp
(
mbedtls_mpi
*
X
,
int
radix
,
char
**
p
,
const
size_t
buflen
)
{
int
ret
;
mbedtls_mpi_uint
r
;
size_t
length
=
0
;
char
*
p_end
=
*
p
+
buflen
;
if
(
radix
<
2
||
radix
>
16
)
return
(
MBEDTLS_ERR_MPI_BAD_INPUT_DATA
);
do
{
if
(
length
>=
buflen
)
{
return
(
MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
);
}
MBEDTLS_MPI_CHK
(
mbedtls_mpi_mod_int
(
&
r
,
X
,
radix
)
);
MBEDTLS_MPI_CHK
(
mbedtls_mpi_div_int
(
X
,
NULL
,
X
,
radix
)
);
MBEDTLS_MPI_CHK
(
mbedtls_mpi_mod_int
(
&
r
,
X
,
radix
)
);
MBEDTLS_MPI_CHK
(
mbedtls_mpi_div_int
(
X
,
NULL
,
X
,
radix
)
);
/*
* Write the residue in the current position, as an ASCII character.
*/
if
(
r
<
0xA
)
*
(
--
p_end
)
=
(
char
)(
'0'
+
r
);
else
*
(
--
p_end
)
=
(
char
)(
'A'
+
(
r
-
0xA
)
);
if
(
mbedtls_mpi_cmp_int
(
X
,
0
)
!=
0
)
MBEDTLS_MPI_CHK
(
mpi_write_hlp
(
X
,
radix
,
p
)
);
length
++
;
}
while
(
mbedtls_mpi_cmp_int
(
X
,
0
)
!=
0
);
if
(
r
<
10
)
*
(
*
p
)
++
=
(
char
)(
r
+
0x30
);
else