diff options
author | Tom Yu <tlyu@mit.edu> | 2003-01-31 05:50:29 +0000 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2003-01-31 05:50:29 +0000 |
commit | 50501b43418d5fee8c53c3f12bb2cb867bccb967 (patch) | |
tree | 5d672553beb2418b5c07ea16a5a2824af46816f9 /src/appl | |
parent | 133604df1c3957fc45898a6fbab8a6193402cf4b (diff) | |
download | krb5-50501b43418d5fee8c53c3f12bb2cb867bccb967.zip krb5-50501b43418d5fee8c53c3f12bb2cb867bccb967.tar.gz krb5-50501b43418d5fee8c53c3f12bb2cb867bccb967.tar.bz2 |
* kcmd.c (v4_des_write): Apply patch from ghudson to fix
non-right-justification case.
ticket: 620
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15139 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl')
-rw-r--r-- | src/appl/bsd/ChangeLog | 5 | ||||
-rw-r--r-- | src/appl/bsd/kcmd.c | 13 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index abbabba..41f3e70 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/src/appl/bsd/kcmd.c b/src/appl/bsd/kcmd.c index 6bd4aee..5388e7a 100644 --- a/src/appl/bsd/kcmd.c +++ b/src/appl/bsd/kcmd.c @@ -1251,10 +1251,15 @@ int secondary; #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), |