diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/t_pkey.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/t_pkey.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libcrypto/asn1/t_pkey.c b/src/lib/libcrypto/asn1/t_pkey.c index 9dd18f6579..61f5cd61f1 100644 --- a/src/lib/libcrypto/asn1/t_pkey.c +++ b/src/lib/libcrypto/asn1/t_pkey.c | |||
| @@ -64,7 +64,7 @@ | |||
| 64 | 64 | ||
| 65 | int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, | 65 | int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, |
| 66 | unsigned char *buf, int off) | 66 | unsigned char *buf, int off) |
| 67 | { | 67 | { |
| 68 | int n,i; | 68 | int n,i; |
| 69 | const char *neg; | 69 | const char *neg; |
| 70 | 70 | ||
| @@ -73,20 +73,20 @@ int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *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 | { | 76 | { |
| 77 | if (BIO_printf(bp, "%s 0\n", number) <= 0) | 77 | if (BIO_printf(bp, "%s 0\n", number) <= 0) |
| 78 | return 0; | 78 | return 0; |
| 79 | return 1; | 79 | return 1; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | if (BN_num_bytes(num) <= BN_BYTES) | 82 | if (BN_num_bytes(num) <= BN_BYTES) |
| 83 | { | 83 | { |
| 84 | if (BIO_printf(bp,"%s %s%lu (%s0x%lx)\n",number,neg, | 84 | if (BIO_printf(bp,"%s %s%lu (%s0x%lx)\n",number,neg, |
| 85 | (unsigned long)num->d[0],neg,(unsigned long)num->d[0]) | 85 | (unsigned long)num->d[0],neg,(unsigned long)num->d[0]) |
| 86 | <= 0) return(0); | 86 | <= 0) return(0); |
| 87 | } | 87 | } |
| 88 | else | 88 | else |
| 89 | { | 89 | { |
| 90 | buf[0]=0; | 90 | buf[0]=0; |
| 91 | if (BIO_printf(bp,"%s%s",number, | 91 | if (BIO_printf(bp,"%s%s",number, |
| 92 | (neg[0] == '-')?" (Negative)":"") <= 0) | 92 | (neg[0] == '-')?" (Negative)":"") <= 0) |
| @@ -98,17 +98,17 @@ int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, | |||
| 98 | else buf++; | 98 | else buf++; |
| 99 | 99 | ||
| 100 | for (i=0; i<n; i++) | 100 | for (i=0; i<n; i++) |
| 101 | { | 101 | { |
| 102 | if ((i%15) == 0) | 102 | if ((i%15) == 0) |
| 103 | { | 103 | { |
| 104 | if(BIO_puts(bp,"\n") <= 0 | 104 | if(BIO_puts(bp,"\n") <= 0 |
| 105 | || !BIO_indent(bp,off+4,128)) | 105 | || !BIO_indent(bp,off+4,128)) |
| 106 | return 0; | 106 | return 0; |
| 107 | } | 107 | } |
| 108 | if (BIO_printf(bp,"%02x%s",buf[i],((i+1) == n)?"":":") | 108 | if (BIO_printf(bp,"%02x%s",buf[i],((i+1) == n)?"":":") |
| 109 | <= 0) return(0); | 109 | <= 0) return(0); |
| 110 | } | ||
| 111 | if (BIO_write(bp,"\n",1) <= 0) return(0); | ||
| 112 | } | 110 | } |
| 113 | return(1); | 111 | if (BIO_write(bp,"\n",1) <= 0) return(0); |
| 114 | } | 112 | } |
| 113 | return(1); | ||
| 114 | } | ||
