diff options
author | Noah Lokocz <nlokocz@mozilla.com> | 2023-03-16 11:54:55 +0000 |
---|---|---|
committer | Noah Lokocz <nlokocz@mozilla.com> | 2023-03-16 11:54:55 +0000 |
commit | 8acd95e85e0da102fc48369fd237c634fe6066ae (patch) | |
tree | 8e1a4dd99d6d370965a7a8a1db41dbde878a0997 /cmd/fipstest/fipstest.c | |
parent | f658c5a831dab0cf861a0c939c0684f0ab012695 (diff) | |
download | nss-hg-8acd95e85e0da102fc48369fd237c634fe6066ae.tar.gz |
Bug 1819958. Removed deprecated sprintf function and replaced with snprintf. r=djackson
Differential Revision: https://phabricator.services.mozilla.com/D171859
Diffstat (limited to 'cmd/fipstest/fipstest.c')
-rw-r--r-- | cmd/fipstest/fipstest.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/fipstest/fipstest.c b/cmd/fipstest/fipstest.c index c9d1958b1..48ca78b54 100644 --- a/cmd/fipstest/fipstest.c +++ b/cmd/fipstest/fipstest.c @@ -589,7 +589,7 @@ tdea_mct_test(int mode, unsigned char *key, unsigned int numKeys, for (i = 0; i < 400; i++) { /* if i == 0 CV[0] = IV not necessary */ /* record the count and key values and plainText */ - sprintf(buf, "COUNT = %d\n", i); + snprintf(buf, sizeof(buf), "COUNT = %d\n", i); fputs(buf, resp); /* Output KEY1[i] */ fputs("KEY1 = ", resp); @@ -1511,7 +1511,7 @@ aes_ecb_mct(char *reqfn) } for (i = 0; i < 100; i++) { - sprintf(buf, "COUNT = %d\n", i); + snprintf(buf, sizeof(buf), "COUNT = %d\n", i); fputs(buf, aesresp); /* Output Key[i] */ fputs("KEY = ", aesresp); @@ -1609,7 +1609,7 @@ aes_ecb_mct(char *reqfn) } for (i = 0; i < 100; i++) { - sprintf(buf, "COUNT = %d\n", i); + snprintf(buf, sizeof(buf), "COUNT = %d\n", i); fputs(buf, aesresp); /* Output Key[i] */ fputs("KEY = ", aesresp); @@ -1808,7 +1808,7 @@ aes_cbc_mct(char *reqfn) } for (i = 0; i < 100; i++) { - sprintf(buf, "COUNT = %d\n", i); + snprintf(buf, sizeof(buf), "COUNT = %d\n", i); fputs(buf, aesresp); /* Output Key[i] */ fputs("KEY = ", aesresp); @@ -1920,7 +1920,7 @@ aes_cbc_mct(char *reqfn) } for (i = 0; i < 100; i++) { - sprintf(buf, "COUNT = %d\n", i); + snprintf(buf, sizeof(buf), "COUNT = %d\n", i); fputs(buf, aesresp); /* Output Key[i] */ fputs("KEY = ", aesresp); @@ -4662,7 +4662,7 @@ sha_mct_test(unsigned int MDLen, unsigned char *seed, FILE *resp) /* seed = MD_i */ memcpy(seed, MD_i, MDLen); - sprintf(buf, "COUNT = %d\n", j); + snprintf(buf, sizeof(buf), "COUNT = %d\n", j); fputs(buf, resp); /* output MD_i */ |