1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-09-11 08:30:59 +03:00
Commit Graph

23 Commits

Author SHA1 Message Date
Sergei Golubchik
f6e99af056 Revert "self-signed certificate verification", it's 3.4 feature
This reverts 395641549ac7..536d9e2b9e5b, in particular:

8dffd56936 MDEV-31857 enable MYSQL_OPT_SSL_VERIFY_SERVER_CERT by default
a99570c118 MDEV-31855 SSL cert validation protocol extension
9aa15e72a7 TLS fingerprint

and related commits
2024-02-19 11:16:26 +01:00
Georg Richter
9aa15e72a7 TLS fingerprint
Beside SHA1 fingerprint hash, Connector/C now also supports
SHA224 (OpenSSL and GnuTLS only), SHA256, SHA384 and SHA512
fingerprint hashes.
2024-02-04 22:17:22 +01:00
Vladislav Vaintroub
63df45ce3d CONC-447 ERROR 2026 (HY000): SSL connection error: Certificate signature check failed
Implement proper verification for server certificate chain,
with refactoring of the certificate stuff.

If custom CA and CRL certs are given, load them into in-memory store, and
use CertVerifyCertificateChainPolicy() to verify the certificate chain.

There are minor errors fixed, such as
- now there is a support for private keys encoded as BEGIN/END PRIVATE KEY
in PEM, instead of only BEGIN/END RSA PRIVATE KEY
- memory leak around CryptAcquireContext() is fixed i.e when client loads
private key, it previously did never released it, not even when connection
ended.

The handling of certificates moved into schannel_certs.c from various places
2019-12-08 18:07:48 +01:00
Sergei Golubchik
ab4d09dd8d fix compilation falire on windows 2019-06-05 18:21:55 +02:00
Georg Richter
b0411b731f CONC-386:
Added support for pem files which contain certificate and private key.
In case the file will contain more than one certificate or key, the first
certificate or key found will be used.
2019-06-02 13:39:27 +02:00
Georg Richter
abee401956 Use lowercase names for windows include files 2018-12-01 10:59:50 +01:00
Vladislav Vaintroub
db1a1a1d31 more clang fixes 2018-02-12 09:29:27 +00:00
Georg Richter
02f57a9c14 Fix for CONC-276: client library crashes on Windows after TLS reconnect:
The connection pointer mysql is now no longer part (and doesn't need to be updated) of schannel security context, since it can be obtained directly from tls container.
2017-08-24 18:09:50 +02:00
Georg Richter
967b2830d8 renamed ma_errmsg.h back to errmsg.h 2016-11-16 18:13:59 +01:00
Vladislav Vaintroub
93af3ae693 Simplify and fix ma_schannel_read_decrypt() to cache state
between the calls.

State can be unread buffer  from DecryptMessage (SECBUFFER_EXTRA)
or decrypted data that did not fit into callers buffer

- Fix error handling - SEC_I_RENEGOTIATE is handled as error,
we're not doing it yet. Stop reading at SEC_I_CONTEXT_EXPIRED.

- Fix buffer sizes  pased to SSPI ( so that large buffers can be read or written
"SELECT REPEAT('a', 20000)"

- Fix unchecked memcpy into the output buffer (size of the output buffer
was not checked, so it is a potential memory overrun)
2016-10-14 17:49:30 +00:00
Vladislav Vaintroub
629ec64630 Fix PVIO to return number of bytes read/written as "signed" integer
since there is a lot of checks for return code being < 0 or -1.
2016-10-13 17:42:03 +00:00
Sergei Golubchik
f95877dc5f Merge branch 'master' into serg-integr 2016-09-15 09:21:30 +02:00
Vladislav Vaintroub
2157642849 Cleanup/fix schannel TLS implementation
- remove global variables
- remove in memory certificate stores that cache all CRL and all CA
- verify certificate against ssl_ca and ssl_crl  specified in
connection options (not against all CRL/CA in store)
2016-09-09 20:17:30 +00:00
Vladislav Vaintroub
38b5e400da C/C integration : Fix mysql_test_client test
- #include <stdlib.h> for strtod and other prototypes
- remove ma_config_win.h as it  redefines things from ma_config.h
- fix compile warnings
2016-09-07 17:14:02 +00:00
Georg Richter
4b1e94bccc Since we use TLS and not SSL functions and structures were renamed
from SSL to TLS
2016-03-16 18:20:08 +01:00
Georg Richter
85525c2ba7 Merge remote-tracking branch 'origin/3.1' 2016-02-16 17:40:03 +01:00
Georg Richter
509b948e7d SSL fixes:
- added MARIADB_OPT_SSL_CIPHER_STRENGTH (value uint) for Schannel
- fixed mutes in all ssl variants
2016-02-16 13:04:16 +01:00
Georg Richter
4ca933bb81 Global cleanup:
removed global locks
  removed dead code and files
  removed dbug
2016-02-08 18:43:02 +01:00
Georg Richter
c5ca735dd3 Renamed prefixes for 10.2 integration 2016-02-02 12:12:04 +01:00
Georg Richter
72f7c4abf5 Windows 64-bit fixes:
changed type of length parameter in mysql_stmt_prepare,
mysql_real_query, mysql_stmt_send_long_data (incl. async _start
functions) from unsigned long to size_t.
Fixed warnings
2015-11-05 11:52:50 +01:00
Georg Richter
7500f37150 - Renamed cio to pvio (pluggable virtual IO)
- minor fixes in windows schannel
2015-10-27 10:24:48 +01:00
Georg Richter
4597cd6a80 Various ssl and schannel fixes 2015-09-10 17:16:21 +02:00
Georg Richter
df8f6225f7 schannel is no longer plugin 2015-08-16 12:00:59 +02:00