summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509v3/v3_conf.c
diff options
context:
space:
mode:
authordjm <>2010-10-01 22:59:01 +0000
committerdjm <>2010-10-01 22:59:01 +0000
commitfe047d8b632246cb2db3234a0a4f32e5c318857b (patch)
tree939b752540947d33507b3acc48d76a8bfb7c3dc3 /src/lib/libcrypto/x509v3/v3_conf.c
parent2ea67f4aa254b09ded62e6e14fc893bbe6381579 (diff)
downloadopenbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.tar.gz
openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.tar.bz2
openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.zip
resolve conflicts, fix local changes
Diffstat (limited to 'src/lib/libcrypto/x509v3/v3_conf.c')
-rw-r--r--src/lib/libcrypto/x509v3/v3_conf.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_conf.c b/src/lib/libcrypto/x509v3/v3_conf.c
index 11eb6b7fd5..6730f9a6ee 100644
--- a/src/lib/libcrypto/x509v3/v3_conf.c
+++ b/src/lib/libcrypto/x509v3/v3_conf.c
@@ -72,14 +72,14 @@ static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, in
72static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, int crit, int type, X509V3_CTX *ctx); 72static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, int crit, int type, X509V3_CTX *ctx);
73static char *conf_lhash_get_string(void *db, char *section, char *value); 73static char *conf_lhash_get_string(void *db, char *section, char *value);
74static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, char *section); 74static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, char *section);
75static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid, 75static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid,
76 int crit, void *ext_struc); 76 int crit, void *ext_struc);
77static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len); 77static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len);
78/* CONF *conf: Config file */ 78/* CONF *conf: Config file */
79/* char *name: Name */ 79/* char *name: Name */
80/* char *value: Value */ 80/* char *value: Value */
81X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, 81X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name,
82 char *value) 82 char *value)
83 { 83 {
84 int crit; 84 int crit;
85 int ext_type; 85 int ext_type;
@@ -99,7 +99,7 @@ X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name,
99/* CONF *conf: Config file */ 99/* CONF *conf: Config file */
100/* char *value: Value */ 100/* char *value: Value */
101X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, 101X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
102 char *value) 102 char *value)
103 { 103 {
104 int crit; 104 int crit;
105 int ext_type; 105 int ext_type;
@@ -113,9 +113,9 @@ X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
113/* CONF *conf: Config file */ 113/* CONF *conf: Config file */
114/* char *value: Value */ 114/* char *value: Value */
115static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, 115static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid,
116 int crit, char *value) 116 int crit, char *value)
117 { 117 {
118 X509V3_EXT_METHOD *method; 118 const X509V3_EXT_METHOD *method;
119 X509_EXTENSION *ext; 119 X509_EXTENSION *ext;
120 STACK_OF(CONF_VALUE) *nval; 120 STACK_OF(CONF_VALUE) *nval;
121 void *ext_struc; 121 void *ext_struc;
@@ -172,8 +172,8 @@ static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid,
172 172
173 } 173 }
174 174
175static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid, 175static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid,
176 int crit, void *ext_struc) 176 int crit, void *ext_struc)
177 { 177 {
178 unsigned char *ext_der; 178 unsigned char *ext_der;
179 int ext_len; 179 int ext_len;
@@ -214,7 +214,7 @@ static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid,
214 214
215X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc) 215X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc)
216 { 216 {
217 X509V3_EXT_METHOD *method; 217 const X509V3_EXT_METHOD *method;
218 if (!(method = X509V3_EXT_get_nid(ext_nid))) { 218 if (!(method = X509V3_EXT_get_nid(ext_nid))) {
219 X509V3err(X509V3_F_X509V3_EXT_I2D,X509V3_R_UNKNOWN_EXTENSION); 219 X509V3err(X509V3_F_X509V3_EXT_I2D,X509V3_R_UNKNOWN_EXTENSION);
220 return NULL; 220 return NULL;
@@ -258,7 +258,8 @@ static int v3_check_generic(char **value)
258 258
259/* Create a generic extension: for now just handle DER type */ 259/* Create a generic extension: for now just handle DER type */
260static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, 260static X509_EXTENSION *v3_generic_extension(const char *ext, char *value,
261 int crit, int gen_type, X509V3_CTX *ctx) 261 int crit, int gen_type,
262 X509V3_CTX *ctx)
262 { 263 {
263 unsigned char *ext_der=NULL; 264 unsigned char *ext_der=NULL;
264 long ext_len; 265 long ext_len;
@@ -322,7 +323,7 @@ static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len)
322 323
323 324
324int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, 325int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section,
325 STACK_OF(X509_EXTENSION) **sk) 326 STACK_OF(X509_EXTENSION) **sk)
326 { 327 {
327 X509_EXTENSION *ext; 328 X509_EXTENSION *ext;
328 STACK_OF(CONF_VALUE) *nval; 329 STACK_OF(CONF_VALUE) *nval;
@@ -343,7 +344,7 @@ int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section,
343/* Convenience functions to add extensions to a certificate, CRL and request */ 344/* Convenience functions to add extensions to a certificate, CRL and request */
344 345
345int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, 346int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
346 X509 *cert) 347 X509 *cert)
347 { 348 {
348 STACK_OF(X509_EXTENSION) **sk = NULL; 349 STACK_OF(X509_EXTENSION) **sk = NULL;
349 if (cert) 350 if (cert)
@@ -354,7 +355,7 @@ int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
354/* Same as above but for a CRL */ 355/* Same as above but for a CRL */
355 356
356int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, 357int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
357 X509_CRL *crl) 358 X509_CRL *crl)
358 { 359 {
359 STACK_OF(X509_EXTENSION) **sk = NULL; 360 STACK_OF(X509_EXTENSION) **sk = NULL;
360 if (crl) 361 if (crl)
@@ -443,7 +444,7 @@ void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf)
443 } 444 }
444 445
445void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, 446void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req,
446 X509_CRL *crl, int flags) 447 X509_CRL *crl, int flags)
447 { 448 {
448 ctx->issuer_cert = issuer; 449 ctx->issuer_cert = issuer;
449 ctx->subject_cert = subj; 450 ctx->subject_cert = subj;
@@ -454,8 +455,8 @@ void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req,
454 455
455/* Old conf compatibility functions */ 456/* Old conf compatibility functions */
456 457
457X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, 458X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
458 char *value) 459 char *name, char *value)
459 { 460 {
460 CONF ctmp; 461 CONF ctmp;
461 CONF_set_nconf(&ctmp, conf); 462 CONF_set_nconf(&ctmp, conf);
@@ -464,8 +465,8 @@ X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name,
464 465
465/* LHASH *conf: Config file */ 466/* LHASH *conf: Config file */
466/* char *value: Value */ 467/* char *value: Value */
467X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, 468X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
468 char *value) 469 int ext_nid, char *value)
469 { 470 {
470 CONF ctmp; 471 CONF ctmp;
471 CONF_set_nconf(&ctmp, conf); 472 CONF_set_nconf(&ctmp, conf);
@@ -489,14 +490,14 @@ NULL,
489NULL 490NULL
490}; 491};
491 492
492void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash) 493void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash)
493 { 494 {
494 ctx->db_meth = &conf_lhash_method; 495 ctx->db_meth = &conf_lhash_method;
495 ctx->db = lhash; 496 ctx->db = lhash;
496 } 497 }
497 498
498int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, 499int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
499 X509 *cert) 500 char *section, X509 *cert)
500 { 501 {
501 CONF ctmp; 502 CONF ctmp;
502 CONF_set_nconf(&ctmp, conf); 503 CONF_set_nconf(&ctmp, conf);
@@ -505,8 +506,8 @@ int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section,
505 506
506/* Same as above but for a CRL */ 507/* Same as above but for a CRL */
507 508
508int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, 509int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
509 X509_CRL *crl) 510 char *section, X509_CRL *crl)
510 { 511 {
511 CONF ctmp; 512 CONF ctmp;
512 CONF_set_nconf(&ctmp, conf); 513 CONF_set_nconf(&ctmp, conf);
@@ -515,8 +516,8 @@ int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section,
515 516
516/* Add extensions to certificate request */ 517/* Add extensions to certificate request */
517 518
518int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, 519int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
519 X509_REQ *req) 520 char *section, X509_REQ *req)
520 { 521 {
521 CONF ctmp; 522 CONF ctmp;
522 CONF_set_nconf(&ctmp, conf); 523 CONF_set_nconf(&ctmp, conf);