140 |
{ |
{ |
141 |
EVP_PKEY *epk = NULL; |
EVP_PKEY *epk = NULL; |
142 |
SSL_RKEY *lkey; |
SSL_RKEY *lkey; |
143 |
|
int nid; |
144 |
|
|
145 |
/* By some reason, Microsoft sets the OID of the Public RSA key to |
/* By some reason, Microsoft sets the OID of the Public RSA key to |
146 |
the oid for "MD5 with RSA Encryption" instead of "RSA Encryption" |
the oid for "MD5 with RSA Encryption" instead of "RSA Encryption" |
147 |
|
|
148 |
Kudos to Richard Levitte for the following (. intiutive .) |
Kudos to Richard Levitte for the following (. intiutive .) |
149 |
lines of code that resets the OID and let's us extract the key. */ |
lines of code that resets the OID and let's us extract the key. */ |
150 |
if (OBJ_obj2nid(cert->cert_info->key->algor->algorithm) == NID_md5WithRSAEncryption) |
nid = OBJ_obj2nid(cert->cert_info->key->algor->algorithm); |
151 |
|
if ((nid == NID_md5WithRSAEncryption) || (nid == NID_shaWithRSAEncryption)) |
152 |
{ |
{ |
153 |
DEBUG_RDP5(("Re-setting algorithm type to RSA in server certificate\n")); |
DEBUG_RDP5(("Re-setting algorithm type to RSA in server certificate\n")); |
154 |
ASN1_OBJECT_free(cert->cert_info->key->algor->algorithm); |
ASN1_OBJECT_free(cert->cert_info->key->algor->algorithm); |