Skip to content
Snippets Groups Projects
Commit e8b3c79f authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Fixed bug in f_decrypt -- it encrypted instead of decrypted...

Rev: src/modules/_Crypto/idea.c:1.3
parent 318c6d93
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id: idea.c,v 1.2 1996/11/07 19:30:17 grubba Exp $ * $Id: idea.c,v 1.3 1996/11/08 22:44:50 grubba Exp $
* *
* IDEA crypto module for Pike * IDEA crypto module for Pike
* *
...@@ -94,8 +94,8 @@ static void f_set_key(INT32 args) ...@@ -94,8 +94,8 @@ static void f_set_key(INT32 args)
error("idea->set_key(): Too short key\n"); error("idea->set_key(): Too short key\n");
} }
idea_set_encrypt_key((unsigned char *)sp[-1].u.string->str, idea_set_encrypt_key((unsigned char *)sp[-1].u.string->str,
&(PIKE_IDEA->e_key)); &PIKE_IDEA->e_key);
idea_set_decrypt_key(&(PIKE_IDEA->e_key), &(PIKE_IDEA->d_key)); idea_set_decrypt_key(&PIKE_IDEA->e_key, &PIKE_IDEA->d_key);
MEMCPY(&(PIKE_IDEA->key), sp[-1].u.string->str, 8); MEMCPY(&(PIKE_IDEA->key), sp[-1].u.string->str, 8);
...@@ -143,7 +143,7 @@ static void f_decrypt(INT32 args) ...@@ -143,7 +143,7 @@ static void f_decrypt(INT32 args)
} }
idea_ecb_encrypt((unsigned char *)sp[-1].u.string->str, buffer, idea_ecb_encrypt((unsigned char *)sp[-1].u.string->str, buffer,
&(PIKE_IDEA->e_key)); &(PIKE_IDEA->d_key));
pop_n_elems(args); pop_n_elems(args);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment