1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Backport of:

ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
Bug#13174: SHA2 function
Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle

Implement SHA2 functions.

Chad added code to make it work with YaSSL.  Also, he removed the 
(probable) bug of embedded server never using SSL-dependent 
functions.  (libmysqld/Makefile.am didn't read ANY autoconf defs.)

Function specification:
  SHA2( string cleartext, integer hash_length ) 
    -> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512.  If either is 
NULL or a length is unsupported, then the result is NULL.  The 
resulting string is always the length of the hash_length parameter
or is NULL.

Include the canonical hash examples from the NIST in the test
results.
---
Polish and address concerns of reviewers.
This commit is contained in:
Konstantin Osipov
2010-04-13 19:04:45 +04:00
parent 04b601a7fe
commit 53fecff1ef
40 changed files with 2315 additions and 83 deletions

View File

@@ -929,7 +929,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
if (acl_user)
{
/* OK. User found and password checked continue validation */
#ifdef HAVE_OPENSSL
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
Vio *vio=thd->net.vio;
SSL *ssl= (SSL*) vio->ssl_arg;
X509 *cert;
@@ -946,7 +946,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
case SSL_TYPE_NONE: // SSL is not required
user_access= acl_user->access;
break;
#ifdef HAVE_OPENSSL
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
case SSL_TYPE_ANY: // Any kind of SSL is ok
if (vio_type(vio) == VIO_TYPE_SSL)
user_access= acl_user->access;