Generate errors when public/private key check is done.
[openssl.git] / crypto / x509v3 / x509v3.h
index ce230a3..1998643 100644 (file)
@@ -130,6 +130,8 @@ char *lname;
 char *sname;
 } BIT_STRING_BITNAME;
 
+typedef BIT_STRING_BITNAME ENUMERATED_NAMES;
+
 typedef struct {
 int ca;
 ASN1_INTEGER *pathlen;
@@ -141,6 +143,11 @@ STACK *issuer;
 ASN1_INTEGER *serial;
 } AUTHORITY_KEYID;
 
+typedef struct {
+ASN1_GENERALIZEDTIME *notBefore;
+ASN1_GENERALIZEDTIME *notAfter;
+} PKEY_USAGE_PERIOD;
+
 typedef struct {
 
 #define GEN_OTHERNAME  (0|V_ASN1_CONTEXT_SPECIFIC)
@@ -204,17 +211,24 @@ int i2d_GENERAL_NAME(GENERAL_NAME *a, unsigned char **pp);
 GENERAL_NAME *d2i_GENERAL_NAME(GENERAL_NAME **a, unsigned char **pp, long length);
 GENERAL_NAME *GENERAL_NAME_new(void);
 void GENERAL_NAME_free(GENERAL_NAME *a);
+STACK *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK *ret);
 
 int i2d_AUTHORITY_KEYID(AUTHORITY_KEYID *a, unsigned char **pp);
 AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **a, unsigned char **pp, long length);
 AUTHORITY_KEYID *AUTHORITY_KEYID_new(void);
 void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a);
 
+int i2d_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD *a, unsigned char **pp);
+PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD **a, unsigned char **pp, long length);
+PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new(void);
+void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a);
+
 STACK *GENERAL_NAMES_new(void);
 void GENERAL_NAMES_free(STACK *a);
 STACK *d2i_GENERAL_NAMES(STACK **a, unsigned char **pp, long length);
 int i2d_GENERAL_NAMES(STACK *a, unsigned char **pp);
 STACK *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, STACK *gen, STACK *extlist);
+STACK *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK *nval);
 
 char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5);
 ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
@@ -225,9 +239,11 @@ void ext_ku_free(STACK *a);
 STACK *ext_ku_new(void);
 
 #ifdef HEADER_CONF_H
+GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, CONF_VALUE *cnf);
 void X509V3_conf_free(CONF_VALUE *val);
 X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, char *value);
 X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, char *value);
+char *str_dup(char *val);
 int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509 *cert);
 int X509V3_EXT_check_conf(LHASH *conf, char *section);
 int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool);
@@ -237,6 +253,9 @@ int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint);
 int X509V3_add_value(char *name, char *value, STACK **extlist);
 int X509V3_add_value_bool(char *name, int asn1_bool, STACK **extlist);
 int X509V3_add_value_int( char *name, ASN1_INTEGER *aint, STACK **extlist);
+char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint);
+char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);
+char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);
 int X509V3_EXT_add(X509V3_EXT_METHOD *ext);
 int X509V3_EXT_add_alias(int nid_to, int nid_from);
 void X509V3_EXT_cleanup(void);
@@ -245,9 +264,11 @@ X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);
 X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid);
 int X509V3_add_standard_extensions(void);
 STACK *X509V3_parse_list(char *line);
+char *X509V3_EXT_d2i(X509_EXTENSION *ext);
 
 char *hex_to_string(unsigned char *buffer, long len);
 unsigned char *string_to_hex(char *str, long *len);
+int name_cmp(char *name, char *cmp);
 
 int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag);
 int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag);
@@ -264,12 +285,20 @@ int i2d_GENERAL_NAME();
 GENERAL_NAME *d2i_GENERAL_NAME();
 GENERAL_NAME *GENERAL_NAME_new();
 void GENERAL_NAME_free();
+STACK *i2v_GENERAL_NAME();
+GENERAL_NAME *v2i_GENERAL_NAME();
+
+int i2d_PKEY_USAGE_PERIOD();
+PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD();
+PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new();
+void PKEY_USAGE_PERIOD_free();
 
 STACK *GENERAL_NAMES_new():
 void GENERAL_NAMES_free():
 STACK *d2i_GENERAL_NAMES();
 int i2d_GENERAL_NAMES();
 STACK *i2v_GENERAL_NAMES();
+STACK *v2i_GENERAL_NAMES();
 
 char *i2s_ASN1_OCTET_STRING();
 ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING();
@@ -281,6 +310,7 @@ STACK *ext_ku_new();
 
 #ifdef HEADER_CONF_H
 void X509V3_conf_free();
+char *str_dup();
 X509_EXTENSION *X509V3_EXT_conf_nid();
 X509_EXTENSION *X509V3_EXT_conf();
 int X509V3_EXT_add_conf();
@@ -292,6 +322,9 @@ int X509V3_get_value_int();
 int X509V3_add_value();
 int X509V3_add_value_bool();
 int X509V3_add_value_int();
+char *i2s_ASN1_INTEGER();
+char * i2s_ASN1_ENUMERATED();
+char * i2s_ASN1_ENUMERATED_TABLE();
 int X509V3_EXT_add();
 int X509V3_EXT_add_alias();
 void X509V3_EXT_cleanup();
@@ -300,9 +333,11 @@ X509V3_EXT_METHOD *X509V3_EXT_get();
 X509V3_EXT_METHOD *X509V3_EXT_get_nid();
 int X509V3_add_standard_extensions();
 STACK *X509V3_parse_list();
+char *X509V3_EXT_get_d2i();
 
 char *hex_to_string();
 unsigned char *string_to_hex();
+int name_cmp();
 
 int X509V3_EXT_print();
 int X509V3_EXT_print_fp();
@@ -313,15 +348,20 @@ int X509V3_EXT_print_fp();
 
 /* Function codes. */
 #define X509V3_F_HEX_TO_STRING                          111
+#define X509V3_F_I2S_ASN1_ENUMERATED                    121
+#define X509V3_F_I2S_ASN1_INTEGER                       120
 #define X509V3_F_S2I_ASN1_IA5STRING                     100
 #define X509V3_F_S2I_ASN1_OCTET_STRING                  112
 #define X509V3_F_S2I_ASN1_SKEY_ID                       114
 #define X509V3_F_S2I_S2I_SKEY_ID                        115
 #define X509V3_F_STRING_TO_HEX                          113
 #define X509V3_F_V2I_ASN1_BIT_STRING                    101
-#define X509V3_F_V2I_AUTHORITY_KEYID                    116
+#define X509V3_F_V2I_AUTHORITY_KEYID                    119
 #define X509V3_F_V2I_BASIC_CONSTRAINTS                  102
 #define X509V3_F_V2I_EXT_KU                             103
+#define X509V3_F_V2I_GENERAL_NAME                       117
+#define X509V3_F_V2I_GENERAL_NAMES                      118
+#define X509V3_F_V3_GENERIC_EXTENSION                   116
 #define X509V3_F_X509V3_ADD_EXT                                 104
 #define X509V3_F_X509V3_ADD_VALUE                       105
 #define X509V3_F_X509V3_EXT_ADD_ALIAS                   106
@@ -331,10 +371,14 @@ int X509V3_EXT_print_fp();
 #define X509V3_F_X509V3_VALUE_GET_BOOL                  110
 
 /* Reason codes. */
+#define X509V3_R_BAD_IP_ADDRESS                                 118
+#define X509V3_R_BAD_OBJECT                             119
 #define X509V3_R_BN_DEC2BN_ERROR                        100
 #define X509V3_R_BN_TO_ASN1_INTEGER_ERROR               101
+#define X509V3_R_EXTENSION_NAME_ERROR                   115
 #define X509V3_R_EXTENSION_NOT_FOUND                    102
 #define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED        103
+#define X509V3_R_EXTENSION_VALUE_ERROR                  116
 #define X509V3_R_ILLEGAL_HEX_DIGIT                      113
 #define X509V3_R_INVALID_BOOLEAN_STRING                         104
 #define X509V3_R_INVALID_EXTENSION_STRING               105
@@ -343,9 +387,14 @@ int X509V3_EXT_print_fp();
 #define X509V3_R_INVALID_NULL_NAME                      108
 #define X509V3_R_INVALID_NULL_VALUE                     109
 #define X509V3_R_INVALID_OBJECT_IDENTIFIER              110
+#define X509V3_R_NO_ISSUER_CERTIFICATE                  121
 #define X509V3_R_NO_PUBLIC_KEY                          114
 #define X509V3_R_ODD_NUMBER_OF_DIGITS                   112
+#define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS           122
+#define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID             123
 #define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT            111
+#define X509V3_R_UNKNOWN_OPTION                                 120
+#define X509V3_R_UNSUPPORTED_OPTION                     117
  
 #ifdef  __cplusplus
 }