Author: jpaetzel
Date: Thu Jun 15 23:14:04 2017
New Revision: 319992
URL: https://svnweb.freebsd.org/changeset/base/319992

Log:
  MFC 319670
  
  Fix SMBFS when saved passwords are greater than 18 characters
  
  PR:   132302
  Submitted by: [email protected] [email protected]

Modified:
  stable/10/contrib/smbfs/lib/smb/subr.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/smbfs/lib/smb/subr.c
==============================================================================
--- stable/10/contrib/smbfs/lib/smb/subr.c      Thu Jun 15 21:34:43 2017        
(r319991)
+++ stable/10/contrib/smbfs/lib/smb/subr.c      Thu Jun 15 23:14:04 2017        
(r319992)
@@ -232,6 +232,8 @@ smb_simplecrypt(char *dst, const char *src)
                          islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch);
                ch ^= pos;
                pos += 13;
+               if (pos > 256)
+                       pos -= 256;
                sprintf(dst, "%02x", ch);
                dst += 2;
        }
@@ -262,6 +264,8 @@ smb_simpledecrypt(char *dst, const char *src)
                        return EINVAL;
                ch ^= pos;
                pos += 13;
+               if (pos > 256)
+                       pos -= 256;
                if (isascii(ch))
                    ch = (isupper(ch) ? ('A' + (ch - 'A' + 13) % 26) :
                          islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to