]> andersk Git - openssh.git/blobdiff - cipher.c
Merged OpenBSD CVS changes that go away
[openssh.git] / cipher.c
index ade17dbc8b785549e4a8ca3c118742a5ce237d79..6edb79c9511c5a6b4514158e5baf43940f6588de 100644 (file)
--- a/cipher.c
+++ b/cipher.c
@@ -93,8 +93,6 @@ swap_bytes(const unsigned char *src, unsigned char *dst_, int n)
     char c[4];
   } t;
 
-  /* assert((n & 7) == 0); */
-
   /* Process 8 bytes every lap. */
   for (n = n / 8; n > 0; n--)
     {
@@ -248,7 +246,8 @@ void cipher_set_key(CipherContext *context, int cipher,
 void cipher_encrypt(CipherContext *context, unsigned char *dest,
                    const unsigned char *src, unsigned int len)
 {
-  assert((len & 7) == 0);
+  if ((len & 7) != 0)
+    fatal("cipher_encrypt: bad plaintext length %d", len);
 
   switch (context->type)
     {
@@ -280,7 +279,8 @@ void cipher_encrypt(CipherContext *context, unsigned char *dest,
 void cipher_decrypt(CipherContext *context, unsigned char *dest,
                    const unsigned char *src, unsigned int len)
 {
-  assert((len & 7) == 0);
+  if ((len & 7) != 0)
+    fatal("cipher_decrypt: bad ciphertext length %d", len);
 
   switch (context->type)
     {
This page took 0.029705 seconds and 4 git commands to generate.