2008-10-18 22:03 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* contrib/xhb/hbcrypt.c
    ! Fixed lower level crypt functions to not do 
      zero division on zero length key input.
This commit is contained in:
Viktor Szakats
2008-10-18 20:03:36 +00:00
parent c3f2ef56f9
commit fec60ddb22
2 changed files with 11 additions and 4 deletions

View File

@@ -8,6 +8,11 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-10-18 22:03 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* contrib/xhb/hbcrypt.c
! Fixed lower level crypt functions to not do
zero division on zero length key input.
2008-10-18 21:16 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/common/hbgete.c
! Fixed recent warning on Win32 platforms.

View File

@@ -85,7 +85,7 @@ void nxs_crypt(
BYTE *cipher )
{
if(keylen > NXS_MAX_KEYLEN )
if( keylen > NXS_MAX_KEYLEN )
{
keylen = NXS_MAX_KEYLEN;
}
@@ -112,7 +112,7 @@ void nxs_decrypt(
const unsigned char *key, ULONG keylen,
BYTE *result )
{
if(keylen > NXS_MAX_KEYLEN )
if( keylen > NXS_MAX_KEYLEN )
{
keylen = NXS_MAX_KEYLEN;
}
@@ -154,7 +154,8 @@ void nxs_scramble(
nxs_make_scramble( scramble, key, keylen );
/* Leave alone the last block */
len = (srclen / keylen) * keylen;
if( keylen > 0 )
len = (srclen / keylen) * keylen;
nxs_partial_scramble( source, cipher, scramble, len, keylen );
keylen = srclen - len;
@@ -207,7 +208,8 @@ void nxs_unscramble(
nxs_make_scramble( scramble, key, keylen );
/* Leave alone the last block */
len = (cipherlen / keylen) * keylen;
if( keylen > 0 )
len = (cipherlen / keylen) * keylen;
nxs_partial_unscramble( cipher, scramble, len , keylen );
keylen = cipherlen - len;