ca.c (325335) | ca.c (325337) |
---|---|
1/* apps/ca.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 1971 unchanged lines hidden (view full) --- 1980 i = X509_set_pubkey(ret, pktmp); 1981 EVP_PKEY_free(pktmp); 1982 if (!i) 1983 goto err; 1984 1985 /* Lets add the extensions, if there are any */ 1986 if (ext_sect) { 1987 X509V3_CTX ctx; | 1/* apps/ca.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 1971 unchanged lines hidden (view full) --- 1980 i = X509_set_pubkey(ret, pktmp); 1981 EVP_PKEY_free(pktmp); 1982 if (!i) 1983 goto err; 1984 1985 /* Lets add the extensions, if there are any */ 1986 if (ext_sect) { 1987 X509V3_CTX ctx; |
1988 if (ci->version == NULL) 1989 if ((ci->version = ASN1_INTEGER_new()) == NULL) 1990 goto err; 1991 ASN1_INTEGER_set(ci->version, 2); /* version 3 certificate */ | |
1992 1993 /* 1994 * Free the current entries if any, there should not be any I believe 1995 */ 1996 if (ci->extensions != NULL) 1997 sk_X509_EXTENSION_pop_free(ci->extensions, X509_EXTENSION_free); 1998 1999 ci->extensions = NULL; --- 46 unchanged lines hidden (view full) --- 2046 /* Copy extensions from request (if any) */ 2047 2048 if (!copy_extensions(ret, req, ext_copy)) { 2049 BIO_printf(bio_err, "ERROR: adding extensions from request\n"); 2050 ERR_print_errors(bio_err); 2051 goto err; 2052 } 2053 | 1988 1989 /* 1990 * Free the current entries if any, there should not be any I believe 1991 */ 1992 if (ci->extensions != NULL) 1993 sk_X509_EXTENSION_pop_free(ci->extensions, X509_EXTENSION_free); 1994 1995 ci->extensions = NULL; --- 46 unchanged lines hidden (view full) --- 2042 /* Copy extensions from request (if any) */ 2043 2044 if (!copy_extensions(ret, req, ext_copy)) { 2045 BIO_printf(bio_err, "ERROR: adding extensions from request\n"); 2046 ERR_print_errors(bio_err); 2047 goto err; 2048 } 2049 |
2050 { 2051 STACK_OF(X509_EXTENSION) *exts = ci->extensions; 2052 2053 if (exts != NULL && sk_X509_EXTENSION_num(exts) > 0) 2054 /* Make it an X509 v3 certificate. */ 2055 if (!X509_set_version(ret, 2)) 2056 goto err; 2057 } 2058 |
|
2054 /* Set the right value for the noemailDN option */ 2055 if (email_dn == 0) { 2056 if (!X509_set_subject_name(ret, dn_subject)) 2057 goto err; 2058 } 2059 2060 if (!default_op) { 2061 BIO_printf(bio_err, "Certificate Details:\n"); --- 857 unchanged lines hidden --- | 2059 /* Set the right value for the noemailDN option */ 2060 if (email_dn == 0) { 2061 if (!X509_set_subject_name(ret, dn_subject)) 2062 goto err; 2063 } 2064 2065 if (!default_op) { 2066 BIO_printf(bio_err, "Certificate Details:\n"); --- 857 unchanged lines hidden --- |