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.99 by root, Wed Jul 17 04:36:03 2013 UTC vs.
Revision 1.100 by root, Wed Jul 17 05:34:17 2013 UTC

158{ 158{
159 if (RSA_public_encrypt (sizeof (auth.rsa), 159 if (RSA_public_encrypt (sizeof (auth.rsa),
160 (unsigned char *)&auth.rsa, (unsigned char *)&encr.rsa, 160 (unsigned char *)&auth.rsa, (unsigned char *)&encr.rsa,
161 key, RSA_PKCS1_OAEP_PADDING) < 0) 161 key, RSA_PKCS1_OAEP_PADDING) < 0)
162 fatal ("RSA_public_encrypt error"); 162 fatal ("RSA_public_encrypt error");
163
164 memcpy (&encr.ecdh, &auth.ecdh, sizeof (encr.ecdh));
163} 165}
164 166
165static inline bool 167static inline bool
166auth_decrypt (RSA *key, const auth_encr &encr, auth_data &auth) 168auth_decrypt (RSA *key, const auth_encr &encr, auth_data &auth)
167{ 169{
171 (const unsigned char *)&encr.rsa, (unsigned char *)rsa_decrypt, 173 (const unsigned char *)&encr.rsa, (unsigned char *)rsa_decrypt,
172 key, RSA_PKCS1_OAEP_PADDING) != sizeof (auth.rsa)) 174 key, RSA_PKCS1_OAEP_PADDING) != sizeof (auth.rsa))
173 return 0; 175 return 0;
174 176
175 memcpy (&auth.rsa, rsa_decrypt, sizeof (auth.rsa)); 177 memcpy (&auth.rsa, rsa_decrypt, sizeof (auth.rsa));
178 memcpy (&auth.ecdh, &encr.ecdh, sizeof (auth.ecdh));
176 179
177 return 1; 180 return 1;
178} 181}
179 182
180static void 183static void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines