26 |
#include <openssl/bn.h> |
#include <openssl/bn.h> |
27 |
#include <openssl/x509v3.h> |
#include <openssl/x509v3.h> |
28 |
|
|
29 |
|
#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090800f) |
30 |
|
#define D2I_X509_CONST const |
31 |
|
#else |
32 |
|
#define D2I_X509_CONST |
33 |
|
#endif |
34 |
|
|
35 |
extern char g_hostname[16]; |
extern char g_hostname[16]; |
36 |
extern int g_width; |
extern int g_width; |
37 |
extern int g_height; |
extern int g_height; |
656 |
|
|
657 |
in_uint32_le(s, ignorelen); |
in_uint32_le(s, ignorelen); |
658 |
DEBUG_RDP5(("Ignored Certificate length is %d\n", ignorelen)); |
DEBUG_RDP5(("Ignored Certificate length is %d\n", ignorelen)); |
659 |
ignorecert = d2i_X509(NULL, &(s->p), ignorelen); |
ignorecert = |
660 |
|
d2i_X509(NULL, (D2I_X509_CONST unsigned char **) &(s->p), |
661 |
|
ignorelen); |
662 |
|
|
663 |
if (ignorecert == NULL) |
if (ignorecert == NULL) |
664 |
{ /* XXX: error out? */ |
{ /* XXX: error out? */ |
682 |
|
|
683 |
in_uint32_le(s, cacert_len); |
in_uint32_le(s, cacert_len); |
684 |
DEBUG_RDP5(("CA Certificate length is %d\n", cacert_len)); |
DEBUG_RDP5(("CA Certificate length is %d\n", cacert_len)); |
685 |
cacert = d2i_X509(NULL, &(s->p), cacert_len); |
cacert = d2i_X509(NULL, (D2I_X509_CONST unsigned char **) &(s->p), cacert_len); |
686 |
/* Note: We don't need to move s->p here - d2i_X509 is |
/* Note: We don't need to move s->p here - d2i_X509 is |
687 |
"kind" enough to do it for us */ |
"kind" enough to do it for us */ |
688 |
if (NULL == cacert) |
if (NULL == cacert) |
705 |
|
|
706 |
in_uint32_le(s, cert_len); |
in_uint32_le(s, cert_len); |
707 |
DEBUG_RDP5(("Certificate length is %d\n", cert_len)); |
DEBUG_RDP5(("Certificate length is %d\n", cert_len)); |
708 |
server_cert = d2i_X509(NULL, &(s->p), cert_len); |
server_cert = d2i_X509(NULL, (D2I_X509_CONST unsigned char **) &(s->p), cert_len); |
709 |
if (NULL == server_cert) |
if (NULL == server_cert) |
710 |
{ |
{ |
711 |
error("Couldn't load Certificate from server\n"); |
error("Couldn't load Certificate from server\n"); |