/[rdesktop]/sourceforge.net/trunk/rdesktop/secure.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/secure.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 710 by jsorg71, Tue Jun 15 22:17:08 2004 UTC revision 828 by stargo, Sun Mar 6 21:11:18 2005 UTC
# Line 1  Line 1 
1  /* -*- c-basic-offset: 8 -*-  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     Protocol services - RDP encryption and licensing     Protocol services - RDP encryption and licensing
4     Copyright (C) Matthew Chapman 1999-2002     Copyright (C) Matthew Chapman 1999-2005
5    
6     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 20  Line 20 
20    
21  #include "rdesktop.h"  #include "rdesktop.h"
22    
 #ifdef WITH_OPENSSL  
23  #include <openssl/rc4.h>  #include <openssl/rc4.h>
24  #include <openssl/md5.h>  #include <openssl/md5.h>
25  #include <openssl/sha.h>  #include <openssl/sha.h>
26  #include <openssl/bn.h>  #include <openssl/bn.h>
27  #include <openssl/x509v3.h>  #include <openssl/x509v3.h>
 #else  
 #include "crypto/rc4.h"  
 #include "crypto/md5.h"  
 #include "crypto/sha.h"  
 #include "crypto/bn.h"  
 #endif  
28    
29  extern char g_hostname[16];  extern char g_hostname[16];
30  extern int g_width;  extern int g_width;
# Line 820  sec_process_mcs_data(STREAM s) Line 813  sec_process_mcs_data(STREAM s)
813    
814  /* Receive secure transport packet */  /* Receive secure transport packet */
815  STREAM  STREAM
816  sec_recv(void)  sec_recv(uint8 * rdpver)
817  {  {
818          uint32 sec_flags;          uint32 sec_flags;
819          uint16 channel;          uint16 channel;
820          STREAM s;          STREAM s;
821    
822          while ((s = mcs_recv(&channel)) != NULL)          while ((s = mcs_recv(&channel, rdpver)) != NULL)
823          {          {
824                    if (rdpver != NULL)
825                    {
826                            if (*rdpver != 3)
827                            {
828                                    if (*rdpver & 0x80)
829                                    {
830                                            in_uint8s(s, 8);        /* signature */
831                                            sec_decrypt(s->p, s->end - s->p);
832                                    }
833                                    return s;
834                            }
835                    }
836                  if (g_encryption || !g_licence_issued)                  if (g_encryption || !g_licence_issued)
837                  {                  {
838                          in_uint32_le(s, sec_flags);                          in_uint32_le(s, sec_flags);
# Line 848  sec_recv(void) Line 853  sec_recv(void)
853                  if (channel != MCS_GLOBAL_CHANNEL)                  if (channel != MCS_GLOBAL_CHANNEL)
854                  {                  {
855                          channel_process(s, channel);                          channel_process(s, channel);
856                          continue;                          *rdpver = 0xff;
857                            return s;
858                  }                  }
859    
860                  return s;                  return s;

Legend:
Removed from v.710  
changed lines
  Added in v.828

  ViewVC Help
Powered by ViewVC 1.1.26