Constify the RSA parts of the ASN.1 library. Note some ugly casts
[openssl.git] / crypto / asn1 / d2i_pu.c
index 142742e8449db332eece78638ab1b24423c19548..fdbc0ac9e8192d1364d522f32be7c8f883d530c7 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/asn1/d2i_pu.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "bn.h"
-#include "evp.h"
-#include "objects.h"
-#include "x509.h"
+#include <openssl/bn.h>
+#include <openssl/evp.h>
+#include <openssl/objects.h>
+#include <openssl/asn1.h>
 
-EVP_PKEY *d2i_PublicKey(type,a,pp,length)
-int type;
-EVP_PKEY **a;
-unsigned char **pp;
-long length;
+EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
+            long length)
        {
        EVP_PKEY *ret;
 
@@ -87,7 +84,8 @@ long length;
                {
 #ifndef NO_RSA
        case EVP_PKEY_RSA:
-               if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL,pp,length)) == NULL)
+               if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL,
+                       (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
                        {
                        ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
                        goto err;
@@ -106,7 +104,7 @@ long length;
        default:
                ASN1err(ASN1_F_D2I_PUBLICKEY,ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);
                goto err;
-               break;
+               /* break; */
                }
        if (a != NULL) (*a)=ret;
        return(ret);