diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/t_pkey.c')
-rw-r--r-- | src/lib/libcrypto/asn1/t_pkey.c | 71 |
1 files changed, 20 insertions, 51 deletions
diff --git a/src/lib/libcrypto/asn1/t_pkey.c b/src/lib/libcrypto/asn1/t_pkey.c index bc518d59a2..0dc6e30c3d 100644 --- a/src/lib/libcrypto/asn1/t_pkey.c +++ b/src/lib/libcrypto/asn1/t_pkey.c | |||
@@ -58,35 +58,23 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "buffer.h" | 61 | #include <openssl/buffer.h> |
62 | #include "bn.h" | 62 | #include <openssl/bn.h> |
63 | #ifndef NO_RSA | 63 | #ifndef NO_RSA |
64 | #include "rsa.h" | 64 | #include <openssl/rsa.h> |
65 | #endif | 65 | #endif |
66 | #ifndef NO_DH | 66 | #ifndef NO_DH |
67 | #include "dh.h" | 67 | #include <openssl/dh.h> |
68 | #endif | 68 | #endif |
69 | #ifndef NO_DSA | 69 | #ifndef NO_DSA |
70 | #include "dsa.h" | 70 | #include <openssl/dsa.h> |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | /* DHerr(DH_F_DHPARAMS_PRINT,ERR_R_MALLOC_FAILURE); | 73 | static int print(BIO *fp,const char *str,BIGNUM *num, |
74 | * DSAerr(DSA_F_DSAPARAMS_PRINT,ERR_R_MALLOC_FAILURE); | ||
75 | */ | ||
76 | |||
77 | #ifndef NOPROTO | ||
78 | static int print(BIO *fp,char *str,BIGNUM *num, | ||
79 | unsigned char *buf,int off); | 74 | unsigned char *buf,int off); |
80 | #else | ||
81 | static int print(); | ||
82 | #endif | ||
83 | |||
84 | #ifndef NO_RSA | 75 | #ifndef NO_RSA |
85 | #ifndef NO_FP_API | 76 | #ifndef NO_FP_API |
86 | int RSA_print_fp(fp,x,off) | 77 | int RSA_print_fp(FILE *fp, RSA *x, int off) |
87 | FILE *fp; | ||
88 | RSA *x; | ||
89 | int off; | ||
90 | { | 78 | { |
91 | BIO *b; | 79 | BIO *b; |
92 | int ret; | 80 | int ret; |
@@ -103,12 +91,10 @@ int off; | |||
103 | } | 91 | } |
104 | #endif | 92 | #endif |
105 | 93 | ||
106 | int RSA_print(bp,x,off) | 94 | int RSA_print(BIO *bp, RSA *x, int off) |
107 | BIO *bp; | ||
108 | RSA *x; | ||
109 | int off; | ||
110 | { | 95 | { |
111 | char str[128],*s; | 96 | char str[128]; |
97 | const char *s; | ||
112 | unsigned char *m=NULL; | 98 | unsigned char *m=NULL; |
113 | int i,ret=0; | 99 | int i,ret=0; |
114 | 100 | ||
@@ -154,10 +140,7 @@ err: | |||
154 | 140 | ||
155 | #ifndef NO_DSA | 141 | #ifndef NO_DSA |
156 | #ifndef NO_FP_API | 142 | #ifndef NO_FP_API |
157 | int DSA_print_fp(fp,x,off) | 143 | int DSA_print_fp(FILE *fp, DSA *x, int off) |
158 | FILE *fp; | ||
159 | DSA *x; | ||
160 | int off; | ||
161 | { | 144 | { |
162 | BIO *b; | 145 | BIO *b; |
163 | int ret; | 146 | int ret; |
@@ -174,10 +157,7 @@ int off; | |||
174 | } | 157 | } |
175 | #endif | 158 | #endif |
176 | 159 | ||
177 | int DSA_print(bp,x,off) | 160 | int DSA_print(BIO *bp, DSA *x, int off) |
178 | BIO *bp; | ||
179 | DSA *x; | ||
180 | int off; | ||
181 | { | 161 | { |
182 | char str[128]; | 162 | char str[128]; |
183 | unsigned char *m=NULL; | 163 | unsigned char *m=NULL; |
@@ -229,15 +209,12 @@ err: | |||
229 | } | 209 | } |
230 | #endif /* !NO_DSA */ | 210 | #endif /* !NO_DSA */ |
231 | 211 | ||
232 | static int print(bp,number,num,buf,off) | 212 | static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf, |
233 | BIO *bp; | 213 | int off) |
234 | char *number; | ||
235 | BIGNUM *num; | ||
236 | unsigned char *buf; | ||
237 | int off; | ||
238 | { | 214 | { |
239 | int n,i; | 215 | int n,i; |
240 | char str[128],*neg; | 216 | char str[128]; |
217 | const char *neg; | ||
241 | 218 | ||
242 | if (num == NULL) return(1); | 219 | if (num == NULL) return(1); |
243 | neg=(num->neg)?"-":""; | 220 | neg=(num->neg)?"-":""; |
@@ -284,9 +261,7 @@ int off; | |||
284 | 261 | ||
285 | #ifndef NO_DH | 262 | #ifndef NO_DH |
286 | #ifndef NO_FP_API | 263 | #ifndef NO_FP_API |
287 | int DHparams_print_fp(fp,x) | 264 | int DHparams_print_fp(FILE *fp, DH *x) |
288 | FILE *fp; | ||
289 | DH *x; | ||
290 | { | 265 | { |
291 | BIO *b; | 266 | BIO *b; |
292 | int ret; | 267 | int ret; |
@@ -303,9 +278,7 @@ DH *x; | |||
303 | } | 278 | } |
304 | #endif | 279 | #endif |
305 | 280 | ||
306 | int DHparams_print(bp,x) | 281 | int DHparams_print(BIO *bp, DH *x) |
307 | BIO *bp; | ||
308 | DH *x; | ||
309 | { | 282 | { |
310 | unsigned char *m=NULL; | 283 | unsigned char *m=NULL; |
311 | int reason=ERR_R_BUF_LIB,i,ret=0; | 284 | int reason=ERR_R_BUF_LIB,i,ret=0; |
@@ -341,9 +314,7 @@ err: | |||
341 | 314 | ||
342 | #ifndef NO_DSA | 315 | #ifndef NO_DSA |
343 | #ifndef NO_FP_API | 316 | #ifndef NO_FP_API |
344 | int DSAparams_print_fp(fp,x) | 317 | int DSAparams_print_fp(FILE *fp, DSA *x) |
345 | FILE *fp; | ||
346 | DSA *x; | ||
347 | { | 318 | { |
348 | BIO *b; | 319 | BIO *b; |
349 | int ret; | 320 | int ret; |
@@ -360,9 +331,7 @@ DSA *x; | |||
360 | } | 331 | } |
361 | #endif | 332 | #endif |
362 | 333 | ||
363 | int DSAparams_print(bp,x) | 334 | int DSAparams_print(BIO *bp, DSA *x) |
364 | BIO *bp; | ||
365 | DSA *x; | ||
366 | { | 335 | { |
367 | unsigned char *m=NULL; | 336 | unsigned char *m=NULL; |
368 | int reason=ERR_R_BUF_LIB,i,ret=0; | 337 | int reason=ERR_R_BUF_LIB,i,ret=0; |