v3_conf.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/* v3_conf.c */
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
* project 1999.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* extension creation utilities */
#include <stdio.h>
#include <ctype.h>
#include "cryptlib.h"
static int v3_check_critical(char **value);
static int v3_check_generic(char **value);
static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, int crit, char *value);
/* CONF *conf: Config file */
/* char *name: Name */
/* char *value: Value */
char *value)
{
int crit;
int ext_type;
if (!ret)
{
}
return ret;
}
/* CONF *conf: Config file */
/* char *value: Value */
char *value)
{
int crit;
int ext_type;
}
/* CONF *conf: Config file */
/* char *value: Value */
{
void *ext_struc;
{
return NULL;
}
{
return NULL;
}
/* Now get internal extension representation based on type */
{
if(!nval)
{
return NULL;
}
}
{
}
{
{
return NULL;
}
}
else
{
return NULL;
}
return ext;
}
{
unsigned char *ext_der;
int ext_len;
/* Convert internal representation to DER */
{
}
else
{
unsigned char *p;
p = ext_der;
}
return ext;
merr:
return NULL;
}
/* Given an internal structure, nid and critical flag create an extension */
{
return NULL;
}
}
/* Check the extension string for critical flag */
static int v3_check_critical(char **value)
{
char *p = *value;
p+=9;
while(isspace((unsigned char)*p)) p++;
*value = p;
return 1;
}
/* Check extension string for generic extension and return the type */
static int v3_check_generic(char **value)
{
char *p = *value;
p+=4;
while (isspace((unsigned char)*p)) p++;
*value = p;
return 1;
}
/* Create a generic extension: for now just handle DER type */
{
long ext_len;
{
goto err;
}
{
goto err;
}
if (!(oct = M_ASN1_OCTET_STRING_new()))
{
goto err;
}
err:
return extension;
}
/* This is the main function: add a bunch of extensions based on a config file
* section to an extension STACK.
*/
{
int i;
for (i = 0; i < sk_CONF_VALUE_num(nval); i++)
{
return 0;
}
return 1;
}
/* Convenience functions to add extensions to a certificate, CRL and request */
{
if (cert)
}
/* Same as above but for a CRL */
{
if (crl)
}
/* Add extensions to certificate request */
{
int i;
if (req)
if (!i || !sk)
return i;
return i;
}
/* Config database functions */
{
return NULL;
}
{
return NULL;
}
{
if (!str) return;
}
{
if (!section) return;
}
{
}
{
}
static X509V3_CONF_METHOD nconf_method = {
NULL,
};
{
}
{
}
/* Old conf compatibility functions */
char *value)
{
}
/* LHASH *conf: Config file */
/* char *value: Value */
char *value)
{
}
{
}
{
}
static X509V3_CONF_METHOD conf_lhash_method = {
NULL,
};
{
}
{
}
/* Same as above but for a CRL */
{
}
/* Add extensions to certificate request */
{
}