From cf9cd32df385f545d5c4933140135bd8f56dd212 Mon Sep 17 00:00:00 2001 From: Max Qian Date: Wed, 6 Jul 2016 16:06:53 +0200 Subject: [PATCH] secur32: Added support for a few more algids. Signed-off-by: Max Qian Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/secur32/schannel_gnutls.c | 23 ++++++++++++++++------- dlls/secur32/schannel_macosx.c | 4 ++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/dlls/secur32/schannel_gnutls.c b/dlls/secur32/schannel_gnutls.c index bcadd47e7aa..7f2dbd6bec4 100644 --- a/dlls/secur32/schannel_gnutls.c +++ b/dlls/secur32/schannel_gnutls.c @@ -315,11 +315,12 @@ static ALG_ID schannel_get_mac_algid(gnutls_mac_algorithm_t mac) { case GNUTLS_MAC_UNKNOWN: case GNUTLS_MAC_NULL: return 0; + case GNUTLS_MAC_MD2: return CALG_MD2; case GNUTLS_MAC_MD5: return CALG_MD5; - case GNUTLS_MAC_SHA1: - case GNUTLS_MAC_SHA256: - case GNUTLS_MAC_SHA384: - case GNUTLS_MAC_SHA512: return CALG_SHA; + case GNUTLS_MAC_SHA1: return CALG_SHA1; + case GNUTLS_MAC_SHA256: return CALG_SHA_256; + case GNUTLS_MAC_SHA384: return CALG_SHA_384; + case GNUTLS_MAC_SHA512: return CALG_SHA_512; default: FIXME("unknown algorithm %d\n", mac); return 0; @@ -330,9 +331,17 @@ static ALG_ID schannel_get_kx_algid(gnutls_kx_algorithm_t kx) { switch (kx) { - case GNUTLS_KX_RSA: return CALG_RSA_KEYX; - case GNUTLS_KX_DHE_DSS: - case GNUTLS_KX_DHE_RSA: return CALG_DH_EPHEM; + case GNUTLS_KX_UNKNOWN: return 0; + case GNUTLS_KX_RSA: + case GNUTLS_KX_RSA_EXPORT: return CALG_RSA_KEYX; + case GNUTLS_KX_DHE_PSK: + case GNUTLS_KX_DHE_DSS: + case GNUTLS_KX_DHE_RSA: return CALG_DH_EPHEM; + case GNUTLS_KX_ANON_ECDH: return CALG_ECDH; + /* MSDN mentions CALG_ECDH_EPHEM, but doesn't appear in the Windows SDK. */ + case GNUTLS_KX_ECDHE_RSA: + case GNUTLS_KX_ECDHE_PSK: return CALG_ECDH; + case GNUTLS_KX_ECDHE_ECDSA: return CALG_ECDSA; default: FIXME("unknown algorithm %d\n", kx); return 0; diff --git a/dlls/secur32/schannel_macosx.c b/dlls/secur32/schannel_macosx.c index b940881d9bf..fdfa48e36d9 100644 --- a/dlls/secur32/schannel_macosx.c +++ b/dlls/secur32/schannel_macosx.c @@ -500,7 +500,8 @@ static ALG_ID schan_get_kx_algid(const struct cipher_suite* c) case schan_kx_ECDHE_ECDSA: case schan_kx_ECDHE_RSA: return CALG_ECDH; case schan_kx_NULL: return 0; - case schan_kx_RSA: return CALG_RSA_KEYX; + case schan_kx_RSA: + case schan_kx_RSA_EXPORT: return CALG_RSA_KEYX; case schan_kx_DH_anon_EXPORT: case schan_kx_DH_anon: @@ -509,7 +510,6 @@ static ALG_ID schan_get_kx_algid(const struct cipher_suite* c) case schan_kx_DH_RSA_EXPORT: case schan_kx_DH_RSA: case schan_kx_FORTEZZA_DMS: - case schan_kx_RSA_EXPORT: FIXME("Don't know CALG for key exchange algorithm %d for cipher suite %#x, returning 0\n", c->kx_alg, (unsigned)c->suite); return 0;