diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2006-03-28 16:35:32 +0200 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2006-03-28 16:35:32 +0200 |
commit | 3e4585c8fd0b23f884d775462736502599146af6 (patch) | |
tree | 27b73970dedcc4215d6f7c4def10ee3990674143 /crypto/dh/dh_prn.c | |
parent | New general public key utility 'pkey'. (diff) | |
download | openssl-3e4585c8fd0b23f884d775462736502599146af6.tar.xz openssl-3e4585c8fd0b23f884d775462736502599146af6.zip |
New utility pkeyparam. Enhance and bugfix algorithm specific parameter
functions to support it.
Diffstat (limited to 'crypto/dh/dh_prn.c')
-rw-r--r-- | crypto/dh/dh_prn.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/crypto/dh/dh_prn.c b/crypto/dh/dh_prn.c index 04e7c55b7a..ae58c2ac87 100644 --- a/crypto/dh/dh_prn.c +++ b/crypto/dh/dh_prn.c @@ -78,47 +78,3 @@ int DHparams_print_fp(FILE *fp, const DH *x) return(ret); } #endif - -int DHparams_print(BIO *bp, const DH *x) - { - unsigned char *m=NULL; - int reason=ERR_R_BUF_LIB,ret=0; - size_t buf_len=0, i; - - if (x->p) - buf_len = (size_t)BN_num_bytes(x->p); - else - { - reason = ERR_R_PASSED_NULL_PARAMETER; - goto err; - } - if (x->g) - if (buf_len < (i = (size_t)BN_num_bytes(x->g))) - buf_len = i; - m=(unsigned char *)OPENSSL_malloc(buf_len+10); - if (m == NULL) - { - reason=ERR_R_MALLOC_FAILURE; - goto err; - } - - if (BIO_printf(bp,"Diffie-Hellman-Parameters: (%d bit)\n", - BN_num_bits(x->p)) <= 0) - goto err; - if (!ASN1_bn_print(bp,"prime:",x->p,m,4)) goto err; - if (!ASN1_bn_print(bp,"generator:",x->g,m,4)) goto err; - if (x->length != 0) - { - if (BIO_printf(bp," recommended-private-length: %d bits\n", - (int)x->length) <= 0) goto err; - } - ret=1; - if (0) - { -err: - DHerr(DH_F_DHPARAMS_PRINT,reason); - } - if (m != NULL) OPENSSL_free(m); - return(ret); - } - |