| OLD | NEW |
| 1 /* crypto/asn1/t_req.c */ | 1 /* crypto/asn1/t_req.c */ |
| 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
| 6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
| 7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
| 8 * | 8 * |
| 9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
| 10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 if (BIO_puts(bp, "\n") <= 0) | 142 if (BIO_puts(bp, "\n") <= 0) |
| 143 goto err; | 143 goto err; |
| 144 | 144 |
| 145 pkey=X509_REQ_get_pubkey(x); | 145 pkey=X509_REQ_get_pubkey(x); |
| 146 if (pkey == NULL) | 146 if (pkey == NULL) |
| 147 { | 147 { |
| 148 BIO_printf(bp,"%12sUnable to load Public Key\n",""); | 148 BIO_printf(bp,"%12sUnable to load Public Key\n",""); |
| 149 ERR_print_errors(bp); | 149 ERR_print_errors(bp); |
| 150 } | 150 } |
| 151 else | 151 else |
| 152 #ifndef OPENSSL_NO_RSA | |
| 153 if (pkey->type == EVP_PKEY_RSA) | |
| 154 { | 152 { |
| 155 » » » BIO_printf(bp,"%12sRSA Public Key: (%d bit)\n","", | 153 » » » EVP_PKEY_print_public(bp, pkey, 16, NULL); |
| 156 » » » BN_num_bits(pkey->pkey.rsa->n)); | 154 » » » EVP_PKEY_free(pkey); |
| 157 » » » RSA_print(bp,pkey->pkey.rsa,16); | |
| 158 } | 155 } |
| 159 else | |
| 160 #endif | |
| 161 #ifndef OPENSSL_NO_DSA | |
| 162 if (pkey->type == EVP_PKEY_DSA) | |
| 163 { | |
| 164 BIO_printf(bp,"%12sDSA Public Key:\n",""); | |
| 165 DSA_print(bp,pkey->pkey.dsa,16); | |
| 166 } | |
| 167 else | |
| 168 #endif | |
| 169 #ifndef OPENSSL_NO_EC | |
| 170 if (pkey->type == EVP_PKEY_EC) | |
| 171 { | |
| 172 BIO_printf(bp, "%12sEC Public Key: \n",""); | |
| 173 EC_KEY_print(bp, pkey->pkey.ec, 16); | |
| 174 } | |
| 175 else | |
| 176 #endif | |
| 177 BIO_printf(bp,"%12sUnknown Public Key:\n",""); | |
| 178 | |
| 179 EVP_PKEY_free(pkey); | |
| 180 } | 156 } |
| 181 | 157 |
| 182 if(!(cflag & X509_FLAG_NO_ATTRIBUTES)) | 158 if(!(cflag & X509_FLAG_NO_ATTRIBUTES)) |
| 183 { | 159 { |
| 184 /* may not be */ | 160 /* may not be */ |
| 185 if(BIO_printf(bp,"%8sAttributes:\n","") <= 0) | 161 if(BIO_printf(bp,"%8sAttributes:\n","") <= 0) |
| 186 goto err; | 162 goto err; |
| 187 | 163 |
| 188 sk=x->req_info->attributes; | 164 sk=x->req_info->attributes; |
| 189 if (sk_X509_ATTRIBUTE_num(sk) == 0) | 165 if (sk_X509_ATTRIBUTE_num(sk) == 0) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 return(1); | 257 return(1); |
| 282 err: | 258 err: |
| 283 X509err(X509_F_X509_REQ_PRINT_EX,ERR_R_BUF_LIB); | 259 X509err(X509_F_X509_REQ_PRINT_EX,ERR_R_BUF_LIB); |
| 284 return(0); | 260 return(0); |
| 285 } | 261 } |
| 286 | 262 |
| 287 int X509_REQ_print(BIO *bp, X509_REQ *x) | 263 int X509_REQ_print(BIO *bp, X509_REQ *x) |
| 288 { | 264 { |
| 289 return X509_REQ_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); | 265 return X509_REQ_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); |
| 290 } | 266 } |
| OLD | NEW |