ssl.c revision 6e9aa255e3376b2da5824c09c4c62bc233463bfe
/* -*- c-basic-offset: 8 -*-
rdesktop: A Remote Desktop Protocol client.
Secure sockets abstraction layer
Copyright (C) Matthew Chapman <matthewc.unsw.edu.au> 1999-2008
Copyright (C) Jay Sorg <j@american-data.com> 2006-2008
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Oracle GPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the General Public License version 2 (GPLv2) at this time for any software where
* a choice of GPL license versions is made available with the language indicating
* that GPLv2 or any later version may be used, or where a choice of which version
* of the GPL is applied is otherwise unspecified.
*/
#include "rdesktop.h"
#include "ssl.h"
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
static void
{
int i, j;
for (i = 0, j = len - 1; i < j; i++, j--)
{
temp = p[i];
p[i] = p[j];
p[j] = temp;
}
}
void
{
int outlen;
ctx = BN_CTX_new();
BN_init(&x);
BN_init(&y);
if (outlen < (int) modulus_size)
BN_free(&y);
BN_clear_free(&x);
}
/* returns newly allocated RDSSL_CERT or NULL */
{
/* this will move the data pointer but we don't care, we don't use it again */
}
void
{
}
/* returns newly allocated RDSSL_RKEY or NULL */
{
int nid;
/* By some reason, Microsoft sets the OID of the Public RSA key to
the oid for "MD5 with RSA Encryption" instead of "RSA Encryption"
Kudos to Richard Levitte for the following (. intiutive .)
lines of code that resets the OID and let's us extract the key. */
{
DEBUG_RDP5(("Re-setting algorithm type to RSA in server certificate\n"));
}
{
error("Failed to extract public key from certificate\n");
return NULL;
}
return lkey;
}
/* returns boolean */
{
/* Currently, we don't use the CA Certificate.
FIXME:
*) Verify the server certificate (server_cert) with the
CA certificate.
*) Store the CA Certificate with the hostname of the
server we are connecting to as key, and compare it
when we connect the next time, in order to prevent
MITM-attacks.
*/
return True;
}
int
{
}
void
{
}
/* returns error */
int
{
int len;
{
return 1;
}
return 0;
}
/* returns boolean */
{
/* Currently, we don't check the signature
FIXME:
*/
return True;
}
void
unsigned char *md)
{
HMAC_CTX_init(&ctx);
}