On Wed, Jan 20, 1999, [EMAIL PROTECTED] wrote:

> Full_Name: 
> Version: 2.1.7-1.3.4
> OS: AIX 4.2 / apache 1.3.4
> Submission from: felix.adpcl.com (194.98.137.100)
> 
> Error when compiling ca-fix.c
> example:
> 
> make certificate TYPE=test
> + finding random files on your platform
> + building ca-fix auxiliary tool
>   xlc ..........
> 
> "ca-fix.c", line 450.24 (E) Operation between types "unsigned char *" and "char
> *" is not allowed
> "ca-fix.c", line 459.24 (E) Operation between types "unsigned char *" and "char
> *" is not allowed
> "ca-fix.c", line 462.49 (E) Function argument assignment between types "const
> char *" and "unsigned char *" is not allowed
> "ca-fix.c", line 475.42 (E) Function argument assignment between types "char *"
> and "unsigned char *" is not allowed
> "ca-fix.c", line 512.45 (E) Function argument assignment between types "unsigned
> char *" and "char *" is not allowed
> "ca-fix.c", line 588.6  (S) Redeclaration of add_ext differs from previous
> declaration on line 76 of "ca-fix.c"
> "ca-fix.c", line 588.6  (I) Prototype for function add_ext must contain only
> promoted types if prototype and nonprototype declarations are mixed
> "ca-fix.c", line 588.6  (I) Parameter 3 has type "char" which promotes to "int"

Oh hell, AIX 4.2....  But nevertheless this nasty C compiler is right. There
are type inconsistencies inside ca-fix.c. But the last tree messages are just
too sensible ones. I've fixed all of them and tried it under AIX 4.2 myself
and now it silently compiles ca-fix without complains. It's fixed in mod_ssl
2.1.8. In the meantime I append you the patch I've committed to for 2.1.8.
Thanks for the feedback.
                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com

Index: ca-fix.c
===================================================================
RCS file: /e/apache/SSL/REPOS/mod_ssl/pkg.apache/src/support/ca-fix.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ca-fix.c    1998/10/09 10:31:12     1.1
+++ ca-fix.c    1999/01/20 14:57:06     1.2
@@ -41,12 +41,10 @@
     ASN1_INTEGER *pathlen;
 } BASIC_CONSTRAINTS;
 
-int i2d_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS * a, unsigned char **pp);
-ASN1_OBJECT *__OBJ_txt2obj(char *name);
+int i2d_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS *, unsigned char **);
+ASN1_OBJECT *__OBJ_txt2obj(char *);
 
-int i2d_BASIC_CONSTRAINTS(a, pp)
-     BASIC_CONSTRAINTS *a;
-     unsigned char **pp;
+int i2d_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS *a, unsigned char **pp)
 {
     M_ASN1_I2D_vars(a);
     if (a->ca)
@@ -54,7 +52,6 @@
     M_ASN1_I2D_len(a->pathlen, i2d_ASN1_INTEGER);
 
     M_ASN1_I2D_seq_total();
-
     if (a->ca)
         M_ASN1_I2D_put(a->ca, i2d_ASN1_BOOLEAN);
     M_ASN1_I2D_put(a->pathlen, i2d_ASN1_INTEGER);
@@ -73,13 +70,11 @@
 STACK *exts;
 STACK *extusage;
 
-void add_ext(char *name, char *val, char crit);
+void add_ext(char *, char *, char);
 
 unsigned char extbuf[10240];
 
-int main(argc, argv)
-     int argc;
-     char **argv;
+int main(int argc, char **argv)
 {
     char *infile = NULL, *outfile = NULL, *keyname = NULL;
     BIO *in = NULL, *out = NULL, *inkey = NULL, *bio_err = NULL;
@@ -93,8 +88,7 @@
     unsigned char setkey = 0;
     X509 *cert;
     EVP_PKEY *pkey = NULL;
-    BASIC_CONSTRAINTS bcons =
-    {0, NULL};
+    BASIC_CONSTRAINTS bcons = {0, NULL};
     EVP_MD *dgst;
 
     if (bio_err == NULL)
@@ -447,7 +441,7 @@
                     fprintf(stderr, "Invalid raw extension length\n");
                     exit(1);
                 }
-                for (p = tmpext->value; *p; p++)
+                for (p = (unsigned char *)tmpext->value; *p; p++)
                     if (!isxdigit(*p)) {
                         fprintf(stderr, "Extension %s invalid hex digit %c\n",
                                 tmpext->value, *p);
@@ -456,10 +450,10 @@
                 rawlen >>= 1;
                 rawext = Malloc(rawlen);
                 tmphex[2] = 0;
-                for (p = tmpext->value, q = rawext; *p; p += 2, q++) {
+                for (p = (unsigned char *)tmpext->value, q = rawext; *p; p += 2, q++) 
+{
                     tmphex[0] = p[0];
                     tmphex[1] = p[1];
-                    *q = (unsigned char) strtol(tmphex, NULL, 16);
+                    *q = (unsigned char)strtol((const char *)tmphex, NULL, 16);
                 }
                 str = ASN1_OCTET_STRING_new();
                 ASN1_OCTET_STRING_set(str, rawext, rawlen);
@@ -472,7 +466,7 @@
                     BIO_printf(bio_err, "Error opening file %s\n", tmpext->value);
                     ERR_print_errors(bio_err);
                 }
-                extlen = BIO_read(tmpin, extbuf, sizeof(extbuf));
+                extlen = BIO_read(tmpin, (char *)extbuf, sizeof(extbuf));
                 str = ASN1_STRING_new();
                 ASN1_OCTET_STRING_set(str, extbuf, extlen);
             }
@@ -509,7 +503,8 @@
 
                 if (ext_str)
                     str = X509v3_pack_string(NULL, V_ASN1_IA5STRING,
-                                      tmpext->value, strlen(tmpext->value));
+                                      (unsigned char *)tmpext->value, 
+                                      strlen(tmpext->value));
                 else
                     str = X509v3_pack_string(NULL, V_ASN1_BIT_STRING,
                                              &ext_bit, 1);
@@ -585,10 +580,7 @@
 
 }
 
-void add_ext(name, val, flag)
-     char *name;
-     char *val;
-     char flag;
+void add_ext(char *name, char *val, char flag)
 {
     EXT_ADD *tmpext;
     if (!exts)
@@ -600,8 +592,7 @@
     sk_push(exts, (char *) tmpext);
 }
 
-ASN1_OBJECT *__OBJ_txt2obj(name)
-     char *name;
+ASN1_OBJECT *__OBJ_txt2obj(char *name)
 {
     int obj_nid;
     ASN1_OBJECT *obj;

______________________________________________________________________
Apache Interface to SSLeay (mod_ssl)   www.engelschall.com/sw/mod_ssl/
Official Support Mailing List               [EMAIL PROTECTED]
Automated List Manager                       [EMAIL PROTECTED]

Reply via email to