X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fasn1%2Ft_pkey.c;h=0112f7cced53ef10d3ee63db3854652d87119e45;hb=12f27bd414fbdba8fd6fbda2d3510a6ee718df74;hp=964fd914f7ed3f4e6439ca7563d8bd1ab50439d3;hpb=60cc56b1a937a794c5620eec45f4244461473075;p=oweals%2Fopenssl.git diff --git a/crypto/asn1/t_pkey.c b/crypto/asn1/t_pkey.c index 964fd914f7..0112f7cced 100644 --- a/crypto/asn1/t_pkey.c +++ b/crypto/asn1/t_pkey.c @@ -412,13 +412,31 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off) if (BIO_write(bp, str, off) <= 0) goto err; } - + /* print the 'short name' of the field type */ if (BIO_printf(bp, "Field Type: %s\n", OBJ_nid2sn(tmp_nid)) <= 0) goto err; if (is_char_two) { + /* print the 'short name' of the base type OID */ + int basis_type = EC_GROUP_get_basis_type(x); + if (basis_type == 0) + goto err; + + if (off) + { + if (off > 128) off=128; + memset(str,' ',off); + if (BIO_write(bp, str, off) <= 0) + goto err; + } + + if (BIO_printf(bp, "Basis Type: %s\n", + OBJ_nid2sn(basis_type)) <= 0) + goto err; + + /* print the polynomial */ if ((p != NULL) && !print(bp, "Polynomial:", p, buffer, off)) goto err; @@ -565,6 +583,13 @@ static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf, if (BIO_write(bp,str,off) <= 0) return(0); } + if (BN_is_zero(num)) + { + if (BIO_printf(bp, "%s 0\n", number) <= 0) + return 0; + return 1; + } + if (BN_num_bytes(num) <= BN_BYTES) { if (BIO_printf(bp,"%s %s%lu (%s0x%lx)\n",number,neg,