/[mcrypt]/libmcrypt/lib/mcrypt.c
ViewVC logotype

Diff of /libmcrypt/lib/mcrypt.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by nmav, Wed Jan 17 19:33:49 2001 UTC revision 1.6 by nmav, Wed Jan 17 19:37:56 2001 UTC
# Line 61  static int internal_init_mcrypt(MCRYPT t Line 61  static int internal_init_mcrypt(MCRYPT t
61          if (lenofkey == 0) {          if (lenofkey == 0) {
62                  return MCRYPT_KEY_LEN_ERROR;    /* error */                  return MCRYPT_KEY_LEN_ERROR;    /* error */
63          }          }
64            
65          sizes = mcrypt_enc_get_supported_key_sizes(td, &num_of_sizes);          sizes = mcrypt_enc_get_supported_key_sizes(td, &num_of_sizes);
66          if (sizes != NULL) {          if (sizes != NULL) {
67                  for (i = 0; i < num_of_sizes; i++) {                  for (i = 0; i < num_of_sizes; i++) {
# Line 94  static int internal_init_mcrypt(MCRYPT t Line 94  static int internal_init_mcrypt(MCRYPT t
94                  key_size = lenofkey;                  key_size = lenofkey;
95          }          }
96    
97            if (lenofkey > key_size) {
98                    return MCRYPT_KEY_LEN_ERROR;    /* error */    
99            }
100    
101          td->keyword_given = mxcalloc(1, mcrypt_enc_get_key_size(td));          td->keyword_given = mxcalloc(1, mcrypt_enc_get_key_size(td));
102          memmove(td->keyword_given, key, lenofkey);          memmove(td->keyword_given, key, lenofkey);
103          td->akey = mxcalloc(1, mcrypt_get_size(td));          td->akey = mxcalloc(1, mcrypt_get_size(td));

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26