Avoid "incomprehensible" errors when required definitions are missing.
[openssl.git] / crypto / asn1 / asn1.h
index 3dc6edaad164f89edb92458389560e181ff88c3a..8a28085d550a9b8e5a9dbbd6f37a114a82def8f6 100644 (file)
@@ -64,8 +64,8 @@ extern "C" {
 #endif
 
 #include <time.h>
-#include "bn.h"
-#include "stack.h"
+#include <openssl/bn.h>
+#include <openssl/stack.h>
 
 #define V_ASN1_UNIVERSAL               0x00
 #define        V_ASN1_APPLICATION              0x40
@@ -471,7 +471,9 @@ void                ASN1_STRING_free(ASN1_STRING *a);
 ASN1_STRING *  ASN1_STRING_dup(ASN1_STRING *a);
 ASN1_STRING *  ASN1_STRING_type_new(int type );
 int            ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b);
-int            ASN1_STRING_set(ASN1_STRING *str,unsigned char *data, int len);
+  /* Since this is used to store all sorts of things, via macros, for now, make
+     its data void * */
+int            ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
 
 int            i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp);
 ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp,
@@ -677,6 +679,9 @@ char *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)());
 ASN1_STRING *ASN1_pack_string(char *obj, int (*i2d)(), ASN1_OCTET_STRING **oct);
 
 #else
+#error "OpenSSL cannot be used with NOPROTO defined.  The NOPROTO sections in header files exist only for automatic parsing by certain utilities."
+/* Without this, highly uncomprehensible error messages can occur
+ * when compiling something with -DNOPROTO ... */
 
 ASN1_TYPE *    ASN1_TYPE_new();
 void           ASN1_TYPE_free();
@@ -805,6 +810,10 @@ ASN1_STRING *ASN1_pack_string();
 #endif
 
 /* BEGIN ERROR CODES */
+/* The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+
 /* Error codes for the ASN1 functions. */
 
 /* Function codes. */
@@ -864,6 +873,8 @@ ASN1_STRING *ASN1_pack_string();
 #define ASN1_F_D2I_AUTHORITY_KEYID                      238
 #define ASN1_F_D2I_BASIC_CONSTRAINTS                    227
 #define ASN1_F_D2I_DHPARAMS                             136
+#define ASN1_F_D2I_DIST_POINT                           276
+#define ASN1_F_D2I_DIST_POINT_NAME                      277
 #define ASN1_F_D2I_DSAPARAMS                            137
 #define ASN1_F_D2I_DSAPRIVATEKEY                        138
 #define ASN1_F_D2I_DSAPUBLICKEY                                 139
@@ -874,6 +885,7 @@ ASN1_STRING *ASN1_pack_string();
 #define ASN1_F_D2I_NETSCAPE_RSA_2                       142
 #define ASN1_F_D2I_NETSCAPE_SPKAC                       143
 #define ASN1_F_D2I_NETSCAPE_SPKI                        144
+#define ASN1_F_D2I_NOTICEREF                            268
 #define ASN1_F_D2I_PBE2PARAM                            262
 #define ASN1_F_D2I_PBEPARAM                             249
 #define ASN1_F_D2I_PBKDF2PARAM                          263
@@ -893,12 +905,15 @@ ASN1_STRING *ASN1_pack_string();
 #define ASN1_F_D2I_PKCS7_SIGN_ENVELOPE                  154
 #define ASN1_F_D2I_PKCS8_PRIV_KEY_INFO                  250
 #define ASN1_F_D2I_PKEY_USAGE_PERIOD                    239
+#define ASN1_F_D2I_POLICYINFO                           269
+#define ASN1_F_D2I_POLICYQUALINFO                       270
 #define ASN1_F_D2I_PRIVATEKEY                           155
 #define ASN1_F_D2I_PUBLICKEY                            156
 #define ASN1_F_D2I_RSAPRIVATEKEY                        157
 #define ASN1_F_D2I_RSAPUBLICKEY                                 158
 #define ASN1_F_D2I_SXNET                                241
 #define ASN1_F_D2I_SXNETID                              243
+#define ASN1_F_D2I_USERNOTICE                           271
 #define ASN1_F_D2I_X509                                         159
 #define ASN1_F_D2I_X509_ALGOR                           160
 #define ASN1_F_D2I_X509_ATTRIBUTE                       161
@@ -916,6 +931,8 @@ ASN1_STRING *ASN1_pack_string();
 #define ASN1_F_D2I_X509_REVOKED                                 173
 #define ASN1_F_D2I_X509_SIG                             174
 #define ASN1_F_D2I_X509_VAL                             175
+#define ASN1_F_DIST_POINT_NAME_NEW                      278
+#define ASN1_F_DIST_POINT_NEW                           279
 #define ASN1_F_GENERAL_NAME_NEW                                 231
 #define ASN1_F_I2D_ASN1_HEADER                          176
 #define ASN1_F_I2D_ASN1_TIME                            225
@@ -935,6 +952,7 @@ ASN1_STRING *ASN1_pack_string();
 #define ASN1_F_NETSCAPE_PKEY_NEW                        189
 #define ASN1_F_NETSCAPE_SPKAC_NEW                       190
 #define ASN1_F_NETSCAPE_SPKI_NEW                        191
+#define ASN1_F_NOTICEREF_NEW                            272
 #define ASN1_F_PBE2PARAM_NEW                            264
 #define ASN1_F_PBEPARAM_NEW                             251
 #define ASN1_F_PBKDF2PARAM_NEW                          265
@@ -954,8 +972,11 @@ ASN1_STRING *ASN1_pack_string();
 #define ASN1_F_PKCS7_SIGN_ENVELOPE_NEW                  201
 #define ASN1_F_PKCS8_PRIV_KEY_INFO_NEW                  252
 #define ASN1_F_PKEY_USAGE_PERIOD_NEW                    240
+#define ASN1_F_POLICYINFO_NEW                           273
+#define ASN1_F_POLICYQUALINFO_NEW                       274
 #define ASN1_F_SXNETID_NEW                              244
 #define ASN1_F_SXNET_NEW                                242
+#define ASN1_F_USERNOTICE_NEW                           275
 #define ASN1_F_X509_ALGOR_NEW                           202
 #define ASN1_F_X509_ATTRIBUTE_NEW                       203
 #define ASN1_F_X509_CINF_NEW                            204
@@ -1035,7 +1056,7 @@ ASN1_STRING *ASN1_pack_string();
 #define ASN1_R_WRONG_PRINTABLE_TYPE                     148
 #define ASN1_R_WRONG_TAG                                149
 #define ASN1_R_WRONG_TYPE                               150
+
 #ifdef  __cplusplus
 }
 #endif