gss_krb5: Don't expect blocksize to always be 8 when calculating padding
authorJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 17 Mar 2010 17:02:48 +0000 (13:02 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 14 May 2010 19:09:15 +0000 (15:09 -0400)
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/auth_gss/gss_krb5_wrap.c

index 496281fabb91a07554d555d25a143c27cb968eea..5d6c3b12ea702da81b6e78fa3802871a7f0695f2 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