From 8cbe58f0d357b14b0ce292d336469d0554a567bc Mon Sep 17 00:00:00 2001 From: miod <> Date: Wed, 9 Jul 2014 08:20:08 +0000 Subject: KNF --- src/lib/libcrypto/rsa/rsa_prn.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/lib/libcrypto/rsa/rsa_prn.c') diff --git a/src/lib/libcrypto/rsa/rsa_prn.c b/src/lib/libcrypto/rsa/rsa_prn.c index 2d7bcb62b0..89cf2b45b0 100644 --- a/src/lib/libcrypto/rsa/rsa_prn.c +++ b/src/lib/libcrypto/rsa/rsa_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_prn.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: rsa_prn.c,v 1.4 2014/07/09 08:20:08 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -61,31 +61,32 @@ #include #include -int RSA_print_fp(FILE *fp, const RSA *x, int off) - { +int +RSA_print_fp(FILE *fp, const RSA *x, int off) +{ BIO *b; int ret; - if ((b=BIO_new(BIO_s_file())) == NULL) - { - RSAerr(RSA_F_RSA_PRINT_FP,ERR_R_BUF_LIB); - return(0); - } - BIO_set_fp(b,fp,BIO_NOCLOSE); - ret=RSA_print(b,x,off); - BIO_free(b); - return(ret); + if ((b = BIO_new(BIO_s_file())) == NULL) { + RSAerr(RSA_F_RSA_PRINT_FP, ERR_R_BUF_LIB); + return 0; } + BIO_set_fp(b, fp, BIO_NOCLOSE); + ret = RSA_print(b, x, off); + BIO_free(b); + return ret; +} -int RSA_print(BIO *bp, const RSA *x, int off) - { +int +RSA_print(BIO *bp, const RSA *x, int off) +{ EVP_PKEY *pk; int ret; + pk = EVP_PKEY_new(); if (!pk || !EVP_PKEY_set1_RSA(pk, (RSA *)x)) return 0; ret = EVP_PKEY_print_private(bp, pk, off, NULL); EVP_PKEY_free(pk); return ret; - } - +} -- cgit v1.2.3-55-g6feb