/[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 482 by matthewc, Thu Oct 9 04:21:19 2003 UTC revision 638 by astrand, Wed Mar 17 14:11:08 2004 UTC
# Line 425  sec_out_mcs_data(STREAM s) Line 425  sec_out_mcs_data(STREAM s)
425          out_uint16_le(s, 0xc001);          out_uint16_le(s, 0xc001);
426          out_uint8(s, 0);          out_uint8(s, 0);
427    
428          out_uint32_le(s, 0x61637544);   /* "Duca" ?! */          out_uint32_le(s, 0x61637544);   /* "Duca", as in Ducati. */
429          out_uint16_be(s, ((length - 14) | 0x8000));     /* remaining length */          out_uint16_be(s, ((length - 14) | 0x8000));     /* remaining length */
430    
431          /* Client information */          /* Client information */
# Line 625  sec_parse_crypt_info(STREAM s, uint32 * Line 625  sec_parse_crypt_info(STREAM s, uint32 *
625          }          }
626          else          else
627          {          {
628                    uint32 certcount;
629    
630                  DEBUG_RDP5(("We're going for the RDP5-style encryption\n"));                  DEBUG_RDP5(("We're going for the RDP5-style encryption\n"));
631                  in_uint8s(s, 4);        /* Number of certificates */                  in_uint32_le(s, certcount);     /* Number of certificates */
632    
633                    if (certcount < 2)
634                    {
635                            error("Server didn't send enough X509 certificates\n");
636                            return False;
637                    }
638    
639                    for (; certcount > 2; certcount--)
640                    {               /* ignore all the certificates between the root and the signing CA */
641                            uint32 ignorelen;
642                            X509 *ignorecert;
643    
644                            DEBUG_RDP5(("Ignored certs left: %d\n", certcount));
645    
646                            in_uint32_le(s, ignorelen);
647                            DEBUG_RDP5(("Ignored Certificate length is %d\n", ignorelen));
648                            ignorecert = d2i_X509(NULL, &(s->p), ignorelen);
649    
650                            if (ignorecert == NULL)
651                            {       /* XXX: error out? */
652                                    DEBUG_RDP5(("got a bad cert: this will probably screw up the rest of the communication\n"));
653                            }
654    
655    #ifdef WITH_DEBUG_RDP5
656                            DEBUG_RDP5(("cert #%d (ignored):\n", certcount));
657                            X509_print_fp(stdout, ignorecert);
658    #endif
659                    }
660    
661                  /* Do da funky X.509 stuffy                  /* Do da funky X.509 stuffy
662    
# Line 700  sec_process_crypt_info(STREAM s) Line 730  sec_process_crypt_info(STREAM s)
730    
731          DEBUG(("Generating client random\n"));          DEBUG(("Generating client random\n"));
732          /* Generate a client random, and hence determine encryption keys */          /* Generate a client random, and hence determine encryption keys */
733          // This is what the MS client do:          /* This is what the MS client do: */
734          memset(inr, 0, SEC_RANDOM_SIZE);          memset(inr, 0, SEC_RANDOM_SIZE);
735          /*  *ARIGL!* Plaintext attack, anyone?          /*  *ARIGL!* Plaintext attack, anyone?
736             I tried doing:             I tried doing:
# Line 844  sec_connect(char *server, char *username Line 874  sec_connect(char *server, char *username
874          if (!mcs_connect(server, &mcs_data, username))          if (!mcs_connect(server, &mcs_data, username))
875                  return False;                  return False;
876    
877          //      sec_process_mcs_data(&mcs_data);          /*      sec_process_mcs_data(&mcs_data); */
878          if (g_encryption)          if (g_encryption)
879                  sec_establish_key();                  sec_establish_key();
880          xfree(mcs_data.data);          xfree(mcs_data.data);

Legend:
Removed from v.482  
changed lines
  Added in v.638

  ViewVC Help
Powered by ViewVC 1.1.26