require cipher-text to be padded to padsize
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13174 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -3027,6 +3027,10 @@ decrypt_internal_derived(krb5_context context,
|
||||
|
||||
len -= checksum_sz;
|
||||
|
||||
if ((len % et->padsize) != 0) {
|
||||
krb5_clear_error_string(context);
|
||||
return KRB5_BAD_MSIZE;
|
||||
}
|
||||
ret = _get_derived_key(context, crypto, ENCRYPTION_USAGE(usage), &dkey);
|
||||
if(ret) {
|
||||
free(p);
|
||||
@@ -3086,6 +3090,11 @@ decrypt_internal(krb5_context context,
|
||||
size_t checksum_sz, l;
|
||||
struct encryption_type *et = crypto->et;
|
||||
|
||||
if ((len % et->padsize) != 0) {
|
||||
krb5_clear_error_string(context);
|
||||
return KRB5_BAD_MSIZE;
|
||||
}
|
||||
|
||||
checksum_sz = CHECKSUMSIZE(et->checksum);
|
||||
p = malloc(len);
|
||||
if(len != 0 && p == NULL) {
|
||||
@@ -3148,6 +3157,11 @@ decrypt_internal_special(krb5_context context,
|
||||
char *tmp;
|
||||
krb5_error_code ret;
|
||||
|
||||
if ((len % et->padsize) != 0) {
|
||||
krb5_clear_error_string(context);
|
||||
return KRB5_BAD_MSIZE;
|
||||
}
|
||||
|
||||
tmp = malloc (sz);
|
||||
if (tmp == NULL) {
|
||||
krb5_set_error_string(context, "malloc: out of memory");
|
||||
|
Reference in New Issue
Block a user