ssl.c revision 4b9d6701570cb98fd36e209314239d104ec584d3
/* -*- c-basic-offset: 8 -*-
rdesktop: A Remote Desktop Protocol client.
Secure sockets abstraction layer
Copyright (C) Matthew Chapman 1999-2007
Copyright (C) Jay Sorg 2006-2007
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* 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 SSL_CERT or NULL */
SSL_CERT *
{
/* this will move the data pointer but we don't care, we don't use it again */
}
void
{
}
/* returns newly allocated SSL_RKEY or NULL */
SSL_RKEY *
{
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;
}