Commit graph

16 commits

Author SHA1 Message Date
Ivan Grokhotkov
cb649e452f remove executable permission from source files 2018-05-29 20:07:45 +08:00
Andy Green
ae1f1e9b84 openssl wrapper: introduce X509_VERIFY_PARAM_set/clear_hostflags
This defines the OpenSSL X509_CHECK_FLAG_...s and the set/clear
accessors.  Since none of them are supported, the set / clear
accessor currently always does nothing and returns error.

This call is often part of the generic openssl user code to
set up certificate verification.  This patch allows it to
compile for ESP32 and decide at runtime what to do about
unsupported flags.

Merges https://github.com/espressif/esp-idf/pull/980
2017-11-20 16:25:57 +11:00
Andy Green
effc6c6d0d openssl wrapper: introduce X509_VERIFY_PARAM_set1_host
This lets the user code set the mbedtls hostname using the standard OpenSSL
X509_VERIFY_PARAM_set1_host() API semantics.

The API takes an X509_VERIFY_PARAM pointer.  We use the fact that is
a composed member of the SSL struct to derive the SSL pointer.

The X509_VERIFY_PARAM_set1_host() is unusual in that it can accept a
NUL terminated C string as usual, or a nonterminated pointer + length.
This implementation converts the latter to the former if given, before
using it.

This is enough for user code to get the openssl wrapper to make
mbedtls confirm the CN on the peer cert belongs to the hostname used
to reach it, by doing, eg

	X509_VERIFY_PARAM_set1_host(SSL_get0_param(myssl), myhostname, 0);

Merges https://github.com/espressif/esp-idf/pull/980
2017-11-20 16:24:06 +11:00
Andy Green
0f02a38262 openssl wrapper: introduce SSL_get0_param
This adds the standard OpenSSL api to get a pointer to the SSL struct's
X509_VERIFY_PARAM.  We need this for the OpenSSL api to set the peer
hostname introduced in the next patch.

Part of https://github.com/espressif/esp-idf/pull/980
2017-11-20 16:23:18 +11:00
Kedar Sovani
b65f47c586 [openssl] Add support for SNI (sending the hostname) 2017-10-31 16:57:38 +05:30
Dong Heng
8c7dfef317 examples/10_openssl_server: fixup SSL server with method of specific version
1. add method of any version supporting at OpenSSL and add API in header file
2. change OpenSSL server context method to be method of any version

Fixes http://esp32.com/viewtopic.php?f=14&t=696.
2017-01-05 15:57:25 +08:00
Dong Heng
ecefb1305a components/openssl: change header file relationship of level 2016-10-10 10:40:00 +08:00
Dong Heng
2033068a72 components/openssl: add internal openssl X509 debug function 2016-10-09 16:42:49 +08:00
Dong Heng
877adaab7a components/openssl: add some function description 2016-09-27 18:50:57 +08:00
dongheng
83aea6c833 components/openssl: add extern C symbol 2016-09-23 15:18:14 +08:00
dongheng
59bb9a9a01 components/openssl: [TW7411] supply doxygen type note 2016-09-23 14:50:27 +08:00
dongheng
2faa2376a0 components/openssl: add empty function to load verify file into SSL context
1. add empty function to load private key into SSL context
        2. add empty function to load certification into SSL context
	3. add function to load RSA private key
2016-09-22 15:39:28 +08:00
dongheng
2cc32db52d component/openssl: add openssl stack function and clear unused variate
1. add openssl 'new' and 'free' function
	2. add clear unused variate to void warning to appear when compile
        3. add internal function 'X509_new' to take the place of 'sk_X509_NAME_new_null' function whitch is openssl stack function
2016-09-22 14:42:49 +08:00
dongheng
6bd3d62d7c components/openssl: add license header 2016-09-22 10:28:08 +08:00
dongheng
44c466c0ea components/openssl: add base function version 2016-09-20 16:58:46 +08:00
dongheng
db2da43fc1 components/openssl: add API header for openssl compatibility layer 2016-09-14 19:39:24 +08:00