OLD | NEW |
1 /* crypto/pem/pem.h */ | 1 /* crypto/pem/pem.h */ |
2 /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1997 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 #define PEM_STRING_PKCS7 "PKCS7" | 127 #define PEM_STRING_PKCS7 "PKCS7" |
128 #define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" | 128 #define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" |
129 #define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" | 129 #define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" |
130 #define PEM_STRING_PKCS8INF "PRIVATE KEY" | 130 #define PEM_STRING_PKCS8INF "PRIVATE KEY" |
131 #define PEM_STRING_DHPARAMS "DH PARAMETERS" | 131 #define PEM_STRING_DHPARAMS "DH PARAMETERS" |
132 #define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" | 132 #define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" |
133 #define PEM_STRING_DSAPARAMS "DSA PARAMETERS" | 133 #define PEM_STRING_DSAPARAMS "DSA PARAMETERS" |
134 #define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" | 134 #define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" |
135 #define PEM_STRING_ECPARAMETERS "EC PARAMETERS" | 135 #define PEM_STRING_ECPARAMETERS "EC PARAMETERS" |
136 #define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" | 136 #define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" |
| 137 #define PEM_STRING_PARAMETERS "PARAMETERS" |
137 #define PEM_STRING_CMS "CMS" | 138 #define PEM_STRING_CMS "CMS" |
138 | 139 |
139 /* Note that this structure is initialised by PEM_SealInit and cleaned up | 140 /* Note that this structure is initialised by PEM_SealInit and cleaned up |
140 by PEM_SealFinal (at least for now) */ | 141 by PEM_SealFinal (at least for now) */ |
141 typedef struct PEM_Encode_Seal_st | 142 typedef struct PEM_Encode_Seal_st |
142 { | 143 { |
143 EVP_ENCODE_CTX encode; | 144 EVP_ENCODE_CTX encode; |
144 EVP_MD_CTX md; | 145 EVP_MD_CTX md; |
145 EVP_CIPHER_CTX cipher; | 146 EVP_CIPHER_CTX cipher; |
146 } PEM_ENCODE_SEAL_CTX; | 147 } PEM_ENCODE_SEAL_CTX; |
(...skipping 29 matching lines...) Expand all Loading... |
176 int cipher; | 177 int cipher; |
177 /* unused, and wrong size | 178 /* unused, and wrong size |
178 unsigned char iv[8]; */ | 179 unsigned char iv[8]; */ |
179 } DEK_info; | 180 } DEK_info; |
180 | 181 |
181 PEM_USER *originator; | 182 PEM_USER *originator; |
182 | 183 |
183 int num_recipient; | 184 int num_recipient; |
184 PEM_USER **recipient; | 185 PEM_USER **recipient; |
185 | 186 |
186 #ifndef OPENSSL_NO_STACK | 187 » /* XXX(ben): don#t think this is used! |
187 » STACK *x509_chain;» /* certificate chain */ | 188 » » STACK *x509_chain;» / * certificate chain */ |
188 #else | |
189 » char *x509_chain;» /* certificate chain */ | |
190 #endif | |
191 EVP_MD *md; /* signature type */ | 189 EVP_MD *md; /* signature type */ |
192 | 190 |
193 int md_enc; /* is the md encrypted or not? */ | 191 int md_enc; /* is the md encrypted or not? */ |
194 int md_len; /* length of md_data */ | 192 int md_len; /* length of md_data */ |
195 char *md_data; /* message digest, could be pkey encrypted */ | 193 char *md_data; /* message digest, could be pkey encrypted */ |
196 | 194 |
197 EVP_CIPHER *dec; /* date encryption cipher */ | 195 EVP_CIPHER *dec; /* date encryption cipher */ |
198 int key_len; /* key length */ | 196 int key_len; /* key length */ |
199 unsigned char *key; /* key */ | 197 unsigned char *key; /* key */ |
200 /* unused, and wrong size | 198 /* unused, and wrong size |
(...skipping 16 matching lines...) Expand all Loading... |
217 #define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ | 215 #define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ |
218 #define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ | 216 #define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ |
219 #define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ | 217 #define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ |
220 #define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ | 218 #define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ |
221 | 219 |
222 #else | 220 #else |
223 | 221 |
224 #define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ | 222 #define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ |
225 type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ | 223 type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ |
226 { \ | 224 { \ |
227 return (type*)PEM_ASN1_read(CHECKED_D2I_OF(type, d2i_##asn1), \ | 225 return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str,fp,(void **)x,cb,u); \ |
228 » » » » str, fp, \ | |
229 » » » » CHECKED_PPTR_OF(type, x), \ | |
230 » » » » cb, u); \ | |
231 } | 226 } |
232 | 227 |
233 #define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ | 228 #define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ |
234 int PEM_write_##name(FILE *fp, type *x) \ | 229 int PEM_write_##name(FILE *fp, type *x) \ |
235 { \ | 230 { \ |
236 return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \ | 231 return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL);
\ |
237 » » » str, fp, \ | |
238 » » » CHECKED_PTR_OF(type, x), \ | |
239 » » » NULL, NULL, 0, NULL, NULL); \ | |
240 } | 232 } |
241 | 233 |
242 #define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ | 234 #define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ |
243 int PEM_write_##name(FILE *fp, const type *x) \ | 235 int PEM_write_##name(FILE *fp, const type *x) \ |
244 { \ | 236 { \ |
245 return PEM_ASN1_write(CHECKED_I2D_OF(const type, i2d_##asn1), \ | 237 return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(void *)x,NULL,NULL,0,NUL
L,NULL); \ |
246 » » » str, fp, \ | |
247 » » » CHECKED_PTR_OF(const type, x), \ | |
248 » » » NULL, NULL, 0, NULL, NULL); \ | |
249 } | 238 } |
250 | 239 |
251 #define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ | 240 #define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ |
252 int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ | 241 int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ |
253 unsigned char *kstr, int klen, pem_password_cb *cb, \ | 242 unsigned char *kstr, int klen, pem_password_cb *cb, \ |
254 void *u) \ | 243 void *u) \ |
255 { \ | 244 { \ |
256 » return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \ | 245 » return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,c
b,u); \ |
257 » » » » str, fp, \ | |
258 » » » » CHECKED_PTR_OF(type, x), \ | |
259 » » » » enc, kstr, klen, cb, u); \ | |
260 } | 246 } |
261 | 247 |
262 #define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ | 248 #define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ |
263 int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ | 249 int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ |
264 unsigned char *kstr, int klen, pem_password_cb *cb, \ | 250 unsigned char *kstr, int klen, pem_password_cb *cb, \ |
265 void *u) \ | 251 void *u) \ |
266 { \ | 252 { \ |
267 » return PEM_ASN1_write(CHECKED_I2D_OF(const type, i2d_##asn1), \ | 253 » return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,c
b,u); \ |
268 » » » » str, fp, \ | |
269 » » » » CHECKED_PTR_OF(const type, x), \ | |
270 » » » » enc, kstr, klen, cb, u); \ | |
271 } | 254 } |
272 | 255 |
273 #endif | 256 #endif |
274 | 257 |
275 #define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ | 258 #define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ |
276 type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ | 259 type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ |
277 { \ | 260 { \ |
278 return (type*)PEM_ASN1_read_bio(CHECKED_D2I_OF(type, d2i_##asn1), \ | 261 return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \ |
279 » » » » str, bp, \ | |
280 » » » » CHECKED_PPTR_OF(type, x), \ | |
281 » » » » cb, u); \ | |
282 } | 262 } |
283 | 263 |
284 #define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ | 264 #define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ |
285 int PEM_write_bio_##name(BIO *bp, type *x) \ | 265 int PEM_write_bio_##name(BIO *bp, type *x) \ |
286 { \ | 266 { \ |
287 return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \ | 267 return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NU
LL); \ |
288 » » » str, bp, \ | |
289 » » » CHECKED_PTR_OF(type, x), \ | |
290 » » » NULL, NULL, 0, NULL, NULL); \ | |
291 } | 268 } |
292 | 269 |
293 #define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ | 270 #define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ |
294 int PEM_write_bio_##name(BIO *bp, const type *x) \ | 271 int PEM_write_bio_##name(BIO *bp, const type *x) \ |
295 { \ | 272 { \ |
296 return PEM_ASN1_write_bio(CHECKED_I2D_OF(const type, i2d_##asn1), \ | 273 return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,NULL,NULL,0
,NULL,NULL); \ |
297 » » » str, bp, \ | |
298 » » » CHECKED_PTR_OF(const type, x), \ | |
299 » » » NULL, NULL, 0, NULL, NULL); \ | |
300 } | 274 } |
301 | 275 |
302 #define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ | 276 #define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ |
303 int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ | 277 int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ |
304 unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ | 278 unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ |
305 { \ | 279 { \ |
306 » return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \ | 280 » return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,enc,kstr,kl
en,cb,u); \ |
307 » » » » str, bp, \ | |
308 » » » » CHECKED_PTR_OF(type, x), \ | |
309 » » » » enc, kstr, klen, cb, u); \ | |
310 } | 281 } |
311 | 282 |
312 #define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ | 283 #define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ |
313 int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ | 284 int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ |
314 unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ | 285 unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ |
315 { \ | 286 { \ |
316 » return PEM_ASN1_write_bio(CHECKED_I2D_OF(const type, i2d_##asn1), \ | 287 » return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,enc
,kstr,klen,cb,u); \ |
317 » » » » str, bp, \ | |
318 » » » » CHECKED_PTR_OF(const type, x), \ | |
319 » » » » enc, kstr, klen, cb, u); \ | |
320 } | 288 } |
321 | 289 |
322 #define IMPLEMENT_PEM_write(name, type, str, asn1) \ | 290 #define IMPLEMENT_PEM_write(name, type, str, asn1) \ |
323 IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ | 291 IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ |
324 IMPLEMENT_PEM_write_fp(name, type, str, asn1) | 292 IMPLEMENT_PEM_write_fp(name, type, str, asn1) |
325 | 293 |
326 #define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ | 294 #define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ |
327 IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ | 295 IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ |
328 IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) | 296 IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) |
329 | 297 |
(...skipping 16 matching lines...) Expand all Loading... |
346 #define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ | 314 #define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ |
347 IMPLEMENT_PEM_read(name, type, str, asn1) \ | 315 IMPLEMENT_PEM_read(name, type, str, asn1) \ |
348 IMPLEMENT_PEM_write_const(name, type, str, asn1) | 316 IMPLEMENT_PEM_write_const(name, type, str, asn1) |
349 | 317 |
350 #define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ | 318 #define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ |
351 IMPLEMENT_PEM_read(name, type, str, asn1) \ | 319 IMPLEMENT_PEM_read(name, type, str, asn1) \ |
352 IMPLEMENT_PEM_write_cb(name, type, str, asn1) | 320 IMPLEMENT_PEM_write_cb(name, type, str, asn1) |
353 | 321 |
354 /* These are the same except they are for the declarations */ | 322 /* These are the same except they are for the declarations */ |
355 | 323 |
356 #if defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_NO_FP_API) | 324 #if defined(OPENSSL_NO_FP_API) |
357 | 325 |
358 #define DECLARE_PEM_read_fp(name, type) /**/ | 326 #define DECLARE_PEM_read_fp(name, type) /**/ |
359 #define DECLARE_PEM_write_fp(name, type) /**/ | 327 #define DECLARE_PEM_write_fp(name, type) /**/ |
360 #define DECLARE_PEM_write_fp_const(name, type) /**/ | |
361 #define DECLARE_PEM_write_cb_fp(name, type) /**/ | 328 #define DECLARE_PEM_write_cb_fp(name, type) /**/ |
362 | 329 |
363 #else | 330 #else |
364 | 331 |
365 #define DECLARE_PEM_read_fp(name, type) \ | 332 #define DECLARE_PEM_read_fp(name, type) \ |
366 type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); | 333 type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); |
367 | 334 |
368 #define DECLARE_PEM_write_fp(name, type) \ | 335 #define DECLARE_PEM_write_fp(name, type) \ |
369 int PEM_write_##name(FILE *fp, type *x); | 336 int PEM_write_##name(FILE *fp, type *x); |
370 | 337 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 DECLARE_PEM_write(name, type) | 388 DECLARE_PEM_write(name, type) |
422 | 389 |
423 #define DECLARE_PEM_rw_const(name, type) \ | 390 #define DECLARE_PEM_rw_const(name, type) \ |
424 DECLARE_PEM_read(name, type) \ | 391 DECLARE_PEM_read(name, type) \ |
425 DECLARE_PEM_write_const(name, type) | 392 DECLARE_PEM_write_const(name, type) |
426 | 393 |
427 #define DECLARE_PEM_rw_cb(name, type) \ | 394 #define DECLARE_PEM_rw_cb(name, type) \ |
428 DECLARE_PEM_read(name, type) \ | 395 DECLARE_PEM_read(name, type) \ |
429 DECLARE_PEM_write_cb(name, type) | 396 DECLARE_PEM_write_cb(name, type) |
430 | 397 |
431 #ifdef SSLEAY_MACROS | |
432 | |
433 #define PEM_write_SSL_SESSION(fp,x) \ | |
434 PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \ | |
435 PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,N
ULL) | |
436 #define PEM_write_X509(fp,x) \ | |
437 PEM_ASN1_write((int (*)())i2d_X509,PEM_STRING_X509,fp, \ | |
438 (char *)x, NULL,NULL,0,NULL,NULL) | |
439 #define PEM_write_X509_REQ(fp,x) PEM_ASN1_write( \ | |
440 (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,fp,(char *)x, \ | |
441 NULL,NULL,0,NULL,NULL) | |
442 #define PEM_write_X509_CRL(fp,x) \ | |
443 PEM_ASN1_write((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL, \ | |
444 fp,(char *)x, NULL,NULL,0,NULL,NULL) | |
445 #define PEM_write_RSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \ | |
446 PEM_ASN1_write((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,fp,\ | |
447 (char *)x,enc,kstr,klen,cb,u) | |
448 #define PEM_write_RSAPublicKey(fp,x) \ | |
449 PEM_ASN1_write((int (*)())i2d_RSAPublicKey,\ | |
450 PEM_STRING_RSA_PUBLIC,fp,(char *)x,NULL,NULL,0,NULL,NULL
) | |
451 #define PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \ | |
452 PEM_ASN1_write((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,fp,\ | |
453 (char *)x,enc,kstr,klen,cb,u) | |
454 #define PEM_write_PrivateKey(bp,x,enc,kstr,klen,cb,u) \ | |
455 PEM_ASN1_write((int (*)())i2d_PrivateKey,\ | |
456 (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\ | |
457 bp,(char *)x,enc,kstr,klen,cb,u) | |
458 #define PEM_write_PKCS7(fp,x) \ | |
459 PEM_ASN1_write((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,fp, \ | |
460 (char *)x, NULL,NULL,0,NULL,NULL) | |
461 #define PEM_write_DHparams(fp,x) \ | |
462 PEM_ASN1_write((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,fp,\ | |
463 (char *)x,NULL,NULL,0,NULL,NULL) | |
464 | |
465 #define PEM_write_NETSCAPE_CERT_SEQUENCE(fp,x) \ | |
466 PEM_ASN1_write((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \ | |
467 PEM_STRING_X509,fp, \ | |
468 (char *)x, NULL,NULL,0,NULL,NULL) | |
469 | |
470 #define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \ | |
471 (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u) | |
472 #define PEM_read_X509(fp,x,cb,u) (X509 *)PEM_ASN1_read( \ | |
473 (char *(*)())d2i_X509,PEM_STRING_X509,fp,(char **)x,cb,u) | |
474 #define PEM_read_X509_REQ(fp,x,cb,u) (X509_REQ *)PEM_ASN1_read( \ | |
475 (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,fp,(char **)x,cb,u) | |
476 #define PEM_read_X509_CRL(fp,x,cb,u) (X509_CRL *)PEM_ASN1_read( \ | |
477 (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,fp,(char **)x,cb,u) | |
478 #define PEM_read_RSAPrivateKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \ | |
479 (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,fp,(char **)x,cb,u) | |
480 #define PEM_read_RSAPublicKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \ | |
481 (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,fp,(char **)x,cb,u) | |
482 #define PEM_read_DSAPrivateKey(fp,x,cb,u) (DSA *)PEM_ASN1_read( \ | |
483 (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,fp,(char **)x,cb,u) | |
484 #define PEM_read_PrivateKey(fp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read( \ | |
485 (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,fp,(char **)x,cb,u) | |
486 #define PEM_read_PKCS7(fp,x,cb,u) (PKCS7 *)PEM_ASN1_read( \ | |
487 (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,fp,(char **)x,cb,u) | |
488 #define PEM_read_DHparams(fp,x,cb,u) (DH *)PEM_ASN1_read( \ | |
489 (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,fp,(char **)x,cb,u) | |
490 | |
491 #define PEM_read_NETSCAPE_CERT_SEQUENCE(fp,x,cb,u) \ | |
492 (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read( \ | |
493 (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,fp,\ | |
494 (char **)x,cb,u) | |
495 | |
496 #define PEM_write_bio_X509(bp,x) \ | |
497 PEM_ASN1_write_bio((int (*)())i2d_X509,PEM_STRING_X509,bp, \ | |
498 (char *)x, NULL,NULL,0,NULL,NULL) | |
499 #define PEM_write_bio_X509_REQ(bp,x) PEM_ASN1_write_bio( \ | |
500 (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,bp,(char *)x, \ | |
501 NULL,NULL,0,NULL,NULL) | |
502 #define PEM_write_bio_X509_CRL(bp,x) \ | |
503 PEM_ASN1_write_bio((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL,\ | |
504 bp,(char *)x, NULL,NULL,0,NULL,NULL) | |
505 #define PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \ | |
506 PEM_ASN1_write_bio((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,\ | |
507 bp,(char *)x,enc,kstr,klen,cb,u) | |
508 #define PEM_write_bio_RSAPublicKey(bp,x) \ | |
509 PEM_ASN1_write_bio((int (*)())i2d_RSAPublicKey, \ | |
510 PEM_STRING_RSA_PUBLIC,\ | |
511 bp,(char *)x,NULL,NULL,0,NULL,NULL) | |
512 #define PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \ | |
513 PEM_ASN1_write_bio((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,\ | |
514 bp,(char *)x,enc,kstr,klen,cb,u) | |
515 #define PEM_write_bio_PrivateKey(bp,x,enc,kstr,klen,cb,u) \ | |
516 PEM_ASN1_write_bio((int (*)())i2d_PrivateKey,\ | |
517 (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\ | |
518 bp,(char *)x,enc,kstr,klen,cb,u) | |
519 #define PEM_write_bio_PKCS7(bp,x) \ | |
520 PEM_ASN1_write_bio((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,bp, \ | |
521 (char *)x, NULL,NULL,0,NULL,NULL) | |
522 #define PEM_write_bio_DHparams(bp,x) \ | |
523 PEM_ASN1_write_bio((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,\ | |
524 bp,(char *)x,NULL,NULL,0,NULL,NULL) | |
525 #define PEM_write_bio_DSAparams(bp,x) \ | |
526 PEM_ASN1_write_bio((int (*)())i2d_DSAparams, \ | |
527 PEM_STRING_DSAPARAMS,bp,(char *)x,NULL,NULL,0,NULL,NULL) | |
528 | |
529 #define PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp,x) \ | |
530 PEM_ASN1_write_bio((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \ | |
531 PEM_STRING_X509,bp, \ | |
532 (char *)x, NULL,NULL,0,NULL,NULL) | |
533 | |
534 #define PEM_read_bio_X509(bp,x,cb,u) (X509 *)PEM_ASN1_read_bio( \ | |
535 (char *(*)())d2i_X509,PEM_STRING_X509,bp,(char **)x,cb,u) | |
536 #define PEM_read_bio_X509_REQ(bp,x,cb,u) (X509_REQ *)PEM_ASN1_read_bio( \ | |
537 (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,bp,(char **)x,cb,u) | |
538 #define PEM_read_bio_X509_CRL(bp,x,cb,u) (X509_CRL *)PEM_ASN1_read_bio( \ | |
539 (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,bp,(char **)x,cb,u) | |
540 #define PEM_read_bio_RSAPrivateKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \ | |
541 (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,bp,(char **)x,cb,u) | |
542 #define PEM_read_bio_RSAPublicKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \ | |
543 (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,bp,(char **)x,cb,u) | |
544 #define PEM_read_bio_DSAPrivateKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \ | |
545 (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,bp,(char **)x,cb,u) | |
546 #define PEM_read_bio_PrivateKey(bp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read_bio( \ | |
547 (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,bp,(char **)x,cb,u) | |
548 | |
549 #define PEM_read_bio_PKCS7(bp,x,cb,u) (PKCS7 *)PEM_ASN1_read_bio( \ | |
550 (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,bp,(char **)x,cb,u) | |
551 #define PEM_read_bio_DHparams(bp,x,cb,u) (DH *)PEM_ASN1_read_bio( \ | |
552 (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,bp,(char **)x,cb,u) | |
553 #define PEM_read_bio_DSAparams(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \ | |
554 (char *(*)())d2i_DSAparams,PEM_STRING_DSAPARAMS,bp,(char **)x,cb,u) | |
555 | |
556 #define PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp,x,cb,u) \ | |
557 (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read_bio( \ | |
558 (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,bp,\ | |
559 (char **)x,cb,u) | |
560 | |
561 #endif | |
562 | |
563 #if 1 | 398 #if 1 |
564 /* "userdata": new with OpenSSL 0.9.4 */ | 399 /* "userdata": new with OpenSSL 0.9.4 */ |
565 typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); | 400 typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); |
566 #else | 401 #else |
567 /* OpenSSL 0.9.3, 0.9.3a */ | 402 /* OpenSSL 0.9.3, 0.9.3a */ |
568 typedef int pem_password_cb(char *buf, int size, int rwflag); | 403 typedef int pem_password_cb(char *buf, int size, int rwflag); |
569 #endif | 404 #endif |
570 | 405 |
571 int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); | 406 int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); |
572 int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len, | 407 int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len, |
573 pem_password_cb *callback,void *u); | 408 pem_password_cb *callback,void *u); |
574 | 409 |
575 #ifndef OPENSSL_NO_BIO | 410 #ifndef OPENSSL_NO_BIO |
576 int PEM_read_bio(BIO *bp, char **name, char **header, | 411 int PEM_read_bio(BIO *bp, char **name, char **header, |
577 unsigned char **data,long *len); | 412 unsigned char **data,long *len); |
578 int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data, | 413 int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data, |
579 long len); | 414 long len); |
580 int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char
*name, BIO *bp, | 415 int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char
*name, BIO *bp, |
581 pem_password_cb *cb, void *u); | 416 pem_password_cb *cb, void *u); |
582 void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, | 417 void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, |
583 void **x, pem_password_cb *cb, void *u); | 418 void **x, pem_password_cb *cb, void *u); |
584 | 419 int» PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp, void *x, |
585 #define PEM_ASN1_read_bio_of(type,d2i,name,bp,x,cb,u) \ | |
586 ((type*)PEM_ASN1_read_bio(CHECKED_D2I_OF(type, d2i), \ | |
587 » » » name, bp,»» » \ | |
588 » » » CHECKED_PPTR_OF(type, x), \ | |
589 » » » cb, u)) | |
590 | |
591 int» PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp,char *x, | |
592 const EVP_CIPHER *enc,unsigned char *kstr,int klen, | 420 const EVP_CIPHER *enc,unsigned char *kstr,int klen, |
593 pem_password_cb *cb, void *u); | 421 pem_password_cb *cb, void *u); |
594 | 422 |
595 #define PEM_ASN1_write_bio_of(type,i2d,name,bp,x,enc,kstr,klen,cb,u) \ | |
596 (PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d), \ | |
597 name, bp, \ | |
598 CHECKED_PTR_OF(type, x), \ | |
599 enc, kstr, klen, cb, u)) | |
600 | |
601 STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
pem_password_cb *cb, void *u); | 423 STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
pem_password_cb *cb, void *u); |
602 int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, | 424 int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, |
603 unsigned char *kstr, int klen, pem_password_cb *cd, void *u); | 425 unsigned char *kstr, int klen, pem_password_cb *cd, void *u); |
604 #endif | 426 #endif |
605 | 427 |
606 #ifndef OPENSSL_SYS_WIN16 | |
607 int PEM_read(FILE *fp, char **name, char **header, | 428 int PEM_read(FILE *fp, char **name, char **header, |
608 unsigned char **data,long *len); | 429 unsigned char **data,long *len); |
609 int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len); | 430 int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len); |
610 void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, | 431 void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, |
611 pem_password_cb *cb, void *u); | 432 pem_password_cb *cb, void *u); |
612 int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, | 433 int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, |
613 » » char *x,const EVP_CIPHER *enc,unsigned char *kstr, | 434 » » void *x,const EVP_CIPHER *enc,unsigned char *kstr, |
614 int klen,pem_password_cb *callback, void *u); | 435 int klen,pem_password_cb *callback, void *u); |
615 STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, | 436 STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, |
616 pem_password_cb *cb, void *u); | 437 pem_password_cb *cb, void *u); |
617 #endif | |
618 | 438 |
619 int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, | 439 int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, |
620 EVP_MD *md_type, unsigned char **ek, int *ekl, | 440 EVP_MD *md_type, unsigned char **ek, int *ekl, |
621 unsigned char *iv, EVP_PKEY **pubk, int npubk); | 441 unsigned char *iv, EVP_PKEY **pubk, int npubk); |
622 void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, | 442 void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, |
623 unsigned char *in, int inl); | 443 unsigned char *in, int inl); |
624 int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig,int *sigl, | 444 int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig,int *sigl, |
625 unsigned char *out, int *outl, EVP_PKEY *priv); | 445 unsigned char *out, int *outl, EVP_PKEY *priv); |
626 | 446 |
627 void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type); | 447 void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type); |
628 void PEM_SignUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt); | 448 void PEM_SignUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt); |
629 int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, | 449 int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, |
630 unsigned int *siglen, EVP_PKEY *pkey); | 450 unsigned int *siglen, EVP_PKEY *pkey); |
631 | 451 |
632 int PEM_def_callback(char *buf, int num, int w, void *key); | 452 int PEM_def_callback(char *buf, int num, int w, void *key); |
633 void PEM_proc_type(char *buf, int type); | 453 void PEM_proc_type(char *buf, int type); |
634 void PEM_dek_info(char *buf, const char *type, int len, char *str); | 454 void PEM_dek_info(char *buf, const char *type, int len, char *str); |
635 | 455 |
636 #ifndef SSLEAY_MACROS | |
637 | 456 |
638 #include <openssl/symhacks.h> | 457 #include <openssl/symhacks.h> |
639 | 458 |
640 DECLARE_PEM_rw(X509, X509) | 459 DECLARE_PEM_rw(X509, X509) |
641 | 460 |
642 DECLARE_PEM_rw(X509_AUX, X509) | 461 DECLARE_PEM_rw(X509_AUX, X509) |
643 | 462 |
644 DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR) | 463 DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR) |
645 | 464 |
646 DECLARE_PEM_rw(X509_REQ, X509_REQ) | 465 DECLARE_PEM_rw(X509_REQ, X509_REQ) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 pem_password_cb *cb, void *u); | 531 pem_password_cb *cb, void *u); |
713 int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, | 532 int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, |
714 char *kstr, int klen, | 533 char *kstr, int klen, |
715 pem_password_cb *cb, void *u); | 534 pem_password_cb *cb, void *u); |
716 | 535 |
717 EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, vo
id *u); | 536 EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, vo
id *u); |
718 | 537 |
719 int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, | 538 int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, |
720 char *kstr,int klen, pem_password_cb *cd, void *u)
; | 539 char *kstr,int klen, pem_password_cb *cd, void *u)
; |
721 | 540 |
722 #endif /* SSLEAY_MACROS */ | 541 EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x); |
| 542 int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x); |
| 543 |
| 544 |
| 545 EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length); |
| 546 EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length); |
| 547 EVP_PKEY *b2i_PrivateKey_bio(BIO *in); |
| 548 EVP_PKEY *b2i_PublicKey_bio(BIO *in); |
| 549 int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk); |
| 550 int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk); |
| 551 #ifndef OPENSSL_NO_RC4 |
| 552 EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u); |
| 553 int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, |
| 554 » » pem_password_cb *cb, void *u); |
| 555 #endif |
723 | 556 |
724 | 557 |
725 /* BEGIN ERROR CODES */ | 558 /* BEGIN ERROR CODES */ |
726 /* The following lines are auto generated by the script mkerr.pl. Any changes | 559 /* The following lines are auto generated by the script mkerr.pl. Any changes |
727 * made after this point may be overwritten when the script is next run. | 560 * made after this point may be overwritten when the script is next run. |
728 */ | 561 */ |
729 void ERR_load_PEM_strings(void); | 562 void ERR_load_PEM_strings(void); |
730 | 563 |
731 /* Error codes for the PEM functions. */ | 564 /* Error codes for the PEM functions. */ |
732 | 565 |
733 /* Function codes. */ | 566 /* Function codes. */ |
| 567 #define PEM_F_B2I_DSS 127 |
| 568 #define PEM_F_B2I_PVK_BIO 128 |
| 569 #define PEM_F_B2I_RSA 129 |
| 570 #define PEM_F_CHECK_BITLEN_DSA 130 |
| 571 #define PEM_F_CHECK_BITLEN_RSA 131 |
734 #define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120 | 572 #define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120 |
735 #define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121 | 573 #define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121 |
| 574 #define PEM_F_DO_B2I 132 |
| 575 #define PEM_F_DO_B2I_BIO 133 |
| 576 #define PEM_F_DO_BLOB_HEADER 134 |
736 #define PEM_F_DO_PK8PKEY 126 | 577 #define PEM_F_DO_PK8PKEY 126 |
737 #define PEM_F_DO_PK8PKEY_FP 125 | 578 #define PEM_F_DO_PK8PKEY_FP 125 |
| 579 #define PEM_F_DO_PVK_BODY 135 |
| 580 #define PEM_F_DO_PVK_HEADER 136 |
| 581 #define PEM_F_I2B_PVK 137 |
| 582 #define PEM_F_I2B_PVK_BIO 138 |
738 #define PEM_F_LOAD_IV 101 | 583 #define PEM_F_LOAD_IV 101 |
739 #define PEM_F_PEM_ASN1_READ 102 | 584 #define PEM_F_PEM_ASN1_READ 102 |
740 #define PEM_F_PEM_ASN1_READ_BIO 103 | 585 #define PEM_F_PEM_ASN1_READ_BIO 103 |
741 #define PEM_F_PEM_ASN1_WRITE 104 | 586 #define PEM_F_PEM_ASN1_WRITE 104 |
742 #define PEM_F_PEM_ASN1_WRITE_BIO 105 | 587 #define PEM_F_PEM_ASN1_WRITE_BIO 105 |
743 #define PEM_F_PEM_DEF_CALLBACK 100 | 588 #define PEM_F_PEM_DEF_CALLBACK 100 |
744 #define PEM_F_PEM_DO_HEADER 106 | 589 #define PEM_F_PEM_DO_HEADER 106 |
745 #define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118 | 590 #define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118 |
746 #define PEM_F_PEM_GET_EVP_CIPHER_INFO 107 | 591 #define PEM_F_PEM_GET_EVP_CIPHER_INFO 107 |
747 #define PEM_F_PEM_PK8PKEY 119 | 592 #define PEM_F_PEM_PK8PKEY 119 |
748 #define PEM_F_PEM_READ 108 | 593 #define PEM_F_PEM_READ 108 |
749 #define PEM_F_PEM_READ_BIO 109 | 594 #define PEM_F_PEM_READ_BIO 109 |
| 595 #define PEM_F_PEM_READ_BIO_PARAMETERS 140 |
750 #define PEM_F_PEM_READ_BIO_PRIVATEKEY 123 | 596 #define PEM_F_PEM_READ_BIO_PRIVATEKEY 123 |
751 #define PEM_F_PEM_READ_PRIVATEKEY 124 | 597 #define PEM_F_PEM_READ_PRIVATEKEY 124 |
752 #define PEM_F_PEM_SEALFINAL 110 | 598 #define PEM_F_PEM_SEALFINAL 110 |
753 #define PEM_F_PEM_SEALINIT 111 | 599 #define PEM_F_PEM_SEALINIT 111 |
754 #define PEM_F_PEM_SIGNFINAL 112 | 600 #define PEM_F_PEM_SIGNFINAL 112 |
755 #define PEM_F_PEM_WRITE 113 | 601 #define PEM_F_PEM_WRITE 113 |
756 #define PEM_F_PEM_WRITE_BIO 114 | 602 #define PEM_F_PEM_WRITE_BIO 114 |
| 603 #define PEM_F_PEM_WRITE_PRIVATEKEY 139 |
757 #define PEM_F_PEM_X509_INFO_READ 115 | 604 #define PEM_F_PEM_X509_INFO_READ 115 |
758 #define PEM_F_PEM_X509_INFO_READ_BIO 116 | 605 #define PEM_F_PEM_X509_INFO_READ_BIO 116 |
759 #define PEM_F_PEM_X509_INFO_WRITE_BIO 117 | 606 #define PEM_F_PEM_X509_INFO_WRITE_BIO 117 |
760 | 607 |
761 /* Reason codes. */ | 608 /* Reason codes. */ |
762 #define PEM_R_BAD_BASE64_DECODE 100 | 609 #define PEM_R_BAD_BASE64_DECODE 100 |
763 #define PEM_R_BAD_DECRYPT 101 | 610 #define PEM_R_BAD_DECRYPT 101 |
764 #define PEM_R_BAD_END_LINE 102 | 611 #define PEM_R_BAD_END_LINE 102 |
765 #define PEM_R_BAD_IV_CHARS 103 | 612 #define PEM_R_BAD_IV_CHARS 103 |
| 613 #define PEM_R_BAD_MAGIC_NUMBER 116 |
766 #define PEM_R_BAD_PASSWORD_READ 104 | 614 #define PEM_R_BAD_PASSWORD_READ 104 |
| 615 #define PEM_R_BAD_VERSION_NUMBER 117 |
| 616 #define PEM_R_BIO_WRITE_FAILURE 118 |
| 617 #define PEM_R_CIPHER_IS_NULL 127 |
767 #define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115 | 618 #define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115 |
| 619 #define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119 |
| 620 #define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120 |
| 621 #define PEM_R_INCONSISTENT_HEADER 121 |
| 622 #define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122 |
| 623 #define PEM_R_KEYBLOB_TOO_SHORT 123 |
768 #define PEM_R_NOT_DEK_INFO 105 | 624 #define PEM_R_NOT_DEK_INFO 105 |
769 #define PEM_R_NOT_ENCRYPTED 106 | 625 #define PEM_R_NOT_ENCRYPTED 106 |
770 #define PEM_R_NOT_PROC_TYPE 107 | 626 #define PEM_R_NOT_PROC_TYPE 107 |
771 #define PEM_R_NO_START_LINE 108 | 627 #define PEM_R_NO_START_LINE 108 |
772 #define PEM_R_PROBLEMS_GETTING_PASSWORD 109 | 628 #define PEM_R_PROBLEMS_GETTING_PASSWORD 109 |
773 #define PEM_R_PUBLIC_KEY_NO_RSA 110 | 629 #define PEM_R_PUBLIC_KEY_NO_RSA 110 |
| 630 #define PEM_R_PVK_DATA_TOO_SHORT 124 |
| 631 #define PEM_R_PVK_TOO_SHORT 125 |
774 #define PEM_R_READ_KEY 111 | 632 #define PEM_R_READ_KEY 111 |
775 #define PEM_R_SHORT_HEADER 112 | 633 #define PEM_R_SHORT_HEADER 112 |
776 #define PEM_R_UNSUPPORTED_CIPHER 113 | 634 #define PEM_R_UNSUPPORTED_CIPHER 113 |
777 #define PEM_R_UNSUPPORTED_ENCRYPTION 114 | 635 #define PEM_R_UNSUPPORTED_ENCRYPTION 114 |
| 636 #define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126 |
778 | 637 |
779 #ifdef __cplusplus | 638 #ifdef __cplusplus |
780 } | 639 } |
781 #endif | 640 #endif |
782 #endif | 641 #endif |
OLD | NEW |