gss_krb5: Don't expect blocksize to always be 8 when calculating padding
[safe/jmp/linux-2.6] / net / sunrpc / auth_gss / gss_krb5_wrap.c
index 496281f..5d6c3b1 100644 (file)
 static inline int
 gss_krb5_padding(int blocksize, int length)
 {
-       /* Most of the code is block-size independent but currently we
-        * use only 8: */
-       BUG_ON(blocksize != 8);
-       return 8 - (length & 7);
+       return blocksize - (length % blocksize);
 }
 
 static inline void