diff options
| author | beck <> | 2014-04-15 16:21:04 +0000 |
|---|---|---|
| committer | beck <> | 2014-04-15 16:21:04 +0000 |
| commit | 815e93e74514b0f699488f372d491cf84236cd99 (patch) | |
| tree | 8c2058c07d3cdac3caf00950e53159c1c251f257 /src/lib/libcrypto/asn1 | |
| parent | 6faa9226dd4494c01448085044adc07001ba4ca0 (diff) | |
| download | openbsd-815e93e74514b0f699488f372d491cf84236cd99.tar.gz openbsd-815e93e74514b0f699488f372d491cf84236cd99.tar.bz2 openbsd-815e93e74514b0f699488f372d491cf84236cd99.zip | |
Part 1 of eliminating BIO_snprintf(). This fixes mechanical conversions
where the return value is ignored changing to (void) snprintf.
ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/asn1')
| -rw-r--r-- | src/lib/libcrypto/asn1/a_gentm.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/a_mbstr.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/a_strex.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/a_utctm.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/asn1_lib.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/asn1_par.c | 8 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/asn1/a_gentm.c b/src/lib/libcrypto/asn1/a_gentm.c index c79c6f538c..04266e790a 100644 --- a/src/lib/libcrypto/asn1/a_gentm.c +++ b/src/lib/libcrypto/asn1/a_gentm.c | |||
| @@ -252,7 +252,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, | |||
| 252 | s->data=(unsigned char *)p; | 252 | s->data=(unsigned char *)p; |
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | BIO_snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900, | 255 | (void) snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900, |
| 256 | ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec); | 256 | ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec); |
| 257 | s->length=strlen(p); | 257 | s->length=strlen(p); |
| 258 | s->type=V_ASN1_GENERALIZEDTIME; | 258 | s->type=V_ASN1_GENERALIZEDTIME; |
diff --git a/src/lib/libcrypto/asn1/a_mbstr.c b/src/lib/libcrypto/asn1/a_mbstr.c index 1538e0a4fc..264d8f677f 100644 --- a/src/lib/libcrypto/asn1/a_mbstr.c +++ b/src/lib/libcrypto/asn1/a_mbstr.c | |||
| @@ -145,14 +145,14 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, | |||
| 145 | 145 | ||
| 146 | if((minsize > 0) && (nchar < minsize)) { | 146 | if((minsize > 0) && (nchar < minsize)) { |
| 147 | ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_SHORT); | 147 | ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_SHORT); |
| 148 | BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize); | 148 | (void) snprintf(strbuf, sizeof strbuf, "%ld", minsize); |
| 149 | ERR_add_error_data(2, "minsize=", strbuf); | 149 | ERR_add_error_data(2, "minsize=", strbuf); |
| 150 | return -1; | 150 | return -1; |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | if((maxsize > 0) && (nchar > maxsize)) { | 153 | if((maxsize > 0) && (nchar > maxsize)) { |
| 154 | ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_LONG); | 154 | ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_LONG); |
| 155 | BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize); | 155 | (void) snprintf(strbuf, sizeof strbuf, "%ld", maxsize); |
| 156 | ERR_add_error_data(2, "maxsize=", strbuf); | 156 | ERR_add_error_data(2, "maxsize=", strbuf); |
| 157 | return -1; | 157 | return -1; |
| 158 | } | 158 | } |
diff --git a/src/lib/libcrypto/asn1/a_strex.c b/src/lib/libcrypto/asn1/a_strex.c index ead37ac325..d1a587ccc1 100644 --- a/src/lib/libcrypto/asn1/a_strex.c +++ b/src/lib/libcrypto/asn1/a_strex.c | |||
| @@ -125,12 +125,12 @@ static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, ch | |||
| 125 | if(c > 0xffffffffL) | 125 | if(c > 0xffffffffL) |
| 126 | return -1; | 126 | return -1; |
| 127 | if(c > 0xffff) { | 127 | if(c > 0xffff) { |
| 128 | BIO_snprintf(tmphex, sizeof tmphex, "\\W%08lX", c); | 128 | (void) snprintf(tmphex, sizeof tmphex, "\\W%08lX", c); |
| 129 | if(!io_ch(arg, tmphex, 10)) return -1; | 129 | if(!io_ch(arg, tmphex, 10)) return -1; |
| 130 | return 10; | 130 | return 10; |
| 131 | } | 131 | } |
| 132 | if(c > 0xff) { | 132 | if(c > 0xff) { |
| 133 | BIO_snprintf(tmphex, sizeof tmphex, "\\U%04lX", c); | 133 | (void) snprintf(tmphex, sizeof tmphex, "\\U%04lX", c); |
| 134 | if(!io_ch(arg, tmphex, 6)) return -1; | 134 | if(!io_ch(arg, tmphex, 6)) return -1; |
| 135 | return 6; | 135 | return 6; |
| 136 | } | 136 | } |
| @@ -149,7 +149,7 @@ static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, ch | |||
| 149 | return 2; | 149 | return 2; |
| 150 | } | 150 | } |
| 151 | if(chflgs & (ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB)) { | 151 | if(chflgs & (ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB)) { |
| 152 | BIO_snprintf(tmphex, 11, "\\%02X", chtmp); | 152 | (void) snprintf(tmphex, 11, "\\%02X", chtmp); |
| 153 | if(!io_ch(arg, tmphex, 3)) return -1; | 153 | if(!io_ch(arg, tmphex, 3)) return -1; |
| 154 | return 3; | 154 | return 3; |
| 155 | } | 155 | } |
diff --git a/src/lib/libcrypto/asn1/a_utctm.c b/src/lib/libcrypto/asn1/a_utctm.c index 072e236592..615395b738 100644 --- a/src/lib/libcrypto/asn1/a_utctm.c +++ b/src/lib/libcrypto/asn1/a_utctm.c | |||
| @@ -229,7 +229,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, | |||
| 229 | s->data=(unsigned char *)p; | 229 | s->data=(unsigned char *)p; |
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | BIO_snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100, | 232 | (void) snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100, |
| 233 | ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec); | 233 | ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec); |
| 234 | s->length=strlen(p); | 234 | s->length=strlen(p); |
| 235 | s->type=V_ASN1_UTCTIME; | 235 | s->type=V_ASN1_UTCTIME; |
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c index 1bcb44aee2..4d1d6af18d 100644 --- a/src/lib/libcrypto/asn1/asn1_lib.c +++ b/src/lib/libcrypto/asn1/asn1_lib.c | |||
| @@ -464,8 +464,8 @@ void asn1_add_error(const unsigned char *address, int offset) | |||
| 464 | { | 464 | { |
| 465 | char buf1[DECIMAL_SIZE(address)+1],buf2[DECIMAL_SIZE(offset)+1]; | 465 | char buf1[DECIMAL_SIZE(address)+1],buf2[DECIMAL_SIZE(offset)+1]; |
| 466 | 466 | ||
| 467 | BIO_snprintf(buf1,sizeof buf1,"%lu",(unsigned long)address); | 467 | (void) snprintf(buf1,sizeof buf1,"%lu",(unsigned long)address); |
| 468 | BIO_snprintf(buf2,sizeof buf2,"%d",offset); | 468 | (void) snprintf(buf2,sizeof buf2,"%d",offset); |
| 469 | ERR_add_error_data(4,"address=",buf1," offset=",buf2); | 469 | ERR_add_error_data(4,"address=",buf1," offset=",buf2); |
| 470 | } | 470 | } |
| 471 | 471 | ||
diff --git a/src/lib/libcrypto/asn1/asn1_par.c b/src/lib/libcrypto/asn1/asn1_par.c index aaca69aebd..29b0ba46b5 100644 --- a/src/lib/libcrypto/asn1/asn1_par.c +++ b/src/lib/libcrypto/asn1/asn1_par.c | |||
| @@ -82,13 +82,13 @@ static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed, | |||
| 82 | 82 | ||
| 83 | p=str; | 83 | p=str; |
| 84 | if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE) | 84 | if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE) |
| 85 | BIO_snprintf(str,sizeof str,"priv [ %d ] ",tag); | 85 | (void) snprintf(str,sizeof str,"priv [ %d ] ",tag); |
| 86 | else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC) | 86 | else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC) |
| 87 | BIO_snprintf(str,sizeof str,"cont [ %d ]",tag); | 87 | (void) snprintf(str,sizeof str,"cont [ %d ]",tag); |
| 88 | else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION) | 88 | else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION) |
| 89 | BIO_snprintf(str,sizeof str,"appl [ %d ]",tag); | 89 | (void) snprintf(str,sizeof str,"appl [ %d ]",tag); |
| 90 | else if (tag > 30) | 90 | else if (tag > 30) |
| 91 | BIO_snprintf(str,sizeof str,"<ASN1 %d>",tag); | 91 | (void) snprintf(str,sizeof str,"<ASN1 %d>",tag); |
| 92 | else | 92 | else |
| 93 | p = ASN1_tag2str(tag); | 93 | p = ASN1_tag2str(tag); |
| 94 | 94 | ||
