Commit 5ee34ea8 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

secur32: Implement QueryContextAttributes for SECPKG_ATTR_REMOTE_CERT_CONTEXT.

parent 3a493d77
......@@ -48,6 +48,7 @@ MAKE_FUNCPTR(gnutls_alert_get);
MAKE_FUNCPTR(gnutls_alert_get_name);
MAKE_FUNCPTR(gnutls_certificate_allocate_credentials);
MAKE_FUNCPTR(gnutls_certificate_free_credentials);
MAKE_FUNCPTR(gnutls_certificate_get_peers);
MAKE_FUNCPTR(gnutls_cipher_get);
MAKE_FUNCPTR(gnutls_credentials_set);
MAKE_FUNCPTR(gnutls_deinit);
......@@ -873,6 +874,27 @@ static SECURITY_STATUS SEC_ENTRY schan_QueryContextAttributesW(
stream_sizes->cbBlockSize = block_size;
return SEC_E_OK;
}
case SECPKG_ATTR_REMOTE_CERT_CONTEXT:
{
unsigned int list_size;
const gnutls_datum_t *datum = pgnutls_certificate_get_peers(
ctx->session, &list_size);
datum = pgnutls_certificate_get_peers(ctx->session, &list_size);
if (datum)
{
PCCERT_CONTEXT *cert = buffer;
*cert = CertCreateCertificateContext(X509_ASN_ENCODING,
datum->data, datum->size);
if (!*cert)
return GetLastError();
else
return SEC_E_OK;
}
else
return SEC_E_INTERNAL_ERROR;
}
default:
FIXME("Unhandled attribute %#x\n", attribute);
......@@ -890,6 +912,8 @@ static SECURITY_STATUS SEC_ENTRY schan_QueryContextAttributesA(
{
case SECPKG_ATTR_STREAM_SIZES:
return schan_QueryContextAttributesW(context_handle, attribute, buffer);
case SECPKG_ATTR_REMOTE_CERT_CONTEXT:
return schan_QueryContextAttributesW(context_handle, attribute, buffer);
default:
FIXME("Unhandled attribute %#x\n", attribute);
......@@ -1222,6 +1246,7 @@ void SECUR32_initSchannelSP(void)
LOAD_FUNCPTR(gnutls_alert_get_name)
LOAD_FUNCPTR(gnutls_certificate_allocate_credentials)
LOAD_FUNCPTR(gnutls_certificate_free_credentials)
LOAD_FUNCPTR(gnutls_certificate_get_peers)
LOAD_FUNCPTR(gnutls_cipher_get)
LOAD_FUNCPTR(gnutls_credentials_set)
LOAD_FUNCPTR(gnutls_deinit)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment