ensure the cksum content length is sufficient.
* t_cksum.c: initialize cksum.length
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8025
dc483132-0cff-0310-8789-
dd5450dbe970
+Tue May 14 19:32:51 1996 Richard Basch <basch@lehman.com>
+
+ * md5crypto.c md5glue.c:
+ ensure the cksum content length is sufficient.
+
+ * t_cksum.c: initialize cksum.length
+
Fri May 10 01:19:18 1996 Richard Basch <basch@lehman.com>
* md5crypto.c: des3-md5 is being replaced with des3-sha
krb5_keyblock keyblock;
krb5_error_code retval;
size_t i;
-
krb5_MD5_CTX working;
+ if (outcksum->length < RSA_MD5_DES_CKSUM_LENGTH + RSA_MD5_DES_CONFOUND_LENGTH)
+ return KRB5_BAD_MSIZE;
+
/* Generate the confounder in place */
if (retval = krb5_random_confounder(RSA_MD5_DES_CONFOUND_LENGTH,
outtmp))
krb5_octet *input = (krb5_octet *)in;
krb5_MD5_CTX working;
+ if (outcksum->length < RSA_MD5_CKSUM_LENGTH)
+ return KRB5_BAD_MSIZE;
+
krb5_MD5Init(&working);
krb5_MD5Update(&working, input, in_length);
krb5_MD5Final(&working);
return(kret);
}
+ oldstyle_checksum.length = CHECKSUM_LENGTH;
if (!(oldstyle_checksum.contents = (krb5_octet *) malloc(CHECKSUM_LENGTH))) {
printf("cannot get memory for old style checksum\n");
return(ENOMEM);
}
+ newstyle_checksum.length = krb5_checksum_size(kcontext, CHECKSUM_TYPE);
if (!(newstyle_checksum.contents = (krb5_octet *)
- malloc(krb5_checksum_size(kcontext, CHECKSUM_TYPE)))) {
+ malloc(newstyle_checksum.length))) {
printf("cannot get memory for new style checksum\n");
return(ENOMEM);
}