From 30a9e395f6ab6a5767151ca9805a33262b3acbe0 Mon Sep 17 00:00:00 2001 From: miod <> Date: Wed, 9 Jul 2014 10:16:24 +0000 Subject: KNF --- src/lib/libcrypto/dsa/dsa_prn.c | 63 +++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 30 deletions(-) (limited to 'src/lib/libcrypto/dsa/dsa_prn.c') diff --git a/src/lib/libcrypto/dsa/dsa_prn.c b/src/lib/libcrypto/dsa/dsa_prn.c index e730c1a092..5a7423c831 100644 --- a/src/lib/libcrypto/dsa/dsa_prn.c +++ b/src/lib/libcrypto/dsa/dsa_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_prn.c,v 1.3 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: dsa_prn.c,v 1.4 2014/07/09 10:16:24 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -61,59 +61,62 @@ #include #include -int DSA_print_fp(FILE *fp, const DSA *x, int off) - { +int +DSA_print_fp(FILE *fp, const DSA *x, int off) +{ BIO *b; int ret; - if ((b=BIO_new(BIO_s_file())) == NULL) - { - DSAerr(DSA_F_DSA_PRINT_FP,ERR_R_BUF_LIB); - return(0); - } - BIO_set_fp(b,fp,BIO_NOCLOSE); - ret=DSA_print(b,x,off); - BIO_free(b); - return(ret); + if ((b = BIO_new(BIO_s_file())) == NULL) { + DSAerr(DSA_F_DSA_PRINT_FP, ERR_R_BUF_LIB); + return 0; } + BIO_set_fp(b, fp, BIO_NOCLOSE); + ret = DSA_print(b, x, off); + BIO_free(b); + return ret; +} -int DSAparams_print_fp(FILE *fp, const DSA *x) - { +int +DSAparams_print_fp(FILE *fp, const DSA *x) +{ BIO *b; int ret; - if ((b=BIO_new(BIO_s_file())) == NULL) - { - DSAerr(DSA_F_DSAPARAMS_PRINT_FP,ERR_R_BUF_LIB); - return(0); - } - BIO_set_fp(b,fp,BIO_NOCLOSE); - ret=DSAparams_print(b, x); - BIO_free(b); - return(ret); + if ((b = BIO_new(BIO_s_file())) == NULL) { + DSAerr(DSA_F_DSAPARAMS_PRINT_FP, ERR_R_BUF_LIB); + return 0; } + BIO_set_fp(b, fp, BIO_NOCLOSE); + ret = DSAparams_print(b, x); + BIO_free(b); + return ret; +} -int DSA_print(BIO *bp, const DSA *x, int off) - { +int +DSA_print(BIO *bp, const DSA *x, int off) +{ EVP_PKEY *pk; int ret; + pk = EVP_PKEY_new(); if (!pk || !EVP_PKEY_set1_DSA(pk, (DSA *)x)) return 0; ret = EVP_PKEY_print_private(bp, pk, off, NULL); EVP_PKEY_free(pk); return ret; - } +} -int DSAparams_print(BIO *bp, const DSA *x) - { +int +DSAparams_print(BIO *bp, const DSA *x) +{ EVP_PKEY *pk; int ret; + pk = EVP_PKEY_new(); if (!pk || !EVP_PKEY_set1_DSA(pk, (DSA *)x)) return 0; ret = EVP_PKEY_print_params(bp, pk, 4, NULL); EVP_PKEY_free(pk); return ret; - } - +} -- cgit v1.2.3-55-g6feb