ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/connection.C
(Generate patch)

Comparing gvpe/src/connection.C (file contents):
Revision 1.31 by pcg, Sun Feb 8 07:24:25 2004 UTC vs.
Revision 1.32 by pcg, Sun Mar 21 13:15:42 2004 UTC

456 u8 flags, challengelen, features, pad3; 456 u8 flags, challengelen, features, pad3;
457 u32 cipher_nid, digest_nid, hmac_nid; 457 u32 cipher_nid, digest_nid, hmac_nid;
458 458
459 void setup (ptype type, int dst); 459 void setup (ptype type, int dst);
460 bool chk_config () const; 460 bool chk_config () const;
461
462 static u8 get_features ()
463 {
464 u8 f = 0;
465#if ENABLE_COMPRESSION
466 f |= FEATURE_COMPRESSION;
467#endif
468#if ENABLE_ROHC
469 f |= FEATURE_ROHC;
470#endif
471 return f;
472 }
461}; 473};
462
463#define FEATURES ((ENABLE_COMPRESSION ? FEATURE_COMPRESSION : 0) \
464 | (ENABLE_ROHC ? FEATURE_ROHC : 0))
465 474
466void config_packet::setup (ptype type, int dst) 475void config_packet::setup (ptype type, int dst)
467{ 476{
468 prot_major = PROTOCOL_MAJOR; 477 prot_major = PROTOCOL_MAJOR;
469 prot_minor = PROTOCOL_MINOR; 478 prot_minor = PROTOCOL_MINOR;
470 randsize = RAND_SIZE; 479 randsize = RAND_SIZE;
471 hmaclen = HMACLENGTH; 480 hmaclen = HMACLENGTH;
472 flags = ENABLE_COMPRESSION ? 0x81 : 0x80; 481 flags = ENABLE_COMPRESSION ? 0x81 : 0x80;
473 challengelen = sizeof (rsachallenge); 482 challengelen = sizeof (rsachallenge);
474 features = FEATURES; 483 features = get_features ();
475 484
476 cipher_nid = htonl (EVP_CIPHER_nid (CIPHER)); 485 cipher_nid = htonl (EVP_CIPHER_nid (CIPHER));
477 digest_nid = htonl (EVP_MD_type (RSA_HASH)); 486 digest_nid = htonl (EVP_MD_type (RSA_HASH));
478 hmac_nid = htonl (EVP_MD_type (DIGEST)); 487 hmac_nid = htonl (EVP_MD_type (DIGEST));
479 488
923 932
924 // compatibility code, remove when no longer required 933 // compatibility code, remove when no longer required
925 if (p->flags & 1) p->features |= FEATURE_COMPRESSION; 934 if (p->flags & 1) p->features |= FEATURE_COMPRESSION;
926 935
927 conf->protocols = p->protocols; 936 conf->protocols = p->protocols;
928 features = p->features & FEATURES; 937 features = p->features & config_packet::get_features ();
929 938
930 send_auth_response (rsi, p->id, k); 939 send_auth_response (rsi, p->id, k);
931 940
932 connection_established (); 941 connection_established ();
933 942
1047 si = rsi; 1056 si = rsi;
1048 1057
1049 slog (L_INFO, _("%s(%s): socket address changed to %s"), 1058 slog (L_INFO, _("%s(%s): socket address changed to %s"),
1050 conf->nodename, (const char *)si, (const char *)rsi); 1059 conf->nodename, (const char *)si, (const char *)rsi);
1051 } 1060 }
1052
1053 delete d;
1054
1055 break;
1056 } 1061 }
1062
1063 delete d;
1064
1065 break;
1057 } 1066 }
1058 } 1067 }
1059 1068
1060 send_reset (rsi); 1069 send_reset (rsi);
1061 break; 1070 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines