along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol.c,v 1.28.4.67 2000/11/25 13:33:33 guus Exp $
+ $Id: protocol.c,v 1.28.4.69 2000/12/05 08:59:30 zarq Exp $
*/
#include "config.h"
for (i = 0; i < strlen(id); i++)
if(!isalnum(id[i]) && id[i] != '_')
return -1;
-
+
return 0;
}
-/* Generic request routines - takes care of logging and error detection as well */
+/* Generic request routines - takes care of logging and error
+ detection as well */
int send_request(connection_t *cl, const char *format, ...)
{
int len, request;
cp
- /* Use vsnprintf instead of vasprintf: faster, no memory fragmentation, cleanup is automatic,
- and there is a limit on the input buffer anyway */
+ /* Use vsnprintf instead of vasprintf: faster, no memory
+ fragmentation, cleanup is automatic, and there is a limit on the
+ input buffer anyway */
va_start(args, format);
len = vsnprintf(buffer, MAXBUFSIZE, format, args);
(H) SHA1,
(E) Encrypted with symmetric cipher.
- Part of the challenge is directly used to set the symmetric cipher key and the initial vector.
- Since a man-in-the-middle cannot decrypt the RSA challenges, this means that he cannot get or
- forge the key for the symmetric cipher.
+ Part of the challenge is directly used to set the symmetric cipher
+ key and the initial vector. Since a man-in-the-middle cannot
+ decrypt the RSA challenges, this means that he cannot get or forge
+ the key for the symmetric cipher.
*/
int send_id(connection_t *cl)
if((cfg = get_config_val(cl->config, config_publickey)))
{
cl->rsa_key = RSA_new();
- BN_hex2bn(&cl->rsa_key->n, cfg->data.ptr);
- BN_hex2bn(&cl->rsa_key->e, "FFFF");
+ if(read_rsa_public_key(&(cl->rsa_key), cfg->data.ptr) < 0)
+ return -1;
}
else
{