533 |
if (OBJ_obj2nid(cert->cert_info->key->algor->algorithm) == NID_md5WithRSAEncryption) |
if (OBJ_obj2nid(cert->cert_info->key->algor->algorithm) == NID_md5WithRSAEncryption) |
534 |
{ |
{ |
535 |
DEBUG_RDP5(("Re-setting algorithm type to RSA in server certificate\n")); |
DEBUG_RDP5(("Re-setting algorithm type to RSA in server certificate\n")); |
536 |
|
ASN1_OBJECT_free(cert->cert_info->key->algor->algorithm); |
537 |
cert->cert_info->key->algor->algorithm = OBJ_nid2obj(NID_rsaEncryption); |
cert->cert_info->key->algor->algorithm = OBJ_nid2obj(NID_rsaEncryption); |
538 |
} |
} |
539 |
epk = X509_get_pubkey(cert); |
epk = X509_get_pubkey(cert); |
543 |
return False; |
return False; |
544 |
} |
} |
545 |
|
|
546 |
server_public_key = (RSA *) epk->pkey.ptr; |
server_public_key = RSAPublicKey_dup((RSA *) epk->pkey.ptr); |
547 |
|
|
548 |
|
EVP_PKEY_free(epk); |
549 |
|
|
550 |
return True; |
return True; |
551 |
} |
} |
683 |
MITM-attacks. |
MITM-attacks. |
684 |
*/ |
*/ |
685 |
|
|
686 |
|
X509_free(cacert); |
687 |
|
|
688 |
in_uint32_le(s, cert_len); |
in_uint32_le(s, cert_len); |
689 |
DEBUG_RDP5(("Certificate length is %d\n", cert_len)); |
DEBUG_RDP5(("Certificate length is %d\n", cert_len)); |
690 |
server_cert = d2i_X509(NULL, &(s->p), cert_len); |
server_cert = d2i_X509(NULL, &(s->p), cert_len); |
703 |
if (!sec_parse_x509_key(server_cert)) |
if (!sec_parse_x509_key(server_cert)) |
704 |
{ |
{ |
705 |
DEBUG_RDP5(("Didn't parse X509 correctly\n")); |
DEBUG_RDP5(("Didn't parse X509 correctly\n")); |
706 |
|
X509_free(server_cert); |
707 |
return False; |
return False; |
708 |
} |
} |
709 |
|
X509_free(server_cert); |
710 |
return True; /* There's some garbage here we don't care about */ |
return True; /* There's some garbage here we don't care about */ |
711 |
} |
} |
712 |
return s_check_end(s); |
return s_check_end(s); |
752 |
|
|
753 |
reverse(sec_crypted_random, SEC_MODULUS_SIZE); |
reverse(sec_crypted_random, SEC_MODULUS_SIZE); |
754 |
|
|
755 |
|
RSA_free(server_public_key); |
756 |
|
server_public_key = NULL; |
757 |
} |
} |
758 |
else |
else |
759 |
{ /* RDP4-style encryption */ |
{ /* RDP4-style encryption */ |