From: Ken Raeburn Date: Fri, 23 Jun 2000 22:53:06 +0000 (+0000) Subject: merge from krb5-1-2-beta4 X-Git-Tag: krb5-1.3-alpha1~2095 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0b43573b23f515c6189da100e08532f5edb985d8;p=krb5.git merge from krb5-1-2-beta4 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12427 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/tests/create/ChangeLog b/src/tests/create/ChangeLog index 100db876a..1d080084c 100644 --- a/src/tests/create/ChangeLog +++ b/src/tests/create/ChangeLog @@ -1,3 +1,13 @@ +2000-05-11 Nalin Dahyabhai + + * kdb5_mkdums.c (main): Make sure buffer 'principal' is terminated. + +2000-05-08 Ken Raeburn + Nalin Dahyabhai + + * kdb5_mkdums.c (main): Make sure buffer "tmp" is + null-terminated. Don't overflow buffer "tmp" or "tmp2". + 1999-10-26 Wilfredo Sanchez * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES, diff --git a/src/tests/create/kdb5_mkdums.c b/src/tests/create/kdb5_mkdums.c index 3cacc19df..aa1854c8f 100644 --- a/src/tests/create/kdb5_mkdums.c +++ b/src/tests/create/kdb5_mkdums.c @@ -130,7 +130,8 @@ char *argv[]; mkey_password = optarg; break; case 'p': /* prefix name to create */ - strcpy(principal_string, optarg); + strncpy(principal_string, optarg, sizeof(principal_string) - 1); + principal_string[sizeof(principal_string) - 1] = '\0'; suffix = principal_string + strlen(principal_string); break; case 'n': /* how many to create */ @@ -195,13 +196,14 @@ char *argv[]; again given a prefix and count to test the db lib and kdb */ (void) sprintf(suffix, "%d", n); (void) sprintf(tmp, "%s-DEPTH-1", principal_string); + tmp[sizeof(tmp) - 1] = '\0'; str_newprinc = tmp; add_princ(test_context, str_newprinc); for (i = 2; i <= depth; i++) { - tmp2[0] = '\0'; (void) sprintf(tmp2, "/%s-DEPTH-%d", principal_string, i); - strcat(tmp, tmp2); + tmp2[sizeof(tmp2) - 1] = '\0'; + strncat(tmp, tmp2, sizeof(tmp) - 1 - strlen(tmp)); str_newprinc = tmp; add_princ(test_context, str_newprinc); } diff --git a/src/tests/dejagnu/config/ChangeLog b/src/tests/dejagnu/config/ChangeLog index 54d0e4b82..f3767a9f5 100644 --- a/src/tests/dejagnu/config/ChangeLog +++ b/src/tests/dejagnu/config/ChangeLog @@ -1,3 +1,8 @@ +2000-05-31 Ken Raeburn + + * default.exp (setup_kerberos_files): Include des3 in supported + enctypes. + 2000-02-07 Tom Yu * default.exp: Remove default_tgs_enctypes for now as it was diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp index 44ffab7a9..e3993544e 100644 --- a/src/tests/dejagnu/config/default.exp +++ b/src/tests/dejagnu/config/default.exp @@ -352,8 +352,7 @@ proc setup_kerberos_files { } { puts $conffile " max_renewable_life = 3:00:00" puts $conffile " master_key_type = des-cbc-md5" puts $conffile " master_key_name = master/key" -# des3-cbc-sha1:normal - puts $conffile " supported_enctypes = des-cbc-crc:normal des-cbc-md5:normal des-cbc-crc:v4 des-cbc-md5:norealm" + puts $conffile " supported_enctypes = des3-cbc-sha1:normal des-cbc-crc:normal des-cbc-md5:normal des-cbc-crc:v4 des-cbc-md5:norealm" puts $conffile " kdc_supported_enctypes = des3-cbc-sha1:normal des-cbc-crc:normal des-cbc-md5:normal des-cbc-crc:v4 des-cbc-md5:norealm" puts $conffile " kdc_ports = 3088" puts $conffile " default_principal_expiration = 2037.12.31.23.59.59" diff --git a/src/tests/hammer/ChangeLog b/src/tests/hammer/ChangeLog index 84d1eb64a..aed2f63df 100644 --- a/src/tests/hammer/ChangeLog +++ b/src/tests/hammer/ChangeLog @@ -1,3 +1,12 @@ +2000-05-11 Nalin Dahyabhai + + * kdc5_hammer.c (main): Make sure buffer 'prefix' is null-terminated. + +2000-05-08 Ken Raeburn + Nalin Dahyabhai + + * kdc5_hammer.c (main): Don't overflow buffers "ctmp" or "stmp". + 1999-10-26 Wilfredo Sanchez * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES, diff --git a/src/tests/hammer/kdc5_hammer.c b/src/tests/hammer/kdc5_hammer.c index 780f92d83..6429a38ed 100644 --- a/src/tests/hammer/kdc5_hammer.c +++ b/src/tests/hammer/kdc5_hammer.c @@ -169,7 +169,8 @@ main(argc, argv) depth = atoi(optarg); /* how deep to go */ break; case 'p': /* prefix name to check */ - strcpy(prefix, optarg); + strncpy(prefix, optarg, sizeof(prefix) - 1); + prefix[sizeof(prefix) - 1] = '\0'; break; case 'n': /* how many to check */ num_to_check = atoi(optarg); @@ -240,10 +241,11 @@ main(argc, argv) again given a prefix and count to test the db lib and kdb */ ctmp[0] = '\0'; for (i = 1; i <= depth; i++) { - ctmp2[0] = '\0'; (void) sprintf(ctmp2, "%s%s%d-DEPTH-%d", (i != 1) ? "/" : "", prefix, n, i); - strcat(ctmp, ctmp2); + ctmp2[sizeof(ctmp2) - 1] = '\0'; + strncat(ctmp, ctmp2, sizeof(ctmp) - 1 - strlen(ctmp)); + ctmp[sizeof(ctmp) - 1] = '\0'; sprintf(client, "%s@%s", ctmp, cur_realm); if (get_tgt (test_context, client, &client_princ, ccache)) { @@ -255,10 +257,11 @@ main(argc, argv) stmp[0] = '\0'; for (j = 1; j <= depth; j++) { - stmp2[0] = '\0'; (void) sprintf(stmp2, "%s%s%d-DEPTH-%d", (j != 1) ? "/" : "", prefix, n, j); - strcat(stmp, stmp2); + stmp2[sizeof (stmp2) - 1] = '\0'; + strncat(stmp, stmp2, sizeof(stmp) - 1 - strlen(stmp)); + stmp[sizeof(stmp) - 1] = '\0'; sprintf(server, "%s@%s", stmp, cur_realm); if (verify_cs_pair(test_context, client, client_princ, stmp, cur_realm, n, i, j, ccache)) diff --git a/src/tests/verify/ChangeLog b/src/tests/verify/ChangeLog index 2f63d09fe..a97ea811a 100644 --- a/src/tests/verify/ChangeLog +++ b/src/tests/verify/ChangeLog @@ -1,3 +1,12 @@ +2000-05-11 Nalin Dahyabhai + + * kdb5_verify.c (main): Make sure buffer "principal_string" is + properly terminated. + +2000-05-08 Nalin Dahyabhai + + * kdb5_verify.c (main): Don't overflow buffer "tmp". + 1999-10-26 Wilfredo Sanchez * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES, diff --git a/src/tests/verify/kdb5_verify.c b/src/tests/verify/kdb5_verify.c index bfb066136..e4277b18c 100644 --- a/src/tests/verify/kdb5_verify.c +++ b/src/tests/verify/kdb5_verify.c @@ -131,7 +131,8 @@ char *argv[]; mkey_password = optarg; break; case 'p': /* prefix name to check */ - strcpy(principal_string, optarg); + strncpy(principal_string, optarg, sizeof(principal_string) - 1); + principal_string[sizeof(principal_string) - 1] = '\0'; suffix = principal_string + strlen(principal_string); break; case 'n': /* how many to check */ @@ -199,9 +200,9 @@ char *argv[]; if (check_princ(context, str_princ)) errors++; for (i = 2; i <= depth; i++) { - tmp2[0] = '\0'; (void) sprintf(tmp2, "/%s-DEPTH-%d", principal_string, i); - strcat(tmp, tmp2); + tmp2[sizeof(tmp2) - 1] = '\0'; + strncat(tmp, tmp2, sizeof(tmp) - 1 - strlen(tmp)); str_princ = tmp; if (check_princ(context, str_princ)) errors++; }