diff options
author | tedu <> | 2014-04-18 00:58:49 +0000 |
---|---|---|
committer | tedu <> | 2014-04-18 00:58:49 +0000 |
commit | a1df5b66c7ad477a535e56a504d8da47e1998cfa (patch) | |
tree | b216ca6fba673789f2c494699c4cf41d23337bfa /src/lib/libcrypto/asn1/t_pkey.c | |
parent | 07f5c09b19f56c323fa22ebd5efb5a4df9f5dc4d (diff) | |
download | openbsd-a1df5b66c7ad477a535e56a504d8da47e1998cfa.tar.gz openbsd-a1df5b66c7ad477a535e56a504d8da47e1998cfa.tar.bz2 openbsd-a1df5b66c7ad477a535e56a504d8da47e1998cfa.zip |
lob a few more knf grenades in here to soften things up.
Diffstat (limited to 'src/lib/libcrypto/asn1/t_pkey.c')
-rw-r--r-- | src/lib/libcrypto/asn1/t_pkey.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/lib/libcrypto/asn1/t_pkey.c b/src/lib/libcrypto/asn1/t_pkey.c index 61f5cd61f1..12674e0125 100644 --- a/src/lib/libcrypto/asn1/t_pkey.c +++ b/src/lib/libcrypto/asn1/t_pkey.c | |||
@@ -72,21 +72,17 @@ int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, | |||
72 | neg = (BN_is_negative(num))?"-":""; | 72 | neg = (BN_is_negative(num))?"-":""; |
73 | if(!BIO_indent(bp,off,128)) | 73 | if(!BIO_indent(bp,off,128)) |
74 | return 0; | 74 | return 0; |
75 | if (BN_is_zero(num)) | 75 | if (BN_is_zero(num)) { |
76 | { | ||
77 | if (BIO_printf(bp, "%s 0\n", number) <= 0) | 76 | if (BIO_printf(bp, "%s 0\n", number) <= 0) |
78 | return 0; | 77 | return 0; |
79 | return 1; | 78 | return 1; |
80 | } | 79 | } |
81 | 80 | ||
82 | if (BN_num_bytes(num) <= BN_BYTES) | 81 | if (BN_num_bytes(num) <= BN_BYTES) { |
83 | { | ||
84 | if (BIO_printf(bp,"%s %s%lu (%s0x%lx)\n",number,neg, | 82 | if (BIO_printf(bp,"%s %s%lu (%s0x%lx)\n",number,neg, |
85 | (unsigned long)num->d[0],neg,(unsigned long)num->d[0]) | 83 | (unsigned long)num->d[0],neg,(unsigned long)num->d[0]) |
86 | <= 0) return(0); | 84 | <= 0) return(0); |
87 | } | 85 | } else { |
88 | else | ||
89 | { | ||
90 | buf[0]=0; | 86 | buf[0]=0; |
91 | if (BIO_printf(bp,"%s%s",number, | 87 | if (BIO_printf(bp,"%s%s",number, |
92 | (neg[0] == '-')?" (Negative)":"") <= 0) | 88 | (neg[0] == '-')?" (Negative)":"") <= 0) |
@@ -97,10 +93,8 @@ int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, | |||
97 | n++; | 93 | n++; |
98 | else buf++; | 94 | else buf++; |
99 | 95 | ||
100 | for (i=0; i<n; i++) | 96 | for (i=0; i<n; i++) { |
101 | { | 97 | if ((i%15) == 0) { |
102 | if ((i%15) == 0) | ||
103 | { | ||
104 | if(BIO_puts(bp,"\n") <= 0 | 98 | if(BIO_puts(bp,"\n") <= 0 |
105 | || !BIO_indent(bp,off+4,128)) | 99 | || !BIO_indent(bp,off+4,128)) |
106 | return 0; | 100 | return 0; |