Fix warnings.
authorBen Laurie <ben@openssl.org>
Mon, 6 Sep 1999 11:06:54 +0000 (11:06 +0000)
committerBen Laurie <ben@openssl.org>
Mon, 6 Sep 1999 11:06:54 +0000 (11:06 +0000)
crypto/evp/encode.c
crypto/evp/evp.h
crypto/x509/x509.h
crypto/x509/x509spki.c

index 0152624..14a4cb1 100644 (file)
@@ -185,7 +185,7 @@ void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)
        *outl=ret;
        }
 
-int EVP_EncodeBlock(unsigned char *t, unsigned char *f, int dlen)
+int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen)
        {
        int i,ret=0;
        unsigned long l;
@@ -337,7 +337,7 @@ end:
        return(rv);
        }
 
-int EVP_DecodeBlock(unsigned char *t, unsigned char *f, int n)
+int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n)
        {
        int i,ret=0,a,b,c,d;
        unsigned long l;
index 570fe27..95ead04 100644 (file)
@@ -521,15 +521,14 @@ void      EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
 void   EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,
                int *outl,unsigned char *in,int inl);
 void   EVP_EncodeFinal(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl);
-int    EVP_EncodeBlock(unsigned char *t, unsigned char *f, int n);
+int    EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n);
 
 void   EVP_DecodeInit(EVP_ENCODE_CTX *ctx);
 int    EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl,
                unsigned char *in, int inl);
 int    EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned
                char *out, int *outl);
-int    EVP_DecodeBlock(unsigned char *t, unsigned
-               char *f, int n);
+int    EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
 
 void   ERR_load_EVP_strings(void );
 
index 1a3071c..262be3f 100644 (file)
@@ -552,7 +552,7 @@ int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
 int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
 int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r);
 
-NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(char *str, int len);
+NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len);
 char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
 EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
 int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
index 984e35a..b35c3f9 100644 (file)
@@ -76,7 +76,7 @@ EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x)
 
 /* Load a Netscape SPKI from a base64 encoded string */
 
-NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(char *str, int len)
+NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len)
 {
        unsigned char *spki_der, *p;
        int spki_len;
@@ -86,7 +86,7 @@ NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(char *str, int len)
                X509err(X509_F_NETSCAPE_SPKI_B64_DECODE, ERR_R_MALLOC_FAILURE);
                return NULL;
        }
-       spki_len = EVP_DecodeBlock(spki_der, str, len);
+       spki_len = EVP_DecodeBlock(spki_der, (const unsigned char *)str, len);
        if(spki_len < 0) {
                X509err(X509_F_NETSCAPE_SPKI_B64_DECODE,
                                                X509_R_BASE64_DECODE_ERROR);
@@ -115,7 +115,7 @@ char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki)
        }
        p = der_spki;
        i2d_NETSCAPE_SPKI(spki, &p);
-       EVP_EncodeBlock(b64_str, der_spki, der_len);
+       EVP_EncodeBlock((unsigned char *)b64_str, der_spki, der_len);
        Free(der_spki);
        return b64_str;
 }