summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2013-08-02 14:40:00 +0100
committerDr. Stephen Henson <steve@openssl.org>2013-10-01 14:01:17 +0100
commit52d0e1ca4e61260d51408b00d4d8589d6f18c9b4 (patch)
tree3fb326137095f4d708285ed9bdf5cfaa775c5af4
parentc6f338657758d5f83c25912bed94ab4fd5058168 (diff)
downloadopenssl-new-52d0e1ca4e61260d51408b00d4d8589d6f18c9b4.tar.gz
If present print j, seed and counter values for DH
(cherry picked from commit c9577ab5eae56cb00c17a0eb724229f0bc1397a0) Conflicts: crypto/dh/dh_ameth.c
-rw-r--r--crypto/dh/dh_ameth.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c
index 7d1254ecd8..2841225f83 100644
--- a/crypto/dh/dh_ameth.c
+++ b/crypto/dh/dh_ameth.c
@@ -363,6 +363,9 @@ static int do_dh_print(BIO *bp, const DH *x, int indent,
}
update_buflen(x->g, &buf_len);
+ update_buflen(x->q, &buf_len);
+ update_buflen(x->j, &buf_len);
+ update_buflen(x->counter, &buf_len);
update_buflen(pub_key, &buf_len);
update_buflen(priv_key, &buf_len);
@@ -390,6 +393,30 @@ static int do_dh_print(BIO *bp, const DH *x, int indent,
if (!ASN1_bn_print(bp,"prime:",x->p,m,indent)) goto err;
if (!ASN1_bn_print(bp,"generator:",x->g,m,indent)) goto err;
+ if (x->q && !ASN1_bn_print(bp,"subgroup order:",x->q,m,indent)) goto err;
+ if (x->j && !ASN1_bn_print(bp,"subgroup factor:",x->j,m,indent))
+ goto err;
+ if (x->seed)
+ {
+ int i;
+ BIO_indent(bp, indent, 128);
+ BIO_puts(bp, "seed:");
+ for (i=0; i < x->seedlen; i++)
+ {
+ if ((i%15) == 0)
+ {
+ if(BIO_puts(bp,"\n") <= 0
+ || !BIO_indent(bp,indent+4,128))
+ goto err;
+ }
+ if (BIO_printf(bp,"%02x%s", x->seed[i],
+ ((i+1) == x->seedlen)?"":":") <= 0)
+ goto err;
+ }
+ if (BIO_write(bp,"\n",1) <= 0) return(0);
+ }
+ if (x->counter && !ASN1_bn_print(bp,"counter:",x->counter,m,indent))
+ goto err;
if (x->length != 0)
{
BIO_indent(bp, indent, 128);