diff options
author | jsing <> | 2021-12-25 12:11:57 +0000 |
---|---|---|
committer | jsing <> | 2021-12-25 12:11:57 +0000 |
commit | 82039a0b66d9e62c5617556d457e9612bfc56e8d (patch) | |
tree | 31241539cb67295a30e1674c67e5bba1b76e248e /src/lib/libcrypto/asn1/t_x509.c | |
parent | 346d30a52f494d9f2e76e352a6ba8ca2ebdcf62f (diff) | |
download | openbsd-82039a0b66d9e62c5617556d457e9612bfc56e8d.tar.gz openbsd-82039a0b66d9e62c5617556d457e9612bfc56e8d.tar.bz2 openbsd-82039a0b66d9e62c5617556d457e9612bfc56e8d.zip |
Move more ASN1_STRING_* functions to a_string.c.
No functional change.
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/asn1/t_x509.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/src/lib/libcrypto/asn1/t_x509.c b/src/lib/libcrypto/asn1/t_x509.c index d1655a1785..ff7871cd06 100644 --- a/src/lib/libcrypto/asn1/t_x509.c +++ b/src/lib/libcrypto/asn1/t_x509.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: t_x509.c,v 1.35 2021/11/01 20:53:08 tb Exp $ */ | 1 | /* $OpenBSD: t_x509.c,v 1.36 2021/12/25 12:11:57 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -352,36 +352,6 @@ X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, const ASN1_STRING *sig) | |||
352 | } | 352 | } |
353 | 353 | ||
354 | int | 354 | int |
355 | ASN1_STRING_print(BIO *bp, const ASN1_STRING *v) | ||
356 | { | ||
357 | int i, n; | ||
358 | char buf[80]; | ||
359 | const char *p; | ||
360 | |||
361 | if (v == NULL) | ||
362 | return (0); | ||
363 | n = 0; | ||
364 | p = (const char *)v->data; | ||
365 | for (i = 0; i < v->length; i++) { | ||
366 | if ((p[i] > '~') || ((p[i] < ' ') && | ||
367 | (p[i] != '\n') && (p[i] != '\r'))) | ||
368 | buf[n] = '.'; | ||
369 | else | ||
370 | buf[n] = p[i]; | ||
371 | n++; | ||
372 | if (n >= 80) { | ||
373 | if (BIO_write(bp, buf, n) <= 0) | ||
374 | return (0); | ||
375 | n = 0; | ||
376 | } | ||
377 | } | ||
378 | if (n > 0) | ||
379 | if (BIO_write(bp, buf, n) <= 0) | ||
380 | return (0); | ||
381 | return (1); | ||
382 | } | ||
383 | |||
384 | int | ||
385 | ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) | 355 | ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) |
386 | { | 356 | { |
387 | if (tm->type == V_ASN1_UTCTIME) | 357 | if (tm->type == V_ASN1_UTCTIME) |