summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorguenther <>2014-04-16 17:46:23 +0000
committerguenther <>2014-04-16 17:46:23 +0000
commit898b424c69eec8bff47c09751962ca33d0c4231b (patch)
treee0268f2157c55f9da4289ce87c2de03333504dd4 /src
parentb874b7b6bf7030d9fe970665ac5c21a389b6a9a3 (diff)
downloadopenbsd-898b424c69eec8bff47c09751962ca33d0c4231b.tar.gz
openbsd-898b424c69eec8bff47c09751962ca33d0c4231b.tar.bz2
openbsd-898b424c69eec8bff47c09751962ca33d0c4231b.zip
Zero-pad usec format to handle values less than 100,000 correctly
ok matthew@ tedu@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ts/ts_rsp_sign.c2
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_rsp_sign.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ts/ts_rsp_sign.c b/src/lib/libcrypto/ts/ts_rsp_sign.c
index 235c0a8476..e7186a8ce0 100644
--- a/src/lib/libcrypto/ts/ts_rsp_sign.c
+++ b/src/lib/libcrypto/ts/ts_rsp_sign.c
@@ -983,7 +983,7 @@ TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time,
983 if the elements correspond to 0, they MUST be wholly 983 if the elements correspond to 0, they MUST be wholly
984 omitted, and the decimal point element also MUST be 984 omitted, and the decimal point element also MUST be
985 omitted." */ 985 omitted." */
986 (void)snprintf(usecstr, sizeof(usecstr), ".%ld", usec); 986 (void)snprintf(usecstr, sizeof(usecstr), ".%06ld", usec);
987 /* truncate and trim trailing 0 */ 987 /* truncate and trim trailing 0 */
988 usecstr[precision + 1] = '\0'; 988 usecstr[precision + 1] = '\0';
989 p = usecstr + strlen(usecstr) - 1; 989 p = usecstr + strlen(usecstr) - 1;
diff --git a/src/lib/libssl/src/crypto/ts/ts_rsp_sign.c b/src/lib/libssl/src/crypto/ts/ts_rsp_sign.c
index 235c0a8476..e7186a8ce0 100644
--- a/src/lib/libssl/src/crypto/ts/ts_rsp_sign.c
+++ b/src/lib/libssl/src/crypto/ts/ts_rsp_sign.c
@@ -983,7 +983,7 @@ TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time,
983 if the elements correspond to 0, they MUST be wholly 983 if the elements correspond to 0, they MUST be wholly
984 omitted, and the decimal point element also MUST be 984 omitted, and the decimal point element also MUST be
985 omitted." */ 985 omitted." */
986 (void)snprintf(usecstr, sizeof(usecstr), ".%ld", usec); 986 (void)snprintf(usecstr, sizeof(usecstr), ".%06ld", usec);
987 /* truncate and trim trailing 0 */ 987 /* truncate and trim trailing 0 */
988 usecstr[precision + 1] = '\0'; 988 usecstr[precision + 1] = '\0';
989 p = usecstr + strlen(usecstr) - 1; 989 p = usecstr + strlen(usecstr) - 1;