+2003-01-31 Tom Yu <tlyu@mit.edu>
+
+ * kcmd.c (v4_des_write): Apply patch from ghudson to fix
+ non-right-justification case.
+
2003-01-30 Ken Raeburn <raeburn@mit.edu>
* login.c (try_krb4): Delete unused krb5 principal name argument.
#endif
#define min(a,b) ((a < b) ? a : b)
- if (len < 8 && right_justify) {
- krb5_random_confounder(8 - len, garbage_buf);
- /* this "right-justifies" the data in the buffer */
- (void) memcpy(garbage_buf + 8 - len, buf, len);
+ if (len < 8) {
+ if (right_justify) {
+ krb5_random_confounder(8 - len, garbage_buf);
+ /* this "right-justifies" the data in the buffer */
+ (void) memcpy(garbage_buf + 8 - len, buf, len);
+ } else {
+ krb5_random_confounder(8 - len, garbage_buf + len);
+ (void) memcpy(garbage_buf, buf, len);
+ }
}
(void) pcbc_encrypt((des_cblock *) ((len < 8) ? garbage_buf : buf),
(des_cblock *) (des_outpkt+4),