diff -Naur openssl-1.0.0q.orig/.gitignore openssl-1.0.0q/.gitignore
--- openssl-1.0.0q.orig/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/.gitignore	2017-04-25 16:23:39.673529454 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/addon/.gitignore openssl-1.0.0q/addon/.gitignore
--- openssl-1.0.0q.orig/addon/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/.gitignore	2017-04-25 16:23:39.674527066 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/addon/asynch_rsa_gen.c openssl-1.0.0q/addon/asynch_rsa_gen.c
--- openssl-1.0.0q.orig/addon/asynch_rsa_gen.c	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/asynch_rsa_gen.c	2017-04-25 16:23:39.676525365 +0200
@@ -0,0 +1,529 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
+*  Code copied from openssl and modified by haavardm, to make the key generation asynchronous
+*
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+/* crypto/rsa/rsa_gen.c */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ * 
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ * 
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (eay@cryptsoft.com)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from 
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
+#include <openssl/cryptlib.h>
+#include <openssl/bn.h>
+#include <openssl/rsa.h>
+#include "modules/libopeay/addon/asynch_rsa_gen.h"
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/openssl/crypto.h"
+#include "modules/libopeay/openssl/buffer.h"
+#include "modules/libopeay/openssl/bn.h"
+#include "modules/libopeay/openssl/evp.h"
+#include "modules/libopeay/openssl/rsa.h"
+#include "modules/libopeay/openssl/objects.h"
+#include "modules/libopeay/openssl/x509.h"
+
+#define SSL_SHA_LENGTH 20
+
+static int GenerateKey_update(int a,int b,void* HDlg)
+{ 
+	return 0;
+}
+
+
+
+static int rsa_builtin_keygen_asynch(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb, RSA_KEYGEN_STATE_HANDLE *state_handle);
+
+
+/*RSA_generate_key_ex_asynch is for testing only*/
+int RSA_generate_key_ex_asynch(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb, RSA_KEYGEN_STATE_HANDLE * state_handle)
+	{
+	state_handle->rsa = rsa;
+	state_handle->e_value = *e_value;
+	state_handle->cb = *cb;
+	state_handle->bits = bits;
+	
+	state_handle->error=FALSE;
+	
+	state_handle->state = RSA_KEYGEN_INITIALISING;
+	state_handle->progress = 0;
+	if(state_handle->rsa->meth->rsa_keygen)
+		{
+		int ok = state_handle->rsa->meth->rsa_keygen(state_handle->rsa, state_handle->bits, &state_handle->e_value, &state_handle->cb);
+		state_handle->state = RSA_KEYGEN_DONE;		
+		return ok;
+		}
+	return 1;	
+	}
+
+RSA_KEYGEN_STATE_HANDLE *RSA_generate_key_ex_asynch_init(int bits)
+	{
+	RSA_KEYGEN_STATE_HANDLE *state_handle = (RSA_KEYGEN_STATE_HANDLE*) OPENSSL_malloc(sizeof(RSA_KEYGEN_STATE_HANDLE));
+	if(state_handle == NULL)
+		return NULL;
+
+	BN_init(&state_handle->e_value);
+	state_handle->error = FALSE;
+		
+	if(!BN_set_word(&state_handle->e_value, RSA_F4))
+	{
+    	OPENSSL_free(state_handle);	
+    	return NULL;
+	}
+
+	state_handle->rsa = RSA_new();
+
+    if(state_handle->rsa == NULL)
+    {
+    	OPENSSL_free(state_handle);	
+    	return NULL;
+    }
+		
+	BN_GENCB_set_old(&state_handle->cb, GenerateKey_update, 0L);		
+		
+	state_handle->state = RSA_KEYGEN_INITIALISING;
+	state_handle->progress = 0;
+	state_handle->bits = bits;
+
+	if(state_handle->rsa->meth->rsa_keygen)
+		{
+		state_handle->rsa->meth->rsa_keygen(state_handle->rsa, state_handle->bits, &state_handle->e_value, &state_handle->cb);
+		state_handle->state = RSA_KEYGEN_DONE;		
+		return state_handle;
+		}
+	return state_handle;
+	}
+
+int RSA_generate_key_ex_asynch_runslice(RSA_KEYGEN_STATE_HANDLE * state_handle)
+	{
+	if 	(state_handle->state == RSA_KEYGEN_DONE)
+		{
+		return 1;
+		}
+
+	int ret = rsa_builtin_keygen_asynch(state_handle->rsa, state_handle->bits, &state_handle->e_value, &state_handle->cb, state_handle);
+	state_handle->progress =(int) ((100*(int)state_handle->state )/ (int)RSA_KEYGEN_DONE);
+		if (state_handle->progress > 100)
+			{
+			state_handle->progress = 100;
+			}
+	return ret;
+	}
+	
+static int rsa_builtin_keygen_asynch(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb, RSA_KEYGEN_STATE_HANDLE *state_handle)
+	{
+	BIGNUM *r0,*r1,*r2,*tmp;
+	int bitsp,bitsq,ok=-1,n,degenerate;
+	BN_CTX *ctx = NULL;
+	
+	if (state_handle->state == RSA_KEYGEN_INITIALISING)
+		{
+		state_handle->ctx = BN_CTX_new();
+		if ( state_handle->ctx == NULL) goto err;
+		BN_CTX_start(state_handle->ctx);
+			
+		state_handle->r0 = BN_CTX_get(state_handle->ctx);
+		state_handle->r1 = BN_CTX_get(state_handle->ctx);
+		state_handle->r2 = BN_CTX_get(state_handle->ctx);
+		state_handle->r3 = BN_CTX_get(state_handle->ctx);
+		
+		if (state_handle->r3 == NULL) goto err;
+
+
+		state_handle->bitsp = (bits+1)/2;
+		state_handle->bitsq = bits - state_handle->bitsp;
+
+		state_handle->ok = -1;
+		state_handle->n = 0;
+
+		state_handle->tmp = NULL;	
+
+		state_handle->degenerate = 0;
+		}
+		
+	degenerate = state_handle->degenerate;	
+	ctx = state_handle->ctx;
+	r0 = state_handle->r0;
+	r1 = state_handle->r1;
+	r2 = state_handle->r2;
+
+
+	bitsp = state_handle->bitsp;
+	bitsq = state_handle->bitsq;
+
+	ok = state_handle->ok;
+	n = state_handle->n;
+
+	tmp = state_handle->tmp;
+		
+	if (state_handle->state == RSA_KEYGEN_INITIALISING)
+		{
+		/* We need the RSA components non-NULL */
+		if(!rsa->n && ((rsa->n=BN_new()) == NULL)) goto err;
+		if(!rsa->d && ((rsa->d=BN_new()) == NULL)) goto err;
+		if(!rsa->e && ((rsa->e=BN_new()) == NULL)) goto err;
+		if(!rsa->p && ((rsa->p=BN_new()) == NULL)) goto err;
+		if(!rsa->q && ((rsa->q=BN_new()) == NULL)) goto err;
+		if(!rsa->dmp1 && ((rsa->dmp1=BN_new()) == NULL)) goto err;
+		if(!rsa->dmq1 && ((rsa->dmq1=BN_new()) == NULL)) goto err;
+		if(!rsa->iqmp && ((rsa->iqmp=BN_new()) == NULL)) goto err;
+	
+		BN_copy(rsa->e, e_value);
+		
+		state_handle->state = RSA_KEYGEN_GENERATING_P;
+		return 0;
+		}
+	if (state_handle->state == RSA_KEYGEN_GENERATING_P)
+		{
+		if(!BN_generate_prime_ex(rsa->p, bitsp, 0, NULL, NULL, cb))
+			goto err;
+		if (!BN_sub(r2,rsa->p,BN_value_one())) goto err;
+		if (!BN_gcd(r1,r2,rsa->e,ctx)) goto err;
+		if (BN_is_one(r1)) 
+			{
+			state_handle->state = RSA_KEYGEN_DONE_GENERATING_P;
+			return 0;	
+			};
+		if(!BN_GENCB_call(cb, 2, n++))
+			goto err;
+		return 0;
+		}
+
+	if (state_handle->state == RSA_KEYGEN_DONE_GENERATING_P)
+		{
+		if(!BN_GENCB_call(cb, 3, 0))
+			goto err;
+		state_handle->state = RSA_KEYGEN_GENERATING_Q1;
+		state_handle->degenerate = 0;
+		return 0;
+		}
+		/* When generating ridiculously small keys, we can get stuck
+		 * continually regenerating the same prime values. Check for
+		 * this and bail if it happens 3 times. */
+
+	if (state_handle->state == RSA_KEYGEN_GENERATING_Q1)		 
+		{
+		if(!BN_generate_prime_ex(rsa->q, bitsq, 0, NULL, NULL, cb))
+			goto err;
+
+		if ((BN_cmp(rsa->p, rsa->q) == 0) && (++degenerate < 3))
+			{
+			state_handle->state = RSA_KEYGEN_GENERATING_Q1;
+			}
+		else
+			{
+			state_handle->state = RSA_KEYGEN_GENERATING_Q2;
+			}	
+		return 0;
+		}
+					
+	if (state_handle->state == RSA_KEYGEN_GENERATING_Q2)		 
+		{		
+		if(degenerate == 3)
+			{
+			ok = 0; /* we set our own err */
+			RSAerr(RSA_F_RSA_BUILTIN_KEYGEN,RSA_R_KEY_SIZE_TOO_SMALL);
+			goto err;
+			}
+			
+		if (!BN_sub(r2,rsa->q,BN_value_one())) goto err;
+		if (!BN_gcd(r1,r2,rsa->e,ctx)) goto err;
+		if (BN_is_one(r1))
+			{
+			state_handle->state = RSA_KEYGEN_DONE_GENERATING_Q;
+			return 0;	
+			}
+		if(!BN_GENCB_call(cb, 2, n++))
+			goto err;
+		state_handle->state = RSA_KEYGEN_GENERATING_Q1;	
+		state_handle->degenerate = 0;
+		return 0;
+		}
+		
+	if (state_handle->state == RSA_KEYGEN_DONE_GENERATING_Q)
+		{
+			if(!BN_GENCB_call(cb, 3, 1))
+				goto err;
+			if (BN_cmp(rsa->p,rsa->q) < 0)
+				{
+				tmp=rsa->p;
+				rsa->p=rsa->q;
+				rsa->q=tmp;
+				}
+		
+			/* calculate n */
+			if (!BN_mul(rsa->n,rsa->p,rsa->q,ctx)) goto err;
+		
+			/* calculate d */
+			if (!BN_sub(r1,rsa->p,BN_value_one())) goto err;	/* p-1 */
+			if (!BN_sub(r2,rsa->q,BN_value_one())) goto err;	/* q-1 */
+			if (!BN_mul(r0,r1,r2,ctx)) goto err;	/* (p-1)(q-1) */
+			if (!BN_mod_inverse(rsa->d,rsa->e,r0,ctx)) goto err;	/* d */
+		
+			/* calculate d mod (p-1) */
+			if (!BN_mod(rsa->dmp1,rsa->d,r1,ctx)) goto err;
+		
+			/* calculate d mod (q-1) */
+			if (!BN_mod(rsa->dmq1,rsa->d,r2,ctx)) goto err;
+		
+			/* calculate inverse of q mod p */
+			if (!BN_mod_inverse(rsa->iqmp,rsa->q,rsa->p,ctx)) goto err;
+		
+			ok=1;
+			state_handle->state = RSA_KEYGEN_DONE;
+		}
+err:
+	if (ok == -1)
+		{
+		state_handle->state = RSA_KEYGEN_DONE;
+		RSAerr(RSA_F_RSA_BUILTIN_KEYGEN,ERR_LIB_BN);
+		ok=0;
+		}
+	if(ctx)
+	{
+		BN_CTX_end(ctx);
+		BN_CTX_free(ctx);
+	}
+
+	return ok;
+	}
+
+void RSA_keygen_asynch_clean_up(RSA_KEYGEN_STATE_HANDLE * state_handle)
+{
+	OPENSSL_free(state_handle);
+}
+
+unsigned char *
+RSA_keygen_asynch_get_public_key(
+		enum SSL_Certificate_Request_Format format,
+		const char* challenge,
+		unsigned char* spki_string,
+		unsigned long* spki_len,
+		unsigned long* keylength,
+		RSA_KEYGEN_STATE_HANDLE* state_handle)
+	{
+				
+	EVP_PKEY *pkey = NULL;
+	EVP_MD_CTX sha;
+	unsigned char *temp,*buffer=NULL, *ret=NULL;
+	X509_PUBKEY *pk;
+	ASN1_OBJECT *o;
+	X509_ALGOR *a;
+	
+	unsigned int len1;
+	unsigned long len;
+
+	BN_clear_free(&state_handle->e_value);
+	
+	pkey = EVP_PKEY_new();
+	int err = EVP_PKEY_assign_RSA(pkey, state_handle->rsa);
+	if (err != 1)
+	{
+		RSA_free(state_handle->rsa);
+		goto err;
+	}
+
+    len = i2d_PrivateKey(pkey,NULL);
+	if(len <= 0)
+	    goto err;
+
+    *keylength = len + SSL_SHA_LENGTH;
+	buffer= (unsigned char *) OPENSSL_malloc((size_t) *keylength);
+	if(buffer == NULL)
+	    goto err;
+
+    temp = buffer + SSL_SHA_LENGTH;
+	len1 =len = i2d_PublicKey(pkey,&temp);
+	if(len <= 0)
+	    goto err;
+
+    EVP_DigestInit(&sha,EVP_sha1());
+	EVP_DigestUpdate(&sha,buffer+ SSL_SHA_LENGTH,len1);
+	EVP_DigestFinal(&sha,buffer,&len1);
+
+	if(format == SSL_Netscape_SPKAC)
+		{
+		NETSCAPE_SPKI *spki= NULL;
+	
+		spki = NETSCAPE_SPKI_new();
+		if(spki == NULL) 
+			goto err;
+      
+		pk = spki->spkac->pubkey;
+		a= pk->algor;
+    
+		if (!ASN1_BIT_STRING_set(pk->public_key,buffer + SSL_SHA_LENGTH,len)) goto err;
+
+		if ((o=OBJ_nid2obj(pkey->type)) == NULL) goto err;
+		ASN1_OBJECT_free(a->algorithm);
+		a->algorithm=o;
+
+	   /* Set the parameter list */
+		if ((a->parameter == NULL) || (a->parameter->type != V_ASN1_NULL))
+			{
+			ASN1_TYPE_free(a->parameter);
+			a->parameter=ASN1_TYPE_new();
+			if(a->parameter == NULL)
+				goto err;
+			a->parameter->type=V_ASN1_NULL;
+			}
+    
+		if(challenge != NULL && op_strlen(challenge) > 0)
+			ASN1_STRING_set(spki->spkac->challenge,(unsigned char *) challenge,op_strlen(challenge));
+
+		NETSCAPE_SPKI_sign(spki,pkey,EVP_md5());  
+		len = i2d_NETSCAPE_SPKI(spki,NULL);
+
+		if(/*len < 0 ||*/ len > *spki_len)
+			goto err;
+        
+	    temp = spki_string;
+	    *spki_len = i2d_NETSCAPE_SPKI(spki,&temp);
+		
+		NETSCAPE_SPKI_free(spki);
+		}
+	else if(format == SSL_PKCS10)
+		{
+		X509_REQ *req = NULL;
+		X509_NAME_ENTRY *cn_challenge = NULL;
+
+		req = X509_REQ_new();
+		if(req == NULL)
+			goto err;
+
+		ASN1_INTEGER_set(req->req_info->version, 0);
+
+		pk = req->req_info->pubkey;
+		a = pk->algor;
+
+		if (!ASN1_BIT_STRING_set(pk->public_key,buffer + SSL_SHA_LENGTH,len))
+			goto err;
+
+		if ((o=OBJ_nid2obj(pkey->type)) == NULL)
+			goto err;
+		ASN1_OBJECT_free(a->algorithm);
+		a->algorithm=o;
+
+	   /* Set the parameter list */
+		if ((a->parameter == NULL) || (a->parameter->type != V_ASN1_NULL))
+			{
+			ASN1_TYPE_free(a->parameter);
+			a->parameter=ASN1_TYPE_new();
+			if(a->parameter == NULL)
+				goto err;
+			a->parameter->type=V_ASN1_NULL;
+			}
+
+		if(challenge == NULL || *challenge == '\0')
+			challenge = "Certificate request generated by Opera";
+
+		if(challenge != NULL && op_strlen(challenge) > 0)
+			{
+			cn_challenge= X509_NAME_ENTRY_new();
+			if(cn_challenge == NULL)
+				{
+				X509_REQ_free(req);
+				goto err;
+				}
+			cn_challenge->object = OBJ_nid2obj(NID_commonName);
+			ASN1_STRING_free(cn_challenge->value);
+			cn_challenge->value = ASN1_T61STRING_new();
+			if(cn_challenge->value == NULL)
+				{
+				X509_NAME_ENTRY_free(cn_challenge);
+				X509_REQ_free(req);
+				goto err;
+				}
+
+			ASN1_STRING_set(cn_challenge->value,(unsigned char *) challenge,op_strlen(challenge));
+
+			X509_NAME_add_entry(req->req_info->subject, cn_challenge,-1,-1);
+			}
+
+		X509_REQ_sign(req,pkey,EVP_md5());  
+
+		len = i2d_X509_REQ(req,NULL);
+		if(/*len < 0 || */len > *spki_len)
+			goto err;
+        
+        temp = spki_string;
+        *spki_len = i2d_X509_REQ(req,&temp);
+		
+		X509_REQ_free(req);
+		}
+
+    temp = buffer + SSL_SHA_LENGTH;
+    len = i2d_PrivateKey(pkey,&temp);
+    if(len != *keylength - SSL_SHA_LENGTH)
+        goto err;
+    
+    ret = buffer;
+    buffer = NULL;
+err:;
+	if(buffer != NULL)
+		{
+		OPENSSL_free(buffer);
+		ret = NULL;
+		state_handle->error = TRUE;	
+		}
+
+	EVP_PKEY_free(pkey);   	
+   	return ret;
+	}
+
+#endif //LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
diff -Naur openssl-1.0.0q.orig/addon/asynch_rsa_gen.h openssl-1.0.0q/addon/asynch_rsa_gen.h
--- openssl-1.0.0q.orig/addon/asynch_rsa_gen.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/asynch_rsa_gen.h	2017-04-25 16:23:39.677526051 +0200
@@ -0,0 +1,116 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
+*  
+* Asyncronous key generation algorithm api
+* 
+* author: haavardm
+*/
+#ifndef ASYNCH_RSA_GEN_H_
+#define ASYNCH_RSA_GEN_H_
+
+#include "modules/libssl/sslenum.h"
+
+typedef enum  
+	{		
+	RSA_KEYGEN_INITIALISING = 0,	
+	RSA_KEYGEN_GENERATING_P,
+	RSA_KEYGEN_DONE_GENERATING_P,
+	RSA_KEYGEN_GENERATING_Q1,
+	RSA_KEYGEN_GENERATING_Q2,	
+	RSA_KEYGEN_DONE_GENERATING_Q,
+	RSA_KEYGEN_DONE,
+	} rsa_keygen_internal_state;
+
+typedef struct keygen_state_handle 
+	{
+	rsa_keygen_internal_state state;	
+	RSA *rsa; 
+	int bits; 
+	BIGNUM e_value; 
+	BN_GENCB cb;
+
+	BIGNUM *r0;
+	BIGNUM *r1;
+	BIGNUM *r2;
+	BIGNUM *r3;
+	BIGNUM *tmp;
+	
+	int bitsp;
+	int bitsq;
+	int ok;
+	int n;
+	BN_CTX *ctx;
+
+	unsigned int degenerate;
+
+	BOOL error;
+	
+	int progress;
+	} RSA_KEYGEN_STATE_HANDLE;
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+
+/** Runs a slice of the keygeneration algorithm
+ * 
+ * 
+ * @param state_handle (in) the state handle
+ * 
+ * @return ok-kode 1==ok, 0==error
+ * 
+ **/
+int RSA_generate_key_ex_asynch_runslice(RSA_KEYGEN_STATE_HANDLE * state_handle);
+
+
+/* Inits the keygeneration algorithm
+ * 
+ * @param keyPairBitSize (in) the bitsize of the keys
+ * 
+ * @return the a new state handler
+ * 
+ * when state_handle->state == RSA_KEYGEN_DONE,
+ * stop loogin and call RSA_keygen_asynch_get_public_key
+ * The state handle MUST be deleted by RSA_keygen_asynch_clean_up
+ */
+ 
+RSA_KEYGEN_STATE_HANDLE *RSA_generate_key_ex_asynch_init(int keyPairBitSize);
+
+/* Call this when state_handle->state == RSA_KEYGEN_DONE after a call to RSA_generate_key_ex_asynch_runslice 
+ * 
+ * @param format (in) certificate format
+ * @param challenge (in) unknown (ynge?)
+ * @param publicKey (out) the public part of the key
+ * @param public_key_length (out) length of public key
+ * @param privateKeylength (out) length of the private key
+ * @param state_handle the (in) keygeneration state handler
+ * 
+ * returns the the private key, NULL if error
+ * 
+ * check state_handle->state for state
+ * and state_handle->error for error 
+ */ 
+unsigned char *
+RSA_keygen_asynch_get_public_key(enum SSL_Certificate_Request_Format format,
+						   	const char *challenge, unsigned char *public_key, 
+						   	unsigned long *public_key_length,unsigned long *privateKeylength,
+							RSA_KEYGEN_STATE_HANDLE * state_handle);
+							
+/** free's the RSA_KEYGEN_STATE_HANDLE generated by RSA_generate_key_ex_asynch_init
+ *
+ * @param state_handle (in) the state handle
+ * 
+ **/
+void RSA_keygen_asynch_clean_up(RSA_KEYGEN_STATE_HANDLE * state_handle);
+
+/**
+ * Low level asynchronous keygeneration algorithm
+ * Do --NOT-- use this function together with RSA_generate_key_ex_asynch_init or RSA_keygen_asynch_clean_up
+ * 
+ */
+int RSA_generate_key_ex_asynch(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb, RSA_KEYGEN_STATE_HANDLE * state_handle);
+
+#ifdef  __cplusplus
+}
+#endif
+#endif /*ASYNCH_RSA_GEN_H_*/
diff -Naur openssl-1.0.0q.orig/addon/cert_ex_data.c openssl-1.0.0q/addon/cert_ex_data.c
--- openssl-1.0.0q.orig/addon/cert_ex_data.c	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/cert_ex_data.c	2017-04-25 16:23:39.678526737 +0200
@@ -0,0 +1,32 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 2007-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+**
+*/
+
+#ifdef LIBOPEAY_X509_EX_DATA
+
+#include "modules/libopeay/openssl/x509.h"
+
+#include "modules/libopeay/libopeay_module.h"
+#include "modules/libopeay/libopeay_implmodule.h"
+
+void free_X509_EV_OID_data(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
+					int idx, long argl, void *argp)
+{
+	sk_ASN1_OBJECT_pop_free((STACK_OF(ASN1_OBJECT) *) ptr, ASN1_OBJECT_free);
+}
+
+int CheckX509_EV_dataID()
+{
+	if(g_ev_oid_x509_list_index != -1)
+		return g_ev_oid_x509_list_index;
+
+	g_ev_oid_x509_list_index = X509_get_ex_new_index(0, NULL, NULL, NULL, free_X509_EV_OID_data);
+	return g_ev_oid_x509_list_index;
+}
+
+#endif
diff -Naur openssl-1.0.0q.orig/addon/digestex.c openssl-1.0.0q/addon/digestex.c
--- openssl-1.0.0q.orig/addon/digestex.c	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/digestex.c	2017-04-25 16:23:39.679526305 +0200
@@ -0,0 +1,110 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+**
+*/
+
+/* addon/digestex.c : cut from crypto/rsa/rsa_sign.c */
+/* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@mincom.oz.au).
+ * The implementation was written so as to conform with Netscapes SSL.
+ * 
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@mincom.oz.au).
+ * 
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (eay@mincom.oz.au)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from 
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (tjh@mincom.oz.au)"
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#if defined SSL_2_0_SUPPORT            
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/openssl/bn.h"
+#include "modules/libopeay/openssl/rsa.h"
+#include "modules/libopeay/openssl/objects.h"
+#include "modules/libopeay/openssl/x509.h"
+
+/* Creates a DER encode X509 signature object, ready for encryption  based on the argument hashstring */
+/* Based on RSA_Sign() */
+int OPEAY_ExtractDigest(int type, unsigned char *m, unsigned int m_len, unsigned char *sigret, unsigned int *siglen)
+{
+    X509_SIG sig;
+    ASN1_TYPE parameter;
+    int ret;
+    X509_ALGOR algor;
+    ASN1_OCTET_STRING digest;
+	
+    sig.algor= &algor;
+    sig.algor->algorithm=OBJ_nid2obj(type);
+    if (sig.algor->algorithm == NULL)
+	{
+        RSAerr(RSA_F_RSA_SIGN,RSA_R_UNKNOWN_ALGORITHM_TYPE);
+        return(0);
+	}
+    if (sig.algor->algorithm->length == 0)
+	{
+        RSAerr(RSA_F_RSA_SIGN,RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD);
+        return(0);
+	}
+    parameter.type=V_ASN1_NULL;
+    parameter.value.ptr=NULL;
+    sig.algor->parameter= &parameter;
+	
+    sig.digest= &digest;
+    sig.digest->data=m;
+    sig.digest->length=m_len;
+	
+    ret= i2d_X509_SIG(&sig,(sigret != NULL ? &sigret : NULL));
+    if(siglen != NULL)
+        *siglen = ret;
+    return ret;
+}
+#endif
diff -Naur openssl-1.0.0q.orig/addon/elgamal.c openssl-1.0.0q/addon/elgamal.c
--- openssl-1.0.0q.orig/addon/elgamal.c	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/elgamal.c	2017-04-25 16:23:39.680525594 +0200
@@ -0,0 +1,550 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+**
+*/
+
+/* addon/elgamal.c */
+/* Parts of this code is modelled or copied from OpenSSL code under the following terms */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ * 
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ * 
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (eay@cryptsoft.com)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from 
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#if defined(NEED_LIBOPEAY_ELGAMAL)
+
+
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/openssl/crypto.h"
+#include "modules/libopeay/openssl/err.h"
+#include "modules/libopeay/openssl/buffer.h"
+#include "modules/libopeay/openssl/bn.h"
+#include "modules/libopeay/openssl/rsa.h"
+#include "modules/libopeay/openssl/dh.h"
+#include "modules/libopeay/openssl/rand.h"
+#include "modules/libopeay/openssl/x509.h"
+#include "modules/libopeay/addon/elgamal.h"
+
+#define ElGamal_err(f,r)  ERR_PUT_error(ERR_LIB_USER,(f),(r),__FILE__,__LINE__)
+
+#define ELGAMAL_F_ELGAMAL_ENCRYPT	1
+#define ELGAMAL_F_ELGAMAL_SIGN		2
+#define ELGAMAL_F_ELGAMAL_DECRYPT	3
+#define ELGAMAL_F_ELGAMAL_VERIFY	4
+
+#define ELGAMAL_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 1
+#define ELGAMAL_R_PADDING_CHECK_FAILED		2
+#define ELGAMAL_R_UNKNOWN_ALGORITHM_TYPE	3
+#define ELGAMAL_R_DATA_TOO_LARGE_FOR_MODULUS 4
+#define ELGAMAL_R_DIGEST_TOO_BIG_FOR_KEY	5
+#define ELGAMAL_R_WRONG_SIGNATURE_LENGTH	6
+
+#if 0
+int ElGamal_GenerateExchangeKey(DH *dh)
+{
+	BN_CTX *ctx;
+	BIGNUM *p1 ; /* p-1 */
+	BIGNUM *r; /* gcd result; */
+	int l;
+	
+	if(dh == NULL)
+		return -1;
+
+	BN_free(dh->priv_key);
+	BN_free(dh->pub_key);
+	dh->pub_key = NULL;
+	dh->priv_key = NULL;
+
+	ctx = BN_CTX_new();
+	if (ctx == NULL) goto err;
+
+	dh->priv_key=BN_new();
+	if (dh->priv_key == NULL) goto err;
+
+	p1 = BN_new();
+	r = BN_new();
+	if(p1 == NULL || r == NULL) goto err;
+
+	if(!BN_sub(p1, dh->p, BN_value_one())) goto err;
+	
+	l = dh->length ? dh->length : BN_num_bits(dh->p)-1; /* secret exponent length */
+	/* Find a number relatively prime with (p-1) */
+	do{
+		if (!BN_rand(dh->priv_key, l, 0, 0)) goto err;
+		if(!BN_gcd(r, dh->priv_key, p1, ctx)) goto err;
+	}while(BN_cmp(r, BN_value_one()) != 0);
+	
+	if(!BN_mod_exp(r, dh->g, dh->priv_key, dh->p, ctx)) goto err;
+	
+	dh->pub_key = r;
+	r = NULL;
+
+err:;
+	if(p1)
+		BN_free(p1);
+	if(r)
+		BN_free(r);
+	if(ctx)
+		BN_CTX_free(ctx);
+
+	return (dh->pub_key ? 0 : -1);
+}
+#endif
+
+/* modelled on code from rsa_eay.c */
+int ElGamal_encrypt(int flen, const unsigned char *from, unsigned char *to, BIGNUM **a,  DH *dh)
+{
+	BIGNUM y,f, k, p1, ret;
+	int i,j,k1,l,num=0,r= -1;
+	unsigned char *buf=NULL;
+	BN_CTX *ctx=NULL;
+
+	if(a== NULL)
+		return(-1);
+
+	if(*a == NULL)
+		*a = BN_new();
+	if(*a == NULL)
+		return(-1);
+
+	BN_init(&k);
+	BN_init(&y);
+	BN_init(&p1);
+	BN_init(&f);
+	BN_init(&ret);
+	if ((ctx=BN_CTX_new()) == NULL) goto err;
+	num=BN_num_bytes(dh->p);
+	if ((buf=(unsigned char *)OPENSSL_malloc(num)) == NULL)
+		{
+		ElGamal_err(ELGAMAL_F_ELGAMAL_ENCRYPT,ERR_R_MALLOC_FAILURE);
+		goto err;
+		}
+
+	if(!BN_sub(&p1, dh->p, BN_value_one())) goto err;
+
+	l = dh->length ? dh->length : BN_num_bits(dh->p)-1; /* secret exponent length */
+	/* Find a number relatively prime with (p-1) */
+	do{
+		if (!BN_rand(&k, l, 0, 0)) goto err;
+		if(!BN_gcd(&y, &k, &p1, ctx)) goto err;
+	}while(BN_cmp(&y, BN_value_one()) != 0);
+	
+	if(!BN_mod_exp(*a, dh->g, &k, dh->p, ctx)) goto err;
+
+	if(RSA_padding_add_PKCS1_type_2(buf,num,from,flen)<=0) goto err;
+
+	if(BN_bin2bn(buf, num, &f) == NULL)
+		goto err;
+
+	if(!BN_mod_exp(&y, dh->pub_key, &k, dh->p, ctx)) goto err;
+
+	if(!BN_mod_mul(&ret, &y, &f, dh->p, ctx)) goto err;
+
+	j=BN_num_bytes(&ret);
+	i=BN_bn2bin(&ret,&(to[num-j]));
+	for (k1=0; k1<(num-i); k1++)
+		to[k1]=0;
+
+	r=num;
+err:
+	if (ctx != NULL) BN_CTX_free(ctx);
+	BN_clear_free(&y);
+	BN_clear_free(&f);
+	BN_clear_free(&ret);
+	if (buf != NULL) 
+		{
+		op_memset(buf,0,num);
+		OPENSSL_free(buf);
+		}
+	return(r);
+}
+
+int ElGamal_decrypt(int flen, const unsigned char *from, unsigned char *to, BIGNUM *a, DH *dh)
+{
+	BIGNUM y,y1,f,ret;
+	int j,num=0,r= -1;
+	unsigned char *buf=NULL;
+	BN_CTX *ctx=NULL;
+
+	BN_init(&y);
+	BN_init(&y1);
+	BN_init(&f);
+	BN_init(&ret);
+	if(BN_bin2bn(from, flen, &f) != &f) goto err;
+	if ((ctx=BN_CTX_new()) == NULL) goto err;
+
+
+	num=BN_num_bytes(dh->p);
+	if ((buf=(unsigned char *)OPENSSL_malloc(num)) == NULL)
+		{
+		ElGamal_err(ELGAMAL_F_ELGAMAL_ENCRYPT,ERR_R_MALLOC_FAILURE);
+		goto err;
+		}
+
+
+	if (BN_ucmp(&f, dh->p) >= 0)
+		{
+		ElGamal_err(ELGAMAL_F_ELGAMAL_DECRYPT,ELGAMAL_R_DATA_TOO_LARGE_FOR_MODULUS);
+		goto err;
+		}
+
+	if(!BN_mod_exp(&y1, a, dh->priv_key, dh->p, ctx)) goto err;
+	if(!BN_mod_inverse(&y, &y1, dh->p, ctx)) goto err;
+	if(!BN_mod_mul(&ret, &y, &f, dh->p, ctx)) goto err;
+
+	j=BN_bn2bin(&ret,buf); /* j is only used with no-padding mode */
+
+	r = RSA_padding_check_PKCS1_type_2(to,num,buf,j,num);
+	if (r < 0)
+		ElGamal_err(ELGAMAL_F_ELGAMAL_DECRYPT,ELGAMAL_R_PADDING_CHECK_FAILED);
+
+err:
+	if (ctx != NULL) BN_CTX_free(ctx);
+	BN_clear_free(&y1);
+	BN_clear_free(&y);
+	BN_clear_free(&f);
+	BN_clear_free(&ret);
+	if (buf != NULL) 
+		{
+		op_memset(buf,0,num);
+		OPENSSL_free(buf);
+		}
+	return(r);
+}
+
+
+static int ElGamal_perform_sign(int flen, const unsigned char *from, unsigned char *to, BIGNUM **a, DH *dh)
+{
+	BIGNUM y, y1,f, k, p1,ret;
+	int i,j,k1,l,num=0,r= -1;
+	unsigned char *buf=NULL;
+	BN_CTX *ctx=NULL;
+
+	if(a== NULL)
+		return(-1);
+
+	if(*a == NULL)
+		*a = BN_new();
+	if(*a == NULL)
+		return(-1);
+
+	BN_init(&k);
+	BN_init(&p1);
+	BN_init(&y);
+	BN_init(&y1);
+	BN_init(&f);
+	BN_init(&ret);
+	if ((ctx=BN_CTX_new()) == NULL) goto err;
+	num=BN_num_bytes(dh->p);
+	if ((buf=(unsigned char *)OPENSSL_malloc(num)) == NULL)
+		{
+		ElGamal_err(ELGAMAL_F_ELGAMAL_ENCRYPT,ERR_R_MALLOC_FAILURE);
+		goto err;
+		}
+
+	if(!BN_sub(&p1, dh->p, BN_value_one())) goto err;
+
+	l = dh->length ? dh->length : BN_num_bits(dh->p)-1; /* secret exponent length */
+	/* Find a number relatively prime with (p-1) */
+	do{
+		if (!BN_rand(&k, l, 0, 0)) goto err;
+		if(!BN_gcd(&y, &k, &p1, ctx)) goto err;
+	}while(BN_cmp(&y, BN_value_one()) != 0);
+	
+	if(!BN_mod_exp(*a, dh->g, &k, dh->p, ctx)) goto err;
+
+	if(RSA_padding_add_PKCS1_type_2(buf,num,from,flen)<=0) goto err;
+
+	if(BN_bin2bn(buf, num, &f) == NULL)
+		goto err;
+
+	if(!BN_mod_mul(&y, dh->priv_key, *a, &p1, ctx)) goto err;
+
+#ifdef __USE_OPENSSL_097__
+	if(!BN_mod_sub(&y1, &f, &y, &p1, ctx)) goto err;
+#else
+	if(!BN_sub(&ret, &f, &y)) goto err;
+	if(!BN_mod(&y1, &ret, &p1, ctx)) goto err;
+#endif
+
+	if(!BN_mod_inverse(&y, &k, &p1, ctx)) goto err;
+
+	if(!BN_mod_mul(&ret, &y1, &y, &p1, ctx)) goto err;
+
+	j=BN_num_bytes(&ret);
+	i=BN_bn2bin(&ret,&(to[num-j]));
+	for (k1=0; k1<(num-i); k1++)
+		to[k1]=0;
+
+	r=num;
+err:
+	if (ctx != NULL) BN_CTX_free(ctx);
+	BN_clear_free(&k);
+	BN_clear_free(&y1);
+	BN_clear_free(&y);
+	BN_clear_free(&f);
+	BN_clear_free(&ret);
+	if (buf != NULL) 
+	{
+		op_memset(buf,0,num);
+		OPENSSL_free(buf);
+	}
+
+	return r;
+}
+
+int ElGamal_sign(int type, const unsigned char *m, unsigned int m_len,
+	     unsigned char *sigret, unsigned int *siglen, BIGNUM **a, DH *dh)
+	{
+	X509_SIG sig;
+	ASN1_TYPE parameter;
+	int i,j,ret=1;
+	unsigned char *p, *tmps = NULL;
+	const unsigned char *s = NULL;
+	X509_ALGOR algor;
+	ASN1_OCTET_STRING digest;
+
+	if(a == NULL)
+		return 0;
+
+	{
+		sig.algor= &algor;
+		sig.algor->algorithm=OBJ_nid2obj(type);
+		if (sig.algor->algorithm == NULL)
+			{
+			ElGamal_err(ELGAMAL_F_ELGAMAL_SIGN,ELGAMAL_R_UNKNOWN_ALGORITHM_TYPE);
+			return(0);
+			}
+		if (sig.algor->algorithm->length == 0)
+			{
+			ElGamal_err(ELGAMAL_F_ELGAMAL_SIGN,ELGAMAL_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD);
+			return(0);
+			}
+		parameter.type=V_ASN1_NULL;
+		parameter.value.ptr=NULL;
+		sig.algor->parameter= &parameter;
+
+		sig.digest= &digest;
+		sig.digest->data=(unsigned char *)m; /* TMP UGLY CAST */
+		sig.digest->length=m_len;
+
+		i=i2d_X509_SIG(&sig,NULL);
+	}
+	j=DH_size(dh);
+	if ((i-RSA_PKCS1_PADDING) > j)
+		{
+		ElGamal_err(ELGAMAL_F_ELGAMAL_SIGN,ELGAMAL_R_DIGEST_TOO_BIG_FOR_KEY);
+		return(0);
+		}
+	tmps=(unsigned char *)OPENSSL_malloc((unsigned int)j+1);
+	if (tmps == NULL)
+		{
+		ElGamal_err(ELGAMAL_F_ELGAMAL_SIGN,ERR_R_MALLOC_FAILURE);
+		return(0);
+		}
+	p=tmps;
+	i2d_X509_SIG(&sig,&p);
+	s=tmps;
+
+
+	i = ElGamal_perform_sign(i, s, sigret, a, dh);
+
+	if (i <= 0)
+		ret=0;
+	else
+		*siglen=i;
+
+	op_memset(tmps,0,(unsigned int)j+1);
+	OPENSSL_free(tmps);
+
+	return(ret);
+}
+
+static int ElGamal_perform_verify(const unsigned char *from, int flen, unsigned char *ref, unsigned int ref_len, BIGNUM *a, DH *dh)
+{
+	BIGNUM s1, s2, y, y1,f;
+	int num=0,r= 0;
+	unsigned char *buf=NULL;
+	BN_CTX *ctx=NULL;
+
+	if(a== NULL)
+		return(0);
+
+	BN_init(&s1);
+	BN_init(&s2);
+	BN_init(&y);
+	BN_init(&y1);
+	BN_init(&f);
+	if ((ctx=BN_CTX_new()) == NULL) goto err;
+	num=BN_num_bytes(dh->p);
+	if ((buf=(unsigned char *)OPENSSL_malloc(num)) == NULL)
+		{
+		ElGamal_err(ELGAMAL_F_ELGAMAL_VERIFY,ERR_R_MALLOC_FAILURE);
+		goto err;
+		}
+
+
+	if(RSA_padding_add_PKCS1_type_2(buf,num,from,flen)<=0) goto err;
+
+	if(BN_bin2bn(buf, num, &f) == NULL)
+		goto err;
+
+	/* g^M mod p */
+	if(!BN_mod_exp(&s1, dh->g, &f, dh->p, ctx)) goto err;
+
+	/* y^a mod p */
+	if(!BN_mod_exp(&y, dh->pub_key, a, dh->p, ctx)) goto err;
+
+	if(BN_bin2bn(ref, ref_len, &f) == NULL)
+		goto err;
+
+	/* a^b mod p */
+	if(!BN_mod_mul(&y1, a, &f , dh->p, ctx)) goto err;
+
+	/* (y^a)*(a^b) mod p */
+	if(!BN_mod_mul(&s2, &y, &y1, dh->p, ctx)) goto err;
+
+	if(BN_cmp(&s1, &s2) == 0)
+		r = 1;
+
+err:
+	if (ctx != NULL) BN_CTX_free(ctx);
+	BN_clear_free(&s1);
+	BN_clear_free(&s2);
+	BN_clear_free(&y);
+	BN_clear_free(&y1);
+	BN_clear_free(&f);
+	if (buf != NULL) 
+	{
+		op_memset(buf,0,num);
+		OPENSSL_free(buf);
+	}
+
+	return r;
+}
+
+int ElGamal_verify(int dtype, const unsigned char *m, unsigned int m_len,
+	     unsigned char *sigbuf, unsigned int siglen, BIGNUM *a, DH *dh)
+	{
+	X509_SIG sig;
+	ASN1_TYPE parameter;
+	int i,j,ret=1;
+	unsigned char *p, *tmps = NULL;
+	const unsigned char *s = NULL;
+	X509_ALGOR algor;
+	ASN1_OCTET_STRING digest;
+
+	if(a == NULL)
+		return 0;
+
+	if (siglen > (unsigned int)DH_size(dh))
+		{
+		ElGamal_err(ELGAMAL_F_ELGAMAL_VERIFY,ELGAMAL_R_WRONG_SIGNATURE_LENGTH);
+		return(0);
+		}
+
+	{
+		sig.algor= &algor;
+		sig.algor->algorithm=OBJ_nid2obj(dtype);
+		if (sig.algor->algorithm == NULL)
+			{
+			ElGamal_err(ELGAMAL_F_ELGAMAL_VERIFY,ELGAMAL_R_UNKNOWN_ALGORITHM_TYPE);
+			return(0);
+			}
+		if (sig.algor->algorithm->length == 0)
+			{
+			ElGamal_err(ELGAMAL_F_ELGAMAL_VERIFY,ELGAMAL_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD);
+			return(0);
+			}
+		parameter.type=V_ASN1_NULL;
+		parameter.value.ptr=NULL;
+		sig.algor->parameter= &parameter;
+
+		sig.digest= &digest;
+		sig.digest->data=(unsigned char *)m; /* TMP UGLY CAST */
+		sig.digest->length=m_len;
+
+		i=i2d_X509_SIG(&sig,NULL);
+	}
+	j=DH_size(dh);
+	if ((i-RSA_PKCS1_PADDING) > j)
+		{
+		ElGamal_err(ELGAMAL_F_ELGAMAL_VERIFY,ELGAMAL_R_DIGEST_TOO_BIG_FOR_KEY);
+		return(0);
+		}
+	tmps=(unsigned char *)OPENSSL_malloc((unsigned int)j+1);
+	if (tmps == NULL)
+		{
+		ElGamal_err(ELGAMAL_F_ELGAMAL_VERIFY,ERR_R_MALLOC_FAILURE);
+		return(0);
+		}
+	p=tmps;
+	i2d_X509_SIG(&sig,&p);
+	s=tmps;
+
+	ret = ElGamal_perform_verify(s, i, sigbuf, siglen, a, dh);
+
+	op_memset(tmps,0,(unsigned int)j+1);
+	OPENSSL_free(tmps);
+
+	return(ret);
+}
+
+
+#endif
+
diff -Naur openssl-1.0.0q.orig/addon/elgamal.h openssl-1.0.0q/addon/elgamal.h
--- openssl-1.0.0q.orig/addon/elgamal.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/elgamal.h	2017-04-25 16:23:39.681528795 +0200
@@ -0,0 +1,23 @@
+
+#ifndef _ELGAMAL_H_
+#define _ELGAMAL_H_
+
+#ifdef NEED_LIBOPEAY_ELGAMAL
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*int ElGamal_GenerateExchangeKey(DH *dh);*/
+int ElGamal_encrypt(int flen, const unsigned char *from, unsigned char *to, BIGNUM **a, DH *dh);
+int ElGamal_decrypt(int flen, const unsigned char *from, unsigned char *to, BIGNUM *a, DH *dh);
+int ElGamal_sign(int type, const unsigned char *m, unsigned int m_len,
+	     unsigned char *sigret, unsigned int *siglen, BIGNUM **a, DH *dh);
+int ElGamal_verify(int dtype, const unsigned char *m, unsigned int m_len,
+	     unsigned char *sigbuf, unsigned int siglen, BIGNUM *a, DH *dh);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
diff -Naur openssl-1.0.0q.orig/addon/libopeay_util.cpp openssl-1.0.0q/addon/libopeay_util.cpp
--- openssl-1.0.0q.orig/addon/libopeay_util.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/libopeay_util.cpp	2017-04-25 16:23:39.683527931 +0200
@@ -0,0 +1,122 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 2012-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+/**
+ * @file libopeay_util.cpp
+ *
+ * Utility functions.
+ *
+ * @author Alexei Khlebnikov <alexeik@opera.com>
+ *
+ */
+
+#if defined(_DEBUG) || defined(SELFTEST)
+
+#include "modules/libopeay/addon/libopeay_util.h"
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/openssl/evp.h"
+#include "modules/libopeay/openssl/x509_vfy.h"
+
+
+#ifdef CASE_ELEMENT
+#error "#define collision: CASE_ELEMENT is already defined."
+#endif
+#define CASE_ELEMENT(name) case name: return #name
+
+const char* EVP_PKEY_type_name(int pkey_type)
+{
+	switch (pkey_type)
+	{
+		// The list is taken from evp.h.
+		CASE_ELEMENT(EVP_PKEY_NONE);
+		CASE_ELEMENT(EVP_PKEY_RSA);
+		CASE_ELEMENT(EVP_PKEY_RSA2);
+		CASE_ELEMENT(EVP_PKEY_DSA);
+		CASE_ELEMENT(EVP_PKEY_DSA1);
+		CASE_ELEMENT(EVP_PKEY_DSA2);
+		CASE_ELEMENT(EVP_PKEY_DSA3);
+		CASE_ELEMENT(EVP_PKEY_DSA4);
+		CASE_ELEMENT(EVP_PKEY_DH);
+		CASE_ELEMENT(EVP_PKEY_EC);
+		CASE_ELEMENT(EVP_PKEY_HMAC);
+	}
+
+	return "(Unknown EVP_PKEY type)";
+}
+
+
+const char* X509_V_ERR_name(int err)
+{
+	switch (err)
+	{
+		// The list is taken from x509_vfy.h.
+		CASE_ELEMENT(X509_V_OK);
+		case 1: return "(illegal error (for uninitialized values, to avoid X509_V_OK): 1)";
+		// The rest of the list is generated by the following command:
+		// cat x509_vfy.h | awk '/X509_V_ERR_/ { print "CASE_ELEMENT(" $2 ");" }'
+		CASE_ELEMENT(X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT);
+		CASE_ELEMENT(X509_V_ERR_UNABLE_TO_GET_CRL);
+		CASE_ELEMENT(X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE);
+		CASE_ELEMENT(X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE);
+		CASE_ELEMENT(X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY);
+		CASE_ELEMENT(X509_V_ERR_CERT_SIGNATURE_FAILURE);
+		CASE_ELEMENT(X509_V_ERR_CRL_SIGNATURE_FAILURE);
+		CASE_ELEMENT(X509_V_ERR_CERT_NOT_YET_VALID);
+		CASE_ELEMENT(X509_V_ERR_CERT_HAS_EXPIRED);
+		CASE_ELEMENT(X509_V_ERR_CRL_NOT_YET_VALID);
+		CASE_ELEMENT(X509_V_ERR_CRL_HAS_EXPIRED);
+		CASE_ELEMENT(X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD);
+		CASE_ELEMENT(X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD);
+		CASE_ELEMENT(X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD);
+		CASE_ELEMENT(X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD);
+		CASE_ELEMENT(X509_V_ERR_OUT_OF_MEM);
+		CASE_ELEMENT(X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT);
+		CASE_ELEMENT(X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN);
+		CASE_ELEMENT(X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY);
+		CASE_ELEMENT(X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE);
+		CASE_ELEMENT(X509_V_ERR_CERT_CHAIN_TOO_LONG);
+		CASE_ELEMENT(X509_V_ERR_CERT_REVOKED);
+		CASE_ELEMENT(X509_V_ERR_INVALID_CA);
+		CASE_ELEMENT(X509_V_ERR_PATH_LENGTH_EXCEEDED);
+		CASE_ELEMENT(X509_V_ERR_INVALID_PURPOSE);
+		CASE_ELEMENT(X509_V_ERR_CERT_UNTRUSTED);
+		CASE_ELEMENT(X509_V_ERR_CERT_REJECTED);
+		CASE_ELEMENT(X509_V_ERR_SUBJECT_ISSUER_MISMATCH);
+		CASE_ELEMENT(X509_V_ERR_AKID_SKID_MISMATCH);
+		CASE_ELEMENT(X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH);
+		CASE_ELEMENT(X509_V_ERR_KEYUSAGE_NO_CERTSIGN);
+		CASE_ELEMENT(X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER);
+		CASE_ELEMENT(X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION);
+		CASE_ELEMENT(X509_V_ERR_KEYUSAGE_NO_CRL_SIGN);
+		CASE_ELEMENT(X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION);
+		CASE_ELEMENT(X509_V_ERR_INVALID_NON_CA);
+		CASE_ELEMENT(X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED);
+		CASE_ELEMENT(X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE);
+		CASE_ELEMENT(X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED);
+		CASE_ELEMENT(X509_V_ERR_INVALID_EXTENSION);
+		CASE_ELEMENT(X509_V_ERR_INVALID_POLICY_EXTENSION);
+		CASE_ELEMENT(X509_V_ERR_NO_EXPLICIT_POLICY);
+		CASE_ELEMENT(X509_V_ERR_DIFFERENT_CRL_SCOPE);
+		CASE_ELEMENT(X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE);
+		CASE_ELEMENT(X509_V_ERR_UNNESTED_RESOURCE);
+		CASE_ELEMENT(X509_V_ERR_PERMITTED_VIOLATION);
+		CASE_ELEMENT(X509_V_ERR_EXCLUDED_VIOLATION);
+		CASE_ELEMENT(X509_V_ERR_SUBTREE_MINMAX);
+		CASE_ELEMENT(X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE);
+		CASE_ELEMENT(X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX);
+		CASE_ELEMENT(X509_V_ERR_UNSUPPORTED_NAME_SYNTAX);
+		CASE_ELEMENT(X509_V_ERR_CRL_PATH_VALIDATION_ERROR);
+		CASE_ELEMENT(X509_V_ERR_APPLICATION_VERIFICATION);
+	}
+
+	return "(Unknown X509_V_ERR_* code)";
+}
+
+#undef CASE_ELEMENT
+
+#endif // defined(_DEBUG) || defined(SELFTEST)
diff -Naur openssl-1.0.0q.orig/addon/libopeay_util.h openssl-1.0.0q/addon/libopeay_util.h
--- openssl-1.0.0q.orig/addon/libopeay_util.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/libopeay_util.h	2017-04-25 16:23:39.684527500 +0200
@@ -0,0 +1,28 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 2012-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+/**
+ * @file libopeay_util.h
+ *
+ * Utility functions.
+ *
+ * @author Alexei Khlebnikov <alexeik@opera.com>
+ *
+ */
+
+#ifndef LIBOPEAY_UTIL_H
+#define LIBOPEAY_UTIL_H
+
+#if defined(_DEBUG) || defined(SELFTEST)
+
+const char* EVP_PKEY_type_name(int pkey_type);
+const char* X509_V_ERR_name(int err);
+
+#endif // defined(_DEBUG) || defined(SELFTEST)
+
+#endif // LIBOPEAY_UTIL_H
diff -Naur openssl-1.0.0q.orig/addon/op_functions.h openssl-1.0.0q/addon/op_functions.h
--- openssl-1.0.0q.orig/addon/op_functions.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/op_functions.h	2017-04-25 16:23:39.685526789 +0200
@@ -0,0 +1,237 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 2011 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+/**
+ * @file op_functions.h
+ *
+ * Substitution of standard C calls with op_ calls, if needed.
+ *
+ * This file introduces an exception to Opera Core op_ prefix rule.
+ * This exception is only introduced for libopeay module, because it
+ * contains mostly 3rd party OpenSSL code and we can't force OpenSSL
+ * developers to adopt our op_ prefix rule. If this exception will
+ * not work on all supported platforms - it will be removed.
+ *
+ * If you are curious and want more info about the problem, please read
+ * the relevant discussion in developer@opera.com maillist, August 2011,
+ * subject "op_ prefix". Here is the a copy of the exception proposal
+ * from that discussion:
+ *
+
+<quote>
+From: "Alexei Khlebnikov" <alexei.khlebnikov@opera.com>
+Subject: Re: [Developer] op_ prefix
+Date: Mon, 08 Aug 2011 14:43:44 +0200
+
+...
+
+I want to introduce an exception to the op-prefix rule for at least some
+3rd-party code, because we can't make upstream developers to adopt our
+op-prefix rule. I want to apply this exception to libopeay (OpenSSL),
+but it can also be useful for lea_malloc, libfreetype and zlib,
+if their owners will want it.
+
+We now have op_calls everywhere in libopeay. It means we have a lot of local
+patches that only exist to satisfy our op-prefix rule. We currently have
+3.7 MB of local patches between "vanilla" OpenSSL and libopeay
+("diff -Nura" with default 3 lines of context). Of course, our local patches do not consist entirely of changing non-op_calls to op_calls, but such changes are a big share of all patches, more than half of them.
+
+I am now upgrading OpenSSL and have a lot merge conflicts because of that.
+Also, I need to replace newly-added non-op_calls by op_calls. I can write
+a script for such replacements, but I am upgrading directory-by-directory,
+so I'll need to run it many times anyway, and this script will not save me
+from all those manual merge conflict resolutions.
+
+Thus I want to make a header, local to libopeay, that will contain blocks like
+
+    #if SYSTEM_MEMSET == NO
+    # undef memset
+    # define memset op_memset
+    #endif
+
+for every function which is a part of system system and has a SYSTEM_* define.
+I am going to include this header into every (autogenerated) .cpp file
+of libopeay, but none of its .h files, thus other modules won't be "poisoned".
+Those rare system function calls from .h files, if they exist, will be
+converted to op_calls anyway, so that other modules including headers
+from libopeay will be able to compile. Other arrangements can be done,
+the point is to remove as many local patches as possible, even if it won't be
+possible to remove all of them.
+
+Why it should work for all projects. All projects have to define SYSTEM_MEMSET
+correctly to YES or NO. Otherwise they'll get a compilation error immediately,
+according to this code in modules/hardcore/base/system.h:
+
+
+    #if !defined SYSTEM_MEMSET || (SYSTEM_MEMSET != YES && SYSTEM_MEMSET != NO)
+    #   error "You need to decide if you want SYSTEM_MEMSET or not."
+    #   error " The system has the following function:"
+    #   error ""
+    #   error " void* memset(void* s1, int n, size_t nbytes);"
+    #   error ""
+    #   error " If SYSTEM_MEMSET==NO then the macro op_memset need not be defined."
+    #   error ""
+    #endif // SYSTEM_MEMSET
+
+And these definitions will be visible in all the Core code. Thus my code
+
+    #if SYSTEM_MEMSET == NO
+    # undef memset
+    # define memset op_memset
+    #endif
+
+will behave the following way:
+
+1) If system memset is used and SYSTEM_MEMSET == YES:
+#undef and #define will be ignored, memset will be defined to whatever it was
+previously defined on the system.
+
+2) If system memset is not used and SYSTEM_MEMSET == NO:
+memset will be defined as op_memset, which in turn can be defined as any
+(weird) platform-specific function or Opera's implementation of this function
+can be taken.
+
+Regarding Eddy's point about exotic functions like wcsnicoll. I haven't seen
+exotic function calls in OpenSSL. It is mostly functions from string.h: str*()
+and mem*(). So what will happen if such functions still exist or will be
+introduced? As I said, I am only going to introduce the mentioned code blocks
+for functions in system system, which have corresponding SYSTEM_* define.
+So those exotic functions are not affected by my proposal and their linking
+will be solved another way, as it would be without this proposal.
+
+Regarding Jakub's point about memory allocation. AFAIU, you are talking about
+op_malloc and op_free. When using own memory allocator, you define,
+for example, op_malloc as own_malloc and op_free as own_free. You don't use
+system's malloc and free and have SYSTEM_MALLOC == NO. In this case "plain"
+malloc will be substituted by the preprocessor by op_malloc and then
+by own_malloc. So it's transparent. OP_NEW and OP_DELETE are unaffected
+by this proposal, because OpenSSL is pure C code and OP_NEW/OP_DELETE
+do not have corresponding SYSTEM_* macros.
+
+I'd like to repeat, I want to introduce this exception only for one module,
+containing 3rd-party code. Not for the whole Core. If it won't work, we can
+switch to "total op-prefix" again.
+</quote>
+
+ * Documentation update 2012-04-13:
+
+It turned out that YES, NO and SYSTEM_* defines are undefined in the end
+of modules/hardcore/base/system.h, which is included by core/pch.h,
+i.e. before this file (op_functions.h). Thus we can't rely on SYSTEM_*
+defines. But before each SYSTEM_X is undefined, each SYSTEM_X is converted
+into the corresponding HAVE_X:
+
+#if SYSTEM_MEMSET == YES
+#	define HAVE_MEMSET
+#endif // SYSTEM_MEMSET == YES
+
+Thus we can use HAVE_* defines.
+
+ *
+ * @author Alexei Khlebnikov <alexeik@opera.com>
+ *
+ */
+
+#ifdef OP_FUNCTIONS_H
+#error This file must be included exactly once, from modules/libopeay/core_includes.h.
+#endif
+#define OP_FUNCTIONS_H
+
+#ifndef HAVE_ATOI
+# undef  atoi
+# define atoi op_atoi
+#endif
+
+#ifndef HAVE_GMTIME
+# undef  gmtime
+# define gmtime op_gmtime
+#endif
+
+#ifndef HAVE_MEMCMP
+# undef  memcmp
+# define memcmp op_memcmp
+#endif
+
+#ifndef HAVE_MEMCPY
+# undef  memcpy
+# define memcpy op_memcpy
+#endif
+
+#ifndef HAVE_MEMMOVE
+# undef  memmove
+# define memmove op_memmove
+#endif
+
+#ifndef HAVE_MEMSET
+# undef  memset
+# define memset op_memset
+#endif
+
+#ifndef HAVE_SSCANF
+# undef  sscanf
+# define sscanf op_sscanf
+#endif
+
+#ifndef HAVE_STRCHR
+# undef  strchr
+# define strchr op_strchr
+#endif
+
+#ifndef HAVE_STRCMP
+# undef  strcmp
+# define strcmp op_strcmp
+#endif
+
+#ifndef HAVE_STRCPY
+# undef  strcpy
+# define strcpy op_strcpy
+#endif
+
+#ifndef HAVE_STRICMP
+# undef  stricmp
+# define stricmp op_stricmp
+# undef  strcasecmp
+# define strcasecmp op_stricmp
+#endif
+
+#ifndef HAVE_STRLEN
+# undef  strlen
+# define strlen op_strlen
+#endif
+
+#ifndef HAVE_STRNCMP
+# undef  strncmp
+# define strncmp op_strncmp
+#endif
+
+#ifndef HAVE_STRNCPY
+# undef  strncpy
+# define strncpy op_strncpy
+#endif
+
+#ifndef HAVE_STRNICMP
+# undef  strnicmp
+# define strnicmp op_strnicmp
+# undef  strncasecmp
+# define strncasecmp op_strnicmp
+#endif
+
+#ifndef HAVE_STRSTR
+# undef  strstr
+# define strstr op_strstr
+#endif
+
+#ifndef HAVE_STRTOUL
+# undef  strtoul
+# define strtoul op_strtoul
+#endif
+
+#ifndef HAVE_TOLOWER
+# undef  tolower
+# define tolower op_tolower
+#endif
diff -Naur openssl-1.0.0q.orig/addon/opera_asynch_rsa_gen.cpp openssl-1.0.0q/addon/opera_asynch_rsa_gen.cpp
--- openssl-1.0.0q.orig/addon/opera_asynch_rsa_gen.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/opera_asynch_rsa_gen.cpp	2017-04-25 16:23:39.686528033 +0200
@@ -0,0 +1,21 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/addon/asynch_rsa_gen.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/addon/opera_cert_ex_data.cpp openssl-1.0.0q/addon/opera_cert_ex_data.cpp
--- openssl-1.0.0q.orig/addon/opera_cert_ex_data.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/opera_cert_ex_data.cpp	2017-04-25 16:23:39.687527602 +0200
@@ -0,0 +1,21 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/addon/cert_ex_data.c"
+}
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/addon/opera_digestex.cpp openssl-1.0.0q/addon/opera_digestex.cpp
--- openssl-1.0.0q.orig/addon/opera_digestex.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/opera_digestex.cpp	2017-04-25 16:23:39.688528287 +0200
@@ -0,0 +1,21 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/addon/digestex.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/addon/opera_elgamal.cpp openssl-1.0.0q/addon/opera_elgamal.cpp
--- openssl-1.0.0q.orig/addon/opera_elgamal.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/opera_elgamal.cpp	2017-04-25 16:23:39.689526180 +0200
@@ -0,0 +1,21 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/addon/elgamal.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/addon/opera_libopeay_util.cpp openssl-1.0.0q/addon/opera_libopeay_util.cpp
--- openssl-1.0.0q.orig/addon/opera_libopeay_util.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/opera_libopeay_util.cpp	2017-04-25 16:23:39.690527424 +0200
@@ -0,0 +1,18 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/addon/libopeay_util.cpp"
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/addon/opera_purposes.cpp openssl-1.0.0q/addon/opera_purposes.cpp
--- openssl-1.0.0q.orig/addon/opera_purposes.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/opera_purposes.cpp	2017-04-25 16:23:39.691526713 +0200
@@ -0,0 +1,21 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/addon/purposes.c"
+}
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/addon/opera_utcprint.cpp openssl-1.0.0q/addon/opera_utcprint.cpp
--- openssl-1.0.0q.orig/addon/opera_utcprint.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/opera_utcprint.cpp	2017-04-25 16:23:39.692527399 +0200
@@ -0,0 +1,21 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/addon/utcprint.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/addon/purposes.c openssl-1.0.0q/addon/purposes.c
--- openssl-1.0.0q.orig/addon/purposes.c	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/purposes.c	2017-04-25 16:23:39.693527806 +0200
@@ -0,0 +1,122 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+**
+**
+** Copyright (C) 2000-2011 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+**
+** Yngve Pettersen
+**
+*/
+
+/* This file contains modified versions of code found in OpenSSL */
+
+/* ====================================================================
+ * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ *    software must display the following acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For written permission, please contact
+ *    licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ *    nor may "OpenSSL" appear in their names without prior written
+ *    permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com).  This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#include <openssl/cryptlib.h>
+#include "modules/libopeay/addon/purposes.h"
+
+
+/* borrowed from v3_purp.c */
+
+/* CA checks common to all purposes
+ * return codes:
+ * 0 not a CA
+ * 1 is a CA
+ * 2 basicConstraints absent so "maybe" a CA
+ * 3 basicConstraints absent but self signed V1.
+ */
+
+#define V1_ROOT (EXFLAG_V1|EXFLAG_SS)
+#define ku_reject(x, usage) \
+	(((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage)))
+#define xku_reject(x, usage) \
+	(((x)->ex_flags & EXFLAG_XKUSAGE) && !((x)->ex_xkusage & (usage)))
+#define ns_reject(x, usage) \
+	(((x)->ex_flags & EXFLAG_NSCERT) && !((x)->ex_nscert & (usage)))
+
+int trust_1oidany(X509_TRUST *trust, X509 *x, int flags);
+int check_ca(const X509 *x);
+
+/* Check SSL CA: common checks for SSL client and server */
+static int check_codesign_ca(const X509 *x)
+{
+	int ca_ret;
+	ca_ret = check_ca(x);
+	if(!ca_ret) return 0;
+	/* check nsCertType if present */
+	if(x->ex_flags & EXFLAG_NSCERT) {
+		if(x->ex_nscert & NS_OBJSIGN_CA) return ca_ret;
+		return 0;
+	}
+	if(ca_ret != 2) return ca_ret;
+	else return 0;
+}
+
+static int check_purpose_code_signing(const X509_PURPOSE *xp, const X509 *x, int ca)
+{
+	if(xku_reject(x,XKU_CODE_SIGN)) return 0;
+	if(ca) return check_codesign_ca(x);
+	if(ns_reject(x, NS_OBJSIGN)) return 0;
+	/* We need to do digital signatures with it */
+	if(ku_reject(x,KU_DIGITAL_SIGNATURE)) return 0;
+	return 1;
+}
+
+// Called only by LibopeayModule::InitL().
+int AddOperaSpecificPurposes()
+{
+	return X509_PURPOSE_add(OPERA_X509_PURPOSE_CODE_SIGN, X509_TRUST_OBJECT_SIGN, 0, check_purpose_code_signing, "Code signing", "codesign", NULL);
+}
diff -Naur openssl-1.0.0q.orig/addon/purposes.h openssl-1.0.0q/addon/purposes.h
--- openssl-1.0.0q.orig/addon/purposes.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/purposes.h	2017-04-25 16:23:39.694527653 +0200
@@ -0,0 +1,19 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2011 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#ifndef PURPOSES_H
+#define PURPOSES_H
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+
+#include <openssl/x509v3.h>
+
+#define OPERA_X509_PURPOSE_CODE_SIGN		(X509_PURPOSE_MAX + 1)
+
+#endif // defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+#endif // PURPOSES_H
diff -Naur openssl-1.0.0q.orig/addon/tools/filelist.py openssl-1.0.0q/addon/tools/filelist.py
--- openssl-1.0.0q.orig/addon/tools/filelist.py	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/tools/filelist.py	2017-04-25 16:23:39.695528339 +0200
@@ -0,0 +1,83 @@
+
+import 	os, re,fnmatch
+import fileinput
+
+def get_filename_list(top, dir, pattern):
+	"""Recursivly generate a listing of files in the file 
+		hierarchy starting at topdir/dir and that matches the 
+		regular expression string in pattern.
+		
+		top should be an absolute path, dir is considered a relative path, and may be empty
+		
+		The returned value is a dictionary with the absolute pathname as key, and the 
+		name relative to the top directory as the value."""
+		
+	file_list = {}
+	dirbase = os.path.join(top, dir)
+	for dirpath, dirnames,filenames in os.walk(dirbase) :
+		for f in (x for x in filenames if re.search(pattern,x, re.IGNORECASE)):
+			pathname = os.path.join(dirpath, f)
+			pathname_mod = os.path.basename(f)
+			file_list[pathname]=pathname_mod
+	return file_list
+
+def remove_filtered(filelist, filters):
+	"""return a list of the (full_filename, filename) tuples in filelist
+		that does NOT match any of the entries in the filters list"""
+	filter_match = set(x for x in filters if not x.find("*"))
+	filter_wild = [x for x in filters if  x not in filter_match]
+
+	temp1 =  [f for f in filelist.values() if f not in filter_match ]
+	
+	for filter in filter_wild:
+		temp2 = fnmatch.filter(temp1, filter);
+		for f in temp2:
+			temp1.remove(f)
+					
+	return dict([(ff, f) for ff, f in filelist.items() if  f in temp1])
+	
+def keep_filtered(filelist, filters):
+	"""return a list of the (full_filename, filename) tuples in filelist 
+		that matches at least one of the entries in the filters list"""
+
+	filter_match = set(x for x in filters if x.find("*")<0)
+	filter_wild = [x for x in filters if  x not in filter_match]
+
+	temp = set(filelist.values())
+	temp1 =  temp.intersection(filter_match)
+	
+	temp2 = list(temp.difference(temp1))
+		
+	for filter in filter_wild:
+		temp3 = fnmatch.filter(temp2, filter);
+		for f in temp3:
+			temp1.add(f)
+			temp2.remove(f)
+					
+	return dict([(ff, f) for ff, f in filelist.items() if f in temp1] )
+
+def process_named_files(top,dir, name, func, param):
+	"""Read all files matching name (a regexp) in the top/dir hieratrchy, and return the 
+		call the processfiles with func and param for the resulting list of files"""
+
+	read_files_list = get_filename_list(top,dir, name)
+	
+	processfiles(read_files_list, func, param)
+
+
+def processfiles(filenames, process_func, param):
+	"""process the files in filenames (which is a dictionary with each entry 
+		of the file's absolute path (the key) and the name relative to the project top dir.
+		Each file is read and passed to the process_func along with the realtive name and the 
+		provided param parameter.
+	
+			* filenames	:	A dictionary of Full_path:relative_path string items
+			* process_func:	A function taking the arguments (rel_filename, lines, param), where filename is the current file name,
+							lines is the file contents, and param is the application specific param attribute input to this function
+			*param 			Opaque application specific structure, only used by process_func """
+	
+	for filename in filenames:
+		current_file = filenames[filename]
+		#print "Scanning ", current_file,"\n"
+		process_func(current_file,[line for line in fileinput.input(filename)], param)
+
diff -Naur openssl-1.0.0q.orig/addon/tools/pruneopenssl.py openssl-1.0.0q/addon/tools/pruneopenssl.py
--- openssl-1.0.0q.orig/addon/tools/pruneopenssl.py	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/tools/pruneopenssl.py	2017-04-25 16:23:39.696528187 +0200
@@ -0,0 +1,102 @@
+
+import filelist
+import shutil,os,re
+
+openssl_path = "openssl"
+
+remove_folders=(
+		"apps",
+		"bugs",
+		"certs",
+		"demos",
+		"MacOS",
+		"ms",
+		"Netware",
+		"os2",
+		"perl",
+		"shlib",
+		"ssl",
+		"test",
+		"times",
+		"tools",
+		"util",
+		"VMS",
+		"include",
+		"openssl",
+		os.path.join("crypto","pkcs7", "p7"),
+		os.path.join("crypto","pkcs7", "t"),
+		os.path.join("crypto","des", "times"),
+		os.path.join("crypto","des", "t"),
+		os.path.join("doc","apps"),
+		os.path.join("doc","ssl")
+		)
+		
+remove_file_patterns = (
+	"makefile\.*",
+	"install.*",
+	".*\.com",
+	"README.*",
+	"VERSION",
+	"FAQ",
+	"config.*",
+	"news",
+	"openssl.doxy",
+	"openssl.spec",
+	"problems"
+)
+
+
+extra_hfiles = [
+	"cryptlib.h",
+	"e_os.h",
+	"e_os2.h",
+	"ext_dat.h",
+	"md32_common.h",
+	"mdc2.h",
+	"o_time.h",
+	"rc5.h"
+	]
+	
+extra_to_delete_after = [
+	"e_os.h",
+	"e_os2.h"
+	]
+	
+dirlist = [x for x in sorted(os.listdir(".")) if re.match("openssl", x, re.IGNORECASE)];
+if dirlist:
+	openssl_path = dirlist[-1]
+	
+files_to_copy = filelist.get_filename_list(os.path.join(openssl_path, "include", "openssl"), "",".*")
+
+for folder in remove_folders:
+	to_delete = os.path.join(openssl_path, folder)
+	print "delete ", to_delete
+	try:
+		shutil.rmtree(to_delete);
+	except:
+		print "not present"
+
+files_to_delete = {}
+for pat in remove_file_patterns:
+	files_to_delete.update(filelist.get_filename_list(openssl_path,"",pat))
+
+for file in files_to_delete:
+	print "delete ", file
+	os.remove(file)
+
+try:
+	os.makedirs(os.path.join(openssl_path,"openssl"))
+except:
+	print "directory already created"
+
+h_files =filelist.get_filename_list(openssl_path,"",".*\.h")
+
+copy_h_files = filelist.keep_filtered(h_files, files_to_copy.values()+ extra_hfiles)
+
+for file in copy_h_files:
+	print "copy file ", file, " to openssl directory"
+	shutil.copyfile(file, os.path.join(openssl_path,"openssl", os.path.basename(file)));
+	
+for file in extra_to_delete_after:
+	print "delete ", file
+	os.remove(os.path.join(openssl_path,file));
diff -Naur openssl-1.0.0q.orig/addon/utcprint.c openssl-1.0.0q/addon/utcprint.c
--- openssl-1.0.0q.orig/addon/utcprint.c	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/addon/utcprint.c	2017-04-25 16:23:39.697529711 +0200
@@ -0,0 +1,122 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+**
+*/
+
+/* crypto/addon/utcprint.c adapted from crypto/asn1/t_x509.c */
+/* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@mincom.oz.au).
+ * The implementation was written so as to conform with Netscapes SSL.
+ * 
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@mincom.oz.au).
+ * 
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (eay@mincom.oz.au)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from 
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (tjh@mincom.oz.au)"
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/openssl/asn1.h"
+#include "modules/pi/OpLocale.h"
+
+int ASN1_UTCTIME_unisprint(uni_char *sp, ASN1_UTCTIME *tm_string)
+    {
+    char *v;
+    int n,i;
+    int y=0,M=0;
+
+	struct tm time_data;
+
+    n=tm_string->length;
+    v=(char *)tm_string->data;
+
+	if (n < (tm_string->type == V_ASN1_GENERALIZEDTIME ? 12 : 10)) goto err;
+	n =(tm_string->type == V_ASN1_GENERALIZEDTIME ? 12 : 10);
+    for (i=0; i<n; i++)
+        if ((v[i] > '9') || (v[i] < '0')) goto err;
+    
+	y= (v[0]-'0')*10+(v[1]-'0');
+	if(n>10)
+	{
+		v+=2;
+		y= y*100 + (v[0]-'0')*10+(v[1]-'0') -1900;
+	}
+    if (y < 70) y+=100;
+	time_data.tm_year = y;
+
+    M= (v[2]-'0')*10+(v[3]-'0');
+    if ((M > 12) || (M < 1)) goto err;
+	time_data.tm_mon = M-1;
+
+	time_data.tm_mday = (v[4]-'0')*10+(v[5]-'0');
+	time_data.tm_hour = (v[6]-'0')*10+(v[7]-'0');
+	time_data.tm_min =  (v[8]-'0')*10+(v[9]-'0');
+    if (    (v[10] >= '0') && (v[10] <= '9') &&
+        (v[11] >= '0') && (v[11] <= '9'))
+		time_data.tm_sec =  (v[10]-'0')*10+(v[11]-'0');
+
+	time_data.tm_isdst = 0;
+	time_data.tm_wday = 0;
+	time_data.tm_yday = 0;
+	time_data.tm_sec = 0;
+#ifdef UTIL_CHECKED_STRFTIME
+	if (OpStatus::IsError(CheckedStrftime(sp, 100, UNI_L("%x %X GMT"), &time_data)))
+		return 0;
+#else
+	if(g_oplocale->op_strftime(sp, 100, UNI_L("%x %X GMT"), &time_data) > 100)
+		return 0;
+#endif
+	return(1);
+err:
+    uni_strcpy(sp,UNI_L("Bad time value"));
+    return(0);
+    }
diff -Naur openssl-1.0.0q.orig/core_includes.h openssl-1.0.0q/core_includes.h
--- openssl-1.0.0q.orig/core_includes.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/core_includes.h	2017-04-25 16:23:39.698527882 +0200
@@ -0,0 +1,38 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 2008 Opera Software ASA.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+**
+*/
+
+/**
+ * @file core_includes.h
+ *
+ * This file is included in all opera_*.cpp wrapper files in libopeay.
+ *
+ * This file must be included exactly once.
+ * This file must not be included from other modules.
+ *
+ */
+
+#ifdef CORE_INCLUDES_H
+#error This file must be included exactly once, from an opera_*.cpp wrapper file.
+#endif
+#define CORE_INCLUDES_H
+
+/* Add c++ header files that can not be included from the C source files here: */
+#include "modules/util/datefun.h"
+
+#define LIBOPEAY_X509_EX_DATA
+
+#ifdef MSWIN
+// avoid collisions with the debug free
+#undef free
+#endif // MSWIN
+
+// op_functions.h must be included in the resulting compilation unit just
+// before an *.c OpenSSL source file. Therefore its include statement must
+// be the last line of this file.
+#include "modules/libopeay/addon/op_functions.h"
diff -Naur openssl-1.0.0q.orig/create_wrappers.py openssl-1.0.0q/create_wrappers.py
--- openssl-1.0.0q.orig/create_wrappers.py	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/create_wrappers.py	2017-04-25 16:23:39.700527857 +0200
@@ -0,0 +1,211 @@
+#!/usr/bin/env python
+
+import os.path
+import sys
+import StringIO
+import optparse
+
+sys.path.insert(1, os.path.join(sys.path[0], '..', '..', 'modules', 'hardcore', 'scripts'))
+import module_sources
+import util
+
+class WrapperModuleSources(module_sources.ModuleSources):
+    """
+    This class extends the parser of module.sources by two new options:
+    - "cpp" (default disabled) can be used for all source-files
+      starting with "opera_" to indicate that the original source-file
+      is a cpp-file and not a c-file; so the wrapper can create the
+      correct include statement.
+    - forcecompileif=statement can be used to compile the source-code
+      if the specifed preprocessor statement is true.
+    """
+    def __init__(self):
+        module_sources.ModuleSources.__init__(self, 'modules', 'libopeay')
+
+    def cpp(self, source):
+        """
+        This option is used for all source-files starting with
+        "opera_" to indicate that the original source-file is a
+        cpp-file and not a c-file. So the wrapper can create the
+        correct include statement.
+        @param source is the source file to check.
+        @return True if the specified source-file has the
+          option cpp set and False otherwise (False is default).
+        """
+        return self.getSourceOption(source, "cpp", "0") == "1"
+
+    def forcecompileif(self, source):
+        """
+        The forcecompileif statement is used to compile the
+        source-code if the specifed preprocessor statement is true.
+
+        @param source is the source file to check.
+        @return the preprocessor statement or None if the option is
+          not set.
+        """
+        return self.getSourceOption(source, "forcecompileif", None)
+
+    def external_ssl_only(self, source):
+        """
+        The external-ssl-only statement is used to compile the
+        source-code with an "#ifdef EXTERNAL_SSL_OPENSSL_IMPLEMENTATION"
+        statement. Without this option, the source-code is compiled
+        with an "#ifdef _SSL_USE_OPENSSL_" statement.
+
+        @param source is the source file to check.
+        @return True if the specified source-file has the
+          option external-ssl-only set and False otherwise (False is
+          default).
+        """
+        return self.getSourceOption(source, "external-ssl-only", "0") == "1"
+
+    def include_with_system_lib(self, source):
+        """
+        The include-with-system-lib statement is used for source-files
+        that should be compiled even if
+        TWEAK_LIBOPEAY_USE_SYSTEM_OPENSSL_LIBRARY is enabled (i.e. an
+        external openssl library is used). Source files without this
+        option will be wrapped inside an
+        "#if !defined(_USE_SYSTEM_LIBCRYPTO_)" statement.
+
+        @param source is the source file to check.
+        @return True if the specified source-file has the
+          option include-with-system-lib set and False otherwise (False is
+          default).
+        """
+        return self.getSourceOption(source, "include-with-system-lib", "0") == "1"
+
+    def getSourceOptionString(self, source):
+        """
+        Returns the options string for the specified source file. The
+        options string can be used to update the file module.sources.
+        """
+        options = []
+        if self.nopch(source) and self.system_includes(source):
+            options.append("winnopch")
+        if self.nopch(source): options.append("no-pch")
+        if self.system_includes(source):
+            options.append("system_includes")
+        if self.cpp(source):
+            options.append("cpp")
+        if self.external_ssl_only(source):
+            options.append("external-ssl-only")
+        if self.include_with_system_lib(source):
+            options.append("include-with-system-lib")
+        forcecompileif = self.forcecompileif(source)
+        if forcecompileif:
+            options.append("forcecompileif=%s" % forcecompileif)
+        return ";".join(options)
+
+class HandleTemplateAction:
+    def __init__(self, cpp, module_sources, source_file, original_filename):
+        self.__cpp = cpp
+        self.__system_includes = module_sources.system_includes(source_file)
+        self.__forcecompileif = module_sources.forcecompileif(source_file)
+        self.__include_with_system_lib = module_sources.include_with_system_lib(source_file)
+        if module_sources.external_ssl_only(source_file):
+            self.__define = "EXTERNAL_SSL_OPENSSL_IMPLEMENTATION"
+        else:
+            self.__define = "_SSL_USE_OPENSSL_"
+        self.__original_filename = original_filename
+
+    def __call__(self, action, output):
+        if action == "header":
+            if self.__system_includes:
+                output.write("#include \"core/pch_system_includes.h\"\n")
+            else:
+                output.write("#include \"core/pch.h\"\n")
+            if not self.__cpp:
+                output.write("#include \"modules/libopeay/core_includes.h\"\n")
+            return True
+
+        elif action == "compileif start":
+            output.write("#if defined(%s)" % self.__define)
+            if self.__forcecompileif:
+                output.write(" || %s" % self.__forcecompileif)
+            output.write("\n")
+            if not self.__include_with_system_lib:
+                output.write("# if !defined(_USE_SYSTEM_LIBCRYPTO_)\n")
+            return True
+
+        elif action == "compileif end":
+            if not self.__include_with_system_lib:
+                output.write("# endif // !_USE_SYSTEM_LIBCRYPTO_\n")
+            output.write("#endif // %s" % self.__define)
+            if self.__forcecompileif:
+                output.write(" || %s" % self.__forcecompileif)
+            output.write("\n")
+            return True
+
+        elif action == "extern C start":
+            if not self.__cpp: output.write('extern "C" {\n')
+            return True
+
+        elif action == "extern C end":
+            if not self.__cpp: output.write('}\n')
+            return True
+
+        elif action == "original filename":
+            output.write('#include "modules/libopeay/%s"\n' % self.__original_filename)
+            return True
+
+option_parser = optparse.OptionParser(
+    description="(Re-)Generates the wrapper files for the openssl source files.")
+option_parser.parse_args()
+
+module_sources_out = StringIO.StringIO()
+module_sources_out.write("# [no-jumbo]\n")
+comments = ["Note: don't use jumbo-compile for libopeay, because this code",
+            "contains a lot of wrappers around external C-sources which",
+            "contain a lot of #define macros and static local functions which",
+            "generate a lot of conflicting declarations...",
+            "Note: this file is automatically generated by create_wrappers.py",
+            "source-files and options are preserved, but comments are not ..."
+            ]
+for line in comments:
+    module_sources_out.write("# %s\n" % line)
+module_sources_out.write("\n")
+
+sourceRoot = os.path.normpath(os.path.join(sys.path[0], '..', '..'))
+libopeayDir = os.path.join(sourceRoot, 'modules', 'libopeay')
+wrapper_template = os.path.join(libopeayDir, 'wrapper_template.cpp')
+module_sources = WrapperModuleSources()
+module_sources.load(os.path.join(libopeayDir, 'module.sources'))
+changed_files = []
+for source_file in module_sources.sources_all():
+    file_path = source_file.split('/')
+    filename = file_path[-1]
+    original_filename = filename
+    (sourcename, dot, extension) = filename.partition(".")
+    if sourcename.startswith("opera_"):
+        extension = "c"
+        if module_sources.cpp(source_file):
+            extension = "cpp"
+        original_filename = sourcename[6:] + "." + extension
+    else:
+        extension = "c"
+        filename = "opera_" + sourcename + ".cpp"
+    file_path[-1] = filename;
+
+    options = module_sources.getSourceOptionString(source_file)
+    if len(options) == 0:
+        module_sources_out.write("%s\n" % '/'.join(file_path))
+    else:
+        module_sources_out.write("%s # [%s]\n" % ('/'.join(file_path).ljust(34), options))
+    if util.readTemplate(wrapper_template,
+                         os.path.join(libopeayDir, *file_path),
+                         HandleTemplateAction(extension=="cpp",
+                                              module_sources,
+                                              source_file,
+                                              "/".join(file_path[0:-1] + [original_filename]))):
+        changed_files.append(os.path.join(*file_path))
+
+if util.updateFile(module_sources_out,
+                   os.path.join(libopeayDir, "module.sources")):
+    print "module.sources updated"
+else:
+    print "module.sources not changed"
+if len(changed_files):
+    print "%d wrapper files updated:" % len(changed_files), changed_files
+else:
+    print "No wrapper file changed"
diff -Naur openssl-1.0.0q.orig/crypto/.gitignore openssl-1.0.0q/crypto/.gitignore
--- openssl-1.0.0q.orig/crypto/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/.gitignore	2017-04-25 16:23:39.700527857 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/LPdir_unix.c openssl-1.0.0q/crypto/LPdir_unix.c
--- openssl-1.0.0q.orig/crypto/LPdir_unix.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/LPdir_unix.c	2017-04-25 16:23:39.702525876 +0200
@@ -25,6 +25,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
 #include <stddef.h>
 #include <stdlib.h>
 #include <limits.h>
diff -Naur openssl-1.0.0q.orig/crypto/LPdir_vms.c openssl-1.0.0q/crypto/LPdir_vms.c
--- openssl-1.0.0q.orig/crypto/LPdir_vms.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/LPdir_vms.c	2017-04-25 16:23:39.703526003 +0200
@@ -24,6 +24,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
diff -Naur openssl-1.0.0q.orig/crypto/LPdir_win.c openssl-1.0.0q/crypto/LPdir_win.c
--- openssl-1.0.0q.orig/crypto/LPdir_win.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/LPdir_win.c	2017-04-25 16:23:39.705526537 +0200
@@ -23,6 +23,9 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include <windows.h>
 #include <tchar.h>
 #ifndef LPDIR_H
diff -Naur openssl-1.0.0q.orig/crypto/aes/.gitignore openssl-1.0.0q/crypto/aes/.gitignore
--- openssl-1.0.0q.orig/crypto/aes/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/aes/.gitignore	2017-04-25 16:23:39.706526105 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/aes/aes.h openssl-1.0.0q/crypto/aes/aes.h
--- openssl-1.0.0q.orig/crypto/aes/aes.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/aes/aes.h	2017-04-25 16:23:39.708526360 +0200
@@ -58,7 +58,9 @@
 #error AES is disabled.
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
+#endif // !OPERA_SMALL_VERSION
 
 #define AES_ENCRYPT	1
 #define AES_DECRYPT	0
@@ -114,8 +116,8 @@
 	unsigned char *ivec, int *num);
 void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
 	size_t length, const AES_KEY *key,
-	unsigned char ivec[AES_BLOCK_SIZE],
-	unsigned char ecount_buf[AES_BLOCK_SIZE],
+	unsigned char ivec[AES_BLOCK_SIZE],       /* ARRAY OK UNUSED OPERA 2007-04-23 yngve*/
+	unsigned char ecount_buf[AES_BLOCK_SIZE], /* ARRAY OK UNUSED OPERA 2007-04-23 yngve*/
 	unsigned int *num);
 /* NB: the IV is _two_ blocks long */
 void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
diff -Naur openssl-1.0.0q.orig/crypto/aes/aes_cbc.c openssl-1.0.0q/crypto/aes/aes_cbc.c
--- openssl-1.0.0q.orig/crypto/aes/aes_cbc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/aes/aes_cbc.c	2017-04-25 16:23:39.710528849 +0200
@@ -49,6 +49,8 @@
  *
  */
 
+#ifndef OPENSSL_NO_AES
+
 #include <openssl/aes.h>
 #include <openssl/modes.h>
 
@@ -61,3 +63,5 @@
 	else
 		CRYPTO_cbc128_decrypt(in,out,len,key,ivec,(block128_f)AES_decrypt);
 }
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/aes/aes_cfb.c openssl-1.0.0q/crypto/aes/aes_cfb.c
--- openssl-1.0.0q.orig/crypto/aes/aes_cfb.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/aes/aes_cfb.c	2017-04-25 16:23:39.712527986 +0200
@@ -49,6 +49,8 @@
  *
  */
 
+#if !defined OPENSSL_NO_AES && defined OPENSSL_USE_CFB_CIPHERS
+
 #include <openssl/aes.h>
 #include <openssl/modes.h>
 
@@ -79,3 +81,4 @@
     CRYPTO_cfb128_8_encrypt(in,out,length,key,ivec,num,enc,(block128_f)AES_encrypt);
     }
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/aes/aes_core.c openssl-1.0.0q/crypto/aes/aes_core.c
--- openssl-1.0.0q.orig/crypto/aes/aes_core.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/aes/aes_core.c	2017-04-25 16:23:39.715528646 +0200
@@ -28,14 +28,20 @@
 /* Note: rewritten a little bit to provide error control and an OpenSSL-
    compatible API */
 
+#ifndef OPENSSL_NO_AES
+
 #ifndef AES_DEBUG
 # ifndef NDEBUG
 #  define NDEBUG
 # endif
 #endif
+
+#ifndef OPERA_SMALL_VERSION
 #include <assert.h>
 
 #include <stdlib.h>
+#endif
+
 #include <openssl/aes.h>
 #include "aes_locl.h"
 
@@ -1356,3 +1362,5 @@
 }
 
 #endif /* AES_ASM */
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/aes/aes_ecb.c openssl-1.0.0q/crypto/aes/aes_ecb.c
--- openssl-1.0.0q.orig/crypto/aes/aes_ecb.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/aes/aes_ecb.c	2017-04-25 16:23:39.717528621 +0200
@@ -54,7 +54,9 @@
 #  define NDEBUG
 # endif
 #endif
+#ifndef OPERA_SMALL_VERSION
 #include <assert.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/aes.h>
 #include "aes_locl.h"
diff -Naur openssl-1.0.0q.orig/crypto/aes/aes_locl.h openssl-1.0.0q/crypto/aes/aes_locl.h
--- openssl-1.0.0q.orig/crypto/aes/aes_locl.h	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/aes/aes_locl.h	2017-04-25 16:23:39.718526793 +0200
@@ -58,9 +58,11 @@
 #error AES is disabled.
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))
 # define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
diff -Naur openssl-1.0.0q.orig/crypto/aes/opera_aes_cbc.cpp openssl-1.0.0q/crypto/aes/opera_aes_cbc.cpp
--- openssl-1.0.0q.orig/crypto/aes/opera_aes_cbc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/aes/opera_aes_cbc.cpp	2017-04-25 16:23:39.720528164 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/aes/aes_cbc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/aes/opera_aes_cfb.cpp openssl-1.0.0q/crypto/aes/opera_aes_cfb.cpp
--- openssl-1.0.0q.orig/crypto/aes/opera_aes_cfb.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/aes/opera_aes_cfb.cpp	2017-04-25 16:23:39.721528012 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/aes/aes_cfb.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/aes/opera_aes_core.cpp openssl-1.0.0q/crypto/aes/opera_aes_core.cpp
--- openssl-1.0.0q.orig/crypto/aes/opera_aes_core.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/aes/opera_aes_core.cpp	2017-04-25 16:23:39.722527022 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch_system_includes.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_ENCRYPTION_AES_SUPPORT)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/aes/aes_core.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_ENCRYPTION_AES_SUPPORT)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/.gitignore openssl-1.0.0q/crypto/asn1/.gitignore
--- openssl-1.0.0q.orig/crypto/asn1/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/.gitignore	2017-04-25 16:23:39.723526311 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_bitstr.c openssl-1.0.0q/crypto/asn1/a_bitstr.c
--- openssl-1.0.0q.orig/crypto/asn1/a_bitstr.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_bitstr.c	2017-04-25 16:23:39.724525879 +0200
@@ -56,12 +56,16 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
 int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
 { return M_ASN1_BIT_STRING_set(x, d, len); }
+#endif
 
 int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
 	{
@@ -106,7 +110,7 @@
 
 	*(p++)=(unsigned char)bits;
 	d=a->data;
-	memcpy(p,d,len);
+	op_memcpy(p,d,len);
 	p+=len;
 	if (len > 0) p[-1]&=(0xff<<bits);
 	*pp=p;
@@ -155,7 +159,7 @@
 			i=ERR_R_MALLOC_FAILURE;
 			goto err;
 			}
-		memcpy(s,p,(int)len);
+		op_memcpy(s,p,(int)len);
 		s[len-1]&=(0xff<<i);
 		p+=len;
 		}
@@ -207,7 +211,7 @@
 			ASN1err(ASN1_F_ASN1_BIT_STRING_SET_BIT,ERR_R_MALLOC_FAILURE);
 			return 0;
 			}
-  		if (w+1-a->length > 0) memset(c+a->length, 0, w+1-a->length);
+		if (w+1-a->length > 0) op_memset(c+a->length, 0, w+1-a->length);
 		a->data=c;
 		a->length=w+1;
 	}
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_bool.c openssl-1.0.0q/crypto/asn1/a_bool.c
--- openssl-1.0.0q.orig/crypto/asn1/a_bool.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_bool.c	2017-04-25 16:23:39.726525854 +0200
@@ -56,10 +56,13 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 
+#ifndef OPERA_SMALL_VERSION
 int i2d_ASN1_BOOLEAN(int a, unsigned char **pp)
 	{
 	int r;
@@ -110,5 +113,6 @@
 	ASN1err(ASN1_F_D2I_ASN1_BOOLEAN,i);
 	return(ret);
 	}
+#endif
 
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_bytes.c openssl-1.0.0q/crypto/asn1/a_bytes.c
--- openssl-1.0.0q.orig/crypto/asn1/a_bytes.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_bytes.c	2017-04-25 16:23:39.728528064 +0200
@@ -56,10 +56,13 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c);
 /* type is a 'bitmap' of acceptable string types.
  */
@@ -107,7 +110,7 @@
 			i=ERR_R_MALLOC_FAILURE;
 			goto err;
 			}
-		memcpy(s,p,(int)len);
+		op_memcpy(s,p,(int)len);
 		s[len]='\0';
 		p+=len;
 		}
@@ -148,7 +151,7 @@
 	else
 		constructed=0;
 	ASN1_put_object(&p,constructed,ret,tag,xclass);
-	memcpy(p,a->data,a->length);
+	op_memcpy(p,a->data,a->length);
 	p+=a->length;
 	*pp= p;
 	return(r);
@@ -219,7 +222,7 @@
 				}
 			else
 				s=ret->data;
-			memcpy(s,p,(int)len);
+			op_memcpy(s,p,(int)len);
 			s[len] = '\0';
 			p+=len;
 			}
@@ -243,8 +246,9 @@
 	ASN1err(ASN1_F_D2I_ASN1_BYTES,i);
 	return(NULL);
 	}
+#endif
 
-
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 /* We are about to parse 0..n d2i_ASN1_bytes objects, we are to collapse
  * them into the one structure that is then returned */
 /* There have been a few bug fixes for this function from
@@ -292,7 +296,7 @@
 			c->error=ERR_R_BUF_LIB;
 			goto err;
 			}
-		memcpy(&(b.data[num]),os->data,os->length);
+		op_memcpy(&(b.data[num]),os->data,os->length);
 		if (!(c->inf & 1))
 			c->slen-=(c->p-c->q);
 		num+=os->length;
@@ -312,3 +316,4 @@
 	return(0);
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_d2i_fp.c openssl-1.0.0q/crypto/asn1/a_d2i_fp.c
--- openssl-1.0.0q.orig/crypto/asn1/a_d2i_fp.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_d2i_fp.c	2017-04-25 16:23:39.729526515 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <limits.h>
 #include "cryptlib.h"
 #include <openssl/buffer.h>
@@ -84,6 +86,7 @@
         }
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x)
 	{
 	BUF_MEM *b = NULL;
@@ -100,9 +103,10 @@
 	if (b != NULL) BUF_MEM_free(b);
 	return(ret);
 	}
-
+#endif
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x)
 	{
 	BUF_MEM *b = NULL;
@@ -119,6 +123,7 @@
 	if (b != NULL) BUF_MEM_free(b);
 	return(ret);
 	}
+#endif
 
 #ifndef OPENSSL_NO_FP_API
 void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_digest.c openssl-1.0.0q/crypto/asn1/a_digest.c
--- openssl-1.0.0q.orig/crypto/asn1/a_digest.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_digest.c	2017-04-25 16:23:39.731528166 +0200
@@ -56,13 +56,17 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 
 #ifndef NO_SYS_TYPES_H
+#ifndef OPERA_SMALL_VERSION
 # include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #include <openssl/err.h>
@@ -72,6 +76,7 @@
 
 #ifndef NO_ASN1_OLD
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
 		unsigned char *md, unsigned int *len)
 	{
@@ -91,7 +96,7 @@
 	OPENSSL_free(str);
 	return(1);
 	}
-
+#endif
 #endif
 
 
@@ -101,7 +106,7 @@
 	int i;
 	unsigned char *str = NULL;
 
-	i=ASN1_item_i2d(asn,&str, it);
+	i=ASN1_item_i2d((ASN1_VALUE *) asn,&str, it);
 	if (!str) return(0);
 
 	EVP_Digest(str, i, md, len, type, NULL);
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_dup.c openssl-1.0.0q/crypto/asn1/a_dup.c
--- openssl-1.0.0q.orig/crypto/asn1/a_dup.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_dup.c	2017-04-25 16:23:39.733529817 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 
 #ifndef NO_OLD_ASN1
@@ -72,13 +74,13 @@
 	if (x == NULL) return(NULL);
 
 	i=i2d(x,NULL);
-	b=OPENSSL_malloc(i+10);
+	b=(unsigned char *) OPENSSL_malloc(i+10);
 	if (b == NULL)
 		{ ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
 	p= b;
 	i=i2d(x,&p);
 	p2= b;
-	ret=d2i(NULL,&p2,i);
+	ret=(char*) d2i(NULL,&p2,i);
 	OPENSSL_free(b);
 	return(ret);
 	}
@@ -99,7 +101,7 @@
 
 	if (x == NULL) return(NULL);
 
-	i=ASN1_item_i2d(x,&b,it);
+	i=ASN1_item_i2d((ASN1_VALUE *) x,&b,it);
 	if (b == NULL)
 		{ ASN1err(ASN1_F_ASN1_ITEM_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
 	p= b;
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_enum.c openssl-1.0.0q/crypto/asn1/a_enum.c
--- openssl-1.0.0q.orig/crypto/asn1/a_enum.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_enum.c	2017-04-25 16:23:39.735526439 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/bn.h>
 
@@ -66,11 +68,12 @@
  * for comments on encoding see a_int.c
  */
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
 	{
 	int j,k;
 	unsigned int i;
-	unsigned char buf[sizeof(long)+1];
+	unsigned char buf[sizeof(long)+1]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 	long d;
 
 	a->type=V_ASN1_ENUMERATED;
@@ -79,7 +82,7 @@
 		if (a->data != NULL)
 			OPENSSL_free(a->data);
 		if ((a->data=(unsigned char *)OPENSSL_malloc(sizeof(long)+1)) != NULL)
-			memset((char *)a->data,0,sizeof(long)+1);
+			op_memset((char *)a->data,0,sizeof(long)+1);
 		}
 	if (a->data == NULL)
 		{
@@ -93,7 +96,7 @@
 		a->type=V_ASN1_NEG_ENUMERATED;
 		}
 
-	for (i=0; i<sizeof(long); i++)
+	for (i=0; i< (int) sizeof(long); i++)
 		{
 		if (d == 0) break;
 		buf[i]=(int)d&0xff;
@@ -105,6 +108,7 @@
 	a->length=j;
 	return(1);
 	}
+#endif
 
 long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a)
 	{
@@ -135,6 +139,7 @@
 	return(r);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
 	{
 	ASN1_ENUMERATED *ret;
@@ -180,3 +185,4 @@
 	else if(ai->type == V_ASN1_NEG_ENUMERATED) BN_set_negative(ret,1);
 	return(ret);
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_gentm.c openssl-1.0.0q/crypto/asn1/a_gentm.c
--- openssl-1.0.0q.orig/crypto/asn1/a_gentm.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_gentm.c	2017-04-25 16:23:39.736525728 +0200
@@ -58,10 +58,12 @@
 
 /* GENERALIZEDTIME implementation, written by Steve Henson. Based on UTCTIME */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
-#include "cryptlib.h"
-#include "o_time.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#include <openssl/o_time.h>
 #include <openssl/asn1.h>
 
 #if 0
@@ -71,7 +73,7 @@
 #ifdef CHARSET_EBCDIC
 	/* KLUDGE! We convert to ascii before writing DER */
 	int len;
-	char tmp[24];
+	char tmp[24]; /* ARRAY OK UNUSED 2009-05-25 yngve EBCDIC ONLY */
 	ASN1_STRING tmpstr = *(ASN1_STRING *)a;
 
 	len = tmpstr.length;
@@ -186,12 +188,13 @@
 	return(0);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
 	{
 	ASN1_GENERALIZEDTIME t;
 
 	t.type=V_ASN1_GENERALIZEDTIME;
-	t.length=strlen(str);
+	t.length=op_strlen(str);
 	t.data=(unsigned char *)str;
 	if (ASN1_GENERALIZEDTIME_check(&t))
 		{
@@ -207,6 +210,7 @@
 	else
 		return(0);
 	}
+#endif
 
 ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
 	     time_t t)
@@ -217,32 +221,44 @@
 ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
 	     time_t t, int offset_day, long offset_sec)
 	{
+	ASN1_GENERALIZEDTIME *alloced = NULL;
+
 	char *p;
 	struct tm *ts;
 	struct tm data;
 	size_t len = 20; 
 
 	if (s == NULL)
-		s=M_ASN1_GENERALIZEDTIME_new();
+		alloced = s=M_ASN1_GENERALIZEDTIME_new();
 	if (s == NULL)
 		return(NULL);
 
 	ts=OPENSSL_gmtime(&t, &data);
 	if (ts == NULL)
+	{
+		if(alloced)
+			M_ASN1_GENERALIZEDTIME_free(alloced);
 		return(NULL);
+	}
 
 	if (offset_day || offset_sec)
 		{ 
 		if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec))
+			{
+			if(alloced)
+				M_ASN1_GENERALIZEDTIME_free(alloced);
 			return NULL;
+			}
 		}
 
 	p=(char *)s->data;
 	if ((p == NULL) || ((size_t)s->length < len))
 		{
-		p=OPENSSL_malloc(len);
+		p= (char *) OPENSSL_malloc(len);
 		if (p == NULL)
 			{
+			if(alloced)
+				M_ASN1_GENERALIZEDTIME_free(alloced);
 			ASN1err(ASN1_F_ASN1_GENERALIZEDTIME_ADJ,
 				ERR_R_MALLOC_FAILURE);
 			return(NULL);
@@ -254,7 +270,7 @@
 
 	BIO_snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
 		     ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
-	s->length=strlen(p);
+	s->length=op_strlen(p);
 	s->type=V_ASN1_GENERALIZEDTIME;
 #ifdef CHARSET_EBCDIC_not
 	ebcdic2ascii(s->data, s->data, s->length);
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_i2d_fp.c openssl-1.0.0q/crypto/asn1/a_i2d_fp.c
--- openssl-1.0.0q.orig/crypto/asn1/a_i2d_fp.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_i2d_fp.c	2017-04-25 16:23:39.738528497 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_int.c openssl-1.0.0q/crypto/asn1/a_int.c
--- openssl-1.0.0q.orig/crypto/asn1/a_int.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_int.c	2017-04-25 16:23:39.740526516 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/bn.h>
 
@@ -150,7 +152,7 @@
 
 	if (pad) *(p++)=pb;
 	if (a->length == 0) *(p++)=0;
-	else if (!neg) memcpy(p,a->data,(unsigned int)a->length);
+	else if (!neg) op_memcpy(p,a->data,(unsigned int)a->length);
 	else {
 		/* Begin at the end of the encoding */
 		n=a->data + a->length - 1;
@@ -246,7 +248,7 @@
 			p++;
 			len--;
 			}
-		memcpy(s,p,(int)len);
+		op_memcpy(s,p,(int)len);
 	}
 
 	if (ret->data != NULL) OPENSSL_free(ret->data);
@@ -267,7 +269,6 @@
  * ASN1 integers: some broken software can encode a positive INTEGER
  * with its MSB set as negative (it doesn't add a padding zero).
  */
-
 ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
 	     long length)
 	{
@@ -315,7 +316,7 @@
 			p++;
 			len--;
 			}
-		memcpy(s,p,(int)len);
+		op_memcpy(s,p,(int)len);
 		p+=len;
 	}
 
@@ -336,7 +337,7 @@
 	{
 	int j,k;
 	unsigned int i;
-	unsigned char buf[sizeof(long)+1];
+	unsigned char buf[sizeof(long)+1]; /* ARRAY OK 2009-05-25 yngve */
 	long d;
 
 	a->type=V_ASN1_INTEGER;
@@ -345,7 +346,7 @@
 		if (a->data != NULL)
 			OPENSSL_free(a->data);
 		if ((a->data=(unsigned char *)OPENSSL_malloc(sizeof(long)+1)) != NULL)
-			memset((char *)a->data,0,sizeof(long)+1);
+			op_memset((char *)a->data,0,sizeof(long)+1);
 		}
 	if (a->data == NULL)
 		{
@@ -359,7 +360,7 @@
 		a->type=V_ASN1_NEG_INTEGER;
 		}
 
-	for (i=0; i<sizeof(long); i++)
+	for (i=0; i < (int)sizeof(long); i++)
 		{
 		if (d == 0) break;
 		buf[i]=(int)d&0xff;
@@ -422,7 +423,7 @@
 	len=((j == 0)?0:((j/8)+1));
 	if (ret->length < len+4)
 		{
-		unsigned char *new_data=OPENSSL_realloc(ret->data, len+4);
+		unsigned char *new_data= (unsigned char *) OPENSSL_realloc(ret->data, len+4);
 		if (!new_data)
 			{
 			ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_mbstr.c openssl-1.0.0q/crypto/asn1/a_mbstr.c
--- openssl-1.0.0q.orig/crypto/asn1/a_mbstr.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_mbstr.c	2017-04-25 16:23:39.742528447 +0200
@@ -56,9 +56,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 
 static int traverse_string(const unsigned char *p, int len, int inform,
@@ -97,9 +99,11 @@
 	ASN1_STRING *dest;
 	unsigned char *p;
 	int nchar;
-	char strbuf[32];
+#ifndef OPERA_SMALL_VERSION
+	char strbuf[32];	/* ARRAY OK UNUSED 2009-05-25 yngve */
+#endif
 	int (*cpyfunc)(unsigned long,void *) = NULL;
-	if(len == -1) len = strlen((const char *)in);
+	if(len == -1) len = op_strlen((const char *)in);
 	if(!mask) mask = DIRSTRING_TYPE;
 
 	/* First do a string check and work out the number of characters */
@@ -145,15 +149,19 @@
 
 	if((minsize > 0) && (nchar < minsize)) {
 		ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_SHORT);
+#ifndef OPERA_SMALL_VERSION
 		BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize);
 		ERR_add_error_data(2, "minsize=", strbuf);
+#endif
 		return -1;
 	}
 
 	if((maxsize > 0) && (nchar > maxsize)) {
 		ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_LONG);
+#ifndef OPERA_SMALL_VERSION
 		BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
 		ERR_add_error_data(2, "maxsize=", strbuf);
+#endif
 		return -1;
 	}
 
@@ -231,7 +239,7 @@
 		cpyfunc = cpy_utf8;
 		break;
 	}
-	if(!(p = OPENSSL_malloc(outlen + 1))) {
+	if(!(p = (unsigned char *) OPENSSL_malloc(outlen + 1))) {
 		if(free_out) ASN1_STRING_free(dest);
 		ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY,ERR_R_MALLOC_FAILURE);
 		return -1;
@@ -287,7 +295,7 @@
 static int in_utf8(unsigned long value, void *arg)
 {
 	int *nchar;
-	nchar = arg;
+	nchar = (int *) arg;
 	(*nchar)++;
 	return 1;
 }
@@ -297,7 +305,7 @@
 static int out_utf8(unsigned long value, void *arg)
 {
 	int *outlen;
-	outlen = arg;
+	outlen = (int *) arg;
 	*outlen += UTF8_putc(NULL, -1, value);
 	return 1;
 }
@@ -328,7 +336,7 @@
 static int cpy_asc(unsigned long value, void *arg)
 {
 	unsigned char **p, *q;
-	p = arg;
+	p = (unsigned char **) arg;
 	q = *p;
 	*q = (unsigned char) value;
 	(*p)++;
@@ -340,7 +348,7 @@
 static int cpy_bmp(unsigned long value, void *arg)
 {
 	unsigned char **p, *q;
-	p = arg;
+	p = (unsigned char **) arg;
 	q = *p;
 	*q++ = (unsigned char) ((value >> 8) & 0xff);
 	*q = (unsigned char) (value & 0xff);
@@ -353,7 +361,7 @@
 static int cpy_univ(unsigned long value, void *arg)
 {
 	unsigned char **p, *q;
-	p = arg;
+	p = (unsigned char **) arg;
 	q = *p;
 	*q++ = (unsigned char) ((value >> 24) & 0xff);
 	*q++ = (unsigned char) ((value >> 16) & 0xff);
@@ -369,7 +377,7 @@
 {
 	unsigned char **p;
 	int ret;
-	p = arg;
+	p = (unsigned char **) arg;
 	/* We already know there is enough room so pass 0xff as the length */
 	ret = UTF8_putc(*p, 0xff, value);
 	*p += ret;
@@ -389,12 +397,12 @@
 	if((ch >= 'a') && (ch <= 'z')) return 1;
 	if((ch >= 'A') && (ch <= 'Z')) return 1;
 	if((ch >= '0') && (ch <= '9')) return 1;
-	if ((ch == ' ') || strchr("'()+,-./:=?", ch)) return 1;
+	if ((ch == ' ') || op_strchr("'()+,-./:=?", ch)) return 1;
 #else /*CHARSET_EBCDIC*/
 	if((ch >= os_toascii['a']) && (ch <= os_toascii['z'])) return 1;
 	if((ch >= os_toascii['A']) && (ch <= os_toascii['Z'])) return 1;
 	if((ch >= os_toascii['0']) && (ch <= os_toascii['9'])) return 1;
-	if ((ch == os_toascii[' ']) || strchr("'()+,-./:=?", os_toebcdic[ch])) return 1;
+	if ((ch == os_toascii[' ']) || op_strchr("'()+,-./:=?", os_toebcdic[ch])) return 1;
 #endif /*CHARSET_EBCDIC*/
 	return 0;
 }
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_object.c openssl-1.0.0q/crypto/asn1/a_object.c
--- openssl-1.0.0q.orig/crypto/asn1/a_object.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_object.c	2017-04-25 16:23:39.744529818 +0200
@@ -56,14 +56,17 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <limits.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 #include <openssl/bn.h>
 
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_TXT2OBJ
 int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
 	{
 	unsigned char *p;
@@ -76,12 +79,13 @@
 
 	p= *pp;
 	ASN1_put_object(&p,0,a->length,V_ASN1_OBJECT,V_ASN1_UNIVERSAL);
-	memcpy(p,a->data,a->length);
+	op_memcpy(p,a->data,a->length);
 	p+=a->length;
 
 	*pp=p;
 	return(objsize);
 	}
+#endif
 
 int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
 	{
@@ -95,7 +99,7 @@
 	if (num == 0)
 		return(0);
 	else if (num == -1)
-		num=strlen(buf);
+		num=op_strlen(buf);
 
 	p=buf;
 	c= *(p++);
@@ -182,7 +186,7 @@
 				if (tmp != ftmp)
 					OPENSSL_free(tmp);
 				tmpsize = blsize + 32;
-				tmp = OPENSSL_malloc(tmpsize);
+				tmp = (char *) OPENSSL_malloc(tmpsize);
 				if (!tmp)
 					goto err;
 				}
@@ -242,7 +246,7 @@
 	i=i2t_ASN1_OBJECT(buf,sizeof buf,a);
 	if (i > (int)(sizeof(buf) - 1))
 		{
-		p = OPENSSL_malloc(i + 1);
+		p = (char*) OPENSSL_malloc(i + 1);
 		if (!p)
 			return -1;
 		i2t_ASN1_OBJECT(p,i + 1,a);
@@ -337,7 +341,7 @@
 			{ i=ERR_R_MALLOC_FAILURE; goto err; }
 		ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA;
 		}
-	memcpy(data,p,length);
+	op_memcpy(data,p,length);
 	/* reattach data to object, after which it remains const */
 	ret->data  =data;
 	ret->length=length;
@@ -396,6 +400,7 @@
 		OPENSSL_free(a);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
 	     const char *sn, const char *ln)
 	{
@@ -410,6 +415,7 @@
 		ASN1_OBJECT_FLAG_DYNAMIC_DATA;
 	return(OBJ_dup(&o));
 	}
+#endif
 
 IMPLEMENT_STACK_OF(ASN1_OBJECT)
 IMPLEMENT_ASN1_SET_OF(ASN1_OBJECT)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_octet.c openssl-1.0.0q/crypto/asn1/a_octet.c
--- openssl-1.0.0q.orig/crypto/asn1/a_octet.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_octet.c	2017-04-25 16:23:39.746530352 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 
 ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *x)
@@ -68,4 +70,3 @@
 
 int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d, int len)
 { return M_ASN1_OCTET_STRING_set(x, d, len); }
-
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_print.c openssl-1.0.0q/crypto/asn1/a_print.c
--- openssl-1.0.0q.orig/crypto/asn1/a_print.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_print.c	2017-04-25 16:23:39.747526847 +0200
@@ -56,8 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 
 int ASN1_PRINTABLE_type(const unsigned char *s, int len)
@@ -87,8 +90,8 @@
 		if (c&0x80)
 			t61=1;
 #else
-		if (!isalnum(c) && (c != ' ') &&
-		    strchr("'()+,-./:=?", c) == NULL)
+		if (!op_isalnum(c) && (c != ' ') &&
+		    op_strchr("'()+,-./:=?", c) == NULL)
 			ia5=1;
 		if (os_toascii[c] & 0x80)
 			t61=1;
@@ -99,6 +102,7 @@
 	return(V_ASN1_PRINTABLESTRING);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)
 	{
 	int i;
@@ -125,3 +129,4 @@
 	s->type=ASN1_PRINTABLE_type(s->data,s->length);
 	return(1);
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_set.c openssl-1.0.0q/crypto/asn1/a_set.c
--- openssl-1.0.0q.orig/crypto/asn1/a_set.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_set.c	2017-04-25 16:23:39.749527101 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1_mac.h>
 
 #ifndef NO_ASN1_OLD
@@ -77,7 +79,7 @@
     const MYBLOB *b2 = (const MYBLOB *)elem2;
     int r;
 
-    r = memcmp(b1->pbData, b2->pbData,
+    r = op_memcmp(b1->pbData, b2->pbData,
 	       b1->cbData < b2->cbData ? b1->cbData : b2->cbData);
     if(r != 0)
 	return r;
@@ -120,7 +122,7 @@
 
         pStart  = p; /* Catch the beg of Setblobs*/
 		/* In this array we will store the SET blobs */
-		rgSetBlob = OPENSSL_malloc(sk_OPENSSL_BLOCK_num(a) * sizeof(MYBLOB));
+		rgSetBlob = (MYBLOB*) OPENSSL_malloc(sk_OPENSSL_BLOCK_num(a) * sizeof(MYBLOB));
 		if (rgSetBlob == NULL)
 			{
 			ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE);
@@ -140,8 +142,8 @@
 
  /* Now we have to sort the blobs. I am using a simple algo.
     *Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/
-        qsort( rgSetBlob, sk_OPENSSL_BLOCK_num(a), sizeof(MYBLOB), SetBlobCmp);
-		if (!(pTempMem = OPENSSL_malloc(totSize)))
+        op_qsort( rgSetBlob, sk_OPENSSL_BLOCK_num(a), sizeof(MYBLOB), SetBlobCmp);
+		if (!(pTempMem = (unsigned char *) OPENSSL_malloc(totSize)))
 			{
 			ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE);
 			return(0);
@@ -151,12 +153,12 @@
         p = pTempMem;
         for(i=0; i<sk_OPENSSL_BLOCK_num(a); ++i)
 		{
-                memcpy(p, rgSetBlob[i].pbData, rgSetBlob[i].cbData);
+                op_memcpy(p, rgSetBlob[i].pbData, rgSetBlob[i].cbData);
                 p += rgSetBlob[i].cbData;
 		}
 
 /* Copy back to user mem*/
-        memcpy(pStart, pTempMem, totSize);
+        op_memcpy(pStart, pTempMem, totSize);
         OPENSSL_free(pTempMem);
         OPENSSL_free(rgSetBlob);
 
@@ -216,10 +218,12 @@
 		if (M_ASN1_D2I_end_sequence()) break;
 		/* XXX: This was called with 4 arguments, incorrectly, it seems
 		   if ((s=func(NULL,&c.p,c.slen,c.max-c.p)) == NULL) */
-		if ((s=d2i(NULL,&c.p,c.slen)) == NULL)
+		if ((s=(char *) d2i(NULL,&c.p,c.slen)) == NULL)
 			{
 			ASN1err(ASN1_F_D2I_ASN1_SET,ASN1_R_ERROR_PARSING_SET_ELEMENT);
+#ifndef OPERA_SMALL_VERSION
 			asn1_add_error(*pp,(int)(c.p- *pp));
+#endif
 			goto err;
 			}
 		if (!sk_OPENSSL_BLOCK_push(ret,s)) goto err;
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_sign.c openssl-1.0.0q/crypto/asn1/a_sign.c
--- openssl-1.0.0q.orig/crypto/asn1/a_sign.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_sign.c	2017-04-25 16:23:39.751525680 +0200
@@ -109,13 +109,17 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 
 #ifndef NO_SYS_TYPES_H
+#ifndef OPERA_SMALL_VERSION
 # include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #include <openssl/bn.h>
@@ -127,6 +131,7 @@
 
 #ifndef NO_ASN1_OLD
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2,
 	      ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey,
 	      const EVP_MD *type)
@@ -210,9 +215,11 @@
 		{ OPENSSL_cleanse((char *)buf_out,outll); OPENSSL_free(buf_out); }
 	return(outl);
 	}
+#endif /* !OPERA_SMALL_VERSION */
 
 #endif
 
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
 int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
 	     ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey,
 	     const EVP_MD *type)
@@ -260,7 +267,7 @@
 		X509_ALGOR_set0(algor2, OBJ_nid2obj(signid), paramtype, NULL);
 
 	EVP_MD_CTX_init(&ctx);
-	inl=ASN1_item_i2d(asn,&buf_in, it);
+	inl=ASN1_item_i2d((ASN1_VALUE *) asn,&buf_in, it);
 	outll=outl=EVP_PKEY_size(pkey);
 	buf_out=(unsigned char *)OPENSSL_malloc((unsigned int)outl);
 	if ((buf_in == NULL) || (buf_out == NULL))
@@ -296,3 +303,4 @@
 		{ OPENSSL_cleanse((char *)buf_out,outll); OPENSSL_free(buf_out); }
 	return(outl);
 	}
+#endif // LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_strex.c openssl-1.0.0q/crypto/asn1/a_strex.c
--- openssl-1.0.0q.orig/crypto/asn1/a_strex.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_strex.c	2017-04-25 16:23:39.753527051 +0200
@@ -56,9 +56,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/crypto.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
@@ -88,7 +90,7 @@
 {
 	unsigned char **out = arg;
 	if(!out) return 1;
-	memcpy(*out, buf, len);
+	op_memcpy(*out, buf, len);
 	*out += len;
 	return 1;
 }
@@ -97,16 +99,18 @@
 static int send_bio_chars(void *arg, const void *buf, int len)
 {
 	if(!arg) return 1;
-	if(BIO_write(arg, buf, len) != len) return 0;
+	if(BIO_write((BIO *) arg, buf, len) != len) return 0;
 	return 1;
 }
 
+#ifndef OPENSSL_NO_FP_API
 static int send_fp_chars(void *arg, const void *buf, int len)
 {
 	if(!arg) return 1;
 	if(fwrite(buf, 1, len, arg) != (unsigned int)len) return 0;
 	return 1;
 }
+#endif
 
 typedef int char_io(void *arg, const void *buf, int len);
 
@@ -120,7 +124,7 @@
 static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, char_io *io_ch, void *arg)
 {
 	unsigned char chflgs, chtmp;
-	char tmphex[HEX_SIZE(long)+3];
+	char tmphex[HEX_SIZE(long)+3]; /* ARRAY OK 2009-05-25 yngve */
 
 	if(c > 0xffffffffL)
 		return -1;
@@ -149,7 +153,7 @@
 		return 2;
 	}
 	if(chflgs & (ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB)) {
-		BIO_snprintf(tmphex, 11, "\\%02X", chtmp);
+		BIO_snprintf(tmphex, sizeof tmphex, "\\%02X", chtmp);
 		if(!io_ch(arg, tmphex, 3)) return -1;
 		return 3;
 	}
@@ -177,7 +181,7 @@
 {
 	int i, outlen, len;
 	unsigned char orflags, *p, *q;
-	unsigned long c;
+	unsigned long c=0;
 	p = buf;
 	q = buf + buflen;
 	outlen = 0;
@@ -211,7 +215,7 @@
 		}
 		if (p == q && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_LAST_ESC_2253;
 		if(type & BUF_TYPE_CONVUTF8) {
-			unsigned char utfbuf[6];
+			unsigned char utfbuf[6]; /* ARRAY OK 2007-11-07 yngve */
 			int utflen;
 			utflen = UTF8_putc(utfbuf, sizeof utfbuf, c);
 			for(i = 0; i < utflen; i++) {
@@ -237,9 +241,9 @@
 
 static int do_hex_dump(char_io *io_ch, void *arg, unsigned char *buf, int buflen)
 {
-	static const char hexdig[] = "0123456789ABCDEF";
+	const char *const hexdig = "0123456789ABCDEF";
 	unsigned char *p, *q;
-	char hextmp[2];
+	char hextmp[2]; /* ARRAY OK 2009-05-25 yngve */
 	if(arg) {
 		p = buf;
 		q = buf + buflen;
@@ -278,7 +282,7 @@
 	t.type = str->type;
 	t.value.ptr = (char *)str;
 	der_len = i2d_ASN1_TYPE(&t, NULL);
-	der_buf = OPENSSL_malloc(der_len);
+	der_buf = (unsigned char *) OPENSSL_malloc(der_len);
 	if(!der_buf) return -1;
 	p = der_buf;
 	i2d_ASN1_TYPE(&t, &p);
@@ -326,13 +330,15 @@
 	outlen = 0;
 
 
+#ifndef OPERA_SMALL_VERSION
 	if(lflags & ASN1_STRFLGS_SHOW_TYPE) {
 		const char *tagname;
 		tagname = ASN1_tag2str(type);
-		outlen += strlen(tagname);
+		outlen += op_strlen(tagname);
 		if(!io_ch(arg, tagname, outlen) || !io_ch(arg, ":", 1)) return -1; 
 		outlen++;
 	}
+#endif
 
 	/* Decide what to do with type, either dump content or display it */
 
@@ -397,10 +403,10 @@
 	ASN1_OBJECT *fn;
 	ASN1_STRING *val;
 	X509_NAME_ENTRY *ent;
-	char objtmp[80];
+	char objtmp[80]; /* ARRAY OK 2009-05-25 yngve */
 	const char *objbuf;
 	int outlen, len;
-	char *sep_dn, *sep_mv, *sep_eq;
+	const char *sep_dn, *sep_mv, *sep_eq;
 	int sep_dn_len, sep_mv_len, sep_eq_len;
 	if(indent < 0) indent = 0;
 	outlen = indent;
@@ -490,7 +496,7 @@
 					objbuf = "";
 				}
 			}
-			objlen = strlen(objbuf);
+			objlen = op_strlen(objbuf);
 			if(!io_ch(arg, objbuf, objlen)) return -1;
 			if ((objlen < fld_len) && (flags & XN_FLAG_FN_ALIGN)) {
 				if (!do_indent(io_ch, arg, fld_len - objlen)) return -1;
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_strnid.c openssl-1.0.0q/crypto/asn1/a_strnid.c
--- openssl-1.0.0q.orig/crypto/asn1/a_strnid.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_strnid.c	2017-04-25 16:23:39.849527800 +0200
@@ -56,17 +56,21 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 
 
+#ifndef OPERA_SMALL_VERSION
 static STACK_OF(ASN1_STRING_TABLE) *stable = NULL;
 static void st_free(ASN1_STRING_TABLE *tbl);
 static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
 			const ASN1_STRING_TABLE * const *b);
+#endif /* !OPERA_SMALL_VERSION */
 
 
 /* This is the global mask for the mbstring functions: this is use to
@@ -74,8 +78,14 @@
  * certain software (e.g. Netscape) has problems with them.
  */
 
+#ifndef _NO_GLOBALS_
 static unsigned long global_mask = B_ASN1_UTF8STRING;
+#else
+static const unsigned long global_mask = 0xFFFFFFFFL;
+#endif // !_NO_GLOBALS_
 
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 void ASN1_STRING_set_default_mask(unsigned long mask)
 {
 	global_mask = mask;
@@ -99,21 +109,23 @@
 {
 	unsigned long mask;
 	char *end;
-	if(!strncmp(p, "MASK:", 5)) {
+	if(!op_strncmp(p, "MASK:", 5)) {
 		if(!p[5]) return 0;
-		mask = strtoul(p + 5, &end, 0);
+		mask = op_strtoul(p + 5, &end, 0);
 		if(*end) return 0;
-	} else if(!strcmp(p, "nombstr"))
+	} else if(!op_strcmp(p, "nombstr"))
 			 mask = ~((unsigned long)(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING));
-	else if(!strcmp(p, "pkix"))
+	else if(!op_strcmp(p, "pkix"))
 			mask = ~((unsigned long)B_ASN1_T61STRING);
-	else if(!strcmp(p, "utf8only")) mask = B_ASN1_UTF8STRING;
-	else if(!strcmp(p, "default"))
+	else if(!op_strcmp(p, "utf8only")) mask = B_ASN1_UTF8STRING;
+	else if(!op_strcmp(p, "default"))
 	    mask = 0xFFFFFFFFL;
 	else return 0;
 	ASN1_STRING_set_default_mask(mask);
 	return 1;
 }
+#endif // !_NO_GLOBALS_
+#endif // !OPERA_SMALL_VERSION
 
 /* The following function generates an ASN1_STRING based on limits in a table.
  * Frequently the types and length of an ASN1_STRING are restricted by a 
@@ -179,11 +191,13 @@
 {NID_ms_csp_name,		-1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}
 };
 
+#ifndef OPERA_SMALL_VERSION
 static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
 			const ASN1_STRING_TABLE * const *b)
 {
 	return (*a)->nid - (*b)->nid;
 }
+#endif
 
 DECLARE_OBJ_BSEARCH_CMP_FN(ASN1_STRING_TABLE, ASN1_STRING_TABLE, table);
 
@@ -196,19 +210,26 @@
 
 ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid)
 {
+#ifndef OPERA_SMALL_VERSION
 	int idx;
+#endif // !OPERA_SMALL_VERSION
 	ASN1_STRING_TABLE *ttmp;
 	ASN1_STRING_TABLE fnd;
 	fnd.nid = nid;
 	ttmp = OBJ_bsearch_table(&fnd, tbl_standard, 
 			   sizeof(tbl_standard)/sizeof(ASN1_STRING_TABLE));
 	if(ttmp) return ttmp;
+#ifdef OPERA_SMALL_VERSION
+	return NULL;
+#else
 	if(!stable) return NULL;
 	idx = sk_ASN1_STRING_TABLE_find(stable, &fnd);
 	if(idx < 0) return NULL;
 	return sk_ASN1_STRING_TABLE_value(stable, idx);
+#endif // OPERA_SMALL_VERSION
 }
-	
+
+#ifndef OPERA_SMALL_VERSION
 int ASN1_STRING_TABLE_add(int nid,
 		 long minsize, long maxsize, unsigned long mask,
 				unsigned long flags)
@@ -252,6 +273,7 @@
 {
 	if(tbl->flags & STABLE_FLAGS_MALLOC) OPENSSL_free(tbl);
 }
+#endif // !OPERA_SMALL_VERSION
 
 
 IMPLEMENT_STACK_OF(ASN1_STRING_TABLE)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_time.c openssl-1.0.0q/crypto/asn1/a_time.c
--- openssl-1.0.0q.orig/crypto/asn1/a_time.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_time.c	2017-04-25 16:23:39.851526937 +0200
@@ -61,22 +61,27 @@
  * written by Steve Henson.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
-#include "cryptlib.h"
-#include "o_time.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#include <openssl/o_time.h>
 #include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(ASN1_TIME)
+#endif
 
 #if 0
 int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp)
 	{
 #ifdef CHARSET_EBCDIC
 	/* KLUDGE! We convert to ascii before writing DER */
-	char tmp[24];
+	char tmp[24]; /* ARRAY OK UNUSED 2009-05-25 yngve EBCDIC only*/
 	ASN1_STRING tmpstr;
 
 	if(a->type == V_ASN1_UTCTIME || a->type == V_ASN1_GENERALIZEDTIME) {
@@ -134,6 +139,7 @@
 	return 0;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 /* Convert an ASN1_TIME structure to GeneralizedTime */
 ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out)
 	{
@@ -173,12 +179,13 @@
 
 	return ret;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 int ASN1_TIME_set_string(ASN1_TIME *s, const char *str)
 	{
 	ASN1_TIME t;
 
-	t.length = strlen(str);
+	t.length = op_strlen(str);
 	t.data = (unsigned char *)str;
 	t.flags = 0;
 	
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_type.c openssl-1.0.0q/crypto/asn1/a_type.c
--- openssl-1.0.0q.orig/crypto/asn1/a_type.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_type.c	2017-04-25 16:23:39.853529985 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/objects.h>
 
@@ -80,7 +82,7 @@
 	if (type == V_ASN1_BOOLEAN)
 		a->value.boolean = value ? 0xff : 0;
 	else
-		a->value.ptr=value;
+		a->value.ptr=(char *)value;
 	}
 
 int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value)
@@ -93,7 +95,7 @@
 	else if (type == V_ASN1_OBJECT)
 		{
 		ASN1_OBJECT *odup;
-		odup = OBJ_dup(value);
+		odup = OBJ_dup((ASN1_OBJECT *)value);
 		if (!odup)
 			return 0;
 		ASN1_TYPE_set(a, type, odup);
@@ -101,7 +103,7 @@
 	else
 		{
 		ASN1_STRING *sdup;
-		sdup = ASN1_STRING_dup(value);
+		sdup = ASN1_STRING_dup((const ASN1_STRING *)value);
 		if (!sdup)
 			return 0;
 		ASN1_TYPE_set(a, type, sdup);
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_utctm.c openssl-1.0.0q/crypto/asn1/a_utctm.c
--- openssl-1.0.0q.orig/crypto/asn1/a_utctm.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_utctm.c	2017-04-25 16:23:39.855528283 +0200
@@ -56,10 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
-#include "cryptlib.h"
-#include "o_time.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#include <openssl/o_time.h>
 #include <openssl/asn1.h>
 
 #if 0
@@ -71,7 +73,7 @@
 #else
 	/* KLUDGE! We convert to ascii before writing DER */
 	int len;
-	char tmp[24];
+	char tmp[24]; /* ARRAY OK UNUSED 2009-05-25 yngve EBCDIC only*/
 	ASN1_STRING x = *(ASN1_STRING *)a;
 
 	len = x.length;
@@ -162,12 +164,13 @@
 	return(0);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str)
 	{
 	ASN1_UTCTIME t;
 
 	t.type=V_ASN1_UTCTIME;
-	t.length=strlen(str);
+	t.length=op_strlen(str);
 	t.data=(unsigned char *)str;
 	if (ASN1_UTCTIME_check(&t))
 		{
@@ -183,6 +186,7 @@
 	else
 		return(0);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
 	{
@@ -192,6 +196,8 @@
 ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
 				int offset_day, long offset_sec)
 	{
+	ASN1_UTCTIME *alloced = NULL;
+
 	char *p;
 	struct tm *ts;
 	struct tm data;
@@ -201,7 +207,7 @@
 	if (s == NULL)
 		{
 		free_s = 1;
-		s=M_ASN1_UTCTIME_new();
+		alloced = s=M_ASN1_UTCTIME_new();
 		}
 	if (s == NULL)
 		goto err;
@@ -209,12 +215,20 @@
 
 	ts=OPENSSL_gmtime(&t, &data);
 	if (ts == NULL)
-		goto err;
+		{
+		if(alloced)
+			M_ASN1_UTCTIME_free(alloced);
+ 		return(NULL);
+		}
 
 	if (offset_day || offset_sec)
 		{ 
 		if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec))
-			goto err;
+			{
+			if(alloced)
+				M_ASN1_UTCTIME_free(alloced);
+ 			return NULL;
+			}
 		}
 
 	if((ts->tm_year < 50) || (ts->tm_year >= 150))
@@ -223,9 +237,11 @@
 	p=(char *)s->data;
 	if ((p == NULL) || ((size_t)s->length < len))
 		{
-		p=OPENSSL_malloc(len);
+		p=(char *)OPENSSL_malloc(len);
 		if (p == NULL)
 			{
+			if(alloced)
+				M_ASN1_UTCTIME_free(alloced);
 			ASN1err(ASN1_F_ASN1_UTCTIME_ADJ,ERR_R_MALLOC_FAILURE);
 			goto err;
 			}
@@ -236,7 +252,7 @@
 
 	BIO_snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
 		     ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
-	s->length=strlen(p);
+	s->length=op_strlen(p);
 	s->type=V_ASN1_UTCTIME;
 #ifdef CHARSET_EBCDIC_not
 	ebcdic2ascii(s->data, s->data, s->length);
@@ -249,6 +265,7 @@
 	}
 
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
 	{
 	struct tm *tm;
@@ -270,6 +287,9 @@
 	t -= offset*60; /* FIXME: may overflow in extreme cases */
 
 	tm = OPENSSL_gmtime(&t, &data);
+
+	if(tm == NULL)
+		return 1;
 	
 #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1
 	year = g2(s->data);
@@ -286,6 +306,7 @@
 
 	return 0;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 
 #if 0
@@ -294,7 +315,7 @@
 	struct tm tm;
 	int offset;
 
-	memset(&tm,'\0',sizeof tm);
+	op_memset(&tm,'\0',sizeof tm);
 
 #define g2(p) (((p)[0]-'0')*10+(p)[1]-'0')
 	tm.tm_year=g2(s->data);
@@ -315,7 +336,7 @@
 		}
 #undef g2
 
-	return mktime(&tm)-offset*60; /* FIXME: mktime assumes the current timezone
+	return op_mktime(&tm)-offset*60; /* FIXME: mktime assumes the current timezone
 	                               * instead of UTC, and unless we rewrite OpenSSL
 				       * in Lisp we cannot locally change the timezone
 				       * without possibly interfering with other parts
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_utf8.c openssl-1.0.0q/crypto/asn1/a_utf8.c
--- openssl-1.0.0q.orig/crypto/asn1/a_utf8.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_utf8.c	2017-04-25 16:23:39.857528258 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/a_verify.c openssl-1.0.0q/crypto/asn1/a_verify.c
--- openssl-1.0.0q.orig/crypto/asn1/a_verify.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/a_verify.c	2017-04-25 16:23:39.859527674 +0200
@@ -56,14 +56,18 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include "asn1_locl.h"
 
 #ifndef NO_SYS_TYPES_H
+#ifndef OPERA_SMALL_VERSION
 # include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #include <openssl/bn.h>
@@ -74,6 +78,7 @@
 
 #ifndef NO_ASN1_OLD
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature,
 		char *data, EVP_PKEY *pkey)
 	{
@@ -122,12 +127,13 @@
 		}
 	/* we don't need to zero the 'ctx' because we just checked
 	 * public information */
-	/* memset(&ctx,0,sizeof(ctx)); */
+	/* op_memset(&ctx,0,sizeof(ctx)); */
 	ret=1;
 err:
 	EVP_MD_CTX_cleanup(&ctx);
 	return(ret);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 #endif
 
@@ -183,7 +189,7 @@
 		goto err;
 		}
 
-	inl = ASN1_item_i2d(asn, &buf_in, it);
+	inl = ASN1_item_i2d((ASN1_VALUE *) asn, &buf_in, it);
 	
 	if (buf_in == NULL)
 		{
@@ -205,7 +211,7 @@
 		}
 	/* we don't need to zero the 'ctx' because we just checked
 	 * public information */
-	/* memset(&ctx,0,sizeof(ctx)); */
+	/* op_memset(&ctx,0,sizeof(ctx)); */
 	ret=1;
 err:
 	EVP_MD_CTX_cleanup(&ctx);
diff -Naur openssl-1.0.0q.orig/crypto/asn1/ameth_lib.c openssl-1.0.0q/crypto/asn1/ameth_lib.c
--- openssl-1.0.0q.orig/crypto/asn1/ameth_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/ameth_lib.c	2017-04-25 16:23:39.861527649 +0200
@@ -55,43 +55,72 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
 #endif
 #include "asn1_locl.h"
+#include "modules/libopeay/libopeay_arrays.h"
+
+
+#define   rsa_asn1_meth0 OPENSSL_GLOBAL_ITEM_NAME(rsa_ameth__rsa_asn1_meth0)
+#define   rsa_asn1_meth1 OPENSSL_GLOBAL_ITEM_NAME(rsa_ameth__rsa_asn1_meth1)
+
+#define   dsa_asn1_meth0 OPENSSL_GLOBAL_ITEM_NAME(dsa_ameth__dsa_asn1_meth0)
+#define   dsa_asn1_meth1 OPENSSL_GLOBAL_ITEM_NAME(dsa_ameth__dsa_asn1_meth1)
+#define   dsa_asn1_meth2 OPENSSL_GLOBAL_ITEM_NAME(dsa_ameth__dsa_asn1_meth2)
+#define   dsa_asn1_meth3 OPENSSL_GLOBAL_ITEM_NAME(dsa_ameth__dsa_asn1_meth3)
+#define   dsa_asn1_meth4 OPENSSL_GLOBAL_ITEM_NAME(dsa_ameth__dsa_asn1_meth4)
+
+#define    dh_asn1_meth  OPENSSL_GLOBAL_ITEM_NAME(dh_ameth__dh_asn1_meth)
+#define eckey_asn1_meth  OPENSSL_GLOBAL_ITEM_NAME(ec_ameth__eckey_asn1_meth)
+#define  hmac_asn1_meth  OPENSSL_GLOBAL_ITEM_NAME(hm_ameth__hmac_asn1_meth)
+
+#ifdef HAS_COMPLEX_GLOBALS
+extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meth0;
+extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meth1;
+
+extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth0;
+extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth1;
+extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth2;
+extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth3;
+extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth4;
 
 extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[];
 extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[];
 extern const EVP_PKEY_ASN1_METHOD dh_asn1_meth;
 extern const EVP_PKEY_ASN1_METHOD eckey_asn1_meth;
 extern const EVP_PKEY_ASN1_METHOD hmac_asn1_meth;
+#endif // HAS_COMPLEX_GLOBALS
 
 /* Keep this sorted in type order !! */
-static const EVP_PKEY_ASN1_METHOD *standard_methods[] = 
-	{
+OPENSSL_PREFIX_CONST_ARRAY(static, const EVP_PKEY_ASN1_METHOD*, ameth_lib__standard_methods, libopeay)
 #ifndef OPENSSL_NO_RSA
-	&rsa_asn1_meths[0],
-	&rsa_asn1_meths[1],
+	CONST_ENTRY(&rsa_asn1_meth0)
+	CONST_ENTRY(&rsa_asn1_meth1)
 #endif
 #ifndef OPENSSL_NO_DH
-	&dh_asn1_meth,
+	CONST_ENTRY(&dh_asn1_meth)
 #endif
 #ifndef OPENSSL_NO_DSA
-	&dsa_asn1_meths[0],
-	&dsa_asn1_meths[1],
-	&dsa_asn1_meths[2],
-	&dsa_asn1_meths[3],
-	&dsa_asn1_meths[4],
+	CONST_ENTRY(&dsa_asn1_meth0)
+	CONST_ENTRY(&dsa_asn1_meth1)
+	CONST_ENTRY(&dsa_asn1_meth2)
+	CONST_ENTRY(&dsa_asn1_meth3)
+	CONST_ENTRY(&dsa_asn1_meth4)
 #endif
 #ifndef OPENSSL_NO_EC
-	&eckey_asn1_meth,
+	CONST_ENTRY(&eckey_asn1_meth)
 #endif
-	&hmac_asn1_meth
-	};
+	CONST_ENTRY(&hmac_asn1_meth)
+CONST_END(ameth_lib__standard_methods)
+#define standard_methods OPENSSL_GLOBAL_ARRAY_NAME(ameth_lib__standard_methods)
 
 typedef int sk_cmp_fn_type(const char * const *a, const char * const *b);
 DECLARE_STACK_OF(EVP_PKEY_ASN1_METHOD)
@@ -104,7 +133,7 @@
 	{
 	int i;
 	for (i = 0;
-		i < sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);
+		i < OPENSSL_CONST_ARRAY_SIZE(ameth_lib__standard_methods);
 		i++)
 		fprintf(stderr, "Number %d id=%d (%s)\n", i,
 			standard_methods[i]->pkey_id,
@@ -126,7 +155,7 @@
 
 int EVP_PKEY_asn1_get_count(void)
 	{
-	int num = sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);
+	int num = OPENSSL_CONST_ARRAY_SIZE(ameth_lib__standard_methods);
 	if (app_methods)
 		num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
 	return num;
@@ -134,7 +163,7 @@
 
 const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx)
 	{
-	int num = sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);
+	int num = OPENSSL_CONST_ARRAY_SIZE(ameth_lib__standard_methods);
 	if (idx < 0)
 		return NULL; 
 	if (idx < num)
@@ -156,8 +185,7 @@
 			return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
 		}
 	ret = OBJ_bsearch_ameth(&t, standard_methods,
-			  sizeof(standard_methods)
-			  /sizeof(EVP_PKEY_ASN1_METHOD *));
+			OPENSSL_CONST_ARRAY_SIZE(ameth_lib__standard_methods));
 	if (!ret || !*ret)
 		return NULL;
 	return *ret;
@@ -292,7 +320,7 @@
 					const char *pem_str, const char *info)
 	{
 	EVP_PKEY_ASN1_METHOD *ameth;
-	ameth = OPENSSL_malloc(sizeof(EVP_PKEY_ASN1_METHOD));
+	ameth = (EVP_PKEY_ASN1_METHOD *)OPENSSL_malloc(sizeof(EVP_PKEY_ASN1_METHOD));
 	if (!ameth)
 		return NULL;
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/asn1.h openssl-1.0.0q/crypto/asn1/asn1.h
--- openssl-1.0.0q.orig/crypto/asn1/asn1.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/asn1.h	2017-04-25 16:23:39.865527878 +0200
@@ -59,7 +59,9 @@
 #ifndef HEADER_ASN1_H
 #define HEADER_ASN1_H
 
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/e_os2.h>
 #ifndef OPENSSL_NO_BIO
 #include <openssl/bio.h>
@@ -406,12 +408,25 @@
 #define ASN1_ITEM_ptr(iptr) (iptr)
 
 /* Macro to include ASN1_ITEM pointer from base type */
+#ifndef OPERA_SMALL_VERSION
 #define ASN1_ITEM_ref(iptr) (&(iptr##_it))
 
 #define ASN1_ITEM_rptr(ref) (&(ref##_it))
 
 #define DECLARE_ASN1_ITEM(name) \
 	OPENSSL_EXTERN const ASN1_ITEM name##_it;
+#else // OPERA_SMALL_VERSION
+#define ASN1_ITEM_ref(iptr) (&(OPENSSL_GLOBAL_ITEM_NAME(iptr##_it)))
+
+#define ASN1_ITEM_rptr(ref) (&(OPENSSL_GLOBAL_ITEM_NAME(ref##_it)))
+
+#ifdef HAS_COMPLEX_GLOBALS
+#define DECLARE_ASN1_ITEM(name) \
+	OPENSSL_EXTERN const ASN1_ITEM g_##name##_it;
+#else
+#define DECLARE_ASN1_ITEM(name)
+#endif
+#endif // OPERA_SMALL_VERSION
 
 #else
 
@@ -570,6 +585,11 @@
 	const char *sname;
 } BIT_STRING_BITNAME;
 
+#define CONST_BIT_STRING_BITNAME_ENTRY(num, _lname, _sname) \
+	CONST_ENTRY_START(bitnum,num)\
+	CONST_ENTRY_SINGLE(lname,_lname)\
+	CONST_ENTRY_SINGLE(sname,_sname)\
+	CONST_ENTRY_END
 
 #define M_ASN1_STRING_length(x)	((x)->length)
 #define M_ASN1_STRING_length_set(x, n)	((x)->length = (n))
diff -Naur openssl-1.0.0q.orig/crypto/asn1/asn1_err.c openssl-1.0.0q/crypto/asn1/asn1_err.c
--- openssl-1.0.0q.orig/crypto/asn1/asn1_err.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/asn1_err.c	2017-04-25 16:23:39.866528285 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/asn1.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/asn1_gen.c openssl-1.0.0q/crypto/asn1/asn1_gen.c
--- openssl-1.0.0q.orig/crypto/asn1/asn1_gen.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/asn1_gen.c	2017-04-25 16:23:39.869527269 +0200
@@ -56,9 +56,10 @@
  *
  */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 #define ASN1_GEN_FLAG		0x10000
 #define ASN1_GEN_FLAG_IMP	(ASN1_GEN_FLAG|1)
@@ -70,7 +71,10 @@
 #define ASN1_GEN_FLAG_SETWRAP	(ASN1_GEN_FLAG|7)
 #define ASN1_GEN_FLAG_FORMAT	(ASN1_GEN_FLAG|8)
 
+#ifndef OPERA_SMALL_VERSION
+// For Opera-specific-version, see close to definition of asn1_gen__tnst.
 #define ASN1_GEN_STR(str,val)	{str, sizeof(str) - 1, val}
+#endif // !OPERA_SMALL_VERSION
 
 #define ASN1_FLAG_EXP_MAX	20
 
@@ -121,6 +125,7 @@
 static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype);
 static int asn1_str2tag(const char *tagstr, int len);
 
+#ifndef OPERA_SMALL_VERSION
 ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf)
 	{
 	X509V3_CTX cnf;
@@ -131,6 +136,7 @@
 	X509V3_set_nconf(&cnf, nconf);
 	return ASN1_generate_v3(str, &cnf);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
 	{
@@ -149,6 +155,9 @@
 	int hdr_constructed = 0, hdr_tag, hdr_class;
 	int r;
 
+	/* Suppress warning "potentially uninitialized local variable used". */
+	hdr_len = 0;
+
 	asn1_tags.imp_tag = -1;
 	asn1_tags.imp_class = -1;
 	asn1_tags.format = ASN1_GEN_FORMAT_ASCII;
@@ -226,7 +235,7 @@
 
 	/* Allocate buffer for new encoding */
 
-	new_der = OPENSSL_malloc(len);
+	new_der = (unsigned char *)OPENSSL_malloc(len);
 	if (!new_der)
 		goto err;
 
@@ -276,7 +285,7 @@
 
 static int asn1_cb(const char *elem, int len, void *bitstr)
 	{
-	tag_exp_arg *arg = bitstr;
+	tag_exp_arg *arg = (tag_exp_arg *)bitstr;
 	int i;
 	int utype;
 	int vlen = 0;
@@ -549,75 +558,80 @@
 	}
 
 
+#define ASN1_GEN_STR(str,val)	CONST_TRIPLE_ENTRY(strnam, str, len, sizeof(str) - 1, tag, val)
+OPENSSL_PREFIX_CONST_ARRAY(static, struct tag_name_st, asn1_gen__tnst, libopeay)
+	ASN1_GEN_STR("BOOL", V_ASN1_BOOLEAN)
+	ASN1_GEN_STR("BOOLEAN", V_ASN1_BOOLEAN)
+	ASN1_GEN_STR("NULL", V_ASN1_NULL)
+	ASN1_GEN_STR("INT", V_ASN1_INTEGER)
+	ASN1_GEN_STR("INTEGER", V_ASN1_INTEGER)
+	ASN1_GEN_STR("ENUM", V_ASN1_ENUMERATED)
+	ASN1_GEN_STR("ENUMERATED", V_ASN1_ENUMERATED)
+	ASN1_GEN_STR("OID", V_ASN1_OBJECT)
+	ASN1_GEN_STR("OBJECT", V_ASN1_OBJECT)
+	ASN1_GEN_STR("UTCTIME", V_ASN1_UTCTIME)
+	ASN1_GEN_STR("UTC", V_ASN1_UTCTIME)
+	ASN1_GEN_STR("GENERALIZEDTIME", V_ASN1_GENERALIZEDTIME)
+	ASN1_GEN_STR("GENTIME", V_ASN1_GENERALIZEDTIME)
+	ASN1_GEN_STR("OCT", V_ASN1_OCTET_STRING)
+	ASN1_GEN_STR("OCTETSTRING", V_ASN1_OCTET_STRING)
+	ASN1_GEN_STR("BITSTR", V_ASN1_BIT_STRING)
+	ASN1_GEN_STR("BITSTRING", V_ASN1_BIT_STRING)
+	ASN1_GEN_STR("UNIVERSALSTRING", V_ASN1_UNIVERSALSTRING)
+	ASN1_GEN_STR("UNIV", V_ASN1_UNIVERSALSTRING)
+	ASN1_GEN_STR("IA5", V_ASN1_IA5STRING)
+	ASN1_GEN_STR("IA5STRING", V_ASN1_IA5STRING)
+	ASN1_GEN_STR("UTF8", V_ASN1_UTF8STRING)
+	ASN1_GEN_STR("UTF8String", V_ASN1_UTF8STRING)
+	ASN1_GEN_STR("BMP", V_ASN1_BMPSTRING)
+	ASN1_GEN_STR("BMPSTRING", V_ASN1_BMPSTRING)
+	ASN1_GEN_STR("VISIBLESTRING", V_ASN1_VISIBLESTRING)
+	ASN1_GEN_STR("VISIBLE", V_ASN1_VISIBLESTRING)
+	ASN1_GEN_STR("PRINTABLESTRING", V_ASN1_PRINTABLESTRING)
+	ASN1_GEN_STR("PRINTABLE", V_ASN1_PRINTABLESTRING)
+	ASN1_GEN_STR("T61", V_ASN1_T61STRING)
+	ASN1_GEN_STR("T61STRING", V_ASN1_T61STRING)
+	ASN1_GEN_STR("TELETEXSTRING", V_ASN1_T61STRING)
+	ASN1_GEN_STR("GeneralString", V_ASN1_GENERALSTRING)
+	ASN1_GEN_STR("GENSTR", V_ASN1_GENERALSTRING)
+	ASN1_GEN_STR("NUMERIC", V_ASN1_NUMERICSTRING)
+	ASN1_GEN_STR("NUMERICSTRING", V_ASN1_NUMERICSTRING)
+
+	/* Special cases */
+	ASN1_GEN_STR("SEQUENCE", V_ASN1_SEQUENCE)
+	ASN1_GEN_STR("SEQ", V_ASN1_SEQUENCE)
+	ASN1_GEN_STR("SET", V_ASN1_SET)
+	/* type modifiers */
+	/* Explicit tag */
+	ASN1_GEN_STR("EXP", ASN1_GEN_FLAG_EXP)
+	ASN1_GEN_STR("EXPLICIT", ASN1_GEN_FLAG_EXP)
+	/* Implicit tag */
+	ASN1_GEN_STR("IMP", ASN1_GEN_FLAG_IMP)
+	ASN1_GEN_STR("IMPLICIT", ASN1_GEN_FLAG_IMP)
+	/* OCTET STRING wrapper */
+	ASN1_GEN_STR("OCTWRAP", ASN1_GEN_FLAG_OCTWRAP)
+	/* SEQUENCE wrapper */
+	ASN1_GEN_STR("SEQWRAP", ASN1_GEN_FLAG_SEQWRAP)
+	/* SET wrapper */
+	ASN1_GEN_STR("SETWRAP", ASN1_GEN_FLAG_SETWRAP)
+	/* BIT STRING wrapper */
+	ASN1_GEN_STR("BITWRAP", ASN1_GEN_FLAG_BITWRAP)
+	ASN1_GEN_STR("FORM", ASN1_GEN_FLAG_FORMAT)
+	ASN1_GEN_STR("FORMAT", ASN1_GEN_FLAG_FORMAT)
+CONST_END(asn1_gen__tnst)
+#define tnst OPENSSL_GLOBAL_ARRAY_NAME(asn1_gen__tnst)
+
+
 static int asn1_str2tag(const char *tagstr, int len)
 	{
 	unsigned int i;
-	static const struct tag_name_st *tntmp, tnst [] = {
-		ASN1_GEN_STR("BOOL", V_ASN1_BOOLEAN),
-		ASN1_GEN_STR("BOOLEAN", V_ASN1_BOOLEAN),
-		ASN1_GEN_STR("NULL", V_ASN1_NULL),
-		ASN1_GEN_STR("INT", V_ASN1_INTEGER),
-		ASN1_GEN_STR("INTEGER", V_ASN1_INTEGER),
-		ASN1_GEN_STR("ENUM", V_ASN1_ENUMERATED),
-		ASN1_GEN_STR("ENUMERATED", V_ASN1_ENUMERATED),
-		ASN1_GEN_STR("OID", V_ASN1_OBJECT),
-		ASN1_GEN_STR("OBJECT", V_ASN1_OBJECT),
-		ASN1_GEN_STR("UTCTIME", V_ASN1_UTCTIME),
-		ASN1_GEN_STR("UTC", V_ASN1_UTCTIME),
-		ASN1_GEN_STR("GENERALIZEDTIME", V_ASN1_GENERALIZEDTIME),
-		ASN1_GEN_STR("GENTIME", V_ASN1_GENERALIZEDTIME),
-		ASN1_GEN_STR("OCT", V_ASN1_OCTET_STRING),
-		ASN1_GEN_STR("OCTETSTRING", V_ASN1_OCTET_STRING),
-		ASN1_GEN_STR("BITSTR", V_ASN1_BIT_STRING),
-		ASN1_GEN_STR("BITSTRING", V_ASN1_BIT_STRING),
-		ASN1_GEN_STR("UNIVERSALSTRING", V_ASN1_UNIVERSALSTRING),
-		ASN1_GEN_STR("UNIV", V_ASN1_UNIVERSALSTRING),
-		ASN1_GEN_STR("IA5", V_ASN1_IA5STRING),
-		ASN1_GEN_STR("IA5STRING", V_ASN1_IA5STRING),
-		ASN1_GEN_STR("UTF8", V_ASN1_UTF8STRING),
-		ASN1_GEN_STR("UTF8String", V_ASN1_UTF8STRING),
-		ASN1_GEN_STR("BMP", V_ASN1_BMPSTRING),
-		ASN1_GEN_STR("BMPSTRING", V_ASN1_BMPSTRING),
-		ASN1_GEN_STR("VISIBLESTRING", V_ASN1_VISIBLESTRING),
-		ASN1_GEN_STR("VISIBLE", V_ASN1_VISIBLESTRING),
-		ASN1_GEN_STR("PRINTABLESTRING", V_ASN1_PRINTABLESTRING),
-		ASN1_GEN_STR("PRINTABLE", V_ASN1_PRINTABLESTRING),
-		ASN1_GEN_STR("T61", V_ASN1_T61STRING),
-		ASN1_GEN_STR("T61STRING", V_ASN1_T61STRING),
-		ASN1_GEN_STR("TELETEXSTRING", V_ASN1_T61STRING),
-		ASN1_GEN_STR("GeneralString", V_ASN1_GENERALSTRING),
-		ASN1_GEN_STR("GENSTR", V_ASN1_GENERALSTRING),
-		ASN1_GEN_STR("NUMERIC", V_ASN1_NUMERICSTRING),
-		ASN1_GEN_STR("NUMERICSTRING", V_ASN1_NUMERICSTRING),
-
-		/* Special cases */
-		ASN1_GEN_STR("SEQUENCE", V_ASN1_SEQUENCE),
-		ASN1_GEN_STR("SEQ", V_ASN1_SEQUENCE),
-		ASN1_GEN_STR("SET", V_ASN1_SET),
-		/* type modifiers */
-		/* Explicit tag */
-		ASN1_GEN_STR("EXP", ASN1_GEN_FLAG_EXP),
-		ASN1_GEN_STR("EXPLICIT", ASN1_GEN_FLAG_EXP),
-		/* Implicit tag */
-		ASN1_GEN_STR("IMP", ASN1_GEN_FLAG_IMP),
-		ASN1_GEN_STR("IMPLICIT", ASN1_GEN_FLAG_IMP),
-		/* OCTET STRING wrapper */
-		ASN1_GEN_STR("OCTWRAP", ASN1_GEN_FLAG_OCTWRAP),
-		/* SEQUENCE wrapper */
-		ASN1_GEN_STR("SEQWRAP", ASN1_GEN_FLAG_SEQWRAP),
-		/* SET wrapper */
-		ASN1_GEN_STR("SETWRAP", ASN1_GEN_FLAG_SETWRAP),
-		/* BIT STRING wrapper */
-		ASN1_GEN_STR("BITWRAP", ASN1_GEN_FLAG_BITWRAP),
-		ASN1_GEN_STR("FORM", ASN1_GEN_FLAG_FORMAT),
-		ASN1_GEN_STR("FORMAT", ASN1_GEN_FLAG_FORMAT),
-	};
+	const struct tag_name_st *tntmp;
 
 	if (len == -1)
 		len = strlen(tagstr);
 	
-	tntmp = tnst;	
-	for (i = 0; i < sizeof(tnst) / sizeof(struct tag_name_st); i++, tntmp++)
+	tntmp = tnst;
+	for (i = 0; i < OPENSSL_CONST_ARRAY_SIZE(asn1_gen__tnst); i++, tntmp++)
 		{
 		if ((len == tntmp->len) && !strncmp(tntmp->strnam, tagstr, len))
 			return tntmp->tag;
@@ -844,7 +858,7 @@
 		ASN1err(ASN1_F_BITSTR_CB, ASN1_R_INVALID_NUMBER);
 		return 0;
 		}
-	if (!ASN1_BIT_STRING_set_bit(bitstr, bitnum, 1))
+	if (!ASN1_BIT_STRING_set_bit((ASN1_BIT_STRING *)bitstr, bitnum, 1))
 		{
 		ASN1err(ASN1_F_BITSTR_CB, ERR_R_MALLOC_FAILURE);
 		return 0;
diff -Naur openssl-1.0.0q.orig/crypto/asn1/asn1_lib.c openssl-1.0.0q/crypto/asn1/asn1_lib.c
--- openssl-1.0.0q.orig/crypto/asn1/asn1_lib.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/asn1_lib.c	2017-04-25 16:23:39.871528641 +0200
@@ -56,15 +56,19 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <limits.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1_mac.h>
 
 static int asn1_get_length(const unsigned char **pp,int *inf,long *rl,int max);
 static void asn1_put_length(unsigned char **pp, int length);
-const char ASN1_version[]="ASN.1" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char ASN1_version[]="ASN.1" OPENSSL_VERSION_PTEXT;  /* ARRAY OK 2007-02-27 haavardm */
+#endif /* !OPERA_SMALL_VERSION */
 
 static int _asn1_check_infinite_end(const unsigned char **p, long len)
 	{
@@ -80,10 +84,12 @@
 	return(0);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_check_infinite_end(unsigned char **p, long len)
 	{
 	return _asn1_check_infinite_end((const unsigned char **)p, len);
 	}
+#endif /* !OPERA_SMALL_VERSION */
 
 int ASN1_const_check_infinite_end(const unsigned char **p, long len)
 	{
@@ -173,7 +179,7 @@
 		i= *p&0x7f;
 		if (*(p++) & 0x80)
 			{
-			if (i > sizeof(long))
+			if (i > (int) sizeof(long))
 				return 0;
 			if (max-- == 0) return(0);
 			while (i-- > 0)
@@ -285,6 +291,7 @@
 	return(ret);
 	}
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 static int _asn1_Finish(ASN1_const_CTX *c)
 	{
 	if ((c->inf == (1|V_ASN1_CONSTRUCTED)) && (!c->eos))
@@ -313,6 +320,7 @@
 	{
 	return _asn1_Finish(c);
 	}
+#endif // !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 
 int asn1_GetSequence(ASN1_const_CTX *c, long *length)
 	{
@@ -373,22 +381,22 @@
 int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)
 	{
 	unsigned char *c;
-	const char *data=_data;
+	const char *data= (const char *) _data;
 
 	if (len < 0)
 		{
 		if (data == NULL)
 			return(0);
 		else
-			len=strlen(data);
+			len=op_strlen(data);
 		}
 	if ((str->length < len) || (str->data == NULL))
 		{
 		c=str->data;
 		if (c == NULL)
-			str->data=OPENSSL_malloc(len+1);
+			str->data= (unsigned char *) OPENSSL_malloc(len+1);
 		else
-			str->data=OPENSSL_realloc(c,len+1);
+			str->data= (unsigned char *) OPENSSL_realloc(c,len+1);
 
 		if (str->data == NULL)
 			{
@@ -400,7 +408,7 @@
 	str->length=len;
 	if (data != NULL)
 		{
-		memcpy(str->data,data,len);
+		op_memcpy(str->data,data,len);
 		/* an allowance for strings :-) */
 		str->data[len]='\0';
 		}
@@ -411,7 +419,7 @@
 	{
 	if (str->data)
 		OPENSSL_free(str->data);
-	str->data = data;
+	str->data = (unsigned char *) data;
 	str->length = len;
 	}
 
@@ -453,7 +461,7 @@
 	i=(a->length-b->length);
 	if (i == 0)
 		{
-		i=memcmp(a->data,b->data,a->length);
+		i=op_memcmp(a->data,b->data,a->length);
 		if (i == 0)
 			return(a->type-b->type);
 		else
@@ -463,14 +471,16 @@
 		return(i);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 void asn1_add_error(const unsigned char *address, int offset)
 	{
-	char buf1[DECIMAL_SIZE(address)+1],buf2[DECIMAL_SIZE(offset)+1];
+	char buf1[DECIMAL_SIZE(address)+1],buf2[DECIMAL_SIZE(offset)+1];  /* ARRAY OK UNUSED OPERA 2004-02-18 yngve */
 
 	BIO_snprintf(buf1,sizeof buf1,"%lu",(unsigned long)address);
 	BIO_snprintf(buf2,sizeof buf2,"%d",offset);
 	ERR_add_error_data(4,"address=",buf1," offset=",buf2);
 	}
+#endif /* !OPERA_SMALL_VERSION */
 
 int ASN1_STRING_length(const ASN1_STRING *x)
 { return M_ASN1_STRING_length(x); }
diff -Naur openssl-1.0.0q.orig/crypto/asn1/asn1_locl.h openssl-1.0.0q/crypto/asn1/asn1_locl.h
--- openssl-1.0.0q.orig/crypto/asn1/asn1_locl.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/asn1_locl.h	2017-04-25 16:23:39.873528336 +0200
@@ -56,6 +56,9 @@
  *
  */
 
+#ifndef HEADER_ASN1_LOCL_H
+#define HEADER_ASN1_LOCL_H
+
 /* Internal ASN1 structures and functions: not for application use */
 
 /* ASN1 print context structure */
@@ -114,6 +117,59 @@
 
 	} /* EVP_PKEY_ASN1_METHOD */;
 
+#define CONST_EVP_PKEY_ASN1_METHOD_ITEM(cname, \
+	a_pkey_id, \
+	a_pkey_base_id, \
+	a_pkey_flags, \
+	a_pem_str, \
+	a_info, \
+	a_pub_decode, \
+	a_pub_encode, \
+	a_pub_cmp, \
+	a_pub_print, \
+	a_priv_decode, \
+	a_priv_encode, \
+	a_priv_print, \
+	a_pkey_size, \
+	a_pkey_bits, \
+	a_param_decode, \
+	a_param_encode, \
+	a_param_missing, \
+	a_param_copy, \
+	a_param_cmp, \
+	a_param_print, \
+	a_pkey_free, \
+	a_pkey_ctrl, \
+	a_old_priv_decode, \
+	a_old_priv_encode \
+) \
+	OPENSSL_PREFIX_CONST_ITEM(extern, EVP_PKEY_ASN1_METHOD, cname, libopeay) \
+		CONST_ITEM_ENTRY_START( pkey_id,         a_pkey_id) \
+		CONST_ITEM_ENTRY_SINGLE(pkey_base_id,    a_pkey_base_id) \
+		CONST_ITEM_ENTRY_SINGLE(pkey_flags,      a_pkey_flags) \
+		CONST_ITEM_ENTRY_SINGLE(pem_str,         a_pem_str) \
+		CONST_ITEM_ENTRY_SINGLE(info,            a_info) \
+		CONST_ITEM_ENTRY_SINGLE(pub_decode,      a_pub_decode) \
+		CONST_ITEM_ENTRY_SINGLE(pub_encode,      a_pub_encode) \
+		CONST_ITEM_ENTRY_SINGLE(pub_cmp,         a_pub_cmp) \
+		CONST_ITEM_ENTRY_SINGLE(pub_print,       a_pub_print) \
+		CONST_ITEM_ENTRY_SINGLE(priv_decode,     a_priv_decode) \
+		CONST_ITEM_ENTRY_SINGLE(priv_encode,     a_priv_encode) \
+		CONST_ITEM_ENTRY_SINGLE(priv_print,      a_priv_print) \
+		CONST_ITEM_ENTRY_SINGLE(pkey_size,       a_pkey_size) \
+		CONST_ITEM_ENTRY_SINGLE(pkey_bits,       a_pkey_bits) \
+		CONST_ITEM_ENTRY_SINGLE(param_decode,    a_param_decode) \
+		CONST_ITEM_ENTRY_SINGLE(param_encode,    a_param_encode) \
+		CONST_ITEM_ENTRY_SINGLE(param_missing,   a_param_missing) \
+		CONST_ITEM_ENTRY_SINGLE(param_copy,      a_param_copy) \
+		CONST_ITEM_ENTRY_SINGLE(param_cmp,       a_param_cmp) \
+		CONST_ITEM_ENTRY_SINGLE(param_print,     a_param_print) \
+		CONST_ITEM_ENTRY_SINGLE(pkey_free,       a_pkey_free) \
+		CONST_ITEM_ENTRY_SINGLE(pkey_ctrl,       a_pkey_ctrl) \
+		CONST_ITEM_ENTRY_SINGLE(old_priv_decode, a_old_priv_decode) \
+		CONST_ITEM_ENTRY_SINGLE(old_priv_encode, a_old_priv_encode) \
+	CONST_ITEM_ENTRY_END
+
 /* Method to handle CRL access.
  * In general a CRL could be very large (several Mb) and can consume large
  * amounts of resources if stored in memory by multiple processes.
@@ -132,3 +188,20 @@
 				ASN1_INTEGER *ser, X509_NAME *issuer);
 	int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk);
 	};
+
+#define CONST_X509_CRL_METHOD_ITEM(cname, \
+	a_flags, \
+	a_crl_init, \
+	a_crl_free, \
+	a_crl_lookup, \
+	a_crl_verify \
+) \
+	OPENSSL_PREFIX_CONST_ITEM(extern, X509_CRL_METHOD, cname, libopeay) \
+		CONST_ITEM_ENTRY_START( flags,         a_flags) \
+		CONST_ITEM_ENTRY_SINGLE(crl_init,      a_crl_init) \
+		CONST_ITEM_ENTRY_SINGLE(crl_free,      a_crl_free) \
+		CONST_ITEM_ENTRY_SINGLE(crl_lookup,    a_crl_lookup) \
+		CONST_ITEM_ENTRY_SINGLE(crl_verify,    a_crl_verify) \
+	CONST_ITEM_ENTRY_END
+
+#endif // !HEADER_ASN1_LOCL_H
diff -Naur openssl-1.0.0q.orig/crypto/asn1/asn1_mac.h openssl-1.0.0q/crypto/asn1/asn1_mac.h
--- openssl-1.0.0q.orig/crypto/asn1/asn1_mac.h	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/asn1_mac.h	2017-04-25 16:23:39.876527600 +0200
@@ -95,6 +95,7 @@
 	if (a != NULL) (*a)=ret; \
 	return(ret);
 
+#ifndef OPERA_SMALL_VERSION
 #define M_ASN1_D2I_Finish(a,func,e) \
 	M_ASN1_D2I_Finish_2(a); \
 err:\
@@ -102,6 +103,14 @@
 	asn1_add_error(*(const unsigned char **)pp,(int)(c.q- *pp)); \
 	if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
 	return(NULL)
+#else
+#define M_ASN1_D2I_Finish(a,func,e) \
+	M_ASN1_D2I_Finish_2(a); \
+err:\
+	ASN1_MAC_H_err((e),c.error,c.line); \
+	if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
+	return(NULL)
+#endif /* OPERA_SMALL_VERSION */
 
 #define M_ASN1_D2I_start_sequence() \
 	if (!asn1_GetSequence(&c,&length)) \
@@ -257,7 +266,7 @@
 #define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \
 	c.q=c.p; \
 	if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\
-		(void (*)())free_func,a,b) == NULL) \
+		(void (*)(void *))free_func,a,b) == NULL) \
 		{ c.line=__LINE__; goto err; } \
 	c.slen-=(c.p-c.q);
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/asn1_par.c openssl-1.0.0q/crypto/asn1/asn1_par.c
--- openssl-1.0.0q.orig/crypto/asn1/asn1_par.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/asn1_par.c	2017-04-25 16:23:39.879528540 +0200
@@ -56,12 +56,15 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include <openssl/objects.h>
 #include <openssl/asn1.h>
 
+#ifndef OPERA_SMALL_VERSION
 static int asn1_print_info(BIO *bp, int tag, int xclass,int constructed,
 	int indent);
 static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
@@ -69,8 +72,8 @@
 static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
 	     int indent)
 	{
-	static const char fmt[]="%-18s";
-	char str[128];
+	const char* fmt="%-18s";
+	char str[128]; /* ARRAY OK 2007-04-23 yngve */
 	const char *p;
 
 	if (constructed & V_ASN1_CONSTRUCTED)
@@ -92,6 +95,8 @@
 	else
 		p = ASN1_tag2str(tag);
 
+	str[sizeof(str)-1] = '\0'; /* Just to be on the safe side */
+
 	if (BIO_printf(bp,fmt,p) <= 0)
 		goto err;
 	return(1);
@@ -414,10 +419,12 @@
 	*pp=p;
 	return(ret);
 	}
+#endif /* !OPERA_SMALL_VERSION */
 
+#ifndef OPERA_SMALL_VERSION
 const char *ASN1_tag2str(int tag)
 {
-	static const char * const tag2str[] = {
+	const char * const tag2str[] = {
 	 "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING", /* 0-4 */
 	 "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL", /* 5-9 */
 	 "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>", 	    /* 10-13 */
@@ -434,4 +441,5 @@
 	if(tag < 0 || tag > 30) return "(unknown)";
 	return tag2str[tag];
 }
+#endif /* !OPERA_SMALL_VERSION */
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/asn1t.h openssl-1.0.0q/crypto/asn1/asn1t.h
--- openssl-1.0.0q.orig/crypto/asn1/asn1t.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/asn1t.h	2017-04-25 16:23:39.883530446 +0200
@@ -58,7 +58,10 @@
 #ifndef HEADER_ASN1T_H
 #define HEADER_ASN1T_H
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
+#endif /* !OPERA_SMALL_VERSION */
+
 #include <openssl/e_os2.h>
 #include <openssl/asn1.h>
 
@@ -74,6 +77,8 @@
 #endif
 
 
+#ifndef OPERA_SMALL_VERSION
+	// Normal openssl version
 #ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
 
 /* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
@@ -83,7 +88,8 @@
 /* Macros for start and end of ASN1_ITEM definition */
 
 #define ASN1_ITEM_start(itname) \
-	OPENSSL_GLOBAL const ASN1_ITEM itname##_it = {
+	OPENSSL_EXTERN const ASN1_ITEM itname##_it = {
+
 
 #define ASN1_ITEM_end(itname) \
 		};
@@ -108,11 +114,29 @@
 
 #endif
 
+#define ASN1_ITEM_start1(itname) ASN1_ITEM_start(itname)
+#define ASN1_ITEM_end1(itname) ASN1_ITEM_end(itname)
 
 /* Macros to aid ASN1 template writing */
 
+#ifndef NO_ASN1_FIELD_NAMES
+#define ASN1_FIELD_NAME_FIRST(name) #name ,
+#define ASN1_FIELD_NAME_LAST(name) , #name
+#define ASN1_FIELD_NAME(name) #name
+#else
+#define ASN1_FIELD_NAME_FIRST(name)
+#define ASN1_FIELD_NAME_LAST(name)
+#define ASN1_FIELD_NAME(x)
+#endif
+
 #define ASN1_ITEM_TEMPLATE(tname) \
-	static const ASN1_TEMPLATE tname##_item_tt 
+	static const ASN1_TEMPLATE tname##_item_tt =
+
+#define ASN1_ITEM_TEMPLATE_BLOCK(tname, typ, utyp, templ, tc, fun, sz)\
+				ASN1_ITEM_start(tname) \
+					typ, utyp, templ, tc,fun, sz\
+							ASN1_FIELD_NAME_LAST(tname) \
+				ASN1_ITEM_end(itname)
 
 #define ASN1_ITEM_TEMPLATE_END(tname) \
 	;\
@@ -122,8 +146,8 @@
 		&tname##_item_tt,\
 		0,\
 		NULL,\
-		0,\
-		#tname \
+		0\
+		ASN1_FIELD_NAME_LAST(tname) \
 	ASN1_ITEM_end(tname)
 
 
@@ -150,20 +174,20 @@
  */
 
 #define ASN1_SEQUENCE(tname) \
-	static const ASN1_TEMPLATE tname##_seq_tt[] 
+	static const ASN1_TEMPLATE tname##_seq_tt[] = {
 
 #define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
 
 #define ASN1_SEQUENCE_END_name(stname, tname) \
-	;\
+	} ;\
 	ASN1_ITEM_start(tname) \
 		ASN1_ITYPE_SEQUENCE,\
 		V_ASN1_SEQUENCE,\
 		tname##_seq_tt,\
 		sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
 		NULL,\
-		sizeof(stname),\
-		#stname \
+		sizeof(stname)\
+		ASN1_FIELD_NAME_LAST(stname) \
 	ASN1_ITEM_end(tname)
 
 #define ASN1_NDEF_SEQUENCE(tname) \
@@ -181,23 +205,23 @@
 	ASN1_SEQUENCE(tname)
 
 #define ASN1_SEQUENCE_ref(tname, cb, lck) \
-	static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \
+	static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, op_offsetof(tname, references), lck, cb, 0}; \
 	ASN1_SEQUENCE(tname)
 
 #define ASN1_SEQUENCE_enc(tname, enc, cb) \
-	static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \
+	static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, op_offsetof(tname, enc)}; \
 	ASN1_SEQUENCE(tname)
 
 #define ASN1_NDEF_SEQUENCE_END(tname) \
-	;\
+	};\
 	ASN1_ITEM_start(tname) \
 		ASN1_ITYPE_NDEF_SEQUENCE,\
 		V_ASN1_SEQUENCE,\
 		tname##_seq_tt,\
 		sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
 		NULL,\
-		sizeof(tname),\
-		#tname \
+		sizeof(tname)\
+		ASN1_FIELD_NAME_LAST(tname) \
 	ASN1_ITEM_end(tname)
 
 #define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname)
@@ -206,16 +230,17 @@
 
 #define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
 
+
 #define ASN1_SEQUENCE_END_ref(stname, tname) \
-	;\
+	};\
 	ASN1_ITEM_start(tname) \
 		ASN1_ITYPE_SEQUENCE,\
 		V_ASN1_SEQUENCE,\
 		tname##_seq_tt,\
 		sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
 		&tname##_aux,\
-		sizeof(stname),\
-		#stname \
+		sizeof(stname)\
+		ASN1_FIELD_NAME_LAST(#stname) \
 	ASN1_ITEM_end(tname)
 
 #define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \
@@ -254,7 +279,7 @@
  */
 
 #define ASN1_CHOICE(tname) \
-	static const ASN1_TEMPLATE tname##_ch_tt[] 
+	static const ASN1_TEMPLATE tname##_ch_tt[] = {
 
 #define ASN1_CHOICE_cb(tname, cb) \
 	static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
@@ -265,70 +290,96 @@
 #define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
 
 #define ASN1_CHOICE_END_selector(stname, tname, selname) \
-	;\
+	} ;\
 	ASN1_ITEM_start(tname) \
 		ASN1_ITYPE_CHOICE,\
-		offsetof(stname,selname) ,\
+		op_offsetof(stname,selname) ,\
 		tname##_ch_tt,\
 		sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
 		NULL,\
-		sizeof(stname),\
-		#stname \
+		sizeof(stname)\
+		ASN1_FIELD_NAME_LAST(stname) \
 	ASN1_ITEM_end(tname)
 
 #define ASN1_CHOICE_END_cb(stname, tname, selname) \
-	;\
+	} ;\
 	ASN1_ITEM_start(tname) \
 		ASN1_ITYPE_CHOICE,\
-		offsetof(stname,selname) ,\
+		op_offsetof(stname,selname) ,\
 		tname##_ch_tt,\
 		sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
 		&tname##_aux,\
-		sizeof(stname),\
-		#stname \
+		sizeof(stname)\
+		ASN1_FIELD_NAME(stname) \
 	ASN1_ITEM_end(tname)
 
 /* This helps with the template wrapper form of ASN1_ITEM */
 
 #define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
 	(flags), (tag), 0,\
-	#name, ASN1_ITEM_ref(type) }
+	ASN1_FIELD_NAME_FIRST(name)\
+	ASN1_ITEM_ref(type) }
 
 /* These help with SEQUENCE or CHOICE components */
 
 /* used to declare other types */
 
+#ifndef NO_ASN1_FIELD_NAMES
 #define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
-	(flags), (tag), offsetof(stname, field),\
+	(flags), (tag), op_offsetof(stname, field),\
 	#field, ASN1_ITEM_ref(type) }
+#else
+#define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
+	(flags), (tag), op_offsetof(stname, field),\
+	ASN1_ITEM_ref(type) }
+#endif
 
 /* used when the structure is combined with the parent */
 
+#ifndef NO_ASN1_FIELD_NAMES
 #define ASN1_EX_COMBINE(flags, tag, type) { \
 	(flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) }
+#else
+#define ASN1_EX_COMBINE(flags, tag, type) { \
+	(flags)|ASN1_TFLG_COMBINE, (tag), 0, ASN1_ITEM_ref(type) }
+#endif
 
 /* implicit and explicit helper macros */
 
 #define ASN1_IMP_EX(stname, field, type, tag, ex) \
-		ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type)
+		ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type),
 
 #define ASN1_EXP_EX(stname, field, type, tag, ex) \
 		ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)
+#define ASN1_EXP_EX1(stname, field, type, tag, ex) \
+		ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)
 
 /* Any defined by macros: the field used is in the table itself */
 
 #ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
-#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
-#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
+#ifndef NO_ASN1_FIELD_NAMES
+#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) },
+#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) },
+#else
+#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, (const ASN1_ITEM *)&(tblname##_adb) },
+#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, (const ASN1_ITEM *)&(tblname##_adb) },
+#endif
 #else
-#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
-#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
+#ifndef NO_ASN1_FIELD_NAMES
+#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb },
+#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb },
+#else
+#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, tblname##_adb },
+#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, tblname##_adb },
+#endif
 #endif
 /* Plain simple type */
-#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
+#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type),
+#define ASN1_SIMPLE1(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
+#define ASN1_SIMPLE2(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
 
 /* OPTIONAL simple type */
-#define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+#define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type),
 
 /* IMPLICIT tagged simple type */
 #define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
@@ -338,24 +389,27 @@
 
 /* Same as above but EXPLICIT */
 
-#define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
-#define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
+#define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0),
+#define ASN1_EXP1(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
+#define ASN1_EXP2(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
+#define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL),
+#define ASN1_EXP_OPT1(stname, field, type, tag) ASN1_EXP_EX1(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
 
 /* SEQUENCE OF type */
 #define ASN1_SEQUENCE_OF(stname, field, type) \
-		ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
+		ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type),
 
 /* OPTIONAL SEQUENCE OF */
 #define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
-		ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+		ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type),
 
 /* Same as above but for SET OF */
 
 #define ASN1_SET_OF(stname, field, type) \
-		ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
+		ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type),
 
 #define ASN1_SET_OF_OPT(stname, field, type) \
-		ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+		ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type),
 
 /* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
 
@@ -363,13 +417,13 @@
 			ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
 
 #define ASN1_EXP_SET_OF(stname, field, type, tag) \
-			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF),
 
 #define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
 			ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
 
 #define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
-			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL),
 
 #define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
 			ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
@@ -378,10 +432,10 @@
 			ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
 
 #define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
-			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF),
 
 #define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
-			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL),
 
 /* EXPLICIT using indefinite length constructed form */
 #define ASN1_NDEF_EXP(stname, field, type, tag) \
@@ -389,6 +443,10 @@
 
 /* EXPLICIT OPTIONAL using indefinite length constructed form */
 #define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF),
+#define ASN1_NDEF_EXP_OPT1(stname, field, type, tag) \
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
+#define ASN1_NDEF_EXP_OPT2(stname, field, type, tag) \
 			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
 
 /* Macros for the ASN1_ADB structure */
@@ -396,46 +454,514 @@
 #define ASN1_ADB(name) \
 	static const ASN1_ADB_TABLE name##_adbtbl[] 
 
+#define ASN1_ADB_SEQ(name) ASN1_ADB(name) = {
+
 #ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
 
 #define ASN1_ADB_END(name, flags, field, app_table, def, none) \
-	;\
+	} ;\
 	static const ASN1_ADB name##_adb = {\
 		flags,\
-		offsetof(name, field),\
+		op_offsetof(name, field),\
 		app_table,\
 		name##_adbtbl,\
 		sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
-		def,\
+		&def,\
 		none\
-	}
+	};
 
 #else
 
 #define ASN1_ADB_END(name, flags, field, app_table, def, none) \
-	;\
+	} ;\
 	static const ASN1_ITEM *name##_adb(void) \
 	{ \
 	static const ASN1_ADB internal_adb = \
 		{\
 		flags,\
-		offsetof(name, field),\
+		op_offsetof(name, field),\
 		app_table,\
 		name##_adbtbl,\
 		sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
-		def,\
+		&def,\
 		none\
 		}; \
 		return (const ASN1_ITEM *) &internal_adb; \
 	} \
-	void dummy_function(void)
+	void dummy_function(void);
 
 #endif
 
-#define ADB_ENTRY(val, template) {val, template}
+#define ADB_ENTRY(val, entry_template) {val, entry_template},
 
 #define ASN1_ADB_TEMPLATE(name) \
-	static const ASN1_TEMPLATE name##_tt 
+	static const ASN1_TEMPLATE name##_tt =
+
+#define ASN1_ADB_TEMPLATE_END ;
+
+#else // OPERA_SMALL_VERSION
+  // Opera specific global variable handling
+  // *******************
+#ifndef NO_ASN1_FIELD_NAMES
+#error("NO_ASN1_FIELD_NAMES must be defined")
+#endif
+#ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION
+#error("OPENSSL_EXPORT_VAR_AS_FUNCTION must NOT be defined")
+#endif
+
+/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
+#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
+
+
+/* Macros for start and end of ASN1_ITEM definition */
+
+#define ASN1_ITEM_start(itname) \
+	OPENSSL_PREFIX_CONST_ARRAY(OPENSSL_GLOBAL, ASN1_ITEM,itname##_it, libopeay)
+
+#define ASN1_ITEM_end(itname) \
+		CONST_END(itname)
+
+#define ASN1_ITEM_start1(itname) \
+	OPENSSL_PREFIX_CONST_ITEM(OPENSSL_GLOBAL, ASN1_ITEM,itname##_it, libopeay)
+
+#define ASN1_ITEM_end1(itname)
+
+#define ASN1_ITEM_DECLARE(itname) DECLARE_MODULE_CONST_ITEM(ASN1_ITEM,itname##_it)
+
+/* Macros to aid ASN1 template writing */
+
+#define ASN1_FIELD_NAME_FIRST(name)
+#define ASN1_FIELD_NAME_LAST(name)
+#define ASN1_FIELD_NAME(x)
+
+#define CONST_ENTRY_TEMPLATE_ITEM(flg, tg, off, ref)\
+		CONST_ENTRY_START(flags, flg)\
+		CONST_ENTRY_SINGLE(tag, tg)\
+		CONST_ENTRY_SINGLE(offset, off)\
+		CONST_ENTRY_SINGLE(item, ref)\
+		CONST_ENTRY_END
+
+#define CONST_ENTRY_TEMPLATE_ITEM1(flg, tg, off, ref)\
+		CONST_ITEM_ENTRY_START(flags, flg)\
+		CONST_ITEM_ENTRY_SINGLE(tag, tg)\
+		CONST_ITEM_ENTRY_SINGLE(offset, off)\
+		CONST_ITEM_ENTRY_SINGLE(item, ref)\
+		CONST_ITEM_ENTRY_END
+
+#define CONST_ENTRY_SINGLE_ASN1_ITEM(typ, utyp, templ, tc, fun, sz)\
+		CONST_ITEM_ENTRY_START(itype,typ)\
+		CONST_ITEM_ENTRY_SINGLE(utype,utyp)\
+		CONST_ITEM_ENTRY_SINGLE(templates,templ)\
+		CONST_ITEM_ENTRY_SINGLE(tcount,tc)\
+		CONST_ITEM_ENTRY_SINGLE(funcs,fun)\
+		CONST_ITEM_ENTRY_SINGLE(size,sz)\
+		CONST_ITEM_ENTRY_END
+
+
+#define ASN1_ITEM_TEMPLATE(tname) \
+	OPENSSL_PREFIX_CONST_ITEM(static, ASN1_TEMPLATE, tname##_item_tt, libopeay)
+
+#define ASN1_ITEM_TEMPLATE_BLOCK(tname, typ, utyp, templ, tc, fun, sz)\
+	ASN1_ITEM_start1(tname) \
+		CONST_ENTRY_SINGLE_ASN1_ITEM(typ, utyp, templ, tc, fun, sz)\
+	ASN1_ITEM_end1(tname)
+
+
+#define ASN1_ITEM_TEMPLATE_END(tname) \
+	ASN1_ITEM_TEMPLATE_BLOCK(tname ,ASN1_ITYPE_PRIMITIVE, -1 ,&OPENSSL_GLOBAL_NAME_item_tt(tname),0,NULL,0)
+
+#define ASN1_TYPE_TEMPLATE_DECLARE(tname)\
+	ASN1_ITEM_DECLARE(tname)
+
+#define ASN1_TYPE_TEMPLATE_DECLARE_FUN_C(tname)\
+	ASN1_ITEM_DECLARE_FUN_C(tname)
+
+#define ASN1_ITEM_TEMPLATE_DECLARE(tname)\
+	DECLARE_MODULE_CONST_ITEM(ASN1_TEMPLATE, tname##_item_tt);\
+	ASN1_ITEM_DECLARE(tname)
+
+/* This is a ASN1 type which just embeds a template */
+
+/* This pair helps declare a SEQUENCE. We can do:
+ *
+ * 	ASN1_SEQUENCE(stname) = {
+ * 		... SEQUENCE components ...
+ * 	} ASN1_SEQUENCE_END(stname)
+ *
+ * 	This will produce an ASN1_ITEM called stname_it
+ *	for a structure called stname.
+ *
+ * 	If you want the same structure but a different
+ *	name then use:
+ *
+ * 	ASN1_SEQUENCE(itname) = {
+ * 		... SEQUENCE components ...
+ * 	} ASN1_SEQUENCE_END_name(stname, itname)
+ *
+ *	This will create an item called itname_it using
+ *	a structure called stname.
+ */
+
+#define ASN1_SEQUENCE(tname) \
+	OPENSSL_PREFIX_CONST_ARRAY(static, ASN1_TEMPLATE, tname##_seq_tt, libopeay)
+
+#define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
+
+#define ASN1_SEQUENCE_END_name(stname,tname) \
+	CONST_END(tname##_seq_tt)\
+	ASN1_ITEM_TEMPLATE_BLOCK(tname,ASN1_ITYPE_SEQUENCE,V_ASN1_SEQUENCE,OPENSSL_GLOBAL_ARRAY_NAME(tname##_seq_tt), \
+					OPENSSL_CONST_ARRAY_SIZE(tname##_seq_tt), NULL, sizeof(stname))
+
+#define ASN1_SEQUENCE_DECLARE(tname)\
+	DECLARE_MODULE_CONST_ARRAY(ASN1_TEMPLATE,tname##_seq_tt);\
+	ASN1_ITEM_DECLARE(tname)
+
+#define ASN1_NDEF_SEQUENCE(tname) \
+	ASN1_SEQUENCE(tname)
+
+#define ASN1_NDEF_SEQUENCE_cb(tname, cb) \
+	ASN1_SEQUENCE_cb(tname, cb)
+
+#define CONST_ASN1_AUX(name, ad, f, ro, rl, cb, eo) \
+	OPENSSL_PREFIX_CONST_ITEM(static, ASN1_AUX, name, libopeay) \
+		CONST_ITEM_ENTRY_START(app_data,ad)\
+		CONST_ITEM_ENTRY_SINGLE(flags,f)\
+		CONST_ITEM_ENTRY_SINGLE(ref_offset,ro)\
+		CONST_ITEM_ENTRY_SINGLE(ref_lock,rl)\
+		CONST_ITEM_ENTRY_SINGLE(asn1_cb,cb)\
+		CONST_ITEM_ENTRY_SINGLE(enc_offset,eo)\
+		CONST_ITEM_ENTRY_END
+
+#define ASN1_AUX_DECLARE(tname)\
+	DECLARE_MODULE_CONST_ITEM(ASN1_AUX, tname)
+
+
+#define ASN1_SEQUENCE_cb(tname, cb) \
+	CONST_ASN1_AUX(tname##_aux, NULL, 0, 0, 0, cb, 0) \
+	ASN1_SEQUENCE(tname)
+
+#define ASN1_BROKEN_SEQUENCE(tname) \
+	CONST_ASN1_AUX(tname##_aux, NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0) \
+	ASN1_SEQUENCE(tname)
+
+#define ASN1_SEQUENCE_ref(tname, cb, lck) \
+	CONST_ASN1_AUX(tname##_aux, NULL, ASN1_AFLG_REFCOUNT, op_offsetof(tname, references), lck, cb, 0) \
+	ASN1_SEQUENCE(tname)
+
+#define ASN1_SEQUENCE_enc(tname, enc, cb) \
+	CONST_ASN1_AUX(tname##_aux, NULL, ASN1_AFLG_ENCODING, 0, 0, cb, op_offsetof(tname, enc)) \
+	ASN1_SEQUENCE(tname)
+
+#define ASN1_SEQ_AUX_DECLARE(tname)\
+	ASN1_AUX_DECLARE(tname##_aux);\
+	ASN1_SEQUENCE_DECLARE(tname)
+
+#define ASN1_SEQ_AUX_DECLARE_FUN_C(tname)\
+	ASN1_AUX_DECLARE_FUN_C(tname##_aux);\
+	ASN1_SEQUENCE_DECLARE_FUN_C(tname)
+
+
+#define ASN1_NDEF_SEQUENCE_END(tname) \
+	CONST_END(tname)\
+	ASN1_ITEM_TEMPLATE_BLOCK(tname,ASN1_ITYPE_NDEF_SEQUENCE, V_ASN1_SEQUENCE, OPENSSL_GLOBAL_ARRAY_NAME(tname##_seq_tt),\
+		OPENSSL_CONST_ARRAY_SIZE(tname##_seq_tt), NULL, sizeof(tname))
+
+#define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname)
+
+#define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
+
+#define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
+
+#define ASN1_SEQUENCE_END_ref(stname, tname) \
+	CONST_END(stname)\
+	ASN1_ITEM_TEMPLATE_BLOCK(tname,ASN1_ITYPE_SEQUENCE,V_ASN1_SEQUENCE,OPENSSL_GLOBAL_ARRAY_NAME(tname##_seq_tt),\
+		OPENSSL_CONST_ARRAY_SIZE(tname##_seq_tt),\
+		&OPENSSL_GLOBAL_ITEM_NAME(tname##_aux),\
+		sizeof(stname))
+
+#define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \
+	CONST_END(stname)\
+	ASN1_ITEM_TEMPLATE_BLOCK(tname,ASN1_ITYPE_SEQUENCE,V_ASN1_SEQUENCE,OPENSSL_GLOBAL_ARRAY_NAME(tname##_seq_tt),\
+		OPENSSL_CONST_ARRAY_SIZE(tname##_seq_tt),\
+		&OPENSSL_GLOBAL_ITEM_NAME(tname##_aux),\
+		sizeof(stname))
+
+
+/* This pair helps declare a CHOICE type. We can do:
+ *
+ * 	ASN1_CHOICE(chname) = {
+ * 		... CHOICE options ...
+ * 	ASN1_CHOICE_END(chname)
+ *
+ * 	This will produce an ASN1_ITEM called chname_it
+ *	for a structure called chname. The structure
+ *	definition must look like this:
+ *	typedef struct {
+ *		int type;
+ *		union {
+ *			ASN1_SOMETHING *opt1;
+ *			ASN1_SOMEOTHER *opt2;
+ *		} value;
+ *	} chname;
+ *
+ *	the name of the selector must be 'type'.
+ * 	to use an alternative selector name use the
+ *      ASN1_CHOICE_END_selector() version.
+ */
+
+#define ASN1_CHOICE(tname) \
+	OPENSSL_PREFIX_CONST_ARRAY(static, ASN1_TEMPLATE, tname##_ch_tt, libopeay)
+
+#define ASN1_CHOICE_cb(tname, cb) \
+	CONST_ASN1_AUX(tname##_aux, NULL, 0, 0, 0, cb, 0) \
+	ASN1_CHOICE(tname)
+
+#define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
+
+#define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
+
+#define ASN1_CHOICE_END_selector(stname, tname, selname) \
+	CONST_END(stname)\
+	ASN1_ITEM_TEMPLATE_BLOCK(tname,\
+		ASN1_ITYPE_CHOICE,\
+		op_offsetof(stname,selname) ,\
+		OPENSSL_GLOBAL_ARRAY_NAME(tname##_ch_tt),\
+		OPENSSL_CONST_ARRAY_SIZE(tname##_ch_tt),\
+		NULL,\
+		sizeof(stname))
+
+#define ASN1_CHOICE_END_cb(stname, tname, selname) \
+	CONST_END(stname)\
+	ASN1_ITEM_TEMPLATE_BLOCK(tname, \
+		ASN1_ITYPE_CHOICE,\
+		op_offsetof(stname,selname) ,\
+		OPENSSL_GLOBAL_ARRAY_NAME(tname##_ch_tt),\
+		OPENSSL_CONST_ARRAY_SIZE(tname##_ch_tt),\
+		&OPENSSL_GLOBAL_ITEM_NAME(tname##_aux),\
+		sizeof(stname))
+
+#define ASN1_CHOICE_DECLARE(tname)\
+	DECLARE_MODULE_CONST_ARRAY(ASN1_TEMPLATE, tname##_ch_tt);\
+	ASN1_ITEM_DECLARE(tname)
+
+#define ASN1_CHOICE_cb_DECLARE(tname)\
+	ASN1_AUX_DECLARE(tname##_aux);\
+	ASN1_CHOICE_DECLARE(tname)
+
+#define ASN1_CHOICE_cb_DECLARE_FUN_C(tname)\
+	ASN1_AUX_DECLARE_FUN_C(tname##_aux);\
+	ASN1_CHOICE_DECLARE_FUN_C(tname)
+
+/* This helps with the template wrapper form of ASN1_ITEM */
+
+#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) \
+	CONST_ENTRY_TEMPLATE_ITEM1( (flags), (tag), 0,\
+		ASN1_ITEM_ref(type))
+
+/* These help with SEQUENCE or CHOICE components */
+
+/* used to declare other types */
+
+#define ASN1_EX_TYPE(flags, tag, stname, field, type) \
+	CONST_ENTRY_TEMPLATE_ITEM((flags), (tag), op_offsetof(stname, field),\
+	ASN1_ITEM_ref(type) )
+#define ASN1_EX_TYPE1(flags, tag, stname, field, type) \
+	CONST_ENTRY_TEMPLATE_ITEM1((flags), (tag), op_offsetof(stname, field),\
+	ASN1_ITEM_ref(type) )
+
+/* used when the structure is combined with the parent */
+
+#define ASN1_EX_COMBINE(flags, tag, type) \
+	CONST_ENTRY_TEMPLATE_ITEM((flags)|ASN1_TFLG_COMBINE, (tag), 0, ASN1_ITEM_ref(type) )
+
+/* implicit and explicit helper macros */
+
+#define ASN1_IMP_EX(stname, field, type, tag, ex) \
+		ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type)
+
+#define ASN1_EXP_EX(stname, field, type, tag, ex) \
+		ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)
+#define ASN1_EXP_EX1(stname, field, type, tag, ex) \
+		ASN1_EX_TYPE1(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)
+
+/* Any defined by macros: the field used is in the table itself */
+
+#define ASN1_ADB_OBJECT(tblname) CONST_ENTRY_TEMPLATE_ITEM( ASN1_TFLG_ADB_OID, -1, 0, (const ASN1_ITEM *)&(OPENSSL_GLOBAL_ITEM_NAME(tblname##_adb)) )
+#define ASN1_ADB_INTEGER(tblname) CONST_ENTRY_TEMPLATE_ITEM( ASN1_TFLG_ADB_INT, -1, 0, (const ASN1_ITEM *)&(OPENSSL_GLOBAL_ITEM_NAME(tblname##_adb)) )
+
+/* Plain simple type */
+#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
+#define ASN1_SIMPLE1(stname, field, type) ASN1_EX_TYPE1(0,0, stname, field, type)
+// Inside ADB_ENTRY
+#ifdef HAS_COMPLEX_GLOBALS
+#define ASN1_SIMPLE2(stname, field, type) \
+		CONST_ENTRY_START(tt.flags, 0)  \
+		CONST_ENTRY_SINGLE(tt.tag, 0)  \
+		CONST_ENTRY_SINGLE(tt.offset, op_offsetof(stname, field))\
+		CONST_ENTRY_SINGLE(tt.item, ASN1_ITEM_ref(type)) \
+		CONST_ITEM_ENTRY_END2
+#else
+#define ASN1_SIMPLE2(stname, field, type) \
+		CONST_ENTRY_SINGLE(tt.flags, 0)\
+		CONST_ENTRY_SINGLE(tt.tag, 0)\
+		CONST_ENTRY_SINGLE(tt.offset, op_offsetof(stname, field))\
+		CONST_ENTRY_SINGLE(tt.item, ASN1_ITEM_ref(type))
+#endif
+
+/* OPTIONAL simple type */
+#define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+
+/* IMPLICIT tagged simple type */
+#define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
+
+/* IMPLICIT tagged OPTIONAL simple type */
+#define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
+
+/* Same as above but EXPLICIT */
+
+#define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
+#define ASN1_EXP1(stname, field, type, tag) ASN1_EXP_EX1(stname, field, type, tag, 0)
+
+#ifdef HAS_COMPLEX_GLOBALS
+#define ASN1_EXP2(stname, field, type, _tag) \
+		CONST_ENTRY_START(tt.flags, ASN1_TFLG_EXPLICIT)\
+		CONST_ENTRY_SINGLE(tt.tag, _tag)\
+		CONST_ENTRY_SINGLE(tt.offset, op_offsetof(stname, field))\
+		CONST_ENTRY_SINGLE(tt.item, ASN1_ITEM_ref(type))\
+		CONST_ITEM_ENTRY_END2
+#else
+// Inside ADB_ENTRY
+#define ASN1_EXP2(stname, field, type, _tag) \
+		CONST_ENTRY_SINGLE(tt.flags, ASN1_TFLG_EXPLICIT)\
+		CONST_ENTRY_SINGLE(tt.tag, _tag)\
+		CONST_ENTRY_SINGLE(tt.offset, op_offsetof(stname, field))\
+		CONST_ENTRY_SINGLE(tt.item, ASN1_ITEM_ref(type))
+#endif
+
+#define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
+#define ASN1_EXP_OPT1(stname, field, type, tag) ASN1_EXP_EX1(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
+
+/* SEQUENCE OF type */
+#define ASN1_SEQUENCE_OF(stname, field, type) \
+		ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
+
+/* OPTIONAL SEQUENCE OF */
+#define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
+		ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+
+/* Same as above but for SET OF */
+
+#define ASN1_SET_OF(stname, field, type) \
+		ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
+
+#define ASN1_SET_OF_OPT(stname, field, type) \
+		ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+
+/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
+
+#define ASN1_IMP_SET_OF(stname, field, type, tag) \
+			ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
+
+#define ASN1_EXP_SET_OF(stname, field, type, tag) \
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
+
+#ifdef HAS_COMPLEX_GLOBALS
+#define ASN1_EXP_SET_OF2(stname, field, type, _tag) \
+		CONST_ENTRY_START(tt.flags, ASN1_TFLG_EXPLICIT | ASN1_TFLG_SET_OF)\
+		CONST_ENTRY_SINGLE(tt.tag, _tag)\
+		CONST_ENTRY_SINGLE(tt.offset, op_offsetof(stname, field))\
+		CONST_ENTRY_SINGLE(tt.item, ASN1_ITEM_ref(type))\
+		CONST_ITEM_ENTRY_END2
+#else
+// Inside ADB_ENTRY
+#define ASN1_EXP_SET_OF2(stname, field, type, _tag) \
+		CONST_ENTRY_SINGLE(tt.flags, ASN1_TFLG_EXPLICIT | ASN1_TFLG_SET_OF)\
+		CONST_ENTRY_SINGLE(tt.tag, _tag)\
+		CONST_ENTRY_SINGLE(tt.offset, op_offsetof(stname, field))\
+		CONST_ENTRY_SINGLE(tt.item, ASN1_ITEM_ref(type))
+#endif
+
+#define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
+			ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
+
+#define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
+
+#define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
+			ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
+
+#define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
+			ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+
+#define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
+
+#define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+
+/* EXPLICIT OPTIONAL using indefinite length constructed form */
+#define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
+			ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
+#define ASN1_NDEF_EXP_OPT1(stname, field, type, tag) \
+			ASN1_EXP_EX1(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
+
+#ifdef HAS_COMPLEX_GLOBALS
+#define ASN1_NDEF_EXP_OPT2(stname, field, type, _tag) \
+		CONST_ENTRY_START(tt.flags, (ASN1_TFLG_EXPLICIT | ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF))\
+		CONST_ENTRY_SINGLE(tt.tag, (_tag))\
+		CONST_ENTRY_SINGLE(tt.offset, op_offsetof(stname, field))\
+		CONST_ENTRY_SINGLE(tt.item, ASN1_ITEM_ref(type))\
+		CONST_ITEM_ENTRY_END2
+#else
+// Inside ADB_ENTRY
+#define ASN1_NDEF_EXP_OPT2(stname, field, type, _tag) \
+		CONST_ENTRY_SINGLE(tt.flags, (ASN1_TFLG_EXPLICIT | ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF))\
+		CONST_ENTRY_SINGLE(tt.tag, (_tag))\
+		CONST_ENTRY_SINGLE(tt.offset, op_offsetof(stname, field))\
+		CONST_ENTRY_SINGLE(tt.item, ASN1_ITEM_ref(type))
+#endif
+
+/* Macros for the ASN1_ADB structure */
+
+#define ASN1_ADB(name) \
+	OPENSSL_PREFIX_CONST_ARRAY(static, ASN1_ADB_TABLE, name##_adbtbl, libopeay) 
+
+#define ASN1_ADB_SEQ(name) ASN1_ADB(name)
+
+#define ASN1_ADB_END(name, _flags, field, app_table, def, none) \
+	CONST_END(name##_adbtbl) \
+	OPENSSL_PREFIX_CONST_ITEM(static, ASN1_ADB, name##_adb, libopeay)\
+		CONST_ITEM_ENTRY_START(flags, _flags)\
+		CONST_ITEM_ENTRY_SINGLE(offset, op_offsetof(name, field))\
+		CONST_ITEM_ENTRY_SINGLE(app_items, app_table)\
+		CONST_ITEM_ENTRY_SINGLE(tbl, OPENSSL_GLOBAL_ARRAY_NAME(name##_adbtbl))\
+		CONST_ITEM_ENTRY_SINGLE(tblcount, OPENSSL_CONST_ARRAY_SIZE(name##_adbtbl))\
+		CONST_ITEM_ENTRY_SINGLE(default_tt, &OPENSSL_GLOBAL_ITEM_NAME(def))\
+		CONST_ITEM_ENTRY_SINGLE(null_tt, none)\
+		CONST_ITEM_ENTRY_END
+
+#define ADB_ENTRY(val, entry_template)\
+	CONST_ENTRY_START(value, val)\
+	CONST_ENTRY_SEP	\
+	entry_template  \
+	CONST_ENTRY_END
+
+#define ASN1_ADB_SEQ_DECLARE(tname)\
+	DECLARE_MODULE_CONST_ARRAY(ASN1_ADB_TABLE, tname##_adbtbl);\
+	DECLARE_MODULE_CONST_ITEM(ASN1_ADB, tname##_adb)
+
+#define ASN1_ADB_TEMPLATE(name) \
+	OPENSSL_PREFIX_CONST_ITEM(static, ASN1_TEMPLATE, name##_tt, libopeay)
+
+#define ASN1_ADB_TEMPLATE_END
+
+#define ASN1_ADB_TEMPLATE_DECLARE(tname)\
+	DECLARE_MODULE_CONST_ITEM(ASN1_TEMPLATE, tname##_tt)
+
+
+  // *******************
+  // End of Opera specific handling
+#endif //OPERA_SMALL_VERSION
 
 /* This is the ASN1 template structure that defines
  * a wrapper round the actual type. It determines the
@@ -473,7 +999,7 @@
 
 struct ASN1_ADB_TABLE_st {
 	long value;		/* NID for an object or value for an int */
-	const ASN1_TEMPLATE tt;		/* item for this value */
+	ASN1_TEMPLATE tt;		/* item for this value */
 };
 
 /* template flags */
@@ -774,15 +1300,14 @@
 /* Macro to implement a primitive type */
 #define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
 #define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
-				ASN1_ITEM_start(itname) \
-					ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
-				ASN1_ITEM_end(itname)
+				ASN1_ITEM_TEMPLATE_BLOCK(itname, \
+					ASN1_ITYPE_PRIMITIVE, V_##vname , NULL, 0, NULL, ex)
 
 /* Macro to implement a multi string type */
 #define IMPLEMENT_ASN1_MSTRING(itname, mask) \
-				ASN1_ITEM_start(itname) \
-					ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
-				ASN1_ITEM_end(itname)
+				ASN1_ITEM_TEMPLATE_BLOCK(itname, \
+					ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING)\
+						ASN1_FIELD_NAME_LAST(itname))
 
 /* Macro to implement an ASN1_ITEM in terms of old style funcs */
 
@@ -795,33 +1320,47 @@
 		(ASN1_d2i_func *)d2i_##sname, \
 		(ASN1_i2d_func *)i2d_##sname, \
 	}; \
-	ASN1_ITEM_start(sname) \
+	ASN1_ITEM_TEMPLATE_BLOCK(sname, \
 		ASN1_ITYPE_COMPAT, \
 		tag, \
 		NULL, \
 		0, \
 		&sname##_ff, \
-		0, \
-		#sname \
-	ASN1_ITEM_end(sname)
+		0)
 
 #define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
-	ASN1_ITEM_start(sname) \
+	ASN1_ITEM_TEMPLATE_BLOCK(sname,\
 		ASN1_ITYPE_EXTERN, \
 		tag, \
 		NULL, \
 		0, \
 		&fptrs, \
-		0, \
-		#sname \
-	ASN1_ITEM_end(sname)
+		0)
 
 /* Macro to implement standard functions in terms of ASN1_ITEM structures */
 
 #define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname)
 
+#define IMPLEMENT_ASN1_FUNCTIONS1(stname) IMPLEMENT_ASN1_FUNCTIONS_fname1(stname, stname, stname)
+#define IMPLEMENT_ASN1_FUNCTIONS11(stname) IMPLEMENT_ASN1_FUNCTIONS_fname11(stname, stname, stname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS2(stname) IMPLEMENT_ASN1_FUNCTIONS_fname2(stname, stname, stname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS3(stname) IMPLEMENT_ASN1_FUNCTIONS_fname3(stname, stname, stname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS31(stname) IMPLEMENT_ASN1_FUNCTIONS_fname31(stname, stname, stname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS32(stname) IMPLEMENT_ASN1_FUNCTIONS_fname32(stname, stname, stname)
+
 #define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)
 
+#define IMPLEMENT_ASN1_FUNCTIONS_name1(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname1(stname, itname, itname)
+#define IMPLEMENT_ASN1_FUNCTIONS_name11(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname11(stname, itname, itname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS_name2(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname2(stname, itname, itname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS_name3(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname3(stname, itname, itname)
+
 #define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
 			IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
 
@@ -831,6 +1370,12 @@
 #define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
 		IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
 
+#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS1(stname) \
+		IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname1(stname, stname, stname)
+
+#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS2(stname) \
+		IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname2(stname, stname, stname)
+
 #define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \
 	pre stname *fname##_new(void) \
 	{ \
@@ -851,10 +1396,42 @@
 		ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
 	}
 
+#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname1(stname, itname, fname) \
+	stname *fname##_new(void) \
+	{ \
+		return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
+	}
+
+#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname2(stname, itname, fname) \
+	void fname##_free(stname *a) \
+	{ \
+		ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
+	}
+
 #define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \
 	IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
 	IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
 
+#define IMPLEMENT_ASN1_FUNCTIONS_fname1(stname, itname, fname) \
+	IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname1(stname, itname, fname) \
+	IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS_fname11(stname, itname, fname) \
+	IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname1(stname, itname, fname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS_fname2(stname, itname, fname) \
+	IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname2(stname, itname, fname) \
+	IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS_fname3(stname, itname, fname) \
+	IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS_fname31(stname, itname, fname) \
+	IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname1(stname, itname, fname)
+
+#define IMPLEMENT_ASN1_FUNCTIONS_fname32(stname, itname, fname) \
+	IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname2(stname, itname, fname)
+
 #define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
 	stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
 	{ \
@@ -865,6 +1442,18 @@
 		return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
 	} 
 
+#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname1(stname, itname, fname) \
+	int i2d_##fname(stname *a, unsigned char **out) \
+	{ \
+		return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
+	}
+
+#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname2(stname, itname, fname) \
+	stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+	{ \
+		return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
+	}
+
 #define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \
 	int i2d_##stname##_NDEF(stname *a, unsigned char **out) \
 	{ \
@@ -884,10 +1473,23 @@
 		return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
 	} 
 
+#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname1(stname, itname, fname) \
+	stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+	{ \
+		return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
+	}
+
+#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname2(stname, itname, fname) \
+	int i2d_##fname(const stname *a, unsigned char **out) \
+	{ \
+		return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
+	}
+
+
 #define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
 	stname * stname##_dup(stname *x) \
         { \
-        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
+        return (stname *) ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
         }
 
 #define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \
diff -Naur openssl-1.0.0q.orig/crypto/asn1/asn_moid.c openssl-1.0.0q/crypto/asn1/asn_moid.c
--- openssl-1.0.0q.orig/crypto/asn1/asn_moid.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/asn_moid.c	2017-04-25 16:23:39.886529151 +0200
@@ -56,10 +56,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include <ctype.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/crypto.h>
-#include "cryptlib.h"
 #include <openssl/conf.h>
 #include <openssl/dso.h>
 #include <openssl/x509.h>
diff -Naur openssl-1.0.0q.orig/crypto/asn1/asn_pack.c openssl-1.0.0q/crypto/asn1/asn_pack.c
--- openssl-1.0.0q.orig/crypto/asn1/asn_pack.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/asn_pack.c	2017-04-25 16:23:39.889528694 +0200
@@ -56,8 +56,10 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 
 #ifndef NO_ASN1_OLD
@@ -66,6 +68,7 @@
 
 /* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
 STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len,
 			 d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK))
 {
@@ -92,7 +95,7 @@
 		ASN1err(ASN1_F_ASN1_SEQ_PACK,ASN1_R_ENCODE_ERROR);
 		return NULL;
 	}
-	if (!(safe = OPENSSL_malloc (safelen))) {
+	if (!(safe = (unsigned char *) OPENSSL_malloc (safelen))) {
 		ASN1err(ASN1_F_ASN1_SEQ_PACK,ERR_R_MALLOC_FAILURE);
 		return NULL;
 	}
@@ -103,9 +106,11 @@
 	if (buf) *buf = safe;
 	return safe;
 }
+#endif // LIBOPEAY_PKCS12_SUPPORT
 
 /* Extract an ASN1 object from an ASN1_STRING */
 
+#ifndef OPERA_SMALL_VERSION
 void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i)
 {
 	const unsigned char *p;
@@ -116,16 +121,18 @@
 		ASN1err(ASN1_F_ASN1_UNPACK_STRING,ASN1_R_DECODE_ERROR);
 	return ret;
 }
+#endif /* !OPERA_SMALL_VERSION */
 
 /* Pack an ASN1 object into an ASN1_STRING */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
 ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, ASN1_STRING **oct)
 {
 	unsigned char *p;
-	ASN1_STRING *octmp;
+	ASN1_STRING *octmp, *ocalloc=NULL;
 
 	if (!oct || !*oct) {
-		if (!(octmp = ASN1_STRING_new ())) {
+		if (!(ocalloc = octmp = ASN1_STRING_new ())) {
 			ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE);
 			return NULL;
 		}
@@ -133,12 +140,18 @@
 	} else octmp = *oct;
 		
 	if (!(octmp->length = i2d(obj, NULL))) {
+		if(ocalloc && !oct)
+			ASN1_STRING_free(ocalloc);
 		ASN1err(ASN1_F_ASN1_PACK_STRING,ASN1_R_ENCODE_ERROR);
-		goto err;
+// GAB		goto err;
+ 		return NULL;
 	}
-	if (!(p = OPENSSL_malloc (octmp->length))) {
+	if (!(p = (unsigned char *) OPENSSL_malloc (octmp->length))) {
+		if(ocalloc && !oct)
+			ASN1_STRING_free(ocalloc);
 		ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE);
-		goto err;
+// GAB		goto err;
+		return NULL;
 	}
 	octmp->data = p;
 	i2d (obj, &p);
@@ -152,11 +165,13 @@
 		}
 	return NULL;
 }
+#endif // LIBOPEAY_PKCS12_SUPPORT
 
 #endif
 
 /* ASN1_ITEM versions of the above */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
 ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct)
 {
 	ASN1_STRING *octmp;
@@ -174,7 +189,7 @@
 		octmp->data = NULL;
 	}
 		
-	if (!(octmp->length = ASN1_item_i2d(obj, &octmp->data, it))) {
+	if (!(octmp->length = ASN1_item_i2d((ASN1_VALUE *) obj, &octmp->data, it))) {
 		ASN1err(ASN1_F_ASN1_ITEM_PACK,ASN1_R_ENCODE_ERROR);
 		return NULL;
 	}
@@ -184,6 +199,7 @@
 	}
 	return octmp;
 }
+#endif // LIBOPEAY_PKCS12_SUPPORT
 
 /* Extract an ASN1 object from an ASN1_STRING */
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/d2i_pr.c openssl-1.0.0q/crypto/asn1/d2i_pr.c
--- openssl-1.0.0q.orig/crypto/asn1/d2i_pr.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/d2i_pr.c	2017-04-25 16:23:39.891529227 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/crypto/asn1/d2i_pu.c openssl-1.0.0q/crypto/asn1/d2i_pu.c
--- openssl-1.0.0q.orig/crypto/asn1/d2i_pu.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/d2i_pu.c	2017-04-25 16:23:39.893530599 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/crypto/asn1/evp_asn1.c openssl-1.0.0q/crypto/asn1/evp_asn1.c
--- openssl-1.0.0q.orig/crypto/asn1/evp_asn1.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/evp_asn1.c	2017-04-25 16:23:39.895529736 +0200
@@ -56,8 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1_mac.h>
 
@@ -93,10 +96,11 @@
 		num=ret;
 	else
 		num=max_len;
-	memcpy(data,p,num);
+	op_memcpy(data,p,num);
 	return(ret);
 	}
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data,
 	     int len)
 	{
@@ -135,6 +139,7 @@
 	ASN1_TYPE_set(a,V_ASN1_SEQUENCE,osp);
 	return(1);
 	}
+#endif
 
 /* we return the actual length..., num may be missing, in which
  * case, set it to zero */
@@ -180,7 +185,7 @@
 		n=max_len;
 
 	if (data != NULL)
-		memcpy(data,M_ASN1_STRING_data(os),n);
+		op_memcpy(data,M_ASN1_STRING_data(os),n);
 	if (0)
 		{
 err:
diff -Naur openssl-1.0.0q.orig/crypto/asn1/f_enum.c openssl-1.0.0q/crypto/asn1/f_enum.c
--- openssl-1.0.0q.orig/crypto/asn1/f_enum.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/f_enum.c	2017-04-25 16:23:39.897529711 +0200
@@ -56,7 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>
@@ -66,7 +71,7 @@
 int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a)
 	{
 	int i,n=0;
-	static const char *h="0123456789ABCDEF";
+	const char * const h="0123456789ABCDEF";
 	char buf[2];
 
 	if (a == NULL) return(0);
diff -Naur openssl-1.0.0q.orig/crypto/asn1/f_int.c openssl-1.0.0q/crypto/asn1/f_int.c
--- openssl-1.0.0q.orig/crypto/asn1/f_int.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/f_int.c	2017-04-25 16:23:39.899529127 +0200
@@ -56,15 +56,20 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>
 
 int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a)
 	{
 	int i,n=0;
-	static const char *h="0123456789ABCDEF";
+	const char * const h="0123456789ABCDEF";
 	char buf[2];
 
 	if (a == NULL) return(0);
@@ -131,9 +136,9 @@
 			/* This #ifdef is not strictly necessary, since
 			 * the characters A...F a...f 0...9 are contiguous
 			 * (yes, even in EBCDIC - but not the whole alphabet).
-			 * Nevertheless, isxdigit() is faster.
+			 * Nevertheless, op_isxdigit() is faster.
 			 */
-			if (!isxdigit(buf[j]))
+			if (!op_isxdigit(buf[j]))
 #endif
 				{
 				i=j;
@@ -169,7 +174,7 @@
 				sp=(unsigned char *)OPENSSL_malloc(
 					(unsigned int)num+i*2);
 			else
-				sp=OPENSSL_realloc_clean(s,slen,num+i*2);
+				sp= (unsigned char *) OPENSSL_realloc_clean(s,slen,num+i*2);
 			if (sp == NULL)
 				{
 				ASN1err(ASN1_F_A2I_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);
diff -Naur openssl-1.0.0q.orig/crypto/asn1/f_string.c openssl-1.0.0q/crypto/asn1/f_string.c
--- openssl-1.0.0q.orig/crypto/asn1/f_string.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/f_string.c	2017-04-25 16:23:39.902528670 +0200
@@ -56,15 +56,20 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>
 
 int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type)
 	{
 	int i,n=0;
-	static const char *h="0123456789ABCDEF";
+	const char *const h="0123456789ABCDEF";
 	char buf[2];
 
 	if (a == NULL) return(0);
@@ -131,9 +136,9 @@
 			/* This #ifdef is not strictly necessary, since
 			 * the characters A...F a...f 0...9 are contiguous
 			 * (yes, even in EBCDIC - but not the whole alphabet).
-			 * Nevertheless, isxdigit() is faster.
+			 * Nevertheless, op_isxdigit() is faster.
 			 */
-			if (!isxdigit(buf[j]))
+			if (!op_isxdigit(buf[j]))
 #endif
 				{
 				i=j;
diff -Naur openssl-1.0.0q.orig/crypto/asn1/i2d_pr.c openssl-1.0.0q/crypto/asn1/i2d_pr.c
--- openssl-1.0.0q.orig/crypto/asn1/i2d_pr.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/i2d_pr.c	2017-04-25 16:23:39.904529483 +0200
@@ -56,8 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#if defined LIBOPEAY_PKCS12_SUPPORT || defined LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#include <openssl/bn.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
 #include "asn1_locl.h"
@@ -77,4 +81,5 @@
 	ASN1err(ASN1_F_I2D_PRIVATEKEY,ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
 	return(-1);
 	}
+#endif // defined LIBOPEAY_PKCS12_SUPPORT || defined LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/i2d_pu.c openssl-1.0.0q/crypto/asn1/i2d_pu.c
--- openssl-1.0.0q.orig/crypto/asn1/i2d_pu.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/i2d_pu.c	2017-04-25 16:23:39.906529179 +0200
@@ -56,8 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#if defined LIBOPEAY_PKCS12_SUPPORT || defined LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
@@ -92,4 +95,5 @@
 		return(-1);
 		}
 	}
+#endif // defined LIBOPEAY_PKCS12_SUPPORT || defined LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/n_pkey.c openssl-1.0.0q/crypto/asn1/n_pkey.c
--- openssl-1.0.0q.orig/crypto/asn1/n_pkey.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/n_pkey.c	2017-04-25 16:23:39.908527757 +0200
@@ -56,8 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPENSSL_NO_RSA
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #include <openssl/objects.h>
@@ -87,20 +90,20 @@
 	} NETSCAPE_ENCRYPTED_PKEY;
 
 
-ASN1_BROKEN_SEQUENCE(NETSCAPE_ENCRYPTED_PKEY) = {
-	ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, os, ASN1_OCTET_STRING),
+ASN1_BROKEN_SEQUENCE(NETSCAPE_ENCRYPTED_PKEY)
+	ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, os, ASN1_OCTET_STRING)
 	ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, enckey, X509_SIG)
-} ASN1_BROKEN_SEQUENCE_END(NETSCAPE_ENCRYPTED_PKEY)
+ASN1_BROKEN_SEQUENCE_END(NETSCAPE_ENCRYPTED_PKEY)
 
 DECLARE_ASN1_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY)
 DECLARE_ASN1_ENCODE_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY,NETSCAPE_ENCRYPTED_PKEY)
 IMPLEMENT_ASN1_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY)
 
-ASN1_SEQUENCE(NETSCAPE_PKEY) = {
-	ASN1_SIMPLE(NETSCAPE_PKEY, version, LONG),
-	ASN1_SIMPLE(NETSCAPE_PKEY, algor, X509_ALGOR),
+ASN1_SEQUENCE(NETSCAPE_PKEY)
+	ASN1_SIMPLE(NETSCAPE_PKEY, version, LONG)
+	ASN1_SIMPLE(NETSCAPE_PKEY, algor, X509_ALGOR)
 	ASN1_SIMPLE(NETSCAPE_PKEY, private_key, ASN1_OCTET_STRING)
-} ASN1_SEQUENCE_END(NETSCAPE_PKEY)
+ASN1_SEQUENCE_END(NETSCAPE_PKEY)
 
 DECLARE_ASN1_FUNCTIONS_const(NETSCAPE_PKEY)
 DECLARE_ASN1_ENCODE_FUNCTIONS_const(NETSCAPE_PKEY,NETSCAPE_PKEY)
@@ -203,11 +206,11 @@
 		ASN1err(ASN1_F_I2D_RSA_NET,ASN1_R_BAD_PASSWORD_READ);
 		goto err;
 		}
-	i = strlen((char *)buf);
+	i = op_strlen((char *)buf);
 	/* If the key is used for SGC the algorithm is modified a little. */
 	if(sgckey) {
 		EVP_Digest(buf, i, buf, NULL, EVP_md5(), NULL);
-		memcpy(buf + 16, "SGCKEYSALT", 10);
+		op_memcpy(buf + 16, "SGCKEYSALT", 10);
 		i = 26;
 	}
 
@@ -253,7 +256,7 @@
 		return NULL;
 	}
 
-	if ((enckey->os->length != 11) || (strncmp("private-key",
+	if ((enckey->os->length != 11) || (op_strncmp("private-key",
 		(char *)enckey->os->data,11) != 0))
 		{
 		ASN1err(ASN1_F_D2I_RSA_NET,ASN1_R_PRIVATE_KEY_HEADER_MISSING);
@@ -296,10 +299,10 @@
 		goto err;
 		}
 
-	i = strlen((char *)buf);
+	i = op_strlen((char *)buf);
 	if(sgckey){
 		EVP_Digest(buf, i, buf, NULL, EVP_md5(), NULL);
-		memcpy(buf + 16, "SGCKEYSALT", 10);
+		op_memcpy(buf + 16, "SGCKEYSALT", 10);
 		i = 26;
 	}
 		
diff -Naur openssl-1.0.0q.orig/crypto/asn1/nsseq.c openssl-1.0.0q/crypto/asn1/nsseq.c
--- openssl-1.0.0q.orig/crypto/asn1/nsseq.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/nsseq.c	2017-04-25 16:23:39.910527452 +0200
@@ -56,11 +56,14 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/objects.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int nsseq_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
 							void *exarg)
@@ -75,9 +78,10 @@
 
 /* Netscape certificate sequence structure */
 
-ASN1_SEQUENCE_cb(NETSCAPE_CERT_SEQUENCE, nsseq_cb) = {
-	ASN1_SIMPLE(NETSCAPE_CERT_SEQUENCE, type, ASN1_OBJECT),
+ASN1_SEQUENCE_cb(NETSCAPE_CERT_SEQUENCE, nsseq_cb)
+	ASN1_SIMPLE(NETSCAPE_CERT_SEQUENCE, type, ASN1_OBJECT)
 	ASN1_EXP_SEQUENCE_OF_OPT(NETSCAPE_CERT_SEQUENCE, certs, X509, 0)
-} ASN1_SEQUENCE_END_cb(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
+ASN1_SEQUENCE_END_cb(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
+
+IMPLEMENT_ASN1_FUNCTIONS2(NETSCAPE_CERT_SEQUENCE)
 
-IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_bitstr.cpp openssl-1.0.0q/crypto/asn1/opera_a_bitstr.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_bitstr.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_bitstr.cpp	2017-04-25 16:23:39.912527148 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_bitstr.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_bool.cpp openssl-1.0.0q/crypto/asn1/opera_a_bool.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_bool.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_bool.cpp	2017-04-25 16:23:39.913528951 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "a_bool.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_bytes.cpp openssl-1.0.0q/crypto/asn1/opera_a_bytes.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_bytes.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_bytes.cpp	2017-04-25 16:23:39.914529637 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_bytes.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_digest.cpp openssl-1.0.0q/crypto/asn1/opera_a_digest.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_digest.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_digest.cpp	2017-04-25 16:23:39.915527808 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_digest.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_dup.cpp openssl-1.0.0q/crypto/asn1/opera_a_dup.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_dup.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_dup.cpp	2017-04-25 16:23:39.916528773 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_dup.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_enum.cpp openssl-1.0.0q/crypto/asn1/opera_a_enum.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_enum.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_enum.cpp	2017-04-25 16:23:39.917528342 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_OCSP) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_enum.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_OCSP) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_gentm.cpp openssl-1.0.0q/crypto/asn1/opera_a_gentm.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_gentm.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_gentm.cpp	2017-04-25 16:23:39.918527072 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_OCSP) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_gentm.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_OCSP) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_int.cpp openssl-1.0.0q/crypto/asn1/opera_a_int.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_int.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_int.cpp	2017-04-25 16:23:39.919528317 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_int.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_mbstr.cpp openssl-1.0.0q/crypto/asn1/opera_a_mbstr.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_mbstr.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_mbstr.cpp	2017-04-25 16:23:39.920526768 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_mbstr.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_object.cpp openssl-1.0.0q/crypto/asn1/opera_a_object.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_object.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_object.cpp	2017-04-25 16:23:39.921528012 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_object.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_octet.cpp openssl-1.0.0q/crypto/asn1/opera_a_octet.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_octet.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_octet.cpp	2017-04-25 16:23:39.922526743 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_octet.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_print.cpp openssl-1.0.0q/crypto/asn1/opera_a_print.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_print.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_print.cpp	2017-04-25 16:23:39.923527708 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_print.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_set.cpp openssl-1.0.0q/crypto/asn1/opera_a_set.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_set.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_set.cpp	2017-04-25 16:23:39.924526997 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_set.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_sign.cpp openssl-1.0.0q/crypto/asn1/opera_a_sign.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_sign.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_sign.cpp	2017-04-25 16:23:39.924526997 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_sign.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_strex.cpp openssl-1.0.0q/crypto/asn1/opera_a_strex.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_strex.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_strex.cpp	2017-04-25 16:23:39.925528241 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_strex.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_strnid.cpp openssl-1.0.0q/crypto/asn1/opera_a_strnid.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_strnid.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_strnid.cpp	2017-04-25 16:23:39.926526692 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_strnid.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_time.cpp openssl-1.0.0q/crypto/asn1/opera_a_time.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_time.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_time.cpp	2017-04-25 16:23:39.927527657 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_time.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_type.cpp openssl-1.0.0q/crypto/asn1/opera_a_type.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_type.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_type.cpp	2017-04-25 16:23:39.928526667 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_type.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_utctm.cpp openssl-1.0.0q/crypto/asn1/opera_a_utctm.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_utctm.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_utctm.cpp	2017-04-25 16:23:39.929527074 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_utctm.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_utf8.cpp openssl-1.0.0q/crypto/asn1/opera_a_utf8.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_utf8.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_utf8.cpp	2017-04-25 16:23:39.930531391 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_utf8.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_a_verify.cpp openssl-1.0.0q/crypto/asn1/opera_a_verify.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_a_verify.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_a_verify.cpp	2017-04-25 16:23:39.931528725 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/a_verify.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_ameth_lib.cpp openssl-1.0.0q/crypto/asn1/opera_ameth_lib.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_ameth_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_ameth_lib.cpp	2017-04-25 16:23:39.932527455 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/ameth_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_asn1_gen.cpp openssl-1.0.0q/crypto/asn1/opera_asn1_gen.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_asn1_gen.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_asn1_gen.cpp	2017-04-25 16:23:39.933527023 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/asn1_gen.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_asn1_lib.cpp openssl-1.0.0q/crypto/asn1/opera_asn1_lib.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_asn1_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_asn1_lib.cpp	2017-04-25 16:23:39.934527989 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/asn1_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_asn1_par.cpp openssl-1.0.0q/crypto/asn1/opera_asn1_par.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_asn1_par.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_asn1_par.cpp	2017-04-25 16:23:39.935526719 +0200
@@ -0,0 +1,16 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2007 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/asn1_par.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_asn_pack.cpp openssl-1.0.0q/crypto/asn1/opera_asn_pack.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_asn_pack.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_asn_pack.cpp	2017-04-25 16:23:39.936528243 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_OCSP)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/asn_pack.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_OCSP)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_d2i_pr.cpp openssl-1.0.0q/crypto/asn1/opera_d2i_pr.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_d2i_pr.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_d2i_pr.cpp	2017-04-25 16:23:39.937526694 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/d2i_pr.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_d2i_pu.cpp openssl-1.0.0q/crypto/asn1/opera_d2i_pu.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_d2i_pu.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_d2i_pu.cpp	2017-04-25 16:23:39.938528218 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/d2i_pu.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_evp_asn1.cpp openssl-1.0.0q/crypto/asn1/opera_evp_asn1.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_evp_asn1.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_evp_asn1.cpp	2017-04-25 16:23:39.939526668 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/evp_asn1.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_f_int.cpp openssl-1.0.0q/crypto/asn1/opera_f_int.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_f_int.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_f_int.cpp	2017-04-25 16:23:39.940528192 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "f_int.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_f_string.cpp openssl-1.0.0q/crypto/asn1/opera_f_string.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_f_string.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_f_string.cpp	2017-04-25 16:23:39.941526643 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "f_string.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_i2d_pr.cpp openssl-1.0.0q/crypto/asn1/opera_i2d_pr.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_i2d_pr.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_i2d_pr.cpp	2017-04-25 16:23:39.942528167 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/i2d_pr.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_i2d_pu.cpp openssl-1.0.0q/crypto/asn1/opera_i2d_pu.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_i2d_pu.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_i2d_pu.cpp	2017-04-25 16:23:39.943531088 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/i2d_pu.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_nsseq.cpp openssl-1.0.0q/crypto/asn1/opera_nsseq.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_nsseq.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_nsseq.cpp	2017-04-25 16:23:39.944529260 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/nsseq.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_p5_pbe.cpp openssl-1.0.0q/crypto/asn1/opera_p5_pbe.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_p5_pbe.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_p5_pbe.cpp	2017-04-25 16:23:39.945529107 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/p5_pbe.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_p5_pbev2.cpp openssl-1.0.0q/crypto/asn1/opera_p5_pbev2.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_p5_pbev2.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_p5_pbev2.cpp	2017-04-25 16:23:39.946529514 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/p5_pbev2.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_p8_pkey.cpp openssl-1.0.0q/crypto/asn1/opera_p8_pkey.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_p8_pkey.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_p8_pkey.cpp	2017-04-25 16:23:39.947528523 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/p8_pkey.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_t_pkey.cpp openssl-1.0.0q/crypto/asn1/opera_t_pkey.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_t_pkey.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_t_pkey.cpp	2017-04-25 16:23:39.948527254 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/t_pkey.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_t_x509.cpp openssl-1.0.0q/crypto/asn1/opera_t_x509.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_t_x509.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_t_x509.cpp	2017-04-25 16:23:39.949528219 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/t_x509.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_t_x509a.cpp openssl-1.0.0q/crypto/asn1/opera_t_x509a.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_t_x509a.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_t_x509a.cpp	2017-04-25 16:23:39.950527508 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "t_x509a.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_tasn_dec.cpp openssl-1.0.0q/crypto/asn1/opera_tasn_dec.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_tasn_dec.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_tasn_dec.cpp	2017-04-25 16:23:39.951529870 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/tasn_dec.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_tasn_enc.cpp openssl-1.0.0q/crypto/asn1/opera_tasn_enc.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_tasn_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_tasn_enc.cpp	2017-04-25 16:23:39.952530835 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/tasn_enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_tasn_fre.cpp openssl-1.0.0q/crypto/asn1/opera_tasn_fre.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_tasn_fre.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_tasn_fre.cpp	2017-04-25 16:23:39.955528982 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/tasn_fre.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_tasn_new.cpp openssl-1.0.0q/crypto/asn1/opera_tasn_new.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_tasn_new.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_tasn_new.cpp	2017-04-25 16:23:39.956527712 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/tasn_new.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_tasn_typ.cpp openssl-1.0.0q/crypto/asn1/opera_tasn_typ.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_tasn_typ.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_tasn_typ.cpp	2017-04-25 16:23:39.958527966 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/tasn_typ.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_tasn_utl.cpp openssl-1.0.0q/crypto/asn1/opera_tasn_utl.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_tasn_utl.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_tasn_utl.cpp	2017-04-25 16:23:39.959528373 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/tasn_utl.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_algor.cpp openssl-1.0.0q/crypto/asn1/opera_x_algor.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_algor.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_algor.cpp	2017-04-25 16:23:39.960528500 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_algor.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_attrib.cpp openssl-1.0.0q/crypto/asn1/opera_x_attrib.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_attrib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_attrib.cpp	2017-04-25 16:23:39.962527916 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_attrib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_bignum.cpp openssl-1.0.0q/crypto/asn1/opera_x_bignum.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_bignum.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_bignum.cpp	2017-04-25 16:23:39.963528602 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_bignum.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_crl.cpp openssl-1.0.0q/crypto/asn1/opera_x_crl.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_crl.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_crl.cpp	2017-04-25 16:23:39.964527332 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_crl.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_exten.cpp openssl-1.0.0q/crypto/asn1/opera_x_exten.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_exten.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_exten.cpp	2017-04-25 16:23:39.965529694 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_exten.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_long.cpp openssl-1.0.0q/crypto/asn1/opera_x_long.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_long.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_long.cpp	2017-04-25 16:23:39.967531066 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_long.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_name.cpp openssl-1.0.0q/crypto/asn1/opera_x_name.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_name.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_name.cpp	2017-04-25 16:23:39.968528120 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_name.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_pubkey.cpp openssl-1.0.0q/crypto/asn1/opera_x_pubkey.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_pubkey.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_pubkey.cpp	2017-04-25 16:23:39.969526850 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_pubkey.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_req.cpp openssl-1.0.0q/crypto/asn1/opera_x_req.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_req.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_req.cpp	2017-04-25 16:23:39.971528780 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_req.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_sig.cpp openssl-1.0.0q/crypto/asn1/opera_x_sig.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_sig.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_sig.cpp	2017-04-25 16:23:39.972527231 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_sig.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_spki.cpp openssl-1.0.0q/crypto/asn1/opera_x_spki.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_spki.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_spki.cpp	2017-04-25 16:23:39.973527079 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_spki.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_val.cpp openssl-1.0.0q/crypto/asn1/opera_x_val.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_val.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_val.cpp	2017-04-25 16:23:39.974528603 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_val.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_x509.cpp openssl-1.0.0q/crypto/asn1/opera_x_x509.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_x509.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_x509.cpp	2017-04-25 16:23:39.976529975 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_x509.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/opera_x_x509a.cpp openssl-1.0.0q/crypto/asn1/opera_x_x509a.cpp
--- openssl-1.0.0q.orig/crypto/asn1/opera_x_x509a.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/opera_x_x509a.cpp	2017-04-25 16:23:39.977528426 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/asn1/x_x509a.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/p5_pbe.c openssl-1.0.0q/crypto/asn1/p5_pbe.c
--- openssl-1.0.0q.orig/crypto/asn1/p5_pbe.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/p5_pbe.c	2017-04-25 16:23:39.978527156 +0200
@@ -56,18 +56,22 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/rand.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* PKCS#5 password based encryption structure */
 
-ASN1_SEQUENCE(PBEPARAM) = {
-	ASN1_SIMPLE(PBEPARAM, salt, ASN1_OCTET_STRING),
+ASN1_SEQUENCE(PBEPARAM)
+	ASN1_SIMPLE(PBEPARAM, salt, ASN1_OCTET_STRING)
 	ASN1_SIMPLE(PBEPARAM, iter, ASN1_INTEGER)
-} ASN1_SEQUENCE_END(PBEPARAM)
+ASN1_SEQUENCE_END(PBEPARAM)
 
 IMPLEMENT_ASN1_FUNCTIONS(PBEPARAM)
 
@@ -103,7 +107,7 @@
 		}
 	sstr = ASN1_STRING_data(pbe->salt);
 	if (salt)
-		memcpy(sstr, salt, saltlen);
+		op_memcpy(sstr, salt, saltlen);
 	else if (RAND_pseudo_bytes(sstr, saltlen) < 0)
 		goto err;
 
@@ -146,3 +150,4 @@
 	X509_ALGOR_free(ret);
 	return NULL;
 	}
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/asn1/p5_pbev2.c openssl-1.0.0q/crypto/asn1/p5_pbev2.c
--- openssl-1.0.0q.orig/crypto/asn1/p5_pbev2.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/p5_pbev2.c	2017-04-25 16:23:39.980527969 +0200
@@ -56,27 +56,31 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/rand.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-/* PKCS#5 v2.0 password based encryption structures */
 
-ASN1_SEQUENCE(PBE2PARAM) = {
-	ASN1_SIMPLE(PBE2PARAM, keyfunc, X509_ALGOR),
+/* PKCS#5 v2.0 password based encryption structures */
+ASN1_SEQUENCE(PBE2PARAM)
+	ASN1_SIMPLE(PBE2PARAM, keyfunc, X509_ALGOR)
 	ASN1_SIMPLE(PBE2PARAM, encryption, X509_ALGOR)
-} ASN1_SEQUENCE_END(PBE2PARAM)
+ASN1_SEQUENCE_END(PBE2PARAM)
 
 IMPLEMENT_ASN1_FUNCTIONS(PBE2PARAM)
 
-ASN1_SEQUENCE(PBKDF2PARAM) = {
-	ASN1_SIMPLE(PBKDF2PARAM, salt, ASN1_ANY),
-	ASN1_SIMPLE(PBKDF2PARAM, iter, ASN1_INTEGER),
-	ASN1_OPT(PBKDF2PARAM, keylength, ASN1_INTEGER),
+ASN1_SEQUENCE(PBKDF2PARAM)
+	ASN1_SIMPLE(PBKDF2PARAM, salt, ASN1_ANY)
+	ASN1_SIMPLE(PBKDF2PARAM, iter, ASN1_INTEGER)
+	ASN1_OPT(PBKDF2PARAM, keylength, ASN1_INTEGER)
 	ASN1_OPT(PBKDF2PARAM, prf, X509_ALGOR)
-} ASN1_SEQUENCE_END(PBKDF2PARAM)
+ASN1_SEQUENCE_END(PBKDF2PARAM)
 
 IMPLEMENT_ASN1_FUNCTIONS(PBKDF2PARAM)
 
@@ -93,7 +97,7 @@
 	X509_ALGOR *scheme = NULL, *kalg = NULL, *ret = NULL;
 	int alg_nid;
 	EVP_CIPHER_CTX ctx;
-	unsigned char iv[EVP_MAX_IV_LENGTH];
+	unsigned char iv[EVP_MAX_IV_LENGTH]; /* ARRAY OK 2004-02-18 yngve */
 	PBKDF2PARAM *kdf = NULL;
 	PBE2PARAM *pbe2 = NULL;
 	ASN1_OCTET_STRING *osalt = NULL;
@@ -149,9 +153,9 @@
 	if(!(osalt = M_ASN1_OCTET_STRING_new())) goto merr;
 
 	if (!saltlen) saltlen = PKCS5_SALT_LEN;
-	if (!(osalt->data = OPENSSL_malloc (saltlen))) goto merr;
+	if (!(osalt->data = (unsigned char *) OPENSSL_malloc (saltlen))) goto merr;
 	osalt->length = saltlen;
-	if (salt) memcpy (osalt->data, salt, saltlen);
+	if (salt) op_memcpy (osalt->data, salt, saltlen);
 	else if (RAND_pseudo_bytes (osalt->data, saltlen) < 0) goto merr;
 
 	if(iter <= 0) iter = PKCS5_DEFAULT_ITER;
diff -Naur openssl-1.0.0q.orig/crypto/asn1/p8_pkey.c openssl-1.0.0q/crypto/asn1/p8_pkey.c
--- openssl-1.0.0q.orig/crypto/asn1/p8_pkey.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/p8_pkey.c	2017-04-25 16:23:39.982526826 +0200
@@ -56,10 +56,14 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Minor tweak to operation: zero private key data */
 static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
@@ -75,12 +79,12 @@
 	return 1;
 }
 
-ASN1_SEQUENCE_cb(PKCS8_PRIV_KEY_INFO, pkey_cb) = {
-	ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, version, ASN1_INTEGER),
-	ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkeyalg, X509_ALGOR),
-	ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkey, ASN1_ANY),
+ASN1_SEQUENCE_cb(PKCS8_PRIV_KEY_INFO, pkey_cb)
+	ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, version, ASN1_INTEGER)
+	ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkeyalg, X509_ALGOR)
+	ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkey, ASN1_ANY)
 	ASN1_IMP_SET_OF_OPT(PKCS8_PRIV_KEY_INFO, attributes, X509_ATTRIBUTE, 0)
-} ASN1_SEQUENCE_END_cb(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
+ASN1_SEQUENCE_END_cb(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
 
 IMPLEMENT_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
 
@@ -152,4 +156,3 @@
 		*pa = p8->pkeyalg;
 	return 1;
 	}
-
diff -Naur openssl-1.0.0q.orig/crypto/asn1/t_bitst.c openssl-1.0.0q/crypto/asn1/t_bitst.c
--- openssl-1.0.0q.orig/crypto/asn1/t_bitst.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/t_bitst.c	2017-04-25 16:23:39.984528477 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
@@ -95,8 +97,8 @@
 {
 	BIT_STRING_BITNAME *bnam;
 	for(bnam = tbl; bnam->lname; bnam++) {
-		if(!strcmp(bnam->sname, name) ||
-			!strcmp(bnam->lname, name) ) return bnam->bitnum;
+		if(!op_strcmp(bnam->sname, name) ||
+			!op_strcmp(bnam->lname, name) ) return bnam->bitnum;
 	}
 	return -1;
 }
diff -Naur openssl-1.0.0q.orig/crypto/asn1/t_crl.c openssl-1.0.0q/crypto/asn1/t_crl.c
--- openssl-1.0.0q.orig/crypto/asn1/t_crl.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/t_crl.c	2017-04-25 16:23:39.987531373 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/bn.h>
diff -Naur openssl-1.0.0q.orig/crypto/asn1/t_pkey.c openssl-1.0.0q/crypto/asn1/t_pkey.c
--- openssl-1.0.0q.orig/crypto/asn1/t_pkey.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/t_pkey.c	2017-04-25 16:23:39.989529672 +0200
@@ -56,8 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
 #include <openssl/bn.h>
diff -Naur openssl-1.0.0q.orig/crypto/asn1/t_req.c openssl-1.0.0q/crypto/asn1/t_req.c
--- openssl-1.0.0q.orig/crypto/asn1/t_req.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/t_req.c	2017-04-25 16:23:39.994529469 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/bn.h>
diff -Naur openssl-1.0.0q.orig/crypto/asn1/t_spki.c openssl-1.0.0q/crypto/asn1/t_spki.c
--- openssl-1.0.0q.orig/crypto/asn1/t_spki.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/t_spki.c	2017-04-25 16:23:39.997528733 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
diff -Naur openssl-1.0.0q.orig/crypto/asn1/t_x509.c openssl-1.0.0q/crypto/asn1/t_x509.c
--- openssl-1.0.0q.orig/crypto/asn1/t_x509.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/t_x509.c	2017-04-25 16:23:40.000529114 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include <openssl/bn.h>
 #ifndef OPENSSL_NO_RSA
@@ -72,7 +74,9 @@
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
+#ifndef OPERA_SMALL_VERSION
 #ifndef OPENSSL_NO_FP_API
 int X509_print_fp(FILE *fp, X509 *x)
 	{
@@ -244,7 +248,7 @@
 	unsigned char *dertmp;
 	int derlen;
 	int i;
-	unsigned char SHA1md[SHA_DIGEST_LENGTH];
+	unsigned char SHA1md[SHA_DIGEST_LENGTH]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 
 	/* display the hash of the subject as it would appear
 	   in OCSP requests */
@@ -282,7 +286,9 @@
 	if (der != NULL) OPENSSL_free(der);
 	return(0);
 	}
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig)
 {
 	unsigned char *s;
@@ -302,6 +308,7 @@
 	if (BIO_write(bp,"\n",1) != 1) return 0;
 	return 1;
 }
+#endif
 
 int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v)
 	{
@@ -342,11 +349,20 @@
 	return(0);
 }
 
-static const char *mon[12]=
-    {
-    "Jan","Feb","Mar","Apr","May","Jun",
-    "Jul","Aug","Sep","Oct","Nov","Dec"
-    };
+OPENSSL_PREFIX_CONST_ARRAY(static, const char*, asn1_mon,libopeay)
+	CONST_ENTRY("Jan")
+	CONST_ENTRY("Feb")
+	CONST_ENTRY("Mar")
+	CONST_ENTRY("Apr")
+	CONST_ENTRY("May")
+	CONST_ENTRY("Jun")
+	CONST_ENTRY("Jul")
+	CONST_ENTRY("Aug")
+	CONST_ENTRY("Sep")
+	CONST_ENTRY("Oct")
+	CONST_ENTRY("Nov")
+	CONST_ENTRY("Dec")
+CONST_END(asn1_mon)
 
 int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
 	{
@@ -387,7 +403,7 @@
 		}
 
 	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d%.*s %d%s",
-		mon[M-1],d,h,m,s,f_len,f,y,(gmt)?" GMT":"") <= 0)
+		OPENSSL_GLOBAL_ARRAY_NAME(asn1_mon)[M-1],d,h,m,s,f_len,f,y,(gmt)?" GMT":"") <= 0)
 		return(0);
 	else
 		return(1);
@@ -423,7 +439,7 @@
 		s=  (v[10]-'0')*10+(v[11]-'0');
 
 	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",
-		mon[M-1],d,h,m,s,y+1900,(gmt)?" GMT":"") <= 0)
+		OPENSSL_GLOBAL_ARRAY_NAME(asn1_mon)[M-1],d,h,m,s,y+1900,(gmt)?" GMT":"") <= 0)
 		return(0);
 	else
 		return(1);
@@ -462,9 +478,9 @@
 			(*s == '\0'))
 #else
 		if (	((*s == '/') &&
-				(isupper(s[1]) && (
+				(op_isupper(s[1]) && (
 					(s[2] == '=') ||
-					(isupper(s[2]) &&
+					(op_isupper(s[2]) &&
 					(s[3] == '='))
 				 ))) ||
 			(*s == '\0'))
diff -Naur openssl-1.0.0q.orig/crypto/asn1/t_x509a.c openssl-1.0.0q/crypto/asn1/t_x509a.c
--- openssl-1.0.0q.orig/crypto/asn1/t_x509a.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/t_x509a.c	2017-04-25 16:23:40.002530207 +0200
@@ -56,8 +56,10 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/asn1.h>
 #include <openssl/x509.h>
@@ -65,6 +67,7 @@
 /* X509_CERT_AUX and string set routines
  */
 
+#ifndef OPERA_SMALL_VERSION
 int X509_CERT_AUX_print(BIO *out, X509_CERT_AUX *aux, int indent)
 {
 	char oidstr[80], first;
@@ -108,3 +111,4 @@
 	}
 	return 1;
 }
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/asn1/tasn_dec.c openssl-1.0.0q/crypto/asn1/tasn_dec.c
--- openssl-1.0.0q.orig/crypto/asn1/tasn_dec.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/tasn_dec.c	2017-04-25 16:23:40.005529191 +0200
@@ -57,8 +57,10 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/objects.h>
@@ -113,7 +115,12 @@
 
 /* Macro to initialize and invalidate the cache */
 
+#ifndef OPERA_SMALL_VERSION
 #define asn1_tlc_clear(c)	if (c) (c)->valid = 0
+#else
+inline void asn1_tlc_clear(ASN1_TLC *c) { if (c) c->valid = 0; }
+#endif // !OPERA_SMALL_VERSION
+
 /* Version to avoid compiler warning about 'c' always non-NULL */
 #define asn1_tlc_clear_nc(c)	(c)->valid = 0
 
@@ -138,6 +145,7 @@
 	return NULL;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_template_d2i(ASN1_VALUE **pval,
 		const unsigned char **in, long len, const ASN1_TEMPLATE *tt)
 	{
@@ -145,6 +153,7 @@
 	asn1_tlc_clear_nc(&c);
 	return asn1_template_ex_d2i(pval, in, len, tt, 0, &c);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 
 /* Decode an item, taking care of IMPLICIT tagging, if any.
@@ -158,7 +167,7 @@
 	const ASN1_TEMPLATE *tt, *errtt = NULL;
 	const ASN1_COMPAT_FUNCS *cf;
 	const ASN1_EXTERN_FUNCS *ef;
-	const ASN1_AUX *aux = it->funcs;
+	const ASN1_AUX *aux = (const ASN1_AUX *) it->funcs;
 	ASN1_aux_cb *asn1_cb;
 	const unsigned char *p = NULL, *q;
 	unsigned char *wp=NULL;	/* BIG FAT WARNING!  BREAKS CONST WHERE USED */
@@ -235,13 +244,13 @@
 
 		case ASN1_ITYPE_EXTERN:
 		/* Use new style d2i */
-		ef = it->funcs;
+		ef = (const ASN1_EXTERN_FUNCS *) it->funcs;
 		return ef->asn1_ex_d2i(pval, in, len,
 						it, tag, aclass, opt, ctx);
 
 		case ASN1_ITYPE_COMPAT:
 		/* we must resort to old style evil hackery */
-		cf = it->funcs;
+		cf = (const ASN1_COMPAT_FUNCS *) it->funcs;
 
 		/* If OPTIONAL see if it is there */
 		if (opt)
@@ -517,11 +526,16 @@
 	ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR);
 	err:
 	ASN1_item_ex_free(pval, it);
+#ifdef OPERA_SMALL_VERSION
+	// Suppress warning "variable set but not used".
+	(void) errtt;
+#else
 	if (errtt)
 		ERR_add_error_data(4, "Field=", errtt->field_name,
 					", Type=", it->sname);
 	else
 		ERR_add_error_data(2, "Type=", it->sname);
+#endif // OPERA_SMALL_VERSION
 	return 0;
 	}
 
@@ -781,6 +795,10 @@
 		return 0; /* Should never happen */
 		}
 
+	buf.data = NULL;
+	buf.length = 0;
+	buf.max = 0;
+
 	if (it->itype == ASN1_ITYPE_MSTRING)
 		{
 		utype = tag;
@@ -933,7 +951,7 @@
 	int ret = 0;
 	const ASN1_PRIMITIVE_FUNCS *pf;
 	ASN1_INTEGER **tint;
-	pf = it->funcs;
+	pf = (const ASN1_PRIMITIVE_FUNCS *) it->funcs;
 
 	if (pf && pf->prim_c2i)
 		return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
@@ -1236,7 +1254,7 @@
 			ASN1err(ASN1_F_COLLECT_DATA, ERR_R_MALLOC_FAILURE);
 			return 0;
 			}
-		memcpy(buf->data + len, *p, plen);
+		op_memcpy(buf->data + len, *p, plen);
 		}
 	*p += plen;
 	return 1;
diff -Naur openssl-1.0.0q.orig/crypto/asn1/tasn_enc.c openssl-1.0.0q/crypto/asn1/tasn_enc.c
--- openssl-1.0.0q.orig/crypto/asn1/tasn_enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/tasn_enc.c	2017-04-25 16:23:40.006525407 +0200
@@ -57,9 +57,10 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
 #include <string.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/objects.h>
@@ -80,11 +81,13 @@
  * to use indefinite length constructed encoding, where appropriate
  */
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out,
 						const ASN1_ITEM *it)
 	{
 	return asn1_item_flags_i2d(val, out, it, ASN1_TFLG_NDEF);
 	}
+#endif
 
 int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)
 	{
@@ -110,7 +113,7 @@
 		len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags);
 		if (len <= 0)
 			return len;
-		buf = OPENSSL_malloc(len);
+		buf = (unsigned char *) OPENSSL_malloc(len);
 		if (!buf)
 			return -1;
 		p = buf;
@@ -135,7 +138,7 @@
 	int i, seqcontlen, seqlen, ndef = 1;
 	const ASN1_COMPAT_FUNCS *cf;
 	const ASN1_EXTERN_FUNCS *ef;
-	const ASN1_AUX *aux = it->funcs;
+	const ASN1_AUX *aux = (const ASN1_AUX *) it->funcs;
 	ASN1_aux_cb *asn1_cb = 0;
 
 	if ((it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval)
@@ -177,12 +180,12 @@
 
 		case ASN1_ITYPE_EXTERN:
 		/* If new style i2d it does all the work */
-		ef = it->funcs;
+		ef = (const ASN1_EXTERN_FUNCS *) it->funcs;
 		return ef->asn1_ex_i2d(pval, out, it, tag, aclass);
 
 		case ASN1_ITYPE_COMPAT:
 		/* old style hackery... */
-		cf = it->funcs;
+		cf = (const ASN1_COMPAT_FUNCS *) it->funcs;
 		if (out)
 			p = *out;
 		i = cf->asn1_i2d(*pval, out);
@@ -261,11 +264,13 @@
 	return 0;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out,
 							const ASN1_TEMPLATE *tt)
 	{
 	return asn1_template_ex_i2d(pval, out, tt, -1, 0);
 	}
+#endif
 
 static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
 				const ASN1_TEMPLATE *tt, int tag, int iclass)
@@ -425,10 +430,10 @@
 
 static int der_cmp(const void *a, const void *b)
 	{
-	const DER_ENC *d1 = a, *d2 = b;
+	const DER_ENC *d1 = (const DER_ENC *) a, *d2 = (const DER_ENC *) b;
 	int cmplen, i;
 	cmplen = (d1->length < d2->length) ? d1->length : d2->length;
-	i = memcmp(d1->data, d2->data, cmplen);
+	i = op_memcmp(d1->data, d2->data, cmplen);
 	if (i)
 		return i;
 	return d1->length - d2->length;
@@ -451,16 +456,16 @@
 			do_sort = 0;
 		else
 			{
-			derlst = OPENSSL_malloc(sk_ASN1_VALUE_num(sk)
+			derlst = (DER_ENC *) OPENSSL_malloc(sk_ASN1_VALUE_num(sk)
 						* sizeof(*derlst));
-			if (!derlst)
-				return 0;
-			tmpdat = OPENSSL_malloc(skcontlen);
+			if(!derlst)
+ 				return 0;
+			tmpdat = (unsigned char *) OPENSSL_malloc(skcontlen);
 			if (!tmpdat)
-				{
+			{
 				OPENSSL_free(derlst);
 				return 0;
-				}
+			}
 			}
 		}
 	/* If not sorting just output each item */
@@ -485,12 +490,12 @@
 		}
 
 	/* Now sort them */
-	qsort(derlst, sk_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp);
+	op_qsort(derlst, sk_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp);
 	/* Output sorted DER encoding */	
 	p = *out;
 	for (i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++)
 		{
-		memcpy(p, tder->data, tder->length);
+		op_memcpy(p, tder->data, tder->length);
 		p += tder->length;
 		}
 	*out = p;
@@ -578,7 +583,7 @@
 	unsigned char c;
 	int len;
 	const ASN1_PRIMITIVE_FUNCS *pf;
-	pf = it->funcs;
+	pf = (const ASN1_PRIMITIVE_FUNCS *) it->funcs;
 	if (pf && pf->prim_i2c)
 		return pf->prim_i2c(pval, cout, putype, it);
 
@@ -691,6 +696,6 @@
 
 		}
 	if (cout && len)
-		memcpy(cout, cont, len);
+		op_memcpy(cout, cont, len);
 	return len;
 	}
diff -Naur openssl-1.0.0q.orig/crypto/asn1/tasn_fre.c openssl-1.0.0q/crypto/asn1/tasn_fre.c
--- openssl-1.0.0q.orig/crypto/asn1/tasn_fre.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/tasn_fre.c	2017-04-25 16:23:40.007527490 +0200
@@ -57,7 +57,9 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/objects.h>
@@ -81,7 +83,7 @@
 	const ASN1_TEMPLATE *tt = NULL, *seqtt;
 	const ASN1_EXTERN_FUNCS *ef;
 	const ASN1_COMPAT_FUNCS *cf;
-	const ASN1_AUX *aux = it->funcs;
+	const ASN1_AUX *aux = (const ASN1_AUX *) it->funcs;
 	ASN1_aux_cb *asn1_cb;
 	int i;
 	if (!pval)
@@ -132,13 +134,13 @@
 		break;
 
 		case ASN1_ITYPE_COMPAT:
-		cf = it->funcs;
+		cf = (const ASN1_COMPAT_FUNCS *) it->funcs;
 		if (cf && cf->asn1_free)
 			cf->asn1_free(*pval);
 		break;
 
 		case ASN1_ITYPE_EXTERN:
-		ef = it->funcs;
+		ef = (const ASN1_EXTERN_FUNCS *) it->funcs;
 		if (ef && ef->asn1_ex_free)
 			ef->asn1_ex_free(pval, it);
 		break;
@@ -207,7 +209,7 @@
 	if (it)
 		{
 		const ASN1_PRIMITIVE_FUNCS *pf;
-		pf = it->funcs;
+		pf = (const ASN1_PRIMITIVE_FUNCS *) it->funcs;
 		if (pf && pf->prim_free)
 			{
 			pf->prim_free(pval, it);
diff -Naur openssl-1.0.0q.orig/crypto/asn1/tasn_new.c openssl-1.0.0q/crypto/asn1/tasn_new.c
--- openssl-1.0.0q.orig/crypto/asn1/tasn_new.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/tasn_new.c	2017-04-25 16:23:40.008527617 +0200
@@ -57,12 +57,16 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 #include <openssl/err.h>
 #include <openssl/asn1t.h>
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
 								int combine);
@@ -91,7 +95,7 @@
 	const ASN1_TEMPLATE *tt = NULL;
 	const ASN1_COMPAT_FUNCS *cf;
 	const ASN1_EXTERN_FUNCS *ef;
-	const ASN1_AUX *aux = it->funcs;
+	const ASN1_AUX *aux = (const ASN1_AUX *) it->funcs;
 	ASN1_aux_cb *asn1_cb;
 	ASN1_VALUE **pseqval;
 	int i;
@@ -111,7 +115,7 @@
 		{
 
 		case ASN1_ITYPE_EXTERN:
-		ef = it->funcs;
+		ef = (const ASN1_EXTERN_FUNCS *) it->funcs;
 		if (ef && ef->asn1_ex_new)
 			{
 			if (!ef->asn1_ex_new(pval, it))
@@ -120,7 +124,7 @@
 		break;
 
 		case ASN1_ITYPE_COMPAT:
-		cf = it->funcs;
+		cf = (const ASN1_COMPAT_FUNCS *) it->funcs;
 		if (cf && cf->asn1_new) {
 			*pval = cf->asn1_new();
 			if (!*pval)
@@ -160,10 +164,10 @@
 			}
 		if (!combine)
 			{
-			*pval = OPENSSL_malloc(it->size);
+			*pval = (ASN1_VALUE *) OPENSSL_malloc(it->size);
 			if (!*pval)
 				goto memerr;
-			memset(*pval, 0, it->size);
+			op_memset(*pval, 0, it->size);
 			}
 		asn1_set_choice_selector(pval, -1, it);
 		if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
@@ -188,10 +192,10 @@
 			}
 		if (!combine)
 			{
-			*pval = OPENSSL_malloc(it->size);
+			*pval = (ASN1_VALUE *) OPENSSL_malloc(it->size);
 			if (!*pval)
 				goto memerr;
-			memset(*pval, 0, it->size);
+			op_memset(*pval, 0, it->size);
 			asn1_do_lock(pval, 0, it);
 			asn1_enc_init(pval, it);
 			}
@@ -235,7 +239,7 @@
 		{
 
 		case ASN1_ITYPE_EXTERN:
-		ef = it->funcs;
+		ef = (const ASN1_EXTERN_FUNCS *) it->funcs;
 		if (ef && ef->asn1_ex_clear) 
 			ef->asn1_ex_clear(pval, it);
 		else *pval = NULL;
@@ -330,9 +334,9 @@
 
 	if (it && it->funcs)
 		{
-		const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
+		const ASN1_PRIMITIVE_FUNCS *pf = (const ASN1_PRIMITIVE_FUNCS *) it->funcs;
 		if (pf->prim_new)
-			return pf->prim_new(pval, it);
+		return pf->prim_new(pval, it);
 		}
 
 	if (!it || (it->itype == ASN1_ITYPE_MSTRING))
@@ -354,7 +358,7 @@
 		return 1;
 
 		case V_ASN1_ANY:
-		typ = OPENSSL_malloc(sizeof(ASN1_TYPE));
+		typ = (ASN1_TYPE *) OPENSSL_malloc(sizeof(ASN1_TYPE));
 		if (!typ)
 			return 0;
 		typ->value.ptr = NULL;
@@ -379,7 +383,7 @@
 	int utype;
 	if (it && it->funcs)
 		{
-		const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
+		const ASN1_PRIMITIVE_FUNCS *pf = (const ASN1_PRIMITIVE_FUNCS *) it->funcs;
 		if (pf->prim_clear)
 			pf->prim_clear(pval, it);
 		else 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/tasn_prn.c openssl-1.0.0q/crypto/asn1/tasn_prn.c
--- openssl-1.0.0q.orig/crypto/asn1/tasn_prn.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/tasn_prn.c	2017-04-25 16:23:40.009526347 +0200
@@ -57,8 +57,10 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/crypto/asn1/tasn_typ.c openssl-1.0.0q/crypto/asn1/tasn_typ.c
--- openssl-1.0.0q.orig/crypto/asn1/tasn_typ.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/tasn_typ.c	2017-04-25 16:23:40.010526474 +0200
@@ -55,9 +55,13 @@
  * Hudson (tjh@cryptsoft.com).
  *
  */
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Declarations for string types */
 
@@ -75,39 +79,59 @@
 IMPLEMENT_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
 
 IMPLEMENT_ASN1_TYPE(ASN1_NULL)
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(ASN1_NULL)
+#endif
 
 IMPLEMENT_ASN1_TYPE(ASN1_OBJECT)
 
 IMPLEMENT_ASN1_TYPE(ASN1_UTF8STRING)
-IMPLEMENT_ASN1_FUNCTIONS(ASN1_UTF8STRING)
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+IMPLEMENT_ASN1_FUNCTIONS3(ASN1_UTF8STRING)
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_TYPE(ASN1_PRINTABLESTRING)
 IMPLEMENT_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING)
+#endif
 
 IMPLEMENT_ASN1_TYPE(ASN1_T61STRING)
-IMPLEMENT_ASN1_FUNCTIONS(ASN1_T61STRING)
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
+IMPLEMENT_ASN1_FUNCTIONS31(ASN1_T61STRING)
+#endif
 
 IMPLEMENT_ASN1_TYPE(ASN1_IA5STRING)
-IMPLEMENT_ASN1_FUNCTIONS(ASN1_IA5STRING)
+IMPLEMENT_ASN1_FUNCTIONS3(ASN1_IA5STRING)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_TYPE(ASN1_GENERALSTRING)
 IMPLEMENT_ASN1_FUNCTIONS(ASN1_GENERALSTRING)
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_TYPE(ASN1_UTCTIME)
 IMPLEMENT_ASN1_FUNCTIONS(ASN1_UTCTIME)
+#endif
 
 IMPLEMENT_ASN1_TYPE(ASN1_GENERALIZEDTIME)
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_TYPE(ASN1_VISIBLESTRING)
 IMPLEMENT_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_TYPE(ASN1_UNIVERSALSTRING)
 IMPLEMENT_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_TYPE(ASN1_BMPSTRING)
 IMPLEMENT_ASN1_FUNCTIONS(ASN1_BMPSTRING)
+#endif
 
 IMPLEMENT_ASN1_TYPE(ASN1_ANY)
 
@@ -119,28 +143,36 @@
 /* Multistring types */
 
 IMPLEMENT_ASN1_MSTRING(ASN1_PRINTABLE, B_ASN1_PRINTABLE)
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
+#endif
 
 IMPLEMENT_ASN1_MSTRING(DISPLAYTEXT, B_ASN1_DISPLAYTEXT)
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT)
+#endif
 
 IMPLEMENT_ASN1_MSTRING(DIRECTORYSTRING, B_ASN1_DIRECTORYSTRING)
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)
+#endif
 
 /* Three separate BOOLEAN type: normal, DEFAULT TRUE and DEFAULT FALSE */
 IMPLEMENT_ASN1_TYPE_ex(ASN1_BOOLEAN, ASN1_BOOLEAN, -1)
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_TYPE_ex(ASN1_TBOOLEAN, ASN1_BOOLEAN, 1)
+#endif
 IMPLEMENT_ASN1_TYPE_ex(ASN1_FBOOLEAN, ASN1_BOOLEAN, 0)
 
 /* Special, OCTET STRING with indefinite length constructed support */
 
 IMPLEMENT_ASN1_TYPE_ex(ASN1_OCTET_STRING_NDEF, ASN1_OCTET_STRING, ASN1_TFLG_NDEF)
 
-ASN1_ITEM_TEMPLATE(ASN1_SEQUENCE_ANY) = 
+ASN1_ITEM_TEMPLATE(ASN1_SEQUENCE_ANY)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, ASN1_SEQUENCE_ANY, ASN1_ANY)
 ASN1_ITEM_TEMPLATE_END(ASN1_SEQUENCE_ANY)
 
-ASN1_ITEM_TEMPLATE(ASN1_SET_ANY) = 
+ASN1_ITEM_TEMPLATE(ASN1_SET_ANY)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SET_OF, 0, ASN1_SET_ANY, ASN1_ANY)
 ASN1_ITEM_TEMPLATE_END(ASN1_SET_ANY)
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/tasn_utl.c openssl-1.0.0q/crypto/asn1/tasn_utl.c
--- openssl-1.0.0q.orig/crypto/asn1/tasn_utl.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/tasn_utl.c	2017-04-25 16:23:40.011526601 +0200
@@ -57,8 +57,10 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/objects.h>
@@ -75,7 +77,7 @@
 
 int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it)
 	{
-	int *sel = offset2ptr(*pval, it->utype);
+	int *sel = (int *) offset2ptr(*pval, it->utype);
 	return *sel;
 	}
 
@@ -86,7 +88,7 @@
 int asn1_set_choice_selector(ASN1_VALUE **pval, int value, const ASN1_ITEM *it)
 	{	
 	int *sel, ret;
-	sel = offset2ptr(*pval, it->utype);
+	sel = (int *) offset2ptr(*pval, it->utype);
 	ret = *sel;
 	*sel = value;
 	return ret;
@@ -105,10 +107,10 @@
 	if ((it->itype != ASN1_ITYPE_SEQUENCE)
 	   && (it->itype != ASN1_ITYPE_NDEF_SEQUENCE))
 		return 0;
-	aux = it->funcs;
+	aux = (const ASN1_AUX *) it->funcs;
 	if (!aux || !(aux->flags & ASN1_AFLG_REFCOUNT))
 		return 0;
-	lck = offset2ptr(*pval, aux->ref_offset);
+	lck = (int *) offset2ptr(*pval, aux->ref_offset);
 	if (op == 0)
 		{
 		*lck = 1;
@@ -130,10 +132,10 @@
 	const ASN1_AUX *aux;
 	if (!pval || !*pval)
 		return NULL;
-	aux = it->funcs;
+	aux = (const ASN1_AUX *) it->funcs;
 	if (!aux || !(aux->flags & ASN1_AFLG_ENCODING))
 		return NULL;
-	return offset2ptr(*pval, aux->enc_offset);
+	return (ASN1_ENCODING *) offset2ptr(*pval, aux->enc_offset);
 	}
 
 void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it)
@@ -172,10 +174,10 @@
 
 	if (enc->enc)
 		OPENSSL_free(enc->enc);
-	enc->enc = OPENSSL_malloc(inlen);
+	enc->enc = (unsigned char *) OPENSSL_malloc(inlen);
 	if (!enc->enc)
 		return 0;
-	memcpy(enc->enc, in, inlen);
+	op_memcpy(enc->enc, in, inlen);
 	enc->len = inlen;
 	enc->modified = 0;
 
@@ -191,7 +193,7 @@
 		return 0;
 	if (out)
 		{
-		memcpy(*out, enc->enc, enc->len);
+		op_memcpy(*out, enc->enc, enc->len);
 		*out += enc->len;
 		}
 	if (len)
@@ -205,7 +207,7 @@
 	ASN1_VALUE **pvaltmp;
 	if (tt->flags & ASN1_TFLG_COMBINE)
 		return pval;
-	pvaltmp = offset2ptr(*pval, tt->offset);
+	pvaltmp = (ASN1_VALUE **) offset2ptr(*pval, tt->offset);
 	/* NOTE for BOOLEAN types the field is just a plain
  	 * int so we can't return int **, so settle for
 	 * (int *).
@@ -232,7 +234,7 @@
 	adb = ASN1_ADB_ptr(tt->item);
 
 	/* Get the selector field */
-	sfld = offset2ptr(*pval, adb->offset);
+	sfld = (ASN1_VALUE **) offset2ptr(*pval, adb->offset);
 
 	/* Check if NULL */
 	if (!sfld)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_algor.c openssl-1.0.0q/crypto/asn1/x_algor.c
--- openssl-1.0.0q.orig/crypto/asn1/x_algor.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_algor.c	2017-04-25 16:23:40.012525890 +0200
@@ -56,23 +56,31 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-ASN1_SEQUENCE(X509_ALGOR) = {
-	ASN1_SIMPLE(X509_ALGOR, algorithm, ASN1_OBJECT),
+ASN1_SEQUENCE(X509_ALGOR)
+	ASN1_SIMPLE(X509_ALGOR, algorithm, ASN1_OBJECT)
 	ASN1_OPT(X509_ALGOR, parameter, ASN1_ANY)
-} ASN1_SEQUENCE_END(X509_ALGOR)
+ASN1_SEQUENCE_END(X509_ALGOR)
 
-ASN1_ITEM_TEMPLATE(X509_ALGORS) = 
+ASN1_ITEM_TEMPLATE(X509_ALGORS)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, algorithms, X509_ALGOR)
 ASN1_ITEM_TEMPLATE_END(X509_ALGORS)
 
 IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR)
+
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_ALGORS, X509_ALGORS, X509_ALGORS)
 IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR)
+#endif
 
 IMPLEMENT_STACK_OF(X509_ALGOR)
 IMPLEMENT_ASN1_SET_OF(X509_ALGOR)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_attrib.c openssl-1.0.0q/crypto/asn1/x_attrib.c
--- openssl-1.0.0q.orig/crypto/asn1/x_attrib.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_attrib.c	2017-04-25 16:23:40.013526576 +0200
@@ -56,11 +56,14 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* X509_ATTRIBUTE: this has the following form:
  *
@@ -82,18 +85,18 @@
  * SET OF structure.
  */
 
-ASN1_CHOICE(X509_ATTRIBUTE_SET) = {
-	ASN1_SET_OF(X509_ATTRIBUTE, value.set, ASN1_ANY),
+ASN1_CHOICE(X509_ATTRIBUTE_SET)
+	ASN1_SET_OF(X509_ATTRIBUTE, value.set, ASN1_ANY)
 	ASN1_SIMPLE(X509_ATTRIBUTE, value.single, ASN1_ANY)
-} ASN1_CHOICE_END_selector(X509_ATTRIBUTE, X509_ATTRIBUTE_SET, single)
+ASN1_CHOICE_END_selector(X509_ATTRIBUTE, X509_ATTRIBUTE_SET, single)
 
-ASN1_SEQUENCE(X509_ATTRIBUTE) = {
-	ASN1_SIMPLE(X509_ATTRIBUTE, object, ASN1_OBJECT),
+ASN1_SEQUENCE(X509_ATTRIBUTE)
+	ASN1_SIMPLE(X509_ATTRIBUTE, object, ASN1_OBJECT)
 	/* CHOICE type merged with parent */
 	ASN1_EX_COMBINE(0, 0, X509_ATTRIBUTE_SET)
-} ASN1_SEQUENCE_END(X509_ATTRIBUTE)
+ASN1_SEQUENCE_END(X509_ATTRIBUTE)
 
-IMPLEMENT_ASN1_FUNCTIONS(X509_ATTRIBUTE)
+IMPLEMENT_ASN1_FUNCTIONS3(X509_ATTRIBUTE)
 IMPLEMENT_ASN1_DUP_FUNCTION(X509_ATTRIBUTE)
 
 X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_bignum.c openssl-1.0.0q/crypto/asn1/x_bignum.c
--- openssl-1.0.0q.orig/crypto/asn1/x_bignum.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_bignum.c	2017-04-25 16:23:40.014526703 +0200
@@ -56,10 +56,13 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/bn.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Custom primitive type for BIGNUM handling. This reads in an ASN1_INTEGER as a
  * BIGNUM directly. Currently it ignores the sign which isn't a problem since all
@@ -75,22 +78,22 @@
 static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it);
 static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it);
 
-static ASN1_PRIMITIVE_FUNCS bignum_pf = {
-	NULL, 0,
-	bn_new,
-	bn_free,
-	0,
-	bn_c2i,
-	bn_i2c
-};
-
-ASN1_ITEM_start(BIGNUM)
-	ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM"
-ASN1_ITEM_end(BIGNUM)
-
-ASN1_ITEM_start(CBIGNUM)
-	ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, BN_SENSITIVE, "BIGNUM"
-ASN1_ITEM_end(CBIGNUM)
+OPENSSL_PREFIX_CONST_ITEM(static, ASN1_PRIMITIVE_FUNCS, bignum_pf, libopeay)
+	CONST_ITEM_ENTRY_START(app_data, NULL)
+	CONST_ITEM_ENTRY_SINGLE(flags, 0)
+	CONST_ITEM_ENTRY_SINGLE(prim_new, bn_new)
+	CONST_ITEM_ENTRY_SINGLE(prim_free, bn_free)
+	CONST_ITEM_ENTRY_SINGLE(prim_clear, NULL)
+	CONST_ITEM_ENTRY_SINGLE(prim_c2i, bn_c2i)
+	CONST_ITEM_ENTRY_SINGLE(prim_i2c, bn_i2c)
+	CONST_ITEM_ENTRY_SINGLE(prim_print, NULL)
+CONST_ITEM_ENTRY_END
+
+ASN1_ITEM_TEMPLATE_BLOCK(BIGNUM,
+	ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &OPENSSL_GLOBAL_ITEM_NAME(bignum_pf), 0)
+
+ASN1_ITEM_TEMPLATE_BLOCK(CBIGNUM,
+	ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &OPENSSL_GLOBAL_ITEM_NAME(bignum_pf), BN_SENSITIVE)
 
 static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
 {
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_crl.c openssl-1.0.0q/crypto/asn1/x_crl.c
--- openssl-1.0.0q.orig/crypto/asn1/x_crl.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_crl.c	2017-04-25 16:23:40.015527948 +0200
@@ -56,36 +56,42 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "asn1_locl.h"
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int X509_REVOKED_cmp(const X509_REVOKED * const *a,
 				const X509_REVOKED * const *b);
 static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp);
 
-ASN1_SEQUENCE(X509_REVOKED) = {
-	ASN1_SIMPLE(X509_REVOKED,serialNumber, ASN1_INTEGER),
-	ASN1_SIMPLE(X509_REVOKED,revocationDate, ASN1_TIME),
+ASN1_SEQUENCE(X509_REVOKED)
+	ASN1_SIMPLE(X509_REVOKED,serialNumber, ASN1_INTEGER)
+	ASN1_SIMPLE(X509_REVOKED,revocationDate, ASN1_TIME)
 	ASN1_SEQUENCE_OF_OPT(X509_REVOKED,extensions, X509_EXTENSION)
-} ASN1_SEQUENCE_END(X509_REVOKED)
+ASN1_SEQUENCE_END(X509_REVOKED)
 
 static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r);
 static int def_crl_lookup(X509_CRL *crl,
 		X509_REVOKED **ret, ASN1_INTEGER *serial, X509_NAME *issuer);
 
-static X509_CRL_METHOD int_crl_meth =
-	{
+CONST_X509_CRL_METHOD_ITEM(x_crl__int_crl_meth,
 	0,
 	0,0,
 	def_crl_lookup,
 	def_crl_verify
-	};
+	);
+#define int_crl_meth OPENSSL_GLOBAL_ITEM_NAME(x_crl__int_crl_meth)
+
+OPENSSL_IMPLEMENT_GLOBAL(const X509_CRL_METHOD *, x_crl__default_crl_method);
+#define default_crl_method OPENSSL_GLOBAL_REF(x_crl__default_crl_method)
+
 
-static const X509_CRL_METHOD *default_crl_method = &int_crl_meth;
 
 /* The X509_CRL_INFO structure needs a bit of customisation.
  * Since we cache the original encoding the signature wont be affected by
@@ -109,15 +115,15 @@
 }
 
 
-ASN1_SEQUENCE_enc(X509_CRL_INFO, enc, crl_inf_cb) = {
-	ASN1_OPT(X509_CRL_INFO, version, ASN1_INTEGER),
-	ASN1_SIMPLE(X509_CRL_INFO, sig_alg, X509_ALGOR),
-	ASN1_SIMPLE(X509_CRL_INFO, issuer, X509_NAME),
-	ASN1_SIMPLE(X509_CRL_INFO, lastUpdate, ASN1_TIME),
-	ASN1_OPT(X509_CRL_INFO, nextUpdate, ASN1_TIME),
-	ASN1_SEQUENCE_OF_OPT(X509_CRL_INFO, revoked, X509_REVOKED),
+ASN1_SEQUENCE_enc(X509_CRL_INFO, enc, crl_inf_cb)
+	ASN1_OPT(X509_CRL_INFO, version, ASN1_INTEGER)
+	ASN1_SIMPLE(X509_CRL_INFO, sig_alg, X509_ALGOR)
+	ASN1_SIMPLE(X509_CRL_INFO, issuer, X509_NAME)
+	ASN1_SIMPLE(X509_CRL_INFO, lastUpdate, ASN1_TIME)
+	ASN1_OPT(X509_CRL_INFO, nextUpdate, ASN1_TIME)
+	ASN1_SEQUENCE_OF_OPT(X509_CRL_INFO, revoked, X509_REVOKED)
 	ASN1_EXP_SEQUENCE_OF_OPT(X509_CRL_INFO, extensions, X509_EXTENSION, 0)
-} ASN1_SEQUENCE_END_enc(X509_CRL_INFO, X509_CRL_INFO)
+ASN1_SEQUENCE_END_enc(X509_CRL_INFO, X509_CRL_INFO)
 
 /* Set CRL entry issuer according to CRL certificate issuer extension.
  * Check for unhandled critical CRL entry extensions.
@@ -139,7 +145,7 @@
 		STACK_OF(X509_EXTENSION) *exts;
 		ASN1_ENUMERATED *reason;
 		X509_EXTENSION *ext;
-		gtmp = X509_REVOKED_get_ext_d2i(rev, 
+		gtmp = (GENERAL_NAMES *) X509_REVOKED_get_ext_d2i(rev,
 						NID_certificate_issuer,
 						&j, NULL);
 		if (!gtmp && (j != -1))
@@ -162,7 +168,7 @@
 			}
 		rev->issuer = gens;
 
-		reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason,
+		reason = (ASN1_ENUMERATED *) X509_REVOKED_get_ext_d2i(rev, NID_crl_reason,
 								&j, NULL);
 		if (!reason && (j != -1))
 			{
@@ -232,18 +238,18 @@
 #ifndef OPENSSL_NO_SHA
 		X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, NULL);
 #endif
-		crl->idp = X509_CRL_get_ext_d2i(crl,
+		crl->idp = (ISSUING_DIST_POINT *) X509_CRL_get_ext_d2i(crl,
 				NID_issuing_distribution_point, NULL, NULL);
 		if (crl->idp)
 			setup_idp(crl, crl->idp);
 
-		crl->akid = X509_CRL_get_ext_d2i(crl,
+		crl->akid = (AUTHORITY_KEYID *) X509_CRL_get_ext_d2i(crl,
 				NID_authority_key_identifier, NULL, NULL);	
 
-		crl->crl_number = X509_CRL_get_ext_d2i(crl,
+		crl->crl_number = (ASN1_INTEGER *) X509_CRL_get_ext_d2i(crl,
 				NID_crl_number, NULL, NULL);	
 
-		crl->base_crl_number = X509_CRL_get_ext_d2i(crl,
+		crl->base_crl_number = (ASN1_INTEGER *) X509_CRL_get_ext_d2i(crl,
 				NID_delta_crl, NULL, NULL);	
 		/* Delta CRLs must have CRL number */
 		if (crl->base_crl_number && !crl->crl_number)
@@ -350,11 +356,11 @@
 	DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl));
 	}
 
-ASN1_SEQUENCE_ref(X509_CRL, crl_cb, CRYPTO_LOCK_X509_CRL) = {
-	ASN1_SIMPLE(X509_CRL, crl, X509_CRL_INFO),
-	ASN1_SIMPLE(X509_CRL, sig_alg, X509_ALGOR),
+ASN1_SEQUENCE_ref(X509_CRL, crl_cb, CRYPTO_LOCK_X509_CRL)
+	ASN1_SIMPLE(X509_CRL, crl, X509_CRL_INFO)
+	ASN1_SIMPLE(X509_CRL, sig_alg, X509_ALGOR)
 	ASN1_SIMPLE(X509_CRL, signature, ASN1_BIT_STRING)
-} ASN1_SEQUENCE_END_ref(X509_CRL, X509_CRL)
+ASN1_SEQUENCE_END_ref(X509_CRL, X509_CRL)
 
 IMPLEMENT_ASN1_FUNCTIONS(X509_REVOKED)
 IMPLEMENT_ASN1_FUNCTIONS(X509_CRL_INFO)
@@ -494,7 +500,7 @@
 	int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk))
 	{
 	X509_CRL_METHOD *m;
-	m = OPENSSL_malloc(sizeof(X509_CRL_METHOD));
+	m = (X509_CRL_METHOD *)OPENSSL_malloc(sizeof(X509_CRL_METHOD));
 	if (!m)
 		return NULL;
 	m->crl_init = crl_init;
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_exten.c openssl-1.0.0q/crypto/asn1/x_exten.c
--- openssl-1.0.0q.orig/crypto/asn1/x_exten.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_exten.c	2017-04-25 16:23:40.016528354 +0200
@@ -56,18 +56,23 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-ASN1_SEQUENCE(X509_EXTENSION) = {
-	ASN1_SIMPLE(X509_EXTENSION, object, ASN1_OBJECT),
-	ASN1_OPT(X509_EXTENSION, critical, ASN1_BOOLEAN),
+ASN1_SEQUENCE(X509_EXTENSION)
+	ASN1_SIMPLE(X509_EXTENSION, object, ASN1_OBJECT)
+	ASN1_OPT(X509_EXTENSION, critical, ASN1_BOOLEAN)
 	ASN1_SIMPLE(X509_EXTENSION, value, ASN1_OCTET_STRING)
-} ASN1_SEQUENCE_END(X509_EXTENSION)
+ASN1_SEQUENCE_END(X509_EXTENSION)
 
-ASN1_ITEM_TEMPLATE(X509_EXTENSIONS) = 
+ASN1_ITEM_TEMPLATE(X509_EXTENSIONS)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, Extension, X509_EXTENSION)
 ASN1_ITEM_TEMPLATE_END(X509_EXTENSIONS)
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_info.c openssl-1.0.0q/crypto/asn1/x_info.c
--- openssl-1.0.0q.orig/crypto/asn1/x_info.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_info.c	2017-04-25 16:23:40.017525967 +0200
@@ -56,12 +56,15 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/asn1.h>
 #include <openssl/x509.h>
 
+#ifndef OPERA_SMALL_VERSION
 X509_INFO *X509_INFO_new(void)
 	{
 	X509_INFO *ret=NULL;
@@ -111,4 +114,5 @@
 	}
 
 IMPLEMENT_STACK_OF(X509_INFO)
+#endif // !OPERA_SMALL_VERSION
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_long.c openssl-1.0.0q/crypto/asn1/x_long.c
--- openssl-1.0.0q.orig/crypto/asn1/x_long.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_long.c	2017-04-25 16:23:40.018525815 +0200
@@ -56,10 +56,13 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/bn.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Custom primitive type for long handling. This converts between an ASN1_INTEGER
  * and a long directly.
@@ -73,23 +76,22 @@
 static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it);
 static int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent, const ASN1_PCTX *pctx);
 
-static ASN1_PRIMITIVE_FUNCS long_pf = {
-	NULL, 0,
-	long_new,
-	long_free,
-	long_free,	/* Clear should set to initial value */
-	long_c2i,
-	long_i2c,
-	long_print
-};
-
-ASN1_ITEM_start(LONG)
-	ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, ASN1_LONG_UNDEF, "LONG"
-ASN1_ITEM_end(LONG)
-
-ASN1_ITEM_start(ZLONG)
-	ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, 0, "ZLONG"
-ASN1_ITEM_end(ZLONG)
+OPENSSL_PREFIX_CONST_ITEM(static, ASN1_PRIMITIVE_FUNCS, long_pf, libopeay)
+	CONST_ITEM_ENTRY_START(app_data, NULL)
+	CONST_ITEM_ENTRY_SINGLE(flags, 0)
+	CONST_ITEM_ENTRY_SINGLE(prim_new, long_new)
+	CONST_ITEM_ENTRY_SINGLE(prim_free, long_free)
+	CONST_ITEM_ENTRY_SINGLE(prim_clear, long_free)	/* Clear should set to initial value */
+	CONST_ITEM_ENTRY_SINGLE(prim_c2i, long_c2i)
+	CONST_ITEM_ENTRY_SINGLE(prim_i2c, long_i2c)
+	CONST_ITEM_ENTRY_SINGLE(prim_print, long_print)
+CONST_ITEM_ENTRY_END
+
+ASN1_ITEM_TEMPLATE_BLOCK(LONG,
+	ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &OPENSSL_GLOBAL_ITEM_NAME(long_pf), ASN1_LONG_UNDEF)
+
+ASN1_ITEM_TEMPLATE_BLOCK(ZLONG,
+	ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &OPENSSL_GLOBAL_ITEM_NAME(long_pf), 0)
 
 static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
 {
@@ -111,7 +113,7 @@
 	char *cp = (char *)pval;
 
 	/* use memcpy, because we may not be long aligned */
-	memcpy(&ltmp, cp, sizeof(long));
+	op_memcpy(&ltmp, cp, sizeof(long));
 
 	if(ltmp == it->size) return -1;
 	/* Convert the long to positive: we subtract one if negative so
@@ -168,7 +170,7 @@
 		ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
 		return 0;
 	}
-	memcpy(cp, &ltmp, sizeof(long));
+	op_memcpy(cp, &ltmp, sizeof(long));
 	return 1;
 }
 
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_name.c openssl-1.0.0q/crypto/asn1/x_name.c
--- openssl-1.0.0q.orig/crypto/asn1/x_name.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_name.c	2017-04-25 16:23:40.019525663 +0200
@@ -56,12 +56,15 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include "asn1_locl.h"
+#include "modules/libopeay/libopeay_arrays.h"
 
 typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
 DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY)
@@ -88,23 +91,23 @@
 						const char *fname, 
 						const ASN1_PCTX *pctx);
 
-ASN1_SEQUENCE(X509_NAME_ENTRY) = {
-	ASN1_SIMPLE(X509_NAME_ENTRY, object, ASN1_OBJECT),
+ASN1_SEQUENCE(X509_NAME_ENTRY)
+	ASN1_SIMPLE(X509_NAME_ENTRY, object, ASN1_OBJECT)
 	ASN1_SIMPLE(X509_NAME_ENTRY, value, ASN1_PRINTABLE)
-} ASN1_SEQUENCE_END(X509_NAME_ENTRY)
+ASN1_SEQUENCE_END(X509_NAME_ENTRY)
 
-IMPLEMENT_ASN1_FUNCTIONS(X509_NAME_ENTRY)
+IMPLEMENT_ASN1_FUNCTIONS3(X509_NAME_ENTRY)
 IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME_ENTRY)
 
 /* For the "Name" type we need a SEQUENCE OF { SET OF X509_NAME_ENTRY }
  * so declare two template wrappers for this
  */
 
-ASN1_ITEM_TEMPLATE(X509_NAME_ENTRIES) =
+ASN1_ITEM_TEMPLATE(X509_NAME_ENTRIES)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SET_OF, 0, RDNS, X509_NAME_ENTRY)
 ASN1_ITEM_TEMPLATE_END(X509_NAME_ENTRIES)
 
-ASN1_ITEM_TEMPLATE(X509_NAME_INTERNAL) =
+ASN1_ITEM_TEMPLATE(X509_NAME_INTERNAL)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, Name, X509_NAME_ENTRIES)
 ASN1_ITEM_TEMPLATE_END(X509_NAME_INTERNAL)
 
@@ -114,17 +117,17 @@
  * to the external form.
  */
 
-const ASN1_EXTERN_FUNCS x509_name_ff = {
-	NULL,
-	x509_name_ex_new,
-	x509_name_ex_free,
-	0,	/* Default clear behaviour is OK */
-	x509_name_ex_d2i,
-	x509_name_ex_i2d,
-	x509_name_ex_print
-};
+OPENSSL_PREFIX_CONST_ITEM(static, ASN1_EXTERN_FUNCS, x509_name_ff, libopeay)
+	CONST_ITEM_ENTRY_START(app_data, NULL)
+	CONST_ITEM_ENTRY_SINGLE(asn1_ex_new,x509_name_ex_new)
+	CONST_ITEM_ENTRY_SINGLE(asn1_ex_free,x509_name_ex_free)
+	CONST_ITEM_ENTRY_SINGLE(asn1_ex_clear,0)	/* Default clear behaviour is OK */
+	CONST_ITEM_ENTRY_SINGLE(asn1_ex_d2i,x509_name_ex_d2i)
+	CONST_ITEM_ENTRY_SINGLE(asn1_ex_i2d,x509_name_ex_i2d)
+	CONST_ITEM_ENTRY_SINGLE(asn1_ex_print,x509_name_ex_print)
+CONST_ITEM_ENTRY_END
 
-IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, x509_name_ff) 
+IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, OPENSSL_GLOBAL_ITEM_NAME(x509_name_ff))
 
 IMPLEMENT_ASN1_FUNCTIONS(X509_NAME)
 IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME)
@@ -132,7 +135,7 @@
 static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it)
 {
 	X509_NAME *ret = NULL;
-	ret = OPENSSL_malloc(sizeof(X509_NAME));
+	ret = (X509_NAME *) OPENSSL_malloc(sizeof(X509_NAME));
 	if(!ret) goto memerr;
 	if ((ret->entries=sk_X509_NAME_ENTRY_new_null()) == NULL)
 		goto memerr;
@@ -193,7 +196,7 @@
 	if(!x509_name_ex_new(&nm.a, NULL)) goto err;
 	/* We've decoded it: now cache encoding */
 	if(!BUF_MEM_grow(nm.x->bytes, p - q)) goto err;
-	memcpy(nm.x->bytes->data, q, p - q);
+	op_memcpy(nm.x->bytes->data, q, p - q);
 
 	/* Convert internal representation to X509_NAME structure */
 	for(i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s); i++) {
@@ -235,7 +238,7 @@
 	}
 	ret = a->bytes->length;
 	if(out != NULL) {
-		memcpy(*out,a->bytes->data,ret);
+		op_memcpy(*out,a->bytes->data,ret);
 		*out+=ret;
 	}
 	return ret;
@@ -362,7 +365,7 @@
 
 	a->canon_enclen = i2d_name_canon(intname, NULL);
 
-	p = OPENSSL_malloc(a->canon_enclen);
+	p = (unsigned char *) OPENSSL_malloc(a->canon_enclen);
 
 	if (!p)
 		goto err;
@@ -421,7 +424,7 @@
 	 */
 
 	/* Ignore leading spaces */
-	while((len > 0) && !(*from & 0x80) && isspace(*from))
+	while((len > 0) && !(*from & 0x80) && op_isspace(*from))
 		{
 		from++;
 		len--;
@@ -430,7 +433,7 @@
 	to = from + len - 1;
 
 	/* Ignore trailing spaces */
-	while ((len > 0) && !(*to & 0x80) && isspace(*to))
+	while ((len > 0) && !(*to & 0x80) && op_isspace(*to))
 		{
 		to--;
 		len--;
@@ -448,7 +451,7 @@
 			i++;
 			}
 		/* Collapse multiple spaces */
-		else if (isspace(*from))
+		else if (op_isspace(*from))
 			{
 			/* Copy one space across */
 			*to++ = ' ';
@@ -461,7 +464,7 @@
 				from++;
 				i++;
 				}
-			while(!(*from & 0x80) && isspace(*from));
+			while(!(*from & 0x80) && op_isspace(*from));
 			}
 		else
 			{
@@ -497,6 +500,7 @@
 	return len;
 	}
 
+#if !defined OPERA_SMALL_VERSION
 int X509_NAME_set(X509_NAME **xn, X509_NAME *name)
 	{
 	X509_NAME *in;
@@ -514,6 +518,7 @@
 		}
 	return(*xn != NULL);
 	}
+#endif
 	
 IMPLEMENT_STACK_OF(X509_NAME_ENTRY)
 IMPLEMENT_ASN1_SET_OF(X509_NAME_ENTRY)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_pkey.c openssl-1.0.0q/crypto/asn1/x_pkey.c
--- openssl-1.0.0q.orig/crypto/asn1/x_pkey.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_pkey.c	2017-04-25 16:23:40.020525510 +0200
@@ -56,13 +56,16 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/asn1_mac.h>
 #include <openssl/x509.h>
 
+#ifndef OPERA_SMALL_VERSION
 /* need to implement */
 int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp)
 	{
@@ -96,11 +99,11 @@
 			c.line=__LINE__;
 			goto err;
 			}
-		memcpy(ret->cipher.iv,
+		op_memcpy(ret->cipher.iv,
 			ret->enc_algor->parameter->value.octet_string->data,i);
 		}
 	else
-		memset(ret->cipher.iv,0,EVP_MAX_IV_LENGTH);
+		op_memset(ret->cipher.iv,0,EVP_MAX_IV_LENGTH);
 	M_ASN1_D2I_Finish(a,X509_PKEY_free,ASN1_F_D2I_X509_PKEY);
 	}
 
@@ -118,7 +121,7 @@
 	ret->key_data=NULL;
 	ret->key_free=0;
 	ret->cipher.cipher=NULL;
-	memset(ret->cipher.iv,0,EVP_MAX_IV_LENGTH);
+	op_memset(ret->cipher.iv,0,EVP_MAX_IV_LENGTH);
 	ret->references=1;
 	return(ret);
 	M_ASN1_New_Error(ASN1_F_X509_PKEY_NEW);
@@ -149,3 +152,4 @@
 	if ((x->key_data != NULL) && (x->key_free)) OPENSSL_free(x->key_data);
 	OPENSSL_free(x);
 	}
+#endif // !OPERA_SMALL_VERSION
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_pubkey.c openssl-1.0.0q/crypto/asn1/x_pubkey.c
--- openssl-1.0.0q.orig/crypto/asn1/x_pubkey.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_pubkey.c	2017-04-25 16:23:40.021527034 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include "asn1_locl.h"
@@ -67,6 +69,7 @@
 #ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
 #endif
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Minor tweak to operation: free up EVP_PKEY */
 static int pubkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
@@ -80,13 +83,14 @@
 	return 1;
 	}
 
-ASN1_SEQUENCE_cb(X509_PUBKEY, pubkey_cb) = {
-	ASN1_SIMPLE(X509_PUBKEY, algor, X509_ALGOR),
+ASN1_SEQUENCE_cb(X509_PUBKEY, pubkey_cb)
+	ASN1_SIMPLE(X509_PUBKEY, algor, X509_ALGOR)
 	ASN1_SIMPLE(X509_PUBKEY, public_key, ASN1_BIT_STRING)
-} ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY)
+ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY)
 
 IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY)
 
+#if !defined(OPERA_SMALL_VERSION)
 int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
 	{
 	X509_PUBKEY *pk=NULL;
@@ -129,6 +133,7 @@
 	if (pk != NULL) X509_PUBKEY_free(pk);
 	return 0;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
 	{
@@ -194,6 +199,7 @@
 	return(NULL);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 /* Now two pseudo ASN1 routines that take an EVP_PKEY structure
  * and encode or decode as X509_PUBKEY
  */
@@ -347,6 +353,7 @@
 	return(ret);
 	}
 #endif
+#endif // !OPERA_SMALL_VERSION
 
 int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,
 					int ptype, void *pval,
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_req.c openssl-1.0.0q/crypto/asn1/x_req.c
--- openssl-1.0.0q.orig/crypto/asn1/x_req.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_req.c	2017-04-25 16:23:40.022526603 +0200
@@ -56,10 +56,14 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* X509_REQ_INFO is handled in an unusual way to get round
  * invalid encodings. Some broken certificate requests don't
@@ -91,23 +95,29 @@
 	return 1;
 }
 
-ASN1_SEQUENCE_enc(X509_REQ_INFO, enc, rinf_cb) = {
-	ASN1_SIMPLE(X509_REQ_INFO, version, ASN1_INTEGER),
-	ASN1_SIMPLE(X509_REQ_INFO, subject, X509_NAME),
-	ASN1_SIMPLE(X509_REQ_INFO, pubkey, X509_PUBKEY),
+ASN1_SEQUENCE_enc(X509_REQ_INFO, enc, rinf_cb)
+	ASN1_SIMPLE(X509_REQ_INFO, version, ASN1_INTEGER)
+	ASN1_SIMPLE(X509_REQ_INFO, subject, X509_NAME)
+	ASN1_SIMPLE(X509_REQ_INFO, pubkey, X509_PUBKEY)
 	/* This isn't really OPTIONAL but it gets round invalid
 	 * encodings
 	 */
 	ASN1_IMP_SET_OF_OPT(X509_REQ_INFO, attributes, X509_ATTRIBUTE, 0)
-} ASN1_SEQUENCE_END_enc(X509_REQ_INFO, X509_REQ_INFO)
+ASN1_SEQUENCE_END_enc(X509_REQ_INFO, X509_REQ_INFO)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(X509_REQ_INFO)
+#endif
 
-ASN1_SEQUENCE_ref(X509_REQ, 0, CRYPTO_LOCK_X509_REQ) = {
-	ASN1_SIMPLE(X509_REQ, req_info, X509_REQ_INFO),
-	ASN1_SIMPLE(X509_REQ, sig_alg, X509_ALGOR),
+ASN1_SEQUENCE_ref(X509_REQ, 0, CRYPTO_LOCK_X509_REQ)
+	ASN1_SIMPLE(X509_REQ, req_info, X509_REQ_INFO)
+	ASN1_SIMPLE(X509_REQ, sig_alg, X509_ALGOR)
 	ASN1_SIMPLE(X509_REQ, signature, ASN1_BIT_STRING)
-} ASN1_SEQUENCE_END_ref(X509_REQ, X509_REQ)
+ ASN1_SEQUENCE_END_ref(X509_REQ, X509_REQ)
 
-IMPLEMENT_ASN1_FUNCTIONS(X509_REQ)
+IMPLEMENT_ASN1_FUNCTIONS1(X509_REQ)
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_DUP_FUNCTION(X509_REQ)
+#endif
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_sig.c openssl-1.0.0q/crypto/asn1/x_sig.c
--- openssl-1.0.0q.orig/crypto/asn1/x_sig.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_sig.c	2017-04-25 16:23:40.022526603 +0200
@@ -56,14 +56,17 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-ASN1_SEQUENCE(X509_SIG) = {
-	ASN1_SIMPLE(X509_SIG, algor, X509_ALGOR),
+ASN1_SEQUENCE(X509_SIG)
+	ASN1_SIMPLE(X509_SIG, algor, X509_ALGOR)
 	ASN1_SIMPLE(X509_SIG, digest, ASN1_OCTET_STRING)
-} ASN1_SEQUENCE_END(X509_SIG)
+ASN1_SEQUENCE_END(X509_SIG)
 
 IMPLEMENT_ASN1_FUNCTIONS(X509_SIG)
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_spki.c openssl-1.0.0q/crypto/asn1/x_spki.c
--- openssl-1.0.0q.orig/crypto/asn1/x_spki.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_spki.c	2017-04-25 16:23:40.023525892 +0200
@@ -60,22 +60,29 @@
   * wrote it.  It is under my Copyright with his permission
   */
 
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-ASN1_SEQUENCE(NETSCAPE_SPKAC) = {
-	ASN1_SIMPLE(NETSCAPE_SPKAC, pubkey, X509_PUBKEY),
+ASN1_SEQUENCE(NETSCAPE_SPKAC)
+	ASN1_SIMPLE(NETSCAPE_SPKAC, pubkey, X509_PUBKEY)
 	ASN1_SIMPLE(NETSCAPE_SPKAC, challenge, ASN1_IA5STRING)
-} ASN1_SEQUENCE_END(NETSCAPE_SPKAC)
+ASN1_SEQUENCE_END(NETSCAPE_SPKAC)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
+#endif
 
-ASN1_SEQUENCE(NETSCAPE_SPKI) = {
-	ASN1_SIMPLE(NETSCAPE_SPKI, spkac, NETSCAPE_SPKAC),
-	ASN1_SIMPLE(NETSCAPE_SPKI, sig_algor, X509_ALGOR),
+ASN1_SEQUENCE(NETSCAPE_SPKI)
+	ASN1_SIMPLE(NETSCAPE_SPKI, spkac, NETSCAPE_SPKAC)
+	ASN1_SIMPLE(NETSCAPE_SPKI, sig_algor, X509_ALGOR)
 	ASN1_SIMPLE(NETSCAPE_SPKI, signature, ASN1_BIT_STRING)
-} ASN1_SEQUENCE_END(NETSCAPE_SPKI)
+ASN1_SEQUENCE_END(NETSCAPE_SPKI)
 
-IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_SPKI)
+IMPLEMENT_ASN1_FUNCTIONS1(NETSCAPE_SPKI)
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_val.c openssl-1.0.0q/crypto/asn1/x_val.c
--- openssl-1.0.0q.orig/crypto/asn1/x_val.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_val.c	2017-04-25 16:23:40.024525740 +0200
@@ -56,14 +56,19 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-ASN1_SEQUENCE(X509_VAL) = {
-	ASN1_SIMPLE(X509_VAL, notBefore, ASN1_TIME),
+ASN1_SEQUENCE(X509_VAL)
+	ASN1_SIMPLE(X509_VAL, notBefore, ASN1_TIME)
 	ASN1_SIMPLE(X509_VAL, notAfter, ASN1_TIME)
-} ASN1_SEQUENCE_END(X509_VAL)
+ASN1_SEQUENCE_END(X509_VAL)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(X509_VAL)
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_x509.c openssl-1.0.0q/crypto/asn1/x_x509.c
--- openssl-1.0.0q.orig/crypto/asn1/x_x509.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_x509.c	2017-04-25 16:23:40.025525587 +0200
@@ -56,27 +56,32 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-ASN1_SEQUENCE_enc(X509_CINF, enc, 0) = {
-	ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0),
-	ASN1_SIMPLE(X509_CINF, serialNumber, ASN1_INTEGER),
-	ASN1_SIMPLE(X509_CINF, signature, X509_ALGOR),
-	ASN1_SIMPLE(X509_CINF, issuer, X509_NAME),
-	ASN1_SIMPLE(X509_CINF, validity, X509_VAL),
-	ASN1_SIMPLE(X509_CINF, subject, X509_NAME),
-	ASN1_SIMPLE(X509_CINF, key, X509_PUBKEY),
-	ASN1_IMP_OPT(X509_CINF, issuerUID, ASN1_BIT_STRING, 1),
-	ASN1_IMP_OPT(X509_CINF, subjectUID, ASN1_BIT_STRING, 2),
+ASN1_SEQUENCE_enc(X509_CINF, enc, 0)
+	ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0)
+	ASN1_SIMPLE(X509_CINF, serialNumber, ASN1_INTEGER)
+	ASN1_SIMPLE(X509_CINF, signature, X509_ALGOR)
+	ASN1_SIMPLE(X509_CINF, issuer, X509_NAME)
+	ASN1_SIMPLE(X509_CINF, validity, X509_VAL)
+	ASN1_SIMPLE(X509_CINF, subject, X509_NAME)
+	ASN1_SIMPLE(X509_CINF, key, X509_PUBKEY)
+	ASN1_IMP_OPT(X509_CINF, issuerUID, ASN1_BIT_STRING, 1)
+	ASN1_IMP_OPT(X509_CINF, subjectUID, ASN1_BIT_STRING, 2)
 	ASN1_EXP_SEQUENCE_OF_OPT(X509_CINF, extensions, X509_EXTENSION, 3)
-} ASN1_SEQUENCE_END_enc(X509_CINF, X509_CINF)
+ASN1_SEQUENCE_END_enc(X509_CINF, X509_CINF)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(X509_CINF)
+#endif
 /* X509 top level structure needs a bit of customisation */
 
 extern void policy_cache_free(X509_POLICY_CACHE *cache);
@@ -115,7 +120,9 @@
 		ASN1_OCTET_STRING_free(ret->skid);
 		AUTHORITY_KEYID_free(ret->akid);
 		CRL_DIST_POINTS_free(ret->crldp);
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
 		policy_cache_free(ret->policy_cache);
+#endif
 		GENERAL_NAMES_free(ret->altname);
 		NAME_CONSTRAINTS_free(ret->nc);
 #ifndef OPENSSL_NO_RFC3779
@@ -132,15 +139,16 @@
 
 }
 
-ASN1_SEQUENCE_ref(X509, x509_cb, CRYPTO_LOCK_X509) = {
-	ASN1_SIMPLE(X509, cert_info, X509_CINF),
-	ASN1_SIMPLE(X509, sig_alg, X509_ALGOR),
+ASN1_SEQUENCE_ref(X509, x509_cb, CRYPTO_LOCK_X509)
+	ASN1_SIMPLE(X509, cert_info, X509_CINF)
+	ASN1_SIMPLE(X509, sig_alg, X509_ALGOR)
 	ASN1_SIMPLE(X509, signature, ASN1_BIT_STRING)
-} ASN1_SEQUENCE_END_ref(X509, X509)
+ASN1_SEQUENCE_END_ref(X509, X509)
 
 IMPLEMENT_ASN1_FUNCTIONS(X509)
 IMPLEMENT_ASN1_DUP_FUNCTION(X509)
 
+#if !defined OPERA_SMALL_VERSION || defined LIBOPEAY_X509_EX_DATA
 int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
 	     CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
         {
@@ -157,6 +165,7 @@
 	{
 	return(CRYPTO_get_ex_data(&r->ex_data,idx));
 	}
+#endif
 
 /* X509_AUX ASN1 routines. X509_AUX is the name given to
  * a certificate with extra info tagged on the end. Since these
diff -Naur openssl-1.0.0q.orig/crypto/asn1/x_x509a.c openssl-1.0.0q/crypto/asn1/x_x509a.c
--- openssl-1.0.0q.orig/crypto/asn1/x_x509a.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/asn1/x_x509a.c	2017-04-25 16:23:40.026526832 +0200
@@ -56,11 +56,14 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* X509_CERT_AUX routines. These are used to encode additional
  * user modifiable data about a certificate. This data is
@@ -69,18 +72,21 @@
  * will simply ignore the extra data. 
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
 static X509_CERT_AUX *aux_get(X509 *x);
+#endif
 
-ASN1_SEQUENCE(X509_CERT_AUX) = {
-	ASN1_SEQUENCE_OF_OPT(X509_CERT_AUX, trust, ASN1_OBJECT),
-	ASN1_IMP_SEQUENCE_OF_OPT(X509_CERT_AUX, reject, ASN1_OBJECT, 0),
-	ASN1_OPT(X509_CERT_AUX, alias, ASN1_UTF8STRING),
-	ASN1_OPT(X509_CERT_AUX, keyid, ASN1_OCTET_STRING),
+ASN1_SEQUENCE(X509_CERT_AUX)
+	ASN1_SEQUENCE_OF_OPT(X509_CERT_AUX, trust, ASN1_OBJECT)
+	ASN1_IMP_SEQUENCE_OF_OPT(X509_CERT_AUX, reject, ASN1_OBJECT, 0)
+	ASN1_OPT(X509_CERT_AUX, alias, ASN1_UTF8STRING)
+	ASN1_OPT(X509_CERT_AUX, keyid, ASN1_OCTET_STRING)
 	ASN1_IMP_SEQUENCE_OF_OPT(X509_CERT_AUX, other, X509_ALGOR, 1)
-} ASN1_SEQUENCE_END(X509_CERT_AUX)
+ASN1_SEQUENCE_END(X509_CERT_AUX)
 
 IMPLEMENT_ASN1_FUNCTIONS(X509_CERT_AUX)
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
 static X509_CERT_AUX *aux_get(X509 *x)
 {
 	if(!x) return NULL;
@@ -133,7 +139,9 @@
 	if(len) *len = x->aux->keyid->length;
 	return x->aux->keyid->data;
 }
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj)
 {
 	X509_CERT_AUX *aux;
@@ -172,9 +180,10 @@
 	}
 }
 
-ASN1_SEQUENCE(X509_CERT_PAIR) = {
-	ASN1_EXP_OPT(X509_CERT_PAIR, forward, X509, 0),
+ASN1_SEQUENCE(X509_CERT_PAIR)
+	ASN1_EXP_OPT(X509_CERT_PAIR, forward, X509, 0)
 	ASN1_EXP_OPT(X509_CERT_PAIR, reverse, X509, 1)
-} ASN1_SEQUENCE_END(X509_CERT_PAIR)
+ASN1_SEQUENCE_END(X509_CERT_PAIR)
 
 IMPLEMENT_ASN1_FUNCTIONS(X509_CERT_PAIR)
+#endif /* OPERA_SMALL_VERSION */
diff -Naur openssl-1.0.0q.orig/crypto/bf/.gitignore openssl-1.0.0q/crypto/bf/.gitignore
--- openssl-1.0.0q.orig/crypto/bf/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/.gitignore	2017-04-25 16:23:40.027527518 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/bf/bf_cfb64.c openssl-1.0.0q/crypto/bf/bf_cfb64.c
--- openssl-1.0.0q.orig/crypto/bf/bf_cfb64.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/bf_cfb64.c	2017-04-25 16:23:40.027527518 +0200
@@ -56,7 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPENSSL_NO_BF
 #include <openssl/blowfish.h>
+
+#ifdef OPENSSL_USE_CFB_CIPHERS
+
 #include "bf_locl.h"
 
 /* The input and output encrypted as though 64bit cfb mode is being
@@ -119,3 +123,6 @@
 	*num=n;
 	}
 
+#endif
+
+#endif // OPENSSL_NO_BF
diff -Naur openssl-1.0.0q.orig/crypto/bf/bf_ecb.c openssl-1.0.0q/crypto/bf/bf_ecb.c
--- openssl-1.0.0q.orig/crypto/bf/bf_ecb.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/bf_ecb.c	2017-04-25 16:23:40.028527365 +0200
@@ -65,7 +65,9 @@
  * CAMBRIDGE SECURITY WORKSHOP, CAMBRIDGE, U.K., DECEMBER 9-11, 1993)
  */
 
-const char BF_version[]="Blowfish" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char BF_version[]="Blowfish" OPENSSL_VERSION_PTEXT;/* ARRAY OK 2007-02-27 haavardm */ 
+#endif
 
 const char *BF_options(void)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/bf/bf_enc.c openssl-1.0.0q/crypto/bf/bf_enc.c
--- openssl-1.0.0q.orig/crypto/bf/bf_enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/bf_enc.c	2017-04-25 16:23:40.029526934 +0200
@@ -56,6 +56,8 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPENSSL_NO_BF
+
 #include <openssl/blowfish.h>
 #include "bf_locl.h"
 
@@ -304,3 +306,5 @@
 	}
 
 #endif
+
+#endif // OPENSSL_NO_BF
diff -Naur openssl-1.0.0q.orig/crypto/bf/bf_opts.c openssl-1.0.0q/crypto/bf/bf_opts.c
--- openssl-1.0.0q.orig/crypto/bf/bf_opts.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/bf_opts.c	2017-04-25 16:23:40.030526782 +0200
@@ -63,7 +63,9 @@
 #define TIMES
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/e_os2.h>
 #include OPENSSL_UNISTD_IO
@@ -74,10 +76,14 @@
 #endif
 
 #ifndef _IRIX
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef TIMES
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/times.h>
 #endif
 
@@ -95,7 +101,9 @@
 
 #if defined(sun) || defined(__ultrix)
 #define _POSIX_SOURCE
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/param.h>
 #endif
 
diff -Naur openssl-1.0.0q.orig/crypto/bf/bf_skey.c openssl-1.0.0q/crypto/bf/bf_skey.c
--- openssl-1.0.0q.orig/crypto/bf/bf_skey.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/bf_skey.c	2017-04-25 16:23:40.031527188 +0200
@@ -56,8 +56,14 @@
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/cryptlib.h>
+
+#ifndef OPENSSL_NO_BF
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/blowfish.h>
 #include "bf_locl.h"
 #include "bf_pi.h"
@@ -69,7 +75,7 @@
 	const unsigned char *d,*end;
 
 
-	memcpy(key,&bf_init,sizeof(BF_KEY));
+	op_memcpy(key,&bf_init,sizeof(BF_KEY));
 	p=key->P;
 
 	if (len > ((BF_ROUNDS+2)*4)) len=(BF_ROUNDS+2)*4;
@@ -114,3 +120,4 @@
 		}
 	}
 
+#endif // OPENSSL_NO_BF
diff -Naur openssl-1.0.0q.orig/crypto/bf/bfs.cpp openssl-1.0.0q/crypto/bf/bfs.cpp
--- openssl-1.0.0q.orig/crypto/bf/bfs.cpp	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/bfs.cpp	2017-04-25 16:23:40.031527188 +0200
@@ -30,8 +30,10 @@
 }
 #endif      
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif // !OPERA_SMALL_VERSION
 #include <openssl/blowfish.h>
 
 void main(int argc,char *argv[])
diff -Naur openssl-1.0.0q.orig/crypto/bf/bfspeed.c openssl-1.0.0q/crypto/bf/bfspeed.c
--- openssl-1.0.0q.orig/crypto/bf/bfspeed.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/bfspeed.c	2017-04-25 16:23:40.032527315 +0200
@@ -63,7 +63,9 @@
 #define TIMES
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/e_os2.h>
 #include OPENSSL_UNISTD_IO
@@ -74,10 +76,14 @@
 #endif
 
 #ifndef _IRIX
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef TIMES
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/times.h>
 #endif
 
@@ -95,7 +101,9 @@
 
 #if defined(sun) || defined(__ultrix)
 #define _POSIX_SOURCE
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/param.h>
 #endif
 
diff -Naur openssl-1.0.0q.orig/crypto/bf/bftest.c openssl-1.0.0q/crypto/bf/bftest.c
--- openssl-1.0.0q.orig/crypto/bf/bftest.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/bftest.c	2017-04-25 16:23:40.034527849 +0200
@@ -59,9 +59,11 @@
 /* This has been a quickly hacked 'ideatest.c'.  When I add tests for other
  * RC2 modes, more of the code will be uncommented. */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/opensslconf.h> /* To see if OPENSSL_NO_BF is defined */
 
 #include "../e_os.h"
@@ -362,21 +364,21 @@
 	BF_LONG len;
 
 #ifdef CHARSET_EBCDIC
-	ebcdic2ascii(cbc_data, cbc_data, strlen(cbc_data));
+	ebcdic2ascii(cbc_data, cbc_data, op_strlen(cbc_data));
 #endif
 
 	printf("testing blowfish in raw ecb mode\n");
 	for (n=0; n<2; n++)
 		{
 #ifdef CHARSET_EBCDIC
-		ebcdic2ascii(bf_key[n], bf_key[n], strlen(bf_key[n]));
+		ebcdic2ascii(bf_key[n], bf_key[n], op_strlen(bf_key[n]));
 #endif
 		BF_set_key(&key,strlen(bf_key[n]),(unsigned char *)bf_key[n]);
 
 		data[0]=bf_plain[n][0];
 		data[1]=bf_plain[n][1];
 		BF_encrypt(data,&key);
-		if (memcmp(&(bf_cipher[n][0]),&(data[0]),8) != 0)
+		if (op_memcmp(&(bf_cipher[n][0]),&(data[0]),8) != 0)
 			{
 			printf("BF_encrypt error encrypting\n");
 			printf("got     :");
@@ -391,7 +393,7 @@
 			}
 
 		BF_decrypt(&(data[0]),&key);
-		if (memcmp(&(bf_plain[n][0]),&(data[0]),8) != 0)
+		if (op_memcmp(&(bf_plain[n][0]),&(data[0]),8) != 0)
 			{
 			printf("BF_encrypt error decrypting\n");
 			printf("got     :");
@@ -413,7 +415,7 @@
 		BF_set_key(&key,8,ecb_data[n]);
 
 		BF_ecb_encrypt(&(plain_data[n][0]),out,&key,BF_ENCRYPT);
-		if (memcmp(&(cipher_data[n][0]),out,8) != 0)
+		if (op_memcmp(&(cipher_data[n][0]),out,8) != 0)
 			{
 			printf("BF_ecb_encrypt blowfish error encrypting\n");
 			printf("got     :");
@@ -428,7 +430,7 @@
 			}
 
 		BF_ecb_encrypt(out,out,&key,BF_DECRYPT);
-		if (memcmp(&(plain_data[n][0]),out,8) != 0)
+		if (op_memcmp(&(plain_data[n][0]),out,8) != 0)
 			{
 			printf("BF_ecb_encrypt error decrypting\n");
 			printf("got     :");
@@ -449,7 +451,7 @@
 		BF_set_key(&key,n,key_test);
 		BF_ecb_encrypt(key_data,out,&key,BF_ENCRYPT);
 		/* mips-sgi-irix6.5-gcc  vv  -mabi=64 bug workaround */
-		if (memcmp(out,&(key_out[i=n-1][0]),8) != 0)
+		if (op_memcmp(out,&(key_out[i=n-1][0]),8) != 0)
 			{
 			printf("blowfish setkey error\n");
 			err=1;
@@ -457,24 +459,24 @@
 		}
 
 	printf("testing blowfish in cbc mode\n");
-	len=strlen(cbc_data)+1;
+	len=op_strlen(cbc_data)+1;
 
 	BF_set_key(&key,16,cbc_key);
-	memset(cbc_in,0,sizeof cbc_in);
-	memset(cbc_out,0,sizeof cbc_out);
-	memcpy(iv,cbc_iv,sizeof iv);
+	op_memset(cbc_in,0,sizeof cbc_in);
+	op_memset(cbc_out,0,sizeof cbc_out);
+	op_memcpy(iv,cbc_iv,sizeof iv);
 	BF_cbc_encrypt((unsigned char *)cbc_data,cbc_out,len,
 		&key,iv,BF_ENCRYPT);
-	if (memcmp(cbc_out,cbc_ok,32) != 0)
+	if (op_memcmp(cbc_out,cbc_ok,32) != 0)
 		{
 		err=1;
 		printf("BF_cbc_encrypt encrypt error\n");
 		for (i=0; i<32; i++) printf("0x%02X,",cbc_out[i]);
 		}
-	memcpy(iv,cbc_iv,8);
+	op_memcpy(iv,cbc_iv,8);
 	BF_cbc_encrypt(cbc_out,cbc_in,len,
 		&key,iv,BF_DECRYPT);
-	if (memcmp(cbc_in,cbc_data,strlen(cbc_data)+1) != 0)
+	if (op_memcmp(cbc_in,cbc_data,strlen(cbc_data)+1) != 0)
 		{
 		printf("BF_cbc_encrypt decrypt error\n");
 		err=1;
@@ -483,27 +485,27 @@
 	printf("testing blowfish in cfb64 mode\n");
 
 	BF_set_key(&key,16,cbc_key);
-	memset(cbc_in,0,40);
-	memset(cbc_out,0,40);
-	memcpy(iv,cbc_iv,8);
+	op_memset(cbc_in,0,40);
+	op_memset(cbc_out,0,40);
+	op_memcpy(iv,cbc_iv,8);
 	n=0;
 	BF_cfb64_encrypt((unsigned char *)cbc_data,cbc_out,(long)13,
 		&key,iv,&n,BF_ENCRYPT);
 	BF_cfb64_encrypt((unsigned char *)&(cbc_data[13]),&(cbc_out[13]),len-13,
 		&key,iv,&n,BF_ENCRYPT);
-	if (memcmp(cbc_out,cfb64_ok,(int)len) != 0)
+	if (op_memcmp(cbc_out,cfb64_ok,(int)len) != 0)
 		{
 		err=1;
 		printf("BF_cfb64_encrypt encrypt error\n");
 		for (i=0; i<(int)len; i++) printf("0x%02X,",cbc_out[i]);
 		}
 	n=0;
-	memcpy(iv,cbc_iv,8);
+	op_memcpy(iv,cbc_iv,8);
 	BF_cfb64_encrypt(cbc_out,cbc_in,17,
 		&key,iv,&n,BF_DECRYPT);
 	BF_cfb64_encrypt(&(cbc_out[17]),&(cbc_in[17]),len-17,
 		&key,iv,&n,BF_DECRYPT);
-	if (memcmp(cbc_in,cbc_data,(int)len) != 0)
+	if (op_memcmp(cbc_in,cbc_data,(int)len) != 0)
 		{
 		printf("BF_cfb64_encrypt decrypt error\n");
 		err=1;
@@ -512,24 +514,24 @@
 	printf("testing blowfish in ofb64\n");
 
 	BF_set_key(&key,16,cbc_key);
-	memset(cbc_in,0,40);
-	memset(cbc_out,0,40);
-	memcpy(iv,cbc_iv,8);
+	op_memset(cbc_in,0,40);
+	op_memset(cbc_out,0,40);
+	op_memcpy(iv,cbc_iv,8);
 	n=0;
 	BF_ofb64_encrypt((unsigned char *)cbc_data,cbc_out,(long)13,&key,iv,&n);
 	BF_ofb64_encrypt((unsigned char *)&(cbc_data[13]),
 		&(cbc_out[13]),len-13,&key,iv,&n);
-	if (memcmp(cbc_out,ofb64_ok,(int)len) != 0)
+	if (op_memcmp(cbc_out,ofb64_ok,(int)len) != 0)
 		{
 		err=1;
 		printf("BF_ofb64_encrypt encrypt error\n");
 		for (i=0; i<(int)len; i++) printf("0x%02X,",cbc_out[i]);
 		}
 	n=0;
-	memcpy(iv,cbc_iv,8);
+	op_memcpy(iv,cbc_iv,8);
 	BF_ofb64_encrypt(cbc_out,cbc_in,17,&key,iv,&n);
 	BF_ofb64_encrypt(&(cbc_out[17]),&(cbc_in[17]),len-17,&key,iv,&n);
-	if (memcmp(cbc_in,cbc_data,(int)len) != 0)
+	if (op_memcmp(cbc_in,cbc_data,(int)len) != 0)
 		{
 		printf("BF_ofb64_encrypt decrypt error\n");
 		err=1;
diff -Naur openssl-1.0.0q.orig/crypto/bf/opera_bf_cfb64.cpp openssl-1.0.0q/crypto/bf/opera_bf_cfb64.cpp
--- openssl-1.0.0q.orig/crypto/bf/opera_bf_cfb64.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/opera_bf_cfb64.cpp	2017-04-25 16:23:40.035527417 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bf/bf_cfb64.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/bf/opera_bf_ecb.cpp openssl-1.0.0q/crypto/bf/opera_bf_ecb.cpp
--- openssl-1.0.0q.orig/crypto/bf/opera_bf_ecb.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/opera_bf_ecb.cpp	2017-04-25 16:23:40.036526706 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "bf_ecb.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/bf/opera_bf_enc.cpp openssl-1.0.0q/crypto/bf/opera_bf_enc.cpp
--- openssl-1.0.0q.orig/crypto/bf/opera_bf_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/opera_bf_enc.cpp	2017-04-25 16:23:40.036526706 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bf/bf_enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/bf/opera_bf_ofb64.cpp openssl-1.0.0q/crypto/bf/opera_bf_ofb64.cpp
--- openssl-1.0.0q.orig/crypto/bf/opera_bf_ofb64.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/opera_bf_ofb64.cpp	2017-04-25 16:23:40.037526833 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "bf_ofb64.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/bf/opera_bf_skey.cpp openssl-1.0.0q/crypto/bf/opera_bf_skey.cpp
--- openssl-1.0.0q.orig/crypto/bf/opera_bf_skey.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bf/opera_bf_skey.cpp	2017-04-25 16:23:40.037526833 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bf/bf_skey.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/bio/.gitignore openssl-1.0.0q/crypto/bio/.gitignore
--- openssl-1.0.0q.orig/crypto/bio/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/.gitignore	2017-04-25 16:23:40.038526681 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/bio/b_dump.c openssl-1.0.0q/crypto/bio/b_dump.c
--- openssl-1.0.0q.orig/crypto/bio/b_dump.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/b_dump.c	2017-04-25 16:23:40.038526681 +0200
@@ -60,19 +60,24 @@
  * Stolen from tjh's ssl/ssl_trc.c stuff.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bio_lcl.h"
 
 #define TRUNCATE
 #define DUMP_WIDTH	16
 #define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH-((i-(i>6?6:i)+3)/4))
 
+#ifndef OPERA_SMALL_VERSION
+
 int BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u),
 	void *u, const char *s, int len)
 	{
 	return BIO_dump_indent_cb(cb, u, s, len, 0);
 	}
+#endif
 
 int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
 	void *u, const char *s, int len, int indent)
@@ -95,7 +100,7 @@
 	if (indent)
 		{
 		if (indent > 128) indent=128;
-		memset(str,' ',indent);
+		op_memset(str,' ',indent);
 		}
 	str[indent]='\0';
 
@@ -157,6 +162,7 @@
 	return(ret);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 #ifndef OPENSSL_NO_FP_API
 static int write_fp(const void *data, size_t len, void *fp)
 	{
@@ -171,17 +177,22 @@
 	return BIO_dump_indent_cb(write_fp, fp, s, len, indent);
 	}
 #endif
+#endif // OPERA_SMALL
 
+#ifndef OPERA_SMALL_VERSION
 static int write_bio(const void *data, size_t len, void *bp)
 	{
 	return BIO_write((BIO *)bp, (const char *)data, len);
 	}
+
 int BIO_dump(BIO *bp, const char *s, int len)
 	{
 	return BIO_dump_cb(write_bio, bp, s, len);
 	}
+
 int BIO_dump_indent(BIO *bp, const char *s, int len, int indent)
 	{
 	return BIO_dump_indent_cb(write_bio, bp, s, len, indent);
 	}
+#endif // OPERA_SMALL
 
diff -Naur openssl-1.0.0q.orig/crypto/bio/b_print.c openssl-1.0.0q/crypto/bio/b_print.c
--- openssl-1.0.0q.orig/crypto/bio/b_print.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/b_print.c	2017-04-25 16:23:40.040526377 +0200
@@ -67,14 +67,18 @@
  * Stolen from tjh's ssl/ssl_trc.c stuff.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
-#include <assert.h>
 #include <limits.h>
-#include "cryptlib.h"
+#include <assert.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #ifndef NO_SYS_TYPES_H
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #include <openssl/bn.h>         /* To get BN_LLONG properly defined */
 #include <openssl/bio.h>
@@ -84,6 +88,9 @@
 #  define HAVE_LONG_LONG 1
 # endif
 #endif
+#ifndef HAVE_LONG_LONG
+# define HAVE_LONG_LONG 0
+#endif
 
 /***************************************************************************/
 
@@ -125,14 +132,14 @@
 #define LLONG long
 #endif
 
-static void fmtstr     (char **, char **, size_t *, size_t *,
+static int fmtstr     (char **, char **, size_t *, size_t *,
 			const char *, int, int, int);
-static void fmtint     (char **, char **, size_t *, size_t *,
+static int fmtint     (char **, char **, size_t *, size_t *,
 			LLONG, int, int, int, int);
-static void fmtfp      (char **, char **, size_t *, size_t *,
+static int fmtfp      (char **, char **, size_t *, size_t *,
 			LDOUBLE, int, int, int);
-static void doapr_outch (char **, char **, size_t *, size_t *, int);
-static void _dopr(char **sbuffer, char **buffer,
+static int doapr_outch (char **, char **, size_t *, size_t *, int);
+static int _dopr(char **sbuffer, char **buffer,
 		  size_t *maxlen, size_t *retlen, int *truncated,
 		  const char *format, va_list args);
 
@@ -165,7 +172,7 @@
 #define char_to_int(p) (p - '0')
 #define OSSL_MAX(p,q) ((p >= q) ? p : q)
 
-static void
+static int
 _dopr(
     char **sbuffer,
     char **buffer,
@@ -200,7 +207,10 @@
             if (ch == '%')
                 state = DP_S_FLAGS;
             else
-                doapr_outch(sbuffer,buffer, &currlen, maxlen, ch);
+			{
+                if(!doapr_outch(sbuffer,buffer, &currlen, maxlen, ch))
+					return 0;
+			}
             ch = *format++;
             break;
         case DP_S_FLAGS:
@@ -231,7 +241,7 @@
             }
             break;
         case DP_S_MIN:
-            if (isdigit((unsigned char)ch)) {
+            if (op_isdigit((unsigned char)ch)) {
                 min = 10 * min + char_to_int(ch);
                 ch = *format++;
             } else if (ch == '*') {
@@ -249,7 +259,7 @@
                 state = DP_S_MOD;
             break;
         case DP_S_MAX:
-            if (isdigit((unsigned char)ch)) {
+            if (op_isdigit((unsigned char)ch)) {
                 if (max < 0)
                     max = 0;
                 max = 10 * max + char_to_int(ch);
@@ -306,8 +316,9 @@
                     value = va_arg(args, int);
                     break;
                 }
-                fmtint(sbuffer, buffer, &currlen, maxlen,
-                       value, 10, min, max, flags);
+                if (!fmtint(sbuffer, buffer, &currlen, maxlen,
+                       value, 10, min, max, flags))
+                    return 0;
                 break;
             case 'X':
                 flags |= DP_F_UP;
@@ -332,17 +343,19 @@
                         unsigned int);
                     break;
                 }
-                fmtint(sbuffer, buffer, &currlen, maxlen, value,
+                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
                        ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
-                       min, max, flags);
+                       min, max, flags))
+                    return 0;
                 break;
             case 'f':
                 if (cflags == DP_C_LDOUBLE)
                     fvalue = va_arg(args, LDOUBLE);
                 else
                     fvalue = va_arg(args, double);
-                fmtfp(sbuffer, buffer, &currlen, maxlen,
-                      fvalue, min, max, flags);
+                if (!fmtfp(sbuffer, buffer, &currlen, maxlen,
+                      fvalue, min, max, flags))
+                    return 0;
                 break;
             case 'E':
                 flags |= DP_F_UP;
@@ -361,8 +374,9 @@
                     fvalue = va_arg(args, double);
                 break;
             case 'c':
-                doapr_outch(sbuffer, buffer, &currlen, maxlen,
-                    va_arg(args, int));
+                if(!doapr_outch(sbuffer, buffer, &currlen, maxlen,
+                    va_arg(args, int)))
+					return 0;
                 break;
             case 's':
                 strvalue = va_arg(args, char *);
@@ -372,13 +386,15 @@
 		    else
 			max = *maxlen;
 		}
-                fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
-                       flags, min, max);
+                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
+                       flags, min, max))
+                    return 0;
                 break;
             case 'p':
                 value = (long)va_arg(args, void *);
-                fmtint(sbuffer, buffer, &currlen, maxlen,
-                    value, 16, min, max, flags|DP_F_NUM);
+                if (!fmtint(sbuffer, buffer, &currlen, maxlen,
+                    value, 16, min, max, flags|DP_F_NUM))
+                    return 0;
                 break;
             case 'n': /* XXX */
                 if (cflags == DP_C_SHORT) {
@@ -400,7 +416,8 @@
                 }
                 break;
             case '%':
-                doapr_outch(sbuffer, buffer, &currlen, maxlen, ch);
+                if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
+					return 0;
                 break;
             case 'w':
                 /* not supported yet, treat as next char */
@@ -424,12 +441,13 @@
     *truncated = (currlen > *maxlen - 1);
     if (*truncated)
         currlen = *maxlen - 1;
-    doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0');
+    if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
+		return 0;
     *retlen = currlen - 1;
-    return;
+    return 1;
 }
 
-static void
+static int
 fmtstr(
     char **sbuffer,
     char **buffer,
@@ -454,22 +472,27 @@
         padlen = -padlen;
 
     while ((padlen > 0) && (cnt < max)) {
-        doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
+			return 0;
         --padlen;
         ++cnt;
     }
     while (*value && (cnt < max)) {
-        doapr_outch(sbuffer, buffer, currlen, maxlen, *value++);
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
+			return 0;
         ++cnt;
     }
     while ((padlen < 0) && (cnt < max)) {
-        doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
+			return 0;
         ++padlen;
         ++cnt;
     }
+
+	return 1;
 }
 
-static void
+static int
 fmtint(
     char **sbuffer,
     char **buffer,
@@ -484,7 +507,7 @@
     int signvalue = 0;
     const char *prefix = "";
     unsigned LLONG uvalue;
-    char convert[DECIMAL_SIZE(value)+3];
+    char convert[DECIMAL_SIZE(value)+3]; /* ARRAY OK 2009-05-25 yngve */
     int place = 0;
     int spadlen = 0;
     int zpadlen = 0;
@@ -519,7 +542,7 @@
     convert[place] = 0;
 
     zpadlen = max - place;
-    spadlen = min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
+    spadlen = min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - op_strlen(prefix);
     if (zpadlen < 0)
         zpadlen = 0;
     if (spadlen < 0)
@@ -533,37 +556,45 @@
 
     /* spaces */
     while (spadlen > 0) {
-        doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
+			return 0;
         --spadlen;
     }
 
     /* sign */
     if (signvalue)
-        doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue);
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
+			return 0;
 
     /* prefix */
     while (*prefix) {
-	doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix);
+	if(!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix))
+		return 0;
 	prefix++;
     }
 
     /* zeros */
     if (zpadlen > 0) {
         while (zpadlen > 0) {
-            doapr_outch(sbuffer, buffer, currlen, maxlen, '0');
+            if(!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
+				return 0;
             --zpadlen;
         }
     }
     /* digits */
     while (place > 0)
-        doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]);
+	{
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
+			return 0;
+	}
 
     /* left justified spaces */
     while (spadlen < 0) {
-        doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
+			return 0;
         ++spadlen;
     }
-    return;
+    return 1;
 }
 
 static LDOUBLE
@@ -576,7 +607,7 @@
 }
 
 static LDOUBLE
-pow_10(int in_exp)
+op_pow_10(int in_exp)
 {
     LDOUBLE result = 1;
     while (in_exp) {
@@ -597,7 +628,7 @@
     return intpart;
 }
 
-static void
+static int
 fmtfp(
     char **sbuffer,
     char **buffer,
@@ -610,8 +641,8 @@
 {
     int signvalue = 0;
     LDOUBLE ufvalue;
-    char iconvert[20];
-    char fconvert[20];
+    char iconvert[20]; /* ARRAY OK 2009-05-25 yngve */
+    char fconvert[20]; /* ARRAY OK 2009-05-25 yngve */
     int iplace = 0;
     int fplace = 0;
     int padlen = 0;
@@ -640,8 +671,8 @@
 
     /* we "cheat" by converting the fractional part to integer by
        multiplying by a factor of 10 */
-    max10 = roundv(pow_10(max));
-    fracpart = roundv(pow_10(max) * (ufvalue - intpart));
+    max10 = roundv(op_pow_10(max));
+    fracpart = roundv(op_pow_10(max) * (ufvalue - intpart));
 
     if (fracpart >= max10) {
         intpart++;
@@ -682,47 +713,60 @@
 
     if ((flags & DP_F_ZERO) && (padlen > 0)) {
         if (signvalue) {
-            doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue);
+            if(!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
+				return 0;
             --padlen;
             signvalue = 0;
         }
         while (padlen > 0) {
-            doapr_outch(sbuffer, buffer, currlen, maxlen, '0');
+            if(!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
+				return 0;
             --padlen;
         }
     }
     while (padlen > 0) {
-        doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
+			return 0;
         --padlen;
     }
     if (signvalue)
-        doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue);
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
+			return 0;
 
     while (iplace > 0)
-        doapr_outch(sbuffer, buffer, currlen, maxlen, iconvert[--iplace]);
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, iconvert[--iplace]))
+			return 0;
 
     /*
      * Decimal point. This should probably use locale to find the correct
      * char to print out.
      */
     if (max > 0 || (flags & DP_F_NUM)) {
-        doapr_outch(sbuffer, buffer, currlen, maxlen, '.');
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, '.'))
+			return 0;
 
         while (fplace > 0)
-            doapr_outch(sbuffer, buffer, currlen, maxlen, fconvert[--fplace]);
+		{
+            if(!doapr_outch(sbuffer, buffer, currlen, maxlen, fconvert[--fplace]))
+				return 0;
+		}
     }
     while (zpadlen > 0) {
-        doapr_outch(sbuffer, buffer, currlen, maxlen, '0');
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
+			return 0;
         --zpadlen;
     }
 
     while (padlen < 0) {
-        doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
+        if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
+			return 0;
         ++padlen;
     }
+
+	return 1;
 }
 
-static void
+static int
 doapr_outch(
     char **sbuffer,
     char **buffer,
@@ -730,37 +774,43 @@
     size_t *maxlen,
     int c)
 {
-    /* If we haven't at least one buffer, someone has doe a big booboo */
+	char *temp;
+    /* If we haven't at least one buffer, someone has done a big booboo */
     assert(*sbuffer != NULL || buffer != NULL);
 
     if (buffer) {
-	while (*currlen >= *maxlen) {
-	    if (*buffer == NULL) {
-		if (*maxlen == 0)
-		    *maxlen = 1024;
-		*buffer = OPENSSL_malloc(*maxlen);
-		if (*currlen > 0) {
-		    assert(*sbuffer != NULL);
-		    memcpy(*buffer, *sbuffer, *currlen);
+		while (*currlen >= *maxlen) {
+			if (*buffer == NULL) {
+				if (*maxlen == 0)
+					*maxlen = 1024;
+				*buffer = (char *) OPENSSL_malloc(*maxlen);
+				if(!*buffer)
+					return 0;
+				if (*currlen > 0) {
+					assert(*sbuffer != NULL);
+					op_memcpy(*buffer, *sbuffer, *currlen);
+				}
+				*sbuffer = NULL;
+			} else {
+				*maxlen += 1024;
+				temp = (char *) OPENSSL_realloc(*buffer, *maxlen);
+				if(temp == NULL)
+					return 0;
+				*buffer = temp;
+			}
 		}
-		*sbuffer = NULL;
-	    } else {
-		*maxlen += 1024;
-		*buffer = OPENSSL_realloc(*buffer, *maxlen);
-	    }
-	}
-	/* What to do if *buffer is NULL? */
-	assert(*sbuffer != NULL || *buffer != NULL);
+		/* What to do if *buffer is NULL? */
+		assert(*sbuffer != NULL || *buffer != NULL);
     }
 
     if (*currlen < *maxlen) {
-	if (*sbuffer)
-	    (*sbuffer)[(*currlen)++] = (char)c;
-	else
-	    (*buffer)[(*currlen)++] = (char)c;
+		if (*sbuffer)
+			(*sbuffer)[(*currlen)++] = (char)c;
+		else
+			(*buffer)[(*currlen)++] = (char)c;
     }
 
-    return;
+	return 1;
 }
 
 /***************************************************************************/
@@ -781,14 +831,15 @@
 int BIO_vprintf (BIO *bio, const char *format, va_list args)
 	{
 	int ret;
-	size_t retlen;
-	char hugebuf[1024*2];	/* Was previously 10k, which is unreasonable
+	size_t retlen=0;
+	/* char hugebuf[1024*2];	*/ /* ARRAY OK DISABLED 2009-08-07 alexeik */
+				/* Was previously 10k, which is unreasonable
 				   in small-stack environments, like threads
 				   or DOS programs. */
-	char *hugebufp = hugebuf;
-	size_t hugebufsize = sizeof(hugebuf);
+	char *hugebufp = NULL; /* hugebuf; */ /* Disabled stack buffer, demand allocated buffer */
+	size_t hugebufsize = 0; /* sizeof(hugebuf); */
 	char *dynbuf = NULL;
-	int ignored;
+	int ignored=0;
 
 	dynbuf = NULL;
 	CRYPTO_push_info("doapr()");
@@ -801,7 +852,7 @@
 		}
 	else
 		{
-		ret=BIO_write(bio, hugebuf, (int)retlen);
+		ret= 0; /* BIO_write(bio, hugebuf, (int)retlen);*/ /* Disabled */
 		}
 	CRYPTO_pop_info();
 	return(ret);
diff -Naur openssl-1.0.0q.orig/crypto/bio/b_sock.c openssl-1.0.0q/crypto/bio/b_sock.c
--- openssl-1.0.0q.orig/crypto/bio/b_sock.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/b_sock.c	2017-04-25 16:23:40.041526224 +0200
@@ -56,9 +56,14 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #define USE_SOCKETS
 #include "cryptlib.h"
 #include <openssl/bio.h>
@@ -182,7 +187,7 @@
 		BIOerr(BIO_F_BIO_GET_PORT,BIO_R_NO_PORT_DEFINED);
 		return(0);
 		}
-	i=atoi(str);
+	i=op_atoi(str);
 	if (i != 0)
 		*port_ptr=(unsigned short)i;
 	else
@@ -201,22 +206,22 @@
 		CRYPTO_w_unlock(CRYPTO_LOCK_GETSERVBYNAME);
 		if(s == NULL)
 			{
-			if (strcmp(str,"http") == 0)
+			if (op_strcmp(str,"http") == 0)
 				*port_ptr=80;
-			else if (strcmp(str,"telnet") == 0)
+			else if (op_strcmp(str,"telnet") == 0)
 				*port_ptr=23;
-			else if (strcmp(str,"socks") == 0)
+			else if (op_strcmp(str,"socks") == 0)
 				*port_ptr=1080;
-			else if (strcmp(str,"https") == 0)
+			else if (op_strcmp(str,"https") == 0)
 				*port_ptr=443;
-			else if (strcmp(str,"ssl") == 0)
+			else if (op_strcmp(str,"ssl") == 0)
 				*port_ptr=443;
-			else if (strcmp(str,"ftp") == 0)
+			else if (op_strcmp(str,"ftp") == 0)
 				*port_ptr=21;
-			else if (strcmp(str,"gopher") == 0)
+			else if (op_strcmp(str,"gopher") == 0)
 				*port_ptr=70;
 #if 0
-			else if (strcmp(str,"wais") == 0)
+			else if (op_strcmp(str,"wais") == 0)
 				*port_ptr=21;
 #endif
 			else
@@ -301,7 +306,7 @@
 	MemCheck_off();
 	ret=(struct hostent *)OPENSSL_malloc(sizeof(struct hostent));
 	if (ret == NULL) return(NULL);
-	memset(ret,0,sizeof(struct hostent));
+	op_memset(ret,0,sizeof(struct hostent));
 
 	for (i=0; a->h_aliases[i] != NULL; i++)
 		;
@@ -309,7 +314,7 @@
 	ret->h_aliases = (char **)OPENSSL_malloc(i*sizeof(char *));
 	if (ret->h_aliases == NULL)
 		goto err;
-	memset(ret->h_aliases, 0, i*sizeof(char *));
+	op_memset(ret->h_aliases, 0, i*sizeof(char *));
 
 	for (i=0; a->h_addr_list[i] != NULL; i++)
 		;
@@ -317,16 +322,16 @@
 	ret->h_addr_list=(char **)OPENSSL_malloc(i*sizeof(char *));
 	if (ret->h_addr_list == NULL)
 		goto err;
-	memset(ret->h_addr_list, 0, i*sizeof(char *));
+	op_memset(ret->h_addr_list, 0, i*sizeof(char *));
 
-	j=strlen(a->h_name)+1;
+	j=op_strlen(a->h_name)+1;
 	if ((ret->h_name=OPENSSL_malloc(j)) == NULL) goto err;
-	memcpy((char *)ret->h_name,a->h_name,j);
+	op_memcpy((char *)ret->h_name,a->h_name,j);
 	for (i=0; a->h_aliases[i] != NULL; i++)
 		{
-		j=strlen(a->h_aliases[i])+1;
+		j=op_strlen(a->h_aliases[i])+1;
 		if ((ret->h_aliases[i]=OPENSSL_malloc(j)) == NULL) goto err;
-		memcpy(ret->h_aliases[i],a->h_aliases[i],j);
+		op_memcpy(ret->h_aliases[i],a->h_aliases[i],j);
 		}
 	ret->h_length=a->h_length;
 	ret->h_addrtype=a->h_addrtype;
@@ -334,7 +339,7 @@
 		{
 		if ((ret->h_addr_list[i]=OPENSSL_malloc(a->h_length)) == NULL)
 			goto err;
-		memcpy(ret->h_addr_list[i],a->h_addr_list[i],a->h_length);
+		op_memcpy(ret->h_addr_list[i],a->h_addr_list[i],a->h_length);
 		}
 	if (0)
 		{
@@ -395,7 +400,7 @@
 	 */
 	CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME);
 #  endif
-	j=strlen(name);
+	j=op_strlen(name);
 	if (j < 128)
 		{
 		for (i=0; i<GHBN_NUM; i++)
@@ -407,7 +412,7 @@
 				}
 			if (ghbn_cache[i].order > 0)
 				{
-				if (strncmp(name,ghbn_cache[i].name,128) == 0)
+				if (op_strncmp(name,ghbn_cache[i].name,128) == 0)
 					break;
 				}
 			}
@@ -450,7 +455,7 @@
 			BIOerr(BIO_F_BIO_GETHOSTBYNAME,ERR_R_MALLOC_FAILURE);
 			goto end;
 			}
-		strncpy(ghbn_cache[lowi].name,name,128);
+		op_strncpy(ghbn_cache[lowi].name,name,128);
 		ghbn_cache[lowi].order=BIO_ghbn_miss+BIO_ghbn_hits;
 		}
 	else
diff -Naur openssl-1.0.0q.orig/crypto/bio/bf_buff.c openssl-1.0.0q/crypto/bio/bf_buff.c
--- openssl-1.0.0q.orig/crypto/bio/bf_buff.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bf_buff.c	2017-04-25 16:23:40.042525793 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bio.h>
 
 static int buffer_write(BIO *h, const char *buf,int num);
@@ -146,7 +148,7 @@
 	if (i != 0)
 		{
 		if (i > outl) i=outl;
-		memcpy(out,&(ctx->ibuf[ctx->ibuf_off]),i);
+		op_memcpy(out,&(ctx->ibuf[ctx->ibuf_off]),i);
 		ctx->ibuf_off+=i;
 		ctx->ibuf_len-=i;
 		num+=i;
@@ -318,14 +320,14 @@
 	case BIO_C_SET_BUFF_READ_DATA:
 		if (num > ctx->ibuf_size)
 			{
-			p1=OPENSSL_malloc((int)num);
+			p1=(char*)OPENSSL_malloc((int)num);
 			if (p1 == NULL) goto malloc_error;
 			if (ctx->ibuf != NULL) OPENSSL_free(ctx->ibuf);
 			ctx->ibuf=p1;
 			}
 		ctx->ibuf_off=0;
 		ctx->ibuf_len=(int)num;
-		memcpy(ctx->ibuf,ptr,(int)num);
+		op_memcpy(ctx->ibuf,ptr,(int)num);
 		ret=1;
 		break;
 	case BIO_C_SET_BUFF_SIZE:
@@ -507,6 +509,6 @@
 
 static int buffer_puts(BIO *b, const char *str)
 	{
-	return(buffer_write(b,str,strlen(str)));
+	return(buffer_write(b,str,op_strlen(str)));
 	}
 
diff -Naur openssl-1.0.0q.orig/crypto/bio/bf_lbuf.c openssl-1.0.0q/crypto/bio/bf_lbuf.c
--- openssl-1.0.0q.orig/crypto/bio/bf_lbuf.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bf_lbuf.c	2017-04-25 16:23:40.043526758 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/bio.h>
 #include <openssl/evp.h>
@@ -182,7 +184,7 @@
 				{
 				if (i >= p - in)
 					{
-					memcpy(&(ctx->obuf[ctx->obuf_len]),
+					op_memcpy(&(ctx->obuf[ctx->obuf_len]),
 						in,p - in);
 					ctx->obuf_len += p - in;
 					inl -= p - in;
@@ -191,7 +193,7 @@
 					}
 				else
 					{
-					memcpy(&(ctx->obuf[ctx->obuf_len]),
+					op_memcpy(&(ctx->obuf[ctx->obuf_len]),
 						in,i);
 					ctx->obuf_len += i;
 					inl -= i;
@@ -220,7 +222,7 @@
 BIO_write(b->next_bio, ">*>", 3);
 #endif
 			if (i < ctx->obuf_len)
-				memmove(ctx->obuf, ctx->obuf + i,
+				op_memmove(ctx->obuf, ctx->obuf + i,
 					ctx->obuf_len - i);
 			ctx->obuf_len-=i;
 			}
@@ -256,7 +258,7 @@
 	   saved for the next trip. */
 	if (inl > 0)
 		{
-		memcpy(&(ctx->obuf[ctx->obuf_len]), in, inl);
+		op_memcpy(&(ctx->obuf[ctx->obuf_len]), in, inl);
 		ctx->obuf_len += inl;
 		num += inl;
 		}
@@ -307,7 +309,7 @@
 				{
 				ctx->obuf_len = obs;
 				}
-			memcpy(p, ctx->obuf, ctx->obuf_len);
+			op_memcpy(p, ctx->obuf, ctx->obuf_len);
 			OPENSSL_free(ctx->obuf);
 			ctx->obuf=p;
 			ctx->obuf_size=obs;
@@ -341,7 +343,7 @@
 				BIO_copy_next_retry(b);
 				if (r <= 0) return((long)r);
 				if (r < ctx->obuf_len)
-					memmove(ctx->obuf, ctx->obuf + r,
+					op_memmove(ctx->obuf, ctx->obuf + r,
 						ctx->obuf_len - r);
 				ctx->obuf_len-=r;
 				}
diff -Naur openssl-1.0.0q.orig/crypto/bio/bf_nbio.c openssl-1.0.0q/crypto/bio/bf_nbio.c
--- openssl-1.0.0q.orig/crypto/bio/bf_nbio.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bf_nbio.c	2017-04-25 16:23:40.044528002 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/rand.h>
 #include <openssl/bio.h>
diff -Naur openssl-1.0.0q.orig/crypto/bio/bf_null.c openssl-1.0.0q/crypto/bio/bf_null.c
--- openssl-1.0.0q.orig/crypto/bio/bf_null.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bf_null.c	2017-04-25 16:23:40.045526733 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/bio.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/bio/bio.h openssl-1.0.0q/crypto/bio/bio.h
--- openssl-1.0.0q.orig/crypto/bio/bio.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bio.h	2017-04-25 16:23:40.047526987 +0200
@@ -62,9 +62,13 @@
 #include <openssl/e_os2.h>
 
 #ifndef OPENSSL_NO_FP_API
+#ifndef OPERA_SMALL_VERSION
 # include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
+#ifndef OPERA_SMALL_VERSION
 #include <stdarg.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/crypto.h>
 
@@ -282,9 +286,26 @@
         long (*callback_ctrl)(BIO *, int, bio_info_cb *);
 	} BIO_METHOD;
 
+#define BIO_METHOD_CONST_ITEM(m_name, typ, nam, bw,br,bp,bg,ct,cr,dstr,callb) \
+	OPENSSL_PREFIX_CONST_ITEM(static, BIO_METHOD, m_name, libopeay)\
+	CONST_ITEM_ENTRY_START(type,typ)\
+	CONST_ITEM_ENTRY_SINGLE(name,NULL)\
+	CONST_ITEM_ENTRY_SINGLE(bwrite,bw)\
+	CONST_ITEM_ENTRY_SINGLE(bread,br)\
+	CONST_ITEM_ENTRY_SINGLE(bputs,bp)\
+	CONST_ITEM_ENTRY_SINGLE(bgets,bg)\
+	CONST_ITEM_ENTRY_SINGLE(ctrl,ct)\
+	CONST_ITEM_ENTRY_SINGLE(create,cr)\
+	CONST_ITEM_ENTRY_SINGLE(destroy,dstr)\
+	CONST_ITEM_ENTRY_SINGLE(callback_ctrl,callb)\
+	CONST_ITEM_ENTRY_END
+
+#define DECLARE_BIO_METHOD_ITEM(name) \
+	DECLARE_MODULE_CONST_ITEM(BIO_METHOD, name)
+
 struct bio_st
 	{
-	BIO_METHOD *method;
+	const BIO_METHOD *method;
 	/* bio, mode, argp, argi, argl, ret */
 	long (*callback)(struct bio_st *,int,const char *,int, long,long);
 	char *cb_arg; /* first argument for the callback */
@@ -578,13 +599,13 @@
 					asn1_ps_func **psuffix_free);
 
 # ifndef OPENSSL_NO_FP_API
-BIO_METHOD *BIO_s_file(void );
+const BIO_METHOD *BIO_s_file(void );
 BIO *BIO_new_file(const char *filename, const char *mode);
 BIO *BIO_new_fp(FILE *stream, int close_flag);
 # define BIO_s_file_internal	BIO_s_file
 # endif
-BIO *	BIO_new(BIO_METHOD *type);
-int	BIO_set(BIO *a,BIO_METHOD *type);
+BIO *	BIO_new(const BIO_METHOD *type);
+int	BIO_set(BIO *a,const BIO_METHOD *type);
 int	BIO_free(BIO *a);
 void	BIO_vfree(BIO *a);
 int	BIO_read(BIO *b, void *data, int len);
@@ -613,7 +634,7 @@
 long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi,
 	long argl,long ret);
 
-BIO_METHOD *BIO_s_mem(void);
+const BIO_METHOD *BIO_s_mem(void);
 BIO *BIO_new_mem_buf(void *buf, int len);
 BIO_METHOD *BIO_s_socket(void);
 BIO_METHOD *BIO_s_connect(void);
@@ -623,7 +644,7 @@
 BIO_METHOD *BIO_s_log(void);
 #endif
 BIO_METHOD *BIO_s_bio(void);
-BIO_METHOD *BIO_s_null(void);
+const BIO_METHOD *BIO_s_null(void);
 BIO_METHOD *BIO_f_null(void);
 BIO_METHOD *BIO_f_buffer(void);
 #ifdef OPENSSL_SYS_VMS
diff -Naur openssl-1.0.0q.orig/crypto/bio/bio_cb.c openssl-1.0.0q/crypto/bio/bio_cb.c
--- openssl-1.0.0q.orig/crypto/bio/bio_cb.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bio_cb.c	2017-04-25 16:23:40.047526987 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/bio.h>
 #include <openssl/err.h>
diff -Naur openssl-1.0.0q.orig/crypto/bio/bio_err.c openssl-1.0.0q/crypto/bio/bio_err.c
--- openssl-1.0.0q.orig/crypto/bio/bio_err.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bio_err.c	2017-04-25 16:23:40.049526682 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/bio.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/bio/bio_lib.c openssl-1.0.0q/crypto/bio/bio_lib.c
--- openssl-1.0.0q.orig/crypto/bio/bio_lib.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bio_lib.c	2017-04-25 16:23:40.050527089 +0200
@@ -56,14 +56,15 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
-#include <openssl/crypto.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bio.h>
 #include <openssl/stack.h>
 
-BIO *BIO_new(BIO_METHOD *method)
+BIO *BIO_new(const BIO_METHOD *method)
 	{
 	BIO *ret=NULL;
 
@@ -81,7 +82,7 @@
 	return(ret);
 	}
 
-int BIO_set(BIO *bio, BIO_METHOD *method)
+int BIO_set(BIO *bio, const BIO_METHOD *method)
 	{
 	bio->method=method;
 	bio->callback=NULL;
@@ -138,8 +139,10 @@
 	return(1);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 void BIO_vfree(BIO *a)
     { BIO_free(a); }
+#endif
 
 void BIO_clear_flags(BIO *b, int flags)
 	{
@@ -200,7 +203,7 @@
 
 	cb=b->callback;
 	if ((cb != NULL) &&
-		((i=(int)cb(b,BIO_CB_READ,out,outl,0L,1L)) <= 0))
+		((i=(int)cb(b,BIO_CB_READ, (const char *) out,outl,0L,1L)) <= 0))
 			return(i);
 
 	if (!b->init)
@@ -209,12 +212,12 @@
 		return(-2);
 		}
 
-	i=b->method->bread(b,out,outl);
+	i=b->method->bread(b,(char *) out,outl);
 
 	if (i > 0) b->num_read+=(unsigned long)i;
 
 	if (cb != NULL)
-		i=(int)cb(b,BIO_CB_READ|BIO_CB_RETURN,out,outl,
+		i=(int)cb(b,BIO_CB_READ|BIO_CB_RETURN,(const char *) out,outl,
 			0L,(long)i);
 	return(i);
 	}
@@ -235,7 +238,7 @@
 		}
 
 	if ((cb != NULL) &&
-		((i=(int)cb(b,BIO_CB_WRITE,in,inl,0L,1L)) <= 0))
+		((i=(int)cb(b,BIO_CB_WRITE,(const char *) in,inl,0L,1L)) <= 0))
 			return(i);
 
 	if (!b->init)
@@ -244,12 +247,12 @@
 		return(-2);
 		}
 
-	i=b->method->bwrite(b,in,inl);
+	i=b->method->bwrite(b,(const char *) in,inl);
 
 	if (i > 0) b->num_write+=(unsigned long)i;
 
 	if (cb != NULL)
-		i=(int)cb(b,BIO_CB_WRITE|BIO_CB_RETURN,in,inl,
+		i=(int)cb(b,BIO_CB_WRITE|BIO_CB_RETURN,(const char *) in,inl,
 			0L,(long)i);
 	return(i);
 	}
@@ -364,13 +367,13 @@
 	cb=b->callback;
 
 	if ((cb != NULL) &&
-		((ret=cb(b,BIO_CB_CTRL,parg,cmd,larg,1L)) <= 0))
+		((ret=cb(b,BIO_CB_CTRL,(const char *) parg,cmd,larg,1L)) <= 0))
 		return(ret);
 
 	ret=b->method->ctrl(b,cmd,larg,parg);
 
 	if (cb != NULL)
-		ret=cb(b,BIO_CB_CTRL|BIO_CB_RETURN,parg,cmd,
+		ret=cb(b,BIO_CB_CTRL|BIO_CB_RETURN,(const char *) parg,cmd,
 			larg,ret);
 	return(ret);
 	}
@@ -391,13 +394,13 @@
 	cb=b->callback;
 
 	if ((cb != NULL) &&
-		((ret=cb(b,BIO_CB_CTRL,(void *)&fp,cmd,0,1L)) <= 0))
+		((ret=cb(b,BIO_CB_CTRL,(const char *)&fp,cmd,0,1L)) <= 0))
 		return(ret);
 
 	ret=b->method->callback_ctrl(b,cmd,fp);
 
 	if (cb != NULL)
-		ret=cb(b,BIO_CB_CTRL|BIO_CB_RETURN,(void *)&fp,cmd,
+		ret=cb(b,BIO_CB_CTRL|BIO_CB_RETURN,(const char*)&fp,cmd,
 			0,ret);
 	return(ret);
 	}
@@ -415,7 +418,6 @@
 	return BIO_ctrl(bio, BIO_CTRL_WPENDING, 0, NULL);
 	}
 
-
 /* put the 'bio' on the end of b's list of operators */
 BIO *BIO_push(BIO *b, BIO *bio)
 	{
@@ -433,6 +435,7 @@
 	return(b);
 	}
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 /* Remove the first and return the rest */
 BIO *BIO_pop(BIO *b)
 	{
@@ -473,6 +476,7 @@
 	{
 	return(bio->retry_reason);
 	}
+#endif
 
 BIO *BIO_find_type(BIO *bio, int type)
 	{
@@ -519,6 +523,7 @@
 		}
 	}
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 BIO *BIO_dup_chain(BIO *in)
 	{
 	BIO *ret=NULL,*eoc=NULL,*bio,*new_bio;
@@ -563,6 +568,7 @@
 		BIO_free(ret);
 	return(NULL);	
 	}
+#endif
 
 void BIO_copy_next_retry(BIO *b)
 	{
@@ -570,6 +576,7 @@
 	b->retry_reason=b->next_bio->retry_reason;
 	}
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
 	     CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
 	{
@@ -598,5 +605,6 @@
 	if(bio) return bio->num_write;
 	return 0;
 }
+#endif
 
 IMPLEMENT_STACK_OF(BIO)
diff -Naur openssl-1.0.0q.orig/crypto/bio/bss_acpt.c openssl-1.0.0q/crypto/bio/bss_acpt.c
--- openssl-1.0.0q.orig/crypto/bio/bss_acpt.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bss_acpt.c	2017-04-25 16:23:40.051526378 +0200
@@ -56,10 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #define USE_SOCKETS
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/bio.h>
 
 #ifndef OPENSSL_NO_SOCK
@@ -148,7 +150,7 @@
 	if ((ret=(BIO_ACCEPT *)OPENSSL_malloc(sizeof(BIO_ACCEPT))) == NULL)
 		return(NULL);
 
-	memset(ret,0,sizeof(BIO_ACCEPT));
+	op_memset(ret,0,sizeof(BIO_ACCEPT));
 	ret->accept_sock=INVALID_SOCKET;
 	ret->bind_mode=BIO_BIND_NORMAL;
 	return(ret);
@@ -455,7 +457,7 @@
 	{
 	int n,ret;
 
-	n=strlen(str);
+	n=op_strlen(str);
 	ret=acpt_write(bp,str,n);
 	return(ret);
 	}
diff -Naur openssl-1.0.0q.orig/crypto/bio/bss_bio.c openssl-1.0.0q/crypto/bio/bss_bio.c
--- openssl-1.0.0q.orig/crypto/bio/bss_bio.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bss_bio.c	2017-04-25 16:23:40.052526505 +0200
@@ -74,10 +74,12 @@
 # endif
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <assert.h>
 #include <limits.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/bio.h>
 #include <openssl/err.h>
@@ -245,7 +247,7 @@
 			chunk = peer_b->size - peer_b->offset;
 		assert(peer_b->offset + chunk <= peer_b->size);
 		
-		memcpy(buf, peer_b->buf + peer_b->offset, chunk);
+		op_memcpy(buf, peer_b->buf + peer_b->offset, chunk);
 		
 		peer_b->len -= chunk;
 		if (peer_b->len)
@@ -408,7 +410,7 @@
 			/* wrap around ring buffer */
 			chunk = b->size - write_offset;
 		
-		memcpy(b->buf + write_offset, buf, chunk);
+		op_memcpy(b->buf + write_offset, buf, chunk);
 		
 		b->len += chunk;
 
@@ -697,7 +699,7 @@
 
 static int bio_puts(BIO *bio, const char *str)
 	{
-	return bio_write(bio, str, strlen(str));
+	return bio_write(bio, str, op_strlen(str));
 	}
 
 
diff -Naur openssl-1.0.0q.orig/crypto/bio/bss_conn.c openssl-1.0.0q/crypto/bio/bss_conn.c
--- openssl-1.0.0q.orig/crypto/bio/bss_conn.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bss_conn.c	2017-04-25 16:23:40.053526353 +0200
@@ -56,8 +56,13 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #define USE_SOCKETS
 #include "cryptlib.h"
 #include <openssl/bio.h>
@@ -198,7 +203,7 @@
 
 		case BIO_CONN_S_CREATE_SOCKET:
 			/* now setup address */
-			memset((char *)&c->them,0,sizeof(c->them));
+			op_memset((char *)&c->them,0,sizeof(c->them));
 			c->them.sin_family=AF_INET;
 			c->them.sin_port=htons((unsigned short)c->port);
 			l=(unsigned long)
@@ -334,7 +339,7 @@
 	ret->ip[2]=0;
 	ret->ip[3]=0;
 	ret->port=0;
-	memset((char *)&ret->them,0,sizeof(ret->them));
+	op_memset((char *)&ret->them,0,sizeof(ret->them));
 	return(ret);
 	}
 
@@ -526,7 +531,7 @@
 				if (data->param_hostname != NULL)
 					OPENSSL_free(data->param_hostname);
 				data->param_hostname=BUF_strdup(buf);
-				memcpy(&(data->ip[0]),ptr,4);
+				op_memcpy(&(data->ip[0]),ptr,4);
 				}
 			else if (num == 3)
 				{
@@ -628,7 +633,7 @@
 	{
 	int n,ret;
 
-	n=strlen(str);
+	n=op_strlen(str);
 	ret=conn_write(bp,str,n);
 	return(ret);
 	}
diff -Naur openssl-1.0.0q.orig/crypto/bio/bss_fd.c openssl-1.0.0q/crypto/bio/bss_fd.c
--- openssl-1.0.0q.orig/crypto/bio/bss_fd.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bss_fd.c	2017-04-25 16:23:40.054526200 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #define USE_SOCKETS
 #include "cryptlib.h"
 
@@ -230,7 +232,7 @@
 	{
 	int n,ret;
 
-	n=strlen(str);
+	n=op_strlen(str);
 	ret=fd_write(bp,str,n);
 	return(ret);
 	}
diff -Naur openssl-1.0.0q.orig/crypto/bio/bss_file.c openssl-1.0.0q/crypto/bio/bss_file.c
--- openssl-1.0.0q.orig/crypto/bio/bss_file.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bss_file.c	2017-04-25 16:23:40.055526328 +0200
@@ -62,9 +62,13 @@
  *		Windows
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #ifndef HEADER_BSS_FILE_C
 #define HEADER_BSS_FILE_C
 
+#ifndef OPERA_SMALL_VERSION
 #if defined(__linux) || defined(__sun) || defined(__hpux)
 /* Following definition aliases fopen to fopen64 on above mentioned
  * platforms. This makes it possible to open and sequentially access
@@ -85,6 +89,7 @@
 
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include "bio_lcl.h"
 #include <openssl/err.h>
@@ -102,7 +107,7 @@
 static long MS_CALLBACK file_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int MS_CALLBACK file_new(BIO *h);
 static int MS_CALLBACK file_free(BIO *data);
-static BIO_METHOD methods_filep=
+static const BIO_METHOD methods_filep=
 	{
 	BIO_TYPE_FILE,
 	"FILE pointer",
@@ -167,7 +172,9 @@
 	if (file == NULL)
 		{
 		SYSerr(SYS_F_FOPEN,get_last_sys_error());
+#ifndef OPERA_SMALL_VERSION
 		ERR_add_error_data(5,"fopen('",filename,"','",mode,"')");
+#endif
 		if (errno == ENOENT)
 			BIOerr(BIO_F_BIO_NEW_FILE,BIO_R_NO_SUCH_FILE);
 		else
@@ -197,7 +204,7 @@
 	return(ret);
 	}
 
-BIO_METHOD *BIO_s_file(void)
+const BIO_METHOD *BIO_s_file(void)
 	{
 	return(&methods_filep);
 	}
@@ -382,9 +389,9 @@
 			}
 #if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_WIN32_CYGWIN)
 		if (!(num & BIO_FP_TEXT))
-			strcat(p,"b");
+			op_strcat(p,"b");
 		else
-			strcat(p,"t");
+			op_strcat(p,"t");
 #endif
 #if defined(OPENSSL_SYS_NETWARE)
 		if (!(num & BIO_FP_TEXT))
@@ -396,7 +403,9 @@
 		if (fp == NULL)
 			{
 			SYSerr(SYS_F_FOPEN,get_last_sys_error());
+#ifndef OPERA_SMALL_VERSION
 			ERR_add_error_data(5,"fopen('",ptr,"','",p,"')");
+#endif
 			BIOerr(BIO_F_FILE_CTRL,ERR_R_SYS_LIB);
 			ret=0;
 			break;
@@ -465,7 +474,7 @@
 	{
 	int n,ret;
 
-	n=strlen(str);
+	n=op_strlen(str);
 	ret=file_write(bp,str,n);
 	return(ret);
 	}
diff -Naur openssl-1.0.0q.orig/crypto/bio/bss_log.c openssl-1.0.0q/crypto/bio/bss_log.c
--- openssl-1.0.0q.orig/crypto/bio/bss_log.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bss_log.c	2017-04-25 16:23:40.056526175 +0200
@@ -58,13 +58,18 @@
 
 	BIO_s_log is useful for system daemons (or services under NT).
 	It is one-way BIO, it sends all stuff to syslogd (on system that
-	commonly use that), or event log (on NT), or OPCOM (on OpenVMS).
+	commonly use that), or event op_log (on NT), or OPCOM (on OpenVMS).
 
 */
 
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "cryptlib.h"
 
@@ -204,11 +209,11 @@
 	if((buf= (char *)OPENSSL_malloc(inl+ 1)) == NULL){
 		return(0);
 	}
-	strncpy(buf, in, inl);
+	op_strncpy(buf, in, inl);
 	buf[inl]= '\0';
 
 	i = 0;
-	while(strncmp(buf, mapping[i].str, mapping[i].strl) != 0) i++;
+	while(op_strncmp(buf, mapping[i].str, mapping[i].strl) != 0) i++;
 	priority = mapping[i].log_level;
 	pp = buf + mapping[i].strl;
 
@@ -236,7 +241,7 @@
 	{
 	int n,ret;
 
-	n=strlen(str);
+	n=op_strlen(str);
 	ret=slg_write(bp,str,n);
 	return(ret);
 	}
@@ -355,9 +360,9 @@
 	/* We know there's an 8-byte header.  That's documented. */
 	opcdef_p = OPCDEF_MALLOC( 8+ len);
 	opcdef_p->opc$b_ms_type = OPC$_RQ_RQST;
-	memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3);
+	op_memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3);
 	opcdef_p->opc$l_ms_rqstid = 0;
-	memcpy(&opcdef_p->opc$l_ms_text, buf, len);
+	op_memcpy(&opcdef_p->opc$l_ms_text, buf, len);
 
 	opc_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
 	opc_dsc.dsc$b_class = DSC$K_CLASS_S;
diff -Naur openssl-1.0.0q.orig/crypto/bio/bss_mem.c openssl-1.0.0q/crypto/bio/bss_mem.c
--- openssl-1.0.0q.orig/crypto/bio/bss_mem.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bss_mem.c	2017-04-25 16:23:40.057526023 +0200
@@ -56,10 +56,14 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bio.h>
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 static int mem_write(BIO *h, const char *buf, int num);
 static int mem_read(BIO *h, char *buf, int size);
@@ -68,8 +72,7 @@
 static long mem_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int mem_new(BIO *h);
 static int mem_free(BIO *data);
-static BIO_METHOD mem_method=
-	{
+BIO_METHOD_CONST_ITEM(bss_mem__mem_method,
 	BIO_TYPE_MEM,
 	"memory buffer",
 	mem_write,
@@ -79,13 +82,14 @@
 	mem_ctrl,
 	mem_new,
 	mem_free,
-	NULL,
-	};
+	NULL
+	);
+#define mem_method OPENSSL_GLOBAL_ITEM_NAME(bss_mem__mem_method)
 
 /* bio->num is used to hold the value to return on 'empty', if it is
  * 0, should_retry is not set */
 
-BIO_METHOD *BIO_s_mem(void)
+const BIO_METHOD *BIO_s_mem(void)
 	{
 	return(&mem_method);
 	}
@@ -100,10 +104,10 @@
 		BIOerr(BIO_F_BIO_NEW_MEM_BUF,BIO_R_NULL_PARAMETER);
 		return NULL;
 	}
-	sz = (len<0) ? strlen(buf) : (size_t)len;
+	sz = (len<0) ? strlen((const char*)buf) : (size_t)len;
 	if(!(ret = BIO_new(BIO_s_mem())) ) return NULL;
 	b = (BUF_MEM *)ret->ptr;
-	b->data = buf;
+	b->data = (char*)buf;
 	b->length = sz;
 	b->max = sz;
 	ret->flags |= BIO_FLAGS_MEM_RDONLY;
@@ -151,7 +155,7 @@
 	BIO_clear_retry_flags(b);
 	ret=(outl >=0 && (size_t)outl > bm->length)?(int)bm->length:outl;
 	if ((out != NULL) && (ret > 0)) {
-		memcpy(out,bm->data,ret);
+		op_memcpy(out,bm->data,ret);
 		bm->length-=ret;
 		if(b->flags & BIO_FLAGS_MEM_RDONLY) bm->data += ret;
 		else {
@@ -188,7 +192,7 @@
 	blen=bm->length;
 	if (BUF_MEM_grow_clean(bm,blen+inl) != (blen+inl))
 		goto end;
-	memcpy(&(bm->data[blen]),in,inl);
+	op_memcpy(&(bm->data[blen]),in,inl);
 	ret=inl;
 end:
 	return(ret);
@@ -214,7 +218,7 @@
 				}
 			else
 				{
-				memset(bm->data,0,bm->max);
+				op_memset(bm->data,0,bm->max);
 				bm->length=0;
 				}
 			}
@@ -311,7 +315,7 @@
 	{
 	int n,ret;
 
-	n=strlen(str);
+	n=op_strlen(str);
 	ret=mem_write(bp,str,n);
 	/* memory semantics is that it will always work */
 	return(ret);
diff -Naur openssl-1.0.0q.orig/crypto/bio/bss_null.c openssl-1.0.0q/crypto/bio/bss_null.c
--- openssl-1.0.0q.orig/crypto/bio/bss_null.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bss_null.c	2017-04-25 16:23:40.058526150 +0200
@@ -56,10 +56,15 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/bio.h>
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 static int null_write(BIO *h, const char *buf, int num);
 static int null_read(BIO *h, char *buf, int size);
@@ -68,8 +73,7 @@
 static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int null_new(BIO *h);
 static int null_free(BIO *data);
-static BIO_METHOD null_method=
-	{
+BIO_METHOD_CONST_ITEM(bss_null__null_method,
 	BIO_TYPE_NULL,
 	"NULL",
 	null_write,
@@ -79,10 +83,11 @@
 	null_ctrl,
 	null_new,
 	null_free,
-	NULL,
-	};
+	NULL
+	);
+#define null_method OPENSSL_GLOBAL_ITEM_NAME(bss_null__null_method)
 
-BIO_METHOD *BIO_s_null(void)
+const BIO_METHOD *BIO_s_null(void)
 	{
 	return(&null_method);
 	}
@@ -145,6 +150,6 @@
 static int null_puts(BIO *bp, const char *str)
 	{
 	if (str == NULL) return(0);
-	return(strlen(str));
+	return(op_strlen(str));
 	}
 
diff -Naur openssl-1.0.0q.orig/crypto/bio/bss_rtcp.c openssl-1.0.0q/crypto/bio/bss_rtcp.c
--- openssl-1.0.0q.orig/crypto/bio/bss_rtcp.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bss_rtcp.c	2017-04-25 16:23:40.059526557 +0200
@@ -61,10 +61,15 @@
  * Revised: 25-SEP-1997		Update for 0.8.1, BIO_CTRL_SET -> BIO_C_SET_FD
  */
 /* VMS */
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/bio.h>
 
@@ -182,7 +187,7 @@
     if ( ctx->pos < ctx->filled ) {
 	length = ctx->filled - ctx->pos;
 	if ( length > outl ) length = outl;
-	memmove ( out, &ctx->msg.data[ctx->pos], length );
+	op_memmove ( out, &ctx->msg.data[ctx->pos], length );
 	ctx->pos += length;
 	return length;
     }
@@ -210,7 +215,7 @@
     if ( ctx->pos < ctx->filled ) {
 	length = ctx->filled - ctx->pos;
 	if ( length > outl ) length = outl;
-	memmove ( out, ctx->msg.data, length );
+	op_memmove ( out, ctx->msg.data, length );
 	ctx->pos += length;
 	return length;
     }
@@ -232,7 +237,7 @@
 	ctx->msg.channel = 'R';
 	ctx->msg.function = 'P';
 	ctx->msg.length = segment;
-	memmove ( ctx->msg.data, &in[i], segment );
+	op_memmove ( ctx->msg.data, &in[i], segment );
 	status = put ( b->num, (char *) &ctx->msg, segment + RPC_HDR_SIZE );
 	if ((status&1) == 0 ) { i = -1; break; }
 
@@ -287,7 +292,7 @@
 {
     int length;
     if (str == NULL) return(0);
-    length = strlen ( str );
+    length = op_strlen ( str );
     if ( length == 0 ) return (0);
     return rtcp_write ( bp,str, length );
 }
diff -Naur openssl-1.0.0q.orig/crypto/bio/bss_sock.c openssl-1.0.0q/crypto/bio/bss_sock.c
--- openssl-1.0.0q.orig/crypto/bio/bss_sock.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/bss_sock.c	2017-04-25 16:23:40.060526125 +0200
@@ -56,10 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #define USE_SOCKETS
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_SOCK
 
@@ -209,7 +211,7 @@
 	{
 	int n,ret;
 
-	n=strlen(str);
+	n=op_strlen(str);
 	ret=sock_write(bp,str,n);
 	return(ret);
 	}
diff -Naur openssl-1.0.0q.orig/crypto/bio/opera_b_dump.cpp openssl-1.0.0q/crypto/bio/opera_b_dump.cpp
--- openssl-1.0.0q.orig/crypto/bio/opera_b_dump.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/opera_b_dump.cpp	2017-04-25 16:23:40.061527090 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "b_dump.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/bio/opera_b_print.cpp openssl-1.0.0q/crypto/bio/opera_b_print.cpp
--- openssl-1.0.0q.orig/crypto/bio/opera_b_print.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/opera_b_print.cpp	2017-04-25 16:23:40.061527090 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bio/b_print.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bio/opera_bf_buff.cpp openssl-1.0.0q/crypto/bio/opera_bf_buff.cpp
--- openssl-1.0.0q.orig/crypto/bio/opera_bf_buff.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/opera_bf_buff.cpp	2017-04-25 16:23:40.062526100 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bio/bf_buff.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/crypto/bio/opera_bio_lib.cpp openssl-1.0.0q/crypto/bio/opera_bio_lib.cpp
--- openssl-1.0.0q.orig/crypto/bio/opera_bio_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/opera_bio_lib.cpp	2017-04-25 16:23:40.062526100 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bio/bio_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/bio/opera_bss_mem.cpp openssl-1.0.0q/crypto/bio/opera_bss_mem.cpp
--- openssl-1.0.0q.orig/crypto/bio/opera_bss_mem.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/opera_bss_mem.cpp	2017-04-25 16:23:40.063526507 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bio/bss_mem.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bio/opera_bss_null.cpp openssl-1.0.0q/crypto/bio/opera_bss_null.cpp
--- openssl-1.0.0q.orig/crypto/bio/opera_bss_null.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/opera_bss_null.cpp	2017-04-25 16:23:40.063526507 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bio/bss_null.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/bio/opera_bss_sock.cpp openssl-1.0.0q/crypto/bio/opera_bss_sock.cpp
--- openssl-1.0.0q.orig/crypto/bio/opera_bss_sock.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bio/opera_bss_sock.cpp	2017-04-25 16:23:40.064526075 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bio/bss_sock.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/crypto/bn/.gitignore openssl-1.0.0q/crypto/bn/.gitignore
--- openssl-1.0.0q.orig/crypto/bn/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/.gitignore	2017-04-25 16:23:40.064526075 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn.h openssl-1.0.0q/crypto/bn/bn.h
--- openssl-1.0.0q.orig/crypto/bn/bn.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn.h	2017-04-25 16:23:40.065525923 +0200
@@ -127,7 +127,9 @@
 
 #include <openssl/e_os2.h>
 #ifndef OPENSSL_NO_FP_API
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h> /* FILE */
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #include <openssl/ossl_typ.h>
 #include <openssl/crypto.h>
@@ -211,7 +213,7 @@
 #define BN_BYTES	8
 #define BN_BITS2	64
 #define BN_BITS4	32
-#define BN_MASK2	(0xffffffffffffffffLL)
+#define BN_MASK2	(0xffffffffffffffffULL)
 #define BN_MASK2l	(0xffffffffL)
 #define BN_MASK2h	(0xffffffff00000000LL)
 #define BN_MASK2h1	(0xffffffff80000000LL)
@@ -358,7 +360,7 @@
 	union
 		{
 		/* if(ver==1) - handles old style callbacks */
-		void (*cb_1)(int, int, void *);
+		int (*cb_1)(int, int, void *);
 		/* if(ver==2) - new callback style */
 		int (*cb_2)(int, int, BN_GENCB *);
 		} cb;
@@ -544,12 +546,12 @@
 #ifndef OPENSSL_NO_DEPRECATED
 BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,
 	const BIGNUM *add, const BIGNUM *rem,
-	void (*callback)(int,int,void *),void *cb_arg);
+	int (*callback)(int,int,void *),void *cb_arg);
 int	BN_is_prime(const BIGNUM *p,int nchecks,
-	void (*callback)(int,int,void *),
+	int (*callback)(int,int,void *),
 	BN_CTX *ctx,void *cb_arg);
 int	BN_is_prime_fasttest(const BIGNUM *p,int nchecks,
-	void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg,
+	int (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg,
 	int do_trial_division);
 #endif /* !defined(OPENSSL_NO_DEPRECATED) */
 
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_add.c openssl-1.0.0q/crypto/bn/bn_add.c
--- openssl-1.0.0q.orig/crypto/bn/bn_add.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_add.c	2017-04-25 16:23:40.066526050 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 /* r can == a or b */
@@ -234,7 +236,7 @@
 			}
 		}
 #if 0
-	memcpy(rp,ap,sizeof(*rp)*(max-i));
+	op_memcpy(rp,ap,sizeof(*rp)*(max-i));
 #else
 	if (rp != ap)
 		{
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_asm.c openssl-1.0.0q/crypto/bn/bn_asm.c
--- openssl-1.0.0q.orig/crypto/bn/bn_asm.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_asm.c	2017-04-25 16:23:40.067526177 +0200
@@ -56,14 +56,18 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef PRODUCT_COMPILES_BN_ASM
+
 #ifndef BN_DEBUG
 # undef NDEBUG /* avoid conflicting definitions */
 # define NDEBUG
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <assert.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 #if defined(BN_LLONG) || defined(BN_UMULT_HIGH)
@@ -1032,3 +1036,5 @@
 #endif
 
 #endif /* !BN_MUL_COMBA */
+
+#endif /* !PRODUCT_COMPILES_BN_ASM */
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_blind.c openssl-1.0.0q/crypto/bn/bn_blind.c
--- openssl-1.0.0q.orig/crypto/bn/bn_blind.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_blind.c	2017-04-25 16:23:40.068526863 +0200
@@ -109,8 +109,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 #define BN_BLINDING_COUNTER	32
@@ -134,6 +136,7 @@
 			  BN_MONT_CTX *m_ctx);
 	};
 
+#ifndef OPERA_SMALL_VERSION
 BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)
 	{
 	BN_BLINDING *ret=NULL;
@@ -145,7 +148,7 @@
 		BNerr(BN_F_BN_BLINDING_NEW,ERR_R_MALLOC_FAILURE);
 		return(NULL);
 		}
-	memset(ret,0,sizeof(BN_BLINDING));
+	op_memset(ret,0,sizeof(BN_BLINDING));
 	if (A != NULL)
 		{
 		if ((ret->A  = BN_dup(A))  == NULL) goto err;
@@ -383,3 +386,4 @@
 
 	return ret;
 }
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_ctx.c openssl-1.0.0q/crypto/bn/bn_ctx.c
--- openssl-1.0.0q.orig/crypto/bn/bn_ctx.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_ctx.c	2017-04-25 16:23:40.069526152 +0200
@@ -60,10 +60,12 @@
 #endif
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <assert.h>
+#endif /* !OPERA_SMALL_VERSION */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 /* TODO list
@@ -213,7 +215,7 @@
 
 BN_CTX *BN_CTX_new(void)
 	{
-	BN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX));
+	BN_CTX *ret = (BN_CTX *) OPENSSL_malloc(sizeof(BN_CTX));
 	if(!ret)
 		{
 		BNerr(BN_F_BN_CTX_NEW,ERR_R_MALLOC_FAILURE);
@@ -334,11 +336,11 @@
 		{
 		unsigned int newsize = (st->size ?
 				(st->size * 3 / 2) : BN_CTX_START_FRAMES);
-		unsigned int *newitems = OPENSSL_malloc(newsize *
+		unsigned int *newitems = (unsigned int *) OPENSSL_malloc(newsize *
 						sizeof(unsigned int));
 		if(!newitems) return 0;
 		if(st->depth)
-			memcpy(newitems, st->indexes, st->depth *
+			op_memcpy(newitems, st->indexes, st->depth *
 						sizeof(unsigned int));
 		if(st->size) OPENSSL_free(st->indexes);
 		st->indexes = newitems;
@@ -406,7 +408,7 @@
 		{
 		BIGNUM *bn;
 		unsigned int loop = 0;
-		BN_POOL_ITEM *item = OPENSSL_malloc(sizeof(BN_POOL_ITEM));
+		BN_POOL_ITEM *item = (BN_POOL_ITEM *) OPENSSL_malloc(sizeof(BN_POOL_ITEM));
 		if(!item) return NULL;
 		/* Initialise the structure */
 		bn = item->vals;
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_div.c openssl-1.0.0q/crypto/bn/bn_div.c
--- openssl-1.0.0q.orig/crypto/bn/bn_div.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_div.c	2017-04-25 16:23:40.070526558 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/bn.h>
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_err.c openssl-1.0.0q/crypto/bn/bn_err.c
--- openssl-1.0.0q.orig/crypto/bn/bn_err.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_err.c	2017-04-25 16:23:40.071526685 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/bn.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_exp.c openssl-1.0.0q/crypto/bn/bn_exp.c
--- openssl-1.0.0q.orig/crypto/bn/bn_exp.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_exp.c	2017-04-25 16:23:40.072527930 +0200
@@ -110,12 +110,13 @@
  */
 
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 /* maximum precomputation table size for *variable* sliding windows */
 #define TABLE_SIZE	32
 
+#ifndef OPERA_SMALL_VERSION
 /* this one works - simple but works */
 int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 	{
@@ -159,8 +160,9 @@
 	bn_check_top(r);
 	return(ret);
 	}
+#endif
 
-
+#if !defined OPERA_SMALL_VERSION || defined LIBOPEAY_PKCS12_SUPPORT || defined(NEED_LIBOPEAY_ELGAMAL)
 int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
 	       BN_CTX *ctx)
 	{
@@ -367,6 +369,7 @@
 	bn_check_top(r);
 	return(ret);
 	}
+#endif // !defined OPERA_SMALL_VERSION || defined LIBOPEAY_PKCS12_SUPPORT || defined(NEED_LIBOPEAY_ELGAMAL)
 
 
 int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
@@ -630,7 +633,7 @@
 		goto err;
 		
 	powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree);
-	memset(powerbuf, 0, powerbufLen);
+	op_memset(powerbuf, 0, powerbufLen);
 
  	/* Initialize the intermediate result. Do this early to save double conversion,
 	 * once each for a^0 and intermediate result.
@@ -879,6 +882,7 @@
 	}
 
 
+#ifndef OPERA_SMALL_VERSION
 /* The old fallback, simple version :-) */
 int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 		const BIGNUM *m, BN_CTX *ctx)
@@ -995,4 +999,4 @@
 	bn_check_top(r);
 	return(ret);
 	}
-
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_exp2.c openssl-1.0.0q/crypto/bn/bn_exp2.c
--- openssl-1.0.0q.orig/crypto/bn/bn_exp2.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_exp2.c	2017-04-25 16:23:40.073526939 +0200
@@ -109,8 +109,12 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+
+#if !defined OPERA_SMALL_VERSION || !defined OPENSSL_NO_DSA
 #include "bn_lcl.h"
 
 #define TABLE_SIZE	32
@@ -310,3 +314,4 @@
 	bn_check_top(rr);
 	return(ret);
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_gcd.c openssl-1.0.0q/crypto/bn/bn_gcd.c
--- openssl-1.0.0q.orig/crypto/bn/bn_gcd.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_gcd.c	2017-04-25 16:23:40.074527067 +0200
@@ -109,7 +109,7 @@
  *
  */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 static BIGNUM *euclid(BIGNUM *a, BIGNUM *b);
@@ -201,7 +201,6 @@
 	return(NULL);
 	}
 
-
 /* solves ax == 1 (mod n) */
 static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
         const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_lcl.h openssl-1.0.0q/crypto/bn/bn_lcl.h
--- openssl-1.0.0q.orig/crypto/bn/bn_lcl.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_lcl.h	2017-04-25 16:23:40.075526914 +0200
@@ -323,33 +323,6 @@
 	(r1)=Hw(t); \
 	}
 
-#elif defined(BN_UMULT_LOHI)
-#define mul_add(r,a,w,c) {		\
-	BN_ULONG high,low,ret,tmp=(a);	\
-	ret =  (r);			\
-	BN_UMULT_LOHI(low,high,w,tmp);	\
-	ret += (c);			\
-	(c) =  (ret<(c))?1:0;		\
-	(c) += high;			\
-	ret += low;			\
-	(c) += (ret<low)?1:0;		\
-	(r) =  ret;			\
-	}
-
-#define mul(r,a,w,c)	{		\
-	BN_ULONG high,low,ret,ta=(a);	\
-	BN_UMULT_LOHI(low,high,w,ta);	\
-	ret =  low + (c);		\
-	(c) =  high;			\
-	(c) += (ret<low)?1:0;		\
-	(r) =  ret;			\
-	}
-
-#define sqr(r0,r1,a)	{		\
-	BN_ULONG tmp=(a);		\
-	BN_UMULT_LOHI(r0,r1,tmp,tmp);	\
-	}
-
 #elif defined(BN_UMULT_HIGH)
 #define mul_add(r,a,w,c) {		\
 	BN_ULONG high,low,ret,tmp=(a);	\
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_lib.c openssl-1.0.0q/crypto/bn/bn_lib.c
--- openssl-1.0.0q.orig/crypto/bn/bn_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_lib.c	2017-04-25 16:23:40.076527321 +0200
@@ -61,13 +61,19 @@
 # define NDEBUG
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <assert.h>
 #include <limits.h>
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
+#include "modules/libopeay/libopeay_arrays.h"
 
-const char BN_version[]="Big Number" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char BN_version[]="Big Number" OPENSSL_VERSION_PTEXT;/* ARRAY OK 2007-02-27 haavardm */ 
+#endif
 
 /* This stuff appears to be completely unused, so is deprecated */
 #ifndef OPENSSL_NO_DEPRECATED
@@ -80,6 +86,24 @@
  * 7 - 128 == 4096
  * 8 - 256 == 8192
  */
+#ifdef _NO_GLOBALS_
+extern int *g_bn_limit_bits_addr();
+#define bn_limit_bits (*g_bn_limit_bits_addr())
+extern int *g_bn_limit_num_addr();
+#define bn_limit_num (*g_bn_limit_num_addr())
+extern int *g_bn_limit_bits_low_addr();
+#define bn_limit_bits_low (*g_bn_limit_bits_low_addr())
+extern int *g_bn_limit_num_low_addr();
+#define bn_limit_num_low (*g_bn_limit_num_low_addr())
+extern int *g_bn_limit_bits_high_addr();
+#define bn_limit_bits_high (*g_bn_limit_bits_high_addr())
+extern int *g_bn_limit_num_high_addr();
+#define bn_limit_num_high (*g_bn_limit_num_high_addr())
+extern int *g_bn_limit_bits_mont_addr();
+#define bn_limit_bits_mont (*g_bn_limit_bits_mont_addr())
+extern int *g_bn_limit_num_mont_addr();
+#define bn_limit_num_mont (*g_bn_limit_num_mont_addr())
+#else
 static int bn_limit_bits=0;
 static int bn_limit_num=8;        /* (1<<bn_limit_bits) */
 static int bn_limit_bits_low=0;
@@ -88,6 +112,7 @@
 static int bn_limit_num_high=8;   /* (1<<bn_limit_bits_high) */
 static int bn_limit_bits_mont=0;
 static int bn_limit_num_mont=8;   /* (1<<bn_limit_bits_mont) */
+#endif
 
 void BN_set_params(int mult, int high, int low, int mont)
 	{
@@ -131,12 +156,18 @@
 	}
 #endif
 
+static const BN_ULONG data_one=1L;
+OPENSSL_PREFIX_CONST_ITEM(static, BIGNUM, const_one, libopeay)
+	CONST_ITEM_ENTRY_START(d, (BN_ULONG *) &data_one)
+	CONST_ITEM_ENTRY_SINGLE(top,1)
+	CONST_ITEM_ENTRY_SINGLE(dmax,1)
+	CONST_ITEM_ENTRY_SINGLE(neg,0)
+	CONST_ITEM_ENTRY_SINGLE(flags,BN_FLG_STATIC_DATA)
+	CONST_ITEM_ENTRY_END;
+
 const BIGNUM *BN_value_one(void)
 	{
-	static const BN_ULONG data_one=1L;
-	static const BIGNUM const_one={(BN_ULONG *)&data_one,1,1,0,BN_FLG_STATIC_DATA};
-
-	return(&const_one);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(const_one));
 	}
 
 char *BN_options(void)
@@ -291,7 +322,7 @@
 
 void BN_init(BIGNUM *a)
 	{
-	memset(a,0,sizeof(BIGNUM));
+	op_memset(a,0,sizeof(BIGNUM));
 	bn_check_top(a);
 	}
 
@@ -381,8 +412,8 @@
 		}
 
 #else
-	memset(A,0,sizeof(BN_ULONG)*words);
-	memcpy(A,b->d,sizeof(b->d[0])*b->top);
+	op_memset(A,0,sizeof(BN_ULONG)*words);
+	op_memcpy(A,b->d,sizeof(b->d[0])*b->top);
 #endif
 		
 	return(a);
@@ -399,6 +430,7 @@
  * while bn_dup_expand() makes sure allocation is made only once.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #ifndef OPENSSL_NO_DEPRECATED
 BIGNUM *bn_dup_expand(const BIGNUM *b, int words)
 	{
@@ -444,6 +476,7 @@
 	return r;
 	}
 #endif
+#endif
 
 /* This is an internal function that should not be used in applications.
  * It ensures that 'b' has enough room for a 'words' word number
@@ -531,7 +564,7 @@
 		case 0: ; /* ultrix cc workaround, see comments in bn_expand_internal */
 		}
 #else
-	memcpy(a->d,b->d,sizeof(b->d[0])*b->top);
+	op_memcpy(a->d,b->d,sizeof(b->d[0])*b->top);
 #endif
 
 	a->top=b->top;
@@ -540,6 +573,7 @@
 	return(a);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 void BN_swap(BIGNUM *a, BIGNUM *b)
 	{
 	int flags_old_a, flags_old_b;
@@ -572,16 +606,18 @@
 	bn_check_top(a);
 	bn_check_top(b);
 	}
+#endif
 
 void BN_clear(BIGNUM *a)
 	{
 	bn_check_top(a);
 	if (a->d != NULL)
-		memset(a->d,0,a->dmax*sizeof(a->d[0]));
+		op_memset(a->d,0,a->dmax*sizeof(a->d[0]));
 	a->top=0;
 	a->neg=0;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 BN_ULONG BN_get_word(const BIGNUM *a)
 	{
 	if (a->top > 1)
@@ -591,6 +627,7 @@
 	/* a->top == 0 */
 	return 0;
 	}
+#endif
 
 int BN_set_word(BIGNUM *a, BN_ULONG w)
 	{
@@ -747,6 +784,7 @@
 	return(1);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int BN_clear_bit(BIGNUM *a, int n)
 	{
 	int i,j;
@@ -762,6 +800,7 @@
 	bn_correct_top(a);
 	return(1);
 	}
+#endif
 
 int BN_is_bit_set(const BIGNUM *a, int n)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_mod.c openssl-1.0.0q/crypto/bn/bn_mod.c
--- openssl-1.0.0q.orig/crypto/bn/bn_mod.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_mod.c	2017-04-25 16:23:40.077527727 +0200
@@ -111,7 +111,7 @@
  * [including the GNU Public Licence.]
  */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 
@@ -138,6 +138,7 @@
 }
 
 
+#ifndef OPERA_SMALL_VERSION
 int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx)
 	{
 	if (!BN_add(r, a, b)) return 0;
@@ -172,6 +173,7 @@
 		return BN_add(r, r, m);
 	return 1;
 	}
+#endif
 
 
 /* slow but works */
@@ -200,6 +202,7 @@
 	}
 
 
+#ifndef OPERA_SMALL_VERSION
 int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
 	{
 	if (!BN_sqr(r, a, ctx)) return 0;
@@ -299,3 +302,4 @@
 	
 	return 1;
 	}
+#endif /* #ifndef OPERA_SMALL_VERSION */
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_mont.c openssl-1.0.0q/crypto/bn/bn_mont.c
--- openssl-1.0.0q.orig/crypto/bn/bn_mont.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_mont.c	2017-04-25 16:23:40.078527296 +0200
@@ -116,8 +116,10 @@
  * sections 3.8 and 4.2 in http://security.ece.orst.edu/koc/papers/r01rsasw.pdf
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 #define MONT_WORD /* use the faster word-based algorithm */
@@ -201,7 +203,7 @@
 	for (i=r->top; i<max; i++) /* memset? XXX */
 		r->d[i]=0;
 #else
-	memset(&(r->d[r->top]),0,(max-r->top)*sizeof(BN_ULONG)); 
+	op_memset(&(r->d[r->top]),0,(max-r->top)*sizeof(BN_ULONG)); 
 #endif
 
 	r->top=max;
@@ -520,6 +522,7 @@
 	return ret;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from)
 	{
 	if (to == from) return(to);
@@ -532,6 +535,7 @@
 	to->n0[1]=from->n0[1];
 	return(to);
 	}
+#endif
 
 BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
 					const BIGNUM *mod, BN_CTX *ctx)
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_mpi.c openssl-1.0.0q/crypto/bn/bn_mpi.c
--- openssl-1.0.0q.orig/crypto/bn/bn_mpi.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_mpi.c	2017-04-25 16:23:40.079527982 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include "bn_lcl.h"
 
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_mul.c openssl-1.0.0q/crypto/bn/bn_mul.c
--- openssl-1.0.0q.orig/crypto/bn/bn_mul.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_mul.c	2017-04-25 16:23:40.080526432 +0200
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #ifndef BN_DEBUG
 # undef NDEBUG /* avoid conflicting definitions */
 # define NDEBUG
@@ -63,8 +64,9 @@
 
 #include <stdio.h>
 #include <assert.h>
-#include "cryptlib.h"
-#include "bn_lcl.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#include "modules/libopeay/crypto/bn/bn_lcl.h"
 
 #if defined(OPENSSL_NO_ASM) || !defined(OPENSSL_BN_ASM_PART_WORDS)
 /* Here follows specialised variants of bn_add_words() and
@@ -204,6 +206,7 @@
 	}
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 BN_ULONG bn_add_part_words(BN_ULONG *r,
 	const BN_ULONG *a, const BN_ULONG *b,
 	int cl, int dl)
@@ -374,6 +377,7 @@
 		}
 	return c;
 	}
+#endif
 
 #ifdef BN_RECURSION
 /* Karatsuba recursive multiplication algorithm
@@ -423,7 +427,7 @@
 		{
 		bn_mul_normal(r,a,n2+dna,b,n2+dnb);
 		if ((dna + dnb) < 0)
-			memset(&r[2*n2 + dna + dnb], 0,
+			op_memset(&r[2*n2 + dna + dnb], 0,
 				sizeof(BN_ULONG) * -(dna + dnb));
 		return;
 		}
@@ -471,7 +475,7 @@
 		if (!zero)
 			bn_mul_comba4(&(t[n2]),t,&(t[n]));
 		else
-			memset(&(t[n2]),0,8*sizeof(BN_ULONG));
+			op_memset(&(t[n2]),0,8*sizeof(BN_ULONG));
 		
 		bn_mul_comba4(r,a,b);
 		bn_mul_comba4(&(r[n2]),&(a[n]),&(b[n]));
@@ -483,7 +487,7 @@
 		if (!zero)
 			bn_mul_comba8(&(t[n2]),t,&(t[n]));
 		else
-			memset(&(t[n2]),0,16*sizeof(BN_ULONG));
+			op_memset(&(t[n2]),0,16*sizeof(BN_ULONG));
 		
 		bn_mul_comba8(r,a,b);
 		bn_mul_comba8(&(r[n2]),&(a[n]),&(b[n]));
@@ -495,7 +499,7 @@
 		if (!zero)
 			bn_mul_recursive(&(t[n2]),t,&(t[n]),n,0,0,p);
 		else
-			memset(&(t[n2]),0,n2*sizeof(BN_ULONG));
+			op_memset(&(t[n2]),0,n2*sizeof(BN_ULONG));
 		bn_mul_recursive(r,a,b,n,0,0,p);
 		bn_mul_recursive(&(r[n2]),&(a[n]),&(b[n]),n,dna,dnb,p);
 		}
@@ -605,7 +609,7 @@
 		bn_mul_comba4(&(t[n2]),t,&(t[n]));
 		bn_mul_comba4(r,a,b);
 		bn_mul_normal(&(r[n2]),&(a[n]),tn,&(b[n]),tn);
-		memset(&(r[n2+tn*2]),0,sizeof(BN_ULONG)*(n2-tn*2));
+		op_memset(&(r[n2+tn*2]),0,sizeof(BN_ULONG)*(n2-tn*2));
 		}
 	else
 # endif
@@ -614,7 +618,7 @@
 		bn_mul_comba8(&(t[n2]),t,&(t[n]));
 		bn_mul_comba8(r,a,b);
 		bn_mul_normal(&(r[n2]),&(a[n]),tna,&(b[n]),tnb);
-		memset(&(r[n2+tna+tnb]),0,sizeof(BN_ULONG)*(n2-tna-tnb));
+		op_memset(&(r[n2+tna+tnb]),0,sizeof(BN_ULONG)*(n2-tna-tnb));
 		}
 	else
 		{
@@ -632,18 +636,18 @@
 			{
 			bn_mul_recursive(&(r[n2]),&(a[n]),&(b[n]),
 				i,tna-i,tnb-i,p);
-			memset(&(r[n2+i*2]),0,sizeof(BN_ULONG)*(n2-i*2));
+			op_memset(&(r[n2+i*2]),0,sizeof(BN_ULONG)*(n2-i*2));
 			}
 		else if (j > 0) /* eg, n == 16, i == 8 and tn == 11 */
 				{
 				bn_mul_part_recursive(&(r[n2]),&(a[n]),&(b[n]),
 					i,tna-i,tnb-i,p);
-				memset(&(r[n2+tna+tnb]),0,
+				op_memset(&(r[n2+tna+tnb]),0,
 					sizeof(BN_ULONG)*(n2-tna-tnb));
 				}
 		else /* (j < 0) eg, n == 16, i == 8 and tn == 5 */
 			{
-			memset(&(r[n2]),0,sizeof(BN_ULONG)*n2);
+			op_memset(&(r[n2]),0,sizeof(BN_ULONG)*n2);
 			if (tna < BN_MUL_RECURSIVE_SIZE_NORMAL
 				&& tnb < BN_MUL_RECURSIVE_SIZE_NORMAL)
 				{
@@ -720,6 +724,7 @@
 		}
 	}
 
+#ifndef OPERA_SMALL_VERSION
 /* a and b must be the same size, which is n2.
  * r needs to be n2 words and t needs to be n2*2
  */
@@ -748,12 +753,14 @@
 		bn_add_words(&(r[n]),&(r[n]),&(t[n]),n);
 		}
 	}
+#endif
 
 /* a and b must be the same size, which is n2.
  * r needs to be n2 words and t needs to be n2*2
  * l is the low words of the output.
  * t needs to be n2*3
  */
+#ifndef OPERA_SMALL_VERSION
 void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
 	     BN_ULONG *t)
 	{
@@ -938,6 +945,7 @@
 			}
 		}
 	}
+#endif /* #ifndef OPERA_SMALL_VERSION */
 #endif /* BN_RECURSION */
 
 int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
@@ -1143,6 +1151,7 @@
 		}
 	}
 
+#ifndef OPERA_SMALL_VERSION
 void bn_mul_low_normal(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
 	{
 #ifdef BN_COUNT
@@ -1164,3 +1173,4 @@
 		b+=4;
 		}
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_prime.c openssl-1.0.0q/crypto/bn/bn_prime.c
--- openssl-1.0.0q.orig/crypto/bn/bn_prime.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_prime.c	2017-04-25 16:23:40.081527118 +0200
@@ -109,9 +109,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 #include <openssl/rand.h>
 
@@ -235,10 +237,12 @@
 	return found;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, BN_GENCB *cb)
 	{
 	return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
 	}
+#endif
 
 int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
 		int do_trial_division, BN_GENCB *cb)
@@ -276,7 +280,7 @@
 			goto err;
 	BN_CTX_start(ctx);
 
-	/* A := abs(a) */
+	/* A := op_abs(a) */
 	if (a->neg)
 		{
 		BIGNUM *t;
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_print.c openssl-1.0.0q/crypto/bn/bn_print.c
--- openssl-1.0.0q.orig/crypto/bn/bn_print.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_print.c	2017-04-25 16:23:40.082527525 +0200
@@ -56,13 +56,16 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include "bn_lcl.h"
 
-static const char Hex[]="0123456789ABCDEF";
+#ifndef OPERA_SMALL_VERSION
+static const char Hex[]="0123456789ABCDEF";/* ARRAY OK 2007-02-27 haavardm */
 
 /* Must 'OPENSSL_free' the returned data */
 char *BN_bn2hex(const BIGNUM *a)
@@ -98,6 +101,7 @@
 err:
 	return(buf);
 	}
+#endif //OPERA_SMALL_VERSION
 
 /* Must 'OPENSSL_free' the returned data */
 char *BN_bn2dec(const BIGNUM *a)
@@ -180,7 +184,7 @@
 
 	if (*a == '-') { neg=1; a++; }
 
-	for (i=0; isxdigit((unsigned char) a[i]); i++)
+	for (i=0; op_isxdigit((unsigned char) a[i]); i++)
 		;
 
 	num=i+neg;
@@ -246,7 +250,7 @@
 	if ((a == NULL) || (*a == '\0')) return(0);
 	if (*a == '-') { neg=1; a++; }
 
-	for (i=0; isdigit((unsigned char) a[i]); i++)
+	for (i=0; op_isdigit((unsigned char) a[i]); i++)
 		;
 
 	num=i+neg;
@@ -331,6 +335,7 @@
 	}
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 int BN_print(BIO *bp, const BIGNUM *a)
 	{
 	int i,j,v,z=0;
@@ -357,3 +362,4 @@
 	return(ret);
 	}
 #endif
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_rand.c openssl-1.0.0q/crypto/bn/bn_rand.c
--- openssl-1.0.0q.orig/crypto/bn/bn_rand.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_rand.c	2017-04-25 16:23:40.083527093 +0200
@@ -109,9 +109,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 #include <openssl/rand.h>
 
@@ -138,22 +140,30 @@
 		goto err;
 		}
 
+#ifdef VALGRIND
+	op_memset(&tim,0,sizeof(tim));
+	op_memset(buf,0,bytes);
+#endif
+
 	/* make a random number and set the top and bottom bits */
-	time(&tim);
+	op_time(&tim);
 	RAND_add(&tim,sizeof(tim),0.0);
 
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
 	if (pseudorand)
 		{
 		if (RAND_pseudo_bytes(buf, bytes) == -1)
 			goto err;
 		}
 	else
+#endif
 		{
 		if (RAND_bytes(buf, bytes) <= 0)
 			goto err;
 		}
 
 #if 1
+#ifndef OPERA_SMALL_VERSION
 	if (pseudorand == 2)
 		{
 		/* generate patterns that are more likely to trigger BN
@@ -173,6 +183,7 @@
 			}
 		}
 #endif
+#endif
 
 	if (top != -1)
 		{
@@ -213,23 +224,29 @@
 	return bnrand(0, rnd, bits, top, bottom);
 	}
 
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
 int     BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom)
 	{
 	return bnrand(1, rnd, bits, top, bottom);
 	}
+#endif
 
 #if 1
+#ifndef OPERA_SMALL_VERSION
 int     BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
 	{
 	return bnrand(2, rnd, bits, top, bottom);
 	}
 #endif
+#endif
 
 
 /* random number r:  0 <= r < range */
 static int bn_rand_range(int pseudo, BIGNUM *r, const BIGNUM *range)
 	{
-	int (*bn_rand)(BIGNUM *, int, int, int) = pseudo ? BN_pseudo_rand : BN_rand;
+	/* Although the handling of pseudo to chose between BN_rand and
+	 * BN_pseudo_rand could more cleanly be done via a function pointer, doing
+	 * so crashes the ADS1.2 compiler used by BREW; see bug 329079 :-( */
 	int n;
 	int count = 100;
 
@@ -251,7 +268,14 @@
 		 * so  3*range (= 11..._2)  is exactly one bit longer than  range */
 		do
 			{
-			if (!bn_rand(r, n + 1, -1, 0)) return 0;
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
+			if (pseudo)
+			    {
+			    if (!BN_pseudo_rand(r, n + 1, -1, 0)) return 0;
+			    }
+			else
+#endif
+			if (!BN_rand(r, n + 1, -1, 0)) return 0;
 			/* If  r < 3*range,  use  r := r MOD range
 			 * (which is either  r, r - range,  or  r - 2*range).
 			 * Otherwise, iterate once more.
@@ -278,7 +302,14 @@
 		do
 			{
 			/* range = 11..._2  or  range = 101..._2 */
-			if (!bn_rand(r, n, -1, 0)) return 0;
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
+			if (pseudo)
+			    {
+				if (!BN_pseudo_rand(r, n, -1, 0)) return 0;
+			    }
+			else
+#endif
+			if (!BN_rand(r, n, -1, 0)) return 0;
 
 			if (!--count)
 				{
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_recp.c openssl-1.0.0q/crypto/bn/bn_recp.c
--- openssl-1.0.0q.orig/crypto/bn/bn_recp.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_recp.c	2017-04-25 16:23:40.084527220 +0200
@@ -56,8 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#if !defined OPERA_SMALL_VERSION || defined LIBOPEAY_PKCS12_SUPPORT || defined(NEED_LIBOPEAY_ELGAMAL)
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 void BN_RECP_CTX_init(BN_RECP_CTX *recp)
@@ -68,6 +71,7 @@
 	recp->flags=0;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 BN_RECP_CTX *BN_RECP_CTX_new(void)
 	{
 	BN_RECP_CTX *ret;
@@ -79,6 +83,7 @@
 	ret->flags=BN_FLG_MALLOCED;
 	return(ret);
 	}
+#endif
 
 void BN_RECP_CTX_free(BN_RECP_CTX *recp)
 	{
@@ -232,3 +237,4 @@
 	BN_CTX_end(ctx);
 	return(ret);
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_shift.c openssl-1.0.0q/crypto/bn/bn_shift.c
--- openssl-1.0.0q.orig/crypto/bn/bn_shift.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_shift.c	2017-04-25 16:23:40.085527068 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 int BN_lshift1(BIGNUM *r, const BIGNUM *a)
@@ -156,7 +158,7 @@
 			t[nw+i+1]|=(l>>rb)&BN_MASK2;
 			t[nw+i]=(l<<lb)&BN_MASK2;
 			}
-	memset(t,0,nw*sizeof(t[0]));
+	op_memset(t,0,nw*sizeof(t[0]));
 /*	for (i=0; i<nw; i++)
 		t[i]=0;*/
 	r->top=a->top+nw+1;
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_sqr.c openssl-1.0.0q/crypto/bn/bn_sqr.c
--- openssl-1.0.0q.orig/crypto/bn/bn_sqr.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_sqr.c	2017-04-25 16:23:40.086527195 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 /* r must not be a */
@@ -252,7 +254,7 @@
 	if (!zero)
 		bn_sqr_recursive(&(t[n2]),t,n,p);
 	else
-		memset(&(t[n2]),0,n2*sizeof(BN_ULONG));
+		op_memset(&(t[n2]),0,n2*sizeof(BN_ULONG));
 	bn_sqr_recursive(r,a,n,p);
 	bn_sqr_recursive(&(r[n2]),&(a[n]),n,p);
 
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_sqrt.c openssl-1.0.0q/crypto/bn/bn_sqrt.c
--- openssl-1.0.0q.orig/crypto/bn/bn_sqrt.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_sqrt.c	2017-04-25 16:23:40.086527195 +0200
@@ -83,8 +83,7 @@
 				goto end;
 			if (!BN_set_word(ret, BN_is_bit_set(a, 0)))
 				{
-				if (ret != in)
-					BN_free(ret);
+				BN_free(ret);
 				return NULL;
 				}
 			bn_check_top(ret);
@@ -103,8 +102,7 @@
 			goto end;
 		if (!BN_set_word(ret, BN_is_one(a)))
 			{
-			if (ret != in)
-				BN_free(ret);
+			BN_free(ret);
 			return NULL;
 			}
 		bn_check_top(ret);
diff -Naur openssl-1.0.0q.orig/crypto/bn/bn_word.c openssl-1.0.0q/crypto/bn/bn_word.c
--- openssl-1.0.0q.orig/crypto/bn/bn_word.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bn_word.c	2017-04-25 16:23:40.087527043 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "bn_lcl.h"
 
 BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w)
diff -Naur openssl-1.0.0q.orig/crypto/bn/bnspeed.c openssl-1.0.0q/crypto/bn/bnspeed.c
--- openssl-1.0.0q.orig/crypto/bn/bnspeed.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bnspeed.c	2017-04-25 16:23:40.088527449 +0200
@@ -64,10 +64,14 @@
 #undef PROG
 #define PROG bnspeed_main
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <signal.h>
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/crypto.h>
 #include <openssl/err.h>
 
@@ -76,10 +80,14 @@
 #endif
 
 #ifndef _IRIX
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef TIMES
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/times.h>
 #endif
 
@@ -97,7 +105,9 @@
 
 #if defined(sun) || defined(__ultrix)
 #define _POSIX_SOURCE
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/param.h>
 #endif
 
diff -Naur openssl-1.0.0q.orig/crypto/bn/bntest.c openssl-1.0.0q/crypto/bn/bntest.c
--- openssl-1.0.0q.orig/crypto/bn/bntest.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/bntest.c	2017-04-25 16:23:40.089526459 +0200
@@ -75,9 +75,11 @@
 #undef OPENSSL_NO_DEPRECATED
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "e_os.h"
 
@@ -149,9 +151,9 @@
 	argv++;
 	while (argc >= 1)
 		{
-		if (strcmp(*argv,"-results") == 0)
+		if (op_strcmp(*argv,"-results") == 0)
 			results=1;
-		else if (strcmp(*argv,"-out") == 0)
+		else if (op_strcmp(*argv,"-out") == 0)
 			{
 			if (--argc < 1) break;
 			outfile= *(++argv);
diff -Naur openssl-1.0.0q.orig/crypto/bn/exp.c openssl-1.0.0q/crypto/bn/exp.c
--- openssl-1.0.0q.orig/crypto/bn/exp.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/exp.c	2017-04-25 16:23:40.090526307 +0200
@@ -1,6 +1,8 @@
 /* unused */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/tmdiff.h>
 #include "bn_lcl.h"
 
diff -Naur openssl-1.0.0q.orig/crypto/bn/expspeed.c openssl-1.0.0q/crypto/bn/expspeed.c
--- openssl-1.0.0q.orig/crypto/bn/expspeed.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/expspeed.c	2017-04-25 16:23:40.091526434 +0200
@@ -89,10 +89,14 @@
 #undef PROG
 #define PROG bnspeed_main
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <signal.h>
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/crypto.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
@@ -102,10 +106,14 @@
 #endif
 
 #ifndef _IRIX
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef TIMES
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/times.h>
 #endif
 
@@ -123,7 +131,9 @@
 
 #if defined(sun) || defined(__ultrix)
 #define _POSIX_SOURCE
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/param.h>
 #endif
 
diff -Naur openssl-1.0.0q.orig/crypto/bn/exptest.c openssl-1.0.0q/crypto/bn/exptest.c
--- openssl-1.0.0q.orig/crypto/bn/exptest.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/exptest.c	2017-04-25 16:23:40.092526002 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_add.cpp openssl-1.0.0q/crypto/bn/opera_bn_add.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_add.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_add.cpp	2017-04-25 16:23:40.092526002 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_add.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_asm.cpp openssl-1.0.0q/crypto/bn/opera_bn_asm.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_asm.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_asm.cpp	2017-04-25 16:23:40.093527247 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_asm.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_blind.cpp openssl-1.0.0q/crypto/bn/opera_bn_blind.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_blind.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_blind.cpp	2017-04-25 16:23:40.094527095 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+extern "C" {
+#include "bn_blind.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_ctx.cpp openssl-1.0.0q/crypto/bn/opera_bn_ctx.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_ctx.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_ctx.cpp	2017-04-25 16:23:40.094527095 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_ctx.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_div.cpp openssl-1.0.0q/crypto/bn/opera_bn_div.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_div.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_div.cpp	2017-04-25 16:23:40.095526942 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_div.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_exp.cpp openssl-1.0.0q/crypto/bn/opera_bn_exp.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_exp.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_exp.cpp	2017-04-25 16:23:40.096527349 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_exp.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_exp2.cpp openssl-1.0.0q/crypto/bn/opera_bn_exp2.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_exp2.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_exp2.cpp	2017-04-25 16:23:40.096527349 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_exp2.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_gcd.cpp openssl-1.0.0q/crypto/bn/opera_bn_gcd.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_gcd.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_gcd.cpp	2017-04-25 16:23:40.098527044 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_gcd.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_lib.cpp openssl-1.0.0q/crypto/bn/opera_bn_lib.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_lib.cpp	2017-04-25 16:23:40.099527171 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_mod.cpp openssl-1.0.0q/crypto/bn/opera_bn_mod.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_mod.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_mod.cpp	2017-04-25 16:23:40.099527171 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_mod.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_mont.cpp openssl-1.0.0q/crypto/bn/opera_bn_mont.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_mont.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_mont.cpp	2017-04-25 16:23:40.100527298 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_mont.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_mul.cpp openssl-1.0.0q/crypto/bn/opera_bn_mul.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_mul.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_mul.cpp	2017-04-25 16:23:40.100527298 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_mul.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_prime.cpp openssl-1.0.0q/crypto/bn/opera_bn_prime.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_prime.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_prime.cpp	2017-04-25 16:23:40.101527146 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_prime.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_print.cpp openssl-1.0.0q/crypto/bn/opera_bn_print.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_print.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_print.cpp	2017-04-25 16:23:40.102527273 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_print.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_rand.cpp openssl-1.0.0q/crypto/bn/opera_bn_rand.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_rand.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_rand.cpp	2017-04-25 16:23:40.102527273 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_rand.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_recp.cpp openssl-1.0.0q/crypto/bn/opera_bn_recp.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_recp.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_recp.cpp	2017-04-25 16:23:40.103527400 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_recp.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_shift.cpp openssl-1.0.0q/crypto/bn/opera_bn_shift.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_shift.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_shift.cpp	2017-04-25 16:23:40.103527400 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_shift.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_sqr.cpp openssl-1.0.0q/crypto/bn/opera_bn_sqr.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_sqr.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_sqr.cpp	2017-04-25 16:23:40.104527248 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_sqr.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/opera_bn_word.cpp openssl-1.0.0q/crypto/bn/opera_bn_word.cpp
--- openssl-1.0.0q.orig/crypto/bn/opera_bn_word.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/opera_bn_word.cpp	2017-04-25 16:23:40.104527248 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/bn/bn_word.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/bn/vms-helper.c openssl-1.0.0q/crypto/bn/vms-helper.c
--- openssl-1.0.0q.orig/crypto/bn/vms-helper.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/bn/vms-helper.c	2017-04-25 16:23:40.105527375 +0200
@@ -53,7 +53,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include "bn_lcl.h"
 
diff -Naur openssl-1.0.0q.orig/crypto/buffer/.gitignore openssl-1.0.0q/crypto/buffer/.gitignore
--- openssl-1.0.0q.orig/crypto/buffer/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/buffer/.gitignore	2017-04-25 16:23:40.106526944 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/buffer/buf_err.c openssl-1.0.0q/crypto/buffer/buf_err.c
--- openssl-1.0.0q.orig/crypto/buffer/buf_err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/buffer/buf_err.c	2017-04-25 16:23:40.106526944 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/buffer.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/buffer/buffer.c openssl-1.0.0q/crypto/buffer/buffer.c
--- openssl-1.0.0q.orig/crypto/buffer/buffer.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/buffer/buffer.c	2017-04-25 16:23:40.107527071 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 
@@ -69,7 +71,7 @@
 	{
 	BUF_MEM *ret;
 
-	ret=OPENSSL_malloc(sizeof(BUF_MEM));
+	ret= (BUF_MEM *) OPENSSL_malloc(sizeof(BUF_MEM));
 	if (ret == NULL)
 		{
 		BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);
@@ -88,7 +90,7 @@
 
 	if (a->data != NULL)
 		{
-		memset(a->data,0,(unsigned int)a->max);
+		op_memset(a->data,0,(unsigned int)a->max);
 		OPENSSL_free(a->data);
 		}
 	OPENSSL_free(a);
@@ -106,7 +108,7 @@
 		}
 	if (str->max >= len)
 		{
-		memset(&str->data[str->length],0,len-str->length);
+		op_memset(&str->data[str->length],0,len-str->length);
 		str->length=len;
 		return(len);
 		}
@@ -118,9 +120,9 @@
 		}
 	n=(len+3)/3*4;
 	if (str->data == NULL)
-		ret=OPENSSL_malloc(n);
+		ret=(char *) OPENSSL_malloc(n);
 	else
-		ret=OPENSSL_realloc(str->data,n);
+		ret=(char *) OPENSSL_realloc(str->data,n);
 	if (ret == NULL)
 		{
 		BUFerr(BUF_F_BUF_MEM_GROW,ERR_R_MALLOC_FAILURE);
@@ -130,7 +132,7 @@
 		{
 		str->data=ret;
 		str->max=n;
-		memset(&str->data[str->length],0,len-str->length);
+		op_memset(&str->data[str->length],0,len-str->length);
 		str->length=len;
 		}
 	return(len);
@@ -143,13 +145,13 @@
 
 	if (str->length >= len)
 		{
-		memset(&str->data[len],0,str->length-len);
+		op_memset(&str->data[len],0,str->length-len);
 		str->length=len;
 		return(len);
 		}
 	if (str->max >= len)
 		{
-		memset(&str->data[str->length],0,len-str->length);
+		op_memset(&str->data[str->length],0,len-str->length);
 		str->length=len;
 		return(len);
 		}
@@ -161,9 +163,9 @@
 		}
 	n=(len+3)/3*4;
 	if (str->data == NULL)
-		ret=OPENSSL_malloc(n);
+		ret=(char *) OPENSSL_malloc(n);
 	else
-		ret=OPENSSL_realloc_clean(str->data,str->max,n);
+		ret=(char *) OPENSSL_realloc_clean(str->data,str->max,n);
 	if (ret == NULL)
 		{
 		BUFerr(BUF_F_BUF_MEM_GROW_CLEAN,ERR_R_MALLOC_FAILURE);
@@ -173,7 +175,7 @@
 		{
 		str->data=ret;
 		str->max=n;
-		memset(&str->data[str->length],0,len-str->length);
+		op_memset(&str->data[str->length],0,len-str->length);
 		str->length=len;
 		}
 	return(len);
@@ -182,7 +184,7 @@
 char *BUF_strdup(const char *str)
 	{
 	if (str == NULL) return(NULL);
-	return BUF_strndup(str, strlen(str));
+	return BUF_strndup(str, op_strlen(str));
 	}
 
 char *BUF_strndup(const char *str, size_t siz)
@@ -191,7 +193,7 @@
 
 	if (str == NULL) return(NULL);
 
-	ret=OPENSSL_malloc(siz+1);
+	ret=(char *) OPENSSL_malloc(siz+1);
 	if (ret == NULL) 
 		{
 		BUFerr(BUF_F_BUF_STRNDUP,ERR_R_MALLOC_FAILURE);
@@ -226,7 +228,7 @@
 		}
 	if (size)
 		*dst = '\0';
-	return l + strlen(src);
+	return l + op_strlen(src);
 	}
 
 size_t BUF_strlcat(char *dst, const char *src, size_t size)
diff -Naur openssl-1.0.0q.orig/crypto/buffer/buffer.h openssl-1.0.0q/crypto/buffer/buffer.h
--- openssl-1.0.0q.orig/crypto/buffer/buffer.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/buffer/buffer.h	2017-04-25 16:23:40.113526995 +0200
@@ -65,11 +65,13 @@
 extern "C" {
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>
 
 #if !defined(NO_SYS_TYPES_H)
 #include <sys/types.h>
 #endif
+#endif /* !OPERA_SMALL_VERSION */
 
 /* Already declared in ossl_typ.h */
 /* typedef struct buf_mem_st BUF_MEM; */
diff -Naur openssl-1.0.0q.orig/crypto/buffer/opera_buffer.cpp openssl-1.0.0q/crypto/buffer/opera_buffer.cpp
--- openssl-1.0.0q.orig/crypto/buffer/opera_buffer.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/buffer/opera_buffer.cpp	2017-04-25 16:23:40.114527402 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/buffer/buffer.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/camellia/.gitignore openssl-1.0.0q/crypto/camellia/.gitignore
--- openssl-1.0.0q.orig/crypto/camellia/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/camellia/.gitignore	2017-04-25 16:23:40.115526970 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/cast/.gitignore openssl-1.0.0q/crypto/cast/.gitignore
--- openssl-1.0.0q.orig/crypto/cast/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/.gitignore	2017-04-25 16:23:40.115526970 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/cast/c_cfb64.c openssl-1.0.0q/crypto/cast/c_cfb64.c
--- openssl-1.0.0q.orig/crypto/cast/c_cfb64.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/c_cfb64.c	2017-04-25 16:23:40.116526818 +0200
@@ -56,6 +56,8 @@
  * [including the GNU Public Licence.]
  */
 
+#if !defined OPENSSL_NO_CAST && defined OPENSSL_USE_CFB_CIPHERS
+
 #include <openssl/cast.h>
 #include "cast_lcl.h"
 
@@ -119,3 +121,4 @@
 	v0=v1=ti[0]=ti[1]=t=c=cc=0;
 	*num=n;
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/cast/c_enc.c openssl-1.0.0q/crypto/cast/c_enc.c
--- openssl-1.0.0q.orig/crypto/cast/c_enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/c_enc.c	2017-04-25 16:23:40.117526666 +0200
@@ -56,6 +56,8 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPENSSL_NO_CAST
+
 #include <openssl/cast.h>
 #include "cast_lcl.h"
 
@@ -206,3 +208,4 @@
 	tin0=tin1=tout0=tout1=xor0=xor1=0;
 	tin[0]=tin[1]=0;
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/cast/c_skey.c openssl-1.0.0q/crypto/cast/c_skey.c
--- openssl-1.0.0q.orig/crypto/cast/c_skey.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/c_skey.c	2017-04-25 16:23:40.118527072 +0200
@@ -56,6 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPENSSL_NO_CAST
+
+#include <openssl/crypto.h>
 #include <openssl/cast.h>
 #include "cast_lcl.h"
 #include "cast_s.h"
@@ -164,3 +167,4 @@
 		}
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/cast/cast_lcl.h openssl-1.0.0q/crypto/cast/cast_lcl.h
--- openssl-1.0.0q.orig/crypto/cast/cast_lcl.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/cast_lcl.h	2017-04-25 16:23:40.119528037 +0200
@@ -57,10 +57,12 @@
  */
 
 
-#include "e_os.h"
+#include <openssl/e_os.h>
 
 #ifdef OPENSSL_SYS_WIN32
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 
diff -Naur openssl-1.0.0q.orig/crypto/cast/cast_spd.c openssl-1.0.0q/crypto/cast/cast_spd.c
--- openssl-1.0.0q.orig/crypto/cast/cast_spd.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/cast_spd.c	2017-04-25 16:23:40.119528037 +0200
@@ -63,6 +63,7 @@
 #define TIMES
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 
 #include <openssl/e_os2.h>
@@ -98,6 +99,7 @@
 #include <limits.h>
 #include <sys/param.h>
 #endif
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/cast.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/cast/castopts.c openssl-1.0.0q/crypto/cast/castopts.c
--- openssl-1.0.0q.orig/crypto/cast/castopts.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/castopts.c	2017-04-25 16:23:40.120526488 +0200
@@ -63,6 +63,7 @@
 #define TIMES
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 
 #include <openssl/e_os2.h>
@@ -98,6 +99,7 @@
 #include <limits.h>
 #include <sys/param.h>
 #endif
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/cast.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/cast/casts.cpp openssl-1.0.0q/crypto/cast/casts.cpp
--- openssl-1.0.0q.orig/crypto/cast/casts.cpp	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/casts.cpp	2017-04-25 16:23:40.121526895 +0200
@@ -30,8 +30,10 @@
 }
 #endif      
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif // !OPERA_SMALL_VERSION
 #include <openssl/cast.h>
 
 void main(int argc,char *argv[])
diff -Naur openssl-1.0.0q.orig/crypto/cast/casttest.c openssl-1.0.0q/crypto/cast/casttest.c
--- openssl-1.0.0q.orig/crypto/cast/casttest.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/casttest.c	2017-04-25 16:23:40.122526463 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/opensslconf.h> /* To see if OPENSSL_NO_CAST is defined */
 
 #include "../e_os.h"
@@ -145,7 +147,7 @@
 	CAST_set_key(&key,k_len[z],k);
 
 	CAST_ecb_encrypt(in,out,&key,CAST_ENCRYPT);
-	if (memcmp(out,&(c[z][0]),8) != 0)
+	if (op_memcmp(out,&(c[z][0]),8) != 0)
 	    {
 	    printf("ecb cast error encrypting for keysize %d\n",k_len[z]*8);
 	    printf("got     :");
@@ -160,7 +162,7 @@
 	    }
 
 	CAST_ecb_encrypt(out,out,&key,CAST_DECRYPT);
-	if (memcmp(out,in,8) != 0)
+	if (op_memcmp(out,in,8) != 0)
 	    {
 	    printf("ecb cast error decrypting for keysize %d\n",k_len[z]*8);
 	    printf("got     :");
@@ -184,8 +186,8 @@
       
       printf("This test will take some time....");
       fflush(stdout);
-      memcpy(out_a,in_a,sizeof(in_a));
-      memcpy(out_b,in_b,sizeof(in_b));
+      op_memcpy(out_a,in_a,sizeof(in_a));
+      op_memcpy(out_b,in_b,sizeof(in_b));
       i=1;
 
       for (l=0; l<1000000L; l++)
@@ -204,8 +206,8 @@
 	      }
 	  }
 
-      if (	(memcmp(out_a,c_a,sizeof(c_a)) != 0) ||
-		(memcmp(out_b,c_b,sizeof(c_b)) != 0))
+      if (	(op_memcmp(out_a,c_a,sizeof(c_a)) != 0) ||
+		(op_memcmp(out_b,c_b,sizeof(c_b)) != 0))
 	  {
 	  printf("\n");
 	  printf("Error\n");
diff -Naur openssl-1.0.0q.orig/crypto/cast/opera_c_cfb64.cpp openssl-1.0.0q/crypto/cast/opera_c_cfb64.cpp
--- openssl-1.0.0q.orig/crypto/cast/opera_c_cfb64.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/opera_c_cfb64.cpp	2017-04-25 16:23:40.122526463 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/cast/c_cfb64.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/cast/opera_c_enc.cpp openssl-1.0.0q/crypto/cast/opera_c_enc.cpp
--- openssl-1.0.0q.orig/crypto/cast/opera_c_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/opera_c_enc.cpp	2017-04-25 16:23:40.123526590 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/cast/c_enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/cast/opera_c_skey.cpp openssl-1.0.0q/crypto/cast/opera_c_skey.cpp
--- openssl-1.0.0q.orig/crypto/cast/opera_c_skey.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/cast/opera_c_skey.cpp	2017-04-25 16:23:40.123526590 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/cast/c_skey.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/cms/.gitignore openssl-1.0.0q/crypto/cms/.gitignore
--- openssl-1.0.0q.orig/crypto/cms/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/cms/.gitignore	2017-04-25 16:23:40.124526159 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/comp/.gitignore openssl-1.0.0q/crypto/comp/.gitignore
--- openssl-1.0.0q.orig/crypto/comp/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/comp/.gitignore	2017-04-25 16:23:40.124526159 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/comp/c_rle.c openssl-1.0.0q/crypto/comp/c_rle.c
--- openssl-1.0.0q.orig/crypto/comp/c_rle.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/comp/c_rle.c	2017-04-25 16:23:40.125526286 +0200
@@ -1,6 +1,8 @@
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/objects.h>
 #include <openssl/comp.h>
 
@@ -37,7 +39,7 @@
 		}
 
 	*(out++)=0;
-	memcpy(out,in,ilen);
+	op_memcpy(out,in,ilen);
 	return(ilen+1);
 	}
 
@@ -55,7 +57,7 @@
 	i= *(in++);
 	if (i == 0)
 		{
-		memcpy(out,in,ilen-1);
+		op_memcpy(out,in,ilen-1);
 		}
 	return(ilen-1);
 	}
diff -Naur openssl-1.0.0q.orig/crypto/comp/c_zlib.c openssl-1.0.0q/crypto/comp/c_zlib.c
--- openssl-1.0.0q.orig/crypto/comp/c_zlib.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/comp/c_zlib.c	2017-04-25 16:23:40.126526134 +0200
@@ -1,6 +1,8 @@
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/objects.h>
 #include <openssl/comp.h>
 #include <openssl/err.h>
@@ -88,6 +90,7 @@
  * and we do not link to a .LIB file when ZLIB_SHARED is set.
  */
 #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
+#ifndef OPERA_SMALL_VERSION
 # include <windows.h>
 #endif /* !(OPENSSL_SYS_WINDOWS || OPENSSL_SYS_WIN32) */
 
@@ -267,7 +270,7 @@
 	if (clear)
 		{
 		out[0]=0;
-		memcpy(&(out[1]),in,ilen);
+		op_memcpy(&(out[1]),in,ilen);
 		l=ilen+1;
 		}
 #ifdef DEBUG_ZLIB
@@ -292,7 +295,7 @@
 		}
 	else
 		{
-		memcpy(out,&(in[1]),ilen-1);
+		op_memcpy(out,&(in[1]),ilen-1);
 		l=ilen-1;
 		}
 #ifdef DEBUG_ZLIB
diff -Naur openssl-1.0.0q.orig/crypto/comp/comp_err.c openssl-1.0.0q/crypto/comp/comp_err.c
--- openssl-1.0.0q.orig/crypto/comp/comp_err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/comp/comp_err.c	2017-04-25 16:23:40.127526540 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/comp.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/comp/comp_lib.c openssl-1.0.0q/crypto/comp/comp_lib.c
--- openssl-1.0.0q.orig/crypto/comp/comp_lib.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/comp/comp_lib.c	2017-04-25 16:23:40.128527226 +0200
@@ -1,6 +1,8 @@
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/objects.h>
 #include <openssl/comp.h>
 
@@ -13,7 +15,7 @@
 		/* ZZZZZZZZZZZZZZZZ */
 		return(NULL);
 		}
-	memset(ret,0,sizeof(COMP_CTX));
+	op_memset(ret,0,sizeof(COMP_CTX));
 	ret->meth=meth;
 	if ((ret->meth->init != NULL) && !ret->meth->init(ret))
 		{
diff -Naur openssl-1.0.0q.orig/crypto/conf/.gitignore openssl-1.0.0q/crypto/conf/.gitignore
--- openssl-1.0.0q.orig/crypto/conf/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/.gitignore	2017-04-25 16:23:40.128527226 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/conf/cnf_save.c openssl-1.0.0q/crypto/conf/cnf_save.c
--- openssl-1.0.0q.orig/crypto/conf/cnf_save.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/cnf_save.c	2017-04-25 16:23:40.129526515 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/conf.h>
 
 static void print_conf(CONF_VALUE *cv);
diff -Naur openssl-1.0.0q.orig/crypto/conf/conf.h openssl-1.0.0q/crypto/conf/conf.h
--- openssl-1.0.0q.orig/crypto/conf/conf.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/conf.h	2017-04-25 16:23:40.132527176 +0200
@@ -134,7 +134,9 @@
 long CONF_get_number(LHASH_OF(CONF_VALUE) *conf,const char *group,
 		     const char *name);
 void CONF_free(LHASH_OF(CONF_VALUE) *conf);
+#ifndef OPENSSL_NO_FP_API
 int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
+#endif
 int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
 
 void OPENSSL_config(const char *config_name);
@@ -168,7 +170,9 @@
 char *NCONF_get_string(const CONF *conf,const char *group,const char *name);
 int NCONF_get_number_e(const CONF *conf,const char *group,const char *name,
 		       long *result);
+#ifndef OPENSSL_NO_FP_API
 int NCONF_dump_fp(const CONF *conf, FILE *out);
+#endif
 int NCONF_dump_bio(const CONF *conf, BIO *out);
 
 #if 0 /* The following function has no error checking,
diff -Naur openssl-1.0.0q.orig/crypto/conf/conf_api.c openssl-1.0.0q/crypto/conf/conf_api.c
--- openssl-1.0.0q.orig/crypto/conf/conf_api.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/conf_api.c	2017-04-25 16:23:40.133527861 +0200
@@ -63,9 +63,11 @@
 # define NDEBUG
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/conf.h>
 #include <openssl/conf_api.h>
 #include "e_os.h"
@@ -129,7 +131,8 @@
 char *_CONF_get_string(const CONF *conf, const char *section, const char *name)
 	{
 	CONF_VALUE *v,vv;
-	char *p;
+	const char *p;
+
 
 	if (name == NULL) return(NULL);
 	if (conf != NULL)
@@ -140,7 +143,7 @@
 			vv.section=(char *)section;
 			v=lh_CONF_VALUE_retrieve(conf->data,&vv);
 			if (v != NULL) return(v->value);
-			if (strcmp(section,"ENV") == 0)
+			if (op_strcmp(section,"ENV") == 0)
 				{
 				p=getenv(name);
 				if (p != NULL) return(p);
@@ -191,13 +194,13 @@
 
 	if (a->section != b->section)
 		{
-		i=strcmp(a->section,b->section);
+		i=op_strcmp(a->section,b->section);
 		if (i) return(i);
 		}
 
 	if ((a->name != NULL) && (b->name != NULL))
 		{
-		i=strcmp(a->name,b->name);
+		i=op_strcmp(a->name,b->name);
 		return(i);
 		}
 	else if (a->name == b->name)
@@ -278,10 +281,10 @@
 	if ((v=OPENSSL_malloc(sizeof(CONF_VALUE))) == NULL)
 		goto err;
 	i=strlen(section)+1;
-	if ((v->section=OPENSSL_malloc(i)) == NULL)
+	if ((v->section=(char *)OPENSSL_malloc(i)) == NULL)
 		goto err;
 
-	memcpy(v->section,section,i);
+	op_memcpy(v->section,section,i);
 	v->name=NULL;
 	v->value=(char *)sk;
 	
diff -Naur openssl-1.0.0q.orig/crypto/conf/conf_def.c openssl-1.0.0q/crypto/conf/conf_def.c
--- openssl-1.0.0q.orig/crypto/conf/conf_def.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/conf_def.c	2017-04-25 16:23:40.134527150 +0200
@@ -58,11 +58,15 @@
 
 /* Part of the code in here was originally in conf.c, which is now removed */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/stack.h>
-#include <openssl/lhash.h>
 #include <openssl/conf.h>
 #include <openssl/conf_api.h>
 #include "conf_def.h"
@@ -90,7 +94,7 @@
 
 const char CONF_def_version[]="CONF_def" OPENSSL_VERSION_PTEXT;
 
-static CONF_METHOD default_method = {
+static const CONF_METHOD default_method = {
 	"OpenSSL default",
 	def_create,
 	def_init_default,
@@ -103,7 +107,7 @@
 	def_load
 	};
 
-static CONF_METHOD WIN32_method = {
+static const CONF_METHOD WIN32_method = {
 	"WIN32",
 	def_create,
 	def_init_WIN32,
@@ -263,7 +267,7 @@
 		*p='\0';
 		BIO_gets(in, p, CONFBUFSIZE-1);
 		p[CONFBUFSIZE-1]='\0';
-		ii=i=strlen(p);
+		ii=i=op_strlen(p);
 		if (i == 0 && !again) break;
 		again=0;
 		while (i > 0)
@@ -380,7 +384,7 @@
 				goto err;
 				}
 			if (psection == NULL) psection=section;
-			v->name=(char *)OPENSSL_malloc(strlen(pname)+1);
+			v->name=(char *)OPENSSL_malloc(op_strlen(pname)+1);
 			v->value=NULL;
 			if (v->name == NULL)
 				{
@@ -391,7 +395,7 @@
 			BUF_strlcpy(v->name,pname,strlen(pname)+1);
 			if (!str_copy(conf,psection,&(v->value),start)) goto err;
 
-			if (strcmp(psection,section) != 0)
+			if (op_strcmp(psection,section) != 0)
 				{
 				if ((tv=_CONF_get_section(conf,psection))
 					== NULL)
@@ -508,7 +512,7 @@
 
 	if ((buf=BUF_MEM_new()) == NULL) return(0);
 
-	len=strlen(from)+1;
+	len=op_strlen(from)+1;
 	if (!BUF_MEM_grow(buf,len)) goto err;
 
 	for (;;)
@@ -618,7 +622,7 @@
 				CONFerr(CONF_F_STR_COPY,CONF_R_VARIABLE_HAS_NO_VALUE);
 				goto err;
 				}
-			BUF_MEM_grow_clean(buf,(strlen(p)+buf->length-(e-from)));
+			BUF_MEM_grow_clean(buf,(op_strlen(p)+buf->length-(e-from)));
 			while (*p)
 				buf->data[to++]= *(p++);
 
diff -Naur openssl-1.0.0q.orig/crypto/conf/conf_def.h openssl-1.0.0q/crypto/conf/conf_def.h
--- openssl-1.0.0q.orig/crypto/conf/conf_def.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/conf_def.h	2017-04-25 16:23:40.135527557 +0200
@@ -108,7 +108,7 @@
 #define IS_HIGHBIT(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
 #endif /*CHARSET_EBCDIC*/
 
-static unsigned short CONF_type_default[256]={
+static const unsigned short CONF_type_default[256]={
 	0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
 	0x0000,0x0010,0x0010,0x0000,0x0000,0x0010,0x0000,0x0000,
 	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
@@ -143,7 +143,7 @@
 	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 	};
 
-static unsigned short CONF_type_win32[256]={
+static const unsigned short CONF_type_win32[256]={
 	0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
 	0x0000,0x0010,0x0010,0x0000,0x0000,0x0010,0x0000,0x0000,
 	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
diff -Naur openssl-1.0.0q.orig/crypto/conf/conf_err.c openssl-1.0.0q/crypto/conf/conf_err.c
--- openssl-1.0.0q.orig/crypto/conf/conf_err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/conf_err.c	2017-04-25 16:23:40.136527405 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/conf.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/conf/conf_lib.c openssl-1.0.0q/crypto/conf/conf_lib.c
--- openssl-1.0.0q.orig/crypto/conf/conf_lib.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/conf_lib.c	2017-04-25 16:23:40.137527532 +0200
@@ -56,16 +56,23 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include <openssl/crypto.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/conf.h>
 #include <openssl/conf_api.h>
 #include <openssl/lhash.h>
 
-const char CONF_version[]="CONF" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char CONF_version[]="CONF" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-26 haavardm */
 
+#ifdef _NO_GLOBALS_
+extern CONF_METHOD* *g_default_CONF_method_addr();
+#define default_CONF_method (*g_default_CONF_method_addr())
+#else
 static CONF_METHOD *default_CONF_method=NULL;
+#endif
 
 /* Init a 'CONF' structure from an old LHASH */
 
@@ -405,3 +412,4 @@
 	return ret;
 	}
 #endif
+#endif /* OPERA_SMALL_VERSION */
diff -Naur openssl-1.0.0q.orig/crypto/conf/conf_mall.c openssl-1.0.0q/crypto/conf/conf_mall.c
--- openssl-1.0.0q.orig/crypto/conf/conf_mall.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/conf_mall.c	2017-04-25 16:23:40.138527659 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/crypto.h>
 #include "cryptlib.h"
 #include <openssl/conf.h>
diff -Naur openssl-1.0.0q.orig/crypto/conf/conf_mod.c openssl-1.0.0q/crypto/conf/conf_mod.c
--- openssl-1.0.0q.orig/crypto/conf/conf_mod.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/conf_mod.c	2017-04-25 16:23:40.139527507 +0200
@@ -56,15 +56,19 @@
  *
  */
 
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/crypto.h>
-#include "cryptlib.h"
 #include <openssl/conf.h>
 #include <openssl/dso.h>
 #include <openssl/x509.h>
 
-
+#ifndef OPERA_SMALL_VERSION
 #define DSO_mod_init_name "OPENSSL_init"
 #define DSO_mod_finish_name "OPENSSL_finish"
 
@@ -325,17 +329,17 @@
 	CONF_MODULE *tmod;
 	int i, nchar;
 	char *p;
-	p = strrchr(name, '.');
+	p = op_strrchr(name, '.');
 
 	if (p)
 		nchar = p - name;
 	else 
-		nchar = strlen(name);
+		nchar = op_strlen(name);
 
 	for (i = 0; i < sk_CONF_MODULE_num(supported_modules); i++)
 		{
 		tmod = sk_CONF_MODULE_value(supported_modules, i);
-		if (!strncmp(tmod->name, name, nchar))
+		if (!op_strncmp(tmod->name, name, nchar))
 			return tmod;
 		}
 
@@ -552,11 +556,11 @@
 	if (file) 
 		return BUF_strdup(file);
 
-	len = strlen(X509_get_default_cert_area());
+	len = op_strlen(X509_get_default_cert_area());
 #ifndef OPENSSL_SYS_VMS
 	len++;
 #endif
-	len += strlen(OPENSSL_CONF);
+	len += op_strlen(OPENSSL_CONF);
 
 	file = OPENSSL_malloc(len + 1);
 
@@ -570,6 +574,7 @@
 
 	return file;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 /* This function takes a list separated by 'sep' and calls the
  * callback function giving the start and length of each member
@@ -594,10 +599,10 @@
 		{
 		if (nospc)
 			{
-			while(*lstart && isspace((unsigned char)*lstart))
+			while(*lstart && op_isspace((unsigned char)*lstart))
 				lstart++;
 			}
-		p = strchr(lstart, sep);
+		p = op_strchr(lstart, sep);
 		if (p == lstart || !*lstart)
 			ret = list_cb(NULL, 0, arg);
 		else
@@ -605,10 +610,10 @@
 			if (p)
 				tmpend = p - 1;
 			else 
-				tmpend = lstart + strlen(lstart) - 1;
+				tmpend = lstart + op_strlen(lstart) - 1;
 			if (nospc)
 				{
-				while(isspace((unsigned char)*tmpend))
+				while(op_isspace((unsigned char)*tmpend))
 					tmpend--;
 				}
 			ret = list_cb(lstart, tmpend - lstart + 1, arg);
diff -Naur openssl-1.0.0q.orig/crypto/conf/conf_sap.c openssl-1.0.0q/crypto/conf/conf_sap.c
--- openssl-1.0.0q.orig/crypto/conf/conf_sap.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/conf_sap.c	2017-04-25 16:23:40.140527634 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/crypto.h>
 #include "cryptlib.h"
 #include <openssl/conf.h>
diff -Naur openssl-1.0.0q.orig/crypto/conf/opera_conf_mod.cpp openssl-1.0.0q/crypto/conf/opera_conf_mod.cpp
--- openssl-1.0.0q.orig/crypto/conf/opera_conf_mod.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/opera_conf_mod.cpp	2017-04-25 16:23:40.141527481 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/conf/conf_mod.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/conf/test.c openssl-1.0.0q/crypto/conf/test.c
--- openssl-1.0.0q.orig/crypto/conf/test.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/conf/test.c	2017-04-25 16:23:40.142527329 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/conf.h>
 #include <openssl/err.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/cpt_err.c openssl-1.0.0q/crypto/cpt_err.c
--- openssl-1.0.0q.orig/crypto/cpt_err.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/cpt_err.c	2017-04-25 16:23:40.143527177 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/crypto.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/cryptlib.c openssl-1.0.0q/crypto/cryptlib.c
--- openssl-1.0.0q.orig/crypto/cryptlib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/cryptlib.c	2017-04-25 16:23:40.144527583 +0200
@@ -114,15 +114,19 @@
  * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
  */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
+#include <openssl/crypto.h>
 #include <openssl/safestack.h>
 
+#ifndef OPERA_SMALL_VERSION
 #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16)
 static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
 #endif
+#endif // !OPERA_SMALL_VERSION
 
 DECLARE_STACK_OF(CRYPTO_dynlock)
 
+#ifndef OPERA_SMALL_VERSION
 /* real #defines in crypto.h, keep these upto date */
 static const char* const lock_names[CRYPTO_NUM_LOCKS] =
 	{
@@ -196,7 +200,9 @@
 	struct CRYPTO_dynlock_value *l, const char *file,int line)=0;
 static void (MS_FAR *dynlock_destroy_callback)(struct CRYPTO_dynlock_value *l,
 	const char *file,int line)=0;
+#endif // !OPERA_SMALL_VERSION
 
+#ifndef OPERA_SMALL_VERSION
 int CRYPTO_get_new_lockid(char *name)
 	{
 	char *str;
@@ -227,12 +233,16 @@
 		i+=CRYPTO_NUM_LOCKS; /* gap of one :-) */
 	return(i);
 	}
+#endif // !OPERA_SMALL_VERSION
 
+#ifndef OPERA_SMALL_VERSION
 int CRYPTO_num_locks(void)
 	{
 	return CRYPTO_NUM_LOCKS;
 	}
+#endif // !OPERA_SMALL_VERSION
 
+#ifndef OPERA_SMALL_VERSION
 int CRYPTO_get_new_dynlockid(void)
 	{
 	int i = 0;
@@ -392,8 +402,10 @@
 	{
 	dynlock_destroy_callback=func;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 
+#ifndef OPERA_SMALL_VERSION
 void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file,
 		int line)
 	{
@@ -417,24 +429,25 @@
 	{
 	add_lock_callback=func;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 /* the memset() here and in set_pointer() seem overkill, but for the sake of
  * CRYPTO_THREADID_cmp() this avoids any platform silliness that might cause two
  * "equal" THREADID structs to not be memcmp()-identical. */
 void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val)
 	{
-	memset(id, 0, sizeof(*id));
+	op_memset(id, 0, sizeof(*id));
 	id->val = val;
 	}
 
 static const unsigned char hash_coeffs[] = { 3, 5, 7, 11, 13, 17, 19, 23 };
 void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr)
 	{
-	unsigned char *dest = (void *)&id->val;
+	unsigned char *dest = (unsigned char *)&id->val;
 	unsigned int accum = 0;
 	unsigned char dnum = sizeof(id->val);
 
-	memset(id, 0, sizeof(*id));
+	op_memset(id, 0, sizeof(*id));
 	id->ptr = ptr;
 	if (sizeof(id->val) >= sizeof(id->ptr))
 		{
@@ -454,7 +467,7 @@
 	 * mistake it as such. Plus I'm lazy. */
 	while (dnum--)
 		{
-		const unsigned char *src = (void *)&id->ptr;
+		const unsigned char *src = (const unsigned char *)&id->ptr;
 		unsigned char snum = sizeof(id->ptr);
 		while (snum--)
 			accum += *(src++) * hash_coeffs[(snum + dnum) & 7];
@@ -463,6 +476,7 @@
 		}
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int CRYPTO_THREADID_set_callback(void (*func)(CRYPTO_THREADID *))
 	{
 	if (threadid_callback)
@@ -475,9 +489,11 @@
 	{
 	return threadid_callback;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 void CRYPTO_THREADID_current(CRYPTO_THREADID *id)
 	{
+#ifndef OPERA_SMALL_VERSION
 	if (threadid_callback)
 		{
 		threadid_callback(id);
@@ -491,6 +507,7 @@
 		return;
 		}
 #endif
+#endif // !OPERA_SMALL_VERSION
 	/* Else pick a backup */
 #ifdef OPENSSL_SYS_WIN16
 	CRYPTO_THREADID_set_numeric(id, (unsigned long)GetCurrentTask());
@@ -500,18 +517,23 @@
 	CRYPTO_THREADID_set_numeric(id, (unsigned long)find_thread(NULL));
 #else
 	/* For everything else, default to using the address of 'errno' */
+#ifdef HAVE_ERRNO
 	CRYPTO_THREADID_set_pointer(id, (void*)&errno);
+#else
+	// Fallback for platforms not having 'errno'.
+	CRYPTO_THREADID_set_pointer(id, NULL);
+#endif // HAVE_ERRNO
 #endif
 	}
 
 int CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b)
 	{
-	return memcmp(a, b, sizeof(*a));
+	return op_memcmp(a, b, sizeof(*a));
 	}
 
 void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src)
 	{
-	memcpy(dest, src, sizeof(*src));
+	op_memcpy(dest, src, sizeof(*src));
 	}
 
 unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id)
@@ -581,6 +603,8 @@
 			CRYPTO_get_lock_name(type), file, line);
 		}
 #endif
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 	if (type < 0)
 		{
 		if (dynlock_lock_callback != NULL)
@@ -598,6 +622,8 @@
 	else
 		if (locking_callback != NULL)
 			locking_callback(mode,type,file,line);
+#endif // !_NO_GLOBALS_
+#endif // !OPERA_SMALL_VERSION
 	}
 
 int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
@@ -605,6 +631,8 @@
 	{
 	int ret = 0;
 
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 	if (add_lock_callback != NULL)
 		{
 #ifdef LOCK_DEBUG
@@ -624,6 +652,8 @@
 #endif
 		}
 	else
+#endif // !_NO_GLOBALS_
+#endif // !OPERA_SMALL_VERSION
 		{
 		CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,file,line);
 
@@ -645,6 +675,7 @@
 	return(ret);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 const char *CRYPTO_get_lock_name(int type)
 	{
 	if (type < 0)
@@ -656,7 +687,9 @@
 	else
 		return(sk_OPENSSL_STRING_value(app_locks,type-CRYPTO_NUM_LOCKS));
 	}
+#endif // !OPERA_SMALL_VERSION
 
+#ifndef OPERA_SMALL_VERSION
 #if	defined(__i386)   || defined(__i386__)   || defined(_M_IX86) || \
 	defined(__INTEL__) || \
 	defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)
@@ -896,16 +929,4 @@
 	}
 
 void *OPENSSL_stderr(void)	{ return stderr; }
-
-int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len)
-	{
-	size_t i;
-	const unsigned char *a = in_a;
-	const unsigned char *b = in_b;
-	unsigned char x = 0;
-
-	for (i = 0; i < len; i++)
-		x |= a[i] ^ b[i];
-
-	return x;
-	}
+#endif // !OPERA_SMALL_VERSION
diff -Naur openssl-1.0.0q.orig/crypto/cryptlib.h openssl-1.0.0q/crypto/cryptlib.h
--- openssl-1.0.0q.orig/crypto/cryptlib.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/cryptlib.h	2017-04-25 16:23:40.145527710 +0200
@@ -59,10 +59,95 @@
 #ifndef HEADER_CRYPTLIB_H
 #define HEADER_CRYPTLIB_H
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
-#include "e_os.h"
+#include <openssl/e_os.h>
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
+
+#if defined(WIN32) && !defined(SIXTY_FOUR_BIT) && !defined(THIRTY_TWO_BIT)
+#define THIRTY_TWO_BIT
+#elif !defined(THIRTY_TWO_BIT) && !defined(SIXTY_FOUR_BIT) && !defined(SIXTEEN_BIT) && !defined(EIGHT_BIT)
+#error One of these MUST be defined
+#endif
+
+
+#define OPENSSL_NO_CAMELLIA
+#define OPENSSL_NO_CMS
+#define OPENSSL_NO_SOCK
+#define OPENSSL_NO_DEPRECATED
+/*#define OPENSSL_NO_BIO */
+#define OPENSSL_NO_FP_API
+#define OPENSSL_NO_IDEA
+#define OPENSSL_NO_ENGINE
+#define OPENSSL_NO_EC
+#define OPENSSL_NO_ECDH
+#define OPENSSL_NO_ECDSA
+#define OPENSSL_NO_SEED
+//#define OPENSSL_NO_SHA256
+//#define OPENSSL_NO_SHA512
+#define OPENSSL_NO_SHA0
+#define NO_OLD_ASN1
+#define OPENSSL_NO_STDIO
+#define OPENSSL_DISABLE_OLD_DES_SUPPORT
+
+#define OPENSSL_SMALL_FOOTPRINT
+#define NO_ASN1_FIELD_NAMES
+
+#ifndef USE_SYSTEM_ASSERT
+#undef assert
+#define assert(x) OP_ASSERT(x)
+#endif // USE_SYSTEM_ASSERT
+
+#ifndef SSL_BLOWFISH_SUPPORT
+#define OPENSSL_NO_BF
+#endif
+
+#if !(defined(NEED_LIBOPEAY_CAST_RIPE_SUPPORT))
+/*#define OPENSSL_NO_AES*/
+#define OPENSSL_NO_CAST
+#define OPENSSL_NO_RIPEMD
+#endif
+#if defined(NEED_LIBOPEAY_CFB_SUPPORT)
+#define OPENSSL_USE_CFB_CIPHERS
+#endif
+#if !defined(__SSL_WITH_DH_DSA__)
+#define OPENSSL_NO_DSA
+#define OPENSSL_NO_DH
+#endif
+#define OPENSSL_NO_MD2
+#define OPENSSL_NO_MDC2
+#define OPENSSL_NO_MD4
+#define OPENSSL_NO_RC5
+#define OPENSSL_NO_WHIRLPOOL
+
+/*#define OPENSSL_NO_OCSP */
+
+#define NO_CONF
+#if !defined SSL_USE_WEAK_CIPHERS
+#define NO_SINGLE_DES
+#endif
+#if !defined SSL_USE_WEAK_CIPHERS && !defined SSL_2_0_SUPPORT && !defined LIBOPEAY_PKCS12_SUPPORT
+#define OPENSSL_NO_RC2
+#endif
+#define DES_PART_ONLY
+#define NO_ERR
+#define OPENSSL_NO_ERR
+
+#ifdef EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
+#define OPENSSL_NO_COMP
+#define OPENSSL_NO_DTLS1
+#define OPENSSL_NO_ECB
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
+
+
+#define OPERA_OPENSSL_STRINGS(x) ((const char *) NULL)
+#else
+#define OPERA_OPENSSL_STRINGS(x) x
+#endif /* _SSL_USE_OPENSSL_ || LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT */
 
 #ifdef OPENSSL_USE_APPLINK
 #define BIO_FLAGS_UPLINK 0x8000
diff -Naur openssl-1.0.0q.orig/crypto/crypto.h openssl-1.0.0q/crypto/crypto.h
--- openssl-1.0.0q.orig/crypto/crypto.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/crypto.h	2017-04-25 16:23:40.146527558 +0200
@@ -117,12 +117,16 @@
 #ifndef HEADER_CRYPTO_H
 #define HEADER_CRYPTO_H
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/e_os2.h>
 
 #ifndef OPENSSL_NO_FP_API
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #include <openssl/stack.h>
@@ -231,15 +235,15 @@
 #ifndef OPENSSL_NO_LOCKING
 #ifndef CRYPTO_w_lock
 #define CRYPTO_w_lock(type)	\
-	CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
+	CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,/*__FILE__*/ "",__LINE__)
 #define CRYPTO_w_unlock(type)	\
-	CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
+	CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,/*__FILE__*/ "",__LINE__)
 #define CRYPTO_r_lock(type)	\
-	CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
+	CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,/*__FILE__*/ "",__LINE__)
 #define CRYPTO_r_unlock(type)	\
-	CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
+	CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,/*__FILE__*/ "",__LINE__)
 #define CRYPTO_add(addr,amount,type)	\
-	CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
+	CRYPTO_add_lock(addr,amount,type,/*__FILE__*/ "",__LINE__)
 #endif
 #else
 #define CRYPTO_w_lock(a)
@@ -353,8 +357,13 @@
 		CRYPTO_dbg_get_options);\
 	} while(0)
 
+#ifndef OPERA_SMALL_VERSION
 int CRYPTO_mem_ctrl(int mode);
 int CRYPTO_is_mem_check_on(void);
+#else
+#define CRYPTO_mem_ctrl(x)
+#define CRYPTO_is_mem_check_on()
+#endif /* OPERA_SMALL_VERSION */
 
 /* for applications */
 #define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON)
@@ -365,19 +374,19 @@
 #define MemCheck_off()	CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)
 #define is_MemCheck_on() CRYPTO_is_mem_check_on()
 
-#define OPENSSL_malloc(num)	CRYPTO_malloc((int)num,__FILE__,__LINE__)
+#define OPENSSL_malloc(num)	CRYPTO_malloc((int)num,/*__FILE__*/ NULL,/*__LINE__*/0)
 #define OPENSSL_strdup(str)	CRYPTO_strdup((str),__FILE__,__LINE__)
 #define OPENSSL_realloc(addr,num) \
-	CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
+	CRYPTO_realloc((char *)addr,(int)num,/*__FILE__*/ NULL,/*__LINE__*/0)
 #define OPENSSL_realloc_clean(addr,old_num,num) \
-	CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__)
+	CRYPTO_realloc_clean(addr,old_num,num,/*__FILE__*/ NULL,/*__LINE__*/0)
 #define OPENSSL_remalloc(addr,num) \
-	CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
+	CRYPTO_remalloc((char **)addr,(int)num,/*__FILE__*/ NULL/*,__LINE__*/0)
 #define OPENSSL_freeFunc	CRYPTO_free
 #define OPENSSL_free(addr)	CRYPTO_free(addr)
 
 #define OPENSSL_malloc_locked(num) \
-	CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)
+	CRYPTO_malloc_locked((int)num,/*__FILE__*/ "",__LINE__)
 #define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr)
 
 
@@ -497,15 +506,25 @@
 			   int line);
 void *CRYPTO_remalloc(void *addr,int num, const char *file, int line);
 
+#if defined OPERA_SMALL_VERSION
+#define OPENSSL_cleanse OPERA_cleanse
+#endif
+
 void OPENSSL_cleanse(void *ptr, size_t len);
 
 void CRYPTO_set_mem_debug_options(long bits);
 long CRYPTO_get_mem_debug_options(void);
 
+#ifndef OPERA_SMALL_VERSION
 #define CRYPTO_push_info(info) \
-        CRYPTO_push_info_(info, __FILE__, __LINE__);
+        CRYPTO_push_info_(info, /*__FILE__*/ "", __LINE__);
 int CRYPTO_push_info_(const char *info, const char *file, int line);
 int CRYPTO_pop_info(void);
+#else
+#define CRYPTO_push_info(x)
+#define CRYPTO_push_info_(x,y,z,w)
+#define CRYPTO_pop_info()
+#endif
 int CRYPTO_remove_all_info(void);
 
 
@@ -541,7 +560,11 @@
 
 /* die if we have to */
 void OpenSSLDie(const char *file,int line,const char *assertion);
+#ifndef OPERA_SMALL_VERSION
 #define OPENSSL_assert(e)       (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))
+#else
+#define OPENSSL_assert(e)       OP_ASSERT(e)
+#endif
 
 unsigned long *OPENSSL_ia32cap_loc(void);
 #define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
diff -Naur openssl-1.0.0q.orig/crypto/des/.gitignore openssl-1.0.0q/crypto/des/.gitignore
--- openssl-1.0.0q.orig/crypto/des/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/des/.gitignore	2017-04-25 16:23:40.147527406 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/des/cbc3_enc.c openssl-1.0.0q/crypto/des/cbc3_enc.c
--- openssl-1.0.0q.orig/crypto/des/cbc3_enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/des/cbc3_enc.c	2017-04-25 16:23:40.148527254 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
-#include "des_locl.h"
+#include <openssl/cryptlib.h>
 
+#include "des_locl.h"
+#ifndef OPERA_SMALL_VERSION
 /* HAS BUGS! DON'T USE - this is only present for use in des.c */
 void DES_3cbc_encrypt(DES_cblock *input, DES_cblock *output, long length,
 	     DES_key_schedule ks1, DES_key_schedule ks2, DES_cblock *iv1,
@@ -72,28 +74,29 @@
 		DES_cbc_encrypt((unsigned char*)input,
 				(unsigned char*)output,length,&ks1,iv1,enc);
 		if (length >= sizeof(DES_cblock))
-			memcpy(niv1,output[off],sizeof(DES_cblock));
+			op_memcpy(niv1,output[off],sizeof(DES_cblock));
 		DES_cbc_encrypt((unsigned char*)output,
 				(unsigned char*)output,l8,&ks2,iv1,!enc);
 		DES_cbc_encrypt((unsigned char*)output,
 				(unsigned char*)output,l8,&ks1,iv2,enc);
 		if (length >= sizeof(DES_cblock))
-			memcpy(niv2,output[off],sizeof(DES_cblock));
+			op_memcpy(niv2,output[off],sizeof(DES_cblock));
 		}
 	else
 		{
 		if (length >= sizeof(DES_cblock))
-			memcpy(niv2,input[off],sizeof(DES_cblock));
+			op_memcpy(niv2,input[off],sizeof(DES_cblock));
 		DES_cbc_encrypt((unsigned char*)input,
 				(unsigned char*)output,l8,&ks1,iv2,enc);
 		DES_cbc_encrypt((unsigned char*)output,
 				(unsigned char*)output,l8,&ks2,iv1,!enc);
 		if (length >= sizeof(DES_cblock))
-			memcpy(niv1,output[off],sizeof(DES_cblock));
+			op_memcpy(niv1,output[off],sizeof(DES_cblock));
 		DES_cbc_encrypt((unsigned char*)output,
 				(unsigned char*)output,length,&ks1,iv1,enc);
 		}
-	memcpy(*iv1,niv1,sizeof(DES_cblock));
-	memcpy(*iv2,niv2,sizeof(DES_cblock));
+	op_memcpy(*iv1,niv1,sizeof(DES_cblock));
+	op_memcpy(*iv2,niv2,sizeof(DES_cblock));
 	}
+#endif
 
diff -Naur openssl-1.0.0q.orig/crypto/des/cfb64ede.c openssl-1.0.0q/crypto/des/cfb64ede.c
--- openssl-1.0.0q.orig/crypto/des/cfb64ede.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/des/cfb64ede.c	2017-04-25 16:23:40.149528219 +0200
@@ -56,8 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/cryptlib.h>
+
+#if !defined OPENSSL_NO_DES && defined OPENSSL_USE_CFB_CIPHERS
+
 #include "des_locl.h"
-#include "e_os.h"
+#include <openssl/e_os.h>
 
 /* The input and output encrypted as though 64bit cfb mode is being
  * used.  The extra state information to record how much of the
@@ -156,7 +160,7 @@
 	register int num=numbits,i;
 	DES_LONG ti[2];
 	unsigned char *iv;
-	unsigned char ovec[16];
+	unsigned char ovec[16]; /* ARRAY OK 2007-11-07 yngve */
 
 	if (num > 64) return;
 	iv = &(*ivec)[0];
@@ -190,7 +194,7 @@
 				l2c(d0,iv);
 				l2c(d1,iv);
 				/* shift ovec left most of the bits... */
-				memmove(ovec,ovec+num/8,8+(num%8 ? 1 : 0));
+				op_memmove(ovec,ovec+num/8,8+(num%8 ? 1 : 0));
 				/* now the remaining bits */
 				if(num%8 != 0)
 					for(i=0 ; i < 8 ; ++i)
@@ -228,7 +232,7 @@
 				l2c(d0,iv);
 				l2c(d1,iv);
 				/* shift ovec left most of the bits... */
-				memmove(ovec,ovec+num/8,8+(num%8 ? 1 : 0));
+				op_memmove(ovec,ovec+num/8,8+(num%8 ? 1 : 0));
 				/* now the remaining bits */
 				if(num%8 != 0)
 					for(i=0 ; i < 8 ; ++i)
@@ -252,3 +256,4 @@
 	v0=v1=d0=d1=ti[0]=ti[1]=0;
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/des/cfb64enc.c openssl-1.0.0q/crypto/des/cfb64enc.c
--- openssl-1.0.0q.orig/crypto/des/cfb64enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/des/cfb64enc.c	2017-04-25 16:23:40.150527787 +0200
@@ -56,6 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/cryptlib.h>
+
+#if !defined OPENSSL_NO_DES && defined OPENSSL_USE_CFB_CIPHERS
+
 #include "des_locl.h"
 
 /* The input and output encrypted as though 64bit cfb mode is being
@@ -119,3 +123,4 @@
 	*num=n;
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/des/cfb_enc.c openssl-1.0.0q/crypto/des/cfb_enc.c
--- openssl-1.0.0q.orig/crypto/des/cfb_enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/des/cfb_enc.c	2017-04-25 16:23:40.152527483 +0200
@@ -56,7 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
-#include "e_os.h"
+#include <openssl/cryptlib.h>
+
+#if !defined OPENSSL_NO_DES && defined OPENSSL_USE_CFB_CIPHERS
+
+#include <openssl/e_os.h>
 #include "des_locl.h"
 #include <assert.h>
 
@@ -78,7 +82,7 @@
 	DES_LONG ti[2];
 	unsigned char *iv;
 #ifndef L_ENDIAN
-	unsigned char ovec[16];
+	unsigned char ovec[16]; /* ARRAY OK 2007-11-07 yngve */
 #else
 	unsigned int  sh[4];
 	unsigned char *ovec=(unsigned char *)sh;
@@ -125,7 +129,7 @@
 				sh[0]=v0, sh[1]=v1, sh[2]=d0, sh[3]=d1;
 #endif
 				if (rem==0)
-					memmove(ovec,ovec+num,8);
+					op_memmove(ovec,ovec+num,8);
 				else
 					for(i=0 ; i < 8 ; ++i)
 						ovec[i]=ovec[i+num]<<rem |
@@ -168,7 +172,7 @@
 				sh[0]=v0, sh[1]=v1, sh[2]=d0, sh[3]=d1;
 #endif
 				if (rem==0)
-					memmove(ovec,ovec+num,8);
+					op_memmove (ovec,ovec+num,8);
 				else
 					for(i=0 ; i < 8 ; ++i)
 						ovec[i]=ovec[i+num]<<rem |
@@ -193,3 +197,4 @@
 	v0=v1=d0=d1=ti[0]=ti[1]=0;
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/des/des.c openssl-1.0.0q/crypto/des/des.c
--- openssl-1.0.0q.orig/crypto/des/des.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/des.c	2017-04-25 16:23:40.153527610 +0200
@@ -56,9 +56,14 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/opensslconf.h>
 #ifndef OPENSSL_SYS_MSDOS
 #ifndef OPENSSL_SYS_VMS
@@ -71,10 +76,14 @@
 #endif /* __DECC */
 #endif /* OPENSSL_SYS_VMS */
 #else /* OPENSSL_SYS_MSDOS */
+#ifndef OPERA_SMALL_VERSION
 #include <io.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "des_ver.h"
 
 #ifdef OPENSSL_SYS_VMS
@@ -82,9 +91,13 @@
 #include <stat.h>
 #else
 #ifndef _IRIX
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
+#ifndef OPERA_SMALL_VERSION
 #include <sys/stat.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #include <openssl/des.h>
 #include <openssl/rand.h>
@@ -134,7 +147,7 @@
 
 	vflag=cflag=eflag=dflag=kflag=hflag=bflag=fflag=sflag=uflag=flag3=0;
 	error=0;
-	memset(key,0,sizeof(key));
+	op_memset(key,0,sizeof(key));
 
 	for (i=1; i<argc; i++)
 		{
@@ -152,16 +165,16 @@
 					break;
 				case 'c':
 					cflag=1;
-					strncpy(cksumname,p,200);
+					op_strncpy(cksumname,p,200);
 					cksumname[sizeof(cksumname)-1]='\0';
-					p+=strlen(cksumname);
+					p+=op_strlen(cksumname);
 					break;
 				case 'C':
 					cflag=1;
 					longk=1;
-					strncpy(cksumname,p,200);
+					op_strncpy(cksumname,p,200);
 					cksumname[sizeof(cksumname)-1]='\0';
-					p+=strlen(cksumname);
+					p+=op_strlen(cksumname);
 					break;
 				case 'e':
 					eflag=1;
@@ -191,9 +204,9 @@
 					break;
 				case 'u':
 					uflag=1;
-					strncpy(uuname,p,200);
+					op_strncpy(uuname,p,200);
 					uuname[sizeof(uuname)-1]='\0';
-					p+=strlen(uuname);
+					p+=op_strlen(uuname);
 					break;
 				case 'h':
 					hflag=1;
@@ -210,8 +223,8 @@
 						int j;
 
 						i++;
-						strncpy(key,argv[i],KEYSIZB);
-						for (j=strlen(argv[i])-1; j>=0; j--)
+						op_strncpy(key,argv[i],KEYSIZB);
+						for (j=op_strlen(argv[i])-1; j>=0; j--)
 							argv[i][j]='\0';
 						}
 					break;
@@ -268,7 +281,7 @@
 		(ins.st_dev == outs.st_dev) &&
 		(ins.st_ino == outs.st_ino))
 #else /* OPENSSL_SYS_MSDOS */
-		(strcmp(in,out) == 0))
+		(op_strcmp(in,out) == 0))
 #endif
 			{
 			fputs("input and output file are the same\n",stderr);
@@ -305,7 +318,9 @@
 #ifdef OPENSSL_SYS_MSDOS
 	/* This should set the file to binary mode. */
 	{
+#ifndef OPERA_SMALL_VERSION
 #include <fcntl.h>
+#endif /* !OPERA_SMALL_VERSION */
 	if (!(uflag && dflag))
 		setmode(fileno(DES_IN),O_BINARY);
 	if (!(uflag && eflag))
@@ -360,7 +375,7 @@
 void doencryption(void)
 	{
 #ifdef _LIBC
-	extern unsigned long time();
+	extern unsigned long op_time();
 #endif
 
 	register int i;
@@ -460,8 +475,8 @@
 	OPENSSL_cleanse(key,sizeof(key));
 	OPENSSL_cleanse(kk,sizeof(kk));
 	/* woops - A bug that does not showup under unix :-( */
-	memset(iv,0,sizeof(iv));
-	memset(iv2,0,sizeof(iv2));
+	op_memset(iv,0,sizeof(iv));
+	op_memset(iv2,0,sizeof(iv2));
 
 	l=1;
 	rem=0;
@@ -520,13 +535,13 @@
 				{
 				char tmpbuf[8];
 
-				if (rem) memcpy(tmpbuf,&(buf[l]),
+				if (rem) op_memcpy(tmpbuf,&(buf[l]),
 					(unsigned int)rem);
 				DES_3cbc_encrypt(
 					(DES_cblock *)buf,(DES_cblock *)obuf,
 					(long)l,ks,ks2,&iv,
 					&iv2,do_encrypt);
-				if (rem) memcpy(&(buf[l]),tmpbuf,
+				if (rem) op_memcpy(&(buf[l]),tmpbuf,
 					(unsigned int)rem);
 				}
 			else
@@ -534,9 +549,9 @@
 				DES_cbc_encrypt(
 					buf,obuf,
 					(long)l,&ks,&iv,do_encrypt);
-				if (l >= 8) memcpy(iv,&(obuf[l-8]),8);
+				if (l >= 8) op_memcpy(iv,&(obuf[l-8]),8);
 				}
-			if (rem) memcpy(buf,&(buf[l]),(unsigned int)rem);
+			if (rem) op_memcpy(buf,&(buf[l]),(unsigned int)rem);
 
 			i=0;
 			while (i < l)
@@ -607,7 +622,7 @@
 				DES_cbc_encrypt(
 					buf,obuf,
 				 	(long)l,&ks,&iv,do_encrypt);
-				if (l >= 8) memcpy(iv,&(buf[l-8]),8);
+				if (l >= 8) op_memcpy(iv,&(buf[l-8]),8);
 				}
 
 			if (uflag)
@@ -698,14 +713,14 @@
 		{
 		if (uubufnum+num < 45)
 			{
-			memcpy(&(uubuf[uubufnum]),data,(unsigned int)num);
+			op_memcpy(&(uubuf[uubufnum]),data,(unsigned int)num);
 			uubufnum+=num;
 			return(num);
 			}
 		else
 			{
 			i=45-uubufnum;
-			memcpy(&(uubuf[uubufnum]),data,(unsigned int)i);
+			op_memcpy(&(uubuf[uubufnum]),data,(unsigned int)i);
 			j=uuencode((unsigned char *)uubuf,45,b);
 			fwrite(b,1,(unsigned int)j,fp);
 			uubufnum=0;
@@ -729,7 +744,7 @@
 		}
 	if (i != num)
 		{
-		memcpy(uubuf,&(data[i]),(unsigned int)rem);
+		op_memcpy(uubuf,&(data[i]),(unsigned int)rem);
 		uubufnum=rem;
 		}
 	return(ret);
@@ -770,7 +785,7 @@
 				fprintf(stderr,"no 'begin' found in uuencoded input\n");
 				return(-1);
 				}
-			if (strncmp((char *)b,"begin ",6) == 0) break;
+			if (op_strncmp((char *)b,"begin ",6) == 0) break;
 			}
 		start=0;
 		}
@@ -778,7 +793,7 @@
 	tot=0;
 	if (valid)
 		{
-		memcpy(out,bb,(unsigned int)valid);
+		op_memcpy(out,bb,(unsigned int)valid);
 		tot=valid;
 		valid=0;
 		}
@@ -787,7 +802,7 @@
 		b[0]='\0';
 		fgets((char *)b,300,fp);
 		if (b[0] == '\0') break;
-		i=strlen((char *)b);
+		i=op_strlen((char *)b);
 		if ((b[0] == 'e') && (b[1] == 'n') && (b[2] == 'd'))
 			{
 			done=1;
@@ -803,13 +818,13 @@
 			{
 			/* num to copy to make it a multiple of 8 */
 			j=(num/8*8)-tot-8;
-			memcpy(&(out[tot]),bb,(unsigned int)j);
+			op_memcpy(&(out[tot]),bb,(unsigned int)j);
 			tot+=j;
-			memcpy(bb,&(bb[j]),(unsigned int)i-j);
+			op_memcpy(bb,&(bb[j]),(unsigned int)i-j);
 			valid=i-j;
 			break;
 			}
-		memcpy(&(out[tot]),bb,(unsigned int)i);
+		op_memcpy(&(out[tot]),bb,(unsigned int)i);
 		tot+=i;
 		}
 	return(tot);
diff -Naur openssl-1.0.0q.orig/crypto/des/des.h openssl-1.0.0q/crypto/des/des.h
--- openssl-1.0.0q.orig/crypto/des/des.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/des/des.h	2017-04-25 16:23:40.154527458 +0200
@@ -75,8 +75,8 @@
 extern "C" {
 #endif
 
-typedef unsigned char DES_cblock[8];
-typedef /* const */ unsigned char const_DES_cblock[8];
+typedef unsigned char DES_cblock[8];					/* ARRAY OK 2009-05-25 yngve */
+typedef /* const */ unsigned char const_DES_cblock[8];	/* ARRAY OK 2009-05-25 yngve */
 /* With "const", gcc 2.8.1 on Solaris thinks that DES_cblock *
  * and const_DES_cblock * are incompatible pointer types. */
 
diff -Naur openssl-1.0.0q.orig/crypto/des/des3s.cpp openssl-1.0.0q/crypto/des/des3s.cpp
--- openssl-1.0.0q.orig/crypto/des/des3s.cpp	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/des/des3s.cpp	2017-04-25 16:23:40.155527026 +0200
@@ -30,8 +30,10 @@
 }
 #endif      
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif // !OPERA_SMALL_VERSION
 #include <openssl/des.h>
 
 void main(int argc,char *argv[])
diff -Naur openssl-1.0.0q.orig/crypto/des/des_enc.c openssl-1.0.0q/crypto/des/des_enc.c
--- openssl-1.0.0q.orig/crypto/des/des_enc.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/des_enc.c	2017-04-25 16:23:40.156527153 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/cryptlib.h>
 #include "des_locl.h"
 #include "spr.h"
 
+#ifdef SSL_USE_WEAK_CIPHERS
 void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
 	{
 	register DES_LONG l,r,t,u;
@@ -152,6 +154,7 @@
 	data[1]=r;
 	l=r=t=u=0;
 	}
+#endif // SSL_USE_WEAK_CIPHERS
 
 void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/des/des_locl.h openssl-1.0.0q/crypto/des/des_locl.h
--- openssl-1.0.0q.orig/crypto/des/des_locl.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/des_locl.h	2017-04-25 16:23:40.157526721 +0200
@@ -67,30 +67,38 @@
 #endif
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #ifndef OPENSSL_SYS_MSDOS
 #if !defined(OPENSSL_SYS_VMS) || defined(__DECC)
+#ifndef OPERA_SMALL_VERSION
 #ifdef OPENSSL_UNISTD
 # include OPENSSL_UNISTD
 #else
 # include <unistd.h>
 #endif
 #include <math.h>
+#endif // OPERA_SMALL_VERSION
 #endif
 #endif
 #include <openssl/des.h>
 
 #ifdef OPENSSL_SYS_MSDOS		/* Visual C++ 2.1 (Windows NT/95) */
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
 #include <errno.h>
 #include <time.h>
 #include <io.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #if defined(__STDC__) || defined(OPENSSL_SYS_VMS) || defined(M_XENIX) || defined(OPENSSL_SYS_MSDOS)
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #ifdef OPENSSL_BUILD_SHLIBCRYPTO
@@ -162,7 +170,7 @@
 
 #if (defined(OPENSSL_SYS_WIN32) && defined(_MSC_VER)) || defined(__ICC)
 #define	ROTATE(a,n)	(_lrotr(a,n))
-#elif defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC)
+#elif defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) && !defined(__llvm__)
 # if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
 #  define ROTATE(a,n)	({ register unsigned int ret;	\
 				asm ("rorl %1,%0"	\
diff -Naur openssl-1.0.0q.orig/crypto/des/des_opts.c openssl-1.0.0q/crypto/des/des_opts.c
--- openssl-1.0.0q.orig/crypto/des/des_opts.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/des_opts.c	2017-04-25 16:23:40.158526569 +0200
@@ -63,12 +63,16 @@
 #define TIMES
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #ifndef OPENSSL_SYS_MSDOS
 #include <openssl/e_os2.h>
 #include OPENSSL_UNISTD
 #else
+#ifndef OPERA_SMALL_VERSION
 #include <io.h>
+#endif /* !OPERA_SMALL_VERSION */
 extern void exit();
 #endif
 
@@ -77,10 +81,14 @@
 #endif
 
 #ifndef _IRIX
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef TIMES
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/times.h>
 #endif
 
@@ -99,7 +107,9 @@
 
 #if defined(sun) || defined(__ultrix)
 #define _POSIX_SOURCE
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/param.h>
 #endif
 
diff -Naur openssl-1.0.0q.orig/crypto/des/dess.cpp openssl-1.0.0q/crypto/des/dess.cpp
--- openssl-1.0.0q.orig/crypto/des/dess.cpp	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/des/dess.cpp	2017-04-25 16:23:40.159526138 +0200
@@ -30,8 +30,10 @@
 }
 #endif      
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif // !OPERA_SMALL_VERSION
 #include <openssl/des.h>
 
 void main(int argc,char *argv[])
diff -Naur openssl-1.0.0q.orig/crypto/des/destest.c openssl-1.0.0q/crypto/des/destest.c
--- openssl-1.0.0q.orig/crypto/des/destest.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/destest.c	2017-04-25 16:23:40.161527789 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/e_os2.h>
 #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_SYS_WINDOWS)
@@ -71,9 +73,13 @@
 #include OPENSSL_UNISTD
 #endif
 #else
+#ifndef OPERA_SMALL_VERSION
 #include <io.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #ifdef OPENSSL_NO_DES
 int main(int argc, char *argv[])
@@ -369,28 +375,28 @@
 		printf("Key error %d\n",j);
 		err=1;
 		}
-	memset(cbc_out,0,40);
-	memset(cbc_in,0,40);
-	i=strlen((char *)cbc_data)+1;
+	op_memset(cbc_out,0,40);
+	op_memset(cbc_in,0,40);
+	i=op_strlen((char *)cbc_data)+1;
 	/* i=((i+7)/8)*8; */
-	memcpy(iv3,cbc_iv,sizeof(cbc_iv));
-	memset(iv2,'\0',sizeof iv2);
+	op_memcpy(iv3,cbc_iv,sizeof(cbc_iv));
+	op_memset(iv2,'\0',sizeof iv2);
 
 	DES_ede3_cbcm_encrypt(cbc_data,cbc_out,16L,&ks,&ks2,&ks3,&iv3,&iv2,
 			      DES_ENCRYPT);
 	DES_ede3_cbcm_encrypt(&cbc_data[16],&cbc_out[16],i-16,&ks,&ks2,&ks3,
 			      &iv3,&iv2,DES_ENCRYPT);
-	/*	if (memcmp(cbc_out,cbc3_ok,
-		(unsigned int)(strlen((char *)cbc_data)+1+7)/8*8) != 0)
+	/*	if (op_memcmp(cbc_out,cbc3_ok,
+		(unsigned int)(op_strlen((char *)cbc_data)+1+7)/8*8) != 0)
 		{
 		printf("des_ede3_cbc_encrypt encrypt error\n");
 		err=1;
 		}
 	*/
-	memcpy(iv3,cbc_iv,sizeof(cbc_iv));
-	memset(iv2,'\0',sizeof iv2);
+	op_memcpy(iv3,cbc_iv,sizeof(cbc_iv));
+	op_memset(iv2,'\0',sizeof iv2);
 	DES_ede3_cbcm_encrypt(cbc_out,cbc_in,i,&ks,&ks2,&ks3,&iv3,&iv2,DES_DECRYPT);
-	if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0)
+	if (op_memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0)
 		{
 		unsigned int n;
 
@@ -409,20 +415,20 @@
 	for (i=0; i<NUM_TESTS; i++)
 		{
 		DES_set_key_unchecked(&key_data[i],&ks);
-		memcpy(in,plain_data[i],8);
-		memset(out,0,8);
-		memset(outin,0,8);
+		op_memcpy(in,plain_data[i],8);
+		op_memset(out,0,8);
+		op_memset(outin,0,8);
 		des_ecb_encrypt(&in,&out,ks,DES_ENCRYPT);
 		des_ecb_encrypt(&out,&outin,ks,DES_DECRYPT);
 
-		if (memcmp(out,cipher_data[i],8) != 0)
+		if (op_memcmp(out,cipher_data[i],8) != 0)
 			{
 			printf("Encryption error %2d\nk=%s p=%s o=%s act=%s\n",
 				i+1,pt(key_data[i]),pt(in),pt(cipher_data[i]),
 				pt(out));
 			err=1;
 			}
-		if (memcmp(in,outin,8) != 0)
+		if (op_memcmp(in,outin,8) != 0)
 			{
 			printf("Decryption error %2d\nk=%s p=%s o=%s act=%s\n",
 				i+1,pt(key_data[i]),pt(out),pt(in),pt(outin));
@@ -437,20 +443,20 @@
 		DES_set_key_unchecked(&key_data[i],&ks);
 		DES_set_key_unchecked(&key_data[i+1],&ks2);
 		DES_set_key_unchecked(&key_data[i+2],&ks3);
-		memcpy(in,plain_data[i],8);
-		memset(out,0,8);
-		memset(outin,0,8);
+		op_memcpy(in,plain_data[i],8);
+		op_memset(out,0,8);
+		op_memset(outin,0,8);
 		des_ecb2_encrypt(&in,&out,ks,ks2,DES_ENCRYPT);
 		des_ecb2_encrypt(&out,&outin,ks,ks2,DES_DECRYPT);
 
-		if (memcmp(out,cipher_ecb2[i],8) != 0)
+		if (op_memcmp(out,cipher_ecb2[i],8) != 0)
 			{
 			printf("Encryption error %2d\nk=%s p=%s o=%s act=%s\n",
 				i+1,pt(key_data[i]),pt(in),pt(cipher_ecb2[i]),
 				pt(out));
 			err=1;
 			}
-		if (memcmp(in,outin,8) != 0)
+		if (op_memcmp(in,outin,8) != 0)
 			{
 			printf("Decryption error %2d\nk=%s p=%s o=%s act=%s\n",
 				i+1,pt(key_data[i]),pt(out),pt(in),pt(outin));
@@ -465,21 +471,21 @@
 		printf("Key error %d\n",j);
 		err=1;
 		}
-	memset(cbc_out,0,40);
-	memset(cbc_in,0,40);
-	memcpy(iv3,cbc_iv,sizeof(cbc_iv));
+	op_memset(cbc_out,0,40);
+	op_memset(cbc_in,0,40);
+	op_memcpy(iv3,cbc_iv,sizeof(cbc_iv));
 	des_ncbc_encrypt(cbc_data,cbc_out,strlen((char *)cbc_data)+1,ks,
 			 &iv3,DES_ENCRYPT);
-	if (memcmp(cbc_out,cbc_ok,32) != 0)
+	if (op_memcmp(cbc_out,cbc_ok,32) != 0)
 		{
 		printf("cbc_encrypt encrypt error\n");
 		err=1;
 		}
 
-	memcpy(iv3,cbc_iv,sizeof(cbc_iv));
+	op_memcpy(iv3,cbc_iv,sizeof(cbc_iv));
 	des_ncbc_encrypt(cbc_out,cbc_in,strlen((char *)cbc_data)+1,ks,
 			 &iv3,DES_DECRYPT);
-	if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)) != 0)
+	if (op_memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)) != 0)
 		{
 		printf("cbc_encrypt decrypt error\n");
 		err=1;
@@ -492,20 +498,20 @@
 		printf("Key error %d\n",j);
 		err=1;
 		}
-	memset(cbc_out,0,40);
-	memset(cbc_in,0,40);
-	memcpy(iv3,cbc_iv,sizeof(cbc_iv));
+	op_memset(cbc_out,0,40);
+	op_memset(cbc_in,0,40);
+	op_memcpy(iv3,cbc_iv,sizeof(cbc_iv));
 	des_xcbc_encrypt(cbc_data,cbc_out,strlen((char *)cbc_data)+1,ks,
 			 &iv3,&cbc2_key,&cbc3_key, DES_ENCRYPT);
-	if (memcmp(cbc_out,xcbc_ok,32) != 0)
+	if (op_memcmp(cbc_out,xcbc_ok,32) != 0)
 		{
 		printf("des_xcbc_encrypt encrypt error\n");
 		err=1;
 		}
-	memcpy(iv3,cbc_iv,sizeof(cbc_iv));
+	op_memcpy(iv3,cbc_iv,sizeof(cbc_iv));
 	des_xcbc_encrypt(cbc_out,cbc_in,strlen((char *)cbc_data)+1,ks,
 			 &iv3,&cbc2_key,&cbc3_key, DES_DECRYPT);
-	if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0)
+	if (op_memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0)
 		{
 		printf("des_xcbc_encrypt decrypt error\n");
 		err=1;
@@ -528,18 +534,18 @@
 		printf("Key error %d\n",j);
 		err=1;
 		}
-	memset(cbc_out,0,40);
-	memset(cbc_in,0,40);
-	i=strlen((char *)cbc_data)+1;
+	op_memset(cbc_out,0,40);
+	op_memset(cbc_in,0,40);
+	i=op_strlen((char *)cbc_data)+1;
 	/* i=((i+7)/8)*8; */
-	memcpy(iv3,cbc_iv,sizeof(cbc_iv));
+	op_memcpy(iv3,cbc_iv,sizeof(cbc_iv));
 
 	des_ede3_cbc_encrypt(cbc_data,cbc_out,16L,ks,ks2,ks3,&iv3,
 			     DES_ENCRYPT);
 	des_ede3_cbc_encrypt(&(cbc_data[16]),&(cbc_out[16]),i-16,ks,ks2,ks3,
 			     &iv3,DES_ENCRYPT);
-	if (memcmp(cbc_out,cbc3_ok,
-		(unsigned int)(strlen((char *)cbc_data)+1+7)/8*8) != 0)
+	if (op_memcmp(cbc_out,cbc3_ok,
+		(unsigned int)(op_strlen((char *)cbc_data)+1+7)/8*8) != 0)
 		{
 		unsigned int n;
 
@@ -553,9 +559,9 @@
 		err=1;
 		}
 
-	memcpy(iv3,cbc_iv,sizeof(cbc_iv));
+	op_memcpy(iv3,cbc_iv,sizeof(cbc_iv));
 	des_ede3_cbc_encrypt(cbc_out,cbc_in,i,ks,ks2,ks3,&iv3,DES_DECRYPT);
-	if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0)
+	if (op_memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0)
 		{
 		unsigned int n;
 
@@ -576,18 +582,18 @@
 		printf("Key error %d\n",j);
 		err=1;
 		}
-	memset(cbc_out,0,40);
-	memset(cbc_in,0,40);
+	op_memset(cbc_out,0,40);
+	op_memset(cbc_in,0,40);
 	des_pcbc_encrypt(cbc_data,cbc_out,strlen((char *)cbc_data)+1,ks,
 			 &cbc_iv,DES_ENCRYPT);
-	if (memcmp(cbc_out,pcbc_ok,32) != 0)
+	if (op_memcmp(cbc_out,pcbc_ok,32) != 0)
 		{
 		printf("pcbc_encrypt encrypt error\n");
 		err=1;
 		}
 	des_pcbc_encrypt(cbc_out,cbc_in,strlen((char *)cbc_data)+1,ks,&cbc_iv,
 			 DES_DECRYPT);
-	if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0)
+	if (op_memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0)
 		{
 		printf("pcbc_encrypt decrypt error\n");
 		err=1;
@@ -608,21 +614,21 @@
 	printf("cfb64() ");
 	err+=cfb64_test(cfb_cipher64);
 
-	memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
+	op_memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
 	for (i=0; i<sizeof(plain); i++)
 		des_cfb_encrypt(&(plain[i]),&(cfb_buf1[i]),
 			8,1,ks,&cfb_tmp,DES_ENCRYPT);
-	if (memcmp(cfb_cipher8,cfb_buf1,sizeof(plain)) != 0)
+	if (op_memcmp(cfb_cipher8,cfb_buf1,sizeof(plain)) != 0)
 		{
 		printf("cfb_encrypt small encrypt error\n");
 		err=1;
 		}
 
-	memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
+	op_memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
 	for (i=0; i<sizeof(plain); i++)
 		des_cfb_encrypt(&(cfb_buf1[i]),&(cfb_buf2[i]),
 			8,1,ks,&cfb_tmp,DES_DECRYPT);
-	if (memcmp(plain,cfb_buf2,sizeof(plain)) != 0)
+	if (op_memcmp(plain,cfb_buf2,sizeof(plain)) != 0)
 		{
 		printf("cfb_encrypt small decrypt error\n");
 		err=1;
@@ -635,9 +641,9 @@
 
 	printf("Doing ofb\n");
 	DES_set_key_checked(&ofb_key,&ks);
-	memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
+	op_memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
 	des_ofb_encrypt(plain,ofb_buf1,64,sizeof(plain)/8,ks,&ofb_tmp);
-	if (memcmp(ofb_cipher,ofb_buf1,sizeof(ofb_buf1)) != 0)
+	if (op_memcmp(ofb_cipher,ofb_buf1,sizeof(ofb_buf1)) != 0)
 		{
 		printf("ofb_encrypt encrypt error\n");
 printf("%02X %02X %02X %02X %02X %02X %02X %02X\n",
@@ -648,9 +654,9 @@
 ofb_buf1[8+4], ofb_cipher[8+5], ofb_cipher[8+6], ofb_cipher[8+7]);
 		err=1;
 		}
-	memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
+	op_memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
 	des_ofb_encrypt(ofb_buf1,ofb_buf2,64,sizeof(ofb_buf1)/8,ks,&ofb_tmp);
-	if (memcmp(plain,ofb_buf2,sizeof(ofb_buf2)) != 0)
+	if (op_memcmp(plain,ofb_buf2,sizeof(ofb_buf2)) != 0)
 		{
 		printf("ofb_encrypt decrypt error\n");
 printf("%02X %02X %02X %02X %02X %02X %02X %02X\n",
@@ -664,25 +670,25 @@
 
 	printf("Doing ofb64\n");
 	DES_set_key_checked(&ofb_key,&ks);
-	memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
-	memset(ofb_buf1,0,sizeof(ofb_buf1));
-	memset(ofb_buf2,0,sizeof(ofb_buf1));
+	op_memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
+	op_memset(ofb_buf1,0,sizeof(ofb_buf1));
+	op_memset(ofb_buf2,0,sizeof(ofb_buf1));
 	num=0;
 	for (i=0; i<sizeof(plain); i++)
 		{
 		des_ofb64_encrypt(&(plain[i]),&(ofb_buf1[i]),1,ks,&ofb_tmp,
 				  &num);
 		}
-	if (memcmp(ofb_cipher,ofb_buf1,sizeof(ofb_buf1)) != 0)
+	if (op_memcmp(ofb_cipher,ofb_buf1,sizeof(ofb_buf1)) != 0)
 		{
 		printf("ofb64_encrypt encrypt error\n");
 		err=1;
 		}
-	memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
+	op_memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
 	num=0;
 	des_ofb64_encrypt(ofb_buf1,ofb_buf2,sizeof(ofb_buf1),ks,&ofb_tmp,
 			  &num);
-	if (memcmp(plain,ofb_buf2,sizeof(ofb_buf2)) != 0)
+	if (op_memcmp(plain,ofb_buf2,sizeof(ofb_buf2)) != 0)
 		{
 		printf("ofb64_encrypt decrypt error\n");
 		err=1;
@@ -690,25 +696,25 @@
 
 	printf("Doing ede_ofb64\n");
 	DES_set_key_checked(&ofb_key,&ks);
-	memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
-	memset(ofb_buf1,0,sizeof(ofb_buf1));
-	memset(ofb_buf2,0,sizeof(ofb_buf1));
+	op_memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
+	op_memset(ofb_buf1,0,sizeof(ofb_buf1));
+	op_memset(ofb_buf2,0,sizeof(ofb_buf1));
 	num=0;
 	for (i=0; i<sizeof(plain); i++)
 		{
 		des_ede3_ofb64_encrypt(&(plain[i]),&(ofb_buf1[i]),1,ks,ks,
 				       ks,&ofb_tmp,&num);
 		}
-	if (memcmp(ofb_cipher,ofb_buf1,sizeof(ofb_buf1)) != 0)
+	if (op_memcmp(ofb_cipher,ofb_buf1,sizeof(ofb_buf1)) != 0)
 		{
 		printf("ede_ofb64_encrypt encrypt error\n");
 		err=1;
 		}
-	memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
+	op_memcpy(ofb_tmp,ofb_iv,sizeof(ofb_iv));
 	num=0;
 	des_ede3_ofb64_encrypt(ofb_buf1,ofb_buf2,sizeof(ofb_buf1),ks,ks,ks,
 			       &ofb_tmp,&num);
-	if (memcmp(plain,ofb_buf2,sizeof(ofb_buf2)) != 0)
+	if (op_memcmp(plain,ofb_buf2,sizeof(ofb_buf2)) != 0)
 		{
 		printf("ede_ofb64_encrypt decrypt error\n");
 		err=1;
@@ -723,7 +729,7 @@
 			(unsigned long)cs,(unsigned long)cbc_cksum_ret);
 		err=1;
 		}
-	if (memcmp(cret,cbc_cksum_data,8) != 0)
+	if (op_memcmp(cret,cbc_cksum_data,8) != 0)
 		{
 		printf("bad cbc_cksum block returned\n");
 		err=1;
@@ -796,7 +802,7 @@
 		{
 		printf(" %d",i);
 		des_ncbc_encrypt(&(cbc_out[i]),cbc_in,
-				 strlen((char *)cbc_data)+1,ks,
+				 op_strlen((char *)cbc_data)+1,ks,
 				 &cbc_iv,DES_ENCRYPT);
 		}
 	printf("\noutput word alignment test");
@@ -804,19 +810,19 @@
 		{
 		printf(" %d",i);
 		des_ncbc_encrypt(cbc_out,&(cbc_in[i]),
-				 strlen((char *)cbc_data)+1,ks,
+				 op_strlen((char *)cbc_data)+1,ks,
 				 &cbc_iv,DES_ENCRYPT);
 		}
 	printf("\n");
 	printf("fast crypt test ");
 	str=crypt("testing","ef");
-	if (strcmp("efGnQx2725bI2",str) != 0)
+	if (op_strcmp("efGnQx2725bI2",str) != 0)
 		{
 		printf("fast crypt error, %s should be efGnQx2725bI2\n",str);
 		err=1;
 		}
 	str=crypt("bca76;23","yA");
-	if (strcmp("yA1Rp/1hZXIJk",str) != 0)
+	if (op_strcmp("yA1Rp/1hZXIJk",str) != 0)
 		{
 		printf("fast crypt error, %s should be yA1Rp/1hZXIJk\n",str);
 		err=1;
@@ -855,20 +861,20 @@
 	int i,err=0;
 
 	DES_set_key_checked(&cfb_key,&ks);
-	memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
+	op_memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
 	des_cfb_encrypt(plain,cfb_buf1,bits,sizeof(plain),ks,&cfb_tmp,
 			DES_ENCRYPT);
-	if (memcmp(cfb_cipher,cfb_buf1,sizeof(plain)) != 0)
+	if (op_memcmp(cfb_cipher,cfb_buf1,sizeof(plain)) != 0)
 		{
 		err=1;
 		printf("cfb_encrypt encrypt error\n");
 		for (i=0; i<24; i+=8)
 			printf("%s\n",pt(&(cfb_buf1[i])));
 		}
-	memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
+	op_memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
 	des_cfb_encrypt(cfb_buf1,cfb_buf2,bits,sizeof(plain),ks,&cfb_tmp,
 			DES_DECRYPT);
-	if (memcmp(plain,cfb_buf2,sizeof(plain)) != 0)
+	if (op_memcmp(plain,cfb_buf2,sizeof(plain)) != 0)
 		{
 		err=1;
 		printf("cfb_encrypt decrypt error\n");
@@ -884,24 +890,24 @@
 	int err=0,i,n;
 
 	DES_set_key_checked(&cfb_key,&ks);
-	memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
+	op_memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
 	n=0;
 	des_cfb64_encrypt(plain,cfb_buf1,12,ks,&cfb_tmp,&n,DES_ENCRYPT);
 	des_cfb64_encrypt(&(plain[12]),&(cfb_buf1[12]),sizeof(plain)-12,ks,
 			  &cfb_tmp,&n,DES_ENCRYPT);
-	if (memcmp(cfb_cipher,cfb_buf1,sizeof(plain)) != 0)
+	if (op_memcmp(cfb_cipher,cfb_buf1,sizeof(plain)) != 0)
 		{
 		err=1;
 		printf("cfb_encrypt encrypt error\n");
 		for (i=0; i<24; i+=8)
 			printf("%s\n",pt(&(cfb_buf1[i])));
 		}
-	memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
+	op_memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
 	n=0;
 	des_cfb64_encrypt(cfb_buf1,cfb_buf2,17,ks,&cfb_tmp,&n,DES_DECRYPT);
 	des_cfb64_encrypt(&(cfb_buf1[17]),&(cfb_buf2[17]),
 			  sizeof(plain)-17,ks,&cfb_tmp,&n,DES_DECRYPT);
-	if (memcmp(plain,cfb_buf2,sizeof(plain)) != 0)
+	if (op_memcmp(plain,cfb_buf2,sizeof(plain)) != 0)
 		{
 		err=1;
 		printf("cfb_encrypt decrypt error\n");
@@ -917,28 +923,28 @@
 	int err=0,i,n;
 
 	DES_set_key_checked(&cfb_key,&ks);
-	memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
+	op_memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
 	n=0;
 	des_ede3_cfb64_encrypt(plain,cfb_buf1,12,ks,ks,ks,&cfb_tmp,&n,
 			       DES_ENCRYPT);
 	des_ede3_cfb64_encrypt(&(plain[12]),&(cfb_buf1[12]),
 			       sizeof(plain)-12,ks,ks,ks,
 			       &cfb_tmp,&n,DES_ENCRYPT);
-	if (memcmp(cfb_cipher,cfb_buf1,sizeof(plain)) != 0)
+	if (op_memcmp(cfb_cipher,cfb_buf1,sizeof(plain)) != 0)
 		{
 		err=1;
 		printf("ede_cfb_encrypt encrypt error\n");
 		for (i=0; i<24; i+=8)
 			printf("%s\n",pt(&(cfb_buf1[i])));
 		}
-	memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
+	op_memcpy(cfb_tmp,cfb_iv,sizeof(cfb_iv));
 	n=0;
 	des_ede3_cfb64_encrypt(cfb_buf1,cfb_buf2,(long)17,ks,ks,ks,
 			       &cfb_tmp,&n,DES_DECRYPT);
 	des_ede3_cfb64_encrypt(&(cfb_buf1[17]),&(cfb_buf2[17]),
 			       sizeof(plain)-17,ks,ks,ks,
 			       &cfb_tmp,&n,DES_DECRYPT);
-	if (memcmp(plain,cfb_buf2,sizeof(plain)) != 0)
+	if (op_memcmp(plain,cfb_buf2,sizeof(plain)) != 0)
 		{
 		err=1;
 		printf("ede_cfb_encrypt decrypt error\n");
diff -Naur openssl-1.0.0q.orig/crypto/des/ecb3_enc.c openssl-1.0.0q/crypto/des/ecb3_enc.c
--- openssl-1.0.0q.orig/crypto/des/ecb3_enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/des/ecb3_enc.c	2017-04-25 16:23:40.162528195 +0200
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/cryptlib.h>
 #include "des_locl.h"
 
 void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
diff -Naur openssl-1.0.0q.orig/crypto/des/ecb_enc.c openssl-1.0.0q/crypto/des/ecb_enc.c
--- openssl-1.0.0q.orig/crypto/des/ecb_enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/des/ecb_enc.c	2017-04-25 16:23:40.162528195 +0200
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/cryptlib.h>
 #include "des_locl.h"
 #include "des_ver.h"
 #include <openssl/opensslv.h>
diff -Naur openssl-1.0.0q.orig/crypto/des/enc_read.c openssl-1.0.0q/crypto/des/enc_read.c
--- openssl-1.0.0q.orig/crypto/des/enc_read.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/enc_read.c	2017-04-25 16:23:40.163527205 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include "des_locl.h"
 
@@ -127,7 +129,7 @@
 			/* we still still need more data but will return
 			 * with the number of bytes we have - should always
 			 * check the return value */
-			memcpy(buf,&(unnet[unnet_start]),
+			op_memcpy(buf,&(unnet[unnet_start]),
 			       unnet_left);
 			/* eay 26/08/92 I had the next 2 lines
 			 * reversed :-( */
@@ -136,7 +138,7 @@
 			}
 		else
 			{
-			memcpy(buf,&(unnet[unnet_start]),len);
+			op_memcpy(buf,&(unnet[unnet_start]),len);
 			unnet_start+=len;
 			unnet_left-=len;
 			i=len;
@@ -195,7 +197,7 @@
 			DES_pcbc_encrypt(net,unnet,num,sched,iv,DES_DECRYPT);
 		else
 			DES_cbc_encrypt(net,unnet,num,sched,iv,DES_DECRYPT);
-		memcpy(buf,unnet,len);
+		op_memcpy(buf,unnet,len);
 		unnet_start=len;
 		unnet_left=num-len;
 
@@ -222,7 +224,7 @@
 
 			/* eay 26/08/92 fix a bug that returned more
 			 * bytes than you asked for (returned len bytes :-( */
-			memcpy(buf,tmpbuf,num);
+			op_memcpy(buf,tmpbuf,num);
 			}
 		else
 			{
diff -Naur openssl-1.0.0q.orig/crypto/des/enc_writ.c openssl-1.0.0q/crypto/des/enc_writ.c
--- openssl-1.0.0q.orig/crypto/des/enc_writ.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/enc_writ.c	2017-04-25 16:23:40.164526494 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <errno.h>
 #include <time.h>
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include "des_locl.h"
 #include <openssl/rand.h>
@@ -84,7 +86,7 @@
 	return (-1);
 #else
 #ifdef _LIBC
-	extern unsigned long time();
+	extern unsigned long op_time();
 	extern int write();
 #endif
 	const unsigned char *buf=_buf;
@@ -132,7 +134,7 @@
 	if (len < 8)
 		{
 		cp=shortbuf;
-		memcpy(shortbuf,buf,len);
+		op_memcpy(shortbuf,buf,len);
 		RAND_pseudo_bytes(shortbuf+len, 8-len);
 		rnum=8;
 		}
diff -Naur openssl-1.0.0q.orig/crypto/des/fcrypt.c openssl-1.0.0q/crypto/des/fcrypt.c
--- openssl-1.0.0q.orig/crypto/des/fcrypt.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/fcrypt.c	2017-04-25 16:23:40.165530253 +0200
@@ -1,5 +1,10 @@
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 /* NOCW */
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #ifdef _OSD_POSIX
 #ifndef CHARSET_EBCDIC
 #define CHARSET_EBCDIC 1
@@ -74,7 +79,7 @@
 	    e_salt[1] = salt[1];
 
 	/* Copy at most 32 chars of password */
-	strncpy (e_buf, buf, sizeof(e_buf));
+	op_strncpy (e_buf, buf, sizeof(e_buf));
 
 	/* Make sure we have a delimiter */
 	e_salt[sizeof(e_salt)-1] = e_buf[sizeof(e_buf)-1] = '\0';
@@ -89,7 +94,7 @@
 	ret = DES_fcrypt(e_buf,e_salt,buff);
 
 	/* Convert the result back to EBCDIC */
-	ascii2ebcdic(ret, ret, strlen(ret));
+	ascii2ebcdic(ret, ret, op_strlen(ret));
 	
 	return ret;
 #endif
@@ -128,7 +133,7 @@
 #endif
 
 /* EAY
-r=strlen(buf);
+r=op_strlen(buf);
 r=(r+7)/8;
 */
 	for (i=0; i<8; i++)
diff -Naur openssl-1.0.0q.orig/crypto/des/fcrypt_b.c openssl-1.0.0q/crypto/des/fcrypt_b.c
--- openssl-1.0.0q.orig/crypto/des/fcrypt_b.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/des/fcrypt_b.c	2017-04-25 16:23:40.166527027 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 /* This version of crypt has been developed from my MIT compatible
  * DES library.
diff -Naur openssl-1.0.0q.orig/crypto/des/ncbc_enc.c openssl-1.0.0q/crypto/des/ncbc_enc.c
--- openssl-1.0.0q.orig/crypto/des/ncbc_enc.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/ncbc_enc.c	2017-04-25 16:23:40.167527713 +0200
@@ -63,6 +63,8 @@
 
 #include "des_locl.h"
 
+#ifdef SSL_USE_WEAK_CIPHERS
+
 #ifdef CBC_ENC_C__DONT_UPDATE_IV
 void DES_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
 		     DES_key_schedule *_schedule, DES_cblock *ivec, int enc)
@@ -146,3 +148,5 @@
 	tin0=tin1=tout0=tout1=xor0=xor1=0;
 	tin[0]=tin[1]=0;
 	}
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/des/opera_cbc3_enc.cpp openssl-1.0.0q/crypto/des/opera_cbc3_enc.cpp
--- openssl-1.0.0q.orig/crypto/des/opera_cbc3_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/des/opera_cbc3_enc.cpp	2017-04-25 16:23:40.168527561 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "cbc3_enc.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/des/opera_cfb64ede.cpp openssl-1.0.0q/crypto/des/opera_cfb64ede.cpp
--- openssl-1.0.0q.orig/crypto/des/opera_cfb64ede.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/des/opera_cfb64ede.cpp	2017-04-25 16:23:40.168527561 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/des/cfb64ede.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/des/opera_cfb64enc.cpp openssl-1.0.0q/crypto/des/opera_cfb64enc.cpp
--- openssl-1.0.0q.orig/crypto/des/opera_cfb64enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/des/opera_cfb64enc.cpp	2017-04-25 16:23:40.169526850 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/des/cfb64enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/des/opera_cfb_enc.cpp openssl-1.0.0q/crypto/des/opera_cfb_enc.cpp
--- openssl-1.0.0q.orig/crypto/des/opera_cfb_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/des/opera_cfb_enc.cpp	2017-04-25 16:23:40.170530050 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/des/cfb_enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/des/opera_des_enc.cpp openssl-1.0.0q/crypto/des/opera_des_enc.cpp
--- openssl-1.0.0q.orig/crypto/des/opera_des_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/des/opera_des_enc.cpp	2017-04-25 16:23:40.170530050 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch_system_includes.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/des/des_enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/des/opera_ecb3_enc.cpp openssl-1.0.0q/crypto/des/opera_ecb3_enc.cpp
--- openssl-1.0.0q.orig/crypto/des/opera_ecb3_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/des/opera_ecb3_enc.cpp	2017-04-25 16:23:40.171527384 +0200
@@ -0,0 +1,17 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2009 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/des/ecb3_enc.c"
+}
+#endif 
diff -Naur openssl-1.0.0q.orig/crypto/des/opera_ecb_enc.cpp openssl-1.0.0q/crypto/des/opera_ecb_enc.cpp
--- openssl-1.0.0q.orig/crypto/des/opera_ecb_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/des/opera_ecb_enc.cpp	2017-04-25 16:23:40.171527384 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "ecb_enc.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/des/opera_set_key.cpp openssl-1.0.0q/crypto/des/opera_set_key.cpp
--- openssl-1.0.0q.orig/crypto/des/opera_set_key.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/des/opera_set_key.cpp	2017-04-25 16:23:40.172528069 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch_system_includes.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/des/set_key.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/des/read2pwd.c openssl-1.0.0q/crypto/des/read2pwd.c
--- openssl-1.0.0q.orig/crypto/des/read2pwd.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/des/read2pwd.c	2017-04-25 16:23:40.172528069 +0200
@@ -109,7 +109,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/des.h>
 #include <openssl/ui.h>
 #include <openssl/crypto.h>
diff -Naur openssl-1.0.0q.orig/crypto/des/read_pwd.c openssl-1.0.0q/crypto/des/read_pwd.c
--- openssl-1.0.0q.orig/crypto/des/read_pwd.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/read_pwd.c	2017-04-25 16:23:40.173527638 +0200
@@ -56,6 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include <openssl/e_os2.h>
 #if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WIN32)
 #ifdef OPENSSL_UNISTD
@@ -87,10 +90,14 @@
 #include "des_locl.h"
 #include "cryptlib.h"
 #include <signal.h>
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <setjmp.h>
+#ifndef OPERA_SMALL_VERSION
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #ifdef OPENSSL_SYS_VMS			/* prototypes for sys$whatever */
 #include <starlet.h>
@@ -100,7 +107,9 @@
 #endif
 
 #ifdef WIN_CONSOLE_BUG
+#ifndef OPERA_SMALL_VERSION
 #include <windows.h>
+#endif /* !OPERA_SMALL_VERSION */
 #ifndef OPENSSL_SYS_WINCE
 #include <wincon.h>
 #endif
@@ -228,8 +237,8 @@
 
 int des_read_pw(char *buf, char *buff, int size, const char *prompt, int verify)
 	{ 
-	memset(buf,0,size);
-	memset(buff,0,size);
+	op_memset(buf,0,size);
+	op_memset(buff,0,size);
 	return(0);
 	}
 
@@ -237,8 +246,8 @@
 
 int des_read_pw(char *buf, char *buff, int size, char *prompt, int verify)
 	{ 
-	memset(buf,0,size);
-	memset(buff,0,size);
+	op_memset(buf,0,size);
+	op_memset(buff,0,size);
 	return(0);
 	}
 
@@ -251,7 +260,7 @@
 
 	do	{
 		fgets(buf,SIZE,in);
-		} while (strchr(buf,'\n') == NULL);
+		} while (op_strchr(buf,'\n') == NULL);
 	}
 
 
@@ -320,7 +329,7 @@
 #endif
 			return(-1);
 		}
-	memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig));
+	op_memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig));
 #endif
 #ifdef OPENSSL_SYS_VMS
 	status = sys$assign(&terminal,&channel,0,0);
@@ -379,7 +388,7 @@
 				*p='\0';
 			else	read_till_nl(tty);
 				
-			if (strcmp(buf,buff) != 0)
+			if (op_strcmp(buf,buff) != 0)
 				{
 				fprintf(stderr,"\nVerify failure");
 				fflush(stderr);
@@ -419,7 +428,7 @@
 #ifdef SIGACTION
 	struct sigaction sa;
 
-	memset(&sa,0,sizeof sa);
+	op_memset(&sa,0,sizeof sa);
 	sa.sa_handler=recsig;
 #endif
 
@@ -515,7 +524,7 @@
 			FlushConsoleInputBuffer(inh);
 		}
 #endif
-	return(strlen(buf));
+	return(op_strlen(buf));
 	}
 #endif
 #endif /* !OPENSSL_SYS_WINCE && !WIN16 */
diff -Naur openssl-1.0.0q.orig/crypto/des/rpc_des.h openssl-1.0.0q/crypto/des/rpc_des.h
--- openssl-1.0.0q.orig/crypto/des/rpc_des.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/rpc_des.h	2017-04-25 16:23:40.174527765 +0200
@@ -112,7 +112,7 @@
 	unsigned char des_ivec[8];	/* input vector */
 	unsigned des_len;	/* number of bytes to crypt */
 	union {
-		unsigned char UDES_data[DES_QUICKLEN];
+		unsigned char UDES_data[DES_QUICKLEN]; /* ARRAY OK UNUSED OPERA 2004-02-18 yngve*/
 		unsigned char *UDES_buf;
 	} UDES;
 #	define des_data UDES.UDES_data	/* direct data here if quick */
diff -Naur openssl-1.0.0q.orig/crypto/des/rpw.c openssl-1.0.0q/crypto/des/rpw.c
--- openssl-1.0.0q.orig/crypto/des/rpw.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/rpw.c	2017-04-25 16:23:40.175527892 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/des.h>
 
 int main(int argc, char *argv[])
diff -Naur openssl-1.0.0q.orig/crypto/des/set_key.c openssl-1.0.0q/crypto/des/set_key.c
--- openssl-1.0.0q.orig/crypto/des/set_key.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/des/set_key.c	2017-04-25 16:23:40.176528019 +0200
@@ -63,8 +63,10 @@
  * 1.1 added norm_expand_bits
  * 1.0 First working version
  */
+#include <openssl/cryptlib.h>
 #include "des_locl.h"
 
+#if !defined OPERA_SMALL_VERSION ||defined SSL_USE_WEAK_CIPHERS
 OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key,0)	/* defaults to false */
 
 static const unsigned char odd_parity[256]={
@@ -146,9 +148,10 @@
 		 * eay 93/06/29
 		 * Another problem, I was comparing only the first 4
 		 * bytes, 97/03/18 */
-		if (memcmp(weak_keys[i],key,sizeof(DES_cblock)) == 0) return(1);
+		if (op_memcmp(weak_keys[i],key,sizeof(DES_cblock)) == 0) return(1);
 	return(0);
 	}
+#endif
 
 /* NOW DEFINED IN des_local.h
  * See ecb_encrypt.c for a pseudo description of these macros. 
@@ -307,6 +310,7 @@
 	0x00002822L,0x04002822L,0x00042822L,0x04042822L,
 	}};
 
+#ifdef SSL_USE_WEAK_CIPHERS
 int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule)
 	{
 	if (DES_check_key)
@@ -333,6 +337,7 @@
 	DES_set_key_unchecked(key, schedule);
 	return 0;
 	}
+#endif
 
 void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule)
 	{
@@ -343,7 +348,7 @@
 	register int i;
 
 #ifdef OPENBSD_DEV_CRYPTO
-	memcpy(schedule->key,key,sizeof schedule->key);
+	op_memcpy(schedule->key,key,sizeof schedule->key);
 	schedule->session=NULL;
 #endif
 	k = &schedule->ks->deslong[0];
@@ -394,10 +399,12 @@
 		}
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule)
 	{
 	return(DES_set_key(key,schedule));
 	}
+#endif
 /*
 #undef des_fixup_key_parity
 void des_fixup_key_parity(des_cblock *key)
diff -Naur openssl-1.0.0q.orig/crypto/des/speed.c openssl-1.0.0q/crypto/des/speed.c
--- openssl-1.0.0q.orig/crypto/des/speed.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/des/speed.c	2017-04-25 16:23:40.177527588 +0200
@@ -63,7 +63,9 @@
 #define TIMES
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/e_os2.h>
 #include OPENSSL_UNISTD_IO
@@ -75,10 +77,14 @@
 #endif
 
 #ifndef _IRIX
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef TIMES
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/times.h>
 #endif
 
@@ -96,7 +102,9 @@
 
 #if defined(sun) || defined(__ultrix)
 #define _POSIX_SOURCE
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/param.h>
 #endif
 
diff -Naur openssl-1.0.0q.orig/crypto/des/str2key.c openssl-1.0.0q/crypto/des/str2key.c
--- openssl-1.0.0q.orig/crypto/des/str2key.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/des/str2key.c	2017-04-25 16:23:40.178527715 +0200
@@ -65,8 +65,8 @@
 	int i,length;
 	register unsigned char j;
 
-	memset(key,0,8);
-	length=strlen(str);
+	op_memset(key,0,8);
+	length=op_strlen(str);
 #ifdef OLD_STR_TO_KEY
 	for (i=0; i<length; i++)
 		(*key)[i%8]^=(str[i]<<1);
@@ -105,9 +105,9 @@
 	int i,length;
 	register unsigned char j;
 
-	memset(key1,0,8);
-	memset(key2,0,8);
-	length=strlen(str);
+	op_memset(key1,0,8);
+	op_memset(key2,0,8);
+	length=op_strlen(str);
 #ifdef OLD_STR_TO_KEY
 	if (length <= 8)
 		{
@@ -148,7 +148,7 @@
 				(*key2)[7-(i%8)]^=j;
 			}
 		}
-	if (length <= 8) memcpy(key2,key1,8);
+	if (length <= 8) op_memcpy(key2,key1,8);
 #endif
 	DES_set_odd_parity(key1);
 	DES_set_odd_parity(key2);
diff -Naur openssl-1.0.0q.orig/crypto/dh/.gitignore openssl-1.0.0q/crypto/dh/.gitignore
--- openssl-1.0.0q.orig/crypto/dh/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/.gitignore	2017-04-25 16:23:40.179526724 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/dh/dh_ameth.c openssl-1.0.0q/crypto/dh/dh_ameth.c
--- openssl-1.0.0q.orig/crypto/dh/dh_ameth.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/dh_ameth.c	2017-04-25 16:23:40.180526572 +0200
@@ -55,13 +55,19 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include <openssl/dh.h>
 #include <openssl/bn.h>
-#include "asn1_locl.h"
+#include "../asn1/asn1_locl.h"
+
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 static void int_dh_free(EVP_PKEY *pkey)
 	{
@@ -90,7 +96,7 @@
 		goto err;
 		}
 
-	pstr = pval;	
+	pstr = (ASN1_STRING *)pval;
 	pm = pstr->data;
 	pmlen = pstr->length;
 
@@ -170,7 +176,7 @@
 	if (penc)
 		OPENSSL_free(penc);
 	if (pval)
-		ASN1_STRING_free(pval);
+		ASN1_STRING_free((ASN1_STRING *)pval);
 
 	return 0;
 	}
@@ -205,7 +211,7 @@
 		goto decerr;
 
 
-	pstr = pval;	
+	pstr = (ASN1_STRING *)pval;
 	pm = pstr->data;
 	pmlen = pstr->length;
 	if (!(dh = d2i_DHparams(NULL, &pm, pmlen)))
@@ -353,7 +359,7 @@
 	else
 		ktype = "PKCS#3 DH Parameters";
 
-	m= OPENSSL_malloc(buf_len+10);
+	m = (unsigned char *)OPENSSL_malloc(buf_len+10);
 	if (m == NULL)
 		{
 		reason=ERR_R_MALLOC_FAILURE;
@@ -466,14 +472,13 @@
 	return do_dh_print(bp, x, 4, NULL, 0);
 	}
 
-const EVP_PKEY_ASN1_METHOD dh_asn1_meth = 
-	{
+CONST_EVP_PKEY_ASN1_METHOD_ITEM(dh_ameth__dh_asn1_meth,
 	EVP_PKEY_DH,
 	EVP_PKEY_DH,
 	0,
 
-	"DH",
-	"OpenSSL PKCS#3 DH method",
+	(char *)"DH",
+	(char *)"OpenSSL PKCS#3 DH method",
 
 	dh_pub_decode,
 	dh_pub_encode,
@@ -495,6 +500,7 @@
 	dh_param_print,
 
 	int_dh_free,
+	0,
+	0,
 	0
-	};
-
+	);
diff -Naur openssl-1.0.0q.orig/crypto/dh/dh_asn1.c openssl-1.0.0q/crypto/dh/dh_asn1.c
--- openssl-1.0.0q.orig/crypto/dh/dh_asn1.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/dh_asn1.c	2017-04-25 16:23:40.181526699 +0200
@@ -56,12 +56,17 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/dh.h>
 #include <openssl/objects.h>
 #include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 /* Override the default free and new methods */
 static int dh_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
@@ -79,15 +84,15 @@
 	return 1;
 }
 
-ASN1_SEQUENCE_cb(DHparams, dh_cb) = {
-	ASN1_SIMPLE(DH, p, BIGNUM),
-	ASN1_SIMPLE(DH, g, BIGNUM),
-	ASN1_OPT(DH, length, ZLONG),
-} ASN1_SEQUENCE_END_cb(DH, DHparams)
+ASN1_SEQUENCE_cb(DHparams, dh_cb)
+	ASN1_SIMPLE(DH, p, BIGNUM)
+	ASN1_SIMPLE(DH, g, BIGNUM)
+	ASN1_OPT(DH, length, ZLONG)
+ASN1_SEQUENCE_END_cb(DH, DHparams)
 
 IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DH, DHparams, DHparams)
 
 DH *DHparams_dup(DH *dh)
 	{
-	return ASN1_item_dup(ASN1_ITEM_rptr(DHparams), dh);
+	return (DH *)ASN1_item_dup(ASN1_ITEM_rptr(DHparams), dh);
 	}
diff -Naur openssl-1.0.0q.orig/crypto/dh/dh_check.c openssl-1.0.0q/crypto/dh/dh_check.c
--- openssl-1.0.0q.orig/crypto/dh/dh_check.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/dh_check.c	2017-04-25 16:23:40.181526699 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/dh.h>
 
@@ -70,6 +72,7 @@
  * should hold.
  */
 
+#ifndef OPERA_SMALL_VERSION
 int DH_check(const DH *dh, int *ret)
 	{
 	int ok=0;
@@ -118,6 +121,7 @@
 	if (q != NULL) BN_free(q);
 	return(ok);
 	}
+#endif
 
 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/dh/dh_err.c openssl-1.0.0q/crypto/dh/dh_err.c
--- openssl-1.0.0q.orig/crypto/dh/dh_err.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/dh_err.c	2017-04-25 16:23:40.182526547 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/dh.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/dh/dh_gen.c openssl-1.0.0q/crypto/dh/dh_gen.c
--- openssl-1.0.0q.orig/crypto/dh/dh_gen.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/dh_gen.c	2017-04-25 16:23:40.183527792 +0200
@@ -61,8 +61,11 @@
  *  - Geoff
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/dh.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/dh/dh_key.c openssl-1.0.0q/crypto/dh/dh_key.c
--- openssl-1.0.0q.orig/crypto/dh/dh_key.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/dh_key.c	2017-04-25 16:23:40.185527487 +0200
@@ -56,11 +56,15 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#ifndef OPENSSL_NO_DH
 #include <openssl/bn.h>
 #include <openssl/rand.h>
 #include <openssl/dh.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int generate_key(DH *dh);
 static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
@@ -81,21 +85,21 @@
 	return dh->meth->compute_key(key, pub_key, dh);
 	}
 
-static DH_METHOD dh_ossl = {
-"OpenSSL DH Method",
-generate_key,
-compute_key,
-dh_bn_mod_exp,
-dh_init,
-dh_finish,
-0,
-NULL,
-NULL
-};
+OPENSSL_PREFIX_CONST_ITEM(static, DH_METHOD, dh_ossl, libopeay)
+  CONST_ITEM_ENTRY_START(name,OPERA_OPENSSL_STRINGS("OpenSSL DH Method"))
+  CONST_ITEM_ENTRY_SINGLE(generate_key, generate_key)
+  CONST_ITEM_ENTRY_SINGLE(compute_key, compute_key)
+  CONST_ITEM_ENTRY_SINGLE(bn_mod_exp, dh_bn_mod_exp)
+  CONST_ITEM_ENTRY_SINGLE(init, dh_init)
+  CONST_ITEM_ENTRY_SINGLE(finish, dh_finish)
+  CONST_ITEM_ENTRY_SINGLE(flags, 0)
+  CONST_ITEM_ENTRY_SINGLE(app_data, NULL)
+  CONST_ITEM_ENTRY_SINGLE(generate_params, NULL)
+CONST_ITEM_ENTRY_END;
 
 const DH_METHOD *DH_OpenSSL(void)
 {
-	return &dh_ossl;
+	return &OPENSSL_GLOBAL_ITEM_NAME(dh_ossl);
 }
 
 static int generate_key(DH *dh)
@@ -261,3 +265,4 @@
 		BN_MONT_CTX_free(dh->method_mont_p);
 	return(1);
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/dh/dh_lib.c openssl-1.0.0q/crypto/dh/dh_lib.c
--- openssl-1.0.0q.orig/crypto/dh/dh_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/dh_lib.c	2017-04-25 16:23:40.186527335 +0200
@@ -56,30 +56,44 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#ifndef OPENSSL_NO_DH
 #include <openssl/bn.h>
 #include <openssl/dh.h>
 #ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
 #endif
 
-const char DH_version[]="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char DH_version[]="Diffie-Hellman" OPENSSL_VERSION_PTEXT;/* ARRAY OK 2008-02-26 haavardm */
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 static const DH_METHOD *default_DH_method = NULL;
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 void DH_set_default_method(const DH_METHOD *meth)
 	{
 	default_DH_method = meth;
 	}
+#endif
 
 const DH_METHOD *DH_get_default_method(void)
 	{
+#ifndef OPERA_SMALL_VERSION
 	if(!default_DH_method)
 		default_DH_method = DH_OpenSSL();
 	return default_DH_method;
+#else
+	return DH_OpenSSL();
+#endif
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int DH_set_method(DH *dh, const DH_METHOD *meth)
 	{
 	/* NB: The caller is specifically setting a method, so it's not up to us
@@ -98,6 +112,7 @@
         if (meth->init) meth->init(dh);
         return 1;
 	}
+#endif
 
 DH *DH_new(void)
 	{
@@ -245,3 +260,5 @@
 	{
 	return(BN_num_bytes(dh->p));
 	}
+
+#endif /* OPENSSL_NO_DH */
diff -Naur openssl-1.0.0q.orig/crypto/dh/dh_pmeth.c openssl-1.0.0q/crypto/dh/dh_pmeth.c
--- openssl-1.0.0q.orig/crypto/dh/dh_pmeth.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/dh_pmeth.c	2017-04-25 16:23:40.187527182 +0200
@@ -55,14 +55,19 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/evp.h>
 #include <openssl/dh.h>
 #include <openssl/bn.h>
-#include "evp_locl.h"
+#include "../evp/evp_locl.h"
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 /* DH pkey context structure */
 
@@ -80,7 +85,7 @@
 static int pkey_dh_init(EVP_PKEY_CTX *ctx)
 	{
 	DH_PKEY_CTX *dctx;
-	dctx = OPENSSL_malloc(sizeof(DH_PKEY_CTX));
+	dctx = (DH_PKEY_CTX *)OPENSSL_malloc(sizeof(DH_PKEY_CTX));
 	if (!dctx)
 		return 0;
 	dctx->prime_len = 1024;
@@ -99,8 +104,8 @@
 	DH_PKEY_CTX *dctx, *sctx;
 	if (!pkey_dh_init(dst))
 		return 0;
-       	sctx = src->data;
-	dctx = dst->data;
+       	sctx = (DH_PKEY_CTX *)src->data;
+	dctx = (DH_PKEY_CTX *)dst->data;
 	dctx->prime_len = sctx->prime_len;
 	dctx->generator = sctx->generator;
 	dctx->use_dsa = sctx->use_dsa;
@@ -109,14 +114,14 @@
 
 static void pkey_dh_cleanup(EVP_PKEY_CTX *ctx)
 	{
-	DH_PKEY_CTX *dctx = ctx->data;
+	DH_PKEY_CTX *dctx = (DH_PKEY_CTX *)ctx->data;
 	if (dctx)
 		OPENSSL_free(dctx);
 	}
 
 static int pkey_dh_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
 	{
-	DH_PKEY_CTX *dctx = ctx->data;
+	DH_PKEY_CTX *dctx = (DH_PKEY_CTX *)ctx->data;
 	switch (type)
 		{
 		case EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN:
@@ -161,7 +166,7 @@
 static int pkey_dh_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
 	{
 	DH *dh = NULL;
-	DH_PKEY_CTX *dctx = ctx->data;
+	DH_PKEY_CTX *dctx = (DH_PKEY_CTX *)ctx->data;
 	BN_GENCB *pcb, cb;
 	int ret;
 	if (ctx->pkey_gencb)
@@ -217,8 +222,7 @@
 	return 1;
 	}
 
-const EVP_PKEY_METHOD dh_pkey_meth = 
-	{
+CONST_EVP_PKEY_METHOD_ITEM(dh_pmeth__dh_pkey_meth,
 	EVP_PKEY_DH,
 	EVP_PKEY_FLAG_AUTOARGLEN,
 	pkey_dh_init,
@@ -251,4 +255,4 @@
 	pkey_dh_ctrl,
 	pkey_dh_ctrl_str
 
-	};
+	);
diff -Naur openssl-1.0.0q.orig/crypto/dh/dhtest.c openssl-1.0.0q/crypto/dh/dhtest.c
--- openssl-1.0.0q.orig/crypto/dh/dhtest.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/dhtest.c	2017-04-25 16:23:40.188526472 +0200
@@ -56,6 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 /* Until the key-gen callbacks are modified to use newer prototypes, we allow
  * deprecated functions for openssl-internal code */
 #ifdef OPENSSL_NO_DEPRECATED
@@ -65,6 +69,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -170,7 +175,7 @@
 	BIO_puts(out,"key1 =");
 	for (i=0; i<aout; i++)
 		{
-		sprintf(buf,"%02X",abuf[i]);
+		op_sprintf(buf,"%02X",abuf[i]);
 		BIO_puts(out,buf);
 		}
 	BIO_puts(out,"\n");
@@ -182,11 +187,11 @@
 	BIO_puts(out,"key2 =");
 	for (i=0; i<bout; i++)
 		{
-		sprintf(buf,"%02X",bbuf[i]);
+		op_sprintf(buf,"%02X",bbuf[i]);
 		BIO_puts(out,buf);
 		}
 	BIO_puts(out,"\n");
-	if ((aout < 4) || (bout != aout) || (memcmp(abuf,bbuf,aout) != 0))
+	if ((aout < 4) || (bout != aout) || (op_memcmp(abuf,bbuf,aout) != 0))
 		{
 		fprintf(stderr,"Error in DH routines\n");
 		ret=1;
diff -Naur openssl-1.0.0q.orig/crypto/dh/opera_dh_ameth.cpp openssl-1.0.0q/crypto/dh/opera_dh_ameth.cpp
--- openssl-1.0.0q.orig/crypto/dh/opera_dh_ameth.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/opera_dh_ameth.cpp	2017-04-25 16:23:40.188526472 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dh/dh_ameth.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dh/opera_dh_asn1.cpp openssl-1.0.0q/crypto/dh/opera_dh_asn1.cpp
--- openssl-1.0.0q.orig/crypto/dh/opera_dh_asn1.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/opera_dh_asn1.cpp	2017-04-25 16:23:40.189528275 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dh/dh_asn1.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dh/opera_dh_check.cpp openssl-1.0.0q/crypto/dh/opera_dh_check.cpp
--- openssl-1.0.0q.orig/crypto/dh/opera_dh_check.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/opera_dh_check.cpp	2017-04-25 16:23:40.189528275 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dh/dh_check.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dh/opera_dh_gen.cpp openssl-1.0.0q/crypto/dh/opera_dh_gen.cpp
--- openssl-1.0.0q.orig/crypto/dh/opera_dh_gen.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/opera_dh_gen.cpp	2017-04-25 16:23:40.190527564 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dh/dh_gen.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dh/opera_dh_key.cpp openssl-1.0.0q/crypto/dh/opera_dh_key.cpp
--- openssl-1.0.0q.orig/crypto/dh/opera_dh_key.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/opera_dh_key.cpp	2017-04-25 16:23:40.190527564 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dh/dh_key.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dh/opera_dh_lib.cpp openssl-1.0.0q/crypto/dh/opera_dh_lib.cpp
--- openssl-1.0.0q.orig/crypto/dh/opera_dh_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/opera_dh_lib.cpp	2017-04-25 16:23:40.191527691 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dh/dh_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dh/opera_dh_pmeth.cpp openssl-1.0.0q/crypto/dh/opera_dh_pmeth.cpp
--- openssl-1.0.0q.orig/crypto/dh/opera_dh_pmeth.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/opera_dh_pmeth.cpp	2017-04-25 16:23:40.191527691 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dh/dh_pmeth.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dh/p1024.c openssl-1.0.0q/crypto/dh/p1024.c
--- openssl-1.0.0q.orig/crypto/dh/p1024.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/p1024.c	2017-04-25 16:23:40.192527539 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/bn.h>
 #include <openssl/asn1.h>
 #include <openssl/dh.h>
diff -Naur openssl-1.0.0q.orig/crypto/dh/p192.c openssl-1.0.0q/crypto/dh/p192.c
--- openssl-1.0.0q.orig/crypto/dh/p192.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/p192.c	2017-04-25 16:23:40.193526828 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/bn.h>
 #include <openssl/asn1.h>
 #include <openssl/dh.h>
diff -Naur openssl-1.0.0q.orig/crypto/dh/p512.c openssl-1.0.0q/crypto/dh/p512.c
--- openssl-1.0.0q.orig/crypto/dh/p512.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dh/p512.c	2017-04-25 16:23:40.194529469 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/bn.h>
 #include <openssl/asn1.h>
 #include <openssl/dh.h>
diff -Naur openssl-1.0.0q.orig/crypto/dsa/.gitignore openssl-1.0.0q/crypto/dsa/.gitignore
--- openssl-1.0.0q.orig/crypto/dsa/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/.gitignore	2017-04-25 16:23:40.195527920 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsa_ameth.c openssl-1.0.0q/crypto/dsa/dsa_ameth.c
--- openssl-1.0.0q.orig/crypto/dsa/dsa_ameth.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsa_ameth.c	2017-04-25 16:23:40.196527488 +0200
@@ -55,8 +55,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include <openssl/dsa.h>
@@ -64,7 +67,9 @@
 #ifndef OPENSSL_NO_CMS
 #include <openssl/cms.h>
 #endif
-#include "asn1_locl.h"
+#include "../asn1/asn1_locl.h"
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 static int dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
 	{
@@ -85,7 +90,7 @@
 
 	if (ptype == V_ASN1_SEQUENCE)
 		{
-		pstr = pval;	
+		pstr = (ASN1_STRING *)pval;
 		pm = pstr->data;
 		pmlen = pstr->length;
 
@@ -178,7 +183,7 @@
 	if (penc)
 		OPENSSL_free(penc);
 	if (pval)
-		ASN1_STRING_free(pval);
+		ASN1_STRING_free((ASN1_STRING *)pval);
 
 	return 0;
 	}
@@ -251,7 +256,7 @@
 			goto decerr;
 		}
 
-	pstr = pval;	
+	pstr = (ASN1_STRING *)pval;
 	pm = pstr->data;
 	pmlen = pstr->length;
 	if (!(dsa = d2i_DSAparams(NULL, &pm, pmlen)))
@@ -557,7 +562,7 @@
 			{
 			int snid, hnid;
 			X509_ALGOR *alg1, *alg2;
-			PKCS7_SIGNER_INFO_get0_algs(arg2, NULL, &alg1, &alg2);
+			PKCS7_SIGNER_INFO_get0_algs((PKCS7_SIGNER_INFO *)arg2, NULL, &alg1, &alg2);
 			if (alg1 == NULL || alg1->algorithm == NULL)
 				return -1;
 			hnid = OBJ_obj2nid(alg1->algorithm);
@@ -574,7 +579,7 @@
 			{
 			int snid, hnid;
 			X509_ALGOR *alg1, *alg2;
-			CMS_SignerInfo_get0_algs(arg2, NULL, NULL, &alg1, &alg2);
+			CMS_SignerInfo_get0_algs((CMS_SignerInfo *)arg2, NULL, NULL, &alg1, &alg2);
 			if (alg1 == NULL || alg1->algorithm == NULL)
 				return -1;
 			hnid = OBJ_obj2nid(alg1->algorithm);
@@ -600,40 +605,55 @@
 
 /* NB these are sorted in pkey_id order, lowest first */
 
-const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] = 
-	{
 
-		{
+
+CONST_EVP_PKEY_ASN1_METHOD_ITEM(dsa_ameth__dsa_asn1_meth0,
 		EVP_PKEY_DSA2,
 		EVP_PKEY_DSA,
 		ASN1_PKEY_ALIAS
-		},
+		// 21 zeros.
+		, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+		, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+		, 0
+		);
 
-		{
+CONST_EVP_PKEY_ASN1_METHOD_ITEM(dsa_ameth__dsa_asn1_meth1,
 		EVP_PKEY_DSA1,
 		EVP_PKEY_DSA,
 		ASN1_PKEY_ALIAS
-		},
+		// 21 zeros.
+		, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+		, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+		, 0
+		);
 
-		{
+CONST_EVP_PKEY_ASN1_METHOD_ITEM(dsa_ameth__dsa_asn1_meth2,
 		EVP_PKEY_DSA4,
 		EVP_PKEY_DSA,
 		ASN1_PKEY_ALIAS
-		},
+		// 21 zeros.
+		, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+		, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+		, 0
+		);
 
-		{
+CONST_EVP_PKEY_ASN1_METHOD_ITEM(dsa_ameth__dsa_asn1_meth3,
 		EVP_PKEY_DSA3,
 		EVP_PKEY_DSA,
 		ASN1_PKEY_ALIAS
-		},
+		// 21 zeros.
+		, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+		, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+		, 0
+		);
 
-		{
+CONST_EVP_PKEY_ASN1_METHOD_ITEM(dsa_ameth__dsa_asn1_meth4,
 		EVP_PKEY_DSA,
 		EVP_PKEY_DSA,
 		0,
 
-		"DSA",
-		"OpenSSL DSA method",
+		(char *)"DSA",
+		(char *)"OpenSSL DSA method",
 
 		dsa_pub_decode,
 		dsa_pub_encode,
@@ -658,5 +678,4 @@
 		dsa_pkey_ctrl,
 		old_dsa_priv_decode,
 		old_dsa_priv_encode
-		}
-	};
+		);
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsa_asn1.c openssl-1.0.0q/crypto/dsa/dsa_asn1.c
--- openssl-1.0.0q.orig/crypto/dsa/dsa_asn1.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsa_asn1.c	2017-04-25 16:23:40.197526777 +0200
@@ -56,19 +56,25 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Override the default new methods */
 static int sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
 								void *exarg)
 {
+	if(!pval)
+		return 0;
 	if(operation == ASN1_OP_NEW_PRE) {
 		DSA_SIG *sig;
-		sig = OPENSSL_malloc(sizeof(DSA_SIG));
+		sig = (DSA_SIG *) OPENSSL_malloc(sizeof(DSA_SIG));
 		if (!sig)
 			{
 			DSAerr(DSA_F_SIG_CB, ERR_R_MALLOC_FAILURE);
@@ -82,10 +88,10 @@
 	return 1;
 }
 
-ASN1_SEQUENCE_cb(DSA_SIG, sig_cb) = {
-	ASN1_SIMPLE(DSA_SIG, r, CBIGNUM),
+ASN1_SEQUENCE_cb(DSA_SIG, sig_cb)
+	ASN1_SIMPLE(DSA_SIG, r, CBIGNUM)
 	ASN1_SIMPLE(DSA_SIG, s, CBIGNUM)
-} ASN1_SEQUENCE_END_cb(DSA_SIG, DSA_SIG)
+ASN1_SEQUENCE_END_cb(DSA_SIG, DSA_SIG)
 
 IMPLEMENT_ASN1_FUNCTIONS_const(DSA_SIG)
 
@@ -105,24 +111,30 @@
 	return 1;
 }
 
-ASN1_SEQUENCE_cb(DSAPrivateKey, dsa_cb) = {
-	ASN1_SIMPLE(DSA, version, LONG),
-	ASN1_SIMPLE(DSA, p, BIGNUM),
-	ASN1_SIMPLE(DSA, q, BIGNUM),
-	ASN1_SIMPLE(DSA, g, BIGNUM),
-	ASN1_SIMPLE(DSA, pub_key, BIGNUM),
+ASN1_SEQUENCE_cb(DSAPrivateKey, dsa_cb)
+	ASN1_SIMPLE(DSA, version, LONG)
+	ASN1_SIMPLE(DSA, p, BIGNUM)
+	ASN1_SIMPLE(DSA, q, BIGNUM)
+	ASN1_SIMPLE(DSA, g, BIGNUM)
+	ASN1_SIMPLE(DSA, pub_key, BIGNUM)
 	ASN1_SIMPLE(DSA, priv_key, BIGNUM)
-} ASN1_SEQUENCE_END_cb(DSA, DSAPrivateKey)
+ASN1_SEQUENCE_END_cb(DSA, DSAPrivateKey)
 
-IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DSA, DSAPrivateKey, DSAPrivateKey)
-
-ASN1_SEQUENCE_cb(DSAparams, dsa_cb) = {
-	ASN1_SIMPLE(DSA, p, BIGNUM),
-	ASN1_SIMPLE(DSA, q, BIGNUM),
-	ASN1_SIMPLE(DSA, g, BIGNUM),
-} ASN1_SEQUENCE_END_cb(DSA, DSAparams)
+#if defined LIBOPEAY_PKCS12_SUPPORT || defined LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
+#define DSA_IMPLEMENT_ENCODE IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname
+#else
+#define DSA_IMPLEMENT_ENCODE IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname1
+#endif
+
+DSA_IMPLEMENT_ENCODE(DSA, DSAPrivateKey, DSAPrivateKey)
+
+ASN1_SEQUENCE_cb(DSAparams, dsa_cb)
+	ASN1_SIMPLE(DSA, p, BIGNUM)
+	ASN1_SIMPLE(DSA, q, BIGNUM)
+	ASN1_SIMPLE(DSA, g, BIGNUM)
+ASN1_SEQUENCE_END_cb(DSA, DSAparams)
 
-IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DSA, DSAparams, DSAparams)
+DSA_IMPLEMENT_ENCODE(DSA, DSAparams, DSAparams)
 
 /* DSA public key is a bit trickier... its effectively a CHOICE type
  * decided by a field called write_params which can either write out
@@ -130,21 +142,22 @@
  * in a SEQUENCE
  */
 
-ASN1_SEQUENCE(dsa_pub_internal) = {
-	ASN1_SIMPLE(DSA, pub_key, BIGNUM),
-	ASN1_SIMPLE(DSA, p, BIGNUM),
-	ASN1_SIMPLE(DSA, q, BIGNUM),
+ASN1_SEQUENCE(dsa_pub_internal) 
+	ASN1_SIMPLE(DSA, pub_key, BIGNUM)
+	ASN1_SIMPLE(DSA, p, BIGNUM)
+	ASN1_SIMPLE(DSA, q, BIGNUM)
 	ASN1_SIMPLE(DSA, g, BIGNUM)
-} ASN1_SEQUENCE_END_name(DSA, dsa_pub_internal)
+ASN1_SEQUENCE_END_name(DSA, dsa_pub_internal)
 
-ASN1_CHOICE_cb(DSAPublicKey, dsa_cb) = {
-	ASN1_SIMPLE(DSA, pub_key, BIGNUM),
+ASN1_CHOICE_cb(DSAPublicKey, dsa_cb)
+	ASN1_SIMPLE(DSA, pub_key, BIGNUM)
 	ASN1_EX_COMBINE(0, 0, dsa_pub_internal)
-} ASN1_CHOICE_END_cb(DSA, DSAPublicKey, write_params)
+ASN1_CHOICE_END_cb(DSA, DSAPublicKey, write_params)
 
 IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DSA, DSAPublicKey, DSAPublicKey)
 
 DSA *DSAparams_dup(DSA *dsa)
 	{
-	return ASN1_item_dup(ASN1_ITEM_rptr(DSAparams), dsa);
+	return (DSA *) ASN1_item_dup(ASN1_ITEM_rptr(DSAparams), dsa);
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsa_err.c openssl-1.0.0q/crypto/dsa/dsa_err.c
--- openssl-1.0.0q.orig/crypto/dsa/dsa_err.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsa_err.c	2017-04-25 16:23:40.198528301 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/dsa.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsa_gen.c openssl-1.0.0q/crypto/dsa/dsa_gen.c
--- openssl-1.0.0q.orig/crypto/dsa/dsa_gen.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsa_gen.c	2017-04-25 16:23:40.205527235 +0200
@@ -73,8 +73,10 @@
 
 #ifndef OPENSSL_NO_SHA
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/bn.h>
 #include <openssl/rand.h>
@@ -190,8 +192,8 @@
 				seed_is_random = 0;
 				seed_len=0; /* use random seed if 'seed_in' turns out to be bad*/
 				}
-			memcpy(buf , seed, qsize);
-			memcpy(buf2, seed, qsize);
+			op_memcpy(buf , seed, qsize);
+			op_memcpy(buf2, seed, qsize);
 			/* precompute "SEED + 1" for step 7: */
 			for (i = qsize-1; i >= 0; i--)
 				{
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsa_key.c openssl-1.0.0q/crypto/dsa/dsa_key.c
--- openssl-1.0.0q.orig/crypto/dsa/dsa_key.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsa_key.c	2017-04-25 16:23:40.206527363 +0200
@@ -56,9 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #ifndef OPENSSL_NO_SHA
 #include <openssl/bn.h>
 #include <openssl/dsa.h>
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsa_lib.c openssl-1.0.0q/crypto/dsa/dsa_lib.c
--- openssl-1.0.0q.orig/crypto/dsa/dsa_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsa_lib.c	2017-04-25 16:23:40.207528049 +0200
@@ -58,8 +58,11 @@
 
 /* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/bn.h>
 #include <openssl/dsa.h>
 #include <openssl/asn1.h>
@@ -70,20 +73,30 @@
 #include <openssl/dh.h>
 #endif
 
-const char DSA_version[]="DSA" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char DSA_version[]="DSA" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-26 haavardm */
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 static const DSA_METHOD *default_DSA_method = NULL;
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 void DSA_set_default_method(const DSA_METHOD *meth)
 	{
 	default_DSA_method = meth;
 	}
+#endif
 
 const DSA_METHOD *DSA_get_default_method(void)
 	{
+#ifndef OPERA_SMALL_VERSION
 	if(!default_DSA_method)
 		default_DSA_method = DSA_OpenSSL();
 	return default_DSA_method;
+#else
+	return DSA_OpenSSL();
+#endif
 	}
 
 DSA *DSA_new(void)
@@ -91,6 +104,7 @@
 	return DSA_new_method(NULL);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int DSA_set_method(DSA *dsa, const DSA_METHOD *meth)
 	{
 	/* NB: The caller is specifically setting a method, so it's not up to us
@@ -109,6 +123,7 @@
         if (meth->init) meth->init(dsa);
         return 1;
 	}
+#endif
 
 DSA *DSA_new_method(ENGINE *engine)
 	{
@@ -255,6 +270,7 @@
 	return(ret);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
 	     CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
         {
@@ -309,3 +325,5 @@
 	return NULL;
 	}
 #endif
+#endif
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsa_ossl.c openssl-1.0.0q/crypto/dsa/dsa_ossl.c
--- openssl-1.0.0q.orig/crypto/dsa/dsa_ossl.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsa_ossl.c	2017-04-25 16:23:40.208527337 +0200
@@ -58,13 +58,17 @@
 
 /* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/bn.h>
 #include <openssl/sha.h>
 #include <openssl/dsa.h>
 #include <openssl/rand.h>
 #include <openssl/asn1.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
 static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
@@ -73,20 +77,20 @@
 static int dsa_init(DSA *dsa);
 static int dsa_finish(DSA *dsa);
 
-static DSA_METHOD openssl_dsa_meth = {
-"OpenSSL DSA method",
-dsa_do_sign,
-dsa_sign_setup,
-dsa_do_verify,
-NULL, /* dsa_mod_exp, */
-NULL, /* dsa_bn_mod_exp, */
-dsa_init,
-dsa_finish,
-0,
-NULL,
-NULL,
-NULL
-};
+OPENSSL_PREFIX_CONST_ITEM(static, DSA_METHOD, openssl_dsa_meth, libopeay)
+  CONST_ITEM_ENTRY_START(name,OPERA_OPENSSL_STRINGS("OpenSSL DSA method"))
+  CONST_ITEM_ENTRY_SINGLE(dsa_do_sign, dsa_do_sign)
+  CONST_ITEM_ENTRY_SINGLE(dsa_sign_setup, dsa_sign_setup)
+  CONST_ITEM_ENTRY_SINGLE(dsa_do_verify, dsa_do_verify)
+  CONST_ITEM_ENTRY_SINGLE(dsa_mod_exp, NULL)
+  CONST_ITEM_ENTRY_SINGLE(bn_mod_exp, NULL)
+  CONST_ITEM_ENTRY_SINGLE(init, dsa_init)
+  CONST_ITEM_ENTRY_SINGLE(finish, dsa_finish)
+  CONST_ITEM_ENTRY_SINGLE(flags, 0)
+  CONST_ITEM_ENTRY_SINGLE(app_data, NULL)
+  CONST_ITEM_ENTRY_SINGLE(dsa_paramgen, NULL)
+  CONST_ITEM_ENTRY_SINGLE(dsa_keygen, NULL)
+CONST_ITEM_ENTRY_END;
 
 /* These macro wrappers replace attempts to use the dsa_mod_exp() and
  * bn_mod_exp() handlers in the DSA_METHOD structure. We avoid the problem of
@@ -125,7 +129,7 @@
 
 const DSA_METHOD *DSA_OpenSSL(void)
 {
-	return &openssl_dsa_meth;
+	return &OPENSSL_GLOBAL_ITEM_NAME(openssl_dsa_meth);
 }
 
 static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
@@ -395,4 +399,5 @@
 		BN_MONT_CTX_free(dsa->method_mont_p);
 	return(1);
 }
+#endif
 
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsa_pmeth.c openssl-1.0.0q/crypto/dsa/dsa_pmeth.c
--- openssl-1.0.0q.orig/crypto/dsa/dsa_pmeth.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsa_pmeth.c	2017-04-25 16:23:40.209527465 +0200
@@ -55,14 +55,19 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/evp.h>
 #include <openssl/bn.h>
-#include "evp_locl.h"
+#include "../evp/evp_locl.h"
 #include "dsa_locl.h"
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 /* DSA pkey context structure */
 
@@ -81,7 +86,7 @@
 static int pkey_dsa_init(EVP_PKEY_CTX *ctx)
 	{
 	DSA_PKEY_CTX *dctx;
-	dctx = OPENSSL_malloc(sizeof(DSA_PKEY_CTX));
+	dctx = (DSA_PKEY_CTX *)OPENSSL_malloc(sizeof(DSA_PKEY_CTX));
 	if (!dctx)
 		return 0;
 	dctx->nbits = 1024;
@@ -101,8 +106,8 @@
 	DSA_PKEY_CTX *dctx, *sctx;
 	if (!pkey_dsa_init(dst))
 		return 0;
-       	sctx = src->data;
-	dctx = dst->data;
+	sctx = (DSA_PKEY_CTX *)src->data;
+	dctx = (DSA_PKEY_CTX *)dst->data;
 	dctx->nbits = sctx->nbits;
 	dctx->qbits = sctx->qbits;
 	dctx->pmd = sctx->pmd;
@@ -112,7 +117,7 @@
 
 static void pkey_dsa_cleanup(EVP_PKEY_CTX *ctx)
 	{
-	DSA_PKEY_CTX *dctx = ctx->data;
+	DSA_PKEY_CTX *dctx = (DSA_PKEY_CTX *)ctx->data;
 	if (dctx)
 		OPENSSL_free(dctx);
 	}
@@ -122,7 +127,7 @@
 	{
 	int ret, type;
 	unsigned int sltmp;
-	DSA_PKEY_CTX *dctx = ctx->data;
+	DSA_PKEY_CTX *dctx = (DSA_PKEY_CTX *)ctx->data;
 	DSA *dsa = ctx->pkey->pkey.dsa;
 
 	if (dctx->md)
@@ -143,7 +148,7 @@
 					const unsigned char *tbs, size_t tbslen)
 	{
 	int ret, type;
-	DSA_PKEY_CTX *dctx = ctx->data;
+	DSA_PKEY_CTX *dctx = (DSA_PKEY_CTX *)ctx->data;
 	DSA *dsa = ctx->pkey->pkey.dsa;
 
 	if (dctx->md)
@@ -158,7 +163,7 @@
 
 static int pkey_dsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
 	{
-	DSA_PKEY_CTX *dctx = ctx->data;
+	DSA_PKEY_CTX *dctx = (DSA_PKEY_CTX *)ctx->data;
 	switch (type)
 		{
 		case EVP_PKEY_CTRL_DSA_PARAMGEN_BITS:
@@ -181,7 +186,7 @@
 			DSAerr(DSA_F_PKEY_DSA_CTRL, DSA_R_INVALID_DIGEST_TYPE);
 			return 0;
 			}
-		dctx->md = p2;
+		dctx->md = (const EVP_MD *)p2;
 		return 1;
 
 		case EVP_PKEY_CTRL_MD:
@@ -194,7 +199,7 @@
 			DSAerr(DSA_F_PKEY_DSA_CTRL, DSA_R_INVALID_DIGEST_TYPE);
 			return 0;
 			}
-		dctx->md = p2;
+		dctx->md = (const EVP_MD *)p2;
 		return 1;
 
 		case EVP_PKEY_CTRL_DIGESTINIT:
@@ -239,7 +244,7 @@
 static int pkey_dsa_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
 	{
 	DSA *dsa = NULL;
-	DSA_PKEY_CTX *dctx = ctx->data;
+	DSA_PKEY_CTX *dctx = (DSA_PKEY_CTX *)ctx->data;
 	BN_GENCB *pcb, cb;
 	int ret;
 	if (ctx->pkey_gencb)
@@ -279,8 +284,7 @@
 	return DSA_generate_key(pkey->pkey.dsa);
 	}
 
-const EVP_PKEY_METHOD dsa_pkey_meth = 
-	{
+CONST_EVP_PKEY_METHOD_ITEM(dsa_pmeth__dsa_pkey_meth,
 	EVP_PKEY_DSA,
 	EVP_PKEY_FLAG_AUTOARGLEN,
 	pkey_dsa_init,
@@ -313,4 +317,4 @@
 	pkey_dsa_ctrl_str
 
 
-	};
+	);
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsa_sign.c openssl-1.0.0q/crypto/dsa/dsa_sign.c
--- openssl-1.0.0q.orig/crypto/dsa/dsa_sign.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsa_sign.c	2017-04-25 16:23:40.210529268 +0200
@@ -58,7 +58,8 @@
 
 /* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
 #include <openssl/rand.h>
 
@@ -88,3 +89,4 @@
 	return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsa_vrf.c openssl-1.0.0q/crypto/dsa/dsa_vrf.c
--- openssl-1.0.0q.orig/crypto/dsa/dsa_vrf.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsa_vrf.c	2017-04-25 16:23:40.211527998 +0200
@@ -58,7 +58,8 @@
 
 /* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
 
 int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
@@ -99,3 +100,4 @@
 	DSA_SIG_free(s);
 	return(ret);
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsagen.c openssl-1.0.0q/crypto/dsa/dsagen.c
--- openssl-1.0.0q.orig/crypto/dsa/dsagen.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsagen.c	2017-04-25 16:23:40.212527567 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/dsa.h>
 
 #define TEST
@@ -102,7 +104,7 @@
 	if (bio_err == NULL)
 		bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
 
-	memcpy(seed_buf,seed,20);
+	op_memcpy(seed_buf,seed,20);
 	dsa=DSA_generate_parameters(1024,seed,20,&counter,&h,cb,bio_err);
 
 	if (dsa == NULL)
diff -Naur openssl-1.0.0q.orig/crypto/dsa/dsatest.c openssl-1.0.0q/crypto/dsa/dsatest.c
--- openssl-1.0.0q.orig/crypto/dsa/dsatest.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/dsatest.c	2017-04-25 16:23:40.213527694 +0200
@@ -62,11 +62,13 @@
 #undef OPENSSL_NO_DEPRECATED
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -183,7 +185,7 @@
 
 	i=BN_bn2bin(dsa->q,buf);
 	j=sizeof(out_q);
-	if ((i != j) || (memcmp(buf,out_q,i) != 0))
+	if ((i != j) || (op_memcmp(buf,out_q,i) != 0))
 		{
 		BIO_printf(bio_err,"q value is wrong\n");
 		goto end;
@@ -191,7 +193,7 @@
 
 	i=BN_bn2bin(dsa->p,buf);
 	j=sizeof(out_p);
-	if ((i != j) || (memcmp(buf,out_p,i) != 0))
+	if ((i != j) || (op_memcmp(buf,out_p,i) != 0))
 		{
 		BIO_printf(bio_err,"p value is wrong\n");
 		goto end;
@@ -199,7 +201,7 @@
 
 	i=BN_bn2bin(dsa->g,buf);
 	j=sizeof(out_g);
-	if ((i != j) || (memcmp(buf,out_g,i) != 0))
+	if ((i != j) || (op_memcmp(buf,out_g,i) != 0))
 		{
 		BIO_printf(bio_err,"g value is wrong\n");
 		goto end;
diff -Naur openssl-1.0.0q.orig/crypto/dsa/opera_dsa_ameth.cpp openssl-1.0.0q/crypto/dsa/opera_dsa_ameth.cpp
--- openssl-1.0.0q.orig/crypto/dsa/opera_dsa_ameth.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/opera_dsa_ameth.cpp	2017-04-25 16:23:40.214527542 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dsa/dsa_ameth.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dsa/opera_dsa_asn1.cpp openssl-1.0.0q/crypto/dsa/opera_dsa_asn1.cpp
--- openssl-1.0.0q.orig/crypto/dsa/opera_dsa_asn1.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/opera_dsa_asn1.cpp	2017-04-25 16:23:40.214527542 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dsa/dsa_asn1.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dsa/opera_dsa_gen.cpp openssl-1.0.0q/crypto/dsa/opera_dsa_gen.cpp
--- openssl-1.0.0q.orig/crypto/dsa/opera_dsa_gen.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/opera_dsa_gen.cpp	2017-04-25 16:23:40.215527669 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dsa/dsa_gen.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dsa/opera_dsa_key.cpp openssl-1.0.0q/crypto/dsa/opera_dsa_key.cpp
--- openssl-1.0.0q.orig/crypto/dsa/opera_dsa_key.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/opera_dsa_key.cpp	2017-04-25 16:23:40.215527669 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dsa/dsa_key.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dsa/opera_dsa_lib.cpp openssl-1.0.0q/crypto/dsa/opera_dsa_lib.cpp
--- openssl-1.0.0q.orig/crypto/dsa/opera_dsa_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/opera_dsa_lib.cpp	2017-04-25 16:23:40.216527516 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dsa/dsa_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dsa/opera_dsa_ossl.cpp openssl-1.0.0q/crypto/dsa/opera_dsa_ossl.cpp
--- openssl-1.0.0q.orig/crypto/dsa/opera_dsa_ossl.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/opera_dsa_ossl.cpp	2017-04-25 16:23:40.217530158 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dsa/dsa_ossl.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dsa/opera_dsa_pmeth.cpp openssl-1.0.0q/crypto/dsa/opera_dsa_pmeth.cpp
--- openssl-1.0.0q.orig/crypto/dsa/opera_dsa_pmeth.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/opera_dsa_pmeth.cpp	2017-04-25 16:23:40.217530158 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dsa/dsa_pmeth.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dsa/opera_dsa_sign.cpp openssl-1.0.0q/crypto/dsa/opera_dsa_sign.cpp
--- openssl-1.0.0q.orig/crypto/dsa/opera_dsa_sign.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/opera_dsa_sign.cpp	2017-04-25 16:23:40.218527212 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dsa/dsa_sign.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dsa/opera_dsa_vrf.cpp openssl-1.0.0q/crypto/dsa/opera_dsa_vrf.cpp
--- openssl-1.0.0q.orig/crypto/dsa/opera_dsa_vrf.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dsa/opera_dsa_vrf.cpp	2017-04-25 16:23:40.218527212 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/dsa/dsa_vrf.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/dso/.gitignore openssl-1.0.0q/crypto/dso/.gitignore
--- openssl-1.0.0q.orig/crypto/dso/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/dso/.gitignore	2017-04-25 16:23:40.219528177 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/dso/dso_dl.c openssl-1.0.0q/crypto/dso/dso_dl.c
--- openssl-1.0.0q.orig/crypto/dso/dso_dl.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dso/dso_dl.c	2017-04-25 16:23:40.219528177 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/dso.h>
 
@@ -326,12 +328,12 @@
 	char *translated;
 	int len, rsize, transform;
 
-	len = strlen(filename);
+	len = op_strlen(filename);
 	rsize = len + 1;
-	transform = (strstr(filename, "/") == NULL);
+	transform = (op_strstr(filename, "/") == NULL);
 		{
 		/* We will convert this to "%s.s?" or "lib%s.s?" */
-		rsize += strlen(extension);/* The length of ".s?" */
+		rsize += op_strlen(extension);/* The length of ".s?" */
 		if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0)
 			rsize += 3; /* The length of "lib" */
 		}
@@ -345,12 +347,12 @@
 	if(transform)
 		{
 		if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0)
-			sprintf(translated, "lib%s%s", filename, extension);
+			op_sprintf(translated, "lib%s%s", filename, extension);
 		else
-			sprintf(translated, "%s%s", filename, extension);
+			op_sprintf(translated, "%s%s", filename, extension);
 		}
 	else
-		sprintf(translated, "%s", filename);
+		op_sprintf(translated, "%s", filename);
 	return(translated);
 	}
 
diff -Naur openssl-1.0.0q.orig/crypto/dso/dso_dlfcn.c openssl-1.0.0q/crypto/dso/dso_dlfcn.c
--- openssl-1.0.0q.orig/crypto/dso/dso_dlfcn.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/dso/dso_dlfcn.c	2017-04-25 16:23:40.221527873 +0200
@@ -66,7 +66,9 @@
 # endif
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/dso.h>
 
@@ -372,9 +374,9 @@
 	char *translated;
 	int len, rsize, transform;
 
-	len = strlen(filename);
+	len = op_strlen(filename);
 	rsize = len + 1;
-	transform = (strstr(filename, "/") == NULL);
+	transform = (op_strstr(filename, "/") == NULL);
 	if(transform)
 		{
 		/* We will convert this to "%s.so" or "lib%s.so" etc */
@@ -397,7 +399,7 @@
 			sprintf(translated, "%s" DSO_ext, filename);
 		}
 	else
-		sprintf(translated, "%s", filename);
+		op_sprintf(translated, "%s", filename);
 	return(translated);
 	}
 
diff -Naur openssl-1.0.0q.orig/crypto/dso/dso_err.c openssl-1.0.0q/crypto/dso/dso_err.c
--- openssl-1.0.0q.orig/crypto/dso/dso_err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/dso/dso_err.c	2017-04-25 16:23:40.222527720 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/dso.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/dso/dso_lib.c openssl-1.0.0q/crypto/dso/dso_lib.c
--- openssl-1.0.0q.orig/crypto/dso/dso_lib.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/dso/dso_lib.c	2017-04-25 16:23:40.223527009 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/crypto.h>
 #include "cryptlib.h"
 #include <openssl/dso.h>
@@ -377,13 +379,13 @@
 		return(0);
 		}
 	/* We'll duplicate filename */
-	copied = OPENSSL_malloc(strlen(filename) + 1);
+	copied = OPENSSL_malloc(op_strlen(filename) + 1);
 	if(copied == NULL)
 		{
 		DSOerr(DSO_F_DSO_SET_FILENAME,ERR_R_MALLOC_FAILURE);
 		return(0);
 		}
-	BUF_strlcpy(copied, filename, strlen(filename) + 1);
+	BUF_strlcpy(copied, filename, op_strlen(filename) + 1);
 	if(dso->filename)
 		OPENSSL_free(dso->filename);
 	dso->filename = copied;
@@ -435,14 +437,14 @@
 		}
 	if(result == NULL)
 		{
-		result = OPENSSL_malloc(strlen(filename) + 1);
+		result = OPENSSL_malloc(op_strlen(filename) + 1);
 		if(result == NULL)
 			{
 			DSOerr(DSO_F_DSO_CONVERT_FILENAME,
 					ERR_R_MALLOC_FAILURE);
 			return(NULL);
 			}
-		BUF_strlcpy(result, filename, strlen(filename) + 1);
+		BUF_strlcpy(result, filename, op_strlen(filename) + 1);
 		}
 	return(result);
 	}
diff -Naur openssl-1.0.0q.orig/crypto/dso/dso_null.c openssl-1.0.0q/crypto/dso/dso_null.c
--- openssl-1.0.0q.orig/crypto/dso/dso_null.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/dso/dso_null.c	2017-04-25 16:23:40.223527009 +0200
@@ -59,7 +59,9 @@
 /* This "NULL" method is provided as the fallback for systems that have
  * no appropriate support for "shared-libraries". */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/dso.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/dso/dso_openssl.c openssl-1.0.0q/crypto/dso/dso_openssl.c
--- openssl-1.0.0q.orig/crypto/dso/dso_openssl.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dso/dso_openssl.c	2017-04-25 16:23:40.224528254 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/dso.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/dso/dso_vms.c openssl-1.0.0q/crypto/dso/dso_vms.c
--- openssl-1.0.0q.orig/crypto/dso/dso_vms.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dso/dso_vms.c	2017-04-25 16:23:40.225527822 +0200
@@ -56,9 +56,14 @@
  *
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/dso.h>
 
@@ -192,27 +197,27 @@
 	 */
 	/* Start with trying to find the end of a dir-spec, and save the
 	   position of the byte after in sp1 */
-	sp1 = strrchr(filename, ']');
-	sp2 = strrchr(filename, '>');
+	sp1 = op_strrchr(filename, ']');
+	sp2 = op_strrchr(filename, '>');
 	if (sp1 == NULL) sp1 = sp2;
 	if (sp2 != NULL && sp2 > sp1) sp1 = sp2;
-	if (sp1 == NULL) sp1 = strrchr(filename, ':');
+	if (sp1 == NULL) sp1 = op_strrchr(filename, ':');
 	if (sp1 == NULL)
 		sp1 = filename;
 	else
 		sp1++;		/* The byte after the found character */
 	/* Now, let's see if there's a type, and save the position in sp2 */
-	sp2 = strchr(sp1, '.');
+	sp2 = op_strchr(sp1, '.');
 	/* If we found it, that's where we'll cut.  Otherwise, look for a
 	   version number and save the position in sp2 */
-	if (sp2 == NULL) sp2 = strchr(sp1, ';');
+	if (sp2 == NULL) sp2 = op_strchr(sp1, ';');
 	/* If there was still nothing to find, set sp2 to point at the end of
 	   the string */
-	if (sp2 == NULL) sp2 = sp1 + strlen(sp1);
+	if (sp2 == NULL) sp2 = sp1 + op_strlen(sp1);
 
 	/* Check that we won't get buffer overflows */
 	if (sp2 - sp1 > FILENAME_MAX
-		|| (sp1 - filename) + strlen(sp2) > FILENAME_MAX)
+		|| (sp1 - filename) + op_strlen(sp2) > FILENAME_MAX)
 		{
 		DSOerr(DSO_F_VMS_LOAD,DSO_R_FILENAME_TOO_BIG);
 		goto err;
@@ -225,18 +230,18 @@
 		goto err;
 		}
 
-	strncpy(p->filename, sp1, sp2-sp1);
+	op_strncpy(p->filename, sp1, sp2-sp1);
 	p->filename[sp2-sp1] = '\0';
 
-	strncpy(p->imagename, filename, sp1-filename);
+	op_strncpy(p->imagename, filename, sp1-filename);
 	p->imagename[sp1-filename] = '\0';
-	strcat(p->imagename, sp2);
+	op_strcat(p->imagename, sp2);
 
-	p->filename_dsc.dsc$w_length = strlen(p->filename);
+	p->filename_dsc.dsc$w_length = op_strlen(p->filename);
 	p->filename_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
 	p->filename_dsc.dsc$b_class = DSC$K_CLASS_S;
 	p->filename_dsc.dsc$a_pointer = p->filename;
-	p->imagename_dsc.dsc$w_length = strlen(p->imagename);
+	p->imagename_dsc.dsc$w_length = op_strlen(p->imagename);
 	p->imagename_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
 	p->imagename_dsc.dsc$b_class = DSC$K_CLASS_S;
 	p->imagename_dsc.dsc$a_pointer = p->imagename;
@@ -516,9 +521,9 @@
 
 static char *vms_name_converter(DSO *dso, const char *filename)
 	{
-        int len = strlen(filename);
+        int len = op_strlen(filename);
         char *not_translated = OPENSSL_malloc(len+1);
-        strcpy(not_translated,filename);
+        op_strcpy(not_translated,filename);
 	return(not_translated);
 	}
 
diff -Naur openssl-1.0.0q.orig/crypto/dso/dso_win32.c openssl-1.0.0q/crypto/dso/dso_win32.c
--- openssl-1.0.0q.orig/crypto/dso/dso_win32.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/dso/dso_win32.c	2017-04-25 16:23:40.226527670 +0200
@@ -56,8 +56,10 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/dso.h>
 
@@ -632,10 +634,10 @@
 	char *translated;
 	int len, transform;
 
-	len = strlen(filename);
-	transform = ((strstr(filename, "/") == NULL) &&
-			(strstr(filename, "\\") == NULL) &&
-			(strstr(filename, ":") == NULL));
+	len = op_strlen(filename);
+	transform = ((op_strstr(filename, "/") == NULL) &&
+			(op_strstr(filename, "\\") == NULL) &&
+			(op_strstr(filename, ":") == NULL));
 	if(transform)
 		/* We will convert this to "%s.dll" */
 		translated = OPENSSL_malloc(len + 5);
@@ -649,9 +651,9 @@
 		return(NULL);   
 		}
 	if(transform)
-		sprintf(translated, "%s.dll", filename);
+		op_sprintf(translated, "%s.dll", filename);
 	else
-		sprintf(translated, "%s", filename);
+		op_sprintf(translated, "%s", filename);
 	return(translated);
 	}
 
diff -Naur openssl-1.0.0q.orig/crypto/ebcdic.c openssl-1.0.0q/crypto/ebcdic.c
--- openssl-1.0.0q.orig/crypto/ebcdic.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ebcdic.c	2017-04-25 16:23:40.227526680 +0200
@@ -189,7 +189,7 @@
 /* Translate a memory block from EBCDIC (host charset) to ASCII (net charset)
  * dest and srce may be identical, or separate memory blocks, but
  * should not overlap. These functions intentionally have an interface
- * compatible to memcpy(3).
+ * compatible to op_memcpy(3).
  */
 
 void *
diff -Naur openssl-1.0.0q.orig/crypto/ebcdic.h openssl-1.0.0q/crypto/ebcdic.h
--- openssl-1.0.0q.orig/crypto/ebcdic.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ebcdic.h	2017-04-25 16:23:40.228526807 +0200
@@ -3,7 +3,9 @@
 #ifndef HEADER_EBCDIC_H
 #define HEADER_EBCDIC_H
 
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 /* Avoid name clashes with other applications */
 #define os_toascii   _openssl_os_toascii
diff -Naur openssl-1.0.0q.orig/crypto/ec/.gitignore openssl-1.0.0q/crypto/ec/.gitignore
--- openssl-1.0.0q.orig/crypto/ec/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ec/.gitignore	2017-04-25 16:23:40.229526934 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/ec/ec_asn1.c openssl-1.0.0q/crypto/ec/ec_asn1.c
--- openssl-1.0.0q.orig/crypto/ec/ec_asn1.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ec/ec_asn1.c	2017-04-25 16:23:40.230528458 +0200
@@ -196,78 +196,82 @@
 	} EC_PRIVATEKEY;
 
 /* the OpenSSL ASN.1 definitions */
-ASN1_SEQUENCE(X9_62_PENTANOMIAL) = {
-	ASN1_SIMPLE(X9_62_PENTANOMIAL, k1, LONG),
-	ASN1_SIMPLE(X9_62_PENTANOMIAL, k2, LONG),
+ASN1_SEQUENCE(X9_62_PENTANOMIAL) 
+	ASN1_SIMPLE(X9_62_PENTANOMIAL, k1, LONG)
+	ASN1_SIMPLE(X9_62_PENTANOMIAL, k2, LONG)
 	ASN1_SIMPLE(X9_62_PENTANOMIAL, k3, LONG)
-} ASN1_SEQUENCE_END(X9_62_PENTANOMIAL)
+ASN1_SEQUENCE_END(X9_62_PENTANOMIAL)
 
 DECLARE_ASN1_ALLOC_FUNCTIONS(X9_62_PENTANOMIAL)
 IMPLEMENT_ASN1_ALLOC_FUNCTIONS(X9_62_PENTANOMIAL)
 
-ASN1_ADB_TEMPLATE(char_two_def) = ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, p.other, ASN1_ANY);
-
-ASN1_ADB(X9_62_CHARACTERISTIC_TWO) = {
-	ADB_ENTRY(NID_X9_62_onBasis, ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, p.onBasis, ASN1_NULL)),
-	ADB_ENTRY(NID_X9_62_tpBasis, ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, p.tpBasis, ASN1_INTEGER)),
-	ADB_ENTRY(NID_X9_62_ppBasis, ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, p.ppBasis, X9_62_PENTANOMIAL))
-} ASN1_ADB_END(X9_62_CHARACTERISTIC_TWO, 0, type, 0, &char_two_def_tt, NULL);
-
-ASN1_SEQUENCE(X9_62_CHARACTERISTIC_TWO) = {
-	ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, m, LONG),
-	ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, type, ASN1_OBJECT),
+ASN1_ADB_TEMPLATE(char_two_def) 
+	ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, p.other, ASN1_ANY)
+ASN1_ADB_TEMPLATE_END
+
+ASN1_ADB_SEQ(X9_62_CHARACTERISTIC_TWO)
+	ADB_ENTRY(NID_X9_62_onBasis, ASN1_SIMPLE2(X9_62_CHARACTERISTIC_TWO, p.onBasis, ASN1_NULL))
+	ADB_ENTRY(NID_X9_62_tpBasis, ASN1_SIMPLE2(X9_62_CHARACTERISTIC_TWO, p.tpBasis, ASN1_INTEGER))
+	ADB_ENTRY(NID_X9_62_ppBasis, ASN1_SIMPLE2(X9_62_CHARACTERISTIC_TWO, p.ppBasis, X9_62_PENTANOMIAL))
+ASN1_ADB_END(X9_62_CHARACTERISTIC_TWO, 0, type, 0, char_two_def_tt, NULL)
+
+ASN1_SEQUENCE(X9_62_CHARACTERISTIC_TWO) 
+	ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, m, LONG)
+	ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, type, ASN1_OBJECT)
 	ASN1_ADB_OBJECT(X9_62_CHARACTERISTIC_TWO)
-} ASN1_SEQUENCE_END(X9_62_CHARACTERISTIC_TWO)
+ASN1_SEQUENCE_END(X9_62_CHARACTERISTIC_TWO)
 
 DECLARE_ASN1_ALLOC_FUNCTIONS(X9_62_CHARACTERISTIC_TWO)
 IMPLEMENT_ASN1_ALLOC_FUNCTIONS(X9_62_CHARACTERISTIC_TWO)
 
-ASN1_ADB_TEMPLATE(fieldID_def) = ASN1_SIMPLE(X9_62_FIELDID, p.other, ASN1_ANY);
-
-ASN1_ADB(X9_62_FIELDID) = {
-	ADB_ENTRY(NID_X9_62_prime_field, ASN1_SIMPLE(X9_62_FIELDID, p.prime, ASN1_INTEGER)),
-	ADB_ENTRY(NID_X9_62_characteristic_two_field, ASN1_SIMPLE(X9_62_FIELDID, p.char_two, X9_62_CHARACTERISTIC_TWO))
-} ASN1_ADB_END(X9_62_FIELDID, 0, fieldType, 0, &fieldID_def_tt, NULL);
+ASN1_ADB_TEMPLATE(fieldID_def) 
+	ASN1_SIMPLE(X9_62_FIELDID, p.other, ASN1_ANY)
+ASN1_ADB_TEMPLATE_END
+
+ASN1_ADB_(X9_62_FIELDID) = {
+	ADB_ENTRY(NID_X9_62_prime_field, ASN1_SIMPLE2(X9_62_FIELDID, p.prime, ASN1_INTEGER))
+	ADB_ENTRY(NID_X9_62_characteristic_two_field, ASN1_SIMPLE2(X9_62_FIELDID, p.char_two, X9_62_CHARACTERISTIC_TWO))
+ASN1_ADB_END(X9_62_FIELDID, 0, fieldType, 0, fieldID_def_tt, NULL)
 
-ASN1_SEQUENCE(X9_62_FIELDID) = {
-	ASN1_SIMPLE(X9_62_FIELDID, fieldType, ASN1_OBJECT),
+ASN1_SEQUENCE(X9_62_FIELDID) 
+	ASN1_SIMPLE(X9_62_FIELDID, fieldType, ASN1_OBJECT)
 	ASN1_ADB_OBJECT(X9_62_FIELDID)
-} ASN1_SEQUENCE_END(X9_62_FIELDID)
+ASN1_SEQUENCE_END(X9_62_FIELDID)
 
-ASN1_SEQUENCE(X9_62_CURVE) = {
-	ASN1_SIMPLE(X9_62_CURVE, a, ASN1_OCTET_STRING),
-	ASN1_SIMPLE(X9_62_CURVE, b, ASN1_OCTET_STRING),
+ASN1_SEQUENCE(X9_62_CURVE) 
+	ASN1_SIMPLE(X9_62_CURVE, a, ASN1_OCTET_STRING)
+	ASN1_SIMPLE(X9_62_CURVE, b, ASN1_OCTET_STRING)
 	ASN1_OPT(X9_62_CURVE, seed, ASN1_BIT_STRING)
-} ASN1_SEQUENCE_END(X9_62_CURVE)
+ASN1_SEQUENCE_END(X9_62_CURVE)
 
-ASN1_SEQUENCE(ECPARAMETERS) = {
-	ASN1_SIMPLE(ECPARAMETERS, version, LONG),
-	ASN1_SIMPLE(ECPARAMETERS, fieldID, X9_62_FIELDID),
-	ASN1_SIMPLE(ECPARAMETERS, curve, X9_62_CURVE),
-	ASN1_SIMPLE(ECPARAMETERS, base, ASN1_OCTET_STRING),
-	ASN1_SIMPLE(ECPARAMETERS, order, ASN1_INTEGER),
+ASN1_SEQUENCE(ECPARAMETERS) 
+	ASN1_SIMPLE(ECPARAMETERS, version, LONG)
+	ASN1_SIMPLE(ECPARAMETERS, fieldID, X9_62_FIELDID)
+	ASN1_SIMPLE(ECPARAMETERS, curve, X9_62_CURVE)
+	ASN1_SIMPLE(ECPARAMETERS, base, ASN1_OCTET_STRING)
+	ASN1_SIMPLE(ECPARAMETERS, order, ASN1_INTEGER)
 	ASN1_OPT(ECPARAMETERS, cofactor, ASN1_INTEGER)
-} ASN1_SEQUENCE_END(ECPARAMETERS)
+ASN1_SEQUENCE_END(ECPARAMETERS)
 
 DECLARE_ASN1_ALLOC_FUNCTIONS(ECPARAMETERS)
 IMPLEMENT_ASN1_ALLOC_FUNCTIONS(ECPARAMETERS)
 
-ASN1_CHOICE(ECPKPARAMETERS) = {
-	ASN1_SIMPLE(ECPKPARAMETERS, value.named_curve, ASN1_OBJECT),
-	ASN1_SIMPLE(ECPKPARAMETERS, value.parameters, ECPARAMETERS),
+ASN1_CHOICE(ECPKPARAMETERS)
+	ASN1_SIMPLE(ECPKPARAMETERS, value.named_curve, ASN1_OBJECT)
+	ASN1_SIMPLE(ECPKPARAMETERS, value.parameters, ECPARAMETERS)
 	ASN1_SIMPLE(ECPKPARAMETERS, value.implicitlyCA, ASN1_NULL)
-} ASN1_CHOICE_END(ECPKPARAMETERS)
+ASN1_CHOICE_END(ECPKPARAMETERS)
 
 DECLARE_ASN1_FUNCTIONS_const(ECPKPARAMETERS)
 DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECPKPARAMETERS, ECPKPARAMETERS)
 IMPLEMENT_ASN1_FUNCTIONS_const(ECPKPARAMETERS)
 
-ASN1_SEQUENCE(EC_PRIVATEKEY) = {
-	ASN1_SIMPLE(EC_PRIVATEKEY, version, LONG),
-	ASN1_SIMPLE(EC_PRIVATEKEY, privateKey, ASN1_OCTET_STRING),
-	ASN1_EXP_OPT(EC_PRIVATEKEY, parameters, ECPKPARAMETERS, 0),
+ASN1_SEQUENCE(EC_PRIVATEKEY) 
+	ASN1_SIMPLE(EC_PRIVATEKEY, version, LONG)
+	ASN1_SIMPLE(EC_PRIVATEKEY, privateKey, ASN1_OCTET_STRING)
+	ASN1_EXP_OPT(EC_PRIVATEKEY, parameters, ECPKPARAMETERS, 0)
 	ASN1_EXP_OPT(EC_PRIVATEKEY, publicKey, ASN1_BIT_STRING, 1)
-} ASN1_SEQUENCE_END(EC_PRIVATEKEY)
+ASN1_SEQUENCE_END(EC_PRIVATEKEY)
 
 DECLARE_ASN1_FUNCTIONS_const(EC_PRIVATEKEY)
 DECLARE_ASN1_ENCODE_FUNCTIONS_const(EC_PRIVATEKEY, EC_PRIVATEKEY)
diff -Naur openssl-1.0.0q.orig/crypto/ec/ec_err.c openssl-1.0.0q/crypto/ec/ec_err.c
--- openssl-1.0.0q.orig/crypto/ec/ec_err.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ec/ec_err.c	2017-04-25 16:23:40.232527595 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/ec.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/ec/ec_lcl.h openssl-1.0.0q/crypto/ec/ec_lcl.h
--- openssl-1.0.0q.orig/crypto/ec/ec_lcl.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ec/ec_lcl.h	2017-04-25 16:23:40.233528560 +0200
@@ -70,7 +70,9 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/obj_mac.h>
 #include <openssl/ec.h>
diff -Naur openssl-1.0.0q.orig/crypto/ec/ec_lib.c openssl-1.0.0q/crypto/ec/ec_lib.c
--- openssl-1.0.0q.orig/crypto/ec/ec_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ec/ec_lib.c	2017-04-25 16:23:40.234527569 +0200
@@ -61,7 +61,9 @@
  * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/err.h>
 #include <openssl/opensslv.h>
diff -Naur openssl-1.0.0q.orig/crypto/ec/ectest.c openssl-1.0.0q/crypto/ec/ectest.c
--- openssl-1.0.0q.orig/crypto/ec/ectest.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ec/ectest.c	2017-04-25 16:23:40.235527138 +0200
@@ -69,15 +69,19 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #ifdef FLAT_INC
 #include "e_os.h"
 #else
 #include "../e_os.h"
 #endif
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 
 #ifdef OPENSSL_NO_EC
@@ -147,7 +151,7 @@
 			}
 		}
 
-	clck = clock();
+	clck = op_clock();
 	for (i = 0; i < 10; i++)
 		{
 		for (j = 0; j < 10; j++)
@@ -156,7 +160,7 @@
 				(type != TIMING_BASE_PT) ? P : NULL, (type != TIMING_BASE_PT) ? r0[i] : NULL, ctx)) ABORT;
 			}
 		}
-	clck = clock() - clck;
+	clck = op_clock() - clck;
 
 	fprintf(stdout, "\n");
 
diff -Naur openssl-1.0.0q.orig/crypto/ecdh/.gitignore openssl-1.0.0q/crypto/ecdh/.gitignore
--- openssl-1.0.0q.orig/crypto/ecdh/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ecdh/.gitignore	2017-04-25 16:23:40.236527544 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/ecdh/ecdhtest.c openssl-1.0.0q/crypto/ecdh/ecdhtest.c
--- openssl-1.0.0q.orig/crypto/ecdh/ecdhtest.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ecdh/ecdhtest.c	2017-04-25 16:23:40.237527392 +0200
@@ -67,6 +67,9 @@
  *
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff -Naur openssl-1.0.0q.orig/crypto/ecdsa/.gitignore openssl-1.0.0q/crypto/ecdsa/.gitignore
--- openssl-1.0.0q.orig/crypto/ecdsa/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ecdsa/.gitignore	2017-04-25 16:23:40.238527519 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/ecdsa/ecs_asn1.c openssl-1.0.0q/crypto/ecdsa/ecs_asn1.c
--- openssl-1.0.0q.orig/crypto/ecdsa/ecs_asn1.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ecdsa/ecs_asn1.c	2017-04-25 16:23:40.238527519 +0200
@@ -57,10 +57,10 @@
 #include <openssl/err.h>
 #include <openssl/asn1t.h>
 
-ASN1_SEQUENCE(ECDSA_SIG) = {
-	ASN1_SIMPLE(ECDSA_SIG, r, CBIGNUM),
+ASN1_SEQUENCE(ECDSA_SIG) 
+	ASN1_SIMPLE(ECDSA_SIG, r, CBIGNUM)
 	ASN1_SIMPLE(ECDSA_SIG, s, CBIGNUM)
-} ASN1_SEQUENCE_END(ECDSA_SIG)
+ASN1_SEQUENCE_END(ECDSA_SIG)
 
 DECLARE_ASN1_FUNCTIONS_const(ECDSA_SIG)
 DECLARE_ASN1_ENCODE_FUNCTIONS_const(ECDSA_SIG, ECDSA_SIG)
diff -Naur openssl-1.0.0q.orig/crypto/ecdsa/ecs_lib.c openssl-1.0.0q/crypto/ecdsa/ecs_lib.c
--- openssl-1.0.0q.orig/crypto/ecdsa/ecs_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ecdsa/ecs_lib.c	2017-04-25 16:23:40.239527926 +0200
@@ -210,7 +210,7 @@
 	int ret,i;
 	ASN1_INTEGER bs;
 	BIGNUM	*order=NULL;
-	unsigned char buf[4];
+	unsigned char buf[4]; /* ARRAY OK 2007-11-07 yngve */
 	const EC_GROUP *group;
 
 	if (r == NULL)
diff -Naur openssl-1.0.0q.orig/crypto/engine/.gitignore openssl-1.0.0q/crypto/engine/.gitignore
--- openssl-1.0.0q.orig/crypto/engine/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/.gitignore	2017-04-25 16:23:40.240527773 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_cnf.c openssl-1.0.0q/crypto/engine/eng_cnf.c
--- openssl-1.0.0q.orig/crypto/engine/eng_cnf.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_cnf.c	2017-04-25 16:23:40.241527621 +0200
@@ -56,9 +56,14 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
+#include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "eng_int.h"
 #include <openssl/conf.h>
 
+#ifndef OPERA_SMALL_VERSION
 /* #define ENGINE_CONF_DEBUG */
 
 /* ENGINE config module */
@@ -66,7 +71,7 @@
 static char *skip_dot(char *name)
 	{
 	char *p;
-	p = strchr(name, '.');
+	p = op_strchr(name, '.');
 	if (p)
 		return p + 1;
 	return name;
@@ -125,12 +130,12 @@
 		/* First handle some special pseudo ctrls */
 
 		/* Override engine name to use */
-		if (!strcmp(ctrlname, "engine_id"))
+		if (!op_strcmp(ctrlname, "engine_id"))
 			name = ctrlvalue;
 		else if (!strcmp(ctrlname, "soft_load"))
 			soft = 1;
 		/* Load a dynamic ENGINE */
-		else if (!strcmp(ctrlname, "dynamic_path"))
+		else if (!op_strcmp(ctrlname, "dynamic_path"))
 			{
 			e = ENGINE_by_id("dynamic");
 			if (!e)
@@ -162,9 +167,9 @@
 			/* Allow "EMPTY" to mean no value: this allows a valid
 			 * "value" to be passed to ctrls of type NO_INPUT
 		 	 */
-			if (!strcmp(ctrlvalue, "EMPTY"))
+			if (!op_strcmp(ctrlvalue, "EMPTY"))
 				ctrlvalue = NULL;
-			if (!strcmp(ctrlname, "init"))
+			if (!op_strcmp(ctrlname, "init"))
 				{
 				if (!NCONF_get_number_e(cnf, value, "init", &do_init))
 					goto err;
@@ -179,7 +184,7 @@
 					goto err;
 					}
 				}
-			else if (!strcmp(ctrlname, "default_algorithms"))
+			else if (!op_strcmp(ctrlname, "default_algorithms"))
 				{
 				if (!ENGINE_set_default_string(e, ctrlvalue))
 					goto err;
@@ -253,7 +258,11 @@
 
 void ENGINE_add_conf_module(void)
 	{
+#ifndef OPERA_SMALL_VERSION
 	CONF_module_add("engines",
 			int_engine_module_init,
 			int_engine_module_finish);
+#endif
 	}
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_ctrl.c openssl-1.0.0q/crypto/engine/eng_ctrl.c
--- openssl-1.0.0q.orig/crypto/engine/eng_ctrl.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_ctrl.c	2017-04-25 16:23:40.242528307 +0200
@@ -53,6 +53,7 @@
  *
  */
 
+#include <openssl/cryptlib.h>
 #include "eng_int.h"
 
 /* When querying a ENGINE-specific control command's 'description', this string
@@ -73,7 +74,7 @@
 static int int_ctrl_cmd_by_name(const ENGINE_CMD_DEFN *defn, const char *s)
 	{
 	int idx = 0;
-	while(!int_ctrl_cmd_is_null(defn) && (strcmp(defn->cmd_name, s) != 0))
+	while(!int_ctrl_cmd_is_null(defn) && (op_strcmp(defn->cmd_name, s) != 0))
 		{
 		idx++;
 		defn++;
@@ -156,20 +157,20 @@
 		else
 			return e->cmd_defns[idx].cmd_num;
 	case ENGINE_CTRL_GET_NAME_LEN_FROM_CMD:
-		return strlen(e->cmd_defns[idx].cmd_name);
+		return op_strlen(e->cmd_defns[idx].cmd_name);
 	case ENGINE_CTRL_GET_NAME_FROM_CMD:
 		return BIO_snprintf(s,strlen(e->cmd_defns[idx].cmd_name) + 1,
 				    "%s", e->cmd_defns[idx].cmd_name);
 	case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD:
 		if(e->cmd_defns[idx].cmd_desc)
-			return strlen(e->cmd_defns[idx].cmd_desc);
-		return strlen(int_no_description);
+			return op_strlen(e->cmd_defns[idx].cmd_desc);
+		return op_strlen(int_no_description);
 	case ENGINE_CTRL_GET_DESC_FROM_CMD:
 		if(e->cmd_defns[idx].cmd_desc)
 			return BIO_snprintf(s,
-					    strlen(e->cmd_defns[idx].cmd_desc) + 1,
+					    op_strlen(e->cmd_defns[idx].cmd_desc) + 1,
 					    "%s", e->cmd_defns[idx].cmd_desc);
-		return BIO_snprintf(s, strlen(int_no_description) + 1,"%s",
+		return BIO_snprintf(s, op_strlen(int_no_description) + 1,"%s",
 				    int_no_description);
 	case ENGINE_CTRL_GET_CMD_FLAGS:
 		return e->cmd_defns[idx].cmd_flags;
@@ -374,7 +375,7 @@
 			ENGINE_R_INTERNAL_LIST_ERROR);
 		return 0;
 		}
-	l = strtol(arg, &ptr, 10);
+	l = op_strtol(arg, &ptr, 10);
 	if((arg == ptr) || (*ptr != '\0'))
 		{
 		ENGINEerr(ENGINE_F_ENGINE_CTRL_CMD_STRING,
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_dyn.c openssl-1.0.0q/crypto/engine/eng_dyn.c
--- openssl-1.0.0q.orig/crypto/engine/eng_dyn.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_dyn.c	2017-04-25 16:23:40.243527875 +0200
@@ -57,6 +57,7 @@
  */
 
 
+#include <openssl/cryptlib.h>
 #include "eng_int.h"
 #include <openssl/dso.h>
 
@@ -192,7 +193,7 @@
 		ENGINEerr(ENGINE_F_DYNAMIC_SET_DATA_CTX,ERR_R_MALLOC_FAILURE);
 		return 0;
 		}
-	memset(c, 0, sizeof(dynamic_data_ctx));
+	op_memset(c, 0, sizeof(dynamic_data_ctx));
 	c->dynamic_dso = NULL;
 	c->v_check = NULL;
 	c->bind_engine = NULL;
@@ -334,7 +335,7 @@
 		{
 	case DYNAMIC_CMD_SO_PATH:
 		/* a NULL 'p' or a string of zero-length is the same thing */
-		if(p && (strlen((const char *)p) < 1))
+		if(p && (op_strlen((const char *)p) < 1))
 			p = NULL;
 		if(ctx->DYNAMIC_LIBNAME)
 			OPENSSL_free((void*)ctx->DYNAMIC_LIBNAME);
@@ -348,7 +349,7 @@
 		return 1;
 	case DYNAMIC_CMD_ID:
 		/* a NULL 'p' or a string of zero-length is the same thing */
-		if(p && (strlen((const char *)p) < 1))
+		if(p && (op_strlen((const char *)p) < 1))
 			p = NULL;
 		if(ctx->engine_id)
 			OPENSSL_free((void*)ctx->engine_id);
@@ -490,7 +491,7 @@
 		}
 	/* First binary copy the ENGINE structure so that we can roll back if
 	 * the hand-over fails */
-	memcpy(&cpy, e, sizeof(ENGINE));
+	op_memcpy(&cpy, e, sizeof(ENGINE));
 	/* Provide the ERR, "ex_data", memory, and locking callbacks so the
 	 * loaded library uses our state rather than its own. FIXME: As noted in
 	 * engine.h, much of this would be simplified if each area of code
@@ -520,7 +521,7 @@
 		ctx->dynamic_dso = NULL;
 		ENGINEerr(ENGINE_F_DYNAMIC_LOAD,ENGINE_R_INIT_FAILED);
 		/* Copy the original ENGINE structure back */
-		memcpy(e, &cpy, sizeof(ENGINE));
+		op_memcpy(e, &cpy, sizeof(ENGINE));
 		return 0;
 		}
 	/* Do we try to add this ENGINE to the internal list too? */
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_err.c openssl-1.0.0q/crypto/engine/eng_err.c
--- openssl-1.0.0q.orig/crypto/engine/eng_err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_err.c	2017-04-25 16:23:40.244527723 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/engine.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_fat.c openssl-1.0.0q/crypto/engine/eng_fat.c
--- openssl-1.0.0q.orig/crypto/engine/eng_fat.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_fat.c	2017-04-25 16:23:40.245527571 +0200
@@ -58,9 +58,12 @@
  * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
  */
 
+#include <openssl/cryptlib.h>
 #include "eng_int.h"
 #include <openssl/conf.h>
 
+
+#ifndef OPERA_SMALL_VERSION
 int ENGINE_set_default(ENGINE *e, unsigned int flags)
 	{
 	if((flags & ENGINE_METHOD_CIPHERS) && !ENGINE_set_default_ciphers(e))
@@ -103,23 +106,23 @@
 static int int_def_cb(const char *alg, int len, void *arg)
 	{
 	unsigned int *pflags = arg;
-	if (!strncmp(alg, "ALL", len))
+	if (!op_strncmp(alg, "ALL", len))
 		*pflags |= ENGINE_METHOD_ALL;
-	else if (!strncmp(alg, "RSA", len))
+	else if (!op_strncmp(alg, "RSA", len))
 		*pflags |= ENGINE_METHOD_RSA;
-	else if (!strncmp(alg, "DSA", len))
+	else if (!op_strncmp(alg, "DSA", len))
 		*pflags |= ENGINE_METHOD_DSA;
-	else if (!strncmp(alg, "ECDH", len))
+	else if (!op_strncmp(alg, "ECDH", len))
 		*pflags |= ENGINE_METHOD_ECDH;
-	else if (!strncmp(alg, "ECDSA", len))
+	else if (!op_strncmp(alg, "ECDSA", len))
 		*pflags |= ENGINE_METHOD_ECDSA;
-	else if (!strncmp(alg, "DH", len))
+	else if (!op_strncmp(alg, "DH", len))
 		*pflags |= ENGINE_METHOD_DH;
-	else if (!strncmp(alg, "RAND", len))
+	else if (!op_strncmp(alg, "RAND", len))
 		*pflags |= ENGINE_METHOD_RAND;
-	else if (!strncmp(alg, "CIPHERS", len))
+	else if (!op_strncmp(alg, "CIPHERS", len))
 		*pflags |= ENGINE_METHOD_CIPHERS;
-	else if (!strncmp(alg, "DIGESTS", len))
+	else if (!op_strncmp(alg, "DIGESTS", len))
 		*pflags |= ENGINE_METHOD_DIGESTS;
 	else if (!strncmp(alg, "PKEY", len))
 		*pflags |=
@@ -179,3 +182,5 @@
 		ENGINE_register_complete(e);
 	return 1;
 	}
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_init.c openssl-1.0.0q/crypto/engine/eng_init.c
--- openssl-1.0.0q.orig/crypto/engine/eng_init.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_init.c	2017-04-25 16:23:40.247527546 +0200
@@ -53,6 +53,10 @@
  *
  */
 
+#include <openssl/cryptlib.h>
+
+#ifndef OPENSSL_NO_ENGINE
+
 #include "eng_int.h"
 
 /* Initialise a engine type for use (or up its functional reference count
@@ -152,3 +156,5 @@
 		}
 	return to_return;
 	}
+
+#endif /* OPENSSL_NO_ENGINE */
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_lib.c openssl-1.0.0q/crypto/engine/eng_lib.c
--- openssl-1.0.0q.orig/crypto/engine/eng_lib.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_lib.c	2017-04-25 16:23:40.248527673 +0200
@@ -56,6 +56,10 @@
  *
  */
 
+#include <openssl/cryptlib.h>
+
+#ifndef OPENSSL_NO_ENGINE
+
 #include "eng_int.h"
 #include <openssl/rand.h>
 
@@ -71,13 +75,14 @@
 		ENGINEerr(ENGINE_F_ENGINE_NEW, ERR_R_MALLOC_FAILURE);
 		return NULL;
 		}
-	memset(ret, 0, sizeof(ENGINE));
+	op_memset(ret, 0, sizeof(ENGINE));
 	ret->struct_ref = 1;
 	engine_ref_debug(ret, 0, 1)
 	CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ENGINE, ret, &ret->ex_data);
 	return ret;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 /* Placed here (close proximity to ENGINE_new) so that modifications to the
  * elements of the ENGINE structure are more likely to be caught and changed
  * here. */
@@ -101,6 +106,7 @@
 	e->cmd_defns = NULL;
 	e->flags = 0;
 	}
+#endif
 
 int engine_free_util(ENGINE *e, int locked)
 	{
@@ -148,7 +154,12 @@
  * cleanup can register a "cleanup" callback here. That way we don't get linker
  * bloat by referring to all *possible* cleanups, but any linker bloat into code
  * "X" will cause X's cleanup function to end up here. */
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(STACK_OF(ENGINE_CLEANUP_ITEM) *, cleanup_stack);
+#define cleanup_stack OPENSSL_GLOBAL_REF(cleanup_stack)
+#else
 static STACK_OF(ENGINE_CLEANUP_ITEM) *cleanup_stack = NULL;
+#endif
 static int int_cleanup_check(int create)
 	{
 	if(cleanup_stack) return 1;
@@ -164,6 +175,7 @@
 	item->cb = cb;
 	return item;
 	}
+#ifndef OPERA_SMALL_VERSION
 void engine_cleanup_add_first(ENGINE_CLEANUP_CB *cb)
 	{
 	ENGINE_CLEANUP_ITEM *item;
@@ -172,6 +184,7 @@
 	if(item)
 		sk_ENGINE_CLEANUP_ITEM_insert(cleanup_stack, item, 0);
 	}
+#endif
 void engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb)
 	{
 	ENGINE_CLEANUP_ITEM *item;
@@ -194,13 +207,16 @@
 			engine_cleanup_cb_free);
 		cleanup_stack = NULL;
 		}
+#ifndef OPERA_SMALL_VERSION
 	/* FIXME: This should be handled (somehow) through RAND, eg. by it
 	 * registering a cleanup callback. */
 	RAND_set_rand_method(NULL);
+#endif
 	}
 
 /* Now the "ex_data" support */
 
+#ifndef OPERA_SMALL_VERSION
 int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
 		CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
 	{
@@ -217,6 +233,7 @@
 	{
 	return(CRYPTO_get_ex_data(&e->ex_data, idx));
 	}
+#endif
 
 /* Functions to get/set an ENGINE's elements - mainly to avoid exposing the
  * ENGINE structure itself. */
@@ -245,6 +262,7 @@
 	return 1;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f)
 	{
 	e->destroy = destroy_f;
@@ -330,3 +348,6 @@
 	{
 	return &internal_static_hack;
 	}
+#endif /* #ifndef OPERA_SMALL_VERSION */
+
+#endif /* OPENSSL_NO_ENGINE */
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_list.c openssl-1.0.0q/crypto/engine/eng_list.c
--- openssl-1.0.0q.orig/crypto/engine/eng_list.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_list.c	2017-04-25 16:23:40.249528079 +0200
@@ -61,6 +61,10 @@
  * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
  */
 
+#include <openssl/cryptlib.h>
+
+#ifndef OPENSSL_NO_ENGINE
+
 #include "eng_int.h"
 
 /* The linked-list of pointers to engine types. engine_list_head
@@ -73,8 +77,15 @@
  * engine_list_head, and each non-null "next" pointer account for
  * the list itself assuming exactly 1 structural reference on each
  * list member. */
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(ENGINE *, engine_list_head);
+#define engine_list_head OPENSSL_GLOBAL_REF(engine_list_head)
+OPENSSL_IMPLEMENT_GLOBAL(ENGINE *, engine_list_tail);
+#define engine_list_tail OPENSSL_GLOBAL_REF(engine_list_tail)
+#else
 static ENGINE *engine_list_head = NULL;
 static ENGINE *engine_list_tail = NULL;
+#endif
 
 /* This cleanup function is only needed internally. If it should be called, we
  * register it with the "ENGINE_cleanup()" stack to be called during cleanup. */
@@ -107,7 +118,7 @@
 	iterator = engine_list_head;
 	while(iterator && !conflict)
 		{
-		conflict = (strcmp(iterator->id, e->id) == 0);
+		conflict = (op_strcmp(iterator->id, e->id) == 0);
 		iterator = iterator->next;
 		}
 	if(conflict)
@@ -204,6 +215,7 @@
 	return ret;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 ENGINE *ENGINE_get_last(void)
 	{
 	ENGINE *ret;
@@ -218,6 +230,7 @@
 	CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 	return ret;
 	}
+#endif
 
 /* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
 ENGINE *ENGINE_get_next(ENGINE *e)
@@ -243,6 +256,7 @@
 	return ret;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 ENGINE *ENGINE_get_prev(ENGINE *e)
 	{
 	ENGINE *ret = NULL;
@@ -265,6 +279,7 @@
 	ENGINE_free(e);
 	return ret;
 	}
+#endif
 
 /* Add another "ENGINE" type into the list. */
 int ENGINE_add(ENGINE *e)
@@ -313,6 +328,7 @@
 	return to_return;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 static void engine_cpy(ENGINE *dest, const ENGINE *src)
 	{
 	dest->id = src->id;
@@ -350,7 +366,7 @@
 ENGINE *ENGINE_by_id(const char *id)
 	{
 	ENGINE *iterator;
-	char *load_dir = NULL;
+	const char *load_dir = NULL;
 	if(id == NULL)
 		{
 		ENGINEerr(ENGINE_F_ENGINE_BY_ID,
@@ -359,7 +375,7 @@
 		}
 	CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
 	iterator = engine_list_head;
-	while(iterator && (strcmp(id, iterator->id) != 0))
+	while(iterator && (op_strcmp(id, iterator->id) != 0))
 		iterator = iterator->next;
 	if(iterator)
 		{
@@ -389,7 +405,9 @@
 		{
 		ENGINEerr(ENGINE_F_ENGINE_BY_ID,
 			ENGINE_R_NO_SUCH_ENGINE);
+#ifndef OPERA_SMALL_VERSION
 		ERR_add_error_data(2, "id=", id);
+#endif
 		}
 	return iterator;
 #else
@@ -432,3 +450,6 @@
 	CRYPTO_add(&e->struct_ref,1,CRYPTO_LOCK_ENGINE);
 	return 1;
 	}
+#endif /* #ifndef OPERA_SMALL_VERSION */
+
+#endif /* OPENSSL_NO_ENGINE */
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_openssl.c openssl-1.0.0q/crypto/engine/eng_openssl.c
--- openssl-1.0.0q.orig/crypto/engine/eng_openssl.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_openssl.c	2017-04-25 16:23:40.250527927 +0200
@@ -62,9 +62,13 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include <openssl/crypto.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+
+#ifndef OPENSSL_NO_ENGINE
+
 #include <openssl/engine.h>
 #include <openssl/dso.h>
 #include <openssl/pem.h>
@@ -80,6 +84,7 @@
 #include <openssl/dh.h>
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 /* This testing gunk is implemented (and explained) lower down. It also assumes
  * the application explicitly calls "ENGINE_load_openssl()" because this is no
  * longer automatic in ENGINE_load_builtin_engines(). */
@@ -123,9 +128,11 @@
 	UI_METHOD *ui_method, void *callback_data);
 #endif
 
+#endif /* OPERA_SMALL_VERSION */
+
 /* The constants used when creating the ENGINE */
-static const char *engine_openssl_id = "openssl";
-static const char *engine_openssl_name = "Software engine support";
+#define engine_openssl_id "openssl"
+#define engine_openssl_name "Software engine support"
 
 /* This internal function is used by ENGINE_openssl() and possibly by the
  * "dynamic" ENGINE support too */
@@ -196,7 +203,7 @@
 #ifdef ENGINE_DYNAMIC_SUPPORT
 static int bind_fn(ENGINE *e, const char *id)
 	{
-	if(id && (strcmp(id, engine_openssl_id) != 0))
+	if(id && (op_strcmp(id, engine_openssl_id) != 0))
 		return 0;
 	if(!bind_helper(e))
 		return 0;
@@ -222,7 +229,7 @@
 static int test_cipher_nids[] = {NID_rc4,NID_rc4_40};
 static int test_cipher_nids_number = 2;
 typedef struct {
-	unsigned char key[TEST_RC4_KEY_SIZE];
+	unsigned char key[TEST_RC4_KEY_SIZE];  /* ARRAY OK UNUSED OPERA 2004-02-18 yngve */
 	RC4_KEY ks;
 	} TEST_RC4_KEY;
 #define test(ctx) ((TEST_RC4_KEY *)(ctx)->cipher_data)
@@ -232,7 +239,7 @@
 #ifdef TEST_ENG_OPENSSL_RC4_P_INIT
 	fprintf(stderr, "(TEST_ENG_OPENSSL_RC4) test_init_key() called\n");
 #endif
-	memcpy(&test(ctx)->key[0],key,EVP_CIPHER_CTX_key_length(ctx));
+	op_memcpy(&test(ctx)->key[0],key,EVP_CIPHER_CTX_key_length(ctx));
 	RC4_set_key(&test(ctx)->ks,EVP_CIPHER_CTX_key_length(ctx),
 		test(ctx)->key);
 	return 1;
@@ -382,3 +389,6 @@
 	return key;
 	}
 #endif
+
+
+#endif /* OPENSSL_NO_ENGINE */
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_pkey.c openssl-1.0.0q/crypto/engine/eng_pkey.c
--- openssl-1.0.0q.orig/crypto/engine/eng_pkey.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_pkey.c	2017-04-25 16:23:40.251527495 +0200
@@ -53,6 +53,7 @@
  *
  */
 
+#include <openssl/cryptlib.h>
 #include "eng_int.h"
 
 /* Basic get/set stuff */
diff -Naur openssl-1.0.0q.orig/crypto/engine/eng_table.c openssl-1.0.0q/crypto/engine/eng_table.c
--- openssl-1.0.0q.orig/crypto/engine/eng_table.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/eng_table.c	2017-04-25 16:23:40.252528740 +0200
@@ -52,8 +52,12 @@
  *
  */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
+
+#ifndef OPENSSL_NO_ENGINE
+
+#include <openssl/engine.h>
 #include <openssl/lhash.h>
 #include "eng_int.h"
 
@@ -86,9 +90,18 @@
 	} ENGINE_PILE_DOALL;
 	
 
+/* This value stores global options controlling behaviour of (mostly) the
+ * engine_table_select() function. It's a bitmask of flag values of the form
+ * ENGINE_TABLE_FLAG_*** (as defined in engine.h) and is controlled by the
+ * ENGINE_[get|set]_table_flags() function. */
+#ifndef OPERA_SMALL_VERSION
 /* Global flags (ENGINE_TABLE_FLAG_***). */
 static unsigned int table_flags = 0;
+#else
+#define table_flags 0
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 /* API function manipulating 'table_flags' */
 unsigned int ENGINE_get_table_flags(void)
 	{
@@ -99,6 +112,7 @@
 	{
 	table_flags = flags;
 	}
+#endif
 
 /* Internal functions for the "piles" hash table */
 static unsigned long engine_pile_hash(const ENGINE_PILE *c)
@@ -127,6 +141,7 @@
 
 /* Privately exposed (via eng_int.h) functions for adding and/or removing
  * ENGINEs from the implementation table */
+#ifndef OPERA_SMALL_VERSION
 int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
 		ENGINE *e, const int *nids, int num_nids, int setdefault)
 	{
@@ -186,6 +201,7 @@
 	CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 	return ret;
 	}
+#endif
 static void int_unregister_cb_doall_arg(ENGINE_PILE *pile, ENGINE *e)
 	{
 	int n;
@@ -332,6 +348,8 @@
 	return ret;
 	}
 
+#endif /* OPENSSL_NO_ENGINE */
+
 /* Table enumeration */
 
 static void int_cb_doall_arg(ENGINE_PILE *pile, ENGINE_PILE_DOALL *dall)
diff -Naur openssl-1.0.0q.orig/crypto/engine/enginetest.c openssl-1.0.0q/crypto/engine/enginetest.c
--- openssl-1.0.0q.orig/crypto/engine/enginetest.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/enginetest.c	2017-04-25 16:23:40.253527750 +0200
@@ -56,8 +56,13 @@
  *
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/e_os2.h>
 
 #ifdef OPENSSL_NO_ENGINE
@@ -106,7 +111,7 @@
 	ENGINE *new_h4 = NULL;
 
 	/* enable memory leak checking unless explicitly disabled */
-	if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) && (0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off"))))
+	if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) && (0 == op_strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off"))))
 		{
 		CRYPTO_malloc_debug_init();
 		CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
@@ -119,7 +124,7 @@
 	CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
 	ERR_load_crypto_strings();
 
-	memset(block, 0, 512 * sizeof(ENGINE *));
+	op_memset(block, 0, 512 * sizeof(ENGINE *));
 	if(((new_h1 = ENGINE_new()) == NULL) ||
 			!ENGINE_set_id(new_h1, "test_id0") ||
 			!ENGINE_set_name(new_h1, "First test item") ||
@@ -219,9 +224,9 @@
 	printf("About to beef up the engine-type list\n");
 	for(loop = 0; loop < 512; loop++)
 		{
-		sprintf(buf, "id%i", loop);
+		op_sprintf(buf, "id%i", loop);
 		id = BUF_strdup(buf);
-		sprintf(buf, "Fake engine type %i", loop);
+		op_sprintf(buf, "Fake engine type %i", loop);
 		name = BUF_strdup(buf);
 		if(((block[loop] = ENGINE_new()) == NULL) ||
 				!ENGINE_set_id(block[loop], id) ||
diff -Naur openssl-1.0.0q.orig/crypto/engine/tb_cipher.c openssl-1.0.0q/crypto/engine/tb_cipher.c
--- openssl-1.0.0q.orig/crypto/engine/tb_cipher.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/tb_cipher.c	2017-04-25 16:23:40.320320876 +0200
@@ -52,6 +52,14 @@
  *
  */
 
+#include <openssl/cryptlib.h>
+
+#include <openssl/evp.h>
+
+
+#ifndef OPENSSL_NO_ENGINE
+
+#include <openssl/engine.h>
 #include "eng_int.h"
 
 /* If this symbol is defined then ENGINE_get_cipher_engine(), the function that
@@ -59,6 +67,7 @@
  * brief debugging summaries to stderr with the 'nid'. */
 /* #define ENGINE_CIPHER_DEBUG */
 
+#ifndef OPERA_SMALL_VERSION
 static ENGINE_TABLE *cipher_table = NULL;
 
 void ENGINE_unregister_ciphers(ENGINE *e)
@@ -114,6 +123,7 @@
 	{
 	return engine_table_select(&cipher_table, nid);
 	}
+#endif
 
 /* Obtains a cipher implementation from an ENGINE functional reference */
 const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid)
@@ -135,9 +145,13 @@
 	return e->ciphers;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 /* Sets the cipher callback in an ENGINE structure */
 int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f)
 	{
 	e->ciphers = f;
 	return 1;
 	}
+#endif
+
+#endif /* OPENSSL_NO_ENGINE */
diff -Naur openssl-1.0.0q.orig/crypto/engine/tb_dh.c openssl-1.0.0q/crypto/engine/tb_dh.c
--- openssl-1.0.0q.orig/crypto/engine/tb_dh.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/tb_dh.c	2017-04-25 16:23:40.321321561 +0200
@@ -52,6 +52,13 @@
  *
  */
 
+#ifndef OPENSSL_NO_DSA
+
+#include <openssl/evp.h>
+
+#ifndef OPENSSL_NO_ENGINE
+
+#include <openssl/engine.h>
 #include "eng_int.h"
 
 /* If this symbol is defined then ENGINE_get_default_DH(), the function that is
@@ -62,6 +69,7 @@
 static ENGINE_TABLE *dh_table = NULL;
 static const int dummy_nid = 1;
 
+#ifndef OPERA_SMALL_VERSION
 void ENGINE_unregister_DH(ENGINE *e)
 	{
 	engine_table_unregister(&dh_table, e);
@@ -95,6 +103,7 @@
 				engine_unregister_all_DH, e, &dummy_nid, 1, 1);
 	return 1;
 	}
+#endif
 
 /* Exposed API function to get a functional reference from the implementation
  * table (ie. try to get a functional reference from the tabled structural
@@ -116,3 +125,7 @@
 	e->dh_meth = dh_meth;
 	return 1;
 	}
+
+
+#endif /* OPENSSL_NO_ENGINE */
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/engine/tb_digest.c openssl-1.0.0q/crypto/engine/tb_digest.c
--- openssl-1.0.0q.orig/crypto/engine/tb_digest.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/tb_digest.c	2017-04-25 16:23:40.322321968 +0200
@@ -52,6 +52,13 @@
  *
  */
 
+#include <openssl/cryptlib.h>
+
+#include <openssl/evp.h>
+
+#ifndef OPENSSL_NO_ENGINE
+
+#include <openssl/engine.h>
 #include "eng_int.h"
 
 /* If this symbol is defined then ENGINE_get_digest_engine(), the function that
@@ -59,6 +66,7 @@
  * brief debugging summaries to stderr with the 'nid'. */
 /* #define ENGINE_DIGEST_DEBUG */
 
+#ifndef OPERA_SMALL_VERSION
 static ENGINE_TABLE *digest_table = NULL;
 
 void ENGINE_unregister_digests(ENGINE *e)
@@ -114,6 +122,7 @@
 	{
 	return engine_table_select(&digest_table, nid);
 	}
+#endif
 
 /* Obtains a digest implementation from an ENGINE functional reference */
 const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid)
@@ -141,3 +150,5 @@
 	e->digests = f;
 	return 1;
 	}
+
+#endif /* OPENSSL_NO_ENGINE */
diff -Naur openssl-1.0.0q.orig/crypto/engine/tb_dsa.c openssl-1.0.0q/crypto/engine/tb_dsa.c
--- openssl-1.0.0q.orig/crypto/engine/tb_dsa.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/tb_dsa.c	2017-04-25 16:23:40.322321968 +0200
@@ -52,6 +52,13 @@
  *
  */
 
+#ifndef OPENSSL_NO_DSA
+
+#ifndef OPENSSL_NO_ENGINE
+
+
+#include <openssl/evp.h>
+#include <openssl/engine.h>
 #include "eng_int.h"
 
 /* If this symbol is defined then ENGINE_get_default_DSA(), the function that is
@@ -62,6 +69,7 @@
 static ENGINE_TABLE *dsa_table = NULL;
 static const int dummy_nid = 1;
 
+#ifndef OPERA_SMALL_VERSION
 void ENGINE_unregister_DSA(ENGINE *e)
 	{
 	engine_table_unregister(&dsa_table, e);
@@ -95,6 +103,7 @@
 				engine_unregister_all_DSA, e, &dummy_nid, 1, 1);
 	return 1;
 	}
+#endif
 
 /* Exposed API function to get a functional reference from the implementation
  * table (ie. try to get a functional reference from the tabled structural
@@ -116,3 +125,8 @@
 	e->dsa_meth = dsa_meth;
 	return 1;
 	}
+
+
+#endif /* OPENSSL_NO_ENGINE */
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/engine/tb_rand.c openssl-1.0.0q/crypto/engine/tb_rand.c
--- openssl-1.0.0q.orig/crypto/engine/tb_rand.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/tb_rand.c	2017-04-25 16:23:40.323320978 +0200
@@ -52,6 +52,13 @@
  *
  */
 
+#include <openssl/cryptlib.h>
+
+#include <openssl/evp.h>
+
+#ifndef OPENSSL_NO_ENGINE
+
+#include <openssl/engine.h>
 #include "eng_int.h"
 
 /* If this symbol is defined then ENGINE_get_default_RAND(), the function that is
@@ -59,6 +66,7 @@
  * display brief debugging summaries to stderr with the 'nid'. */
 /* #define ENGINE_RAND_DEBUG */
 
+#ifndef OPERA_SMALL_VERSION
 static ENGINE_TABLE *rand_table = NULL;
 static const int dummy_nid = 1;
 
@@ -103,6 +111,7 @@
 	{
 	return engine_table_select(&rand_table, dummy_nid);
 	}
+#endif
 
 /* Obtains an RAND implementation from an ENGINE functional reference */
 const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e)
@@ -116,3 +125,5 @@
 	e->rand_meth = rand_meth;
 	return 1;
 	}
+
+#endif /* OPENSSL_NO_ENGINE */
diff -Naur openssl-1.0.0q.orig/crypto/engine/tb_rsa.c openssl-1.0.0q/crypto/engine/tb_rsa.c
--- openssl-1.0.0q.orig/crypto/engine/tb_rsa.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/engine/tb_rsa.c	2017-04-25 16:23:40.324322501 +0200
@@ -52,6 +52,12 @@
  *
  */
 
+#include <openssl/cryptlib.h>
+
+#ifndef OPENSSL_NO_ENGINE
+
+#include <openssl/evp.h>
+#include <openssl/engine.h>
 #include "eng_int.h"
 
 /* If this symbol is defined then ENGINE_get_default_RSA(), the function that is
@@ -59,6 +65,7 @@
  * display brief debugging summaries to stderr with the 'nid'. */
 /* #define ENGINE_RSA_DEBUG */
 
+#ifndef OPERA_SMALL_VERSION
 static ENGINE_TABLE *rsa_table = NULL;
 static const int dummy_nid = 1;
 
@@ -103,6 +110,7 @@
 	{
 	return engine_table_select(&rsa_table, dummy_nid);
 	}
+#endif
 
 /* Obtains an RSA implementation from an ENGINE functional reference */
 const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e)
@@ -116,3 +124,5 @@
 	e->rsa_meth = rsa_meth;
 	return 1;
 	}
+
+#endif /* OPENSSL_NO_ENGINE */
diff -Naur openssl-1.0.0q.orig/crypto/err/.gitignore openssl-1.0.0q/crypto/err/.gitignore
--- openssl-1.0.0q.orig/crypto/err/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/err/.gitignore	2017-04-25 16:23:40.325321790 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/err/err.c openssl-1.0.0q/crypto/err/err.c
--- openssl-1.0.0q.orig/crypto/err/err.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/err/err.c	2017-04-25 16:23:40.326322197 +0200
@@ -109,15 +109,20 @@
  *
  */
 
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 #include <openssl/crypto.h>
 #include <openssl/buffer.h>
 #include <openssl/bio.h>
 #include <openssl/err.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 DECLARE_LHASH_OF(ERR_STRING_DATA);
 DECLARE_LHASH_OF(ERR_STATE);
@@ -222,7 +227,8 @@
 	};
 #endif
 
-
+// Declaration moved from err.c to err.h in order to be included into libopeay_constants.h.
+#ifndef OPERA_SMALL_VERSION
 /* Define the predeclared (but externally opaque) "ERR_FNS" type */
 struct st_ERR_FNS
 	{
@@ -241,6 +247,7 @@
 	/* Returns the next available error "library" numbers */
 	int (*cb_get_next_lib)(void);
 	};
+#endif // !OPERA_SMALL_VERSION
 
 /* Predeclarations of the "err_defaults" functions */
 static LHASH_OF(ERR_STRING_DATA) *int_err_get(int create);
@@ -254,24 +261,26 @@
 static ERR_STATE *int_thread_set_item(ERR_STATE *);
 static void int_thread_del_item(const ERR_STATE *);
 static int int_err_get_next_lib(void);
+
 /* The static ERR_FNS table using these defaults functions */
-static const ERR_FNS err_defaults =
-	{
-	int_err_get,
-	int_err_del,
-	int_err_get_item,
-	int_err_set_item,
-	int_err_del_item,
-	int_thread_get,
-	int_thread_release,
-	int_thread_get_item,
-	int_thread_set_item,
-	int_thread_del_item,
-	int_err_get_next_lib
-	};
+OPENSSL_PREFIX_CONST_ITEM(static, ERR_FNS, err__err_defaults, libopeay) \
+	CONST_ITEM_ENTRY_START( cb_err_get,            int_err_get) \
+	CONST_ITEM_ENTRY_SINGLE(cb_err_del,            int_err_del) \
+	CONST_ITEM_ENTRY_SINGLE(cb_err_get_item,       int_err_get_item) \
+	CONST_ITEM_ENTRY_SINGLE(cb_err_set_item,       int_err_set_item) \
+	CONST_ITEM_ENTRY_SINGLE(cb_err_del_item,       int_err_del_item) \
+	CONST_ITEM_ENTRY_SINGLE(cb_thread_get,         int_thread_get) \
+	CONST_ITEM_ENTRY_SINGLE(cb_thread_release,     int_thread_release) \
+	CONST_ITEM_ENTRY_SINGLE(cb_thread_get_item,    int_thread_get_item) \
+	CONST_ITEM_ENTRY_SINGLE(cb_thread_set_item,    int_thread_set_item) \
+	CONST_ITEM_ENTRY_SINGLE(cb_thread_del_item,    int_thread_del_item) \
+	CONST_ITEM_ENTRY_SINGLE(cb_get_next_lib,       int_err_get_next_lib) \
+CONST_ITEM_ENTRY_END
+#define err_defaults OPENSSL_GLOBAL_ITEM_NAME(err__err_defaults)
 
 /* The replacable table of ERR_FNS functions we use at run-time */
-static const ERR_FNS *err_fns = NULL;
+OPENSSL_IMPLEMENT_GLOBAL(const ERR_FNS *, err__err_fns);
+#define err_fns OPENSSL_GLOBAL_REF(err__err_fns)
 
 /* Eg. rather than using "err_get()", use "ERRFN(err_get)()". */
 #define ERRFN(a) err_fns->cb_##a
@@ -281,10 +290,17 @@
  * "err_defaults" functions. This way, a linked module can completely defer all
  * ERR state operation (together with requisite locking) to the implementations
  * and state in the loading application. */
-static LHASH_OF(ERR_STRING_DATA) *int_error_hash = NULL;
-static LHASH_OF(ERR_STATE) *int_thread_hash = NULL;
-static int int_thread_hash_references = 0;
-static int int_err_library_number= ERR_LIB_USER;
+OPENSSL_IMPLEMENT_GLOBAL(LHASH_OF(ERR_STRING_DATA) *, err__int_error_hash);
+#define int_error_hash OPENSSL_GLOBAL_REF(err__int_error_hash)
+
+OPENSSL_IMPLEMENT_GLOBAL(LHASH_OF(ERR_STATE) *, err__int_thread_hash);
+#define int_thread_hash OPENSSL_GLOBAL_REF(err__int_thread_hash)
+
+OPENSSL_IMPLEMENT_GLOBAL(int, err__int_thread_hash_references);
+#define int_thread_hash_references OPENSSL_GLOBAL_REF(err__int_thread_hash_references)
+
+OPENSSL_IMPLEMENT_GLOBAL(int, err__int_err_library_number);
+#define int_err_library_number OPENSSL_GLOBAL_REF(err__int_err_library_number)
 
 /* Internal function that checks whether "err_fns" is set and if not, sets it to
  * the defaults. */
@@ -632,6 +648,7 @@
 	(p)->err_data_flags[i]=0; \
 	} while(0)
 
+#ifndef OPENSSL_NO_ERR
 #define err_clear(p,i) \
 	do { \
 	(p)->err_flags[i]=0; \
@@ -640,6 +657,14 @@
 	(p)->err_file[i]=NULL; \
 	(p)->err_line[i]= -1; \
 	} while(0)
+#else
+#define err_clear(p,i) \
+	do { \
+	(p)->err_flags[i]=0; \
+	(p)->err_buffer[i]=0; \
+	err_clear_data(p,i); \
+	} while(0)
+#endif
 
 static void ERR_STATE_free(ERR_STATE *s)
 	{
@@ -714,7 +739,7 @@
 	 * This dirty hack strips them to something sensible.
 	 * @@@ We shouldn't modify a const string, though.
 	 */
-	if (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) {
+	if (op_strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) {
 		char *end;
 
 		/* Skip the "*POSIX(" prefix */
@@ -723,7 +748,7 @@
 		if (*end == ')')
 			*end = '\0';
 		/* Optional: use the basename of the path only. */
-		if ((end = strrchr(file, '/')) != NULL)
+		if ((end = op_strrchr(file, '/')) != NULL)
 			file = &end[1];
 	}
 #endif
@@ -734,8 +759,10 @@
 		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
 	es->err_flags[es->top]=0;
 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
+#ifndef OPENSSL_NO_ERR
 	es->err_file[es->top]=file;
 	es->err_line[es->top]=line;
+#endif
 	err_clear_data(es,es->top);
 	}
 
@@ -757,6 +784,7 @@
 unsigned long ERR_get_error(void)
 	{ return(get_error_values(1,0,NULL,NULL,NULL,NULL)); }
 
+#ifndef OPERA_SMALL_VERSION
 unsigned long ERR_get_error_line(const char **file,
 	     int *line)
 	{ return(get_error_values(1,0,file,line,NULL,NULL)); }
@@ -764,11 +792,13 @@
 unsigned long ERR_get_error_line_data(const char **file, int *line,
 	     const char **data, int *flags)
 	{ return(get_error_values(1,0,file,line,data,flags)); }
+#endif
 
 
 unsigned long ERR_peek_error(void)
 	{ return(get_error_values(0,0,NULL,NULL,NULL,NULL)); }
 
+#ifndef OPERA_SMALL_VERSION
 unsigned long ERR_peek_error_line(const char **file, int *line)
 	{ return(get_error_values(0,0,file,line,NULL,NULL)); }
 
@@ -786,15 +816,25 @@
 unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
 	     const char **data, int *flags)
 	{ return(get_error_values(0,1,file,line,data,flags)); }
+#endif
 
-
-static unsigned long get_error_values(int inc, int top, const char **file, int *line,
+static unsigned long get_error_values(int inc, int top, const char **fake_file, int *fake_line,
 	     const char **data, int *flags)
 	{	
 	int i=0;
 	ERR_STATE *es;
 	unsigned long ret;
 
+	// Opera local patch begin.
+	// Do not disclose filename and line number.
+	// Report fake values.
+	if (fake_file) *fake_file = "";
+	if (fake_line) *fake_line = 0;
+	// Create fake variables to fool the rest of the code in this function.
+	const char **file = NULL;
+	int *line = 0;
+	// Opera local patch end.
+
 	es=ERR_get_state();
 
 	if (inc && top)
@@ -820,6 +860,7 @@
 		es->err_buffer[i]=0;
 		}
 
+#ifndef OPENSSL_NO_ERR
 	if ((file != NULL) && (line != NULL))
 		{
 		if (es->err_file[i] == NULL)
@@ -833,6 +874,7 @@
 			if (line != NULL) *line=es->err_line[i];
 			}
 		}
+#endif
 
 	if (data == NULL)
 		{
@@ -872,15 +914,15 @@
 	rs=ERR_reason_error_string(e);
 
 	if (ls == NULL) 
-		BIO_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
+		op_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
 	if (fs == NULL)
-		BIO_snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
+		op_snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
 	if (rs == NULL)
-		BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
+		op_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
 
-	BIO_snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf, 
+	op_snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf,
 		fs?fs:fsbuf, rs?rs:rsbuf);
-	if (strlen(buf) == len-1)
+	if (op_strlen(buf) == len-1)
 		{
 		/* output may be truncated; make sure we always have 5 
 		 * colon-separated fields, i.e. 4 colons ... */
@@ -892,7 +934,7 @@
 			
 			for (i = 0; i < NUM_COLONS; i++)
 				{
-				char *colon = strchr(s, ':');
+				char *colon = op_strchr(s, ':');
 				if (colon == NULL || colon > &buf[len-1] - NUM_COLONS + i)
 					{
 					/* set colon no. i at last possible position
@@ -1001,9 +1043,16 @@
 	}
 #endif
 
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(ERR_STATE, err__fallback);
+#define fallback OPENSSL_GLOBAL_REF(err__fallback)
+#endif
+
 ERR_STATE *ERR_get_state(void)
 	{
+#ifndef OPERA_SMALL_VERSION
 	static ERR_STATE fallback;
+#endif
 	ERR_STATE *ret,tmp,*tmpp=NULL;
 	int i;
 	CRYPTO_THREADID tid;
@@ -1041,11 +1090,13 @@
 	return ret;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int ERR_get_next_error_library(void)
 	{
 	err_fns_check();
 	return ERRFN(get_next_lib)();
 	}
+#endif
 
 void ERR_set_error_data(char *data, int flags)
 	{
@@ -1070,7 +1121,7 @@
 	char *str,*p,*a;
 
 	s=80;
-	str=OPENSSL_malloc(s+1);
+	str= (char *) OPENSSL_malloc(s+1);
 	if (str == NULL) return;
 	str[0]='\0';
 
@@ -1082,11 +1133,11 @@
 		/* ignore NULLs, thanks to Bob Beck <beck@obtuse.com> */
 		if (a != NULL)
 			{
-			n+=strlen(a);
+			n+=op_strlen(a);
 			if (n > s)
 				{
 				s=n+20;
-				p=OPENSSL_realloc(str,s+1);
+				p= (char *) OPENSSL_realloc(str,s+1);
 				if (p == NULL)
 					{
 					OPENSSL_free(str);
@@ -1133,3 +1184,13 @@
 	es->err_flags[es->top]&=~ERR_FLAG_MARK;
 	return 1;
 	}
+
+#else // #if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+
+// Stubs for linking of the "minimal" profile without support for "complex globals".
+unsigned long ERR_get_error(void)  { return 0; }
+unsigned long ERR_peek_error(void) { return 0; }
+void ERR_clear_error(void) { return; }
+void ERR_remove_thread_state(const CRYPTO_THREADID *tid) { return; }
+
+#endif // #if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/err/err.h openssl-1.0.0q/crypto/err/err.h
--- openssl-1.0.0q.orig/crypto/err/err.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/err/err.h	2017-04-25 16:23:40.327322045 +0200
@@ -115,8 +115,10 @@
 #include <openssl/e_os2.h>
 
 #ifndef OPENSSL_NO_FP_API
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #include <openssl/ossl_typ.h>
@@ -137,7 +139,9 @@
 #define ERR_PUT_error(a,b,c,d,e)	ERR_put_error(a,b,c,NULL,0)
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #define ERR_TXT_MALLOCED	0x01
 #define ERR_TXT_STRING		0x02
@@ -152,8 +156,10 @@
 	unsigned long err_buffer[ERR_NUM_ERRORS];
 	char *err_data[ERR_NUM_ERRORS];
 	int err_data_flags[ERR_NUM_ERRORS];
+#ifndef OPENSSL_NO_ERR
 	const char *err_file[ERR_NUM_ERRORS];
 	int err_line[ERR_NUM_ERRORS];
+#endif
 	int top,bottom;
 	} ERR_STATE;
 
@@ -378,6 +384,28 @@
  * the application's "ERR_FNS". */
 int ERR_set_implementation(const ERR_FNS *fns);
 
+// Declaration moved from err.c to err.h in order to be included into libopeay_constants.h.
+#ifdef OPERA_SMALL_VERSION
+/* Define the predeclared (but externally opaque) "ERR_FNS" type */
+struct st_ERR_FNS
+	{
+	/* Works on the "error_hash" string table */
+	LHASH_OF(ERR_STRING_DATA) *(*cb_err_get)(int create);
+	void (*cb_err_del)(void);
+	ERR_STRING_DATA *(*cb_err_get_item)(const ERR_STRING_DATA *);
+	ERR_STRING_DATA *(*cb_err_set_item)(ERR_STRING_DATA *);
+	ERR_STRING_DATA *(*cb_err_del_item)(ERR_STRING_DATA *);
+	/* Works on the "thread_hash" error-state table */
+	LHASH_OF(ERR_STATE) *(*cb_thread_get)(int create);
+	void (*cb_thread_release)(LHASH_OF(ERR_STATE) **hash);
+	ERR_STATE *(*cb_thread_get_item)(const ERR_STATE *);
+	ERR_STATE *(*cb_thread_set_item)(ERR_STATE *);
+	void (*cb_thread_del_item)(const ERR_STATE *);
+	/* Returns the next available error "library" numbers */
+	int (*cb_get_next_lib)(void);
+	};
+#endif // OPERA_SMALL_VERSION
+
 #ifdef	__cplusplus
 }
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/err/err_all.c openssl-1.0.0q/crypto/err/err_all.c
--- openssl-1.0.0q.orig/crypto/err/err_all.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/err/err_all.c	2017-04-25 16:23:40.328322172 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/asn1.h>
 #include <openssl/bn.h>
 #ifndef OPENSSL_NO_EC
diff -Naur openssl-1.0.0q.orig/crypto/err/err_prn.c openssl-1.0.0q/crypto/err/err_prn.c
--- openssl-1.0.0q.orig/crypto/err/err_prn.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/err/err_prn.c	2017-04-25 16:23:40.328322172 +0200
@@ -56,19 +56,26 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 #include <openssl/crypto.h>
 #include <openssl/buffer.h>
 #include <openssl/err.h>
 
+#ifndef OPERA_SMALL_VERSION
 void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u),
 			 void *u)
 	{
 	unsigned long l;
-	char buf[256];
-	char buf2[4096];
+	char buf[256];		/* ARRAY OK UNUSED OPERA 2004-02-18 yngve */
+	char buf2[4096];	/* ARRAY OK UNUSED OPERA 2004-02-18 yngve */
 	const char *file,*data;
 	int line,flags;
 	unsigned long es;
@@ -81,7 +88,7 @@
 		ERR_error_string_n(l, buf, sizeof buf);
 		BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
 			file, line, (flags & ERR_TXT_STRING) ? data : "");
-		if (cb(buf2, strlen(buf2), u) <= 0)
+		if (cb(buf2, op_strlen(buf2), u) <= 0)
 			break; /* abort outputting the error report */
 		}
 	}
@@ -112,3 +119,4 @@
 	}
 
 	
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/err/opera_err.cpp openssl-1.0.0q/crypto/err/opera_err.cpp
--- openssl-1.0.0q.orig/crypto/err/opera_err.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/err/opera_err.cpp	2017-04-25 16:23:40.329321740 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/err/err.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
diff -Naur openssl-1.0.0q.orig/crypto/evp/.gitignore openssl-1.0.0q/crypto/evp/.gitignore
--- openssl-1.0.0q.orig/crypto/evp/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/.gitignore	2017-04-25 16:23:40.329321740 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/evp/bio_b64.c openssl-1.0.0q/crypto/evp/bio_b64.c
--- openssl-1.0.0q.orig/crypto/evp/bio_b64.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/bio_b64.c	2017-04-25 16:23:40.330322147 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/evp.h>
@@ -87,11 +89,11 @@
 	int start;		/* have we started decoding yet? */
 	int cont;		/* <= 0 when finished */
 	EVP_ENCODE_CTX base64;
-	char buf[EVP_ENCODE_LENGTH(B64_BLOCK_SIZE)+10];
-	char tmp[B64_BLOCK_SIZE];
+	char buf[EVP_ENCODE_LENGTH(B64_BLOCK_SIZE)+10]; /* ARRAY OK UNUSED 2007-04-23 yngve */
+	char tmp[B64_BLOCK_SIZE]; /* ARRAY OK UNUSED 2007-04-23 yngve */
 	} BIO_B64_CTX;
 
-static BIO_METHOD methods_b64=
+static const BIO_METHOD methods_b64=
 	{
 	BIO_TYPE_BASE64,"base64 encoding",
 	b64_write,
@@ -104,7 +106,7 @@
 	b64_callback_ctrl,
 	};
 
-BIO_METHOD *BIO_f_base64(void)
+const BIO_METHOD *BIO_f_base64(void)
 	{
 	return(&methods_b64);
 	}
@@ -170,7 +172,7 @@
 		i=ctx->buf_len-ctx->buf_off;
 		if (i > outl) i=outl;
 		OPENSSL_assert(ctx->buf_off+i < (int)sizeof(ctx->buf));
-		memcpy(out,&(ctx->buf[ctx->buf_off]),i);
+		op_memcpy(out,&(ctx->buf[ctx->buf_off]),i);
 		ret=i;
 		out+=i;
 		outl-=i;
@@ -325,7 +327,7 @@
 			 * number consumed */
 			if (jj != i)
 				{
-				memmove(ctx->tmp, &ctx->tmp[jj], i-jj);
+				op_memmove(ctx->tmp, &ctx->tmp[jj], i-jj);
 				ctx->tmp_len=i-jj;
 				}
 			ctx->buf_len=0;
@@ -355,7 +357,7 @@
 		else
 			i=outl;
 
-		memcpy(out,ctx->buf,i);
+		op_memcpy(out,ctx->buf,i);
 		ret+=i;
 		ctx->buf_off=i;
 		if (ctx->buf_off == ctx->buf_len)
@@ -427,7 +429,7 @@
 				/* There's a theoretical possibility for this */
 				if (n > inl) 
 					n=inl;
-				memcpy(&(ctx->tmp[ctx->tmp_len]),in,n);
+				op_memcpy(&(ctx->tmp[ctx->tmp_len]),in,n);
 				ctx->tmp_len+=n;
 				ret += n;
 				if (ctx->tmp_len < 3)
@@ -443,7 +445,7 @@
 				{
 				if (n < 3)
 					{
-					memcpy(ctx->tmp,in,n);
+					op_memcpy(ctx->tmp,in,n);
 					ctx->tmp_len=n;
 					ret += n;
 					break;
diff -Naur openssl-1.0.0q.orig/crypto/evp/bio_enc.c openssl-1.0.0q/crypto/evp/bio_enc.c
--- openssl-1.0.0q.orig/crypto/evp/bio_enc.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/bio_enc.c	2017-04-25 16:23:40.331321995 +0200
@@ -56,11 +56,16 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include <openssl/evp.h>
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 static int enc_write(BIO *h, const char *buf, int num);
 static int enc_read(BIO *h, char *buf, int size);
@@ -84,11 +89,10 @@
 	/* buf is larger than ENC_BLOCK_SIZE because EVP_DecryptUpdate
 	 * can return up to a block more data than is presented to it
 	 */
-	char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2];
+	char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2]; /* ARRAY OK UNUSED 2007-04-23  yngve */
 	} BIO_ENC_CTX;
 
-static BIO_METHOD methods_enc=
-	{
+BIO_METHOD_CONST_ITEM(bio_enc__methods_enc,
 	BIO_TYPE_CIPHER,"cipher",
 	enc_write,
 	enc_read,
@@ -97,10 +101,11 @@
 	enc_ctrl,
 	enc_new,
 	enc_free,
-	enc_callback_ctrl,
-	};
+	enc_callback_ctrl
+	);
+#define methods_enc OPENSSL_GLOBAL_ITEM_NAME(bio_enc__methods_enc)
 
-BIO_METHOD *BIO_f_cipher(void)
+const BIO_METHOD *BIO_f_cipher(void)
 	{
 	return(&methods_enc);
 	}
@@ -155,7 +160,7 @@
 		{
 		i=ctx->buf_len-ctx->buf_off;
 		if (i > outl) i=outl;
-		memcpy(out,&(ctx->buf[ctx->buf_off]),i);
+		op_memcpy(out,&(ctx->buf[ctx->buf_off]),i);
 		ret=i;
 		out+=i;
 		outl-=i;
@@ -216,7 +221,7 @@
 		else
 			i=outl;
 		if (i <= 0) break;
-		memcpy(out,ctx->buf,i);
+		op_memcpy(out,ctx->buf,i);
 		ret+=i;
 		ctx->buf_off=i;
 		outl-=i;
@@ -378,12 +383,7 @@
 	long ret=1;
 
 	if (b->next_bio == NULL) return(0);
-	switch (cmd)
-		{
-	default:
-		ret=BIO_callback_ctrl(b->next_bio,cmd,fp);
-		break;
-		}
+	ret=BIO_callback_ctrl(b->next_bio,cmd,fp);
 	return(ret);
 	}
 
@@ -400,7 +400,7 @@
 
 	b->init=1;
 	ctx=(BIO_ENC_CTX *)b->ptr;
-	memcpy(ctx->cipher,c,sizeof(EVP_CIPHER_CTX));
+	op_memcpy(ctx->cipher,c,sizeof(EVP_CIPHER_CTX));
 	
 	if (b->callback != NULL)
 		b->callback(b,BIO_CB_CTRL,(char *)c,BIO_CTRL_SET,e,1L);
diff -Naur openssl-1.0.0q.orig/crypto/evp/bio_md.c openssl-1.0.0q/crypto/evp/bio_md.c
--- openssl-1.0.0q.orig/crypto/evp/bio_md.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/bio_md.c	2017-04-25 16:23:40.332322401 +0200
@@ -56,11 +56,16 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include <openssl/evp.h>
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 /* BIO_put and BIO_get both add to the digest,
  * BIO_gets returns the digest */
@@ -74,8 +79,7 @@
 static int md_free(BIO *data);
 static long md_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp);
 
-static BIO_METHOD methods_md=
-	{
+BIO_METHOD_CONST_ITEM(bio_md__methods_md,
 	BIO_TYPE_MD,"message digest",
 	md_write,
 	md_read,
@@ -84,10 +88,11 @@
 	md_ctrl,
 	md_new,
 	md_free,
-	md_callback_ctrl,
-	};
+	md_callback_ctrl
+	);
+#define methods_md OPENSSL_GLOBAL_ITEM_NAME(bio_md__methods_md)
 
-BIO_METHOD *BIO_f_md(void)
+const BIO_METHOD *BIO_f_md(void)
 	{
 	return(&methods_md);
 	}
@@ -108,7 +113,7 @@
 static int md_free(BIO *a)
 	{
 	if (a == NULL) return(0);
-	EVP_MD_CTX_destroy(a->ptr);
+	EVP_MD_CTX_destroy((EVP_MD_CTX *)a->ptr);
 	a->ptr=NULL;
 	a->init=0;
 	a->flags=0;
@@ -121,7 +126,7 @@
 	EVP_MD_CTX *ctx;
 
 	if (out == NULL) return(0);
-	ctx=b->ptr;
+	ctx=(EVP_MD_CTX *)b->ptr;
 
 	if ((ctx == NULL) || (b->next_bio == NULL)) return(0);
 
@@ -145,7 +150,7 @@
 	EVP_MD_CTX *ctx;
 
 	if ((in == NULL) || (inl <= 0)) return(0);
-	ctx=b->ptr;
+	ctx=(EVP_MD_CTX *)b->ptr;
 
 	if ((ctx != NULL) && (b->next_bio != NULL))
 		ret=BIO_write(b->next_bio,in,inl);
@@ -173,7 +178,7 @@
 	long ret=1;
 	BIO *dbio;
 
-	ctx=b->ptr;
+	ctx=(EVP_MD_CTX *)b->ptr;
 
 	switch (cmd)
 		{
@@ -188,14 +193,14 @@
 	case BIO_C_GET_MD:
 		if (b->init)
 			{
-			ppmd=ptr;
+			ppmd=(const EVP_MD **)ptr;
 			*ppmd=ctx->digest;
 			}
 		else
 			ret=0;
 		break;
 	case BIO_C_GET_MD_CTX:
-		pctx=ptr;
+		pctx=(EVP_MD_CTX **)ptr;
 		*pctx=ctx;
 		b->init = 1;
 		break;
@@ -212,14 +217,14 @@
 		break;
 
 	case BIO_C_SET_MD:
-		md=ptr;
+		md=(EVP_MD *)ptr;
 		ret = EVP_DigestInit_ex(ctx,md, NULL);
 		if (ret > 0)
 			b->init=1;
 		break;
 	case BIO_CTRL_DUP:
-		dbio=ptr;
-		dctx=dbio->ptr;
+		dbio=(BIO *)ptr;
+		dctx=(EVP_MD_CTX *)dbio->ptr;
 		EVP_MD_CTX_copy_ex(dctx,ctx);
 		b->init=1;
 		break;
@@ -235,12 +240,7 @@
 	long ret=1;
 
 	if (b->next_bio == NULL) return(0);
-	switch (cmd)
-		{
-	default:
-		ret=BIO_callback_ctrl(b->next_bio,cmd,fp);
-		break;
-		}
+	ret=BIO_callback_ctrl(b->next_bio,cmd,fp);
 	return(ret);
 	}
 
@@ -250,7 +250,7 @@
 	unsigned int ret;
 
 
-	ctx=bp->ptr;
+	ctx=(EVP_MD_CTX *)bp->ptr;
 	if (size < ctx->digest->md_size)
 		return(0);
 	if (EVP_DigestFinal_ex(ctx,(unsigned char *)buf,&ret)<=0) 
@@ -267,4 +267,3 @@
 	return(-1);
 	}
 */
-
diff -Naur openssl-1.0.0q.orig/crypto/evp/bio_ok.c openssl-1.0.0q/crypto/evp/bio_ok.c
--- openssl-1.0.0q.orig/crypto/evp/bio_ok.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/bio_ok.c	2017-04-25 16:23:40.333321410 +0200
@@ -117,10 +117,12 @@
 
 */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
 #include <assert.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include <openssl/bio.h>
 #include <openssl/evp.h>
@@ -228,7 +230,7 @@
 			{
 			i=ctx->buf_len-ctx->buf_off;
 			if (i > outl) i=outl;
-			memcpy(out,&(ctx->buf[ctx->buf_off]),i);
+			op_memcpy(out,&(ctx->buf[ctx->buf_off]),i);
 			ret+=i;
 			out+=i;
 			outl-=i;
@@ -243,7 +245,7 @@
 				if(ctx->buf_len_save- ctx->buf_off_save > 0)
 					{
 					ctx->buf_len= ctx->buf_len_save- ctx->buf_off_save;
-					memmove(ctx->buf, &(ctx->buf[ctx->buf_off_save]),
+					op_memmove(ctx->buf, &(ctx->buf[ctx->buf_off_save]),
 							ctx->buf_len);
 					}
 				else
@@ -325,7 +327,7 @@
 		n= (inl+ ctx->buf_len > OK_BLOCK_SIZE+ OK_BLOCK_BLOCK) ? 
 			(int)(OK_BLOCK_SIZE+OK_BLOCK_BLOCK-ctx->buf_len) : inl;
 
-		memcpy((unsigned char *)(&(ctx->buf[ctx->buf_len])),(unsigned char *)in,n);
+		op_memcpy((unsigned char *)(&(ctx->buf[ctx->buf_len])),(unsigned char *)in,n);
 		ctx->buf_len+= n;
 		inl-=n;
 		in+=n;
@@ -470,11 +472,11 @@
 	 * particularly now EVP_MD_CTX has been restructured.
 	 */
 	RAND_pseudo_bytes(md->md_data, md->digest->md_size);
-	memcpy(&(ctx->buf[ctx->buf_len]), md->md_data, md->digest->md_size);
+	op_memcpy(&(ctx->buf[ctx->buf_len]), md->md_data, md->digest->md_size);
 	longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size);
 	ctx->buf_len+= md->digest->md_size;
 
-	EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN));
+	EVP_DigestUpdate(md, WELLKNOWN, op_strlen(WELLKNOWN));
 	EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL);
 	ctx->buf_len+= md->digest->md_size;
 	ctx->blockout= 1;
@@ -494,20 +496,20 @@
 	if((int)(ctx->buf_len-ctx->buf_off) < 2*md->digest->md_size) return;
 
 	EVP_DigestInit_ex(md, md->digest, NULL);
-	memcpy(md->md_data, &(ctx->buf[ctx->buf_off]), md->digest->md_size);
+	op_memcpy(md->md_data, &(ctx->buf[ctx->buf_off]), md->digest->md_size);
 	longswap(md->md_data, md->digest->md_size);
 	ctx->buf_off+= md->digest->md_size;
 
-	EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN));
+	EVP_DigestUpdate(md, WELLKNOWN, op_strlen(WELLKNOWN));
 	EVP_DigestFinal_ex(md, tmp, NULL);
-	ret= memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0;
+	ret= op_memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0;
 	ctx->buf_off+= md->digest->md_size;
 	if(ret == 1)
 		{
 		ctx->sigio= 0;
 		if(ctx->buf_len != ctx->buf_off)
 			{
-			memmove(ctx->buf, &(ctx->buf[ctx->buf_off]), ctx->buf_len- ctx->buf_off);
+			op_memmove(ctx->buf, &(ctx->buf[ctx->buf_off]), ctx->buf_len- ctx->buf_off);
 			}
 		ctx->buf_len-= ctx->buf_off;
 		ctx->buf_off= 0;
@@ -558,7 +560,7 @@
  
 	EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl);
 	EVP_DigestFinal_ex(md, tmp, NULL);
-	if(memcmp(&(ctx->buf[tl+ OK_BLOCK_BLOCK]), tmp, md->digest->md_size) == 0)
+	if(op_memcmp(&(ctx->buf[tl+ OK_BLOCK_BLOCK]), tmp, md->digest->md_size) == 0)
 		{
 		/* there might be parts from next block lurking around ! */
 		ctx->buf_off_save= tl+ OK_BLOCK_BLOCK+ md->digest->md_size;
diff -Naur openssl-1.0.0q.orig/crypto/evp/c_all.c openssl-1.0.0q/crypto/evp/c_all.c
--- openssl-1.0.0q.orig/crypto/evp/c_all.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/c_all.c	2017-04-25 16:23:40.334322655 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #ifndef OPENSSL_NO_ENGINE
diff -Naur openssl-1.0.0q.orig/crypto/evp/c_allc.c openssl-1.0.0q/crypto/evp/c_allc.c
--- openssl-1.0.0q.orig/crypto/evp/c_allc.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/c_allc.c	2017-04-25 16:23:40.335321665 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/pkcs12.h>
 #include <openssl/objects.h>
@@ -66,6 +68,8 @@
 	{
 
 #ifndef OPENSSL_NO_DES
+
+#ifndef OPERA_SMALL_VERSION
 	EVP_add_cipher(EVP_des_cfb());
 	EVP_add_cipher(EVP_des_cfb1());
 	EVP_add_cipher(EVP_des_cfb8());
@@ -86,18 +90,25 @@
 	EVP_add_cipher_alias(SN_des_cbc,"DES");
 	EVP_add_cipher_alias(SN_des_cbc,"des");
 	EVP_add_cipher(EVP_des_ede_cbc());
+#endif /* !OPERA_SMALL_VERSION */
+
 	EVP_add_cipher(EVP_des_ede3_cbc());
 	EVP_add_cipher_alias(SN_des_ede3_cbc,"DES3");
 	EVP_add_cipher_alias(SN_des_ede3_cbc,"des3");
 
+#ifndef OPERA_SMALL_VERSION
 	EVP_add_cipher(EVP_des_ecb());
 	EVP_add_cipher(EVP_des_ede());
 	EVP_add_cipher(EVP_des_ede3());
+#endif /* !OPERA_SMALL_VERSION */
+
 #endif
 
 #ifndef OPENSSL_NO_RC4
 	EVP_add_cipher(EVP_rc4());
+#ifndef OPERA_SMALL_VERSION
 	EVP_add_cipher(EVP_rc4_40());
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #ifndef OPENSSL_NO_IDEA
@@ -119,14 +130,24 @@
 #endif
 
 #ifndef OPENSSL_NO_RC2
+#ifdef RC2_CBC_ONLY
+	EVP_add_cipher(EVP_rc2_cbc());
+	EVP_add_cipher_alias(SN_rc2_cbc,"RC2");
+	EVP_add_cipher_alias(SN_rc2_cbc,"rc2");
+#else
+#ifndef OPERA_SMALL_VERSION
 	EVP_add_cipher(EVP_rc2_ecb());
 	EVP_add_cipher(EVP_rc2_cfb());
 	EVP_add_cipher(EVP_rc2_ofb());
+#endif /* !OPERA_SMALL_VERSION */
 	EVP_add_cipher(EVP_rc2_cbc());
 	EVP_add_cipher(EVP_rc2_40_cbc());
+#ifndef OPERA_SMALL_VERSION
 	EVP_add_cipher(EVP_rc2_64_cbc());
+#endif /* !OPERA_SMALL_VERSION */
 	EVP_add_cipher_alias(SN_rc2_cbc,"RC2");
 	EVP_add_cipher_alias(SN_rc2_cbc,"rc2");
+#endif // RC2_CBC_ONLY
 #endif
 
 #ifndef OPENSSL_NO_BF
@@ -160,6 +181,14 @@
 #endif
 
 #ifndef OPENSSL_NO_AES
+#ifdef OPERA_SMALL_VERSION
+	EVP_add_cipher(EVP_aes_128_cbc());
+	EVP_add_cipher_alias(SN_aes_128_cbc,"AES128");
+	EVP_add_cipher_alias(SN_aes_128_cbc,"aes128");
+	EVP_add_cipher(EVP_aes_256_cbc());
+	EVP_add_cipher_alias(SN_aes_256_cbc,"AES256");
+	EVP_add_cipher_alias(SN_aes_256_cbc,"aes256");
+#else
 	EVP_add_cipher(EVP_aes_128_ecb());
 	EVP_add_cipher(EVP_aes_128_cbc());
 	EVP_add_cipher(EVP_aes_128_cfb());
@@ -193,6 +222,7 @@
 #endif
 	EVP_add_cipher_alias(SN_aes_256_cbc,"AES256");
 	EVP_add_cipher_alias(SN_aes_256_cbc,"aes256");
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #ifndef OPENSSL_NO_CAMELLIA
diff -Naur openssl-1.0.0q.orig/crypto/evp/c_alld.c openssl-1.0.0q/crypto/evp/c_alld.c
--- openssl-1.0.0q.orig/crypto/evp/c_alld.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/c_alld.c	2017-04-25 16:23:40.335321665 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/pkcs12.h>
 #include <openssl/objects.h>
@@ -67,11 +69,19 @@
 #ifndef OPENSSL_NO_MD4
 	EVP_add_digest(EVP_md4());
 #endif
+#if !defined LIBOPEAY_DISABLE_MD5_PARTIAL
+	if(!g_turn_off_md5)
+	{
 #ifndef OPENSSL_NO_MD5
 	EVP_add_digest(EVP_md5());
 	EVP_add_digest_alias(SN_md5,"ssl2-md5");
 	EVP_add_digest_alias(SN_md5,"ssl3-md5");
 #endif
+	}
+#endif /* LIBOPEAY_DISABLE_MD5_PARTIAL */
+#if !defined OPENSSL_NO_SHA && !defined LIBOPEAY_DISABLE_SHA1_PARTIAL
+	if(!g_turn_off_sha1)
+	{
 #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA0)
 	EVP_add_digest(EVP_sha());
 #ifndef OPENSSL_NO_DSA
@@ -92,6 +102,8 @@
 	EVP_add_digest(EVP_ecdsa());
 #endif
 #endif
+	}
+#endif
 #if !defined(OPENSSL_NO_MDC2) && !defined(OPENSSL_NO_DES)
 	EVP_add_digest(EVP_mdc2());
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/evp/digest.c openssl-1.0.0q/crypto/evp/digest.c
--- openssl-1.0.0q.orig/crypto/evp/digest.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/digest.c	2017-04-25 16:23:40.336321792 +0200
@@ -109,8 +109,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #ifndef OPENSSL_NO_ENGINE
@@ -119,12 +122,15 @@
 
 void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
 	{
-	memset(ctx,'\0',sizeof *ctx);
+	op_memset(ctx,'\0',sizeof *ctx);
 	}
 
 EVP_MD_CTX *EVP_MD_CTX_create(void)
 	{
-	EVP_MD_CTX *ctx=OPENSSL_malloc(sizeof *ctx);
+	EVP_MD_CTX *ctx=(EVP_MD_CTX *)OPENSSL_malloc(sizeof *ctx);
+
+	if (!ctx)
+		return NULL;
 
 	if (ctx)
 		EVP_MD_CTX_init(ctx);
@@ -164,9 +170,11 @@
 				return 0;
 				}
 			}
+#ifndef OPERA_SMALL_VERSION
 		else
 			/* Ask if an ENGINE is reserved for this job */
 			impl = ENGINE_get_digest_engine(type->type);
+#endif
 		if(impl)
 			{
 			/* There's an ENGINE for this job ... (apparently) */
@@ -225,11 +233,18 @@
 		}
 	if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT)
 		return 1;
+
+	if (!ctx->md_data)		// can happen because of OOM earlier
+		return 0;
+
 	return ctx->digest->init(ctx);
 	}
 
 int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
 	{
+	if (!ctx->md_data)		// can happen because of OOM earlier
+		return 0;
+
 	return ctx->update(ctx,data,count);
 	}
 
@@ -248,6 +263,9 @@
 	int ret;
 
 	OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE);
+	if (!ctx->md_data)		// can happen because of OOM earlier
+		return 0;
+
 	ret=ctx->digest->final(ctx,md);
 	if (size != NULL)
 		*size=ctx->digest->md_size;
@@ -256,7 +274,7 @@
 		ctx->digest->cleanup(ctx);
 		EVP_MD_CTX_set_flags(ctx,EVP_MD_CTX_FLAG_CLEANED);
 		}
-	memset(ctx->md_data,0,ctx->digest->ctx_size);
+	op_memset(ctx->md_data,0,ctx->digest->ctx_size);
 	return ret;
 	}
 
@@ -285,12 +303,12 @@
 
 	if (out->digest == in->digest)
 		{
-		tmp_buf = out->md_data;
+		tmp_buf = (unsigned char *) out->md_data;
 	    	EVP_MD_CTX_set_flags(out,EVP_MD_CTX_FLAG_REUSE);
 		}
 	else tmp_buf = NULL;
 	EVP_MD_CTX_cleanup(out);
-	memcpy(out,in,sizeof *out);
+	op_memcpy(out,in,sizeof *out);
 
 	if (in->md_data && out->digest->ctx_size)
 		{
@@ -305,7 +323,7 @@
 				return 0;
 				}
 			}
-		memcpy(out->md_data,in->md_data,out->digest->ctx_size);
+		op_memcpy(out->md_data,in->md_data,out->digest->ctx_size);
 		}
 
 	out->update = in->update;
@@ -374,7 +392,7 @@
 		 * functional reference we held for this reason. */
 		ENGINE_finish(ctx->engine);
 #endif
-	memset(ctx,'\0',sizeof *ctx);
+	op_memset(ctx,'\0',sizeof *ctx);
 
 	return 1;
 	}
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_aes.c openssl-1.0.0q/crypto/evp/e_aes.c
--- openssl-1.0.0q.orig/crypto/evp/e_aes.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_aes.c	2017-04-25 16:23:40.337321919 +0200
@@ -52,10 +52,13 @@
 #ifndef OPENSSL_NO_AES
 #include <openssl/evp.h>
 #include <openssl/err.h>
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
 #include <assert.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/aes.h>
 #include "evp_locl.h"
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 					const unsigned char *iv, int enc);
@@ -73,12 +76,16 @@
 		       EVP_CIPHER_set_asn1_iv,
 		       EVP_CIPHER_get_asn1_iv,
 		       NULL)
+
+#if !defined _SSL_USE_OPENSSL_ || defined OPENSSL_USE_CFB_CIPHERS
 IMPLEMENT_BLOCK_CIPHER(aes_192, ks, AES, EVP_AES_KEY,
 		       NID_aes_192, 16, 24, 16, 128,
 		       0, aes_init_key, NULL, 
 		       EVP_CIPHER_set_asn1_iv,
 		       EVP_CIPHER_get_asn1_iv,
 		       NULL)
+#endif
+
 IMPLEMENT_BLOCK_CIPHER(aes_256, ks, AES, EVP_AES_KEY,
 		       NID_aes_256, 16, 32, 16, 128,
 		       0, aes_init_key, NULL, 
@@ -86,6 +93,7 @@
 		       EVP_CIPHER_get_asn1_iv,
 		       NULL)
 
+#if (!defined _SSL_USE_OPENSSL_ && !defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION) || defined OPENSSL_USE_CFB_CIPHERS
 #define IMPLEMENT_AES_CFBR(ksize,cbits)	IMPLEMENT_CFBR(aes,AES,EVP_AES_KEY,ks,ksize,cbits,16)
 
 IMPLEMENT_AES_CFBR(128,1)
@@ -95,6 +103,7 @@
 IMPLEMENT_AES_CFBR(128,8)
 IMPLEMENT_AES_CFBR(192,8)
 IMPLEMENT_AES_CFBR(256,8)
+#endif
 
 static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 		   const unsigned char *iv, int enc)
@@ -104,9 +113,9 @@
 	if ((ctx->cipher->flags & EVP_CIPH_MODE) == EVP_CIPH_CFB_MODE
 	    || (ctx->cipher->flags & EVP_CIPH_MODE) == EVP_CIPH_OFB_MODE
 	    || enc) 
-		ret=AES_set_encrypt_key(key, ctx->key_len * 8, ctx->cipher_data);
+		ret=AES_set_encrypt_key(key, ctx->key_len * 8, (AES_KEY *) ctx->cipher_data);
 	else
-		ret=AES_set_decrypt_key(key, ctx->key_len * 8, ctx->cipher_data);
+		ret=AES_set_decrypt_key(key, ctx->key_len * 8, (AES_KEY *) ctx->cipher_data);
 
 	if(ret < 0)
 		{
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_bf.c openssl-1.0.0q/crypto/evp/e_bf.c
--- openssl-1.0.0q.orig/crypto/evp/e_bf.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_bf.c	2017-04-25 16:23:40.338322046 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #ifndef OPENSSL_NO_BF
 #include <openssl/evp.h>
 #include "evp_locl.h"
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_cast.c openssl-1.0.0q/crypto/evp/e_cast.c
--- openssl-1.0.0q.orig/crypto/evp/e_cast.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_cast.c	2017-04-25 16:23:40.339322453 +0200
@@ -56,10 +56,13 @@
  * [including the GNU Public Licence.]
  */
 
-#include <stdio.h>
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_CAST
+
+#ifndef OPERA_SMALL_VERSION
+#include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include "evp_locl.h"
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_des.c openssl-1.0.0q/crypto/evp/e_des.c
--- openssl-1.0.0q.orig/crypto/evp/e_des.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_des.c	2017-04-25 16:23:40.340322021 +0200
@@ -56,9 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #ifndef OPENSSL_NO_DES
+#ifndef NO_SINGLE_DES
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include "evp_locl.h"
@@ -71,6 +74,7 @@
 
 /* Because of various casts and different names can't use IMPLEMENT_BLOCK_CIPHER */
 
+#ifndef OPERA_SMALL_VERSION
 static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 			  const unsigned char *in, size_t inl)
 {
@@ -78,7 +82,9 @@
 		DES_ecb_encrypt((DES_cblock *)(in + i), (DES_cblock *)(out + i), ctx->cipher_data, ctx->encrypt);
 	return 1;
 }
+#endif
 
+#ifndef DES_PART_ONLY
 static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 			  const unsigned char *in, size_t inl)
 {
@@ -95,37 +101,39 @@
 				(DES_cblock *)ctx->iv, &ctx->num);
 	return 1;
 }
+#endif
 
 static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 			  const unsigned char *in, size_t inl)
 {
 	while(inl>=EVP_MAXCHUNK)
 		{
-		DES_ncbc_encrypt(in, out, (long)EVP_MAXCHUNK, ctx->cipher_data,
+		DES_ncbc_encrypt(in, out, (long)EVP_MAXCHUNK, (DES_key_schedule *)ctx->cipher_data,
 				(DES_cblock *)ctx->iv, ctx->encrypt);
 		inl-=EVP_MAXCHUNK;
 		in +=EVP_MAXCHUNK;
 		out+=EVP_MAXCHUNK;
 		}
 	if (inl)
-		DES_ncbc_encrypt(in, out, (long)inl, ctx->cipher_data,
+		DES_ncbc_encrypt(in, out, (long)inl, (DES_key_schedule *)ctx->cipher_data,
 				(DES_cblock *)ctx->iv, ctx->encrypt);
 	return 1;
 }
 
+#if !defined _SSL_USE_OPENSSL_ || defined OPENSSL_USE_CFB_CIPHERS
 static int des_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 			    const unsigned char *in, size_t inl)
 {
 	while(inl>=EVP_MAXCHUNK)
 		{
-		DES_cfb64_encrypt(in,out, (long)EVP_MAXCHUNK, ctx->cipher_data,
+		DES_cfb64_encrypt(in,out, (long)EVP_MAXCHUNK, (DES_key_schedule *)ctx->cipher_data,
 				(DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
 		inl-=EVP_MAXCHUNK;
 		in +=EVP_MAXCHUNK;
 		out+=EVP_MAXCHUNK;
 		}
 	if (inl)
-		DES_cfb64_encrypt(in, out, (long)inl, ctx->cipher_data,
+		DES_cfb64_encrypt(in, out, (long)inl, (DES_key_schedule *)ctx->cipher_data,
 			  (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
 	return 1;
 }
@@ -145,7 +153,7 @@
 	for(n=0 ; n < chunk*8; ++n)
 	    {
 	    c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0;
-	    DES_cfb_encrypt(c,d,1,1,ctx->cipher_data,(DES_cblock *)ctx->iv,
+	    DES_cfb_encrypt(c,d,1,1,(DES_key_schedule *)ctx->cipher_data,(DES_cblock *)ctx->iv,
 			ctx->encrypt);
 	    out[n/8]=(out[n/8]&~(0x80 >> (unsigned int)(n%8))) |
 		     ((d[0]&0x80) >> (unsigned int)(n%8));
@@ -171,10 +179,11 @@
 	out+=EVP_MAXCHUNK;
 	}
     if (inl)
-	DES_cfb_encrypt(in,out,8,(long)inl,ctx->cipher_data,
+	DES_cfb_encrypt(in,out,8,(long)inl,(DES_key_schedule *)ctx->cipher_data,
 			(DES_cblock *)ctx->iv,ctx->encrypt);
     return 1;
     }
+#endif
 
 BLOCK_CIPHER_defs(des, DES_key_schedule, NID_des, 8, 8, 8, 64,
 			EVP_CIPH_RAND_KEY, des_init_key, NULL,
@@ -182,6 +191,7 @@
 			EVP_CIPHER_get_asn1_iv,
 			des_ctrl)
 
+#if !defined _SSL_USE_OPENSSL_ || defined OPENSSL_USE_CFB_CIPHERS
 BLOCK_CIPHER_def_cfb(des,DES_key_schedule,NID_des,8,8,1,
 		     EVP_CIPH_RAND_KEY, des_init_key,NULL,
 		     EVP_CIPHER_set_asn1_iv,
@@ -191,6 +201,7 @@
 		     EVP_CIPH_RAND_KEY,des_init_key,NULL,
 		     EVP_CIPHER_set_asn1_iv,
 		     EVP_CIPHER_get_asn1_iv,des_ctrl)
+#endif
 
 static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 			const unsigned char *iv, int enc)
@@ -200,7 +211,7 @@
 	if(DES_set_key_checked(deskey,ctx->cipher_data) != 0)
 		return 0;
 #else
-	DES_set_key_unchecked(deskey,ctx->cipher_data);
+	DES_set_key_unchecked(deskey, (DES_key_schedule *) ctx->cipher_data);
 #endif
 	return 1;
 	}
@@ -211,7 +222,7 @@
 	switch(type)
 		{
 	case EVP_CTRL_RAND_KEY:
-		if (RAND_bytes(ptr, 8) <= 0)
+		if (RAND_bytes((unsigned char *) ptr, 8) <= 0)
 			return 0;
 		DES_set_odd_parity((DES_cblock *)ptr);
 		return 1;
@@ -222,3 +233,4 @@
 	}
 
 #endif
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_des3.c openssl-1.0.0q/crypto/evp/e_des3.c
--- openssl-1.0.0q.orig/crypto/evp/e_des3.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_des3.c	2017-04-25 16:23:40.341321869 +0200
@@ -56,22 +56,29 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #ifndef OPENSSL_NO_DES
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include "evp_locl.h"
 #include <openssl/des.h>
 #include <openssl/rand.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
+#if !defined OPERA_SMALL_VERSION ||defined SSL_USE_WEAK_CIPHERS
 static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 			    const unsigned char *iv,int enc);
+#endif
 
 static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 			     const unsigned char *iv,int enc);
 
+#if !defined OPERA_SMALL_VERSION ||defined SSL_USE_WEAK_CIPHERS
 static int des3_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
+#endif
 
 typedef struct
     {
@@ -84,6 +91,7 @@
 
 /* Because of various casts and different args can't use IMPLEMENT_BLOCK_CIPHER */
 
+#ifndef OPERA_SMALL_VERSION
 static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 			      const unsigned char *in, size_t inl)
 {
@@ -95,7 +103,9 @@
 				 ctx->encrypt);
 	return 1;
 }
+#endif
 
+#ifndef DES_PART_ONLY
 static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 			      const unsigned char *in, size_t inl)
 {
@@ -115,6 +125,7 @@
 
 	return 1;
 }
+#endif
 
 static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 			      const unsigned char *in, size_t inl)
@@ -146,6 +157,8 @@
 	return 1;
 }
 
+#ifdef DES_PART_ONLY
+#if (!defined _SSL_USE_OPENSSL_ && !defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION )|| defined OPENSSL_USE_CFB_CIPHERS
 static int des_ede_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 			      const unsigned char *in, size_t inl)
 {
@@ -204,12 +217,16 @@
 			(DES_cblock *)ctx->iv,ctx->encrypt);
     return 1;
     }
+#endif
+#endif
 
+#if !defined OPERA_SMALL_VERSION ||defined SSL_USE_WEAK_CIPHERS
 BLOCK_CIPHER_defs(des_ede, DES_EDE_KEY, NID_des_ede, 8, 16, 8, 64,
 			EVP_CIPH_RAND_KEY, des_ede_init_key, NULL, 
 			EVP_CIPHER_set_asn1_iv,
 			EVP_CIPHER_get_asn1_iv,
 			des3_ctrl)
+#endif
 
 #define des_ede3_cfb64_cipher des_ede_cfb64_cipher
 #define des_ede3_ofb_cipher des_ede_ofb_cipher
@@ -222,6 +239,7 @@
 			EVP_CIPHER_get_asn1_iv,
 			des3_ctrl)
 
+#if (!defined _SSL_USE_OPENSSL_ && !defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION ) || defined OPENSSL_USE_CFB_CIPHERS
 BLOCK_CIPHER_def_cfb(des_ede3,DES_EDE_KEY,NID_des_ede3,24,8,1,
 		     EVP_CIPH_RAND_KEY, des_ede3_init_key,NULL,
 		     EVP_CIPHER_set_asn1_iv,
@@ -233,7 +251,9 @@
 		     EVP_CIPHER_set_asn1_iv,
 		     EVP_CIPHER_get_asn1_iv,
 		     des3_ctrl)
+#endif
 
+#if !defined OPERA_SMALL_VERSION ||defined SSL_USE_WEAK_CIPHERS
 static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 			    const unsigned char *iv, int enc)
 	{
@@ -246,10 +266,11 @@
 	DES_set_key_unchecked(&deskey[0],&data(ctx)->ks1);
 	DES_set_key_unchecked(&deskey[1],&data(ctx)->ks2);
 #endif
-	memcpy(&data(ctx)->ks3,&data(ctx)->ks1,
+	op_memcpy(&data(ctx)->ks3,&data(ctx)->ks1,
 	       sizeof(data(ctx)->ks1));
 	return 1;
 	}
+#endif
 
 static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 			     const unsigned char *iv, int enc)
@@ -279,15 +300,16 @@
 	return 1;
 	}
 
+#if !defined OPERA_SMALL_VERSION ||defined SSL_USE_WEAK_CIPHERS
 static int des3_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
 	{
 
-	DES_cblock *deskey = ptr;
+	DES_cblock *deskey = (DES_cblock *) ptr;
 
 	switch(type)
 		{
 	case EVP_CTRL_RAND_KEY:
-		if (RAND_bytes(ptr, c->key_len) <= 0)
+		if (RAND_bytes((unsigned char *) ptr, c->key_len) <= 0)
 			return 0;
 		DES_set_odd_parity(deskey);
 		if (c->key_len >= 16)
@@ -300,7 +322,9 @@
 		return -1;
 		}
 	}
+#endif
 
+#ifndef DES_PART_ONLY
 const EVP_CIPHER *EVP_des_ede(void)
 {
 	return &des_ede_ecb;
@@ -311,3 +335,5 @@
 	return &des_ede3_ecb;
 }
 #endif
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_dsa.c openssl-1.0.0q/crypto/evp/e_dsa.c
--- openssl-1.0.0q.orig/crypto/evp/e_dsa.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_dsa.c	2017-04-25 16:23:40.342321437 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_idea.c openssl-1.0.0q/crypto/evp/e_idea.c
--- openssl-1.0.0q.orig/crypto/evp/e_idea.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_idea.c	2017-04-25 16:23:40.343322402 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_IDEA
 #include <openssl/evp.h>
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_null.c openssl-1.0.0q/crypto/evp/e_null.c
--- openssl-1.0.0q.orig/crypto/evp/e_null.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_null.c	2017-04-25 16:23:40.344321691 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/objects.h>
@@ -88,7 +90,7 @@
 static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 	     const unsigned char *iv, int enc)
 	{
-	/*	memset(&(ctx->c),0,sizeof(ctx->c));*/
+	/*	op_memset(&(ctx->c),0,sizeof(ctx->c));*/
 	return 1;
 	}
 
@@ -96,7 +98,7 @@
 	     const unsigned char *in, size_t inl)
 	{
 	if (in != out)
-		memcpy((char *)out,(const char *)in,inl);
+		op_memcpy((char *)out,(const char *)in,inl);
 	return 1;
 	}
 
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_rc2.c openssl-1.0.0q/crypto/evp/e_rc2.c
--- openssl-1.0.0q.orig/crypto/evp/e_rc2.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_rc2.c	2017-04-25 16:23:40.345321260 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_RC2
 
@@ -65,13 +67,16 @@
 #include <openssl/objects.h>
 #include "evp_locl.h"
 #include <openssl/rc2.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 			const unsigned char *iv,int enc);
+#ifndef OPERA_SMALL_VERSION
 static int rc2_meth_to_magic(EVP_CIPHER_CTX *ctx);
 static int rc2_magic_to_meth(int i);
 static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
 static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+#endif
 static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
 
 typedef struct
@@ -94,6 +99,7 @@
 #define RC2_64_MAGIC	0x78
 #define RC2_128_MAGIC	0x3a
 
+#ifndef OPERA_SMALL_VERSION
 static const EVP_CIPHER r2_64_cbc_cipher=
 	{
 	NID_rc2_64_cbc,
@@ -108,30 +114,32 @@
 	rc2_ctrl,
 	NULL
 	};
+#endif
 
-static const EVP_CIPHER r2_40_cbc_cipher=
-	{
+CONST_EVP_CIPHER_ITEM(r2_40_cbc_cipher,
 	NID_rc2_40_cbc,
 	8,5 /* 40 bit */,8,
 	EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
 	rc2_init_key,
 	rc2_cbc_cipher,
 	NULL,
-	sizeof(EVP_RC2_KEY),
-	rc2_set_asn1_type_and_iv,
-	rc2_get_asn1_type_and_iv,
+	EVP_RC2_KEY,
+	OPERA_SET_GET_ASN1_PARAM_FN(rc2_set_asn1_type_and_iv),
+	OPERA_SET_GET_ASN1_PARAM_FN(rc2_get_asn1_type_and_iv),
 	rc2_ctrl,
 	NULL
-	};
+	);
 
+#ifndef OPERA_SMALL_VERSION
 const EVP_CIPHER *EVP_rc2_64_cbc(void)
 	{
 	return(&r2_64_cbc_cipher);
 	}
+#endif
 
 const EVP_CIPHER *EVP_rc2_40_cbc(void)
 	{
-	return(&r2_40_cbc_cipher);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(r2_40_cbc_cipher));
 	}
 	
 static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
@@ -142,6 +150,7 @@
 	return 1;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 static int rc2_meth_to_magic(EVP_CIPHER_CTX *e)
 	{
 	int i;
@@ -171,7 +180,7 @@
 	int i=0;
 	int key_bits;
 	unsigned int l;
-	unsigned char iv[EVP_MAX_IV_LENGTH];
+	unsigned char iv[EVP_MAX_IV_LENGTH]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 
 	if (type != NULL)
 		{
@@ -203,6 +212,7 @@
 		}
 	return(i);
 	}
+#endif
 
 static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_rc4.c openssl-1.0.0q/crypto/evp/e_rc4.c
--- openssl-1.0.0q.orig/crypto/evp/e_rc4.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_rc4.c	2017-04-25 16:23:40.346321666 +0200
@@ -56,14 +56,18 @@
  * [including the GNU Public Licence.]
  */
 
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_RC4
 
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/rc4.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* FIXME: surely this is available elsewhere? */
 #define EVP_RC4_KEY_SIZE		16
@@ -79,45 +83,70 @@
 			const unsigned char *iv,int enc);
 static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 		      const unsigned char *in, size_t inl);
-static const EVP_CIPHER r4_cipher=
-	{
+CONST_EVP_CIPHER_ITEM(r4_cipher,
 	NID_rc4,
 	1,EVP_RC4_KEY_SIZE,0,
 	EVP_CIPH_VARIABLE_LENGTH,
 	rc4_init_key,
 	rc4_cipher,
 	NULL,
-	sizeof(EVP_RC4_KEY),
+	EVP_RC4_KEY,
 	NULL,
 	NULL,
 	NULL,
 	NULL
-	};
+	);
 
-static const EVP_CIPHER r4_40_cipher=
-	{
+#ifdef LIBOPEAY_USE_RC4_256
+CONST_EVP_CIPHER_ITEM(r4_256_cipher,
+	NID_rc4,
+	1,32 /*256 bits*/ ,0,
+	EVP_CIPH_VARIABLE_LENGTH,
+	rc4_init_key,
+	rc4_cipher,
+	NULL,
+	EVP_RC4_KEY,
+	NULL,
+	NULL,
+	NULL,
+	NULL
+	);
+#endif
+
+#if !defined OPERA_SMALL_VERSION ||defined SSL_USE_WEAK_CIPHERS
+CONST_EVP_CIPHER_ITEM(r4_40_cipher,
 	NID_rc4_40,
 	1,5 /* 40 bit */,0,
 	EVP_CIPH_VARIABLE_LENGTH,
 	rc4_init_key,
 	rc4_cipher,
 	NULL,
-	sizeof(EVP_RC4_KEY),
+	EVP_RC4_KEY,
 	NULL, 
 	NULL,
 	NULL,
 	NULL
-	};
+	);
+#endif
 
 const EVP_CIPHER *EVP_rc4(void)
 	{
-	return(&r4_cipher);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(r4_cipher));
 	}
 
+#ifdef LIBOPEAY_USE_RC4_256
+const EVP_CIPHER *EVP_rc4_256(void)
+	{
+	return(&OPENSSL_GLOBAL_ITEM_NAME(r4_256_cipher));
+	}
+#endif
+
+#if !defined OPERA_SMALL_VERSION ||defined SSL_USE_WEAK_CIPHERS
 const EVP_CIPHER *EVP_rc4_40(void)
 	{
-	return(&r4_40_cipher);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(r4_40_cipher));
 	}
+#endif
 
 static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 			const unsigned char *iv, int enc)
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_rc5.c openssl-1.0.0q/crypto/evp/e_rc5.c
--- openssl-1.0.0q.orig/crypto/evp/e_rc5.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_rc5.c	2017-04-25 16:23:40.346321666 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_RC5
 
diff -Naur openssl-1.0.0q.orig/crypto/evp/e_xcbc_d.c openssl-1.0.0q/crypto/evp/e_xcbc_d.c
--- openssl-1.0.0q.orig/crypto/evp/e_xcbc_d.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/e_xcbc_d.c	2017-04-25 16:23:40.348322479 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_DES
 
@@ -107,8 +109,8 @@
 	DES_cblock *deskey = (DES_cblock *)key;
 
 	DES_set_key_unchecked(deskey,&data(ctx)->ks);
-	memcpy(&data(ctx)->inw[0],&key[8],8);
-	memcpy(&data(ctx)->outw[0],&key[16],8);
+	op_memcpy(&data(ctx)->inw[0],&key[8],8);
+	op_memcpy(&data(ctx)->outw[0],&key[16],8);
 
 	return 1;
 	}
diff -Naur openssl-1.0.0q.orig/crypto/evp/encode.c openssl-1.0.0q/crypto/evp/encode.c
--- openssl-1.0.0q.orig/crypto/evp/encode.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/encode.c	2017-04-25 16:23:40.349322327 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 
 #ifndef CHARSET_EBCDIC
@@ -139,14 +141,14 @@
 	OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data));
 	if ((ctx->num+inl) < ctx->length)
 		{
-		memcpy(&(ctx->enc_data[ctx->num]),in,inl);
+		op_memcpy(&(ctx->enc_data[ctx->num]),in,inl);
 		ctx->num+=inl;
 		return;
 		}
 	if (ctx->num != 0)
 		{
 		i=ctx->length-ctx->num;
-		memcpy(&(ctx->enc_data[ctx->num]),in,i);
+		op_memcpy(&(ctx->enc_data[ctx->num]),in,i);
 		in+=i;
 		inl-=i;
 		j=EVP_EncodeBlock(out,ctx->enc_data,ctx->length);
@@ -167,7 +169,7 @@
 		total+=j+1;
 		}
 	if (inl != 0)
-		memcpy(&(ctx->enc_data[0]),in,inl);
+		op_memcpy(&(ctx->enc_data[0]),in,inl);
 	ctx->num=inl;
 	*outl=total;
 	}
diff -Naur openssl-1.0.0q.orig/crypto/evp/evp.h openssl-1.0.0q/crypto/evp/evp.h
--- openssl-1.0.0q.orig/crypto/evp/evp.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/evp.h	2017-04-25 16:23:40.351322581 +0200
@@ -181,6 +181,45 @@
 	int (*md_ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
 	} /* EVP_MD */;
 
+#if !defined(OPERA_SMALL_VERSION)
+#define CONST_EVP_MD_ITEM_REQUIRED_TYPE_IMPL(_sign, _verify, u,v,x,y,z) _sign, _verify, {u,v,x,y,z},
+#else
+#define CONST_EVP_MD_ITEM_REQUIRED_TYPE_IMPL(_sign, _verify, u,v,x,y,z) CONST_EVP_MD_ITEM_REQUIRED_TYPE( _sign, _verify, u,v,x,y,z)
+#if defined(HAS_COMPLEX_GLOBALS)
+#define CONST_EVP_MD_ITEM_REQUIRED_TYPE(_sign, _verify, u,v,x,y,z)  , _sign, _verify, {u,v,x,y,z}
+#else
+#define CONST_EVP_MD_ITEM_REQUIRED_TYPE(_sign, _verify,u,v,x,y,z) \
+	CONST_ITEM_ENTRY_SINGLE(sign,_sign)\
+	CONST_ITEM_ENTRY_SINGLE(verify,_verify)\
+	CONST_ITEM_ENTRY_SINGLE(required_pkey_type[0], u)\
+	CONST_ITEM_ENTRY_SINGLE(required_pkey_type[1], v)\
+	CONST_ITEM_ENTRY_SINGLE(required_pkey_type[2], x)\
+	CONST_ITEM_ENTRY_SINGLE(required_pkey_type[3], y)\
+	CONST_ITEM_ENTRY_SINGLE(required_pkey_type[4], z)
+#endif
+#endif
+
+#define CONST_EVP_MD_ITEM(cname, _type, _pkey_type, _md_size, _flags, \
+			_init, _update, _final, _copy, _cleanup,\
+			required, _block_size, _ctx_size) \
+	OPENSSL_PREFIX_CONST_ITEM(static, EVP_MD, cname, libopeay)\
+	CONST_ITEM_ENTRY_START(type,_type) \
+	CONST_ITEM_ENTRY_SINGLE(pkey_type,_pkey_type)\
+	CONST_ITEM_ENTRY_SINGLE(md_size,_md_size)\
+	CONST_ITEM_ENTRY_SINGLE(flags, _flags)\
+	CONST_ITEM_ENTRY_SINGLE(init, _init)\
+	CONST_ITEM_ENTRY_SINGLE(update,_update)\
+	CONST_ITEM_ENTRY_SINGLE(final,_final)\
+	CONST_ITEM_ENTRY_SINGLE(copy,_copy)\
+	CONST_ITEM_ENTRY_SINGLE(cleanup, _cleanup)\
+	required\
+	CONST_ITEM_ENTRY_SINGLE(block_size,_block_size)\
+	CONST_ITEM_ENTRY_SINGLE(ctx_size, _ctx_size)\
+	CONST_ITEM_ENTRY_SINGLE(md_ctrl, NULL)\
+	CONST_ITEM_ENTRY_END
+
+#define DECLARE_EVP_MD_ITEM(cname) DECLARE_MODULE_CONST_ITEM(EVP_MD, cname)
+
 typedef int evp_sign_method(int type,const unsigned char *m,
 			    unsigned int m_length,unsigned char *sigret,
 			    unsigned int *siglen, void *key);
@@ -225,33 +264,33 @@
 
 #define	EVP_MD_CTRL_ALG_CTRL			0x1000
 
-#define EVP_PKEY_NULL_method	NULL,NULL,{0,0,0,0}
+#define EVP_PKEY_NULL_method	CONST_EVP_MD_ITEM_REQUIRED_TYPE_IMPL(NULL,NULL, 0,0,0,0,0)
 
 #ifndef OPENSSL_NO_DSA
-#define EVP_PKEY_DSA_method	(evp_sign_method *)DSA_sign, \
+#define EVP_PKEY_DSA_method	CONST_EVP_MD_ITEM_REQUIRED_TYPE_IMPL((evp_sign_method *)DSA_sign, \
 				(evp_verify_method *)DSA_verify, \
-				{EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \
-					EVP_PKEY_DSA4,0}
+				EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \
+					EVP_PKEY_DSA4,0)
 #else
 #define EVP_PKEY_DSA_method	EVP_PKEY_NULL_method
 #endif
 
 #ifndef OPENSSL_NO_ECDSA
-#define EVP_PKEY_ECDSA_method   (evp_sign_method *)ECDSA_sign, \
+#define EVP_PKEY_ECDSA_method  CONST_EVP_MD_ITEM_REQUIRED_TYPE_IMPL( (evp_sign_method *)ECDSA_sign, \
 				(evp_verify_method *)ECDSA_verify, \
-                                 {EVP_PKEY_EC,0,0,0}
+                                 EVP_PKEY_EC,0,0,0,0)
 #else   
 #define EVP_PKEY_ECDSA_method   EVP_PKEY_NULL_method
 #endif
 
 #ifndef OPENSSL_NO_RSA
-#define EVP_PKEY_RSA_method	(evp_sign_method *)RSA_sign, \
+#define EVP_PKEY_RSA_method	CONST_EVP_MD_ITEM_REQUIRED_TYPE_IMPL((evp_sign_method *)RSA_sign, \
 				(evp_verify_method *)RSA_verify, \
-				{EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
-#define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \
+				EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0,0)
+#define EVP_PKEY_RSA_ASN1_OCTET_STRING_method CONST_EVP_MD_ITEM_REQUIRED_TYPE_IMPL(\
 				(evp_sign_method *)RSA_sign_ASN1_OCTET_STRING, \
 				(evp_verify_method *)RSA_verify_ASN1_OCTET_STRING, \
-				{EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
+				EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0,0)
 #else
 #define EVP_PKEY_RSA_method	EVP_PKEY_NULL_method
 #define EVP_PKEY_RSA_ASN1_OCTET_STRING_method EVP_PKEY_NULL_method
@@ -316,6 +355,41 @@
 	void *app_data;		/* Application data */
 	} /* EVP_CIPHER */;
 
+#ifndef OPERA_SMALL_VERSION
+#define OPERA_SET_GET_ASN1_PARAM_FN(f) f
+#else
+#define OPERA_SET_GET_ASN1_PARAM_FN(f) NULL
+#endif
+
+#define CONST_EVP_CIPHER_ITEM(cname, _nid, _block_size, \
+			  _key_len, _iv_len, _flags, _init_key, _do_cipher, _cleanup, \
+			  kstruct, _set_asn1, _get_asn1, _ctrl, _app_data) \
+OPENSSL_PREFIX_CONST_ITEM(static, EVP_CIPHER, cname, libopeay) \
+	CONST_ITEM_ENTRY_START(nid,_nid) \
+	CONST_ITEM_ENTRY_SINGLE(block_size, _block_size)\
+	CONST_ITEM_ENTRY_SINGLE(key_len, _key_len)\
+	CONST_ITEM_ENTRY_SINGLE(iv_len, _iv_len)\
+	CONST_ITEM_ENTRY_SINGLE(flags, _flags)\
+	CONST_ITEM_ENTRY_SINGLE(init, _init_key)\
+	CONST_ITEM_ENTRY_SINGLE(do_cipher, _do_cipher)\
+	CONST_ITEM_ENTRY_SINGLE(cleanup, _cleanup)\
+	CONST_ITEM_ENTRY_SINGLE(ctx_size, sizeof(kstruct))\
+	CONST_ITEM_ENTRY_SINGLE(set_asn1_parameters, _set_asn1)\
+	CONST_ITEM_ENTRY_SINGLE(get_asn1_parameters, _get_asn1)\
+	CONST_ITEM_ENTRY_SINGLE(ctrl, _ctrl)\
+	CONST_ITEM_ENTRY_SINGLE(app_data, _app_data)\
+	CONST_ITEM_ENTRY_END
+
+#define DECLARE_EVP_CIPHER_ITEM(cname) DECLARE_MODULE_CONST_ITEM(EVP_CIPHER, cname)
+
+#ifdef OPENSSL_USE_CFB_CIPHERS
+#define DECLARE_BLOCK_CIPHER(cname) \
+		DECLARE_EVP_CIPHER_ITEM(EVP_CIPHER, cname##_cbc);\
+		DECLARE_EVP_CIPHER_ITEM(EVP_CIPHER, cname##_cbfb)
+#else
+#define DECLARE_BLOCK_CIPHER(cname) DECLARE_EVP_CIPHER_ITEM(cname##_cbc)
+#endif
+
 /* Values for cipher flags */
 
 /* Modes for ciphers */
@@ -362,7 +436,7 @@
 typedef struct evp_cipher_info_st
 	{
 	const EVP_CIPHER *cipher;
-	unsigned char iv[EVP_MAX_IV_LENGTH];
+	unsigned char iv[EVP_MAX_IV_LENGTH]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 	} EVP_CIPHER_INFO;
 
 struct evp_cipher_ctx_st
@@ -372,9 +446,9 @@
 	int encrypt;		/* encrypt or decrypt */
 	int buf_len;		/* number we have left */
 
-	unsigned char  oiv[EVP_MAX_IV_LENGTH];	/* original iv */
-	unsigned char  iv[EVP_MAX_IV_LENGTH];	/* working iv */
-	unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */
+	unsigned char  oiv[EVP_MAX_IV_LENGTH];	/* original iv */ /* ARRAY OK 2009-05-25 yngve */
+	unsigned char  iv[EVP_MAX_IV_LENGTH];	/* working iv */ /* ARRAY OK 2009-05-25 yngve */
+	unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */ /* ARRAY OK 2009-05-25 yngve */
 	int num;				/* used by cfb/ofb mode */
 
 	void *app_data;		/* application stuff */
@@ -383,7 +457,7 @@
 	void *cipher_data; /* per EVP data */
 	int final_used;
 	int block_mask;
-	unsigned char final[EVP_MAX_BLOCK_LENGTH];/* possible final block */
+	unsigned char final[EVP_MAX_BLOCK_LENGTH];/* possible final block */ /* ARRAY OK 2009-05-25 yngve */
 	} /* EVP_CIPHER_CTX */;
 
 typedef struct evp_Encode_Ctx_st
@@ -394,7 +468,7 @@
 			 * length that is ok.  Once decoding begins,
 			 * the length is adjusted up each time a longer
 			 * line is decoded */
-	unsigned char enc_data[80];	/* data to encode */
+	unsigned char enc_data[80];	/* data to encode */ /* ARRAY OK 2009-05-25 yngve */
 	int line_num;	/* number read on current line */
 	int expect_nl;
 	} EVP_ENCODE_CTX;
@@ -612,9 +686,9 @@
 int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key);
 
 #ifndef OPENSSL_NO_BIO
-BIO_METHOD *BIO_f_md(void);
-BIO_METHOD *BIO_f_base64(void);
-BIO_METHOD *BIO_f_cipher(void);
+const BIO_METHOD *BIO_f_md(void);
+const BIO_METHOD *BIO_f_base64(void);
+const BIO_METHOD *BIO_f_cipher(void);
 BIO_METHOD *BIO_f_reliable(void);
 void BIO_set_cipher(BIO *b,const EVP_CIPHER *c,const unsigned char *k,
 		const unsigned char *i, int enc);
@@ -695,6 +769,7 @@
 #ifndef OPENSSL_NO_RC4
 const EVP_CIPHER *EVP_rc4(void);
 const EVP_CIPHER *EVP_rc4_40(void);
+const EVP_CIPHER *EVP_rc4_256(void);
 #endif
 #ifndef OPENSSL_NO_IDEA
 const EVP_CIPHER *EVP_idea_ecb(void);
diff -Naur openssl-1.0.0q.orig/crypto/evp/evp_enc.c openssl-1.0.0q/crypto/evp/evp_enc.c
--- openssl-1.0.0q.orig/crypto/evp/evp_enc.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/evp_enc.c	2017-04-25 16:23:40.352324664 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
@@ -65,22 +67,29 @@
 #include <openssl/engine.h>
 #endif
 #include "evp_locl.h"
+#ifndef OPERA_SMALL_VERSION
+#include <assert.h>
+#endif /* !OPERA_SMALL_VERSION */
 
-const char EVP_version[]="EVP" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char EVP_version[]="EVP" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-26 haavardm */
+#endif
 
 void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx)
 	{
-	memset(ctx,0,sizeof(EVP_CIPHER_CTX));
+	op_memset(ctx,0,sizeof(EVP_CIPHER_CTX));
 	/* ctx->cipher=NULL; */
 	}
 
+#ifndef OPERA_SMALL_VERSION
 EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void)
 	{
-	EVP_CIPHER_CTX *ctx=OPENSSL_malloc(sizeof *ctx);
+	EVP_CIPHER_CTX *ctx=(EVP_CIPHER_CTX*) OPENSSL_malloc(sizeof *ctx);
 	if (ctx)
 		EVP_CIPHER_CTX_init(ctx);
 	return ctx;
 	}
+#endif
 
 int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
 	     const unsigned char *key, const unsigned char *iv, int enc)
@@ -171,6 +180,7 @@
 			}
 		ctx->key_len = cipher->key_len;
 		ctx->flags = 0;
+#if !defined OPERA_SMALL_VERSION ||defined SSL_USE_WEAK_CIPHERS  || !defined OPENSSL_NO_RC2
 		if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT)
 			{
 			if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL))
@@ -179,6 +189,7 @@
 				return 0;
 				}
 			}
+#endif
 		}
 	else if(!ctx->cipher)
 		{
@@ -210,8 +221,8 @@
 
 			OPENSSL_assert(EVP_CIPHER_CTX_iv_length(ctx) <=
 					(int)sizeof(ctx->iv));
-			if(iv) memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_iv_length(ctx));
-			memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx));
+			if(iv) op_memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_iv_length(ctx));
+			op_memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx));
 			break;
 
 			default:
@@ -306,7 +317,7 @@
 		{
 		if (i+inl < bl)
 			{
-			memcpy(&(ctx->buf[i]),in,inl);
+			op_memcpy(&(ctx->buf[i]),in,inl);
 			ctx->buf_len+=inl;
 			*outl=0;
 			return 1;
@@ -314,7 +325,7 @@
 		else
 			{
 			j=bl-i;
-			memcpy(&(ctx->buf[i]),in,j);
+			op_memcpy(&(ctx->buf[i]),in,j);
 			if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,bl)) return 0;
 			inl-=j;
 			in+=j;
@@ -333,7 +344,7 @@
 		}
 
 	if (i != 0)
-		memcpy(ctx->buf,&(in[inl]),i);
+		op_memcpy(ctx->buf,&(in[inl]),i);
 	ctx->buf_len=i;
 	return 1;
 	}
@@ -351,7 +362,7 @@
 	unsigned int i, b, bl;
 
 	b=ctx->cipher->block_size;
-	OPENSSL_assert(b <= sizeof ctx->buf);
+	OPENSSL_assert(b <= (int) sizeof ctx->buf);
 	if (b == 1)
 		{
 		*outl=0;
@@ -397,11 +408,11 @@
 		return EVP_EncryptUpdate(ctx, out, outl, in, inl);
 
 	b=ctx->cipher->block_size;
-	OPENSSL_assert(b <= sizeof ctx->final);
+	OPENSSL_assert(b <= (int) sizeof ctx->final);
 
 	if(ctx->final_used)
 		{
-		memcpy(out,ctx->final,b);
+		op_memcpy(out,ctx->final,b);
 		out+=b;
 		fix_len = 1;
 		}
@@ -418,7 +429,7 @@
 		{
 		*outl-=b;
 		ctx->final_used=1;
-		memcpy(ctx->final,&out[*outl],b);
+		op_memcpy(ctx->final,&out[*outl],b);
 		}
 	else
 		ctx->final_used = 0;
@@ -460,7 +471,7 @@
 			EVPerr(EVP_F_EVP_DECRYPTFINAL_EX,EVP_R_WRONG_FINAL_BLOCK_LENGTH);
 			return(0);
 			}
-		OPENSSL_assert(b <= sizeof ctx->final);
+		OPENSSL_assert(b <= (int) sizeof ctx->final);
 		n=ctx->final[b-1];
 		if (n == 0 || n > (int)b)
 			{
@@ -512,10 +523,11 @@
 		 * functional reference we held for this reason. */
 		ENGINE_finish(c->engine);
 #endif
-	memset(c,0,sizeof(EVP_CIPHER_CTX));
+	op_memset(c,0,sizeof(EVP_CIPHER_CTX));
 	return 1;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen)
 	{
 	if(c->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH) 
@@ -529,6 +541,7 @@
 	EVPerr(EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH,EVP_R_INVALID_KEY_LENGTH);
 	return 0;
 	}
+#endif
 
 int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *ctx, int pad)
 	{
@@ -584,7 +597,7 @@
 #endif
 
 	EVP_CIPHER_CTX_cleanup(out);
-	memcpy(out,in,sizeof *out);
+	op_memcpy(out,in,sizeof *out);
 
 	if (in->cipher_data && in->cipher->ctx_size)
 		{
@@ -594,7 +607,7 @@
 			EVPerr(EVP_F_EVP_CIPHER_CTX_COPY,ERR_R_MALLOC_FAILURE);
 			return 0;
 			}
-		memcpy(out->cipher_data,in->cipher_data,in->cipher->ctx_size);
+		op_memcpy(out->cipher_data,in->cipher_data,in->cipher->ctx_size);
 		}
 
 	if (in->cipher->flags & EVP_CIPH_CUSTOM_COPY)
diff -Naur openssl-1.0.0q.orig/crypto/evp/evp_err.c openssl-1.0.0q/crypto/evp/evp_err.c
--- openssl-1.0.0q.orig/crypto/evp/evp_err.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/evp_err.c	2017-04-25 16:23:40.352324664 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/evp.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/evp/evp_key.c openssl-1.0.0q/crypto/evp/evp_key.c
--- openssl-1.0.0q.orig/crypto/evp/evp_key.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/evp_key.c	2017-04-25 16:23:40.353321997 +0200
@@ -56,15 +56,18 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/ui.h>
 
+#ifndef _SSL_USE_OPENSSL_
 /* should be init to zeros. */
-static char prompt_string[80];
+static char prompt_string[80]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 
 void EVP_set_pw_prompt(const char *prompt)
 	{
@@ -72,7 +75,7 @@
 		prompt_string[0]='\0';
 	else
 		{
-		strncpy(prompt_string,prompt,79);
+		op_strncpy(prompt_string,prompt,79);
 		prompt_string[79]='\0';
 		}
 	}
@@ -96,7 +99,7 @@
 int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, int verify)
 	{
 	int ret;
-	char buff[BUFSIZ];
+	char buff[BUFSIZ]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 	UI *ui;
 
 	if ((prompt == NULL) && (prompt_string[0] != '\0'))
@@ -112,12 +115,14 @@
 	return ret;
 	}
 
+#endif
+
 int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, 
 	     const unsigned char *salt, const unsigned char *data, int datal,
 	     int count, unsigned char *key, unsigned char *iv)
 	{
 	EVP_MD_CTX c;
-	unsigned char md_buf[EVP_MAX_MD_SIZE];
+	unsigned char md_buf[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-05-25 yngve */
 	int niv,nkey,addmd=0;
 	unsigned int mds=0,i;
 
diff -Naur openssl-1.0.0q.orig/crypto/evp/evp_lib.c openssl-1.0.0q/crypto/evp/evp_lib.c
--- openssl-1.0.0q.orig/crypto/evp/evp_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/evp_lib.c	2017-04-25 16:23:40.354322404 +0200
@@ -56,8 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 
@@ -96,7 +99,7 @@
 		if (i != (int)l)
 			return(-1);
 		else if (i > 0)
-			memcpy(c->iv,c->oiv,l);
+			op_memcpy(c->iv,c->oiv,l);
 		}
 	return(i);
 	}
@@ -214,6 +217,7 @@
 	ctx->app_data = data;
 	}
 
+#if defined(LIBOPEAY_PKCS12_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
 int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
 	{
 	return cipher->iv_len;
@@ -228,6 +232,7 @@
 	{
 	return cipher->key_len;
 	}
+#endif
 
 int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/evp/evp_locl.h openssl-1.0.0q/crypto/evp/evp_locl.h
--- openssl-1.0.0q.orig/crypto/evp/evp_locl.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/evp_locl.h	2017-04-25 16:23:40.355322252 +0200
@@ -56,6 +56,9 @@
  *
  */
 
+#ifndef HEADER_EVP_LOCL_H
+#define HEADER_EVP_LOCL_H
+
 /* Macros to code block cipher wrappers */
 
 /* Wrapper functions for each cipher mode */
@@ -124,12 +127,24 @@
 	return 1;\
 }
 
+#if !defined(_SSL_USE_OPENSSL_) && !defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 #define BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
 	BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
 	BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \
 	BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
 	BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched)
+#else
+#ifdef OPENSSL_USE_CFB_CIPHERS
+#define BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
+	BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
+	BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched)
+#else
+#define BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
+	BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched)
+#endif
+#endif
 
+#if !defined(_SSL_USE_OPENSSL_) && !defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 #define BLOCK_CIPHER_def1(cname, nmode, mode, MODE, kstruct, nid, block_size, \
 			  key_len, iv_len, flags, init_key, cleanup, \
 			  set_asn1, get_asn1, ctrl) \
@@ -145,6 +160,26 @@
 	NULL \
 }; \
 const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
+#else
+#if defined SSL_USE_WEAK_CIPHERS
+#define BLOCK_CIPHER_def1(cname, nmode, mode, MODE, kstruct, nid, block_size, \
+			  key_len, iv_len, flags, init_key, cleanup, \
+			  set_asn1, get_asn1, ctrl) \
+CONST_EVP_CIPHER_ITEM(cname##_##mode, nid##_##nmode, block_size, key_len, iv_len,\
+	((flags) | EVP_CIPH_##MODE##_MODE), init_key, cname##_##mode##_cipher, cleanup,\
+	kstruct, NULL , NULL, ctrl, NULL)\
+const EVP_CIPHER *EVP_##cname##_##mode(void) { return &OPENSSL_GLOBAL_ITEM_NAME(cname##_##mode); }
+
+#else
+#define BLOCK_CIPHER_def1(cname, nmode, mode, MODE, kstruct, nid, block_size, \
+			  key_len, iv_len, flags, init_key, cleanup, \
+			  set_asn1, get_asn1, ctrl) \
+CONST_EVP_CIPHER_ITEM(cname##_##mode, nid##_##nmode, block_size, key_len, iv_len,\
+	((flags) | EVP_CIPH_##MODE##_MODE), init_key, cname##_##mode##_cipher, cleanup,\
+	kstruct, NULL , NULL, NULL, NULL)\
+const EVP_CIPHER *EVP_##cname##_##mode(void) { return &OPENSSL_GLOBAL_ITEM_NAME(cname##_##mode); }
+#endif
+#endif
 
 #define BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, \
 			     iv_len, flags, init_key, cleanup, set_asn1, \
@@ -172,6 +207,24 @@
 BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \
 		  0, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
 
+#if !defined(_SSL_USE_OPENSSL_) && !defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+
+#define BLOCK_CIPHER_defs(cname, kstruct, \
+			  nid, block_size, key_len, iv_len, cbits, flags, \
+			  init_key, cleanup, set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, \
+		     init_key, cleanup, set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, \
+		     flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \
+		     flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, iv_len, flags, \
+		     init_key, cleanup, set_asn1, get_asn1, ctrl)
+
+#else
+
+#ifdef OPENSSL_USE_CFB_CIPHERS
+
 #define BLOCK_CIPHER_defs(cname, kstruct, \
 			  nid, block_size, key_len, iv_len, cbits, flags, \
 			  init_key, cleanup, set_asn1, get_asn1, ctrl) \
@@ -179,10 +232,22 @@
 		     init_key, cleanup, set_asn1, get_asn1, ctrl) \
 BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, \
 		     flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
+			 /*
 BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \
 		     flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
 BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags, \
 		     init_key, cleanup, set_asn1, get_asn1, ctrl)
+			 */
+#else
+
+#define BLOCK_CIPHER_defs(cname, kstruct, \
+			  nid, block_size, key_len, iv_len, cbits, flags, \
+			  init_key, cleanup, set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, \
+		     init_key, cleanup, set_asn1, get_asn1, ctrl)
+
+#endif
+#endif
 
 
 /*
@@ -342,4 +407,65 @@
 
 	} /* EVP_PKEY_METHOD */;
 
+#define CONST_EVP_PKEY_METHOD_ITEM(cname, \
+	a_pkey_id, \
+	a_flags, \
+	a_init, \
+	a_copy, \
+	a_cleanup, \
+	a_paramgen_init, \
+	a_paramgen, \
+	a_keygen_init, \
+	a_keygen, \
+	a_sign_init, \
+	a_sign, \
+	a_verify_init, \
+	a_verify, \
+	a_verify_recover_init, \
+	a_verify_recover, \
+	a_signctx_init, \
+	a_signctx, \
+	a_verifyctx_init, \
+	a_verifyctx, \
+	a_encrypt_init, \
+	a_encrypt, \
+	a_decrypt_init, \
+	a_decrypt, \
+	a_derive_init, \
+	a_derive, \
+	a_ctrl, \
+	a_ctrl_str \
+) \
+	OPENSSL_PREFIX_CONST_ITEM(extern, EVP_PKEY_METHOD, cname, libopeay) \
+		CONST_ITEM_ENTRY_START( pkey_id,             a_pkey_id) \
+		CONST_ITEM_ENTRY_SINGLE(flags,               a_flags) \
+		CONST_ITEM_ENTRY_SINGLE(init,                a_init) \
+		CONST_ITEM_ENTRY_SINGLE(copy,                a_copy) \
+		CONST_ITEM_ENTRY_SINGLE(cleanup,             a_cleanup) \
+		CONST_ITEM_ENTRY_SINGLE(paramgen_init,       a_paramgen_init) \
+		CONST_ITEM_ENTRY_SINGLE(paramgen,            a_paramgen) \
+		CONST_ITEM_ENTRY_SINGLE(keygen_init,         a_keygen_init) \
+		CONST_ITEM_ENTRY_SINGLE(keygen,              a_keygen) \
+		CONST_ITEM_ENTRY_SINGLE(sign_init,           a_sign_init) \
+		CONST_ITEM_ENTRY_SINGLE(sign,                a_sign) \
+		CONST_ITEM_ENTRY_SINGLE(verify_init,         a_verify_init) \
+		CONST_ITEM_ENTRY_SINGLE(verify,              a_verify) \
+		CONST_ITEM_ENTRY_SINGLE(verify_recover_init, a_verify_recover_init) \
+		CONST_ITEM_ENTRY_SINGLE(verify_recover,      a_verify_recover) \
+		CONST_ITEM_ENTRY_SINGLE(signctx_init,        a_signctx_init) \
+		CONST_ITEM_ENTRY_SINGLE(signctx,             a_signctx) \
+		CONST_ITEM_ENTRY_SINGLE(verifyctx_init,      a_verifyctx_init) \
+		CONST_ITEM_ENTRY_SINGLE(verifyctx,           a_verifyctx) \
+		CONST_ITEM_ENTRY_SINGLE(encrypt_init,        a_encrypt_init) \
+		CONST_ITEM_ENTRY_SINGLE(encrypt,             a_encrypt) \
+		CONST_ITEM_ENTRY_SINGLE(decrypt_init,        a_decrypt_init) \
+		CONST_ITEM_ENTRY_SINGLE(decrypt,             a_decrypt) \
+		CONST_ITEM_ENTRY_SINGLE(derive_init,         a_derive_init) \
+		CONST_ITEM_ENTRY_SINGLE(derive,              a_derive) \
+		CONST_ITEM_ENTRY_SINGLE(ctrl,                a_ctrl) \
+		CONST_ITEM_ENTRY_SINGLE(ctrl_str,            a_ctrl_str) \
+	CONST_ITEM_ENTRY_END
+
 void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx);
+
+#endif // !HEADER_EVP_LOCL_H
diff -Naur openssl-1.0.0q.orig/crypto/evp/evp_pbe.c openssl-1.0.0q/crypto/evp/evp_pbe.c
--- openssl-1.0.0q.orig/crypto/evp/evp_pbe.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/evp_pbe.c	2017-04-25 16:23:40.356322099 +0200
@@ -56,20 +56,32 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/pkcs12.h>
 #include <openssl/x509.h>
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 /* Password based encryption (PBE) functions */
 
 DECLARE_STACK_OF(EVP_PBE_CTL)
-static STACK_OF(EVP_PBE_CTL) *pbe_algs;
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(STACK_OF(EVP_PBE_CTL) *, pbe_algs);
+#define pbe_algs OPENSSL_GLOBAL_REF(pbe_algs)
+#else
+static STACK_OF(EVP_PBE_CTL) *pbe_algs=NULL;
+#endif
 
 /* Setup a cipher context from a PBE algorithm */
 
-typedef struct
+typedef struct evp_pbe_ctl_st
 	{
 	int pbe_type;
 	int pbe_nid;
@@ -78,47 +90,58 @@
 	EVP_PBE_KEYGEN *keygen;
 	} EVP_PBE_CTL;
 
-static const EVP_PBE_CTL builtin_pbe[] = 
-	{
-	{EVP_PBE_TYPE_OUTER, NID_pbeWithMD2AndDES_CBC,
-			NID_des_cbc, NID_md2, PKCS5_PBE_keyivgen},
-	{EVP_PBE_TYPE_OUTER, NID_pbeWithMD5AndDES_CBC,
-			NID_des_cbc, NID_md5, PKCS5_PBE_keyivgen},
-	{EVP_PBE_TYPE_OUTER, NID_pbeWithSHA1AndRC2_CBC,
-			NID_rc2_64_cbc, NID_sha1, PKCS5_PBE_keyivgen},
-
-	{EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And128BitRC4,
-			NID_rc4, NID_sha1, PKCS12_PBE_keyivgen},
-	{EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And40BitRC4,
-			NID_rc4_40, NID_sha1, PKCS12_PBE_keyivgen},
-	{EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
-		 	NID_des_ede3_cbc, NID_sha1, PKCS12_PBE_keyivgen},
-	{EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And2_Key_TripleDES_CBC, 
-			NID_des_ede_cbc, NID_sha1, PKCS12_PBE_keyivgen},
-	{EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And128BitRC2_CBC,
-			NID_rc2_cbc, NID_sha1, PKCS12_PBE_keyivgen},
-	{EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And40BitRC2_CBC,
-			NID_rc2_40_cbc, NID_sha1, PKCS12_PBE_keyivgen},
-
-#ifndef OPENSSL_NO_HMAC
-	{EVP_PBE_TYPE_OUTER, NID_pbes2, -1, -1, PKCS5_v2_PBE_keyivgen},
-#endif
-	{EVP_PBE_TYPE_OUTER, NID_pbeWithMD2AndRC2_CBC,
-			NID_rc2_64_cbc, NID_md2, PKCS5_PBE_keyivgen},
-	{EVP_PBE_TYPE_OUTER, NID_pbeWithMD5AndRC2_CBC,
-			NID_rc2_64_cbc, NID_md5, PKCS5_PBE_keyivgen},
-	{EVP_PBE_TYPE_OUTER, NID_pbeWithSHA1AndDES_CBC,
-			NID_des_cbc, NID_sha1, PKCS5_PBE_keyivgen},
-
-
-	{EVP_PBE_TYPE_PRF, NID_hmacWithSHA1, -1, NID_sha1, 0},
-	{EVP_PBE_TYPE_PRF, NID_hmacWithMD5, -1, NID_md5, 0},
-	{EVP_PBE_TYPE_PRF, NID_hmacWithSHA224, -1, NID_sha224, 0},
-	{EVP_PBE_TYPE_PRF, NID_hmacWithSHA256, -1, NID_sha256, 0},
-	{EVP_PBE_TYPE_PRF, NID_hmacWithSHA384, -1, NID_sha384, 0},
-	{EVP_PBE_TYPE_PRF, NID_hmacWithSHA512, -1, NID_sha512, 0},
-	{EVP_PBE_TYPE_PRF, NID_id_HMACGostR3411_94, -1, NID_id_GostR3411_94, 0},
-	};
+#define EVP_PBE_ENTRY( \
+	a_pbe_type,   \
+	a_pbe_nid,    \
+	a_cipher_nid, \
+	a_md_nid,     \
+	a_keygen      \
+) \
+	CONST_PENT_ENTRY( \
+		pbe_type,   a_pbe_type,   \
+		pbe_nid,    a_pbe_nid,    \
+		cipher_nid, a_cipher_nid, \
+		md_nid,     a_md_nid,     \
+		keygen,     a_keygen      \
+	)
+
+OPENSSL_PREFIX_CONST_ARRAY(extern, struct evp_pbe_ctl_st, evp_pbe__builtin_pbe, libopeay)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbeWithMD2AndDES_CBC,
+			NID_des_cbc, NID_md2, PKCS5_PBE_keyivgen)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbeWithMD5AndDES_CBC,
+			NID_des_cbc, NID_md5, PKCS5_PBE_keyivgen)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbeWithSHA1AndRC2_CBC,
+			NID_rc2_64_cbc, NID_sha1, PKCS5_PBE_keyivgen)
+
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And128BitRC4,
+			NID_rc4, NID_sha1, PKCS12_PBE_keyivgen)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And40BitRC4,
+			NID_rc4_40, NID_sha1, PKCS12_PBE_keyivgen)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
+			NID_des_ede3_cbc, NID_sha1, PKCS12_PBE_keyivgen)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And2_Key_TripleDES_CBC,
+			NID_des_ede_cbc, NID_sha1, PKCS12_PBE_keyivgen)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And128BitRC2_CBC,
+			NID_rc2_cbc, NID_sha1, PKCS12_PBE_keyivgen)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And40BitRC2_CBC,
+			NID_rc2_40_cbc, NID_sha1, PKCS12_PBE_keyivgen)
+
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbeWithMD2AndRC2_CBC,
+			NID_rc2_64_cbc, NID_md2, PKCS5_PBE_keyivgen)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbeWithMD5AndRC2_CBC,
+			NID_rc2_64_cbc, NID_md5, PKCS5_PBE_keyivgen)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_OUTER, NID_pbeWithSHA1AndDES_CBC,
+			NID_des_cbc, NID_sha1, PKCS5_PBE_keyivgen)
+
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_PRF, NID_hmacWithSHA1, -1, NID_sha1, 0)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_PRF, NID_hmacWithMD5, -1, NID_md5, 0)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_PRF, NID_hmacWithSHA224, -1, NID_sha224, 0)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_PRF, NID_hmacWithSHA256, -1, NID_sha256, 0)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_PRF, NID_hmacWithSHA384, -1, NID_sha384, 0)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_PRF, NID_hmacWithSHA512, -1, NID_sha512, 0)
+	EVP_PBE_ENTRY(EVP_PBE_TYPE_PRF, NID_id_HMACGostR3411_94, -1, NID_id_GostR3411_94, 0)
+CONST_END(evp_pbe__builtin_pbe)
+#define builtin_pbe OPENSSL_GLOBAL_ARRAY_NAME(evp_pbe__builtin_pbe)
 
 #ifdef TEST
 int main(int argc, char **argv)
@@ -158,18 +181,20 @@
 	if (!EVP_PBE_find(EVP_PBE_TYPE_OUTER, OBJ_obj2nid(pbe_obj),
 					&cipher_nid, &md_nid, &keygen))
 		{
-		char obj_tmp[80];
+		char obj_tmp[80]; /* ARRAY OK 2009-05-25 yngve */
 		EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM);
 		if (!pbe_obj) BUF_strlcpy (obj_tmp, "NULL", sizeof obj_tmp);
 		else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj);
+#ifndef OPERA_SMALL_VERSION
 		ERR_add_error_data(2, "TYPE=", obj_tmp);
+#endif
 		return 0;
 		}
 
 	if(!pass)
 		passlen = 0;
 	else if (passlen == -1)
-		passlen = strlen(pass);
+		passlen = op_strlen(pass);
 
 	if (cipher_nid == -1)
 		cipher = NULL;
@@ -286,7 +311,7 @@
 	if (pbetmp == NULL)
 		{
 		pbetmp = OBJ_bsearch_pbe2(&pbelu, builtin_pbe,
-				     sizeof(builtin_pbe)/sizeof(EVP_PBE_CTL));
+			OPENSSL_CONST_ARRAY_SIZE(evp_pbe__builtin_pbe));
 		}
 	if (pbetmp == NULL)
 		return 0;
@@ -309,3 +334,5 @@
 	sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
 	pbe_algs = NULL;
 	}
+
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/evp/evp_pkey.c openssl-1.0.0q/crypto/evp/evp_pkey.c
--- openssl-1.0.0q.orig/crypto/evp/evp_pkey.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/evp_pkey.c	2017-04-25 16:23:40.357322785 +0200
@@ -56,12 +56,15 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/rand.h>
-#include "asn1_locl.h"
+#include "../asn1/asn1_locl.h"
 
 /* Extract a private key from a PKCS8 structure */
 
@@ -69,7 +72,7 @@
 {
 	EVP_PKEY *pkey = NULL;
 	ASN1_OBJECT *algoid;
-	char obj_tmp[80];
+	char obj_tmp[80]; /* ARRAY OK 2009-05-25 yngve */
 
 	if (!PKCS8_pkey_get0(&algoid, NULL, NULL, NULL, p8))
 		return NULL;
@@ -158,6 +161,7 @@
 	return NULL;
 }
 
+#ifndef OPERA_SMALL_VERSION
 PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken)
 {
 	switch (broken) {
@@ -178,13 +182,16 @@
 		return NULL;
 	}
 }
+#endif // !OPERA_SMALL_VERSION
 
 /* EVP_PKEY attribute functions */
 
+#ifndef OPERA_SMALL_VERSION
 int EVP_PKEY_get_attr_count(const EVP_PKEY *key)
 {
 	return X509at_get_attr_count(key->attributes);
 }
+#endif // !OPERA_SMALL_VERSION
 
 int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid,
 			  int lastpos)
@@ -192,21 +199,25 @@
 	return X509at_get_attr_by_NID(key->attributes, nid, lastpos);
 }
 
+#ifndef OPERA_SMALL_VERSION
 int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj,
 			  int lastpos)
 {
 	return X509at_get_attr_by_OBJ(key->attributes, obj, lastpos);
 }
+#endif // !OPERA_SMALL_VERSION
 
 X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc)
 {
 	return X509at_get_attr(key->attributes, loc);
 }
 
+#ifndef OPERA_SMALL_VERSION
 X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc)
 {
 	return X509at_delete_attr(key->attributes, loc);
 }
+#endif // !OPERA_SMALL_VERSION
 
 int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr)
 {
diff -Naur openssl-1.0.0q.orig/crypto/evp/evp_test.c openssl-1.0.0q/crypto/evp/evp_test.c
--- openssl-1.0.0q.orig/crypto/evp/evp_test.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/evp_test.c	2017-04-25 16:23:40.358322353 +0200
@@ -47,8 +47,13 @@
  * OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -87,7 +92,7 @@
 	    fprintf(stderr,"Odd number of hex digits!");
 	    EXIT(4);
 	    }
-	sscanf((char *)s,"%2x",&n);
+	op_sscanf((char *)s,"%2x",&n);
 	*d=(unsigned char)n;
 	}
     return s-d;
@@ -101,7 +106,7 @@
     if (**string == 0)
         return NULL;
 
-    memset(isdelim, 0, 256);
+    op_memset(isdelim, 0, 256);
     isdelim[0] = 1;
 
     while (*delim)
@@ -188,7 +193,7 @@
 	    test1_exit(8);
 	    }
 
-	if(memcmp(out,ciphertext,cn))
+	if(op_memcmp(out,ciphertext,cn))
 	    {
 	    fprintf(stderr,"Ciphertext mismatch\n");
 	    hexdump(stderr,"Got",out,cn);
@@ -227,7 +232,7 @@
 	    test1_exit(8);
 	    }
 
-	if(memcmp(out,plaintext,pn))
+	if(op_memcmp(out,plaintext,pn))
 	    {
 	    fprintf(stderr,"Plaintext mismatch\n");
 	    hexdump(stderr,"Got",out,pn);
@@ -302,7 +307,7 @@
 	EXIT(102);
 	}
 
-    if(memcmp(md,ciphertext,cn))
+    if(op_memcmp(md,ciphertext,cn))
 	{
 	fprintf(stderr,"Digest mismatch\n");
 	hexdump(stderr,"Got",md,cn);
@@ -384,7 +389,7 @@
 	    p[-1] = '\0';
 	    encdec = -1;
 	} else {
-	    encdec = atoi(sstrsep(&p,"\n"));
+	    encdec = op_atoi(sstrsep(&p,"\n"));
 	}
 	      
 
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_dss.c openssl-1.0.0q/crypto/evp/m_dss.c
--- openssl-1.0.0q.orig/crypto/evp/m_dss.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_dss.c	2017-04-25 16:23:40.359321922 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_dss1.c openssl-1.0.0q/crypto/evp/m_dss1.c
--- openssl-1.0.0q.orig/crypto/evp/m_dss1.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_dss1.c	2017-04-25 16:23:40.360321490 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_SHA
 
@@ -67,18 +69,18 @@
 #ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
 #endif
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int init(EVP_MD_CTX *ctx)
-	{ return SHA1_Init(ctx->md_data); }
+	{ return SHA1_Init((SHA_CTX *) ctx->md_data); }
 
 static int update(EVP_MD_CTX *ctx,const void *data,size_t count)
-	{ return SHA1_Update(ctx->md_data,data,count); }
+	{ return SHA1_Update((SHA_CTX *) ctx->md_data,data,count); }
 
 static int final(EVP_MD_CTX *ctx,unsigned char *md)
-	{ return SHA1_Final(md,ctx->md_data); }
+	{ return SHA1_Final(md,(SHA_CTX *) ctx->md_data); }
 
-static const EVP_MD dss1_md=
-	{
+CONST_EVP_MD_ITEM(dss1_md,
 	NID_dsa,
 	NID_dsaWithSHA1,
 	SHA_DIGEST_LENGTH,
@@ -90,11 +92,11 @@
 	NULL,
 	EVP_PKEY_DSA_method,
 	SHA_CBLOCK,
-	sizeof(EVP_MD *)+sizeof(SHA_CTX),
-	};
+	sizeof(EVP_MD *)+sizeof(SHA_CTX)
+	);
 
 const EVP_MD *EVP_dss1(void)
 	{
-	return(&dss1_md);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(dss1_md));
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_md2.c openssl-1.0.0q/crypto/evp/m_md2.c
--- openssl-1.0.0q.orig/crypto/evp/m_md2.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_md2.c	2017-04-25 16:23:40.361322176 +0200
@@ -56,8 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_MD2
 
@@ -68,18 +71,18 @@
 #ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #endif
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int init(EVP_MD_CTX *ctx)
-	{ return MD2_Init(ctx->md_data); }
+	{ return MD2_Init((MD2_CTX *) ctx->md_data); }
 
 static int update(EVP_MD_CTX *ctx,const void *data,size_t count)
-	{ return MD2_Update(ctx->md_data,data,count); }
+	{ return MD2_Update((MD2_CTX *) ctx->md_data, (const unsigned char *) data,count); }
 
 static int final(EVP_MD_CTX *ctx,unsigned char *md)
-	{ return MD2_Final(md,ctx->md_data); }
+	{ return MD2_Final(md,(MD2_CTX *) ctx->md_data); }
 
-static const EVP_MD md2_md=
-	{
+CONST_EVP_MD_ITEM(md2_md,
 	NID_md2,
 	NID_md2WithRSAEncryption,
 	MD2_DIGEST_LENGTH,
@@ -91,11 +94,11 @@
 	NULL,
 	EVP_PKEY_RSA_method,
 	MD2_BLOCK,
-	sizeof(EVP_MD *)+sizeof(MD2_CTX),
-	};
+	sizeof(EVP_MD *)+sizeof(MD2_CTX)
+	);
 
 const EVP_MD *EVP_md2(void)
 	{
-	return(&md2_md);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(md2_md));
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_md4.c openssl-1.0.0q/crypto/evp/m_md4.c
--- openssl-1.0.0q.orig/crypto/evp/m_md4.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_md4.c	2017-04-25 16:23:40.361322176 +0200
@@ -56,8 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_MD4
 
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_md5.c openssl-1.0.0q/crypto/evp/m_md5.c
--- openssl-1.0.0q.orig/crypto/evp/m_md5.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_md5.c	2017-04-25 16:23:40.362322303 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_MD5
 
@@ -68,18 +70,18 @@
 #ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #endif
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int init(EVP_MD_CTX *ctx)
-	{ return MD5_Init(ctx->md_data); }
+	{ return MD5_Init((MD5_CTX *) ctx->md_data); }
 
 static int update(EVP_MD_CTX *ctx,const void *data,size_t count)
-	{ return MD5_Update(ctx->md_data,data,count); }
+	{ return MD5_Update((MD5_CTX *) ctx->md_data,data,count); }
 
 static int final(EVP_MD_CTX *ctx,unsigned char *md)
-	{ return MD5_Final(md,ctx->md_data); }
+	{ return MD5_Final(md,(MD5_CTX *) ctx->md_data); }
 
-static const EVP_MD md5_md=
-	{
+CONST_EVP_MD_ITEM(md5_md,
 	NID_md5,
 	NID_md5WithRSAEncryption,
 	MD5_DIGEST_LENGTH,
@@ -91,11 +93,11 @@
 	NULL,
 	EVP_PKEY_RSA_method,
 	MD5_CBLOCK,
-	sizeof(EVP_MD *)+sizeof(MD5_CTX),
-	};
+	sizeof(EVP_MD *)+sizeof(MD5_CTX)
+	);
 
 const EVP_MD *EVP_md5(void)
 	{
-	return(&md5_md);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(md5_md));
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_mdc2.c openssl-1.0.0q/crypto/evp/m_mdc2.c
--- openssl-1.0.0q.orig/crypto/evp/m_mdc2.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_mdc2.c	2017-04-25 16:23:40.363322151 +0200
@@ -56,8 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_MDC2
 
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_null.c openssl-1.0.0q/crypto/evp/m_null.c
--- openssl-1.0.0q.orig/crypto/evp/m_null.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_null.c	2017-04-25 16:23:40.364322557 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_ripemd.c openssl-1.0.0q/crypto/evp/m_ripemd.c
--- openssl-1.0.0q.orig/crypto/evp/m_ripemd.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_ripemd.c	2017-04-25 16:23:40.365323243 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_RIPEMD
 
@@ -68,18 +70,18 @@
 #ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #endif
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int init(EVP_MD_CTX *ctx)
-	{ return RIPEMD160_Init(ctx->md_data); }
+	{ return RIPEMD160_Init((RIPEMD160_CTX *) ctx->md_data); }
 
 static int update(EVP_MD_CTX *ctx,const void *data,size_t count)
-	{ return RIPEMD160_Update(ctx->md_data,data,count); }
+	{ return RIPEMD160_Update((RIPEMD160_CTX *) ctx->md_data,data,count); }
 
 static int final(EVP_MD_CTX *ctx,unsigned char *md)
-	{ return RIPEMD160_Final(md,ctx->md_data); }
+	{ return RIPEMD160_Final(md,(RIPEMD160_CTX *) ctx->md_data); }
 
-static const EVP_MD ripemd160_md=
-	{
+CONST_EVP_MD_ITEM(ripemd160_md,
 	NID_ripemd160,
 	NID_ripemd160WithRSA,
 	RIPEMD160_DIGEST_LENGTH,
@@ -91,11 +93,11 @@
 	NULL,
 	EVP_PKEY_RSA_method,
 	RIPEMD160_CBLOCK,
-	sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX),
-	};
+	sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX)
+	);
 
 const EVP_MD *EVP_ripemd160(void)
 	{
-	return(&ripemd160_md);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(ripemd160_md));
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_sha.c openssl-1.0.0q/crypto/evp/m_sha.c
--- openssl-1.0.0q.orig/crypto/evp/m_sha.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_sha.c	2017-04-25 16:23:40.365323243 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 
 #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA0)
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_sha1.c openssl-1.0.0q/crypto/evp/m_sha1.c
--- openssl-1.0.0q.orig/crypto/evp/m_sha1.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_sha1.c	2017-04-25 16:23:40.366322253 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_SHA
 
@@ -67,18 +69,19 @@
 #ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #endif
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 static int init(EVP_MD_CTX *ctx)
-	{ return SHA1_Init(ctx->md_data); }
+	{ return SHA1_Init((SHA_CTX *) ctx->md_data); }
 
 static int update(EVP_MD_CTX *ctx,const void *data,size_t count)
-	{ return SHA1_Update(ctx->md_data,data,count); }
+	{ return SHA1_Update((SHA_CTX *) ctx->md_data,data,count); }
 
 static int final(EVP_MD_CTX *ctx,unsigned char *md)
-	{ return SHA1_Final(md,ctx->md_data); }
+	{ return SHA1_Final(md,(SHA_CTX *) ctx->md_data); }
 
-static const EVP_MD sha1_md=
-	{
+CONST_EVP_MD_ITEM(sha1_md,
 	NID_sha1,
 	NID_sha1WithRSAEncryption,
 	SHA_DIGEST_LENGTH,
@@ -90,32 +93,31 @@
 	NULL,
 	EVP_PKEY_RSA_method,
 	SHA_CBLOCK,
-	sizeof(EVP_MD *)+sizeof(SHA_CTX),
-	};
+	sizeof(EVP_MD *)+sizeof(SHA_CTX)
+	);
 
 const EVP_MD *EVP_sha1(void)
 	{
-	return(&sha1_md);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(sha1_md));
 	}
 #endif
 
 #ifndef OPENSSL_NO_SHA256
 static int init224(EVP_MD_CTX *ctx)
-	{ return SHA224_Init(ctx->md_data); }
+	{ return SHA224_Init((SHA256_CTX *) ctx->md_data); }
 static int init256(EVP_MD_CTX *ctx)
-	{ return SHA256_Init(ctx->md_data); }
+	{ return SHA256_Init((SHA256_CTX *) ctx->md_data); }
 /*
  * Even though there're separate SHA224_[Update|Final], we call
  * SHA256 functions even in SHA224 context. This is what happens
  * there anyway, so we can spare few CPU cycles:-)
  */
 static int update256(EVP_MD_CTX *ctx,const void *data,size_t count)
-	{ return SHA256_Update(ctx->md_data,data,count); }
+	{ return SHA256_Update((SHA256_CTX *) ctx->md_data,data,count); }
 static int final256(EVP_MD_CTX *ctx,unsigned char *md)
-	{ return SHA256_Final(md,ctx->md_data); }
+	{ return SHA256_Final(md,(SHA256_CTX *) ctx->md_data); }
 
-static const EVP_MD sha224_md=
-	{
+CONST_EVP_MD_ITEM(sha224_md,
 	NID_sha224,
 	NID_sha224WithRSAEncryption,
 	SHA224_DIGEST_LENGTH,
@@ -127,14 +129,13 @@
 	NULL,
 	EVP_PKEY_RSA_method,
 	SHA256_CBLOCK,
-	sizeof(EVP_MD *)+sizeof(SHA256_CTX),
-	};
+	sizeof(EVP_MD *)+sizeof(SHA256_CTX)
+	);
 
 const EVP_MD *EVP_sha224(void)
-	{ return(&sha224_md); }
+	{ return(&OPENSSL_GLOBAL_ITEM_NAME(sha224_md)); }
 
-static const EVP_MD sha256_md=
-	{
+CONST_EVP_MD_ITEM(sha256_md,
 	NID_sha256,
 	NID_sha256WithRSAEncryption,
 	SHA256_DIGEST_LENGTH,
@@ -146,26 +147,25 @@
 	NULL,
 	EVP_PKEY_RSA_method,
 	SHA256_CBLOCK,
-	sizeof(EVP_MD *)+sizeof(SHA256_CTX),
-	};
+	sizeof(EVP_MD *)+sizeof(SHA256_CTX)
+	);
 
 const EVP_MD *EVP_sha256(void)
-	{ return(&sha256_md); }
+	{ return(&OPENSSL_GLOBAL_ITEM_NAME(sha256_md)); }
 #endif	/* ifndef OPENSSL_NO_SHA256 */
 
 #ifndef OPENSSL_NO_SHA512
 static int init384(EVP_MD_CTX *ctx)
-	{ return SHA384_Init(ctx->md_data); }
+	{ return SHA384_Init((SHA512_CTX *) ctx->md_data); }
 static int init512(EVP_MD_CTX *ctx)
-	{ return SHA512_Init(ctx->md_data); }
+	{ return SHA512_Init((SHA512_CTX *) ctx->md_data); }
 /* See comment in SHA224/256 section */
 static int update512(EVP_MD_CTX *ctx,const void *data,size_t count)
-	{ return SHA512_Update(ctx->md_data,data,count); }
+	{ return SHA512_Update((SHA512_CTX *) ctx->md_data,data,count); }
 static int final512(EVP_MD_CTX *ctx,unsigned char *md)
-	{ return SHA512_Final(md,ctx->md_data); }
+	{ return SHA512_Final(md,(SHA512_CTX *) ctx->md_data); }
 
-static const EVP_MD sha384_md=
-	{
+CONST_EVP_MD_ITEM(sha384_md,
 	NID_sha384,
 	NID_sha384WithRSAEncryption,
 	SHA384_DIGEST_LENGTH,
@@ -177,14 +177,13 @@
 	NULL,
 	EVP_PKEY_RSA_method,
 	SHA512_CBLOCK,
-	sizeof(EVP_MD *)+sizeof(SHA512_CTX),
-	};
+	sizeof(EVP_MD *)+sizeof(SHA512_CTX)
+	);
 
 const EVP_MD *EVP_sha384(void)
-	{ return(&sha384_md); }
+	{ return(&OPENSSL_GLOBAL_ITEM_NAME(sha384_md)); }
 
-static const EVP_MD sha512_md=
-	{
+CONST_EVP_MD_ITEM(sha512_md,
 	NID_sha512,
 	NID_sha512WithRSAEncryption,
 	SHA512_DIGEST_LENGTH,
@@ -196,9 +195,9 @@
 	NULL,
 	EVP_PKEY_RSA_method,
 	SHA512_CBLOCK,
-	sizeof(EVP_MD *)+sizeof(SHA512_CTX),
-	};
+	sizeof(EVP_MD *)+sizeof(SHA512_CTX)
+	);
 
 const EVP_MD *EVP_sha512(void)
-	{ return(&sha512_md); }
+	{ return(&OPENSSL_GLOBAL_ITEM_NAME(sha512_md)); }
 #endif	/* ifndef OPENSSL_NO_SHA512 */
diff -Naur openssl-1.0.0q.orig/crypto/evp/m_sigver.c openssl-1.0.0q/crypto/evp/m_sigver.c
--- openssl-1.0.0q.orig/crypto/evp/m_sigver.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/m_sigver.c	2017-04-25 16:23:40.367322939 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
@@ -140,6 +143,10 @@
 		EVP_MD_CTX tmp_ctx;
 		unsigned char md[EVP_MAX_MD_SIZE];
 		unsigned int mdlen;
+
+		/* Suppress warning "potentially uninitialized local variable used". */
+		mdlen = 0;
+
 		EVP_MD_CTX_init(&tmp_ctx);
 		if (!EVP_MD_CTX_copy_ex(&tmp_ctx,ctx))
 		     	return 0;
@@ -179,6 +186,9 @@
 	unsigned int mdlen;
 	int vctx;
 
+	/* Suppress warning "potentially uninitialized local variable used". */
+	mdlen = 0;
+
 	if (ctx->pctx->pmeth->verifyctx)
 		vctx = 1;
 	else
diff -Naur openssl-1.0.0q.orig/crypto/evp/names.c openssl-1.0.0q/crypto/evp/names.c
--- openssl-1.0.0q.orig/crypto/evp/names.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/names.c	2017-04-25 16:23:40.368322507 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
@@ -123,7 +125,10 @@
 	   does that part.  -- Richard Levitte */
 	OBJ_NAME_cleanup(-1);
 
+#if !defined(_SSL_USE_OPENSSL_) && !defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
 	EVP_PBE_cleanup();
+#endif
+
 	if (obj_cleanup_defer == 2)
 		{
 		obj_cleanup_defer = 0;
@@ -141,7 +146,7 @@
 
 static void do_all_cipher_fn(const OBJ_NAME *nm, void *arg)
 	{
-	struct doall_cipher *dc = arg;
+	struct doall_cipher *dc = (struct doall_cipher *)arg;
 	if (nm->alias)
 		dc->fn(NULL, nm->name, nm->data, dc->arg);
 	else
@@ -175,7 +180,7 @@
 
 static void do_all_md_fn(const OBJ_NAME *nm, void *arg)
 	{
-	struct doall_md *dc = arg;
+	struct doall_md *dc = (struct doall_md *)arg;
 	if (nm->alias)
 		dc->fn(NULL, nm->name, nm->data, dc->arg);
 	else
diff -Naur openssl-1.0.0q.orig/crypto/evp/openbsd_hw.c openssl-1.0.0q/crypto/evp/openbsd_hw.c
--- openssl-1.0.0q.orig/crypto/evp/openbsd_hw.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/openbsd_hw.c	2017-04-25 16:23:40.369322634 +0200
@@ -61,13 +61,19 @@
 /* check flag after OpenSSL headers to ensure make depend works */
 #ifdef OPENSSL_OPENBSD_DEV_CRYPTO
 
+#ifndef OPERA_SMALL_VERSION
 #include <fcntl.h>
+#endif /* !OPERA_SMALL_VERSION */
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/ioctl.h>
 #include <crypto/cryptodev.h>
 #include <unistd.h>
+#ifndef OPERA_SMALL_VERSION
 #include <assert.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 /* longest key supported in hardware */
 #define MAX_HW_KEY	24
@@ -112,7 +118,7 @@
 	close(cryptodev_fd);
 	}
     assert(ses);
-    memset(ses,'\0',sizeof *ses);
+    op_memset(ses,'\0',sizeof *ses);
 
     return 1;
     }
@@ -137,7 +143,7 @@
 
     assert(ctx->cipher->iv_len <= MAX_HW_IV);
 
-    memcpy(CDATA(ctx)->key,key,klen);
+    op_memcpy(CDATA(ctx)->key,key,klen);
     
     CDATA(ctx)->cipher=cipher;
     CDATA(ctx)->keylen=klen;
@@ -162,7 +168,7 @@
     assert(CDATA(ctx));
     assert(!dev_failed);
 
-    memset(&cryp,'\0',sizeof cryp);
+    op_memset(&cryp,'\0',sizeof cryp);
     cryp.ses=CDATA(ctx)->ses;
     cryp.op=ctx->encrypt ? COP_ENCRYPT : COP_DECRYPT;
     cryp.flags=0;
@@ -175,7 +181,7 @@
 	cryp.iv=(caddr_t)ctx->iv;
 
     if(!ctx->encrypt)
-	memcpy(lb,&in[cryp.len-ctx->cipher->iv_len],ctx->cipher->iv_len);
+	op_memcpy(lb,&in[cryp.len-ctx->cipher->iv_len],ctx->cipher->iv_len);
 
     if(ioctl(fd, CIOCCRYPT, &cryp) == -1)
 	{
@@ -191,7 +197,7 @@
 	    if(((unsigned long)in&3) || cinl != inl)
 		{
 		cin=OPENSSL_malloc(cinl);
-		memcpy(cin,in,inl);
+		op_memcpy(cin,in,inl);
 		cryp.src=cin;
 		}
 
@@ -213,7 +219,7 @@
 		
 	    if(cout)
 		{
-		memcpy(out,cout,inl);
+		op_memcpy(out,cout,inl);
 		OPENSSL_free(cout);
 		}
 	    if(cin)
@@ -228,9 +234,9 @@
 	}
 
     if(ctx->encrypt)
-	memcpy(ctx->iv,&out[cryp.len-ctx->cipher->iv_len],ctx->cipher->iv_len);
+	op_memcpy(ctx->iv,&out[cryp.len-ctx->cipher->iv_len],ctx->cipher->iv_len);
     else
-	memcpy(ctx->iv,lb,ctx->cipher->iv_len);
+	op_memcpy(ctx->iv,lb,ctx->cipher->iv_len);
 
     return 1;
     }
@@ -325,16 +331,16 @@
     /* some cards can't do zero length */
     if(!len)
 	{
-	memcpy(md,md5zero,16);
+	op_memcpy(md,md5zero,16);
 	return 1;
 	}
 
-    memset(&cryp,'\0',sizeof cryp);
+    op_memset(&cryp,'\0',sizeof cryp);
     cryp.ses=ses;
     cryp.op=COP_ENCRYPT;/* required to do the MAC rather than check it */
     cryp.len=len;
     cryp.src=(caddr_t)data;
-    cryp.dst=(caddr_t)data; // FIXME!!!
+    cryp.dst=(caddr_t)data; /*FIXME!!! */
     cryp.mac=(caddr_t)md;
 
     if(ioctl(fd, CIOCCRYPT, &cryp) == -1)
@@ -344,9 +350,9 @@
 	    char *dcopy;
 
 	    dcopy=OPENSSL_malloc(len);
-	    memcpy(dcopy,data,len);
+	    op_memcpy(dcopy,data,len);
 	    cryp.src=dcopy;
-	    cryp.dst=cryp.src; // FIXME!!!
+	    cryp.dst=cryp.src; /*FIXME!!! */
 
 	    if(ioctl(fd, CIOCCRYPT, &cryp) == -1)
 		{
@@ -363,7 +369,7 @@
 	    return 0;
 	    }
 	}
-    //    printf("done\n");
+    /*   printf("done\n"); */
 
     return 1;
     }
@@ -377,7 +383,7 @@
 	return do_digest(md_data->sess.ses,md_data->md,data,len);
 
     md_data->data=OPENSSL_realloc(md_data->data,md_data->len+len);
-    memcpy(md_data->data+md_data->len,data,len);
+    op_memcpy(md_data->data+md_data->len,data,len);
     md_data->len+=len;
 
     return 1;
@@ -390,7 +396,7 @@
 
     if(ctx->flags&EVP_MD_CTX_FLAG_ONESHOT)
 	{
-	memcpy(md,md_data->md,MD5_DIGEST_LENGTH);
+	op_memcpy(md,md_data->md,MD5_DIGEST_LENGTH);
 	ret=1;
 	}
     else
@@ -409,11 +415,11 @@
     const MD_DATA *from_md=from->md_data;
     MD_DATA *to_md=to->md_data;
 
-    // How do we copy sessions?
+    /*How do we copy sessions? */
     assert(from->digest->flags&EVP_MD_FLAG_ONESHOT);
 
     to_md->data=OPENSSL_malloc(from_md->len);
-    memcpy(to_md->data,from_md->data,from_md->len);
+    op_memcpy(to_md->data,from_md->data,from_md->len);
 
     return 1;
     }
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_bio_enc.cpp openssl-1.0.0q/crypto/evp/opera_bio_enc.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_bio_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_bio_enc.cpp	2017-04-25 16:23:40.370322203 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/bio_enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_bio_md.cpp openssl-1.0.0q/crypto/evp/opera_bio_md.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_bio_md.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_bio_md.cpp	2017-04-25 16:23:40.370322203 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/bio_md.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_c_allc.cpp openssl-1.0.0q/crypto/evp/opera_c_allc.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_c_allc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_c_allc.cpp	2017-04-25 16:23:40.371322050 +0200
@@ -0,0 +1,21 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/c_allc.c"
+}
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_c_alld.cpp openssl-1.0.0q/crypto/evp/opera_c_alld.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_c_alld.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_c_alld.cpp	2017-04-25 16:23:40.371322050 +0200
@@ -0,0 +1,21 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/c_alld.c"
+}
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_digest.cpp openssl-1.0.0q/crypto/evp/opera_digest.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_digest.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_digest.cpp	2017-04-25 16:23:40.372321619 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/digest.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_e_aes.cpp openssl-1.0.0q/crypto/evp/opera_e_aes.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_e_aes.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_e_aes.cpp	2017-04-25 16:23:40.372321619 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/e_aes.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_e_bf.cpp openssl-1.0.0q/crypto/evp/opera_e_bf.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_e_bf.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_e_bf.cpp	2017-04-25 16:23:40.373321466 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/e_bf.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_e_cast.cpp openssl-1.0.0q/crypto/evp/opera_e_cast.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_e_cast.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_e_cast.cpp	2017-04-25 16:23:40.373321466 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/e_cast.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_e_des.cpp openssl-1.0.0q/crypto/evp/opera_e_des.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_e_des.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_e_des.cpp	2017-04-25 16:23:40.374321593 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/e_des.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_e_des3.cpp openssl-1.0.0q/crypto/evp/opera_e_des3.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_e_des3.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_e_des3.cpp	2017-04-25 16:23:40.374321593 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/e_des3.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_e_rc2.cpp openssl-1.0.0q/crypto/evp/opera_e_rc2.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_e_rc2.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_e_rc2.cpp	2017-04-25 16:23:40.375321162 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/e_rc2.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_e_rc4.cpp openssl-1.0.0q/crypto/evp/opera_e_rc4.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_e_rc4.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_e_rc4.cpp	2017-04-25 16:23:40.375321162 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/e_rc4.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_encode.cpp openssl-1.0.0q/crypto/evp/opera_encode.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_encode.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_encode.cpp	2017-04-25 16:23:40.375321162 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/encode.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_evp_enc.cpp openssl-1.0.0q/crypto/evp/opera_evp_enc.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_evp_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_evp_enc.cpp	2017-04-25 16:23:40.376321568 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/evp_enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_evp_key.cpp openssl-1.0.0q/crypto/evp/opera_evp_key.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_evp_key.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_evp_key.cpp	2017-04-25 16:23:40.376321568 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/evp_key.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_evp_lib.cpp openssl-1.0.0q/crypto/evp/opera_evp_lib.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_evp_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_evp_lib.cpp	2017-04-25 16:23:40.377321137 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/evp_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_evp_pbe.cpp openssl-1.0.0q/crypto/evp/opera_evp_pbe.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_evp_pbe.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_evp_pbe.cpp	2017-04-25 16:23:40.377321137 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/evp_pbe.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_evp_pkey.cpp openssl-1.0.0q/crypto/evp/opera_evp_pkey.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_evp_pkey.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_evp_pkey.cpp	2017-04-25 16:23:40.416619707 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/evp_pkey.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_m_dss1.cpp openssl-1.0.0q/crypto/evp/opera_m_dss1.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_m_dss1.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_m_dss1.cpp	2017-04-25 16:23:40.416619707 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/m_dss1.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_m_md2.cpp openssl-1.0.0q/crypto/evp/opera_m_md2.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_m_md2.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_m_md2.cpp	2017-04-25 16:23:40.417620393 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2010 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/m_md2.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_m_md5.cpp openssl-1.0.0q/crypto/evp/opera_m_md5.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_m_md5.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_m_md5.cpp	2017-04-25 16:23:40.417620393 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/m_md5.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_m_ripemd.cpp openssl-1.0.0q/crypto/evp/opera_m_ripemd.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_m_ripemd.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_m_ripemd.cpp	2017-04-25 16:23:40.418620520 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/m_ripemd.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_m_sha1.cpp openssl-1.0.0q/crypto/evp/opera_m_sha1.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_m_sha1.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_m_sha1.cpp	2017-04-25 16:23:40.418620520 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/m_sha1.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_m_sigver.cpp openssl-1.0.0q/crypto/evp/opera_m_sigver.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_m_sigver.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_m_sigver.cpp	2017-04-25 16:23:40.419620367 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/m_sigver.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_names.cpp openssl-1.0.0q/crypto/evp/opera_names.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_names.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_names.cpp	2017-04-25 16:23:40.419620367 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/names.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_p5_crpt.cpp openssl-1.0.0q/crypto/evp/opera_p5_crpt.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_p5_crpt.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_p5_crpt.cpp	2017-04-25 16:23:40.419620367 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/p5_crpt.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_p_lib.cpp openssl-1.0.0q/crypto/evp/opera_p_lib.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_p_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_p_lib.cpp	2017-04-25 16:23:40.420620215 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/p_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_p_sign.cpp openssl-1.0.0q/crypto/evp/opera_p_sign.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_p_sign.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_p_sign.cpp	2017-04-25 16:23:40.420620215 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/p_sign.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_p_verify.cpp openssl-1.0.0q/crypto/evp/opera_p_verify.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_p_verify.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_p_verify.cpp	2017-04-25 16:23:40.421620063 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/p_verify.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_pmeth_fn.cpp openssl-1.0.0q/crypto/evp/opera_pmeth_fn.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_pmeth_fn.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_pmeth_fn.cpp	2017-04-25 16:23:40.421620063 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/pmeth_fn.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_pmeth_gn.cpp openssl-1.0.0q/crypto/evp/opera_pmeth_gn.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_pmeth_gn.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_pmeth_gn.cpp	2017-04-25 16:23:40.422619911 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/pmeth_gn.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/opera_pmeth_lib.cpp openssl-1.0.0q/crypto/evp/opera_pmeth_lib.cpp
--- openssl-1.0.0q.orig/crypto/evp/opera_pmeth_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/opera_pmeth_lib.cpp	2017-04-25 16:23:40.422619911 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/evp/pmeth_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/evp/p5_crpt.c openssl-1.0.0q/crypto/evp/p5_crpt.c
--- openssl-1.0.0q.orig/crypto/evp/p5_crpt.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/p5_crpt.c	2017-04-25 16:23:40.423620038 +0200
@@ -56,9 +56,12 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/evp.h>
 
@@ -102,7 +105,7 @@
 	saltlen = pbe->salt->length;
 
 	if(!pass) passlen = 0;
-	else if(passlen == -1) passlen = strlen(pass);
+	else if(passlen == -1) passlen = op_strlen(pass);
 
 	EVP_MD_CTX_init(&ctx);
 	EVP_DigestInit_ex(&ctx, md, NULL);
@@ -120,9 +123,9 @@
 	}
 	EVP_MD_CTX_cleanup(&ctx);
 	OPENSSL_assert(EVP_CIPHER_key_length(cipher) <= (int)sizeof(md_tmp));
-	memcpy(key, md_tmp, EVP_CIPHER_key_length(cipher));
+	op_memcpy(key, md_tmp, EVP_CIPHER_key_length(cipher));
 	OPENSSL_assert(EVP_CIPHER_iv_length(cipher) <= 16);
-	memcpy(iv, md_tmp + (16 - EVP_CIPHER_iv_length(cipher)),
+	op_memcpy(iv, md_tmp + (16 - EVP_CIPHER_iv_length(cipher)),
 						 EVP_CIPHER_iv_length(cipher));
 	EVP_CipherInit_ex(cctx, cipher, NULL, key, iv, en_de);
 	OPENSSL_cleanse(md_tmp, EVP_MAX_MD_SIZE);
diff -Naur openssl-1.0.0q.orig/crypto/evp/p5_crpt2.c openssl-1.0.0q/crypto/evp/p5_crpt2.c
--- openssl-1.0.0q.orig/crypto/evp/p5_crpt2.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/p5_crpt2.c	2017-04-25 16:23:40.424620444 +0200
@@ -55,9 +55,11 @@
  * Hudson (tjh@cryptsoft.com).
  *
  */
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #if !defined(OPENSSL_NO_HMAC) && !defined(OPENSSL_NO_SHA)
 #include <openssl/x509.h>
 #include <openssl/evp.h>
@@ -96,7 +98,7 @@
 	if(!pass)
 		passlen = 0;
 	else if(passlen == -1)
-		passlen = strlen(pass);
+		passlen = op_strlen(pass);
 	if (!HMAC_Init_ex(&hctx_tpl, pass, passlen, digest, NULL))
 		{
 		HMAC_CTX_cleanup(&hctx_tpl);
@@ -129,7 +131,7 @@
 			return 0;
 			}
 		HMAC_CTX_cleanup(&hctx);
-		memcpy(p, digtmp, cplen);
+		op_memcpy(p, digtmp, cplen);
 		for(j = 1; j < iter; j++)
 			{
 			if (!HMAC_CTX_copy(&hctx, &hctx_tpl))
diff -Naur openssl-1.0.0q.orig/crypto/evp/p_dec.c openssl-1.0.0q/crypto/evp/p_dec.c
--- openssl-1.0.0q.orig/crypto/evp/p_dec.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/p_dec.c	2017-04-25 16:23:40.424620444 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/rand.h>
 #ifndef OPENSSL_NO_RSA
diff -Naur openssl-1.0.0q.orig/crypto/evp/p_enc.c openssl-1.0.0q/crypto/evp/p_enc.c
--- openssl-1.0.0q.orig/crypto/evp/p_enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/p_enc.c	2017-04-25 16:23:40.425620013 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/rand.h>
 #ifndef OPENSSL_NO_RSA
diff -Naur openssl-1.0.0q.orig/crypto/evp/p_lib.c openssl-1.0.0q/crypto/evp/p_lib.c
--- openssl-1.0.0q.orig/crypto/evp/p_lib.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/p_lib.c	2017-04-25 16:23:40.426620140 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/err.h>
 #include <openssl/objects.h>
@@ -78,7 +80,7 @@
 #include <openssl/engine.h>
 #endif
 
-#include "asn1_locl.h"
+#include "../asn1/asn1_locl.h"
 
 static void EVP_PKEY_free_it(EVP_PKEY *x);
 
@@ -89,13 +91,16 @@
 	return 0;
 	}
 
+#if defined(LIBOPEAY_ASYNCHRONOUS_KEYGENERATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
 int EVP_PKEY_size(EVP_PKEY *pkey)
 	{
 	if (pkey && pkey->ameth && pkey->ameth->pkey_size)
 		return pkey->ameth->pkey_size(pkey);
 	return 0;
 	}
+#endif // defined(LIBOPEAY_ASYNCHRONOUS_KEYGENERATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
 
+#ifndef OPERA_SMALL_VERSION
 int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode)
 	{
 #ifndef OPENSSL_NO_DSA
@@ -120,6 +125,7 @@
 #endif
 	return(0);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)
 	{
@@ -147,6 +153,7 @@
 	return 0;
 	}
 
+#if defined(LIBOPEAY_PKCS12_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
 int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b)
 	{
 	if (a->type != b->type)
@@ -178,6 +185,7 @@
 
 	return -2;
 	}
+#endif // defined(LIBOPEAY_PKCS12_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 
 EVP_PKEY *EVP_PKEY_new(void)
 	{
@@ -260,19 +268,22 @@
 	return pkey_set_type(pkey, EVP_PKEY_NONE, str, len);
 	}
 
+#if defined(LIBOPEAY_PKCS12_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
 int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key)
 	{
 	if (!EVP_PKEY_set_type(pkey, type))
 		return 0;
-	pkey->pkey.ptr=key;
+	pkey->pkey.ptr=(char*)key;
 	return (key != NULL);
 	}
+#endif // defined(LIBOPEAY_PKCS12_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
 
 void *EVP_PKEY_get0(EVP_PKEY *pkey)
 	{
 	return pkey->pkey.ptr;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 #ifndef OPENSSL_NO_RSA
 int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key)
 {
@@ -356,6 +367,7 @@
 	return pkey->pkey.dh;
 }
 #endif
+#endif // !OPERA_SMALL_VERSION
 
 int EVP_PKEY_type(int type)
 	{
@@ -403,8 +415,10 @@
 		}
 #endif
 	EVP_PKEY_free_it(x);
+#ifdef LIBOPEAY_PKCS12_SUPPORT
 	if (x->attributes)
 		sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
+#endif
 	OPENSSL_free(x);
 	}
 
diff -Naur openssl-1.0.0q.orig/crypto/evp/p_open.c openssl-1.0.0q/crypto/evp/p_open.c
--- openssl-1.0.0q.orig/crypto/evp/p_open.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/p_open.c	2017-04-25 16:23:40.427619988 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
 #ifndef OPENSSL_NO_RSA
 
diff -Naur openssl-1.0.0q.orig/crypto/evp/p_seal.c openssl-1.0.0q/crypto/evp/p_seal.c
--- openssl-1.0.0q.orig/crypto/evp/p_seal.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/p_seal.c	2017-04-25 16:23:40.427619988 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/rand.h>
 #ifndef OPENSSL_NO_RSA
diff -Naur openssl-1.0.0q.orig/crypto/evp/p_sign.c openssl-1.0.0q/crypto/evp/p_sign.c
--- openssl-1.0.0q.orig/crypto/evp/p_sign.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/p_sign.c	2017-04-25 16:23:40.428620115 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
@@ -78,7 +80,7 @@
 int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
 	     EVP_PKEY *pkey)
 	{
-	unsigned char m[EVP_MAX_MD_SIZE];
+	unsigned char m[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-05-25 yngve */
 	unsigned int m_len;
 	int i,ok=0,v;
 	EVP_MD_CTX tmp_ctx;
diff -Naur openssl-1.0.0q.orig/crypto/evp/p_verify.c openssl-1.0.0q/crypto/evp/p_verify.c
--- openssl-1.0.0q.orig/crypto/evp/p_verify.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/p_verify.c	2017-04-25 16:23:40.429620521 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
@@ -65,7 +67,7 @@
 int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
 	     unsigned int siglen, EVP_PKEY *pkey)
 	{
-	unsigned char m[EVP_MAX_MD_SIZE];
+	unsigned char m[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-05-25 yngve */
 	unsigned int m_len;
 	int i,ok=0,v;
 	EVP_MD_CTX tmp_ctx;
diff -Naur openssl-1.0.0q.orig/crypto/evp/pmeth_fn.c openssl-1.0.0q/crypto/evp/pmeth_fn.c
--- openssl-1.0.0q.orig/crypto/evp/pmeth_fn.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/pmeth_fn.c	2017-04-25 16:23:40.430620090 +0200
@@ -56,9 +56,12 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include "evp_locl.h"
diff -Naur openssl-1.0.0q.orig/crypto/evp/pmeth_gn.c openssl-1.0.0q/crypto/evp/pmeth_gn.c
--- openssl-1.0.0q.orig/crypto/evp/pmeth_gn.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/pmeth_gn.c	2017-04-25 16:23:40.430620090 +0200
@@ -56,9 +56,12 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/bn.h>
@@ -178,7 +181,7 @@
 
 static int trans_cb(int a, int b, BN_GENCB *gcb)
 	{
-	EVP_PKEY_CTX *ctx = gcb->arg;
+	EVP_PKEY_CTX *ctx = (EVP_PKEY_CTX *)gcb->arg;
 	ctx->keygen_info[0] = a;
 	ctx->keygen_info[1] = b;
 	return ctx->pkey_gencb(ctx);
diff -Naur openssl-1.0.0q.orig/crypto/evp/pmeth_lib.c openssl-1.0.0q/crypto/evp/pmeth_lib.c
--- openssl-1.0.0q.orig/crypto/evp/pmeth_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/evp/pmeth_lib.c	2017-04-25 16:23:40.431620217 +0200
@@ -56,41 +56,54 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
 #endif
-#include "asn1_locl.h"
+#include "../asn1/asn1_locl.h"
 #include "evp_locl.h"
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 typedef int sk_cmp_fn_type(const char * const *a, const char * const *b);
 
 DECLARE_STACK_OF(EVP_PKEY_METHOD)
 STACK_OF(EVP_PKEY_METHOD) *app_pkey_methods = NULL;
 
+#define  rsa_pkey_meth OPENSSL_GLOBAL_ITEM_NAME(rsa_pmeth__rsa_pkey_meth )
+#define   dh_pkey_meth OPENSSL_GLOBAL_ITEM_NAME( dh_pmeth__dh_pkey_meth  )
+#define  dsa_pkey_meth OPENSSL_GLOBAL_ITEM_NAME(dsa_pmeth__dsa_pkey_meth )
+#define   ec_pkey_meth OPENSSL_GLOBAL_ITEM_NAME( ec_pmeth__ec_pkey_meth  )
+#define hmac_pkey_meth OPENSSL_GLOBAL_ITEM_NAME( hm_pmeth__hmac_pkey_meth)
+
+#ifdef HAS_COMPLEX_GLOBALS
 extern const EVP_PKEY_METHOD rsa_pkey_meth, dh_pkey_meth, dsa_pkey_meth;
 extern const EVP_PKEY_METHOD ec_pkey_meth, hmac_pkey_meth;
+#endif // HAS_COMPLEX_GLOBALS
 
-static const EVP_PKEY_METHOD *standard_methods[] =
-	{
+OPENSSL_PREFIX_CONST_ARRAY(static, const EVP_PKEY_METHOD*, pmeth_lib__standard_methods, libopeay)
 #ifndef OPENSSL_NO_RSA
-	&rsa_pkey_meth,
+	CONST_ENTRY(&rsa_pkey_meth)
 #endif
 #ifndef OPENSSL_NO_DH
-	&dh_pkey_meth,
+	CONST_ENTRY(&dh_pkey_meth)
 #endif
 #ifndef OPENSSL_NO_DSA
-	&dsa_pkey_meth,
+	CONST_ENTRY(&dsa_pkey_meth)
 #endif
 #ifndef OPENSSL_NO_EC
-	&ec_pkey_meth,
+	CONST_ENTRY(&ec_pkey_meth)
 #endif
-	&hmac_pkey_meth,
-	};
+	CONST_ENTRY(&hmac_pkey_meth)
+CONST_END(pmeth_lib__standard_methods)
+#define standard_methods OPENSSL_GLOBAL_ARRAY_NAME(pmeth_lib__standard_methods)
 
 DECLARE_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_METHOD *, const EVP_PKEY_METHOD *,
 			   pmeth);
@@ -117,7 +130,7 @@
 			return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx);
 		}
 	ret = OBJ_bsearch_pmeth(&t, standard_methods,
-			  sizeof(standard_methods)/sizeof(EVP_PKEY_METHOD *));
+			OPENSSL_CONST_ARRAY_SIZE(pmeth_lib__standard_methods));
 	if (!ret || !*ret)
 		return NULL;
 	return *ret;
@@ -164,7 +177,7 @@
 		return NULL;
 		}
 
-	ret = OPENSSL_malloc(sizeof(EVP_PKEY_CTX));
+	ret = (EVP_PKEY_CTX *)OPENSSL_malloc(sizeof(EVP_PKEY_CTX));
 	if (!ret)
 		{
 #ifndef OPENSSL_NO_ENGINE
@@ -199,7 +212,7 @@
 EVP_PKEY_METHOD* EVP_PKEY_meth_new(int id, int flags)
 	{
 	EVP_PKEY_METHOD *pmeth;
-	pmeth = OPENSSL_malloc(sizeof(EVP_PKEY_METHOD));
+	pmeth = (EVP_PKEY_METHOD *)OPENSSL_malloc(sizeof(EVP_PKEY_METHOD));
 	if (!pmeth)
 		return NULL;
 
@@ -264,7 +277,7 @@
 		return 0;
 		}
 #endif
-	rctx = OPENSSL_malloc(sizeof(EVP_PKEY_CTX));
+	rctx = (EVP_PKEY_CTX *)OPENSSL_malloc(sizeof(EVP_PKEY_CTX));
 	if (!rctx)
 		return NULL;
 
diff -Naur openssl-1.0.0q.orig/crypto/ex_data.c openssl-1.0.0q/crypto/ex_data.c
--- openssl-1.0.0q.orig/crypto/ex_data.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ex_data.c	2017-04-25 16:23:40.433620192 +0200
@@ -138,7 +138,12 @@
  *
  */
 
-#include "cryptlib.h"
+#ifndef OPERA_SMALL_VERSION
+#include <stdio.h>
+#include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/buffer.h>
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 
 /* What an "implementation of ex_data functionality" looks like */
@@ -167,26 +172,40 @@
 			CRYPTO_EX_DATA *ad);
 	};
 
+#ifndef OPERA_SMALL_VERSION
 /* The implementation we use at run-time */
 static const CRYPTO_EX_DATA_IMPL *impl = NULL;
 
 /* To call "impl" functions, use this macro rather than referring to 'impl' directly, eg.
  * EX_IMPL(get_new_index)(...); */
 #define EX_IMPL(a) impl->cb_##a
+#else /* OPERA_SMALL_VERSION */
+#define EX_IMPL(a) int_##a
+#endif /* OPERA_SMALL_VERSION */
+
 
 /* Predeclare the "default" ex_data implementation */
+#ifndef OPERA_SMALL_VERSION
 static int int_new_class(void);
+#endif
+
 static void int_cleanup(void);
+#if !defined OPERA_SMALL_VERSION || defined LIBOPEAY_X509_EX_DATA
 static int int_get_new_index(int class_index, long argl, void *argp,
 		CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
 		CRYPTO_EX_free *free_func);
+#endif
 static int int_new_ex_data(int class_index, void *obj,
 		CRYPTO_EX_DATA *ad);
+#if !defined(OPERA_SMALL_VERSION) || defined (EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 static int int_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
 		CRYPTO_EX_DATA *from);
+#endif
 static void int_free_ex_data(int class_index, void *obj,
 		CRYPTO_EX_DATA *ad);
-static CRYPTO_EX_DATA_IMPL impl_default =
+
+#ifndef OPERA_SMALL_VERSION
+static const CRYPTO_EX_DATA_IMPL impl_default =
 	{
 	int_new_class,
 	int_cleanup,
@@ -208,13 +227,18 @@
 /* A macro wrapper for impl_check that first uses a non-locked test before
  * invoking the function (which checks again inside a lock). */
 #define IMPL_CHECK if(!impl) impl_check();
+#else  /* OPERA_SMALL_VERSION */
+#define IMPL_CHECK
+#endif /* OPERA_SMALL_VERSION */
 
+#ifndef OPERA_SMALL_VERSION
 /* API functions to get/set the "ex_data" implementation */
 const CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void)
 	{
 	IMPL_CHECK
 	return impl;
 	}
+
 int CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i)
 	{
 	int toret = 0;
@@ -227,6 +251,7 @@
 	CRYPTO_w_unlock(CRYPTO_LOCK_EX_DATA);
 	return toret;
 	}
+#endif // OPERA_SMALL_VERSION
 
 /****************************************************************************/
 /* Interal (default) implementation of "ex_data" support. API functions are
@@ -242,11 +267,18 @@
 } EX_CLASS_ITEM;
 
 /* When assigning new class indexes, this is our counter */
+#ifndef OPERA_SMALL_VERSION
 static int ex_class = CRYPTO_EX_INDEX_USER;
+#endif // OPERA_SMALL_VERSION
 
 /* The global hash table of EX_CLASS_ITEM items */
 DECLARE_LHASH_OF(EX_CLASS_ITEM);
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(LHASH_OF(EX_CLASS_ITEM) *, ex_data);
+#define ex_data OPENSSL_GLOBAL_REF(ex_data)
+#else
 static LHASH_OF(EX_CLASS_ITEM) *ex_data = NULL;
+#endif // OPERA_SMALL_VERSION
 
 /* The callbacks required in the "ex_data" hash table */
 static unsigned long ex_class_item_hash(const EX_CLASS_ITEM *a)
@@ -302,10 +334,10 @@
 	EX_DATA_CHECK(return NULL;)
 	d.class_index = class_index;
 	CRYPTO_w_lock(CRYPTO_LOCK_EX_DATA);
-	p = lh_EX_CLASS_ITEM_retrieve(ex_data, &d);
+	p = (EX_CLASS_ITEM *) lh_EX_CLASS_ITEM_retrieve(ex_data, &d);
 	if(!p)
 		{
-		gen = OPENSSL_malloc(sizeof(EX_CLASS_ITEM));
+		gen = (EX_CLASS_ITEM *) OPENSSL_malloc(sizeof(EX_CLASS_ITEM));
 		if(gen)
 			{
 			gen->class_index = class_index;
@@ -328,6 +360,7 @@
 	return p;
 	}
 
+#if !defined OPERA_SMALL_VERSION || defined LIBOPEAY_X509_EX_DATA
 /* Add a new method to the given EX_CLASS_ITEM and return the corresponding
  * index (or -1 for error). Handles locking. */
 static int def_add_index(EX_CLASS_ITEM *item, long argl, void *argp,
@@ -363,10 +396,12 @@
 	CRYPTO_w_unlock(CRYPTO_LOCK_EX_DATA);
 	return toret;
 	}
+#endif
 
 /**************************************************************/
 /* The functions in the default CRYPTO_EX_DATA_IMPL structure */
 
+#if !defined OPERA_SMALL_VERSION
 static int int_new_class(void)
 	{
 	int toret;
@@ -375,6 +410,7 @@
 	CRYPTO_w_unlock(CRYPTO_LOCK_EX_DATA);
 	return toret;
 	}
+#endif
 
 static void int_cleanup(void)
 	{
@@ -382,9 +418,12 @@
 	lh_EX_CLASS_ITEM_doall(ex_data, def_cleanup_cb);
 	lh_EX_CLASS_ITEM_free(ex_data);
 	ex_data = NULL;
+#ifndef OPERA_SMALL_VERSION
 	impl = NULL;
+#endif
 	}
 
+#if !defined OPERA_SMALL_VERSION || defined LIBOPEAY_X509_EX_DATA
 static int int_get_new_index(int class_index, long argl, void *argp,
 		CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
 		CRYPTO_EX_free *free_func)
@@ -394,6 +433,7 @@
 		return -1;
 	return def_add_index(item, argl, argp, new_func, dup_func, free_func);
 	}
+#endif
 
 /* Thread-safe by copying a class's array of "CRYPTO_EX_DATA_FUNCS" entries in
  * the lock, then using them outside the lock. NB: Thread-safety only applies to
@@ -414,7 +454,7 @@
 	mx = sk_CRYPTO_EX_DATA_FUNCS_num(item->meth);
 	if(mx > 0)
 		{
-		storage = OPENSSL_malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS*));
+		storage = (CRYPTO_EX_DATA_FUNCS **) OPENSSL_malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS*));
 		if(!storage)
 			goto skip;
 		for(i = 0; i < mx; i++)
@@ -441,6 +481,7 @@
 	return 1;
 	}
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 /* Same thread-safety notes as for "int_new_ex_data" */
 static int int_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
 		CRYPTO_EX_DATA *from)
@@ -461,7 +502,7 @@
 		mx = j;
 	if(mx > 0)
 		{
-		storage = OPENSSL_malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS*));
+		storage = (CRYPTO_EX_DATA_FUNCS**)OPENSSL_malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS*));
 		if(!storage)
 			goto skip;
 		for(i = 0; i < mx; i++)
@@ -476,7 +517,7 @@
 		}
 	for(i = 0; i < mx; i++)
 		{
-		ptr = CRYPTO_get_ex_data(from, i);
+		ptr = (char*)CRYPTO_get_ex_data(from, i);
 		if(storage[i] && storage[i]->dup_func)
 			storage[i]->dup_func(to,from,&ptr,i,
 				storage[i]->argl,storage[i]->argp);
@@ -486,6 +527,7 @@
 		OPENSSL_free(storage);
 	return 1;
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 /* Same thread-safety notes as for "int_new_ex_data" */
 static void int_free_ex_data(int class_index, void *obj,
@@ -501,7 +543,7 @@
 	mx = sk_CRYPTO_EX_DATA_FUNCS_num(item->meth);
 	if(mx > 0)
 		{
-		storage = OPENSSL_malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS*));
+		storage = (CRYPTO_EX_DATA_FUNCS **) OPENSSL_malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS*));
 		if(!storage)
 			goto skip;
 		for(i = 0; i < mx; i++)
@@ -538,11 +580,13 @@
 
 /* Obtain an index for a new class (not the same as getting a new index within
  * an existing class - this is actually getting a new *class*) */
+#ifndef OPERA_SMALL_VERSION
 int CRYPTO_ex_data_new_class(void)
 	{
 	IMPL_CHECK
 	return EX_IMPL(new_class)();
 	}
+#endif
 
 /* Release all "ex_data" state to prevent memory leaks. This can't be made
  * thread-safe without overhauling a lot of stuff, and shouldn't really be
@@ -554,6 +598,7 @@
 	EX_IMPL(cleanup)();
 	}
 
+#if !defined OPERA_SMALL_VERSION || defined LIBOPEAY_X509_EX_DATA
 /* Inside an existing class, get/register a new index. */
 int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
 		CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
@@ -566,6 +611,7 @@
 			argl, argp, new_func, dup_func, free_func);
 	return ret;
 	}
+#endif
 
 /* Initialise a new CRYPTO_EX_DATA for use in a particular class - including
  * calling new() callbacks for each index in the class used by this variable */
@@ -577,14 +623,16 @@
 
 /* Duplicate a CRYPTO_EX_DATA variable - including calling dup() callbacks for
  * each index in the class used by this variable */
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
 	     CRYPTO_EX_DATA *from)
 	{
 	IMPL_CHECK
 	return EX_IMPL(dup_ex_data)(class_index, to, from);
 	}
+#endif
 
-/* Cleanup a CRYPTO_EX_DATA variable - including calling free() callbacks for
+/* Cleanup a CRYPTO_EX_DATA variable - including calling op_free() callbacks for
  * each index in the class used by this variable */
 void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
 	{
@@ -617,7 +665,7 @@
 			}
 		i++;
 		}
-	sk_void_set(ad->sk,idx,val);
+	sk_void_set(ad->sk,idx, (char *) val);
 	return(1);
 	}
 
diff -Naur openssl-1.0.0q.orig/crypto/hmac/.gitignore openssl-1.0.0q/crypto/hmac/.gitignore
--- openssl-1.0.0q.orig/crypto/hmac/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/hmac/.gitignore	2017-04-25 16:23:40.433620192 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/hmac/hm_ameth.c openssl-1.0.0q/crypto/hmac/hm_ameth.c
--- openssl-1.0.0q.orig/crypto/hmac/hm_ameth.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/hmac/hm_ameth.c	2017-04-25 16:23:40.434620319 +0200
@@ -55,10 +55,16 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
-#include "asn1_locl.h"
+#include "../asn1/asn1_locl.h"
+
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 #define HMAC_TEST_PRIVATE_KEY_FORMAT
 
@@ -122,7 +128,7 @@
 		{
 		if (!*pder)
 			{
-			*pder = OPENSSL_malloc(os->length);
+			*pder = (unsigned char *)OPENSSL_malloc(os->length);
 			inc = 0;
 			}
 		else inc = 1;
@@ -138,14 +144,13 @@
 
 #endif
 
-const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = 
-	{
+CONST_EVP_PKEY_ASN1_METHOD_ITEM(hm_ameth__hmac_asn1_meth,
 	EVP_PKEY_HMAC,
 	EVP_PKEY_HMAC,
 	0,
 
-	"HMAC",
-	"OpenSSL HMAC method",
+	(char *)"HMAC",
+	(char *)"OpenSSL HMAC method",
 
 	0,0,0,0,
 
@@ -157,11 +162,6 @@
 
 	hmac_key_free,
 	hmac_pkey_ctrl,
-#ifdef HMAC_TEST_PRIVATE_KEY_FORMAT
 	old_hmac_decode,
 	old_hmac_encode
-#else
-	0,0
-#endif
-	};
-
+	);
diff -Naur openssl-1.0.0q.orig/crypto/hmac/hm_pmeth.c openssl-1.0.0q/crypto/hmac/hm_pmeth.c
--- openssl-1.0.0q.orig/crypto/hmac/hm_pmeth.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/hmac/hm_pmeth.c	2017-04-25 16:23:40.435619049 +0200
@@ -55,13 +55,17 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 #include <openssl/evp.h>
 #include <openssl/hmac.h>
-#include "evp_locl.h"
+#include "../evp/evp_locl.h"
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* HMAC pkey context structure */
 
@@ -75,7 +79,7 @@
 static int pkey_hmac_init(EVP_PKEY_CTX *ctx)
 	{
 	HMAC_PKEY_CTX *hctx;
-	hctx = OPENSSL_malloc(sizeof(HMAC_PKEY_CTX));
+	hctx = (HMAC_PKEY_CTX *)OPENSSL_malloc(sizeof(HMAC_PKEY_CTX));
 	if (!hctx)
 		return 0;
 	hctx->md = NULL;
@@ -96,8 +100,8 @@
 	HMAC_PKEY_CTX *sctx, *dctx;
 	if (!pkey_hmac_init(dst))
 		return 0;
-       	sctx = src->data;
-	dctx = dst->data;
+	sctx = (HMAC_PKEY_CTX *)src->data;
+	dctx = (HMAC_PKEY_CTX *)dst->data;
 	dctx->md = sctx->md;
 	HMAC_CTX_init(&dctx->ctx);
 	HMAC_CTX_copy(&dctx->ctx, &sctx->ctx);
@@ -112,7 +116,7 @@
 
 static void pkey_hmac_cleanup(EVP_PKEY_CTX *ctx)
 	{
-	HMAC_PKEY_CTX *hctx = ctx->data;
+	HMAC_PKEY_CTX *hctx = (HMAC_PKEY_CTX *)ctx->data;
 	HMAC_CTX_cleanup(&hctx->ctx);
 	if (hctx->ktmp.data)
 		{
@@ -127,7 +131,7 @@
 static int pkey_hmac_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
 	{
 	ASN1_OCTET_STRING *hkey = NULL;
-	HMAC_PKEY_CTX *hctx = ctx->data;
+	HMAC_PKEY_CTX *hctx = (HMAC_PKEY_CTX *)ctx->data;
 	if (!hctx->ktmp.data)
 		return 0;
 	hkey = ASN1_OCTET_STRING_dup(&hctx->ktmp);
@@ -140,14 +144,14 @@
 
 static int int_update(EVP_MD_CTX *ctx,const void *data,size_t count)
 	{
-	HMAC_PKEY_CTX *hctx = ctx->pctx->data;
-	HMAC_Update(&hctx->ctx, data, count);
+	HMAC_PKEY_CTX *hctx = (HMAC_PKEY_CTX *)ctx->pctx->data;
+	HMAC_Update(&hctx->ctx, (const unsigned char *)data, count);
 	return 1;
 	}
 
 static int hmac_signctx_init(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)
 	{
-	HMAC_PKEY_CTX *hctx = ctx->data;
+	HMAC_PKEY_CTX *hctx = (HMAC_PKEY_CTX *)ctx->data;
 	HMAC_CTX_set_flags(&hctx->ctx, mctx->flags & ~EVP_MD_CTX_FLAG_NO_INIT);
 	EVP_MD_CTX_set_flags(mctx, EVP_MD_CTX_FLAG_NO_INIT);
 	mctx->update = int_update;
@@ -158,7 +162,7 @@
 					EVP_MD_CTX *mctx)
 	{
 	unsigned int hlen;
-	HMAC_PKEY_CTX *hctx = ctx->data;
+	HMAC_PKEY_CTX *hctx = (HMAC_PKEY_CTX *)ctx->data;
 	int l = EVP_MD_CTX_size(mctx);
 
 	if (l < 0)
@@ -174,7 +178,7 @@
 
 static int pkey_hmac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
 	{
-	HMAC_PKEY_CTX *hctx = ctx->data;
+	HMAC_PKEY_CTX *hctx = (HMAC_PKEY_CTX *)ctx->data;
 	ASN1_OCTET_STRING *key;
 	switch (type)
 		{
@@ -182,12 +186,12 @@
 		case EVP_PKEY_CTRL_SET_MAC_KEY:
 		if ((!p2 && p1 > 0) || (p1 < -1))
 			return 0;
-		if (!ASN1_OCTET_STRING_set(&hctx->ktmp, p2, p1))
+		if (!ASN1_OCTET_STRING_set(&hctx->ktmp, (const unsigned char *)p2, p1))
 			return 0;
 		break;
 
 		case EVP_PKEY_CTRL_MD:
-		hctx->md = p2;
+		hctx->md = (const EVP_MD *)p2;
 		break;
 
 		case EVP_PKEY_CTRL_DIGESTINIT:
@@ -231,8 +235,7 @@
 	return -2;
 	}
 
-const EVP_PKEY_METHOD hmac_pkey_meth = 
-	{
+CONST_EVP_PKEY_METHOD_ITEM(hm_pmeth__hmac_pkey_meth,
 	EVP_PKEY_HMAC,
 	0,
 	pkey_hmac_init,
@@ -264,4 +267,4 @@
 	pkey_hmac_ctrl,
 	pkey_hmac_ctrl_str
 
-	};
+	);
diff -Naur openssl-1.0.0q.orig/crypto/hmac/hmac.c openssl-1.0.0q/crypto/hmac/hmac.c
--- openssl-1.0.0q.orig/crypto/hmac/hmac.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/hmac/hmac.c	2017-04-25 16:23:40.436619735 +0200
@@ -55,17 +55,23 @@
  * copied and put under another distribution licence
  * [including the GNU Public Licence.]
  */
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/hmac.h>
+#include "modules/libopeay/libopeay_implmodule.h"
+
 
 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
 		  const EVP_MD *md, ENGINE *impl)
 	{
 	int i,j,reset=0;
-	unsigned char pad[HMAC_MAX_MD_CBLOCK];
+	unsigned char pad[HMAC_MAX_MD_CBLOCK]; /* ARRAY OK 2004-02-18 yngve */
 
 	if (md != NULL)
 		{
@@ -93,11 +99,11 @@
 		else
 			{
 			OPENSSL_assert(len>=0 && len<=(int)sizeof(ctx->key));
-			memcpy(ctx->key,key,len);
+			op_memcpy(ctx->key,key,len);
 			ctx->key_length=len;
 			}
 		if(ctx->key_length != HMAC_MAX_MD_CBLOCK)
-			memset(&ctx->key[ctx->key_length], 0,
+			op_memset(&ctx->key[ctx->key_length], 0,
 				HMAC_MAX_MD_CBLOCK - ctx->key_length);
 		}
 
@@ -139,7 +145,7 @@
 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len)
 	{
 	unsigned int i;
-	unsigned char buf[EVP_MAX_MD_SIZE];
+	unsigned char buf[EVP_MAX_MD_SIZE]; /* ARRAY OK 2004-02-18 yngve */
 
 	if (!EVP_DigestFinal_ex(&ctx->md_ctx,buf,&i))
 		goto err;
@@ -169,7 +175,7 @@
 		goto err;
 	if (!EVP_MD_CTX_copy(&dctx->md_ctx, &sctx->md_ctx))
 		goto err;
-	memcpy(dctx->key, sctx->key, HMAC_MAX_MD_CBLOCK);
+	op_memcpy(dctx->key, sctx->key, HMAC_MAX_MD_CBLOCK);
 	dctx->key_length = sctx->key_length;
 	dctx->md = sctx->md;
 	return 1;
@@ -182,15 +188,22 @@
 	EVP_MD_CTX_cleanup(&ctx->i_ctx);
 	EVP_MD_CTX_cleanup(&ctx->o_ctx);
 	EVP_MD_CTX_cleanup(&ctx->md_ctx);
-	memset(ctx,0,sizeof *ctx);
+	op_memset(ctx,0,sizeof *ctx);
 	}
 
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(Libopeay_ImplementModuleData::hmac__m_t, hmac__m);
+#define m OPENSSL_GLOBAL_REF(hmac__m)
+#endif
+
 unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
 		    const unsigned char *d, size_t n, unsigned char *md,
 		    unsigned int *md_len)
 	{
 	HMAC_CTX c;
+#ifndef OPERA_SMALL_VERSION
 	static unsigned char m[EVP_MAX_MD_SIZE];
+#endif
 
 	if (md == NULL) md=m;
 	HMAC_CTX_init(&c);
diff -Naur openssl-1.0.0q.orig/crypto/hmac/hmac.h openssl-1.0.0q/crypto/hmac/hmac.h
--- openssl-1.0.0q.orig/crypto/hmac/hmac.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/hmac/hmac.h	2017-04-25 16:23:40.436619735 +0200
@@ -79,7 +79,7 @@
 	EVP_MD_CTX i_ctx;
 	EVP_MD_CTX o_ctx;
 	unsigned int key_length;
-	unsigned char key[HMAC_MAX_MD_CBLOCK];
+	unsigned char key[HMAC_MAX_MD_CBLOCK]; /* ARRAY OK 2009-05-25 yngve */
 	} HMAC_CTX;
 
 #define HMAC_size(e)	(EVP_MD_size((e)->md))
diff -Naur openssl-1.0.0q.orig/crypto/hmac/hmactest.c openssl-1.0.0q/crypto/hmac/hmactest.c
--- openssl-1.0.0q.orig/crypto/hmac/hmactest.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/hmac/hmactest.c	2017-04-25 16:23:40.437619303 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -147,7 +149,7 @@
 			test[i].data, test[i].data_len,
 			NULL,NULL));
 
-		if (strcmp(p,(char *)test[i].digest) != 0)
+		if (op_strcmp(p,(char *)test[i].digest) != 0)
 			{
 			printf("error calculating HMAC on %d entry'\n",i);
 			printf("got %s instead of %s\n",p,test[i].digest);
@@ -168,7 +170,7 @@
 	static char buf[80];
 
 	for (i=0; i<MD5_DIGEST_LENGTH; i++)
-		sprintf(&(buf[i*2]),"%02x",md[i]);
+		op_sprintf(&(buf[i*2]),"%02x",md[i]);
 	return(buf);
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/hmac/opera_hm_ameth.cpp openssl-1.0.0q/crypto/hmac/opera_hm_ameth.cpp
--- openssl-1.0.0q.orig/crypto/hmac/opera_hm_ameth.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/hmac/opera_hm_ameth.cpp	2017-04-25 16:23:40.438619151 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/hmac/hm_ameth.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/hmac/opera_hm_pmeth.cpp openssl-1.0.0q/crypto/hmac/opera_hm_pmeth.cpp
--- openssl-1.0.0q.orig/crypto/hmac/opera_hm_pmeth.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/hmac/opera_hm_pmeth.cpp	2017-04-25 16:23:40.438619151 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/hmac/hm_pmeth.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/hmac/opera_hmac.cpp openssl-1.0.0q/crypto/hmac/opera_hmac.cpp
--- openssl-1.0.0q.orig/crypto/hmac/opera_hmac.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/hmac/opera_hmac.cpp	2017-04-25 16:23:40.439619278 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/hmac/hmac.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/idea/.gitignore openssl-1.0.0q/crypto/idea/.gitignore
--- openssl-1.0.0q.orig/crypto/idea/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/idea/.gitignore	2017-04-25 16:23:40.439619278 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/idea/i_ecb.c openssl-1.0.0q/crypto/idea/i_ecb.c
--- openssl-1.0.0q.orig/crypto/idea/i_ecb.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/idea/i_ecb.c	2017-04-25 16:23:40.440619684 +0200
@@ -60,7 +60,9 @@
 #include "idea_lcl.h"
 #include <openssl/opensslv.h>
 
-const char IDEA_version[]="IDEA" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char IDEA_version[]="IDEA" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-26 haavardm */
+#endif
 
 const char *idea_options(void)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/idea/idea_spd.c openssl-1.0.0q/crypto/idea/idea_spd.c
--- openssl-1.0.0q.orig/crypto/idea/idea_spd.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/idea/idea_spd.c	2017-04-25 16:23:40.441619532 +0200
@@ -63,6 +63,7 @@
 #define TIMES
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 
 #include <openssl/e_os2.h>
@@ -98,6 +99,7 @@
 #include <limits.h>
 #include <sys/param.h>
 #endif
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/idea.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/idea/ideatest.c openssl-1.0.0q/crypto/idea/ideatest.c
--- openssl-1.0.0q.orig/crypto/idea/ideatest.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/idea/ideatest.c	2017-04-25 16:23:40.442619659 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -115,7 +117,7 @@
 
 	idea_set_encrypt_key(k,&key);
 	idea_ecb_encrypt(in,out,&key);
-	if (memcmp(out,c,8) != 0)
+	if (op_memcmp(out,c,8) != 0)
 		{
 		printf("ecb idea error encrypting\n");
 		printf("got     :");
@@ -131,7 +133,7 @@
 
 	idea_set_decrypt_key(&key,&dkey);
 	idea_ecb_encrypt(c,out,&dkey);
-	if (memcmp(out,in,8) != 0)
+	if (op_memcmp(out,in,8) != 0)
 		{
 		printf("ecb idea error decrypting\n");
 		printf("got     :");
@@ -147,12 +149,12 @@
 
 	if (err == 0) printf("ecb idea ok\n");
 
-	memcpy(iv,k,8);
+	op_memcpy(iv,k,8);
 	idea_cbc_encrypt((unsigned char *)text,out,strlen(text)+1,&key,iv,1);
-	memcpy(iv,k,8);
+	op_memcpy(iv,k,8);
 	idea_cbc_encrypt(out,out,8,&dkey,iv,0);
 	idea_cbc_encrypt(&(out[8]),&(out[8]),strlen(text)+1-8,&dkey,iv,0);
-	if (memcmp(text,out,strlen(text)+1) != 0)
+	if (op_memcmp(text,out,strlen(text)+1) != 0)
 		{
 		printf("cbc idea bad\n");
 		err=4;
@@ -183,28 +185,28 @@
 
         idea_set_encrypt_key(cfb_key,&eks);
         idea_set_decrypt_key(&eks,&dks);
-        memcpy(cfb_tmp,cfb_iv,8);
+        op_memcpy(cfb_tmp,cfb_iv,8);
         n=0;
         idea_cfb64_encrypt(plain,cfb_buf1,(long)12,&eks,
                 cfb_tmp,&n,IDEA_ENCRYPT);
         idea_cfb64_encrypt(&(plain[12]),&(cfb_buf1[12]),
                 (long)CFB_TEST_SIZE-12,&eks,
                 cfb_tmp,&n,IDEA_ENCRYPT);
-        if (memcmp(cfb_cipher,cfb_buf1,CFB_TEST_SIZE) != 0)
+        if (op_memcmp(cfb_cipher,cfb_buf1,CFB_TEST_SIZE) != 0)
                 {
                 err=1;
                 printf("idea_cfb64_encrypt encrypt error\n");
                 for (i=0; i<CFB_TEST_SIZE; i+=8)
                         printf("%s\n",pt(&(cfb_buf1[i])));
                 }
-        memcpy(cfb_tmp,cfb_iv,8);
+        op_memcpy(cfb_tmp,cfb_iv,8);
         n=0;
         idea_cfb64_encrypt(cfb_buf1,cfb_buf2,(long)13,&eks,
                 cfb_tmp,&n,IDEA_DECRYPT);
         idea_cfb64_encrypt(&(cfb_buf1[13]),&(cfb_buf2[13]),
                 (long)CFB_TEST_SIZE-13,&eks,
                 cfb_tmp,&n,IDEA_DECRYPT);
-        if (memcmp(plain,cfb_buf2,CFB_TEST_SIZE) != 0)
+        if (op_memcmp(plain,cfb_buf2,CFB_TEST_SIZE) != 0)
                 {
                 err=1;
                 printf("idea_cfb_encrypt decrypt error\n");
diff -Naur openssl-1.0.0q.orig/crypto/jpake/.gitignore openssl-1.0.0q/crypto/jpake/.gitignore
--- openssl-1.0.0q.orig/crypto/jpake/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/jpake/.gitignore	2017-04-25 16:23:40.443620066 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/krb5/.gitignore openssl-1.0.0q/crypto/krb5/.gitignore
--- openssl-1.0.0q.orig/crypto/krb5/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/krb5/.gitignore	2017-04-25 16:23:40.443620066 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/krb5/krb5_asn.c openssl-1.0.0q/crypto/krb5/krb5_asn.c
--- openssl-1.0.0q.orig/crypto/krb5/krb5_asn.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/krb5/krb5_asn.c	2017-04-25 16:23:40.443620066 +0200
@@ -60,35 +60,35 @@
 #include <openssl/krb5_asn.h>
 
 
-ASN1_SEQUENCE(KRB5_ENCDATA) = {
-	ASN1_EXP(KRB5_ENCDATA, etype,		ASN1_INTEGER,	  0),
-	ASN1_EXP_OPT(KRB5_ENCDATA, kvno,	ASN1_INTEGER,	  1),
+ASN1_SEQUENCE(KRB5_ENCDATA) 
+	ASN1_EXP(KRB5_ENCDATA, etype,		ASN1_INTEGER,	  0)
+	ASN1_EXP_OPT(KRB5_ENCDATA, kvno,	ASN1_INTEGER,	  1)
 	ASN1_EXP(KRB5_ENCDATA, cipher,		ASN1_OCTET_STRING,2)
-} ASN1_SEQUENCE_END(KRB5_ENCDATA)
+ASN1_SEQUENCE_END(KRB5_ENCDATA)
 
 IMPLEMENT_ASN1_FUNCTIONS(KRB5_ENCDATA)
 
 
-ASN1_SEQUENCE(KRB5_PRINCNAME) = {
-	ASN1_EXP(KRB5_PRINCNAME, nametype,	ASN1_INTEGER,	  0),
+ASN1_SEQUENCE(KRB5_PRINCNAME) 
+	ASN1_EXP(KRB5_PRINCNAME, nametype,	ASN1_INTEGER,	  0)
 	ASN1_EXP_SEQUENCE_OF(KRB5_PRINCNAME, namestring, ASN1_GENERALSTRING, 1)
-} ASN1_SEQUENCE_END(KRB5_PRINCNAME)
+ASN1_SEQUENCE_END(KRB5_PRINCNAME)
 
 IMPLEMENT_ASN1_FUNCTIONS(KRB5_PRINCNAME)
 
 
 /* [APPLICATION 1] = 0x61 */
-ASN1_SEQUENCE(KRB5_TKTBODY) = {
-	ASN1_EXP(KRB5_TKTBODY, tktvno,		ASN1_INTEGER,	  0),
-	ASN1_EXP(KRB5_TKTBODY, realm, 		ASN1_GENERALSTRING, 1),
-	ASN1_EXP(KRB5_TKTBODY, sname,		KRB5_PRINCNAME,	  2),
+ASN1_SEQUENCE(KRB5_TKTBODY) 
+	ASN1_EXP(KRB5_TKTBODY, tktvno,		ASN1_INTEGER,	  0)
+	ASN1_EXP(KRB5_TKTBODY, realm, 		ASN1_GENERALSTRING, 1)
+	ASN1_EXP(KRB5_TKTBODY, sname,		KRB5_PRINCNAME,	  2)
 	ASN1_EXP(KRB5_TKTBODY, encdata,		KRB5_ENCDATA,	  3)
-} ASN1_SEQUENCE_END(KRB5_TKTBODY)
+ASN1_SEQUENCE_END(KRB5_TKTBODY)
 
 IMPLEMENT_ASN1_FUNCTIONS(KRB5_TKTBODY)
 
 
-ASN1_ITEM_TEMPLATE(KRB5_TICKET) = 
+ASN1_ITEM_TEMPLATE(KRB5_TICKET)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_EXPTAG|ASN1_TFLG_APPLICATION, 1,
 			KRB5_TICKET, KRB5_TKTBODY)
 ASN1_ITEM_TEMPLATE_END(KRB5_TICKET)
@@ -97,17 +97,17 @@
 
 
 /* [APPLICATION 14] = 0x6e */
-ASN1_SEQUENCE(KRB5_APREQBODY) = {
-	ASN1_EXP(KRB5_APREQBODY, pvno,		ASN1_INTEGER,	  0),
-	ASN1_EXP(KRB5_APREQBODY, msgtype,	ASN1_INTEGER,	  1),
-	ASN1_EXP(KRB5_APREQBODY, apoptions,	ASN1_BIT_STRING,  2),
-	ASN1_EXP(KRB5_APREQBODY, ticket, 	KRB5_TICKET,	  3),
-	ASN1_EXP(KRB5_APREQBODY, authenticator,	KRB5_ENCDATA,	  4),
-} ASN1_SEQUENCE_END(KRB5_APREQBODY)
+ASN1_SEQUENCE(KRB5_APREQBODY) 
+	ASN1_EXP(KRB5_APREQBODY, pvno,		ASN1_INTEGER,	  0)
+	ASN1_EXP(KRB5_APREQBODY, msgtype,	ASN1_INTEGER,	  1)
+	ASN1_EXP(KRB5_APREQBODY, apoptions,	ASN1_BIT_STRING,  2)
+	ASN1_EXP(KRB5_APREQBODY, ticket, 	KRB5_TICKET,	  3)
+	ASN1_EXP(KRB5_APREQBODY, authenticator,	KRB5_ENCDATA,	  4)
+ASN1_SEQUENCE_END(KRB5_APREQBODY)
 
 IMPLEMENT_ASN1_FUNCTIONS(KRB5_APREQBODY)
 
-ASN1_ITEM_TEMPLATE(KRB5_APREQ) = 
+ASN1_ITEM_TEMPLATE(KRB5_APREQ)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_EXPTAG|ASN1_TFLG_APPLICATION, 14,
 			KRB5_APREQ, KRB5_APREQBODY)
 ASN1_ITEM_TEMPLATE_END(KRB5_APREQ)
@@ -117,48 +117,48 @@
 
 /*  Authenticator stuff 	*/
 
-ASN1_SEQUENCE(KRB5_CHECKSUM) = {
-	ASN1_EXP(KRB5_CHECKSUM, ctype,		ASN1_INTEGER,	  0),
+ASN1_SEQUENCE(KRB5_CHECKSUM) 
+	ASN1_EXP(KRB5_CHECKSUM, ctype,		ASN1_INTEGER,	  0)
 	ASN1_EXP(KRB5_CHECKSUM, checksum,	ASN1_OCTET_STRING,1)
-} ASN1_SEQUENCE_END(KRB5_CHECKSUM)
+ASN1_SEQUENCE_END(KRB5_CHECKSUM)
 
 IMPLEMENT_ASN1_FUNCTIONS(KRB5_CHECKSUM)
 
 
-ASN1_SEQUENCE(KRB5_ENCKEY) = {
-	ASN1_EXP(KRB5_ENCKEY,	ktype,		ASN1_INTEGER,	  0),
+ASN1_SEQUENCE(KRB5_ENCKEY) 
+	ASN1_EXP(KRB5_ENCKEY,	ktype,		ASN1_INTEGER,	  0)
 	ASN1_EXP(KRB5_ENCKEY,	keyvalue,	ASN1_OCTET_STRING,1)
-} ASN1_SEQUENCE_END(KRB5_ENCKEY)
+ASN1_SEQUENCE_END(KRB5_ENCKEY)
 
 IMPLEMENT_ASN1_FUNCTIONS(KRB5_ENCKEY)
 
 
 /* SEQ OF SEQ; see ASN1_EXP_SEQUENCE_OF_OPT() below */
-ASN1_SEQUENCE(KRB5_AUTHDATA) = {
-	ASN1_EXP(KRB5_AUTHDATA,	adtype,		ASN1_INTEGER,	  0),
+ASN1_SEQUENCE(KRB5_AUTHDATA) 
+	ASN1_EXP(KRB5_AUTHDATA,	adtype,		ASN1_INTEGER,	  0)
 	ASN1_EXP(KRB5_AUTHDATA,	addata, 	ASN1_OCTET_STRING,1)
-} ASN1_SEQUENCE_END(KRB5_AUTHDATA)
+ASN1_SEQUENCE_END(KRB5_AUTHDATA)
 
 IMPLEMENT_ASN1_FUNCTIONS(KRB5_AUTHDATA)
 
 
 /* [APPLICATION 2] = 0x62 */
-ASN1_SEQUENCE(KRB5_AUTHENTBODY) = {
-	ASN1_EXP(KRB5_AUTHENTBODY,	avno,	ASN1_INTEGER,	  0),
-	ASN1_EXP(KRB5_AUTHENTBODY,	crealm,	ASN1_GENERALSTRING, 1),
-	ASN1_EXP(KRB5_AUTHENTBODY,	cname,	KRB5_PRINCNAME,	  2),
-	ASN1_EXP_OPT(KRB5_AUTHENTBODY,	cksum,	KRB5_CHECKSUM,	  3),
-	ASN1_EXP(KRB5_AUTHENTBODY,	cusec,	ASN1_INTEGER,	  4),
-	ASN1_EXP(KRB5_AUTHENTBODY,	ctime,	ASN1_GENERALIZEDTIME, 5),
-	ASN1_EXP_OPT(KRB5_AUTHENTBODY,	subkey,	KRB5_ENCKEY,	  6),
-	ASN1_EXP_OPT(KRB5_AUTHENTBODY,	seqnum,	ASN1_INTEGER,	  7),
+ASN1_SEQUENCE(KRB5_AUTHENTBODY) 
+	ASN1_EXP(KRB5_AUTHENTBODY,	avno,	ASN1_INTEGER,	  0)
+	ASN1_EXP(KRB5_AUTHENTBODY,	crealm,	ASN1_GENERALSTRING, 1)
+	ASN1_EXP(KRB5_AUTHENTBODY,	cname,	KRB5_PRINCNAME,	  2)
+	ASN1_EXP_OPT(KRB5_AUTHENTBODY,	cksum,	KRB5_CHECKSUM,	  3)
+	ASN1_EXP(KRB5_AUTHENTBODY,	cusec,	ASN1_INTEGER,	  4)
+	ASN1_EXP(KRB5_AUTHENTBODY,	ctime,	ASN1_GENERALIZEDTIME, 5)
+	ASN1_EXP_OPT(KRB5_AUTHENTBODY,	subkey,	KRB5_ENCKEY,	  6)
+	ASN1_EXP_OPT(KRB5_AUTHENTBODY,	seqnum,	ASN1_INTEGER,	  7)
 	ASN1_EXP_SEQUENCE_OF_OPT
-		    (KRB5_AUTHENTBODY,	authorization,	KRB5_AUTHDATA, 8),
-} ASN1_SEQUENCE_END(KRB5_AUTHENTBODY)
+		    (KRB5_AUTHENTBODY,	authorization,	KRB5_AUTHDATA, 8)
+ASN1_SEQUENCE_END(KRB5_AUTHENTBODY)
 
 IMPLEMENT_ASN1_FUNCTIONS(KRB5_AUTHENTBODY)
 
-ASN1_ITEM_TEMPLATE(KRB5_AUTHENT) = 
+ASN1_ITEM_TEMPLATE(KRB5_AUTHENT)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_EXPTAG|ASN1_TFLG_APPLICATION, 2,
 			KRB5_AUTHENT, KRB5_AUTHENTBODY)
 ASN1_ITEM_TEMPLATE_END(KRB5_AUTHENT)
diff -Naur openssl-1.0.0q.orig/crypto/lhash/.gitignore openssl-1.0.0q/crypto/lhash/.gitignore
--- openssl-1.0.0q.orig/crypto/lhash/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/lhash/.gitignore	2017-04-25 16:23:40.444620193 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/lhash/lh_stats.c openssl-1.0.0q/crypto/lhash/lh_stats.c
--- openssl-1.0.0q.orig/crypto/lhash/lh_stats.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/lhash/lh_stats.c	2017-04-25 16:23:40.445620041 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 /* If you wish to build this outside of SSLeay, remove the following lines
  * and things should work as expected */
 #include "cryptlib.h"
diff -Naur openssl-1.0.0q.orig/crypto/lhash/lh_test.c openssl-1.0.0q/crypto/lhash/lh_test.c
--- openssl-1.0.0q.orig/crypto/lhash/lh_test.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/lhash/lh_test.c	2017-04-25 16:23:40.446620447 +0200
@@ -56,9 +56,14 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/lhash.h>
 
 main()
@@ -75,9 +80,9 @@
 		buf[0]='\0';
 		fgets(buf,256,stdin);
 		if (buf[0] == '\0') break;
-		i=strlen(buf);
+		i=op_strlen(buf);
 		p=OPENSSL_malloc(i+1);
-		memcpy(p,buf,i+1);
+		op_memcpy(p,buf,i+1);
 		lh_insert(conf,p);
 		}
 
diff -Naur openssl-1.0.0q.orig/crypto/lhash/lhash.c openssl-1.0.0q/crypto/lhash/lhash.c
--- openssl-1.0.0q.orig/crypto/lhash/lhash.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/lhash/lhash.c	2017-04-25 16:23:40.447620295 +0200
@@ -71,7 +71,7 @@
  *	     skipping the lh_doall() processing. eay - 4/12/95
  *
  * 1.9 eay - Fixed a memory leak in lh_free, the LHASH_NODEs
- *	     were not being free()ed. 21/11/95
+ *	     were not being op_free()ed. 21/11/95
  *
  * 1.8 eay - Put the stats routines into a separate file, lh_stats.c
  *	     19/09/95
@@ -94,13 +94,17 @@
  *
  * 1.0 eay - First version
  */
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <openssl/crypto.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 
-const char lh_version[]="lhash" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char lh_version[]="lhash" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-26 haavardm */
+#endif
 
 #undef MIN_NODES 
 #define MIN_NODES	16
@@ -116,13 +120,13 @@
 	_LHASH *ret;
 	int i;
 
-	if ((ret=OPENSSL_malloc(sizeof(_LHASH))) == NULL)
+	if ((ret=(_LHASH *)OPENSSL_malloc(sizeof(_LHASH))) == NULL)
 		goto err0;
-	if ((ret->b=OPENSSL_malloc(sizeof(LHASH_NODE *)*MIN_NODES)) == NULL)
+	if ((ret->b=(LHASH_NODE **)OPENSSL_malloc(sizeof(LHASH_NODE *)*MIN_NODES)) == NULL)
 		goto err1;
 	for (i=0; i<MIN_NODES; i++)
 		ret->b[i]=NULL;
-	ret->comp=((c == NULL)?(LHASH_COMP_FN_TYPE)strcmp:c);
+	ret->comp=((c == NULL)?(LHASH_COMP_FN_TYPE)op_strcmp:c);
 	ret->hash=((h == NULL)?(LHASH_HASH_FN_TYPE)lh_strhash:h);
 	ret->num_nodes=MIN_NODES/2;
 	ret->num_alloc_nodes=MIN_NODES;
@@ -450,7 +454,7 @@
 	if ((c == NULL) || (*c == '\0'))
 		return(ret);
 /*
-	unsigned char b[16];
+	unsigned char b[16];  // ARRAY OK 2007-11-07 yngve UNUSED
 	MD5(c,strlen(c),b);
 	return(b[0]|(b[1]<<8)|(b[2]<<16)|(b[3]<<24)); 
 */
diff -Naur openssl-1.0.0q.orig/crypto/lhash/lhash.h openssl-1.0.0q/crypto/lhash/lhash.h
--- openssl-1.0.0q.orig/crypto/lhash/lhash.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/lhash/lhash.h	2017-04-25 16:23:40.447620295 +0200
@@ -65,7 +65,9 @@
 
 #include <openssl/e_os2.h>
 #ifndef OPENSSL_NO_FP_API
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #ifndef OPENSSL_NO_BIO
@@ -102,7 +104,7 @@
 	unsigned long name##_LHASH_HASH(const void *);
 #define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
 	unsigned long name##_LHASH_HASH(const void *arg) { \
-		const o_type *a = arg; \
+		const o_type *a = (const o_type *) arg; \
 		return name##_hash(a); }
 #define LHASH_HASH_FN(name) name##_LHASH_HASH
 
@@ -111,8 +113,8 @@
 	int name##_LHASH_COMP(const void *, const void *);
 #define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
 	int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
-		const o_type *a = arg1;		    \
-		const o_type *b = arg2; \
+		const o_type *a = (const o_type *) arg1;		    \
+		const o_type *b = (const o_type *) arg2; \
 		return name##_cmp(a,b); }
 #define LHASH_COMP_FN(name) name##_LHASH_COMP
 
@@ -121,7 +123,7 @@
 	void name##_LHASH_DOALL(void *);
 #define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \
 	void name##_LHASH_DOALL(void *arg) { \
-		o_type *a = arg; \
+		o_type *a = (o_type *) arg; \
 		name##_doall(a); }
 #define LHASH_DOALL_FN(name) name##_LHASH_DOALL
 
@@ -130,8 +132,8 @@
 	void name##_LHASH_DOALL_ARG(void *, void *);
 #define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
 	void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
-		o_type *a = arg1; \
-		a_type *b = arg2; \
+		o_type *a = (o_type *) arg1; \
+		a_type *b = (a_type *) arg2; \
 		name##_doall_arg(a, b); }
 #define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
 
@@ -168,7 +170,7 @@
 
 #define LH_LOAD_MULT	256
 
-/* Indicates a malloc() error in the last call, this is only bad
+/* Indicates a op_malloc() error in the last call, this is only bad
  * in lh_insert(). */
 #define lh_error(lh)	((lh)->error)
 
diff -Naur openssl-1.0.0q.orig/crypto/lhash/opera_lhash.cpp openssl-1.0.0q/crypto/lhash/opera_lhash.cpp
--- openssl-1.0.0q.orig/crypto/lhash/opera_lhash.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/lhash/opera_lhash.cpp	2017-04-25 16:23:40.448620701 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/lhash/lhash.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/md2/.gitignore openssl-1.0.0q/crypto/md2/.gitignore
--- openssl-1.0.0q.orig/crypto/md2/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/md2/.gitignore	2017-04-25 16:23:40.448620701 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/md2/md2.c openssl-1.0.0q/crypto/md2/md2.c
--- openssl-1.0.0q.orig/crypto/md2/md2.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/md2/md2.c	2017-04-25 16:23:40.449619990 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/md2.h>
 
 #define BUFSIZE	1024*16
diff -Naur openssl-1.0.0q.orig/crypto/md2/md2.h openssl-1.0.0q/crypto/md2/md2.h
--- openssl-1.0.0q.orig/crypto/md2/md2.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/md2/md2.h	2017-04-25 16:23:40.450620676 +0200
@@ -75,9 +75,9 @@
 typedef struct MD2state_st
 	{
 	unsigned int num;
-	unsigned char data[MD2_BLOCK];
-	MD2_INT cksm[MD2_BLOCK];
-	MD2_INT state[MD2_BLOCK];
+	unsigned char data[MD2_BLOCK]; /* ARRAY OK 2004-02-18 yngve */
+	MD2_INT cksm[MD2_BLOCK]; /* ARRAY OK 2004-02-18 yngve */
+	MD2_INT state[MD2_BLOCK]; /* ARRAY OK 2004-02-18 yngve */
 	} MD2_CTX;
 
 const char *MD2_options(void);
diff -Naur openssl-1.0.0q.orig/crypto/md2/md2_dgst.c openssl-1.0.0q/crypto/md2/md2_dgst.c
--- openssl-1.0.0q.orig/crypto/md2/md2_dgst.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/md2/md2_dgst.c	2017-04-25 16:23:40.451620245 +0200
@@ -56,14 +56,20 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPENSSL_NO_MD2
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/md2.h>
 #include <openssl/opensslv.h>
 #include <openssl/crypto.h>
 
-const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-26 haavardm */
+#endif
 
 /* Implemented from RFC1319 The MD2 Message-Digest Algorithm
  */
@@ -108,6 +114,7 @@
 	0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14,
 	};
 
+#ifndef OPERA_SMALL_VERSION
 const char *MD2_options(void)
 	{
 	if (sizeof(MD2_INT) == 1)
@@ -115,13 +122,14 @@
 	else
 		return("md2(int)");
 	}
+#endif
 
 int MD2_Init(MD2_CTX *c)
 	{
 	c->num=0;
-	memset(c->state,0,sizeof c->state);
-	memset(c->cksm,0,sizeof c->cksm);
-	memset(c->data,0,sizeof c->data);
+	op_memset(c->state,0,sizeof c->state);
+	op_memset(c->cksm,0,sizeof c->cksm);
+	op_memset(c->data,0,sizeof c->data);
 	return 1;
 	}
 
@@ -136,7 +144,7 @@
 		{
 		if ((c->num+len) >= MD2_BLOCK)
 			{
-			memcpy(&(p[c->num]),data,MD2_BLOCK-c->num);
+			op_memcpy(&(p[c->num]),data,MD2_BLOCK-c->num);
 			md2_block(c,c->data);
 			data+=(MD2_BLOCK - c->num);
 			len-=(MD2_BLOCK - c->num);
@@ -145,7 +153,7 @@
 			}
 		else
 			{
-			memcpy(&(p[c->num]),data,len);
+			op_memcpy(&(p[c->num]),data,len);
 			/* data+=len; */
 			c->num+=(int)len;
 			return 1;
@@ -159,7 +167,7 @@
 		data+=MD2_BLOCK;
 		len-=MD2_BLOCK;
 		}
-	memcpy(p,data,len);
+	op_memcpy(p,data,len);
 	c->num=(int)len;
 	return 1;
 	}
@@ -196,7 +204,7 @@
 			}
 		t=(t+i)&0xff;
 		}
-	memcpy(sp1,state,16*sizeof(MD2_INT));
+	op_memcpy(sp1,state,16*sizeof(MD2_INT));
 	OPENSSL_cleanse(state,48*sizeof(MD2_INT));
 	}
 
@@ -221,7 +229,8 @@
 
 	for (i=0; i<16; i++)
 		md[i]=(UCHAR)(p1[i]&0xff);
-	memset((char *)&c,0,sizeof(c));
+	op_memset((char *)&c,0,sizeof(c));
 	return 1;
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/md2/md2_one.c openssl-1.0.0q/crypto/md2/md2_one.c
--- openssl-1.0.0q.orig/crypto/md2/md2_one.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/md2/md2_one.c	2017-04-25 16:23:40.452619813 +0200
@@ -56,7 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/md2.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/md2/md2test.c openssl-1.0.0q/crypto/md2/md2test.c
--- openssl-1.0.0q.orig/crypto/md2/md2test.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/md2/md2test.c	2017-04-25 16:23:40.453619940 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -112,7 +114,7 @@
 		{
 		EVP_Digest((unsigned char *)*P,strlen(*P),md,NULL,EVP_md2(), NULL);
 		p=pt(md);
-		if (strcmp(p,*R) != 0)
+		if (op_strcmp(p,*R) != 0)
 			{
 			printf("error calculating MD2 on '%s'\n",*P);
 			printf("got %s instead of %s\n",p,*R);
@@ -137,7 +139,7 @@
 	static char buf[80];
 
 	for (i=0; i<MD2_DIGEST_LENGTH; i++)
-		sprintf(&(buf[i*2]),"%02x",md[i]);
+		op_sprintf(&(buf[i*2]),"%02x",md[i]);
 	return(buf);
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/md32_common.h openssl-1.0.0q/crypto/md32_common.h
--- openssl-1.0.0q.orig/crypto/md32_common.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/md32_common.h	2017-04-25 16:23:40.454620067 +0200
@@ -142,7 +142,7 @@
  */
 #undef ROTATE
 #ifndef PEDANTIC
-# if defined(_MSC_VER) || defined(__ICC)
+# if 0 /* defined(_MSC_VER) || defined(__ICC) */
 #  define ROTATE(a,n)	_lrotl(a,n)
 # elif defined(__MWERKS__)
 #  if defined(__POWERPC__)
@@ -153,7 +153,7 @@
 #  else
 #   define ROTATE(a,n)	__rol(a,n)
 #  endif
-# elif defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+# elif defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(__llvm__)
   /*
    * Some GNU C inline assembler templates. Note that these are
    * rotates by *constant* number of bits! But that's exactly
@@ -281,7 +281,7 @@
 
 int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len)
 	{
-	const unsigned char *data=data_;
+	const unsigned char *data=(const unsigned char *)data_;
 	unsigned char *p;
 	HASH_LONG l;
 	size_t n;
@@ -303,17 +303,17 @@
 
 		if (len >= HASH_CBLOCK || len+n >= HASH_CBLOCK)
 			{
-			memcpy (p+n,data,HASH_CBLOCK-n);
+			op_memcpy (p+n,data,HASH_CBLOCK-n);
 			HASH_BLOCK_DATA_ORDER (c,p,1);
 			n      = HASH_CBLOCK-n;
 			data  += n;
 			len   -= n;
 			c->num = 0;
-			memset (p,0,HASH_CBLOCK);	/* keep it zeroed */
+			op_memset (p,0,HASH_CBLOCK);	/* keep it zeroed */
 			}
 		else
 			{
-			memcpy (p+n,data,len);
+			op_memcpy (p+n,data,len);
 			c->num += (unsigned int)len;
 			return 1;
 			}
@@ -332,16 +332,18 @@
 		{
 		p = (unsigned char *)c->data;
 		c->num = (unsigned int)len;
-		memcpy (p,data,len);
+		op_memcpy (p,data,len);
 		}
 	return 1;
 	}
 
 
+#ifndef OPERA_SMALL_VERSION
 void HASH_TRANSFORM (HASH_CTX *c, const unsigned char *data)
 	{
 	HASH_BLOCK_DATA_ORDER (c,data,1);
 	}
+#endif
 
 
 int HASH_FINAL (unsigned char *md, HASH_CTX *c)
@@ -354,11 +356,11 @@
 
 	if (n > (HASH_CBLOCK-8))
 		{
-		memset (p+n,0,HASH_CBLOCK-n);
+		op_memset (p+n,0,HASH_CBLOCK-n);
 		n=0;
 		HASH_BLOCK_DATA_ORDER (c,p,1);
 		}
-	memset (p+n,0,HASH_CBLOCK-8-n);
+	op_memset (p+n,0,HASH_CBLOCK-8-n);
 
 	p += HASH_CBLOCK-8;
 #if   defined(DATA_ORDER_IS_BIG_ENDIAN)
@@ -371,7 +373,7 @@
 	p -= HASH_CBLOCK;
 	HASH_BLOCK_DATA_ORDER (c,p,1);
 	c->num=0;
-	memset (p,0,HASH_CBLOCK);
+	op_memset (p,0,HASH_CBLOCK);
 
 #ifndef HASH_MAKE_STRING
 #error "HASH_MAKE_STRING must be defined!"
diff -Naur openssl-1.0.0q.orig/crypto/md4/.gitignore openssl-1.0.0q/crypto/md4/.gitignore
--- openssl-1.0.0q.orig/crypto/md4/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/md4/.gitignore	2017-04-25 16:23:40.454620067 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/md4/md4.c openssl-1.0.0q/crypto/md4/md4.c
--- openssl-1.0.0q.orig/crypto/md4/md4.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/md4/md4.c	2017-04-25 16:23:40.455619915 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/md4.h>
 
 #define BUFSIZE	1024*16
diff -Naur openssl-1.0.0q.orig/crypto/md4/md4_dgst.c openssl-1.0.0q/crypto/md4/md4_dgst.c
--- openssl-1.0.0q.orig/crypto/md4/md4_dgst.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/md4/md4_dgst.c	2017-04-25 16:23:40.456619763 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "md4_locl.h"
 #include <openssl/opensslv.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/md4/md4_locl.h openssl-1.0.0q/crypto/md4/md4_locl.h
--- openssl-1.0.0q.orig/crypto/md4/md4_locl.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/md4/md4_locl.h	2017-04-25 16:23:40.456619763 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/opensslconf.h>
 #include <openssl/md4.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/md4/md4_one.c openssl-1.0.0q/crypto/md4/md4_one.c
--- openssl-1.0.0q.orig/crypto/md4/md4_one.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/md4/md4_one.c	2017-04-25 16:23:40.457619890 +0200
@@ -56,8 +56,13 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/md4.h>
 #include <openssl/crypto.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/md4/md4s.cpp openssl-1.0.0q/crypto/md4/md4s.cpp
--- openssl-1.0.0q.orig/crypto/md4/md4s.cpp	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/md4/md4s.cpp	2017-04-25 16:23:40.458620017 +0200
@@ -30,8 +30,10 @@
 }
 #endif      
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif // !OPERA_SMALL_VERSION
 #include <openssl/md4.h>
 
 extern "C" {
@@ -50,7 +52,7 @@
 	int j=0;
 
 	if (argc >= 2)
-		num=atoi(argv[1]);
+		num=op_atoi(argv[1]);
 
 	if (num == 0) num=16;
 	if (num > 250) num=16;
diff -Naur openssl-1.0.0q.orig/crypto/md4/md4test.c openssl-1.0.0q/crypto/md4/md4test.c
--- openssl-1.0.0q.orig/crypto/md4/md4test.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/md4/md4test.c	2017-04-25 16:23:40.458620017 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -108,7 +110,7 @@
 		{
 		EVP_Digest(&(P[0][0]),strlen((char *)*P),md,NULL,EVP_md4(), NULL);
 		p=pt(md);
-		if (strcmp(p,(char *)*R) != 0)
+		if (op_strcmp(p,(char *)*R) != 0)
 			{
 			printf("error calculating MD4 on '%s'\n",*P);
 			printf("got %s instead of %s\n",p,*R);
@@ -130,7 +132,7 @@
 	static char buf[80];
 
 	for (i=0; i<MD4_DIGEST_LENGTH; i++)
-		sprintf(&(buf[i*2]),"%02x",md[i]);
+		op_sprintf(&(buf[i*2]),"%02x",md[i]);
 	return(buf);
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/md5/.gitignore openssl-1.0.0q/crypto/md5/.gitignore
--- openssl-1.0.0q.orig/crypto/md5/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/md5/.gitignore	2017-04-25 16:23:40.459619865 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/md5/md5.c openssl-1.0.0q/crypto/md5/md5.c
--- openssl-1.0.0q.orig/crypto/md5/md5.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/md5/md5.c	2017-04-25 16:23:40.460619712 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/md5.h>
 
 #define BUFSIZE	1024*16
diff -Naur openssl-1.0.0q.orig/crypto/md5/md5_dgst.c openssl-1.0.0q/crypto/md5/md5_dgst.c
--- openssl-1.0.0q.orig/crypto/md5/md5_dgst.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/md5/md5_dgst.c	2017-04-25 16:23:40.461620119 +0200
@@ -56,11 +56,15 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "md5_locl.h"
 #include <openssl/opensslv.h>
 
-const char MD5_version[]="MD5" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char MD5_version[]="MD5" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-26 haavardm */
+#endif
 
 /* Implemented from RFC1321 The MD5 Message-Digest Algorithm
  */
@@ -72,7 +76,7 @@
 
 int MD5_Init(MD5_CTX *c)
 	{
-	memset (c,0,sizeof(*c));
+	op_memset (c,0,sizeof(*c));
 	c->A=INIT_DATA_A;
 	c->B=INIT_DATA_B;
 	c->C=INIT_DATA_C;
@@ -86,7 +90,7 @@
 #endif
 void md5_block_data_order (MD5_CTX *c, const void *data_, size_t num)
 	{
-	const unsigned char *data=data_;
+	const unsigned char *data=(const unsigned char *)data_;
 	register unsigned MD32_REG_T A,B,C,D,l;
 #ifndef MD32_XARRAY
 	/* See comment in crypto/sha/sha_locl.h for details. */
diff -Naur openssl-1.0.0q.orig/crypto/md5/md5_locl.h openssl-1.0.0q/crypto/md5/md5_locl.h
--- openssl-1.0.0q.orig/crypto/md5/md5_locl.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/md5/md5_locl.h	2017-04-25 16:23:40.461620119 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/e_os2.h>
 #include <openssl/md5.h>
 
@@ -93,7 +95,7 @@
 	} while (0)
 #define	HASH_BLOCK_DATA_ORDER	md5_block_data_order
 
-#include "md32_common.h"
+#include <openssl/md32_common.h>
 
 /*
 #define	F(x,y,z)	(((x) & (y))  |  ((~(x)) & (z)))
diff -Naur openssl-1.0.0q.orig/crypto/md5/md5_one.c openssl-1.0.0q/crypto/md5/md5_one.c
--- openssl-1.0.0q.orig/crypto/md5/md5_one.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/md5/md5_one.c	2017-04-25 16:23:40.462619687 +0200
@@ -56,8 +56,13 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/md5.h>
 #include <openssl/crypto.h>
 
@@ -68,7 +73,12 @@
 unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md)
 	{
 	MD5_CTX c;
+#ifdef _NO_GLOBALS_
+extern unsigned char *g_md5_m_addr();
+#define m g_md5_m_addr()
+#else
 	static unsigned char m[MD5_DIGEST_LENGTH];
+#endif
 
 	if (md == NULL) md=m;
 	if (!MD5_Init(&c))
diff -Naur openssl-1.0.0q.orig/crypto/md5/md5s.cpp openssl-1.0.0q/crypto/md5/md5s.cpp
--- openssl-1.0.0q.orig/crypto/md5/md5s.cpp	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/md5/md5s.cpp	2017-04-25 16:23:40.463620373 +0200
@@ -30,8 +30,10 @@
 }
 #endif      
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif // !OPERA_SMALL_VERSION
 #include <openssl/md5.h>
 
 extern "C" {
@@ -50,7 +52,7 @@
 	int j=0;
 
 	if (argc >= 2)
-		num=atoi(argv[1]);
+		num=op_atoi(argv[1]);
 
 	if (num == 0) num=16;
 	if (num > 250) num=16;
diff -Naur openssl-1.0.0q.orig/crypto/md5/md5test.c openssl-1.0.0q/crypto/md5/md5test.c
--- openssl-1.0.0q.orig/crypto/md5/md5test.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/md5/md5test.c	2017-04-25 16:23:40.464619662 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -108,7 +110,7 @@
 		{
 		EVP_Digest(&(P[0][0]),strlen((char *)*P),md,NULL,EVP_md5(), NULL);
 		p=pt(md);
-		if (strcmp(p,(char *)*R) != 0)
+		if (op_strcmp(p,(char *)*R) != 0)
 			{
 			printf("error calculating MD5 on '%s'\n",*P);
 			printf("got %s instead of %s\n",p,*R);
@@ -134,7 +136,7 @@
 	static char buf[80];
 
 	for (i=0; i<MD5_DIGEST_LENGTH; i++)
-		sprintf(&(buf[i*2]),"%02x",md[i]);
+		op_sprintf(&(buf[i*2]),"%02x",md[i]);
 	return(buf);
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/md5/opera_md5_dgst.cpp openssl-1.0.0q/crypto/md5/opera_md5_dgst.cpp
--- openssl-1.0.0q.orig/crypto/md5/opera_md5_dgst.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/md5/opera_md5_dgst.cpp	2017-04-25 16:23:40.465619789 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_HASH_MD5_SUPPORT)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/md5/md5_dgst.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_HASH_MD5_SUPPORT)
diff -Naur openssl-1.0.0q.orig/crypto/mdc2/.gitignore openssl-1.0.0q/crypto/mdc2/.gitignore
--- openssl-1.0.0q.orig/crypto/mdc2/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/mdc2/.gitignore	2017-04-25 16:23:40.466619637 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/mdc2/mdc2.h openssl-1.0.0q/crypto/mdc2/mdc2.h
--- openssl-1.0.0q.orig/crypto/mdc2/mdc2.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/mdc2/mdc2.h	2017-04-25 16:23:40.468619612 +0200
@@ -75,7 +75,7 @@
 typedef struct mdc2_ctx_st
 	{
 	unsigned int num;
-	unsigned char data[MDC2_BLOCK];
+	unsigned char data[MDC2_BLOCK]; /* ARRAY OK UNUSED OPERA 2004-02-18 yngve*/
 	DES_cblock h,hh;
 	int pad_type; /* either 1 or 2, default 1 */
 	} MDC2_CTX;
diff -Naur openssl-1.0.0q.orig/crypto/mdc2/mdc2_one.c openssl-1.0.0q/crypto/mdc2/mdc2_one.c
--- openssl-1.0.0q.orig/crypto/mdc2/mdc2_one.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/mdc2/mdc2_one.c	2017-04-25 16:23:40.468619612 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/mdc2.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/mdc2/mdc2dgst.c openssl-1.0.0q/crypto/mdc2/mdc2dgst.c
--- openssl-1.0.0q.orig/crypto/mdc2/mdc2dgst.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/mdc2/mdc2dgst.c	2017-04-25 16:23:40.469620298 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/des.h>
 #include <openssl/mdc2.h>
 
@@ -79,8 +81,8 @@
 	{
 	c->num=0;
 	c->pad_type=1;
-	memset(&(c->h[0]),0x52,MDC2_BLOCK);
-	memset(&(c->hh[0]),0x25,MDC2_BLOCK);
+	op_memset(&(c->h[0]),0x52,MDC2_BLOCK);
+	op_memset(&(c->hh[0]),0x25,MDC2_BLOCK);
 	return 1;
 	}
 
@@ -94,7 +96,7 @@
 		if (i+len < MDC2_BLOCK)
 			{
 			/* partial block */
-			memcpy(&(c->data[i]),in,len);
+			op_memcpy(&(c->data[i]),in,len);
 			c->num+=(int)len;
 			return 1;
 			}
@@ -102,7 +104,7 @@
 			{
 			/* filled one */
 			j=MDC2_BLOCK-i;
-			memcpy(&(c->data[i]),in,j);
+			op_memcpy(&(c->data[i]),in,j);
 			len-=j;
 			in+=j;
 			c->num=0;
@@ -114,7 +116,7 @@
 	j=len-i;
 	if (j > 0)
 		{
-		memcpy(&(c->data[0]),&(in[i]),j);
+		op_memcpy(&(c->data[0]),&(in[i]),j);
 		c->num=(int)j;
 		}
 	return 1;
@@ -169,11 +171,11 @@
 		{
 		if (j == 2)
 			c->data[i++]=0x80;
-		memset(&(c->data[i]),0,MDC2_BLOCK-i);
+		op_memset(&(c->data[i]),0,MDC2_BLOCK-i);
 		mdc2_body(c,c->data,MDC2_BLOCK);
 		}
-	memcpy(md,(char *)c->h,MDC2_BLOCK);
-	memcpy(&(md[MDC2_BLOCK]),(char *)c->hh,MDC2_BLOCK);
+	op_memcpy(md,(char *)c->h,MDC2_BLOCK);
+	op_memcpy(&(md[MDC2_BLOCK]),(char *)c->hh,MDC2_BLOCK);
 	return 1;
 	}
 
diff -Naur openssl-1.0.0q.orig/crypto/mdc2/mdc2test.c openssl-1.0.0q/crypto/mdc2/mdc2test.c
--- openssl-1.0.0q.orig/crypto/mdc2/mdc2test.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/mdc2/mdc2test.c	2017-04-25 16:23:40.470620146 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -107,7 +109,7 @@
 	EVP_DigestUpdate(&c,(unsigned char *)text,strlen(text));
 	EVP_DigestFinal_ex(&c,&(md[0]),NULL);
 
-	if (memcmp(md,pad1,MDC2_DIGEST_LENGTH) != 0)
+	if (op_memcmp(md,pad1,MDC2_DIGEST_LENGTH) != 0)
 		{
 		for (i=0; i<MDC2_DIGEST_LENGTH; i++)
 			printf("%02X",md[i]);
@@ -126,7 +128,7 @@
 	EVP_DigestUpdate(&c,(unsigned char *)text,strlen(text));
 	EVP_DigestFinal_ex(&c,&(md[0]),NULL);
 
-	if (memcmp(md,pad2,MDC2_DIGEST_LENGTH) != 0)
+	if (op_memcmp(md,pad2,MDC2_DIGEST_LENGTH) != 0)
 		{
 		for (i=0; i<MDC2_DIGEST_LENGTH; i++)
 			printf("%02X",md[i]);
diff -Naur openssl-1.0.0q.orig/crypto/mem.c openssl-1.0.0q/crypto/mem.c
--- openssl-1.0.0q.orig/crypto/mem.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/mem.c	2017-04-25 16:23:40.471620273 +0200
@@ -56,12 +56,19 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
-#include <openssl/crypto.h>
-#include "cryptlib.h"
-
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 
+#ifndef OPERA_SMALL_VERSION
+#ifdef _NO_GLOBALS_
+extern int *g_allow_customize_addr();
+#define allow_customize (*g_allow_customize_addr())
+extern int *g_allow_customize_debug_addr();
+#define allow_customize_debug (*g_allow_customize_debug_addr())
+#else
 static int allow_customize = 1;      /* we provide flexible functions for */
 static int allow_customize_debug = 1;/* exchanging memory-related functions at
                                       * run-time, but this must be done
@@ -70,33 +77,46 @@
                                       * problems when malloc/free pairs
                                       * don't match etc. */
 
+#endif
+#endif /* OPERA_SMALL_VERSION */
 
 
 /* the following pointers may be changed as long as 'allow_customize' is set */
 
-static void *(*malloc_func)(size_t)         = malloc;
+#ifdef OPERA_SMALL_VERSION
+#define malloc_func		op_malloc
+#define malloc_ex_func(s, f, l)	op_malloc(s)
+#define realloc_func	op_realloc
+#define realloc_ex_func(p, s, f, l)		op_realloc(p,s)
+#define free_func		op_free
+#define free_locked_func	op_free
+#else
+
+static void *(*malloc_func)(size_t)         = op_malloc;
 static void *default_malloc_ex(size_t num, const char *file, int line)
 	{ return malloc_func(num); }
 static void *(*malloc_ex_func)(size_t, const char *file, int line)
         = default_malloc_ex;
 
-static void *(*realloc_func)(void *, size_t)= realloc;
+static void *(*realloc_func)(void *, size_t)= op_realloc;
 static void *default_realloc_ex(void *str, size_t num,
         const char *file, int line)
 	{ return realloc_func(str,num); }
 static void *(*realloc_ex_func)(void *, size_t, const char *file, int line)
         = default_realloc_ex;
 
-static void (*free_func)(void *)            = free;
+static void (*free_func)(void *)            = op_free;
 
-static void *(*malloc_locked_func)(size_t)  = malloc;
+#ifndef OPERA_SMALL_VERSION
+static void *(*malloc_locked_func)(size_t)  = op_malloc;
 static void *default_malloc_locked_ex(size_t num, const char *file, int line)
 	{ return malloc_locked_func(num); }
 static void *(*malloc_locked_ex_func)(size_t, const char *file, int line)
         = default_malloc_locked_ex;
+#endif
 
-static void (*free_locked_func)(void *)     = free;
-
+static void (*free_locked_func)(void *)     = op_free;
+#endif
 
 
 /* may be changed as long as 'allow_customize_debug' is set */
@@ -113,15 +133,23 @@
 #else
 /* applications can use CRYPTO_malloc_debug_init() to select above case
  * at run-time */
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 static void (*malloc_debug_func)(void *,int,const char *,int,int) = NULL;
 static void (*realloc_debug_func)(void *,void *,int,const char *,int,int)
 	= NULL;
 static void (*free_debug_func)(void *,int) = NULL;
+#ifndef OPERA_SMALL_VERSION
 static void (*set_debug_options_func)(long) = NULL;
 static long (*get_debug_options_func)(void) = NULL;
 #endif
+#endif
+#endif /* OPERA_SMALL_VERSION */
+#endif
 
 
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t),
 	void (*f)(void *))
 	{
@@ -164,6 +192,7 @@
 	free_locked_func=f;
 	return 1;
 	}
+#endif
 
 int CRYPTO_set_locked_mem_ex_functions(
         void *(*m)(size_t,const char *,int),
@@ -178,6 +207,8 @@
 	return 1;
 	}
 
+
+#ifndef _NO_GLOBALS_
 int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int),
 				   void (*r)(void *,void *,int,const char *,int,int),
 				   void (*f)(void *,int),
@@ -193,6 +224,7 @@
 	get_debug_options_func=go;
 	return 1;
 	}
+#endif
 
 
 void CRYPTO_get_mem_functions(void *(**m)(size_t), void *(**r)(void *, size_t),
@@ -233,6 +265,7 @@
 	if (f != NULL) *f=free_locked_func;
 	}
 
+#ifndef _NO_GLOBALS_
 void CRYPTO_get_mem_debug_functions(void (**m)(void *,int,const char *,int,int),
 				    void (**r)(void *,void *,int,const char *,int,int),
 				    void (**f)(void *,int),
@@ -245,8 +278,11 @@
 	if (so != NULL) *so=set_debug_options_func;
 	if (go != NULL) *go=get_debug_options_func;
 	}
+#endif
+#endif
 
 
+#ifndef OPERA_SMALL_VERSION
 void *CRYPTO_malloc_locked(int num, const char *file, int line)
 	{
 	void *ret = NULL;
@@ -254,17 +290,21 @@
 	if (num <= 0) return NULL;
 
 	allow_customize = 0;
+#ifndef _NO_GLOBALS_
 	if (malloc_debug_func != NULL)
 		{
 		allow_customize_debug = 0;
 		malloc_debug_func(NULL, num, file, line, 0);
 		}
+#endif
 	ret = malloc_locked_ex_func(num,file,line);
 #ifdef LEVITTE_DEBUG_MEM
 	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
 #endif
+#ifndef _NO_GLOBALS_
 	if (malloc_debug_func != NULL)
 		malloc_debug_func(ret, num, file, line, 1);
+#endif
 
 #ifndef OPENSSL_CPUID_OBJ
         /* Create a dependency on the value of 'cleanse_ctr' so our memory
@@ -290,6 +330,7 @@
 	if (free_debug_func != NULL)
 		free_debug_func(NULL, 1);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 void *CRYPTO_malloc(int num, const char *file, int line)
 	{
@@ -297,13 +338,19 @@
 
 	if (num <= 0) return NULL;
 
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 	allow_customize = 0;
 	if (malloc_debug_func != NULL)
 		{
 		allow_customize_debug = 0;
 		malloc_debug_func(NULL, num, file, line, 0);
 		}
+#endif // !_NO_GLOBALS_
+#endif // !OPERA_SMALL_VERSION
 	ret = malloc_ex_func(num,file,line);
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 #ifdef LEVITTE_DEBUG_MEM
 	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
 #endif
@@ -319,14 +366,16 @@
                 ((unsigned char *)ret)[0] = cleanse_ctr;
 	}
 #endif
+#endif // !_NO_GLOBALS_
+#endif // !OPERA_SMALL_VERSION
 
 	return ret;
 	}
 char *CRYPTO_strdup(const char *str, const char *file, int line)
 	{
-	char *ret = CRYPTO_malloc(strlen(str)+1, file, line);
+	char *ret = (char *)CRYPTO_malloc(op_strlen(str)+1, file, line);
 
-	strcpy(ret, str);
+	op_strcpy(ret, str);
 	return ret;
 	}
 
@@ -339,14 +388,22 @@
 
 	if (num <= 0) return NULL;
 
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 	if (realloc_debug_func != NULL)
 		realloc_debug_func(str, NULL, num, file, line, 0);
+#endif
+#endif
 	ret = realloc_ex_func(str,num,file,line);
 #ifdef LEVITTE_DEBUG_MEM
 	fprintf(stderr, "LEVITTE_DEBUG_MEM:         | 0x%p -> 0x%p (%d)\n", str, ret, num);
 #endif
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 	if (realloc_debug_func != NULL)
 		realloc_debug_func(str, ret, num, file, line, 1);
+#endif
+#endif
 
 	return ret;
 	}
@@ -365,12 +422,16 @@
 	 * |old_len| bytes to the new buffer, below. */
 	if (num < old_len) return NULL;
 
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 	if (realloc_debug_func != NULL)
 		realloc_debug_func(str, NULL, num, file, line, 0);
+#endif
+#endif
 	ret=malloc_ex_func(num,file,line);
 	if(ret)
 		{
-		memcpy(ret,str,old_len);
+		op_memcpy(ret,str,old_len);
 		OPENSSL_cleanse(str,old_len);
 		free_func(str);
 		}
@@ -379,24 +440,37 @@
 		"LEVITTE_DEBUG_MEM:         | 0x%p -> 0x%p (%d)\n",
 		str, ret, num);
 #endif
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 	if (realloc_debug_func != NULL)
 		realloc_debug_func(str, ret, num, file, line, 1);
+#endif
+#endif
 
 	return ret;
 	}
 
 void CRYPTO_free(void *str)
 	{
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 	if (free_debug_func != NULL)
 		free_debug_func(str, 0);
+#endif
+#endif
 #ifdef LEVITTE_DEBUG_MEM
 	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
 #endif
 	free_func(str);
+#ifndef OPERA_SMALL_VERSION
+#ifndef _NO_GLOBALS_
 	if (free_debug_func != NULL)
 		free_debug_func(NULL, 1);
+#endif
+#endif
 	}
 
+#ifndef OPERA_SMALL_VERSION
 void *CRYPTO_remalloc(void *a, int num, const char *file, int line)
 	{
 	if (a != NULL) OPENSSL_free(a);
@@ -404,15 +478,20 @@
 	return(a);
 	}
 
+#ifndef _NO_GLOBALS_
 void CRYPTO_set_mem_debug_options(long bits)
 	{
 	if (set_debug_options_func != NULL)
 		set_debug_options_func(bits);
 	}
+#endif // !_NO_GLOBALS_
 
+#ifndef _NO_GLOBALS_
 long CRYPTO_get_mem_debug_options(void)
 	{
 	if (get_debug_options_func != NULL)
 		return get_debug_options_func();
 	return 0;
 	}
+#endif // !_NO_GLOBALS_
+#endif // !OPERA_SMALL_VERSION
diff -Naur openssl-1.0.0q.orig/crypto/mem_clr.c openssl-1.0.0q/crypto/mem_clr.c
--- openssl-1.0.0q.orig/crypto/mem_clr.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/mem_clr.c	2017-04-25 16:23:40.472620120 +0200
@@ -56,8 +56,12 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
-#include <openssl/crypto.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+
+#ifndef OPERA_SMALL_VERSION
 
 unsigned char cleanse_ctr = 0;
 
@@ -75,3 +79,5 @@
 		ctr += (63 + (size_t)p);
 	cleanse_ctr = (unsigned char)ctr;
 	}
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/mem_dbg.c openssl-1.0.0q/crypto/mem_dbg.c
--- openssl-1.0.0q.orig/crypto/mem_dbg.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/mem_dbg.c	2017-04-25 16:23:40.473619689 +0200
@@ -109,16 +109,27 @@
  *
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>	
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/crypto.h>
 #include <openssl/buffer.h>
 #include <openssl/bio.h>
 #include <openssl/lhash.h>
 
+
+#ifdef _NO_GLOBALS_
+extern int *g_mh_mode_addr();
+#define mh_mode (*g_mh_mode_addr())
+#else
 static int mh_mode=CRYPTO_MEM_CHECK_OFF;
+#endif
 /* The state changes to CRYPTO_MEM_CHECK_ON | CRYPTO_MEM_CHECK_ENABLE
  * when the application asks for it (usually after library initialisation
  * for which no book-keeping is desired).
@@ -133,12 +144,21 @@
  * State CRYPTO_MEM_CHECK_ENABLE without ..._ON makes no sense whatsoever.
  */
 
-static unsigned long order = 0; /* number of memory requests */
+#ifndef OPERA_SMALL_VERSION
+#ifdef _NO_GLOBALS_
+extern unsigned long *g_order_addr();
+#define g_order (*g_order_addr())
+extern LHASH* *g_mh_addr();
+#define mh (*g_mh_addr())
+#else
+static unsigned long g_order = 0; /* number of memory requests */
 
 DECLARE_LHASH_OF(MEM);
 static LHASH_OF(MEM) *mh=NULL; /* hash-table of memory requests
 				* (address as key); access requires
 				* MALLOC2 lock */
+#endif // _NO_GLOBALS_
+#endif // OPERA_SMALL_VERSION
 
 
 typedef struct app_mem_info_st
@@ -160,6 +180,10 @@
 
 static void app_info_free(APP_INFO *);
 
+#ifdef _NO_GLOBALS_
+extern LHASH* *g_amih_addr();
+#define amih (*g_amih_addr())
+#else
 DECLARE_LHASH_OF(APP_INFO);
 static LHASH_OF(APP_INFO) *amih=NULL; /* hash-table with those
 				       * app_mem_info_st's that are at
@@ -167,6 +191,7 @@
 				       * stack (with `thread' as key);
 				       * access requires MALLOC2
 				       * lock */
+#endif // _NO_GLOBALS_
 
 typedef struct mem_st
 /* memory-block description */
@@ -181,6 +206,11 @@
 	APP_INFO *app_info;
 	} MEM;
 
+#ifndef OPERA_SMALL_VERSION
+#ifdef _NO_GLOBALS_
+extern long *g_options_addr();
+#define options (*g_options_addr())
+#else
 static long options =             /* extra information to be recorded */
 #if defined(CRYPTO_MDEBUG_TIME) || defined(CRYPTO_MDEBUG_ALL)
 	V_CRYPTO_MDEBUG_TIME |
@@ -189,8 +219,16 @@
 	V_CRYPTO_MDEBUG_THREAD |
 #endif
 	0;
+#endif
+#endif /* OPERA_SMALL_VERSION */
 
 
+#ifdef _NO_GLOBALS_
+extern unsigned int *g_num_disable_addr();
+#define num_disable (*g_num_disable_addr())
+extern unsigned long *g_disabling_thread_addr();
+#define disabling_thread (*g_disabling_thread_addr())
+#else
 static unsigned int num_disable = 0; /* num_disable > 0
                                       *     iff
                                       * mh_mode == CRYPTO_MEM_CHECK_ON (w/o ..._ENABLE)
@@ -200,6 +238,7 @@
  * case (by the thread named in disabling_thread).
  */
 static CRYPTO_THREADID disabling_threadid;
+#endif // _NO_GLOBALS_
 
 static void app_info_free(APP_INFO *inf)
 	{
@@ -302,6 +341,7 @@
 	}	
 
 
+#ifndef OPERA_SMALL_VERSION
 void CRYPTO_dbg_set_options(long bits)
 	{
 	options = bits;
@@ -336,6 +376,7 @@
 	return(ret);
 	}
 static IMPLEMENT_LHASH_HASH_FN(mem, MEM)
+#endif // OPERA_SMALL_VERSION
 
 /* static int app_info_cmp(APP_INFO *a, APP_INFO *b) */
 static int app_info_cmp(const void *a_void, const void *b_void)
@@ -460,6 +501,7 @@
 	return(ret);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int CRYPTO_remove_all_info(void)
 	{
 	int ret=0;
@@ -477,7 +519,8 @@
 	}
 
 
-static unsigned long break_order_num=0;
+static const unsigned long break_order_num=0;
+
 void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,
 	int before_p)
 	{
@@ -522,12 +565,12 @@
 			else
 				memset(&m->threadid, 0, sizeof(m->threadid));
 
-			if (order == break_order_num)
+			if (g_order == break_order_num)
 				{
 				/* BREAK HERE */
-				m->order=order;
+				m->order=g_order;
 				}
-			m->order=order++;
+			m->order=g_order++;
 #ifdef LEVITTE_DEBUG_MEM
 			fprintf(stderr, "LEVITTE_DEBUG_MEM: [%5ld] %c 0x%p (%d)\n",
 				m->order,
@@ -830,7 +873,7 @@
 	if (mh == NULL) return;
 	/* Need to turn off memory checking when allocated BIOs ... especially
 	 * as we're creating them at a time when we're trying to check we've not
-	 * left anything un-free()'d!! */
+	 * left anything un-op_free()'d!! */
 	MemCheck_off();
 	b = BIO_new(BIO_s_file());
 	MemCheck_on();
@@ -872,3 +915,5 @@
 			 &cb);
 	CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC2);
 	}
+
+#endif // OPERA_SMALL_VERSION
diff -Naur openssl-1.0.0q.orig/crypto/modes/cbc128.c openssl-1.0.0q/crypto/modes/cbc128.c
--- openssl-1.0.0q.orig/crypto/modes/cbc128.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/modes/cbc128.c	2017-04-25 16:23:40.475619663 +0200
@@ -49,6 +49,8 @@
  */
 
 #include "modes.h"
+
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
 
 #ifndef MODES_DEBUG
@@ -57,6 +59,7 @@
 # endif
 #endif
 #include <assert.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #define STRICT_ALIGNMENT 1
 #if defined(__i386) || defined(__i386__) || \
diff -Naur openssl-1.0.0q.orig/crypto/modes/opera_cbc128.cpp openssl-1.0.0q/crypto/modes/opera_cbc128.cpp
--- openssl-1.0.0q.orig/crypto/modes/opera_cbc128.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/modes/opera_cbc128.cpp	2017-04-25 16:23:40.476619791 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/modes/cbc128.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/o_str.c openssl-1.0.0q/crypto/o_str.c
--- openssl-1.0.0q.orig/crypto/o_str.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/o_str.c	2017-04-25 16:23:40.477620756 +0200
@@ -56,8 +56,10 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <ctype.h>
-#include <e_os.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/e_os.h>
 #include "o_str.h"
 
 #if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && \
@@ -71,7 +73,7 @@
 #if defined(OPENSSL_IMPLEMENTS_strncasecmp)
 	while (*str1 && *str2 && n)
 		{
-		int res = toupper(*str1) - toupper(*str2);
+		int res = op_toupper(*str1) - op_toupper(*str2);
 		if (res) return res < 0 ? -1 : 1;
 		str1++;
 		str2++;
diff -Naur openssl-1.0.0q.orig/crypto/o_str.h openssl-1.0.0q/crypto/o_str.h
--- openssl-1.0.0q.orig/crypto/o_str.h	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/o_str.h	2017-04-25 16:23:40.478620045 +0200
@@ -59,10 +59,11 @@
 #ifndef HEADER_O_STR_H
 #define HEADER_O_STR_H
 
+#ifndef OPERA_SMALL_VERSION
 #include <stddef.h>		/* to get size_t */
+#endif /* !OPERA_SMALL_VERSION */
 
 int OPENSSL_strcasecmp(const char *str1, const char *str2);
 int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n);
-int OPENSSL_memcmp(const void *p1,const void *p2,size_t n);
 
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/o_time.c openssl-1.0.0q/crypto/o_time.c
--- openssl-1.0.0q.orig/crypto/o_time.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/o_time.c	2017-04-25 16:23:40.480619182 +0200
@@ -60,7 +60,9 @@
  */
 
 #include <openssl/e_os2.h>
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "o_time.h"
 
 #ifdef OPENSSL_SYS_VMS
@@ -69,12 +71,14 @@
 #  define VMS_GMTIME_OK
 # endif
 # ifndef VMS_GMTIME_OK
+#ifndef OPERA_SMALL_VERSION
 #  include <libdtdef.h>
 #  include <lib$routines.h>
 #  include <lnmdef.h>
 #  include <starlet.h>
 #  include <descrip.h>
 #  include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 # endif /* ndef VMS_GMTIME_OK */
 #endif
 
@@ -92,7 +96,7 @@
 	if (ts == NULL)
 		return NULL;
 
-	memcpy(result, ts, sizeof(struct tm));
+	op_memcpy(result, ts, sizeof(struct tm));
 	ts = result;
 #endif
 #if defined( OPENSSL_SYS_VMS) && !defined( VMS_GMTIME_OK)
@@ -100,7 +104,7 @@
 		{
 		static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL");
 		static $DESCRIPTOR(lognam,"SYS$TIMEZONE_DIFFERENTIAL");
-		char logvalue[256];
+		char logvalue[256];  	/* ARRAY OK UNUSED 2009-05-25 yngve VMS ONLY*/
 		unsigned int reslen = 0;
 		struct {
 			short buflen;
@@ -133,11 +137,11 @@
 **  the other __utc_* deals with time in terms of UTC.
 */
 /* We use the same conditions as in said time.h to check if we should
-   assume that t contains local time (and should therefore be adjusted)
+   assume that t contains local op_time (and should therefore be adjusted)
    or UTC (and should therefore be left untouched). */
 #if __CRTL_VER < 70000000 || defined _VMS_V6_SOURCE
 		/* Get the numerical value of the equivalence string */
-		status = atoi(logvalue);
+		status = op_atoi(logvalue);
 
 		/* and use it to move time to GMT */
 		t -= status;
diff -Naur openssl-1.0.0q.orig/crypto/o_time.h openssl-1.0.0q/crypto/o_time.h
--- openssl-1.0.0q.orig/crypto/o_time.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/o_time.h	2017-04-25 16:23:40.483620401 +0200
@@ -59,7 +59,9 @@
 #ifndef HEADER_O_TIME_H
 #define HEADER_O_TIME_H
 
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif // OPERA_SMALL_VERSION
 
 struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result);
 int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec);
diff -Naur openssl-1.0.0q.orig/crypto/objects/.gitignore openssl-1.0.0q/crypto/objects/.gitignore
--- openssl-1.0.0q.orig/crypto/objects/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/.gitignore	2017-04-25 16:23:40.483620401 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/objects/o_names.c openssl-1.0.0q/crypto/objects/o_names.c
--- openssl-1.0.0q.orig/crypto/objects/o_names.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/o_names.c	2017-04-25 16:23:40.484620528 +0200
@@ -1,7 +1,10 @@
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
+#include <openssl/cryptlib.h>
 #include <openssl/err.h>
 #include <openssl/lhash.h>
 #include <openssl/objects.h>
@@ -23,8 +26,16 @@
  * that applications may define.  I only really use the free function field.
  */
 DECLARE_LHASH_OF(OBJ_NAME);
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(LHASH_OF(OBJ_NAME) *, names_lh);
+#define names_lh OPENSSL_GLOBAL_REF(names_lh)
+#else
 static LHASH_OF(OBJ_NAME) *names_lh=NULL;
+#endif // OPERA_SMALL_VERSION
+
+#ifndef OPERA_SMALL_VERSION
 static int names_type_num=OBJ_NAME_TYPE_NUM;
+#endif // !OPERA_SMALL_VERSION
 
 typedef struct name_funcs_st
 	{
@@ -36,7 +47,12 @@
 DECLARE_STACK_OF(NAME_FUNCS)
 IMPLEMENT_STACK_OF(NAME_FUNCS)
 
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(STACK_OF(NAME_FUNCS) *, name_funcs_stack);
+#define name_funcs_stack OPENSSL_GLOBAL_REF(name_funcs_stack)
+#else
 static STACK_OF(NAME_FUNCS) *name_funcs_stack;
+#endif
 
 /* The LHASH callbacks now use the raw "void *" prototypes and do per-variable
  * casting in the functions. This prevents function pointer casting without the
@@ -59,6 +75,7 @@
 	return(names_lh != NULL);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *),
 	int (*cmp_func)(const char *, const char *),
 	void (*free_func)(const char *, int, const char *))
@@ -110,6 +127,7 @@
 		name_funcs->free_func = free_func;
 	return(ret);
 	}
+#endif
 
 /* static int obj_name_cmp(OBJ_NAME *a, OBJ_NAME *b) */
 static int obj_name_cmp(const void *a_void, const void *b_void)
@@ -128,7 +146,7 @@
 				a->type)->cmp_func(a->name,b->name);
 			}
 		else
-			ret=strcmp(a->name,b->name);
+			ret=op_strcmp(a->name,b->name);
 		}
 	return(ret);
 	}
@@ -295,7 +313,7 @@
 
 static void do_all_sorted_fn(const OBJ_NAME *name,void *d_)
 	{
-	struct doall_sorted *d=d_;
+	struct doall_sorted *d=(struct doall_sorted *)d_;
 
 	if(name->type != d->type)
 		return;
@@ -305,10 +323,10 @@
 
 static int do_all_sorted_cmp(const void *n1_,const void *n2_)
 	{
-	const OBJ_NAME * const *n1=n1_;
-	const OBJ_NAME * const *n2=n2_;
+	const OBJ_NAME * const *n1=(const OBJ_NAME * const *)n1_;
+	const OBJ_NAME * const *n2=(const OBJ_NAME * const *)n2_;
 
-	return strcmp((*n1)->name,(*n2)->name);
+	return op_strcmp((*n1)->name,(*n2)->name);
 	}
 
 void OBJ_NAME_do_all_sorted(int type,void (*fn)(const OBJ_NAME *,void *arg),
@@ -318,11 +336,11 @@
 	int n;
 
 	d.type=type;
-	d.names=OPENSSL_malloc(lh_OBJ_NAME_num_items(names_lh)*sizeof *d.names);
+	d.names=(const OBJ_NAME **)OPENSSL_malloc(lh_OBJ_NAME_num_items(names_lh)*sizeof *d.names);
 	d.n=0;
 	OBJ_NAME_do_all(type,do_all_sorted_fn,&d);
 
-	qsort((void *)d.names,d.n,sizeof *d.names,do_all_sorted_cmp);
+	op_qsort((void *)d.names,d.n,sizeof *d.names,do_all_sorted_cmp);
 
 	for(n=0 ; n < d.n ; ++n)
 		fn(d.names[n],arg);
@@ -330,7 +348,12 @@
 	OPENSSL_free((void *)d.names);
 	}
 
-static int free_type;
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(int, free_type);
+#define free_type OPENSSL_GLOBAL_REF(free_type)
+#else
+static int free_type=0;
+#endif
 
 static void names_lh_free_doall(OBJ_NAME *onp)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/objects/obj_dat.bat openssl-1.0.0q/crypto/objects/obj_dat.bat
--- openssl-1.0.0q.orig/crypto/objects/obj_dat.bat	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/obj_dat.bat	2017-04-25 16:23:40.485621214 +0200
@@ -0,0 +1 @@
+perl obj_dat.pl obj_mac.h obj_dat.h
diff -Naur openssl-1.0.0q.orig/crypto/objects/obj_dat.c openssl-1.0.0q/crypto/objects/obj_dat.c
--- openssl-1.0.0q.orig/crypto/objects/obj_dat.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/obj_dat.c	2017-04-25 16:23:40.487620351 +0200
@@ -56,10 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
 #include <limits.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
@@ -74,15 +76,17 @@
 #define NUM_SN 0
 #define NUM_LN 0
 #define NUM_OBJ 0
-static const unsigned char lvalues[1];
+static const unsigned char lvalues[1];  /* ARRAY OK 2007-11-07 yngve UNUSED*/
 static const ASN1_OBJECT nid_objs[1];
 static const unsigned int sn_objs[1];
 static const unsigned int ln_objs[1];
 static const unsigned int obj_objs[1];
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 DECLARE_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, sn);
 DECLARE_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, ln);
+#endif
 DECLARE_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, obj);
 
 #define ADDED_DATA	0
@@ -97,18 +101,31 @@
 	} ADDED_OBJ;
 DECLARE_LHASH_OF(ADDED_OBJ);
 
+#ifndef OPERA_SMALL_VERSION
+
 static int new_nid=NUM_NID;
 static LHASH_OF(ADDED_OBJ) *added=NULL;
 
+#else
+
+OPENSSL_DECLARE_GLOBAL(int,                   obj_dat__new_nid);
+#define new_nid OPENSSL_GLOBAL_REF(           obj_dat__new_nid)
+OPENSSL_DECLARE_GLOBAL(LHASH_OF(ADDED_OBJ) *, obj_dat__added);
+#define added OPENSSL_GLOBAL_REF(             obj_dat__added)
+
+#endif // !OPERA_SMALL_VERSION
+
+#ifndef OPERA_SMALL_VERSION
 static int sn_cmp(const ASN1_OBJECT * const *a, const unsigned int *b)
-	{ return(strcmp((*a)->sn,nid_objs[*b].sn)); }
+	{ return(op_strcmp((*a)->sn,nid_objs[*b].sn)); }
 
 IMPLEMENT_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, sn);
 
 static int ln_cmp(const ASN1_OBJECT * const *a, const unsigned int *b)
-	{ return(strcmp((*a)->ln,nid_objs[*b].ln)); }
+	{ return(op_strcmp((*a)->ln,nid_objs[*b].ln)); }
 
 IMPLEMENT_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, ln);
+#endif // !OPERA_SMALL_VERSION
 
 static unsigned long added_obj_hash(const ADDED_OBJ *ca)
 	{
@@ -159,15 +176,15 @@
 	case ADDED_DATA:
 		i=(a->length - b->length);
 		if (i) return(i);
-		return(memcmp(a->data,b->data,(size_t)a->length));
+		return(op_memcmp(a->data,b->data,(size_t)a->length));
 	case ADDED_SNAME:
 		if (a->sn == NULL) return(-1);
 		else if (b->sn == NULL) return(1);
-		else return(strcmp(a->sn,b->sn));
+		else return(op_strcmp(a->sn,b->sn));
 	case ADDED_LNAME:
 		if (a->ln == NULL) return(-1);
 		else if (b->ln == NULL) return(1);
-		else return(strcmp(a->ln,b->ln));
+		else return(op_strcmp(a->ln,b->ln));
 	case ADDED_NID:
 		return(a->nid-b->nid);
 	default:
@@ -288,8 +305,10 @@
 
 ASN1_OBJECT *OBJ_nid2obj(int n)
 	{
+#ifndef OPERA_SMALL_VERSION
 	ADDED_OBJ ad,*adp;
 	ASN1_OBJECT ob;
+#endif
 
 	if ((n >= 0) && (n < NUM_NID))
 		{
@@ -300,6 +319,10 @@
 			}
 		return((ASN1_OBJECT *)&(nid_objs[n]));
 		}
+#ifdef OPERA_SMALL_VERSION
+	else
+		return NULL;
+#else
 	else if (added == NULL)
 		return(NULL);
 	else
@@ -316,12 +339,15 @@
 			return(NULL);
 			}
 		}
+#endif // OPERA_SMALL_VERSION
 	}
 
 const char *OBJ_nid2sn(int n)
 	{
+#ifndef OPERA_SMALL_VERSION
 	ADDED_OBJ ad,*adp;
 	ASN1_OBJECT ob;
+#endif
 
 	if ((n >= 0) && (n < NUM_NID))
 		{
@@ -332,6 +358,10 @@
 			}
 		return(nid_objs[n].sn);
 		}
+#ifdef OPERA_SMALL_VERSION
+	else
+		return NULL;
+#else
 	else if (added == NULL)
 		return(NULL);
 	else
@@ -348,12 +378,15 @@
 			return(NULL);
 			}
 		}
+#endif // OPERA_SMALL_VERSION
 	}
 
 const char *OBJ_nid2ln(int n)
 	{
+#ifndef OPERA_SMALL_VERSION
 	ADDED_OBJ ad,*adp;
 	ASN1_OBJECT ob;
+#endif
 
 	if ((n >= 0) && (n < NUM_NID))
 		{
@@ -364,6 +397,10 @@
 			}
 		return(nid_objs[n].ln);
 		}
+#ifdef OPERA_SMALL_VERSION
+	else
+		return NULL;
+#else
 	else if (added == NULL)
 		return(NULL);
 	else
@@ -380,6 +417,7 @@
 			return(NULL);
 			}
 		}
+#endif // OPERA_SMALL_VERSION
 	}
 
 static int obj_cmp(const ASN1_OBJECT * const *ap, const unsigned int *bp)
@@ -390,7 +428,7 @@
 
 	j=(a->length - b->length);
         if (j) return(j);
-	return(memcmp(a->data,b->data,a->length));
+	return(op_memcmp(a->data,b->data,a->length));
 	}
 
 IMPLEMENT_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, obj);
@@ -398,13 +436,16 @@
 int OBJ_obj2nid(const ASN1_OBJECT *a)
 	{
 	const unsigned int *op;
+#ifndef OPERA_SMALL_VERSION
 	ADDED_OBJ ad,*adp;
+#endif // !OPERA_SMALL_VERSION
 
 	if (a == NULL)
 		return(NID_undef);
 	if (a->nid != 0)
 		return(a->nid);
 
+#ifndef OPERA_SMALL_VERSION
 	if (added != NULL)
 		{
 		ad.type=ADDED_DATA;
@@ -412,6 +453,7 @@
 		adp=lh_ADDED_OBJ_retrieve(added,&ad);
 		if (adp != NULL) return (adp->obj->nid);
 		}
+#endif // !OPERA_SMALL_VERSION
 	op=OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);
 	if (op == NULL)
 		return(NID_undef);
@@ -426,18 +468,22 @@
 
 ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
 	{
+#ifndef OPERA_SMALL_VERSION
 	int nid = NID_undef;
+#endif // !OPERA_SMALL_VERSION
 	ASN1_OBJECT *op=NULL;
 	unsigned char *buf;
 	unsigned char *p;
 	const unsigned char *cp;
 	int i, j;
 
+#ifndef OPERA_SMALL_VERSION
 	if(!no_name) {
 		if( ((nid = OBJ_sn2nid(s)) != NID_undef) ||
 			((nid = OBJ_ln2nid(s)) != NID_undef) ) 
 					return OBJ_nid2obj(nid);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 	/* Work out size of content octets */
 	i=a2d_ASN1_OBJECT(NULL,0,s,-1);
@@ -469,7 +515,7 @@
 	BIGNUM *bl;
 	unsigned long l;
 	const unsigned char *p;
-	char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
+	char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2]; /* ARRAY OK 2009-05-25 yngve */
 
 	/* Ensure that, at every state, |buf| is NUL-terminated. */
 	if (buf && buf_len > 0)
@@ -488,7 +534,7 @@
 			{
 			if (buf)
 				BUF_strlcpy(buf,s,buf_len);
-			n=strlen(s);
+			n=op_strlen(s);
 			return n;
 			}
 		}
@@ -567,10 +613,10 @@
 		if (use_bn)
 			{
 			char *bndec;
-			bndec = BN_bn2dec(bl);
+			bndec = (char*) BN_bn2dec(bl);
 			if (!bndec)
 				goto err;
-			i = strlen(bndec);
+			i = op_strlen(bndec);
 			if (buf)
 				{
 				if (buf_len > 1)
@@ -598,7 +644,7 @@
 		else
 			{
 			BIO_snprintf(tbuf,sizeof tbuf,".%lu",l);
-			i=strlen(tbuf);
+			i=op_strlen(tbuf);
 			if (buf && (buf_len > 0))
 				{
 				BUF_strlcpy(buf,tbuf,buf_len);
@@ -617,7 +663,6 @@
 			l=0;
 			}
 		}
-
 	if (bl)
 		BN_free(bl);
 	return n;
@@ -628,6 +673,7 @@
 	return -1;
 }
 
+#ifndef OPERA_SMALL_VERSION
 int OBJ_txt2nid(const char *s)
 {
 	ASN1_OBJECT *obj;
@@ -642,10 +688,13 @@
 	{
 	ASN1_OBJECT o;
 	const ASN1_OBJECT *oo= &o;
+#ifndef OPERA_SMALL_VERSION
 	ADDED_OBJ ad,*adp;
+#endif // !OPERA_SMALL_VERSION
 	const unsigned int *op;
 
 	o.ln=s;
+#ifndef OPERA_SMALL_VERSION
 	if (added != NULL)
 		{
 		ad.type=ADDED_LNAME;
@@ -653,6 +702,7 @@
 		adp=lh_ADDED_OBJ_retrieve(added,&ad);
 		if (adp != NULL) return (adp->obj->nid);
 		}
+#endif // !OPERA_SMALL_VERSION
 	op=OBJ_bsearch_ln(&oo, ln_objs, NUM_LN);
 	if (op == NULL) return(NID_undef);
 	return(nid_objs[*op].nid);
@@ -662,10 +712,13 @@
 	{
 	ASN1_OBJECT o;
 	const ASN1_OBJECT *oo= &o;
+#ifndef OPERA_SMALL_VERSION
 	ADDED_OBJ ad,*adp;
+#endif // !OPERA_SMALL_VERSION
 	const unsigned int *op;
 
 	o.sn=s;
+#ifndef OPERA_SMALL_VERSION
 	if (added != NULL)
 		{
 		ad.type=ADDED_SNAME;
@@ -673,10 +726,12 @@
 		adp=lh_ADDED_OBJ_retrieve(added,&ad);
 		if (adp != NULL) return (adp->obj->nid);
 		}
+#endif // !OPERA_SMALL_VERSION
 	op=OBJ_bsearch_sn(&oo, sn_objs, NUM_SN);
 	if (op == NULL) return(NID_undef);
 	return(nid_objs[*op].nid);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 const void *OBJ_bsearch_(const void *key, const void *base, int num, int size,
 			 int (*cmp)(const void *, const void *))
@@ -689,7 +744,7 @@
 			    int (*cmp)(const void *, const void *),
 			    int flags)
 	{
-	const char *base=base_;
+	const char *base=(const char *)base_;
 	int l,h,i=0,c=0;
 	const char *p = NULL;
 
@@ -735,9 +790,10 @@
 	return(p);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int OBJ_create_objects(BIO *in)
 	{
-	MS_STATIC char buf[512];
+	MS_STATIC char buf[512]; /* ARRAY OK 2007-11-07 yngve UNUSED */
 	int i,num=0;
 	char *o,*s,*l=NULL;
 
@@ -747,26 +803,26 @@
 		i=BIO_gets(in,buf,512);
 		if (i <= 0) return(num);
 		buf[i-1]='\0';
-		if (!isalnum((unsigned char)buf[0])) return(num);
+		if (!op_isalnum((unsigned char)buf[0])) return(num);
 		o=s=buf;
-		while (isdigit((unsigned char)*s) || (*s == '.'))
+		while (op_isdigit((unsigned char)*s) || (*s == '.'))
 			s++;
 		if (*s != '\0')
 			{
 			*(s++)='\0';
-			while (isspace((unsigned char)*s))
+			while (op_isspace((unsigned char)*s))
 				s++;
 			if (*s == '\0')
 				s=NULL;
 			else
 				{
 				l=s;
-				while ((*l != '\0') && !isspace((unsigned char)*l))
+				while ((*l != '\0') && !op_isspace((unsigned char)*l))
 					l++;
 				if (*l != '\0')
 					{
 					*(l++)='\0';
-					while (isspace((unsigned char)*l))
+					while (op_isspace((unsigned char)*l))
 						l++;
 					if (*l == '\0') l=NULL;
 					}
@@ -782,6 +838,7 @@
 		}
 	/* return(num); */
 	}
+#endif // !OPERA_SMALL_VERSION
 
 int OBJ_create(const char *oid, const char *sn, const char *ln)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/objects/obj_dat.h openssl-1.0.0q/crypto/objects/obj_dat.h
--- openssl-1.0.0q.orig/crypto/objects/obj_dat.h	2015-01-15 15:56:15.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/obj_dat.h	2017-04-25 16:23:40.527619848 +0200
@@ -1,5 +1,8 @@
 /* crypto/objects/obj_dat.h */
 
+/* !!NOTE!!NOTE!! MAKE NO DIRECT CHANGES IN THIS FILE.
+ * IT IS GENERATED; **ALL** CHANGES WILL BE LOST */
+
 /* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
  * following command:
  * perl obj_dat.pl obj_mac.h obj_dat.h
@@ -62,4915 +65,4956 @@
  * [including the GNU Public Licence.]
  */
 
+#include "modules/libopeay/libopeay_arrays.h"
+#include "modules/libopeay/libopeay_implmodule.h"
+
+#define CONST_ENTRY_NID(_sn, _ln, _nid, len, _dat, _flg) \
+	CONST_ENTRY_START(sn, _sn)\
+	CONST_ENTRY_SINGLE(ln, _ln)\
+	CONST_ENTRY_SINGLE(nid, _nid)\
+	CONST_ENTRY_SINGLE(length, len)\
+	CONST_ENTRY_SINGLE(data, _dat)\
+	CONST_ENTRY_SINGLE(flags, _flg)\
+	CONST_ENTRY_END
+
+#ifndef ADS12
+#define LVALUES_START static const unsigned char lvalues[]={
+#define I(x) x,
+#define LVALUES_END };
+#else
+#define LVALUES_START OPENSSL_PREFIX_CONST_ARRAY(static, unsigned char, lvalues, libopeay)
+#define I(x) CONST_ENTRY(x)
+#define LVALUES_END CONST_END(lvalues)
+#define NEED_LVALUES_OVERRIDE
+#endif
+
+/* These arrays become too big for some compilers, e.g MSDev 6. In any case their size is under control */
+#undef TEST_CONST_ARRAY_SIZE
+#define TEST_CONST_ARRAY_SIZE ((void)0)
+
+
 #define NUM_NID 893
 #define NUM_SN 886
 #define NUM_LN 886
 #define NUM_OBJ 840
 
-static const unsigned char lvalues[5824]={
-0x00,                                        /* [  0] OBJ_undef */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,               /* [  1] OBJ_rsadsi */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,          /* [  7] OBJ_pkcs */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x02,     /* [ 14] OBJ_md2 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,     /* [ 22] OBJ_md5 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x04,     /* [ 30] OBJ_rc4 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,/* [ 38] OBJ_rsaEncryption */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x02,/* [ 47] OBJ_md2WithRSAEncryption */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,/* [ 56] OBJ_md5WithRSAEncryption */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x01,/* [ 65] OBJ_pbeWithMD2AndDES_CBC */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,/* [ 74] OBJ_pbeWithMD5AndDES_CBC */
-0x55,                                        /* [ 83] OBJ_X500 */
-0x55,0x04,                                   /* [ 84] OBJ_X509 */
-0x55,0x04,0x03,                              /* [ 86] OBJ_commonName */
-0x55,0x04,0x06,                              /* [ 89] OBJ_countryName */
-0x55,0x04,0x07,                              /* [ 92] OBJ_localityName */
-0x55,0x04,0x08,                              /* [ 95] OBJ_stateOrProvinceName */
-0x55,0x04,0x0A,                              /* [ 98] OBJ_organizationName */
-0x55,0x04,0x0B,                              /* [101] OBJ_organizationalUnitName */
-0x55,0x08,0x01,0x01,                         /* [104] OBJ_rsa */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,     /* [108] OBJ_pkcs7 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,/* [116] OBJ_pkcs7_data */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,/* [125] OBJ_pkcs7_signed */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,/* [134] OBJ_pkcs7_enveloped */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x04,/* [143] OBJ_pkcs7_signedAndEnveloped */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x05,/* [152] OBJ_pkcs7_digest */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,/* [161] OBJ_pkcs7_encrypted */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x03,     /* [170] OBJ_pkcs3 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x03,0x01,/* [178] OBJ_dhKeyAgreement */
-0x2B,0x0E,0x03,0x02,0x06,                    /* [187] OBJ_des_ecb */
-0x2B,0x0E,0x03,0x02,0x09,                    /* [192] OBJ_des_cfb64 */
-0x2B,0x0E,0x03,0x02,0x07,                    /* [197] OBJ_des_cbc */
-0x2B,0x0E,0x03,0x02,0x11,                    /* [202] OBJ_des_ede_ecb */
-0x2B,0x06,0x01,0x04,0x01,0x81,0x3C,0x07,0x01,0x01,0x02,/* [207] OBJ_idea_cbc */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,     /* [218] OBJ_rc2_cbc */
-0x2B,0x0E,0x03,0x02,0x12,                    /* [226] OBJ_sha */
-0x2B,0x0E,0x03,0x02,0x0F,                    /* [231] OBJ_shaWithRSAEncryption */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,     /* [236] OBJ_des_ede3_cbc */
-0x2B,0x0E,0x03,0x02,0x08,                    /* [244] OBJ_des_ofb64 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,     /* [249] OBJ_pkcs9 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,/* [257] OBJ_pkcs9_emailAddress */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x02,/* [266] OBJ_pkcs9_unstructuredName */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,/* [275] OBJ_pkcs9_contentType */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,/* [284] OBJ_pkcs9_messageDigest */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,/* [293] OBJ_pkcs9_signingTime */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,/* [302] OBJ_pkcs9_countersignature */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,/* [311] OBJ_pkcs9_challengePassword */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x08,/* [320] OBJ_pkcs9_unstructuredAddress */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x09,/* [329] OBJ_pkcs9_extCertAttributes */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,          /* [338] OBJ_netscape */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,     /* [345] OBJ_netscape_cert_extension */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x02,     /* [353] OBJ_netscape_data_type */
-0x2B,0x0E,0x03,0x02,0x1A,                    /* [361] OBJ_sha1 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,/* [366] OBJ_sha1WithRSAEncryption */
-0x2B,0x0E,0x03,0x02,0x0D,                    /* [375] OBJ_dsaWithSHA */
-0x2B,0x0E,0x03,0x02,0x0C,                    /* [380] OBJ_dsa_2 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,/* [385] OBJ_pbeWithSHA1AndRC2_CBC */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,/* [394] OBJ_id_pbkdf2 */
-0x2B,0x0E,0x03,0x02,0x1B,                    /* [403] OBJ_dsaWithSHA1_2 */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x01,/* [408] OBJ_netscape_cert_type */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x02,/* [417] OBJ_netscape_base_url */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x03,/* [426] OBJ_netscape_revocation_url */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x04,/* [435] OBJ_netscape_ca_revocation_url */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x07,/* [444] OBJ_netscape_renewal_url */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x08,/* [453] OBJ_netscape_ca_policy_url */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x0C,/* [462] OBJ_netscape_ssl_server_name */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x0D,/* [471] OBJ_netscape_comment */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x02,0x05,/* [480] OBJ_netscape_cert_sequence */
-0x55,0x1D,                                   /* [489] OBJ_id_ce */
-0x55,0x1D,0x0E,                              /* [491] OBJ_subject_key_identifier */
-0x55,0x1D,0x0F,                              /* [494] OBJ_key_usage */
-0x55,0x1D,0x10,                              /* [497] OBJ_private_key_usage_period */
-0x55,0x1D,0x11,                              /* [500] OBJ_subject_alt_name */
-0x55,0x1D,0x12,                              /* [503] OBJ_issuer_alt_name */
-0x55,0x1D,0x13,                              /* [506] OBJ_basic_constraints */
-0x55,0x1D,0x14,                              /* [509] OBJ_crl_number */
-0x55,0x1D,0x20,                              /* [512] OBJ_certificate_policies */
-0x55,0x1D,0x23,                              /* [515] OBJ_authority_key_identifier */
-0x2B,0x06,0x01,0x04,0x01,0x97,0x55,0x01,0x02,/* [518] OBJ_bf_cbc */
-0x55,0x08,0x03,0x65,                         /* [527] OBJ_mdc2 */
-0x55,0x08,0x03,0x64,                         /* [531] OBJ_mdc2WithRSA */
-0x55,0x04,0x2A,                              /* [535] OBJ_givenName */
-0x55,0x04,0x04,                              /* [538] OBJ_surname */
-0x55,0x04,0x2B,                              /* [541] OBJ_initials */
-0x55,0x1D,0x1F,                              /* [544] OBJ_crl_distribution_points */
-0x2B,0x0E,0x03,0x02,0x03,                    /* [547] OBJ_md5WithRSA */
-0x55,0x04,0x05,                              /* [552] OBJ_serialNumber */
-0x55,0x04,0x0C,                              /* [555] OBJ_title */
-0x55,0x04,0x0D,                              /* [558] OBJ_description */
-0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x42,0x0A,/* [561] OBJ_cast5_cbc */
-0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x42,0x0C,/* [570] OBJ_pbeWithMD5AndCast5_CBC */
-0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,          /* [579] OBJ_dsaWithSHA1 */
-0x2B,0x0E,0x03,0x02,0x1D,                    /* [586] OBJ_sha1WithRSA */
-0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,          /* [591] OBJ_dsa */
-0x2B,0x24,0x03,0x02,0x01,                    /* [598] OBJ_ripemd160 */
-0x2B,0x24,0x03,0x03,0x01,0x02,               /* [603] OBJ_ripemd160WithRSA */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x08,     /* [609] OBJ_rc5_cbc */
-0x29,0x01,0x01,0x85,0x1A,0x01,               /* [617] OBJ_rle_compression */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x08,/* [623] OBJ_zlib_compression */
-0x55,0x1D,0x25,                              /* [634] OBJ_ext_key_usage */
-0x2B,0x06,0x01,0x05,0x05,0x07,               /* [637] OBJ_id_pkix */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,          /* [643] OBJ_id_kp */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,     /* [650] OBJ_server_auth */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,     /* [658] OBJ_client_auth */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,     /* [666] OBJ_code_sign */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,     /* [674] OBJ_email_protect */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,     /* [682] OBJ_time_stamp */
-0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x15,/* [690] OBJ_ms_code_ind */
-0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x16,/* [700] OBJ_ms_code_com */
-0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x0A,0x03,0x01,/* [710] OBJ_ms_ctl_sign */
-0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x0A,0x03,0x03,/* [720] OBJ_ms_sgc */
-0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x0A,0x03,0x04,/* [730] OBJ_ms_efs */
-0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x04,0x01,/* [740] OBJ_ns_sgc */
-0x55,0x1D,0x1B,                              /* [749] OBJ_delta_crl */
-0x55,0x1D,0x15,                              /* [752] OBJ_crl_reason */
-0x55,0x1D,0x18,                              /* [755] OBJ_invalidity_date */
-0x2B,0x65,0x01,0x04,0x01,                    /* [758] OBJ_sxnet */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x01,/* [763] OBJ_pbe_WithSHA1And128BitRC4 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x02,/* [773] OBJ_pbe_WithSHA1And40BitRC4 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,/* [783] OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x04,/* [793] OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,/* [803] OBJ_pbe_WithSHA1And128BitRC2_CBC */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,/* [813] OBJ_pbe_WithSHA1And40BitRC2_CBC */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,/* [823] OBJ_keyBag */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,/* [834] OBJ_pkcs8ShroudedKeyBag */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,/* [845] OBJ_certBag */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x04,/* [856] OBJ_crlBag */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,/* [867] OBJ_secretBag */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,/* [878] OBJ_safeContentsBag */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,/* [889] OBJ_friendlyName */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,/* [898] OBJ_localKeyID */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,/* [907] OBJ_x509Certificate */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x02,/* [917] OBJ_sdsiCertificate */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x17,0x01,/* [927] OBJ_x509Crl */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,/* [937] OBJ_pbes2 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0E,/* [946] OBJ_pbmac1 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,     /* [955] OBJ_hmacWithSHA1 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x01,     /* [963] OBJ_id_qt_cps */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x02,     /* [971] OBJ_id_qt_unotice */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,/* [979] OBJ_SMIMECapabilities */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x04,/* [988] OBJ_pbeWithMD2AndRC2_CBC */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x06,/* [997] OBJ_pbeWithMD5AndRC2_CBC */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,/* [1006] OBJ_pbeWithSHA1AndDES_CBC */
-0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x0E,/* [1015] OBJ_ms_ext_req */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,/* [1025] OBJ_ext_req */
-0x55,0x04,0x29,                              /* [1034] OBJ_name */
-0x55,0x04,0x2E,                              /* [1037] OBJ_dnQualifier */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,          /* [1040] OBJ_id_pe */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,          /* [1047] OBJ_id_ad */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x01,     /* [1054] OBJ_info_access */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,     /* [1062] OBJ_ad_OCSP */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,     /* [1070] OBJ_ad_ca_issuers */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,     /* [1078] OBJ_OCSP_sign */
-0x28,                                        /* [1086] OBJ_iso */
-0x2A,                                        /* [1087] OBJ_member_body */
-0x2A,0x86,0x48,                              /* [1088] OBJ_ISO_US */
-0x2A,0x86,0x48,0xCE,0x38,                    /* [1091] OBJ_X9_57 */
-0x2A,0x86,0x48,0xCE,0x38,0x04,               /* [1096] OBJ_X9cm */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,     /* [1102] OBJ_pkcs1 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,     /* [1110] OBJ_pkcs5 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,/* [1118] OBJ_SMIME */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,/* [1127] OBJ_id_smime_mod */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,/* [1137] OBJ_id_smime_ct */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,/* [1147] OBJ_id_smime_aa */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,/* [1157] OBJ_id_smime_alg */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x04,/* [1167] OBJ_id_smime_cd */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x05,/* [1177] OBJ_id_smime_spq */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,/* [1187] OBJ_id_smime_cti */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x01,/* [1197] OBJ_id_smime_mod_cms */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x02,/* [1208] OBJ_id_smime_mod_ess */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x03,/* [1219] OBJ_id_smime_mod_oid */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x04,/* [1230] OBJ_id_smime_mod_msg_v3 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x05,/* [1241] OBJ_id_smime_mod_ets_eSignature_88 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x06,/* [1252] OBJ_id_smime_mod_ets_eSignature_97 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x07,/* [1263] OBJ_id_smime_mod_ets_eSigPolicy_88 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x08,/* [1274] OBJ_id_smime_mod_ets_eSigPolicy_97 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x01,/* [1285] OBJ_id_smime_ct_receipt */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x02,/* [1296] OBJ_id_smime_ct_authData */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x03,/* [1307] OBJ_id_smime_ct_publishCert */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,/* [1318] OBJ_id_smime_ct_TSTInfo */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x05,/* [1329] OBJ_id_smime_ct_TDTInfo */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x06,/* [1340] OBJ_id_smime_ct_contentInfo */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x07,/* [1351] OBJ_id_smime_ct_DVCSRequestData */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x08,/* [1362] OBJ_id_smime_ct_DVCSResponseData */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x01,/* [1373] OBJ_id_smime_aa_receiptRequest */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x02,/* [1384] OBJ_id_smime_aa_securityLabel */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x03,/* [1395] OBJ_id_smime_aa_mlExpandHistory */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x04,/* [1406] OBJ_id_smime_aa_contentHint */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x05,/* [1417] OBJ_id_smime_aa_msgSigDigest */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x06,/* [1428] OBJ_id_smime_aa_encapContentType */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x07,/* [1439] OBJ_id_smime_aa_contentIdentifier */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x08,/* [1450] OBJ_id_smime_aa_macValue */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x09,/* [1461] OBJ_id_smime_aa_equivalentLabels */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0A,/* [1472] OBJ_id_smime_aa_contentReference */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0B,/* [1483] OBJ_id_smime_aa_encrypKeyPref */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,/* [1494] OBJ_id_smime_aa_signingCertificate */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0D,/* [1505] OBJ_id_smime_aa_smimeEncryptCerts */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,/* [1516] OBJ_id_smime_aa_timeStampToken */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0F,/* [1527] OBJ_id_smime_aa_ets_sigPolicyId */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x10,/* [1538] OBJ_id_smime_aa_ets_commitmentType */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x11,/* [1549] OBJ_id_smime_aa_ets_signerLocation */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x12,/* [1560] OBJ_id_smime_aa_ets_signerAttr */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x13,/* [1571] OBJ_id_smime_aa_ets_otherSigCert */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x14,/* [1582] OBJ_id_smime_aa_ets_contentTimestamp */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x15,/* [1593] OBJ_id_smime_aa_ets_CertificateRefs */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x16,/* [1604] OBJ_id_smime_aa_ets_RevocationRefs */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x17,/* [1615] OBJ_id_smime_aa_ets_certValues */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x18,/* [1626] OBJ_id_smime_aa_ets_revocationValues */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x19,/* [1637] OBJ_id_smime_aa_ets_escTimeStamp */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1A,/* [1648] OBJ_id_smime_aa_ets_certCRLTimestamp */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1B,/* [1659] OBJ_id_smime_aa_ets_archiveTimeStamp */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1C,/* [1670] OBJ_id_smime_aa_signatureType */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1D,/* [1681] OBJ_id_smime_aa_dvcs_dvc */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x01,/* [1692] OBJ_id_smime_alg_ESDHwith3DES */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x02,/* [1703] OBJ_id_smime_alg_ESDHwithRC2 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x03,/* [1714] OBJ_id_smime_alg_3DESwrap */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x04,/* [1725] OBJ_id_smime_alg_RC2wrap */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x05,/* [1736] OBJ_id_smime_alg_ESDH */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x06,/* [1747] OBJ_id_smime_alg_CMS3DESwrap */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x07,/* [1758] OBJ_id_smime_alg_CMSRC2wrap */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x04,0x01,/* [1769] OBJ_id_smime_cd_ldap */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x05,0x01,/* [1780] OBJ_id_smime_spq_ets_sqt_uri */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x05,0x02,/* [1791] OBJ_id_smime_spq_ets_sqt_unotice */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x01,/* [1802] OBJ_id_smime_cti_ets_proofOfOrigin */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x02,/* [1813] OBJ_id_smime_cti_ets_proofOfReceipt */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x03,/* [1824] OBJ_id_smime_cti_ets_proofOfDelivery */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x04,/* [1835] OBJ_id_smime_cti_ets_proofOfSender */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x05,/* [1846] OBJ_id_smime_cti_ets_proofOfApproval */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x06,/* [1857] OBJ_id_smime_cti_ets_proofOfCreation */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x04,     /* [1868] OBJ_md4 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,          /* [1876] OBJ_id_pkix_mod */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x02,          /* [1883] OBJ_id_qt */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,          /* [1890] OBJ_id_it */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,          /* [1897] OBJ_id_pkip */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x06,          /* [1904] OBJ_id_alg */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,          /* [1911] OBJ_id_cmc */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x08,          /* [1918] OBJ_id_on */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x09,          /* [1925] OBJ_id_pda */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,          /* [1932] OBJ_id_aca */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0B,          /* [1939] OBJ_id_qcs */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0C,          /* [1946] OBJ_id_cct */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x01,     /* [1953] OBJ_id_pkix1_explicit_88 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x02,     /* [1961] OBJ_id_pkix1_implicit_88 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x03,     /* [1969] OBJ_id_pkix1_explicit_93 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x04,     /* [1977] OBJ_id_pkix1_implicit_93 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x05,     /* [1985] OBJ_id_mod_crmf */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x06,     /* [1993] OBJ_id_mod_cmc */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x07,     /* [2001] OBJ_id_mod_kea_profile_88 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x08,     /* [2009] OBJ_id_mod_kea_profile_93 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x09,     /* [2017] OBJ_id_mod_cmp */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0A,     /* [2025] OBJ_id_mod_qualified_cert_88 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0B,     /* [2033] OBJ_id_mod_qualified_cert_93 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0C,     /* [2041] OBJ_id_mod_attribute_cert */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0D,     /* [2049] OBJ_id_mod_timestamp_protocol */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0E,     /* [2057] OBJ_id_mod_ocsp */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0F,     /* [2065] OBJ_id_mod_dvcs */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x10,     /* [2073] OBJ_id_mod_cmp2000 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x02,     /* [2081] OBJ_biometricInfo */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x03,     /* [2089] OBJ_qcStatements */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x04,     /* [2097] OBJ_ac_auditEntity */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x05,     /* [2105] OBJ_ac_targeting */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x06,     /* [2113] OBJ_aaControls */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x07,     /* [2121] OBJ_sbgp_ipAddrBlock */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x08,     /* [2129] OBJ_sbgp_autonomousSysNum */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x09,     /* [2137] OBJ_sbgp_routerIdentifier */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x03,     /* [2145] OBJ_textNotice */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x05,     /* [2153] OBJ_ipsecEndSystem */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x06,     /* [2161] OBJ_ipsecTunnel */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x07,     /* [2169] OBJ_ipsecUser */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x0A,     /* [2177] OBJ_dvcs */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x01,     /* [2185] OBJ_id_it_caProtEncCert */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x02,     /* [2193] OBJ_id_it_signKeyPairTypes */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x03,     /* [2201] OBJ_id_it_encKeyPairTypes */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x04,     /* [2209] OBJ_id_it_preferredSymmAlg */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x05,     /* [2217] OBJ_id_it_caKeyUpdateInfo */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x06,     /* [2225] OBJ_id_it_currentCRL */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x07,     /* [2233] OBJ_id_it_unsupportedOIDs */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x08,     /* [2241] OBJ_id_it_subscriptionRequest */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x09,     /* [2249] OBJ_id_it_subscriptionResponse */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0A,     /* [2257] OBJ_id_it_keyPairParamReq */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0B,     /* [2265] OBJ_id_it_keyPairParamRep */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0C,     /* [2273] OBJ_id_it_revPassphrase */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0D,     /* [2281] OBJ_id_it_implicitConfirm */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0E,     /* [2289] OBJ_id_it_confirmWaitTime */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0F,     /* [2297] OBJ_id_it_origPKIMessage */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,     /* [2305] OBJ_id_regCtrl */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x02,     /* [2313] OBJ_id_regInfo */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x01,/* [2321] OBJ_id_regCtrl_regToken */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x02,/* [2330] OBJ_id_regCtrl_authenticator */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x03,/* [2339] OBJ_id_regCtrl_pkiPublicationInfo */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x04,/* [2348] OBJ_id_regCtrl_pkiArchiveOptions */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x05,/* [2357] OBJ_id_regCtrl_oldCertID */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x06,/* [2366] OBJ_id_regCtrl_protocolEncrKey */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x02,0x01,/* [2375] OBJ_id_regInfo_utf8Pairs */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x02,0x02,/* [2384] OBJ_id_regInfo_certReq */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x01,     /* [2393] OBJ_id_alg_des40 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,     /* [2401] OBJ_id_alg_noSignature */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x03,     /* [2409] OBJ_id_alg_dh_sig_hmac_sha1 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x04,     /* [2417] OBJ_id_alg_dh_pop */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x01,     /* [2425] OBJ_id_cmc_statusInfo */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x02,     /* [2433] OBJ_id_cmc_identification */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x03,     /* [2441] OBJ_id_cmc_identityProof */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x04,     /* [2449] OBJ_id_cmc_dataReturn */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x05,     /* [2457] OBJ_id_cmc_transactionId */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x06,     /* [2465] OBJ_id_cmc_senderNonce */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x07,     /* [2473] OBJ_id_cmc_recipientNonce */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x08,     /* [2481] OBJ_id_cmc_addExtensions */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x09,     /* [2489] OBJ_id_cmc_encryptedPOP */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x0A,     /* [2497] OBJ_id_cmc_decryptedPOP */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x0B,     /* [2505] OBJ_id_cmc_lraPOPWitness */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x0F,     /* [2513] OBJ_id_cmc_getCert */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x10,     /* [2521] OBJ_id_cmc_getCRL */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x11,     /* [2529] OBJ_id_cmc_revokeRequest */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x12,     /* [2537] OBJ_id_cmc_regInfo */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x13,     /* [2545] OBJ_id_cmc_responseInfo */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x15,     /* [2553] OBJ_id_cmc_queryPending */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x16,     /* [2561] OBJ_id_cmc_popLinkRandom */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x17,     /* [2569] OBJ_id_cmc_popLinkWitness */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x18,     /* [2577] OBJ_id_cmc_confirmCertAcceptance */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x08,0x01,     /* [2585] OBJ_id_on_personalData */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x01,     /* [2593] OBJ_id_pda_dateOfBirth */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x02,     /* [2601] OBJ_id_pda_placeOfBirth */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x03,     /* [2609] OBJ_id_pda_gender */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x04,     /* [2617] OBJ_id_pda_countryOfCitizenship */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x05,     /* [2625] OBJ_id_pda_countryOfResidence */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x01,     /* [2633] OBJ_id_aca_authenticationInfo */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x02,     /* [2641] OBJ_id_aca_accessIdentity */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x03,     /* [2649] OBJ_id_aca_chargingIdentity */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x04,     /* [2657] OBJ_id_aca_group */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x05,     /* [2665] OBJ_id_aca_role */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0B,0x01,     /* [2673] OBJ_id_qcs_pkixQCSyntax_v1 */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0C,0x01,     /* [2681] OBJ_id_cct_crs */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0C,0x02,     /* [2689] OBJ_id_cct_PKIData */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0C,0x03,     /* [2697] OBJ_id_cct_PKIResponse */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x03,     /* [2705] OBJ_ad_timeStamping */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x04,     /* [2713] OBJ_ad_dvcs */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x01,/* [2721] OBJ_id_pkix_OCSP_basic */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,/* [2730] OBJ_id_pkix_OCSP_Nonce */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x03,/* [2739] OBJ_id_pkix_OCSP_CrlID */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x04,/* [2748] OBJ_id_pkix_OCSP_acceptableResponses */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x05,/* [2757] OBJ_id_pkix_OCSP_noCheck */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x06,/* [2766] OBJ_id_pkix_OCSP_archiveCutoff */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x07,/* [2775] OBJ_id_pkix_OCSP_serviceLocator */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x08,/* [2784] OBJ_id_pkix_OCSP_extendedStatus */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x09,/* [2793] OBJ_id_pkix_OCSP_valid */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x0A,/* [2802] OBJ_id_pkix_OCSP_path */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x0B,/* [2811] OBJ_id_pkix_OCSP_trustRoot */
-0x2B,0x0E,0x03,0x02,                         /* [2820] OBJ_algorithm */
-0x2B,0x0E,0x03,0x02,0x0B,                    /* [2824] OBJ_rsaSignature */
-0x55,0x08,                                   /* [2829] OBJ_X500algorithms */
-0x2B,                                        /* [2831] OBJ_org */
-0x2B,0x06,                                   /* [2832] OBJ_dod */
-0x2B,0x06,0x01,                              /* [2834] OBJ_iana */
-0x2B,0x06,0x01,0x01,                         /* [2837] OBJ_Directory */
-0x2B,0x06,0x01,0x02,                         /* [2841] OBJ_Management */
-0x2B,0x06,0x01,0x03,                         /* [2845] OBJ_Experimental */
-0x2B,0x06,0x01,0x04,                         /* [2849] OBJ_Private */
-0x2B,0x06,0x01,0x05,                         /* [2853] OBJ_Security */
-0x2B,0x06,0x01,0x06,                         /* [2857] OBJ_SNMPv2 */
-0x2B,0x06,0x01,0x07,                         /* [2861] OBJ_Mail */
-0x2B,0x06,0x01,0x04,0x01,                    /* [2865] OBJ_Enterprises */
-0x2B,0x06,0x01,0x04,0x01,0x8B,0x3A,0x82,0x58,/* [2870] OBJ_dcObject */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x19,/* [2879] OBJ_domainComponent */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0D,/* [2889] OBJ_Domain */
-0x00,                                        /* [2899] OBJ_joint_iso_ccitt */
-0x55,0x01,0x05,                              /* [2900] OBJ_selected_attribute_types */
-0x55,0x01,0x05,0x37,                         /* [2903] OBJ_clearance */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x03,/* [2907] OBJ_md4WithRSAEncryption */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0A,     /* [2916] OBJ_ac_proxying */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0B,     /* [2924] OBJ_sinfo_access */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x06,     /* [2932] OBJ_id_aca_encAttrs */
-0x55,0x04,0x48,                              /* [2940] OBJ_role */
-0x55,0x1D,0x24,                              /* [2943] OBJ_policy_constraints */
-0x55,0x1D,0x37,                              /* [2946] OBJ_target_information */
-0x55,0x1D,0x38,                              /* [2949] OBJ_no_rev_avail */
-0x00,                                        /* [2952] OBJ_ccitt */
-0x2A,0x86,0x48,0xCE,0x3D,                    /* [2953] OBJ_ansi_X9_62 */
-0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,          /* [2958] OBJ_X9_62_prime_field */
-0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,          /* [2965] OBJ_X9_62_characteristic_two_field */
-0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,          /* [2972] OBJ_X9_62_id_ecPublicKey */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x01,     /* [2979] OBJ_X9_62_prime192v1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x02,     /* [2987] OBJ_X9_62_prime192v2 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x03,     /* [2995] OBJ_X9_62_prime192v3 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x04,     /* [3003] OBJ_X9_62_prime239v1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x05,     /* [3011] OBJ_X9_62_prime239v2 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x06,     /* [3019] OBJ_X9_62_prime239v3 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,     /* [3027] OBJ_X9_62_prime256v1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,          /* [3035] OBJ_ecdsa_with_SHA1 */
-0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,/* [3042] OBJ_ms_csp_name */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x01,/* [3051] OBJ_aes_128_ecb */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,/* [3060] OBJ_aes_128_cbc */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x03,/* [3069] OBJ_aes_128_ofb128 */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x04,/* [3078] OBJ_aes_128_cfb128 */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x15,/* [3087] OBJ_aes_192_ecb */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,/* [3096] OBJ_aes_192_cbc */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x17,/* [3105] OBJ_aes_192_ofb128 */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x18,/* [3114] OBJ_aes_192_cfb128 */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x29,/* [3123] OBJ_aes_256_ecb */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,/* [3132] OBJ_aes_256_cbc */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2B,/* [3141] OBJ_aes_256_ofb128 */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2C,/* [3150] OBJ_aes_256_cfb128 */
-0x55,0x1D,0x17,                              /* [3159] OBJ_hold_instruction_code */
-0x2A,0x86,0x48,0xCE,0x38,0x02,0x01,          /* [3162] OBJ_hold_instruction_none */
-0x2A,0x86,0x48,0xCE,0x38,0x02,0x02,          /* [3169] OBJ_hold_instruction_call_issuer */
-0x2A,0x86,0x48,0xCE,0x38,0x02,0x03,          /* [3176] OBJ_hold_instruction_reject */
-0x09,                                        /* [3183] OBJ_data */
-0x09,0x92,0x26,                              /* [3184] OBJ_pss */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,          /* [3187] OBJ_ucl */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,     /* [3194] OBJ_pilot */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,/* [3202] OBJ_pilotAttributeType */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x03,/* [3211] OBJ_pilotAttributeSyntax */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,/* [3220] OBJ_pilotObjectClass */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x0A,/* [3229] OBJ_pilotGroups */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x03,0x04,/* [3238] OBJ_iA5StringSyntax */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x03,0x05,/* [3248] OBJ_caseIgnoreIA5StringSyntax */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x03,/* [3258] OBJ_pilotObject */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x04,/* [3268] OBJ_pilotPerson */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x05,/* [3278] OBJ_account */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x06,/* [3288] OBJ_document */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x07,/* [3298] OBJ_room */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x09,/* [3308] OBJ_documentSeries */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0E,/* [3318] OBJ_rFC822localPart */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0F,/* [3328] OBJ_dNSDomain */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x11,/* [3338] OBJ_domainRelatedObject */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x12,/* [3348] OBJ_friendlyCountry */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x13,/* [3358] OBJ_simpleSecurityObject */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x14,/* [3368] OBJ_pilotOrganization */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x15,/* [3378] OBJ_pilotDSA */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x16,/* [3388] OBJ_qualityLabelledData */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x01,/* [3398] OBJ_userId */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x02,/* [3408] OBJ_textEncodedORAddress */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x03,/* [3418] OBJ_rfc822Mailbox */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x04,/* [3428] OBJ_info */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x05,/* [3438] OBJ_favouriteDrink */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x06,/* [3448] OBJ_roomNumber */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x07,/* [3458] OBJ_photo */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x08,/* [3468] OBJ_userClass */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x09,/* [3478] OBJ_host */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0A,/* [3488] OBJ_manager */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0B,/* [3498] OBJ_documentIdentifier */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0C,/* [3508] OBJ_documentTitle */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0D,/* [3518] OBJ_documentVersion */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0E,/* [3528] OBJ_documentAuthor */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0F,/* [3538] OBJ_documentLocation */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x14,/* [3548] OBJ_homeTelephoneNumber */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x15,/* [3558] OBJ_secretary */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x16,/* [3568] OBJ_otherMailbox */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x17,/* [3578] OBJ_lastModifiedTime */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x18,/* [3588] OBJ_lastModifiedBy */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1A,/* [3598] OBJ_aRecord */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1B,/* [3608] OBJ_pilotAttributeType27 */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1C,/* [3618] OBJ_mXRecord */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1D,/* [3628] OBJ_nSRecord */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1E,/* [3638] OBJ_sOARecord */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1F,/* [3648] OBJ_cNAMERecord */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x25,/* [3658] OBJ_associatedDomain */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x26,/* [3668] OBJ_associatedName */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x27,/* [3678] OBJ_homePostalAddress */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x28,/* [3688] OBJ_personalTitle */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x29,/* [3698] OBJ_mobileTelephoneNumber */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2A,/* [3708] OBJ_pagerTelephoneNumber */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2B,/* [3718] OBJ_friendlyCountryName */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2D,/* [3728] OBJ_organizationalStatus */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2E,/* [3738] OBJ_janetMailbox */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2F,/* [3748] OBJ_mailPreferenceOption */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x30,/* [3758] OBJ_buildingName */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x31,/* [3768] OBJ_dSAQuality */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x32,/* [3778] OBJ_singleLevelQuality */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x33,/* [3788] OBJ_subtreeMinimumQuality */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x34,/* [3798] OBJ_subtreeMaximumQuality */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x35,/* [3808] OBJ_personalSignature */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x36,/* [3818] OBJ_dITRedirect */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x37,/* [3828] OBJ_audio */
-0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x38,/* [3838] OBJ_documentPublisher */
-0x55,0x04,0x2D,                              /* [3848] OBJ_x500UniqueIdentifier */
-0x2B,0x06,0x01,0x07,0x01,                    /* [3851] OBJ_mime_mhs */
-0x2B,0x06,0x01,0x07,0x01,0x01,               /* [3856] OBJ_mime_mhs_headings */
-0x2B,0x06,0x01,0x07,0x01,0x02,               /* [3862] OBJ_mime_mhs_bodies */
-0x2B,0x06,0x01,0x07,0x01,0x01,0x01,          /* [3868] OBJ_id_hex_partial_message */
-0x2B,0x06,0x01,0x07,0x01,0x01,0x02,          /* [3875] OBJ_id_hex_multipart_message */
-0x55,0x04,0x2C,                              /* [3882] OBJ_generationQualifier */
-0x55,0x04,0x41,                              /* [3885] OBJ_pseudonym */
-0x67,0x2A,                                   /* [3888] OBJ_id_set */
-0x67,0x2A,0x00,                              /* [3890] OBJ_set_ctype */
-0x67,0x2A,0x01,                              /* [3893] OBJ_set_msgExt */
-0x67,0x2A,0x03,                              /* [3896] OBJ_set_attr */
-0x67,0x2A,0x05,                              /* [3899] OBJ_set_policy */
-0x67,0x2A,0x07,                              /* [3902] OBJ_set_certExt */
-0x67,0x2A,0x08,                              /* [3905] OBJ_set_brand */
-0x67,0x2A,0x00,0x00,                         /* [3908] OBJ_setct_PANData */
-0x67,0x2A,0x00,0x01,                         /* [3912] OBJ_setct_PANToken */
-0x67,0x2A,0x00,0x02,                         /* [3916] OBJ_setct_PANOnly */
-0x67,0x2A,0x00,0x03,                         /* [3920] OBJ_setct_OIData */
-0x67,0x2A,0x00,0x04,                         /* [3924] OBJ_setct_PI */
-0x67,0x2A,0x00,0x05,                         /* [3928] OBJ_setct_PIData */
-0x67,0x2A,0x00,0x06,                         /* [3932] OBJ_setct_PIDataUnsigned */
-0x67,0x2A,0x00,0x07,                         /* [3936] OBJ_setct_HODInput */
-0x67,0x2A,0x00,0x08,                         /* [3940] OBJ_setct_AuthResBaggage */
-0x67,0x2A,0x00,0x09,                         /* [3944] OBJ_setct_AuthRevReqBaggage */
-0x67,0x2A,0x00,0x0A,                         /* [3948] OBJ_setct_AuthRevResBaggage */
-0x67,0x2A,0x00,0x0B,                         /* [3952] OBJ_setct_CapTokenSeq */
-0x67,0x2A,0x00,0x0C,                         /* [3956] OBJ_setct_PInitResData */
-0x67,0x2A,0x00,0x0D,                         /* [3960] OBJ_setct_PI_TBS */
-0x67,0x2A,0x00,0x0E,                         /* [3964] OBJ_setct_PResData */
-0x67,0x2A,0x00,0x10,                         /* [3968] OBJ_setct_AuthReqTBS */
-0x67,0x2A,0x00,0x11,                         /* [3972] OBJ_setct_AuthResTBS */
-0x67,0x2A,0x00,0x12,                         /* [3976] OBJ_setct_AuthResTBSX */
-0x67,0x2A,0x00,0x13,                         /* [3980] OBJ_setct_AuthTokenTBS */
-0x67,0x2A,0x00,0x14,                         /* [3984] OBJ_setct_CapTokenData */
-0x67,0x2A,0x00,0x15,                         /* [3988] OBJ_setct_CapTokenTBS */
-0x67,0x2A,0x00,0x16,                         /* [3992] OBJ_setct_AcqCardCodeMsg */
-0x67,0x2A,0x00,0x17,                         /* [3996] OBJ_setct_AuthRevReqTBS */
-0x67,0x2A,0x00,0x18,                         /* [4000] OBJ_setct_AuthRevResData */
-0x67,0x2A,0x00,0x19,                         /* [4004] OBJ_setct_AuthRevResTBS */
-0x67,0x2A,0x00,0x1A,                         /* [4008] OBJ_setct_CapReqTBS */
-0x67,0x2A,0x00,0x1B,                         /* [4012] OBJ_setct_CapReqTBSX */
-0x67,0x2A,0x00,0x1C,                         /* [4016] OBJ_setct_CapResData */
-0x67,0x2A,0x00,0x1D,                         /* [4020] OBJ_setct_CapRevReqTBS */
-0x67,0x2A,0x00,0x1E,                         /* [4024] OBJ_setct_CapRevReqTBSX */
-0x67,0x2A,0x00,0x1F,                         /* [4028] OBJ_setct_CapRevResData */
-0x67,0x2A,0x00,0x20,                         /* [4032] OBJ_setct_CredReqTBS */
-0x67,0x2A,0x00,0x21,                         /* [4036] OBJ_setct_CredReqTBSX */
-0x67,0x2A,0x00,0x22,                         /* [4040] OBJ_setct_CredResData */
-0x67,0x2A,0x00,0x23,                         /* [4044] OBJ_setct_CredRevReqTBS */
-0x67,0x2A,0x00,0x24,                         /* [4048] OBJ_setct_CredRevReqTBSX */
-0x67,0x2A,0x00,0x25,                         /* [4052] OBJ_setct_CredRevResData */
-0x67,0x2A,0x00,0x26,                         /* [4056] OBJ_setct_PCertReqData */
-0x67,0x2A,0x00,0x27,                         /* [4060] OBJ_setct_PCertResTBS */
-0x67,0x2A,0x00,0x28,                         /* [4064] OBJ_setct_BatchAdminReqData */
-0x67,0x2A,0x00,0x29,                         /* [4068] OBJ_setct_BatchAdminResData */
-0x67,0x2A,0x00,0x2A,                         /* [4072] OBJ_setct_CardCInitResTBS */
-0x67,0x2A,0x00,0x2B,                         /* [4076] OBJ_setct_MeAqCInitResTBS */
-0x67,0x2A,0x00,0x2C,                         /* [4080] OBJ_setct_RegFormResTBS */
-0x67,0x2A,0x00,0x2D,                         /* [4084] OBJ_setct_CertReqData */
-0x67,0x2A,0x00,0x2E,                         /* [4088] OBJ_setct_CertReqTBS */
-0x67,0x2A,0x00,0x2F,                         /* [4092] OBJ_setct_CertResData */
-0x67,0x2A,0x00,0x30,                         /* [4096] OBJ_setct_CertInqReqTBS */
-0x67,0x2A,0x00,0x31,                         /* [4100] OBJ_setct_ErrorTBS */
-0x67,0x2A,0x00,0x32,                         /* [4104] OBJ_setct_PIDualSignedTBE */
-0x67,0x2A,0x00,0x33,                         /* [4108] OBJ_setct_PIUnsignedTBE */
-0x67,0x2A,0x00,0x34,                         /* [4112] OBJ_setct_AuthReqTBE */
-0x67,0x2A,0x00,0x35,                         /* [4116] OBJ_setct_AuthResTBE */
-0x67,0x2A,0x00,0x36,                         /* [4120] OBJ_setct_AuthResTBEX */
-0x67,0x2A,0x00,0x37,                         /* [4124] OBJ_setct_AuthTokenTBE */
-0x67,0x2A,0x00,0x38,                         /* [4128] OBJ_setct_CapTokenTBE */
-0x67,0x2A,0x00,0x39,                         /* [4132] OBJ_setct_CapTokenTBEX */
-0x67,0x2A,0x00,0x3A,                         /* [4136] OBJ_setct_AcqCardCodeMsgTBE */
-0x67,0x2A,0x00,0x3B,                         /* [4140] OBJ_setct_AuthRevReqTBE */
-0x67,0x2A,0x00,0x3C,                         /* [4144] OBJ_setct_AuthRevResTBE */
-0x67,0x2A,0x00,0x3D,                         /* [4148] OBJ_setct_AuthRevResTBEB */
-0x67,0x2A,0x00,0x3E,                         /* [4152] OBJ_setct_CapReqTBE */
-0x67,0x2A,0x00,0x3F,                         /* [4156] OBJ_setct_CapReqTBEX */
-0x67,0x2A,0x00,0x40,                         /* [4160] OBJ_setct_CapResTBE */
-0x67,0x2A,0x00,0x41,                         /* [4164] OBJ_setct_CapRevReqTBE */
-0x67,0x2A,0x00,0x42,                         /* [4168] OBJ_setct_CapRevReqTBEX */
-0x67,0x2A,0x00,0x43,                         /* [4172] OBJ_setct_CapRevResTBE */
-0x67,0x2A,0x00,0x44,                         /* [4176] OBJ_setct_CredReqTBE */
-0x67,0x2A,0x00,0x45,                         /* [4180] OBJ_setct_CredReqTBEX */
-0x67,0x2A,0x00,0x46,                         /* [4184] OBJ_setct_CredResTBE */
-0x67,0x2A,0x00,0x47,                         /* [4188] OBJ_setct_CredRevReqTBE */
-0x67,0x2A,0x00,0x48,                         /* [4192] OBJ_setct_CredRevReqTBEX */
-0x67,0x2A,0x00,0x49,                         /* [4196] OBJ_setct_CredRevResTBE */
-0x67,0x2A,0x00,0x4A,                         /* [4200] OBJ_setct_BatchAdminReqTBE */
-0x67,0x2A,0x00,0x4B,                         /* [4204] OBJ_setct_BatchAdminResTBE */
-0x67,0x2A,0x00,0x4C,                         /* [4208] OBJ_setct_RegFormReqTBE */
-0x67,0x2A,0x00,0x4D,                         /* [4212] OBJ_setct_CertReqTBE */
-0x67,0x2A,0x00,0x4E,                         /* [4216] OBJ_setct_CertReqTBEX */
-0x67,0x2A,0x00,0x4F,                         /* [4220] OBJ_setct_CertResTBE */
-0x67,0x2A,0x00,0x50,                         /* [4224] OBJ_setct_CRLNotificationTBS */
-0x67,0x2A,0x00,0x51,                         /* [4228] OBJ_setct_CRLNotificationResTBS */
-0x67,0x2A,0x00,0x52,                         /* [4232] OBJ_setct_BCIDistributionTBS */
-0x67,0x2A,0x01,0x01,                         /* [4236] OBJ_setext_genCrypt */
-0x67,0x2A,0x01,0x03,                         /* [4240] OBJ_setext_miAuth */
-0x67,0x2A,0x01,0x04,                         /* [4244] OBJ_setext_pinSecure */
-0x67,0x2A,0x01,0x05,                         /* [4248] OBJ_setext_pinAny */
-0x67,0x2A,0x01,0x07,                         /* [4252] OBJ_setext_track2 */
-0x67,0x2A,0x01,0x08,                         /* [4256] OBJ_setext_cv */
-0x67,0x2A,0x05,0x00,                         /* [4260] OBJ_set_policy_root */
-0x67,0x2A,0x07,0x00,                         /* [4264] OBJ_setCext_hashedRoot */
-0x67,0x2A,0x07,0x01,                         /* [4268] OBJ_setCext_certType */
-0x67,0x2A,0x07,0x02,                         /* [4272] OBJ_setCext_merchData */
-0x67,0x2A,0x07,0x03,                         /* [4276] OBJ_setCext_cCertRequired */
-0x67,0x2A,0x07,0x04,                         /* [4280] OBJ_setCext_tunneling */
-0x67,0x2A,0x07,0x05,                         /* [4284] OBJ_setCext_setExt */
-0x67,0x2A,0x07,0x06,                         /* [4288] OBJ_setCext_setQualf */
-0x67,0x2A,0x07,0x07,                         /* [4292] OBJ_setCext_PGWYcapabilities */
-0x67,0x2A,0x07,0x08,                         /* [4296] OBJ_setCext_TokenIdentifier */
-0x67,0x2A,0x07,0x09,                         /* [4300] OBJ_setCext_Track2Data */
-0x67,0x2A,0x07,0x0A,                         /* [4304] OBJ_setCext_TokenType */
-0x67,0x2A,0x07,0x0B,                         /* [4308] OBJ_setCext_IssuerCapabilities */
-0x67,0x2A,0x03,0x00,                         /* [4312] OBJ_setAttr_Cert */
-0x67,0x2A,0x03,0x01,                         /* [4316] OBJ_setAttr_PGWYcap */
-0x67,0x2A,0x03,0x02,                         /* [4320] OBJ_setAttr_TokenType */
-0x67,0x2A,0x03,0x03,                         /* [4324] OBJ_setAttr_IssCap */
-0x67,0x2A,0x03,0x00,0x00,                    /* [4328] OBJ_set_rootKeyThumb */
-0x67,0x2A,0x03,0x00,0x01,                    /* [4333] OBJ_set_addPolicy */
-0x67,0x2A,0x03,0x02,0x01,                    /* [4338] OBJ_setAttr_Token_EMV */
-0x67,0x2A,0x03,0x02,0x02,                    /* [4343] OBJ_setAttr_Token_B0Prime */
-0x67,0x2A,0x03,0x03,0x03,                    /* [4348] OBJ_setAttr_IssCap_CVM */
-0x67,0x2A,0x03,0x03,0x04,                    /* [4353] OBJ_setAttr_IssCap_T2 */
-0x67,0x2A,0x03,0x03,0x05,                    /* [4358] OBJ_setAttr_IssCap_Sig */
-0x67,0x2A,0x03,0x03,0x03,0x01,               /* [4363] OBJ_setAttr_GenCryptgrm */
-0x67,0x2A,0x03,0x03,0x04,0x01,               /* [4369] OBJ_setAttr_T2Enc */
-0x67,0x2A,0x03,0x03,0x04,0x02,               /* [4375] OBJ_setAttr_T2cleartxt */
-0x67,0x2A,0x03,0x03,0x05,0x01,               /* [4381] OBJ_setAttr_TokICCsig */
-0x67,0x2A,0x03,0x03,0x05,0x02,               /* [4387] OBJ_setAttr_SecDevSig */
-0x67,0x2A,0x08,0x01,                         /* [4393] OBJ_set_brand_IATA_ATA */
-0x67,0x2A,0x08,0x1E,                         /* [4397] OBJ_set_brand_Diners */
-0x67,0x2A,0x08,0x22,                         /* [4401] OBJ_set_brand_AmericanExpress */
-0x67,0x2A,0x08,0x23,                         /* [4405] OBJ_set_brand_JCB */
-0x67,0x2A,0x08,0x04,                         /* [4409] OBJ_set_brand_Visa */
-0x67,0x2A,0x08,0x05,                         /* [4413] OBJ_set_brand_MasterCard */
-0x67,0x2A,0x08,0xAE,0x7B,                    /* [4417] OBJ_set_brand_Novus */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x0A,     /* [4422] OBJ_des_cdmf */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x06,/* [4430] OBJ_rsaOAEPEncryptionSET */
-0x00,                                        /* [4439] OBJ_itu_t */
-0x50,                                        /* [4440] OBJ_joint_iso_itu_t */
-0x67,                                        /* [4441] OBJ_international_organizations */
-0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x02,/* [4442] OBJ_ms_smartcard_login */
-0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,/* [4452] OBJ_ms_upn */
-0x55,0x04,0x09,                              /* [4462] OBJ_streetAddress */
-0x55,0x04,0x11,                              /* [4465] OBJ_postalCode */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x15,          /* [4468] OBJ_id_ppl */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0E,     /* [4475] OBJ_proxyCertInfo */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x15,0x00,     /* [4483] OBJ_id_ppl_anyLanguage */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x15,0x01,     /* [4491] OBJ_id_ppl_inheritAll */
-0x55,0x1D,0x1E,                              /* [4499] OBJ_name_constraints */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x15,0x02,     /* [4502] OBJ_Independent */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,/* [4510] OBJ_sha256WithRSAEncryption */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,/* [4519] OBJ_sha384WithRSAEncryption */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,/* [4528] OBJ_sha512WithRSAEncryption */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0E,/* [4537] OBJ_sha224WithRSAEncryption */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,/* [4546] OBJ_sha256 */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,/* [4555] OBJ_sha384 */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,/* [4564] OBJ_sha512 */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x04,/* [4573] OBJ_sha224 */
-0x2B,                                        /* [4582] OBJ_identified_organization */
-0x2B,0x81,0x04,                              /* [4583] OBJ_certicom_arc */
-0x67,0x2B,                                   /* [4586] OBJ_wap */
-0x67,0x2B,0x01,                              /* [4588] OBJ_wap_wsg */
-0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03,     /* [4591] OBJ_X9_62_id_characteristic_two_basis */
-0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03,0x01,/* [4599] OBJ_X9_62_onBasis */
-0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03,0x02,/* [4608] OBJ_X9_62_tpBasis */
-0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03,0x03,/* [4617] OBJ_X9_62_ppBasis */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x01,     /* [4626] OBJ_X9_62_c2pnb163v1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x02,     /* [4634] OBJ_X9_62_c2pnb163v2 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x03,     /* [4642] OBJ_X9_62_c2pnb163v3 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x04,     /* [4650] OBJ_X9_62_c2pnb176v1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x05,     /* [4658] OBJ_X9_62_c2tnb191v1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x06,     /* [4666] OBJ_X9_62_c2tnb191v2 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x07,     /* [4674] OBJ_X9_62_c2tnb191v3 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x08,     /* [4682] OBJ_X9_62_c2onb191v4 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x09,     /* [4690] OBJ_X9_62_c2onb191v5 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0A,     /* [4698] OBJ_X9_62_c2pnb208w1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0B,     /* [4706] OBJ_X9_62_c2tnb239v1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0C,     /* [4714] OBJ_X9_62_c2tnb239v2 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0D,     /* [4722] OBJ_X9_62_c2tnb239v3 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0E,     /* [4730] OBJ_X9_62_c2onb239v4 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0F,     /* [4738] OBJ_X9_62_c2onb239v5 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x10,     /* [4746] OBJ_X9_62_c2pnb272w1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x11,     /* [4754] OBJ_X9_62_c2pnb304w1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x12,     /* [4762] OBJ_X9_62_c2tnb359v1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x13,     /* [4770] OBJ_X9_62_c2pnb368w1 */
-0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x14,     /* [4778] OBJ_X9_62_c2tnb431r1 */
-0x2B,0x81,0x04,0x00,0x06,                    /* [4786] OBJ_secp112r1 */
-0x2B,0x81,0x04,0x00,0x07,                    /* [4791] OBJ_secp112r2 */
-0x2B,0x81,0x04,0x00,0x1C,                    /* [4796] OBJ_secp128r1 */
-0x2B,0x81,0x04,0x00,0x1D,                    /* [4801] OBJ_secp128r2 */
-0x2B,0x81,0x04,0x00,0x09,                    /* [4806] OBJ_secp160k1 */
-0x2B,0x81,0x04,0x00,0x08,                    /* [4811] OBJ_secp160r1 */
-0x2B,0x81,0x04,0x00,0x1E,                    /* [4816] OBJ_secp160r2 */
-0x2B,0x81,0x04,0x00,0x1F,                    /* [4821] OBJ_secp192k1 */
-0x2B,0x81,0x04,0x00,0x20,                    /* [4826] OBJ_secp224k1 */
-0x2B,0x81,0x04,0x00,0x21,                    /* [4831] OBJ_secp224r1 */
-0x2B,0x81,0x04,0x00,0x0A,                    /* [4836] OBJ_secp256k1 */
-0x2B,0x81,0x04,0x00,0x22,                    /* [4841] OBJ_secp384r1 */
-0x2B,0x81,0x04,0x00,0x23,                    /* [4846] OBJ_secp521r1 */
-0x2B,0x81,0x04,0x00,0x04,                    /* [4851] OBJ_sect113r1 */
-0x2B,0x81,0x04,0x00,0x05,                    /* [4856] OBJ_sect113r2 */
-0x2B,0x81,0x04,0x00,0x16,                    /* [4861] OBJ_sect131r1 */
-0x2B,0x81,0x04,0x00,0x17,                    /* [4866] OBJ_sect131r2 */
-0x2B,0x81,0x04,0x00,0x01,                    /* [4871] OBJ_sect163k1 */
-0x2B,0x81,0x04,0x00,0x02,                    /* [4876] OBJ_sect163r1 */
-0x2B,0x81,0x04,0x00,0x0F,                    /* [4881] OBJ_sect163r2 */
-0x2B,0x81,0x04,0x00,0x18,                    /* [4886] OBJ_sect193r1 */
-0x2B,0x81,0x04,0x00,0x19,                    /* [4891] OBJ_sect193r2 */
-0x2B,0x81,0x04,0x00,0x1A,                    /* [4896] OBJ_sect233k1 */
-0x2B,0x81,0x04,0x00,0x1B,                    /* [4901] OBJ_sect233r1 */
-0x2B,0x81,0x04,0x00,0x03,                    /* [4906] OBJ_sect239k1 */
-0x2B,0x81,0x04,0x00,0x10,                    /* [4911] OBJ_sect283k1 */
-0x2B,0x81,0x04,0x00,0x11,                    /* [4916] OBJ_sect283r1 */
-0x2B,0x81,0x04,0x00,0x24,                    /* [4921] OBJ_sect409k1 */
-0x2B,0x81,0x04,0x00,0x25,                    /* [4926] OBJ_sect409r1 */
-0x2B,0x81,0x04,0x00,0x26,                    /* [4931] OBJ_sect571k1 */
-0x2B,0x81,0x04,0x00,0x27,                    /* [4936] OBJ_sect571r1 */
-0x67,0x2B,0x01,0x04,0x01,                    /* [4941] OBJ_wap_wsg_idm_ecid_wtls1 */
-0x67,0x2B,0x01,0x04,0x03,                    /* [4946] OBJ_wap_wsg_idm_ecid_wtls3 */
-0x67,0x2B,0x01,0x04,0x04,                    /* [4951] OBJ_wap_wsg_idm_ecid_wtls4 */
-0x67,0x2B,0x01,0x04,0x05,                    /* [4956] OBJ_wap_wsg_idm_ecid_wtls5 */
-0x67,0x2B,0x01,0x04,0x06,                    /* [4961] OBJ_wap_wsg_idm_ecid_wtls6 */
-0x67,0x2B,0x01,0x04,0x07,                    /* [4966] OBJ_wap_wsg_idm_ecid_wtls7 */
-0x67,0x2B,0x01,0x04,0x08,                    /* [4971] OBJ_wap_wsg_idm_ecid_wtls8 */
-0x67,0x2B,0x01,0x04,0x09,                    /* [4976] OBJ_wap_wsg_idm_ecid_wtls9 */
-0x67,0x2B,0x01,0x04,0x0A,                    /* [4981] OBJ_wap_wsg_idm_ecid_wtls10 */
-0x67,0x2B,0x01,0x04,0x0B,                    /* [4986] OBJ_wap_wsg_idm_ecid_wtls11 */
-0x67,0x2B,0x01,0x04,0x0C,                    /* [4991] OBJ_wap_wsg_idm_ecid_wtls12 */
-0x55,0x1D,0x20,0x00,                         /* [4996] OBJ_any_policy */
-0x55,0x1D,0x21,                              /* [5000] OBJ_policy_mappings */
-0x55,0x1D,0x36,                              /* [5003] OBJ_inhibit_any_policy */
-0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x01,0x02,/* [5006] OBJ_camellia_128_cbc */
-0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x01,0x03,/* [5017] OBJ_camellia_192_cbc */
-0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x01,0x04,/* [5028] OBJ_camellia_256_cbc */
-0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x01,     /* [5039] OBJ_camellia_128_ecb */
-0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x15,     /* [5047] OBJ_camellia_192_ecb */
-0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x29,     /* [5055] OBJ_camellia_256_ecb */
-0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x04,     /* [5063] OBJ_camellia_128_cfb128 */
-0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x18,     /* [5071] OBJ_camellia_192_cfb128 */
-0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x2C,     /* [5079] OBJ_camellia_256_cfb128 */
-0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x03,     /* [5087] OBJ_camellia_128_ofb128 */
-0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x17,     /* [5095] OBJ_camellia_192_ofb128 */
-0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x2B,     /* [5103] OBJ_camellia_256_ofb128 */
-0x55,0x1D,0x09,                              /* [5111] OBJ_subject_directory_attributes */
-0x55,0x1D,0x1C,                              /* [5114] OBJ_issuing_distribution_point */
-0x55,0x1D,0x1D,                              /* [5117] OBJ_certificate_issuer */
-0x2A,0x83,0x1A,0x8C,0x9A,0x44,               /* [5120] OBJ_kisa */
-0x2A,0x83,0x1A,0x8C,0x9A,0x44,0x01,0x03,     /* [5126] OBJ_seed_ecb */
-0x2A,0x83,0x1A,0x8C,0x9A,0x44,0x01,0x04,     /* [5134] OBJ_seed_cbc */
-0x2A,0x83,0x1A,0x8C,0x9A,0x44,0x01,0x06,     /* [5142] OBJ_seed_ofb128 */
-0x2A,0x83,0x1A,0x8C,0x9A,0x44,0x01,0x05,     /* [5150] OBJ_seed_cfb128 */
-0x2B,0x06,0x01,0x05,0x05,0x08,0x01,0x01,     /* [5158] OBJ_hmac_md5 */
-0x2B,0x06,0x01,0x05,0x05,0x08,0x01,0x02,     /* [5166] OBJ_hmac_sha1 */
-0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x42,0x0D,/* [5174] OBJ_id_PasswordBasedMAC */
-0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x42,0x1E,/* [5183] OBJ_id_DHBasedMac */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x10,     /* [5192] OBJ_id_it_suppLangTags */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x05,     /* [5200] OBJ_caRepository */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x09,/* [5208] OBJ_id_smime_ct_compressedData */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x1B,/* [5219] OBJ_id_ct_asciiTextWithCRLF */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x05,/* [5230] OBJ_id_aes128_wrap */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x19,/* [5239] OBJ_id_aes192_wrap */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2D,/* [5248] OBJ_id_aes256_wrap */
-0x2A,0x86,0x48,0xCE,0x3D,0x04,0x02,          /* [5257] OBJ_ecdsa_with_Recommended */
-0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,          /* [5264] OBJ_ecdsa_with_Specified */
-0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x01,     /* [5271] OBJ_ecdsa_with_SHA224 */
-0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,     /* [5279] OBJ_ecdsa_with_SHA256 */
-0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,     /* [5287] OBJ_ecdsa_with_SHA384 */
-0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,     /* [5295] OBJ_ecdsa_with_SHA512 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x06,     /* [5303] OBJ_hmacWithMD5 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x08,     /* [5311] OBJ_hmacWithSHA224 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,     /* [5319] OBJ_hmacWithSHA256 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,     /* [5327] OBJ_hmacWithSHA384 */
-0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,     /* [5335] OBJ_hmacWithSHA512 */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x01,/* [5343] OBJ_dsa_with_SHA224 */
-0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x02,/* [5352] OBJ_dsa_with_SHA256 */
-0x28,0xCF,0x06,0x03,0x00,0x37,               /* [5361] OBJ_whirlpool */
-0x2A,0x85,0x03,0x02,0x02,                    /* [5367] OBJ_cryptopro */
-0x2A,0x85,0x03,0x02,0x09,                    /* [5372] OBJ_cryptocom */
-0x2A,0x85,0x03,0x02,0x02,0x03,               /* [5377] OBJ_id_GostR3411_94_with_GostR3410_2001 */
-0x2A,0x85,0x03,0x02,0x02,0x04,               /* [5383] OBJ_id_GostR3411_94_with_GostR3410_94 */
-0x2A,0x85,0x03,0x02,0x02,0x09,               /* [5389] OBJ_id_GostR3411_94 */
-0x2A,0x85,0x03,0x02,0x02,0x0A,               /* [5395] OBJ_id_HMACGostR3411_94 */
-0x2A,0x85,0x03,0x02,0x02,0x13,               /* [5401] OBJ_id_GostR3410_2001 */
-0x2A,0x85,0x03,0x02,0x02,0x14,               /* [5407] OBJ_id_GostR3410_94 */
-0x2A,0x85,0x03,0x02,0x02,0x15,               /* [5413] OBJ_id_Gost28147_89 */
-0x2A,0x85,0x03,0x02,0x02,0x16,               /* [5419] OBJ_id_Gost28147_89_MAC */
-0x2A,0x85,0x03,0x02,0x02,0x17,               /* [5425] OBJ_id_GostR3411_94_prf */
-0x2A,0x85,0x03,0x02,0x02,0x62,               /* [5431] OBJ_id_GostR3410_2001DH */
-0x2A,0x85,0x03,0x02,0x02,0x63,               /* [5437] OBJ_id_GostR3410_94DH */
-0x2A,0x85,0x03,0x02,0x02,0x0E,0x01,          /* [5443] OBJ_id_Gost28147_89_CryptoPro_KeyMeshing */
-0x2A,0x85,0x03,0x02,0x02,0x0E,0x00,          /* [5450] OBJ_id_Gost28147_89_None_KeyMeshing */
-0x2A,0x85,0x03,0x02,0x02,0x1E,0x00,          /* [5457] OBJ_id_GostR3411_94_TestParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x1E,0x01,          /* [5464] OBJ_id_GostR3411_94_CryptoProParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x1F,0x00,          /* [5471] OBJ_id_Gost28147_89_TestParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x1F,0x01,          /* [5478] OBJ_id_Gost28147_89_CryptoPro_A_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x1F,0x02,          /* [5485] OBJ_id_Gost28147_89_CryptoPro_B_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x1F,0x03,          /* [5492] OBJ_id_Gost28147_89_CryptoPro_C_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x1F,0x04,          /* [5499] OBJ_id_Gost28147_89_CryptoPro_D_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x1F,0x05,          /* [5506] OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x1F,0x06,          /* [5513] OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x1F,0x07,          /* [5520] OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x20,0x00,          /* [5527] OBJ_id_GostR3410_94_TestParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x20,0x02,          /* [5534] OBJ_id_GostR3410_94_CryptoPro_A_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x20,0x03,          /* [5541] OBJ_id_GostR3410_94_CryptoPro_B_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x20,0x04,          /* [5548] OBJ_id_GostR3410_94_CryptoPro_C_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x20,0x05,          /* [5555] OBJ_id_GostR3410_94_CryptoPro_D_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x21,0x01,          /* [5562] OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x21,0x02,          /* [5569] OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x21,0x03,          /* [5576] OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x23,0x00,          /* [5583] OBJ_id_GostR3410_2001_TestParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x23,0x01,          /* [5590] OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x23,0x02,          /* [5597] OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x23,0x03,          /* [5604] OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x24,0x00,          /* [5611] OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x24,0x01,          /* [5618] OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet */
-0x2A,0x85,0x03,0x02,0x02,0x14,0x01,          /* [5625] OBJ_id_GostR3410_94_a */
-0x2A,0x85,0x03,0x02,0x02,0x14,0x02,          /* [5632] OBJ_id_GostR3410_94_aBis */
-0x2A,0x85,0x03,0x02,0x02,0x14,0x03,          /* [5639] OBJ_id_GostR3410_94_b */
-0x2A,0x85,0x03,0x02,0x02,0x14,0x04,          /* [5646] OBJ_id_GostR3410_94_bBis */
-0x2A,0x85,0x03,0x02,0x09,0x01,0x06,0x01,     /* [5653] OBJ_id_Gost28147_89_cc */
-0x2A,0x85,0x03,0x02,0x09,0x01,0x05,0x03,     /* [5661] OBJ_id_GostR3410_94_cc */
-0x2A,0x85,0x03,0x02,0x09,0x01,0x05,0x04,     /* [5669] OBJ_id_GostR3410_2001_cc */
-0x2A,0x85,0x03,0x02,0x09,0x01,0x03,0x03,     /* [5677] OBJ_id_GostR3411_94_with_GostR3410_94_cc */
-0x2A,0x85,0x03,0x02,0x09,0x01,0x03,0x04,     /* [5685] OBJ_id_GostR3411_94_with_GostR3410_2001_cc */
-0x2A,0x85,0x03,0x02,0x09,0x01,0x08,0x01,     /* [5693] OBJ_id_GostR3410_2001_ParamSet_cc */
-0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x02,/* [5701] OBJ_LocalKeySet */
-0x55,0x1D,0x2E,                              /* [5710] OBJ_freshest_crl */
-0x2B,0x06,0x01,0x05,0x05,0x07,0x08,0x03,     /* [5713] OBJ_id_on_permanentIdentifier */
-0x55,0x04,0x0E,                              /* [5721] OBJ_searchGuide */
-0x55,0x04,0x0F,                              /* [5724] OBJ_businessCategory */
-0x55,0x04,0x10,                              /* [5727] OBJ_postalAddress */
-0x55,0x04,0x12,                              /* [5730] OBJ_postOfficeBox */
-0x55,0x04,0x13,                              /* [5733] OBJ_physicalDeliveryOfficeName */
-0x55,0x04,0x14,                              /* [5736] OBJ_telephoneNumber */
-0x55,0x04,0x15,                              /* [5739] OBJ_telexNumber */
-0x55,0x04,0x16,                              /* [5742] OBJ_teletexTerminalIdentifier */
-0x55,0x04,0x17,                              /* [5745] OBJ_facsimileTelephoneNumber */
-0x55,0x04,0x18,                              /* [5748] OBJ_x121Address */
-0x55,0x04,0x19,                              /* [5751] OBJ_internationaliSDNNumber */
-0x55,0x04,0x1A,                              /* [5754] OBJ_registeredAddress */
-0x55,0x04,0x1B,                              /* [5757] OBJ_destinationIndicator */
-0x55,0x04,0x1C,                              /* [5760] OBJ_preferredDeliveryMethod */
-0x55,0x04,0x1D,                              /* [5763] OBJ_presentationAddress */
-0x55,0x04,0x1E,                              /* [5766] OBJ_supportedApplicationContext */
-0x55,0x04,0x1F,                              /* [5769] OBJ_member */
-0x55,0x04,0x20,                              /* [5772] OBJ_owner */
-0x55,0x04,0x21,                              /* [5775] OBJ_roleOccupant */
-0x55,0x04,0x22,                              /* [5778] OBJ_seeAlso */
-0x55,0x04,0x23,                              /* [5781] OBJ_userPassword */
-0x55,0x04,0x24,                              /* [5784] OBJ_userCertificate */
-0x55,0x04,0x25,                              /* [5787] OBJ_cACertificate */
-0x55,0x04,0x26,                              /* [5790] OBJ_authorityRevocationList */
-0x55,0x04,0x27,                              /* [5793] OBJ_certificateRevocationList */
-0x55,0x04,0x28,                              /* [5796] OBJ_crossCertificatePair */
-0x55,0x04,0x2F,                              /* [5799] OBJ_enhancedSearchGuide */
-0x55,0x04,0x30,                              /* [5802] OBJ_protocolInformation */
-0x55,0x04,0x31,                              /* [5805] OBJ_distinguishedName */
-0x55,0x04,0x32,                              /* [5808] OBJ_uniqueMember */
-0x55,0x04,0x33,                              /* [5811] OBJ_houseIdentifier */
-0x55,0x04,0x34,                              /* [5814] OBJ_supportedAlgorithms */
-0x55,0x04,0x35,                              /* [5817] OBJ_deltaRevocationList */
-0x55,0x04,0x36,                              /* [5820] OBJ_dmdName */
-};
+LVALUES_START
+I(0x00)                                                /* [  0] OBJ_undef */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D)        /* [  1] OBJ_rsadsi */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) /* [  7] OBJ_pkcs */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x02) I(0x02) /* [ 14] OBJ_md2 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x02) I(0x05) /* [ 22] OBJ_md5 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x03) I(0x04) /* [ 30] OBJ_rc4 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) I(0x01) /* [ 38] OBJ_rsaEncryption */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) I(0x02) /* [ 47] OBJ_md2WithRSAEncryption */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) I(0x04) /* [ 56] OBJ_md5WithRSAEncryption */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x05) I(0x01) /* [ 65] OBJ_pbeWithMD2AndDES_CBC */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x05) I(0x03) /* [ 74] OBJ_pbeWithMD5AndDES_CBC */
+I(0x55)                                                /* [ 83] OBJ_X500 */
+I(0x55) I(0x04)                                        /* [ 84] OBJ_X509 */
+I(0x55) I(0x04) I(0x03)                                /* [ 86] OBJ_commonName */
+I(0x55) I(0x04) I(0x06)                                /* [ 89] OBJ_countryName */
+I(0x55) I(0x04) I(0x07)                                /* [ 92] OBJ_localityName */
+I(0x55) I(0x04) I(0x08)                                /* [ 95] OBJ_stateOrProvinceName */
+I(0x55) I(0x04) I(0x0A)                                /* [ 98] OBJ_organizationName */
+I(0x55) I(0x04) I(0x0B)                                /* [101] OBJ_organizationalUnitName */
+I(0x55) I(0x08) I(0x01) I(0x01)                        /* [104] OBJ_rsa */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x07) /* [108] OBJ_pkcs7 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x07) I(0x01) /* [116] OBJ_pkcs7_data */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x07) I(0x02) /* [125] OBJ_pkcs7_signed */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x07) I(0x03) /* [134] OBJ_pkcs7_enveloped */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x07) I(0x04) /* [143] OBJ_pkcs7_signedAndEnveloped */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x07) I(0x05) /* [152] OBJ_pkcs7_digest */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x07) I(0x06) /* [161] OBJ_pkcs7_encrypted */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x03) /* [170] OBJ_pkcs3 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x03) I(0x01) /* [178] OBJ_dhKeyAgreement */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x06)                /* [187] OBJ_des_ecb */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x09)                /* [192] OBJ_des_cfb64 */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x07)                /* [197] OBJ_des_cbc */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x11)                /* [202] OBJ_des_ede_ecb */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x81) I(0x3C) I(0x07) I(0x01) I(0x01) I(0x02) /* [207] OBJ_idea_cbc */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x03) I(0x02) /* [218] OBJ_rc2_cbc */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x12)                /* [226] OBJ_sha */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x0F)                /* [231] OBJ_shaWithRSAEncryption */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x03) I(0x07) /* [236] OBJ_des_ede3_cbc */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x08)                /* [244] OBJ_des_ofb64 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) /* [249] OBJ_pkcs9 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x01) /* [257] OBJ_pkcs9_emailAddress */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x02) /* [266] OBJ_pkcs9_unstructuredName */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x03) /* [275] OBJ_pkcs9_contentType */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x04) /* [284] OBJ_pkcs9_messageDigest */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x05) /* [293] OBJ_pkcs9_signingTime */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x06) /* [302] OBJ_pkcs9_countersignature */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x07) /* [311] OBJ_pkcs9_challengePassword */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x08) /* [320] OBJ_pkcs9_unstructuredAddress */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x09) /* [329] OBJ_pkcs9_extCertAttributes */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) /* [338] OBJ_netscape */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x01) /* [345] OBJ_netscape_cert_extension */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x02) /* [353] OBJ_netscape_data_type */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x1A)                /* [361] OBJ_sha1 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) I(0x05) /* [366] OBJ_sha1WithRSAEncryption */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x0D)                /* [375] OBJ_dsaWithSHA */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x0C)                /* [380] OBJ_dsa_2 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x05) I(0x0B) /* [385] OBJ_pbeWithSHA1AndRC2_CBC */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x05) I(0x0C) /* [394] OBJ_id_pbkdf2 */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x1B)                /* [403] OBJ_dsaWithSHA1_2 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x01) I(0x01) /* [408] OBJ_netscape_cert_type */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x01) I(0x02) /* [417] OBJ_netscape_base_url */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x01) I(0x03) /* [426] OBJ_netscape_revocation_url */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x01) I(0x04) /* [435] OBJ_netscape_ca_revocation_url */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x01) I(0x07) /* [444] OBJ_netscape_renewal_url */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x01) I(0x08) /* [453] OBJ_netscape_ca_policy_url */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x01) I(0x0C) /* [462] OBJ_netscape_ssl_server_name */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x01) I(0x0D) /* [471] OBJ_netscape_comment */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x02) I(0x05) /* [480] OBJ_netscape_cert_sequence */
+I(0x55) I(0x1D)                                        /* [489] OBJ_id_ce */
+I(0x55) I(0x1D) I(0x0E)                                /* [491] OBJ_subject_key_identifier */
+I(0x55) I(0x1D) I(0x0F)                                /* [494] OBJ_key_usage */
+I(0x55) I(0x1D) I(0x10)                                /* [497] OBJ_private_key_usage_period */
+I(0x55) I(0x1D) I(0x11)                                /* [500] OBJ_subject_alt_name */
+I(0x55) I(0x1D) I(0x12)                                /* [503] OBJ_issuer_alt_name */
+I(0x55) I(0x1D) I(0x13)                                /* [506] OBJ_basic_constraints */
+I(0x55) I(0x1D) I(0x14)                                /* [509] OBJ_crl_number */
+I(0x55) I(0x1D) I(0x20)                                /* [512] OBJ_certificate_policies */
+I(0x55) I(0x1D) I(0x23)                                /* [515] OBJ_authority_key_identifier */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x97) I(0x55) I(0x01) I(0x02) /* [518] OBJ_bf_cbc */
+I(0x55) I(0x08) I(0x03) I(0x65)                        /* [527] OBJ_mdc2 */
+I(0x55) I(0x08) I(0x03) I(0x64)                        /* [531] OBJ_mdc2WithRSA */
+I(0x55) I(0x04) I(0x2A)                                /* [535] OBJ_givenName */
+I(0x55) I(0x04) I(0x04)                                /* [538] OBJ_surname */
+I(0x55) I(0x04) I(0x2B)                                /* [541] OBJ_initials */
+I(0x55) I(0x1D) I(0x1F)                                /* [544] OBJ_crl_distribution_points */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x03)                /* [547] OBJ_md5WithRSA */
+I(0x55) I(0x04) I(0x05)                                /* [552] OBJ_serialNumber */
+I(0x55) I(0x04) I(0x0C)                                /* [555] OBJ_title */
+I(0x55) I(0x04) I(0x0D)                                /* [558] OBJ_description */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF6) I(0x7D) I(0x07) I(0x42) I(0x0A) /* [561] OBJ_cast5_cbc */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF6) I(0x7D) I(0x07) I(0x42) I(0x0C) /* [570] OBJ_pbeWithMD5AndCast5_CBC */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x38) I(0x04) I(0x03) /* [579] OBJ_dsaWithSHA1 */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x1D)                /* [586] OBJ_sha1WithRSA */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x38) I(0x04) I(0x01) /* [591] OBJ_dsa */
+I(0x2B) I(0x24) I(0x03) I(0x02) I(0x01)                /* [598] OBJ_ripemd160 */
+I(0x2B) I(0x24) I(0x03) I(0x03) I(0x01) I(0x02)        /* [603] OBJ_ripemd160WithRSA */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x03) I(0x08) /* [609] OBJ_rc5_cbc */
+I(0x29) I(0x01) I(0x01) I(0x85) I(0x1A) I(0x01)        /* [617] OBJ_rle_compression */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x03) I(0x08) /* [623] OBJ_zlib_compression */
+I(0x55) I(0x1D) I(0x25)                                /* [634] OBJ_ext_key_usage */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07)        /* [637] OBJ_id_pkix */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) /* [643] OBJ_id_kp */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) I(0x01) /* [650] OBJ_server_auth */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) I(0x02) /* [658] OBJ_client_auth */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) I(0x03) /* [666] OBJ_code_sign */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) I(0x04) /* [674] OBJ_email_protect */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) I(0x08) /* [682] OBJ_time_stamp */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x82) I(0x37) I(0x02) I(0x01) I(0x15) /* [690] OBJ_ms_code_ind */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x82) I(0x37) I(0x02) I(0x01) I(0x16) /* [700] OBJ_ms_code_com */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x82) I(0x37) I(0x0A) I(0x03) I(0x01) /* [710] OBJ_ms_ctl_sign */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x82) I(0x37) I(0x0A) I(0x03) I(0x03) /* [720] OBJ_ms_sgc */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x82) I(0x37) I(0x0A) I(0x03) I(0x04) /* [730] OBJ_ms_efs */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x86) I(0xF8) I(0x42) I(0x04) I(0x01) /* [740] OBJ_ns_sgc */
+I(0x55) I(0x1D) I(0x1B)                                /* [749] OBJ_delta_crl */
+I(0x55) I(0x1D) I(0x15)                                /* [752] OBJ_crl_reason */
+I(0x55) I(0x1D) I(0x18)                                /* [755] OBJ_invalidity_date */
+I(0x2B) I(0x65) I(0x01) I(0x04) I(0x01)                /* [758] OBJ_sxnet */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x01) I(0x01) /* [763] OBJ_pbe_WithSHA1And128BitRC4 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x01) I(0x02) /* [773] OBJ_pbe_WithSHA1And40BitRC4 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x01) I(0x03) /* [783] OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x01) I(0x04) /* [793] OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x01) I(0x05) /* [803] OBJ_pbe_WithSHA1And128BitRC2_CBC */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x01) I(0x06) /* [813] OBJ_pbe_WithSHA1And40BitRC2_CBC */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x0A) I(0x01) I(0x01) /* [823] OBJ_keyBag */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x0A) I(0x01) I(0x02) /* [834] OBJ_pkcs8ShroudedKeyBag */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x0A) I(0x01) I(0x03) /* [845] OBJ_certBag */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x0A) I(0x01) I(0x04) /* [856] OBJ_crlBag */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x0A) I(0x01) I(0x05) /* [867] OBJ_secretBag */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x0C) I(0x0A) I(0x01) I(0x06) /* [878] OBJ_safeContentsBag */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x14) /* [889] OBJ_friendlyName */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x15) /* [898] OBJ_localKeyID */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x16) I(0x01) /* [907] OBJ_x509Certificate */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x16) I(0x02) /* [917] OBJ_sdsiCertificate */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x17) I(0x01) /* [927] OBJ_x509Crl */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x05) I(0x0D) /* [937] OBJ_pbes2 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x05) I(0x0E) /* [946] OBJ_pbmac1 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x02) I(0x07) /* [955] OBJ_hmacWithSHA1 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x02) I(0x01) /* [963] OBJ_id_qt_cps */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x02) I(0x02) /* [971] OBJ_id_qt_unotice */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x0F) /* [979] OBJ_SMIMECapabilities */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x05) I(0x04) /* [988] OBJ_pbeWithMD2AndRC2_CBC */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x05) I(0x06) /* [997] OBJ_pbeWithMD5AndRC2_CBC */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x05) I(0x0A) /* [1006] OBJ_pbeWithSHA1AndDES_CBC */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x82) I(0x37) I(0x02) I(0x01) I(0x0E) /* [1015] OBJ_ms_ext_req */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x0E) /* [1025] OBJ_ext_req */
+I(0x55) I(0x04) I(0x29)                                /* [1034] OBJ_name */
+I(0x55) I(0x04) I(0x2E)                                /* [1037] OBJ_dnQualifier */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) /* [1040] OBJ_id_pe */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) /* [1047] OBJ_id_ad */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x01) /* [1054] OBJ_info_access */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) /* [1062] OBJ_ad_OCSP */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x02) /* [1070] OBJ_ad_ca_issuers */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) I(0x09) /* [1078] OBJ_OCSP_sign */
+I(0x28)                                                /* [1086] OBJ_iso */
+I(0x2A)                                                /* [1087] OBJ_member_body */
+I(0x2A) I(0x86) I(0x48)                                /* [1088] OBJ_ISO_US */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x38)                /* [1091] OBJ_X9_57 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x38) I(0x04)        /* [1096] OBJ_X9cm */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) /* [1102] OBJ_pkcs1 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x05) /* [1110] OBJ_pkcs5 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) /* [1118] OBJ_SMIME */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x00) /* [1127] OBJ_id_smime_mod */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) /* [1137] OBJ_id_smime_ct */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) /* [1147] OBJ_id_smime_aa */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x03) /* [1157] OBJ_id_smime_alg */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x04) /* [1167] OBJ_id_smime_cd */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x05) /* [1177] OBJ_id_smime_spq */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x06) /* [1187] OBJ_id_smime_cti */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x00) I(0x01) /* [1197] OBJ_id_smime_mod_cms */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x00) I(0x02) /* [1208] OBJ_id_smime_mod_ess */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x00) I(0x03) /* [1219] OBJ_id_smime_mod_oid */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x00) I(0x04) /* [1230] OBJ_id_smime_mod_msg_v3 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x00) I(0x05) /* [1241] OBJ_id_smime_mod_ets_eSignature_88 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x00) I(0x06) /* [1252] OBJ_id_smime_mod_ets_eSignature_97 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x00) I(0x07) /* [1263] OBJ_id_smime_mod_ets_eSigPolicy_88 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x00) I(0x08) /* [1274] OBJ_id_smime_mod_ets_eSigPolicy_97 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) I(0x01) /* [1285] OBJ_id_smime_ct_receipt */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) I(0x02) /* [1296] OBJ_id_smime_ct_authData */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) I(0x03) /* [1307] OBJ_id_smime_ct_publishCert */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) I(0x04) /* [1318] OBJ_id_smime_ct_TSTInfo */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) I(0x05) /* [1329] OBJ_id_smime_ct_TDTInfo */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) I(0x06) /* [1340] OBJ_id_smime_ct_contentInfo */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) I(0x07) /* [1351] OBJ_id_smime_ct_DVCSRequestData */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) I(0x08) /* [1362] OBJ_id_smime_ct_DVCSResponseData */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x01) /* [1373] OBJ_id_smime_aa_receiptRequest */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x02) /* [1384] OBJ_id_smime_aa_securityLabel */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x03) /* [1395] OBJ_id_smime_aa_mlExpandHistory */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x04) /* [1406] OBJ_id_smime_aa_contentHint */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x05) /* [1417] OBJ_id_smime_aa_msgSigDigest */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x06) /* [1428] OBJ_id_smime_aa_encapContentType */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x07) /* [1439] OBJ_id_smime_aa_contentIdentifier */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x08) /* [1450] OBJ_id_smime_aa_macValue */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x09) /* [1461] OBJ_id_smime_aa_equivalentLabels */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x0A) /* [1472] OBJ_id_smime_aa_contentReference */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x0B) /* [1483] OBJ_id_smime_aa_encrypKeyPref */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x0C) /* [1494] OBJ_id_smime_aa_signingCertificate */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x0D) /* [1505] OBJ_id_smime_aa_smimeEncryptCerts */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x0E) /* [1516] OBJ_id_smime_aa_timeStampToken */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x0F) /* [1527] OBJ_id_smime_aa_ets_sigPolicyId */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x10) /* [1538] OBJ_id_smime_aa_ets_commitmentType */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x11) /* [1549] OBJ_id_smime_aa_ets_signerLocation */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x12) /* [1560] OBJ_id_smime_aa_ets_signerAttr */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x13) /* [1571] OBJ_id_smime_aa_ets_otherSigCert */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x14) /* [1582] OBJ_id_smime_aa_ets_contentTimestamp */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x15) /* [1593] OBJ_id_smime_aa_ets_CertificateRefs */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x16) /* [1604] OBJ_id_smime_aa_ets_RevocationRefs */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x17) /* [1615] OBJ_id_smime_aa_ets_certValues */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x18) /* [1626] OBJ_id_smime_aa_ets_revocationValues */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x19) /* [1637] OBJ_id_smime_aa_ets_escTimeStamp */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x1A) /* [1648] OBJ_id_smime_aa_ets_certCRLTimestamp */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x1B) /* [1659] OBJ_id_smime_aa_ets_archiveTimeStamp */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x1C) /* [1670] OBJ_id_smime_aa_signatureType */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x02) I(0x1D) /* [1681] OBJ_id_smime_aa_dvcs_dvc */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x03) I(0x01) /* [1692] OBJ_id_smime_alg_ESDHwith3DES */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x03) I(0x02) /* [1703] OBJ_id_smime_alg_ESDHwithRC2 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x03) I(0x03) /* [1714] OBJ_id_smime_alg_3DESwrap */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x03) I(0x04) /* [1725] OBJ_id_smime_alg_RC2wrap */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x03) I(0x05) /* [1736] OBJ_id_smime_alg_ESDH */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x03) I(0x06) /* [1747] OBJ_id_smime_alg_CMS3DESwrap */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x03) I(0x07) /* [1758] OBJ_id_smime_alg_CMSRC2wrap */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x04) I(0x01) /* [1769] OBJ_id_smime_cd_ldap */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x05) I(0x01) /* [1780] OBJ_id_smime_spq_ets_sqt_uri */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x05) I(0x02) /* [1791] OBJ_id_smime_spq_ets_sqt_unotice */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x06) I(0x01) /* [1802] OBJ_id_smime_cti_ets_proofOfOrigin */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x06) I(0x02) /* [1813] OBJ_id_smime_cti_ets_proofOfReceipt */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x06) I(0x03) /* [1824] OBJ_id_smime_cti_ets_proofOfDelivery */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x06) I(0x04) /* [1835] OBJ_id_smime_cti_ets_proofOfSender */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x06) I(0x05) /* [1846] OBJ_id_smime_cti_ets_proofOfApproval */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x06) I(0x06) /* [1857] OBJ_id_smime_cti_ets_proofOfCreation */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x02) I(0x04) /* [1868] OBJ_md4 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) /* [1876] OBJ_id_pkix_mod */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x02) /* [1883] OBJ_id_qt */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) /* [1890] OBJ_id_it */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) /* [1897] OBJ_id_pkip */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x06) /* [1904] OBJ_id_alg */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) /* [1911] OBJ_id_cmc */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x08) /* [1918] OBJ_id_on */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x09) /* [1925] OBJ_id_pda */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0A) /* [1932] OBJ_id_aca */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0B) /* [1939] OBJ_id_qcs */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0C) /* [1946] OBJ_id_cct */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x01) /* [1953] OBJ_id_pkix1_explicit_88 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x02) /* [1961] OBJ_id_pkix1_implicit_88 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x03) /* [1969] OBJ_id_pkix1_explicit_93 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x04) /* [1977] OBJ_id_pkix1_implicit_93 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x05) /* [1985] OBJ_id_mod_crmf */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x06) /* [1993] OBJ_id_mod_cmc */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x07) /* [2001] OBJ_id_mod_kea_profile_88 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x08) /* [2009] OBJ_id_mod_kea_profile_93 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x09) /* [2017] OBJ_id_mod_cmp */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x0A) /* [2025] OBJ_id_mod_qualified_cert_88 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x0B) /* [2033] OBJ_id_mod_qualified_cert_93 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x0C) /* [2041] OBJ_id_mod_attribute_cert */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x0D) /* [2049] OBJ_id_mod_timestamp_protocol */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x0E) /* [2057] OBJ_id_mod_ocsp */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x0F) /* [2065] OBJ_id_mod_dvcs */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x00) I(0x10) /* [2073] OBJ_id_mod_cmp2000 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x02) /* [2081] OBJ_biometricInfo */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x03) /* [2089] OBJ_qcStatements */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x04) /* [2097] OBJ_ac_auditEntity */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x05) /* [2105] OBJ_ac_targeting */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x06) /* [2113] OBJ_aaControls */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x07) /* [2121] OBJ_sbgp_ipAddrBlock */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x08) /* [2129] OBJ_sbgp_autonomousSysNum */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x09) /* [2137] OBJ_sbgp_routerIdentifier */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x02) I(0x03) /* [2145] OBJ_textNotice */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) I(0x05) /* [2153] OBJ_ipsecEndSystem */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) I(0x06) /* [2161] OBJ_ipsecTunnel */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) I(0x07) /* [2169] OBJ_ipsecUser */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x03) I(0x0A) /* [2177] OBJ_dvcs */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x01) /* [2185] OBJ_id_it_caProtEncCert */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x02) /* [2193] OBJ_id_it_signKeyPairTypes */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x03) /* [2201] OBJ_id_it_encKeyPairTypes */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x04) /* [2209] OBJ_id_it_preferredSymmAlg */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x05) /* [2217] OBJ_id_it_caKeyUpdateInfo */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x06) /* [2225] OBJ_id_it_currentCRL */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x07) /* [2233] OBJ_id_it_unsupportedOIDs */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x08) /* [2241] OBJ_id_it_subscriptionRequest */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x09) /* [2249] OBJ_id_it_subscriptionResponse */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x0A) /* [2257] OBJ_id_it_keyPairParamReq */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x0B) /* [2265] OBJ_id_it_keyPairParamRep */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x0C) /* [2273] OBJ_id_it_revPassphrase */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x0D) /* [2281] OBJ_id_it_implicitConfirm */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x0E) /* [2289] OBJ_id_it_confirmWaitTime */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x0F) /* [2297] OBJ_id_it_origPKIMessage */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) I(0x01) /* [2305] OBJ_id_regCtrl */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) I(0x02) /* [2313] OBJ_id_regInfo */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) I(0x01) I(0x01) /* [2321] OBJ_id_regCtrl_regToken */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) I(0x01) I(0x02) /* [2330] OBJ_id_regCtrl_authenticator */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) I(0x01) I(0x03) /* [2339] OBJ_id_regCtrl_pkiPublicationInfo */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) I(0x01) I(0x04) /* [2348] OBJ_id_regCtrl_pkiArchiveOptions */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) I(0x01) I(0x05) /* [2357] OBJ_id_regCtrl_oldCertID */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) I(0x01) I(0x06) /* [2366] OBJ_id_regCtrl_protocolEncrKey */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) I(0x02) I(0x01) /* [2375] OBJ_id_regInfo_utf8Pairs */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x05) I(0x02) I(0x02) /* [2384] OBJ_id_regInfo_certReq */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x06) I(0x01) /* [2393] OBJ_id_alg_des40 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x06) I(0x02) /* [2401] OBJ_id_alg_noSignature */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x06) I(0x03) /* [2409] OBJ_id_alg_dh_sig_hmac_sha1 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x06) I(0x04) /* [2417] OBJ_id_alg_dh_pop */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x01) /* [2425] OBJ_id_cmc_statusInfo */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x02) /* [2433] OBJ_id_cmc_identification */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x03) /* [2441] OBJ_id_cmc_identityProof */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x04) /* [2449] OBJ_id_cmc_dataReturn */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x05) /* [2457] OBJ_id_cmc_transactionId */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x06) /* [2465] OBJ_id_cmc_senderNonce */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x07) /* [2473] OBJ_id_cmc_recipientNonce */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x08) /* [2481] OBJ_id_cmc_addExtensions */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x09) /* [2489] OBJ_id_cmc_encryptedPOP */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x0A) /* [2497] OBJ_id_cmc_decryptedPOP */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x0B) /* [2505] OBJ_id_cmc_lraPOPWitness */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x0F) /* [2513] OBJ_id_cmc_getCert */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x10) /* [2521] OBJ_id_cmc_getCRL */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x11) /* [2529] OBJ_id_cmc_revokeRequest */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x12) /* [2537] OBJ_id_cmc_regInfo */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x13) /* [2545] OBJ_id_cmc_responseInfo */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x15) /* [2553] OBJ_id_cmc_queryPending */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x16) /* [2561] OBJ_id_cmc_popLinkRandom */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x17) /* [2569] OBJ_id_cmc_popLinkWitness */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x07) I(0x18) /* [2577] OBJ_id_cmc_confirmCertAcceptance */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x08) I(0x01) /* [2585] OBJ_id_on_personalData */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x09) I(0x01) /* [2593] OBJ_id_pda_dateOfBirth */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x09) I(0x02) /* [2601] OBJ_id_pda_placeOfBirth */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x09) I(0x03) /* [2609] OBJ_id_pda_gender */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x09) I(0x04) /* [2617] OBJ_id_pda_countryOfCitizenship */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x09) I(0x05) /* [2625] OBJ_id_pda_countryOfResidence */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0A) I(0x01) /* [2633] OBJ_id_aca_authenticationInfo */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0A) I(0x02) /* [2641] OBJ_id_aca_accessIdentity */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0A) I(0x03) /* [2649] OBJ_id_aca_chargingIdentity */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0A) I(0x04) /* [2657] OBJ_id_aca_group */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0A) I(0x05) /* [2665] OBJ_id_aca_role */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0B) I(0x01) /* [2673] OBJ_id_qcs_pkixQCSyntax_v1 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0C) I(0x01) /* [2681] OBJ_id_cct_crs */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0C) I(0x02) /* [2689] OBJ_id_cct_PKIData */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0C) I(0x03) /* [2697] OBJ_id_cct_PKIResponse */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x03) /* [2705] OBJ_ad_timeStamping */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x04) /* [2713] OBJ_ad_dvcs */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x01) /* [2721] OBJ_id_pkix_OCSP_basic */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x02) /* [2730] OBJ_id_pkix_OCSP_Nonce */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x03) /* [2739] OBJ_id_pkix_OCSP_CrlID */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x04) /* [2748] OBJ_id_pkix_OCSP_acceptableResponses */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x05) /* [2757] OBJ_id_pkix_OCSP_noCheck */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x06) /* [2766] OBJ_id_pkix_OCSP_archiveCutoff */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x07) /* [2775] OBJ_id_pkix_OCSP_serviceLocator */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x08) /* [2784] OBJ_id_pkix_OCSP_extendedStatus */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x09) /* [2793] OBJ_id_pkix_OCSP_valid */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x0A) /* [2802] OBJ_id_pkix_OCSP_path */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x01) I(0x0B) /* [2811] OBJ_id_pkix_OCSP_trustRoot */
+I(0x2B) I(0x0E) I(0x03) I(0x02)                        /* [2820] OBJ_algorithm */
+I(0x2B) I(0x0E) I(0x03) I(0x02) I(0x0B)                /* [2824] OBJ_rsaSignature */
+I(0x55) I(0x08)                                        /* [2829] OBJ_X500algorithms */
+I(0x2B)                                                /* [2831] OBJ_org */
+I(0x2B) I(0x06)                                        /* [2832] OBJ_dod */
+I(0x2B) I(0x06) I(0x01)                                /* [2834] OBJ_iana */
+I(0x2B) I(0x06) I(0x01) I(0x01)                        /* [2837] OBJ_Directory */
+I(0x2B) I(0x06) I(0x01) I(0x02)                        /* [2841] OBJ_Management */
+I(0x2B) I(0x06) I(0x01) I(0x03)                        /* [2845] OBJ_Experimental */
+I(0x2B) I(0x06) I(0x01) I(0x04)                        /* [2849] OBJ_Private */
+I(0x2B) I(0x06) I(0x01) I(0x05)                        /* [2853] OBJ_Security */
+I(0x2B) I(0x06) I(0x01) I(0x06)                        /* [2857] OBJ_SNMPv2 */
+I(0x2B) I(0x06) I(0x01) I(0x07)                        /* [2861] OBJ_Mail */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01)                /* [2865] OBJ_Enterprises */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x8B) I(0x3A) I(0x82) I(0x58) /* [2870] OBJ_dcObject */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x19) /* [2879] OBJ_domainComponent */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x0D) /* [2889] OBJ_Domain */
+I(0x00)                                                /* [2899] OBJ_joint_iso_ccitt */
+I(0x55) I(0x01) I(0x05)                                /* [2900] OBJ_selected_attribute_types */
+I(0x55) I(0x01) I(0x05) I(0x37)                        /* [2903] OBJ_clearance */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) I(0x03) /* [2907] OBJ_md4WithRSAEncryption */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x0A) /* [2916] OBJ_ac_proxying */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x0B) /* [2924] OBJ_sinfo_access */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x0A) I(0x06) /* [2932] OBJ_id_aca_encAttrs */
+I(0x55) I(0x04) I(0x48)                                /* [2940] OBJ_role */
+I(0x55) I(0x1D) I(0x24)                                /* [2943] OBJ_policy_constraints */
+I(0x55) I(0x1D) I(0x37)                                /* [2946] OBJ_target_information */
+I(0x55) I(0x1D) I(0x38)                                /* [2949] OBJ_no_rev_avail */
+I(0x00)                                                /* [2952] OBJ_ccitt */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D)                /* [2953] OBJ_ansi_X9_62 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x01) I(0x01) /* [2958] OBJ_X9_62_prime_field */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x01) I(0x02) /* [2965] OBJ_X9_62_characteristic_two_field */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x02) I(0x01) /* [2972] OBJ_X9_62_id_ecPublicKey */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x01) I(0x01) /* [2979] OBJ_X9_62_prime192v1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x01) I(0x02) /* [2987] OBJ_X9_62_prime192v2 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x01) I(0x03) /* [2995] OBJ_X9_62_prime192v3 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x01) I(0x04) /* [3003] OBJ_X9_62_prime239v1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x01) I(0x05) /* [3011] OBJ_X9_62_prime239v2 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x01) I(0x06) /* [3019] OBJ_X9_62_prime239v3 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x01) I(0x07) /* [3027] OBJ_X9_62_prime256v1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x04) I(0x01) /* [3035] OBJ_ecdsa_with_SHA1 */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x82) I(0x37) I(0x11) I(0x01) /* [3042] OBJ_ms_csp_name */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x01) /* [3051] OBJ_aes_128_ecb */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x02) /* [3060] OBJ_aes_128_cbc */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x03) /* [3069] OBJ_aes_128_ofb128 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x04) /* [3078] OBJ_aes_128_cfb128 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x15) /* [3087] OBJ_aes_192_ecb */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x16) /* [3096] OBJ_aes_192_cbc */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x17) /* [3105] OBJ_aes_192_ofb128 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x18) /* [3114] OBJ_aes_192_cfb128 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x29) /* [3123] OBJ_aes_256_ecb */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x2A) /* [3132] OBJ_aes_256_cbc */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x2B) /* [3141] OBJ_aes_256_ofb128 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x2C) /* [3150] OBJ_aes_256_cfb128 */
+I(0x55) I(0x1D) I(0x17)                                /* [3159] OBJ_hold_instruction_code */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x38) I(0x02) I(0x01) /* [3162] OBJ_hold_instruction_none */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x38) I(0x02) I(0x02) /* [3169] OBJ_hold_instruction_call_issuer */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x38) I(0x02) I(0x03) /* [3176] OBJ_hold_instruction_reject */
+I(0x09)                                                /* [3183] OBJ_data */
+I(0x09) I(0x92) I(0x26)                                /* [3184] OBJ_pss */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) /* [3187] OBJ_ucl */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) /* [3194] OBJ_pilot */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) /* [3202] OBJ_pilotAttributeType */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x03) /* [3211] OBJ_pilotAttributeSyntax */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) /* [3220] OBJ_pilotObjectClass */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x0A) /* [3229] OBJ_pilotGroups */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x03) I(0x04) /* [3238] OBJ_iA5StringSyntax */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x03) I(0x05) /* [3248] OBJ_caseIgnoreIA5StringSyntax */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x03) /* [3258] OBJ_pilotObject */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x04) /* [3268] OBJ_pilotPerson */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x05) /* [3278] OBJ_account */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x06) /* [3288] OBJ_document */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x07) /* [3298] OBJ_room */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x09) /* [3308] OBJ_documentSeries */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x0E) /* [3318] OBJ_rFC822localPart */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x0F) /* [3328] OBJ_dNSDomain */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x11) /* [3338] OBJ_domainRelatedObject */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x12) /* [3348] OBJ_friendlyCountry */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x13) /* [3358] OBJ_simpleSecurityObject */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x14) /* [3368] OBJ_pilotOrganization */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x15) /* [3378] OBJ_pilotDSA */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x04) I(0x16) /* [3388] OBJ_qualityLabelledData */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x01) /* [3398] OBJ_userId */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x02) /* [3408] OBJ_textEncodedORAddress */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x03) /* [3418] OBJ_rfc822Mailbox */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x04) /* [3428] OBJ_info */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x05) /* [3438] OBJ_favouriteDrink */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x06) /* [3448] OBJ_roomNumber */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x07) /* [3458] OBJ_photo */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x08) /* [3468] OBJ_userClass */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x09) /* [3478] OBJ_host */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x0A) /* [3488] OBJ_manager */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x0B) /* [3498] OBJ_documentIdentifier */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x0C) /* [3508] OBJ_documentTitle */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x0D) /* [3518] OBJ_documentVersion */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x0E) /* [3528] OBJ_documentAuthor */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x0F) /* [3538] OBJ_documentLocation */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x14) /* [3548] OBJ_homeTelephoneNumber */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x15) /* [3558] OBJ_secretary */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x16) /* [3568] OBJ_otherMailbox */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x17) /* [3578] OBJ_lastModifiedTime */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x18) /* [3588] OBJ_lastModifiedBy */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x1A) /* [3598] OBJ_aRecord */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x1B) /* [3608] OBJ_pilotAttributeType27 */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x1C) /* [3618] OBJ_mXRecord */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x1D) /* [3628] OBJ_nSRecord */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x1E) /* [3638] OBJ_sOARecord */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x1F) /* [3648] OBJ_cNAMERecord */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x25) /* [3658] OBJ_associatedDomain */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x26) /* [3668] OBJ_associatedName */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x27) /* [3678] OBJ_homePostalAddress */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x28) /* [3688] OBJ_personalTitle */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x29) /* [3698] OBJ_mobileTelephoneNumber */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x2A) /* [3708] OBJ_pagerTelephoneNumber */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x2B) /* [3718] OBJ_friendlyCountryName */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x2D) /* [3728] OBJ_organizationalStatus */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x2E) /* [3738] OBJ_janetMailbox */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x2F) /* [3748] OBJ_mailPreferenceOption */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x30) /* [3758] OBJ_buildingName */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x31) /* [3768] OBJ_dSAQuality */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x32) /* [3778] OBJ_singleLevelQuality */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x33) /* [3788] OBJ_subtreeMinimumQuality */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x34) /* [3798] OBJ_subtreeMaximumQuality */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x35) /* [3808] OBJ_personalSignature */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x36) /* [3818] OBJ_dITRedirect */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x37) /* [3828] OBJ_audio */
+I(0x09) I(0x92) I(0x26) I(0x89) I(0x93) I(0xF2) I(0x2C) I(0x64) I(0x01) I(0x38) /* [3838] OBJ_documentPublisher */
+I(0x55) I(0x04) I(0x2D)                                /* [3848] OBJ_x500UniqueIdentifier */
+I(0x2B) I(0x06) I(0x01) I(0x07) I(0x01)                /* [3851] OBJ_mime_mhs */
+I(0x2B) I(0x06) I(0x01) I(0x07) I(0x01) I(0x01)        /* [3856] OBJ_mime_mhs_headings */
+I(0x2B) I(0x06) I(0x01) I(0x07) I(0x01) I(0x02)        /* [3862] OBJ_mime_mhs_bodies */
+I(0x2B) I(0x06) I(0x01) I(0x07) I(0x01) I(0x01) I(0x01) /* [3868] OBJ_id_hex_partial_message */
+I(0x2B) I(0x06) I(0x01) I(0x07) I(0x01) I(0x01) I(0x02) /* [3875] OBJ_id_hex_multipart_message */
+I(0x55) I(0x04) I(0x2C)                                /* [3882] OBJ_generationQualifier */
+I(0x55) I(0x04) I(0x41)                                /* [3885] OBJ_pseudonym */
+I(0x67) I(0x2A)                                        /* [3888] OBJ_id_set */
+I(0x67) I(0x2A) I(0x00)                                /* [3890] OBJ_set_ctype */
+I(0x67) I(0x2A) I(0x01)                                /* [3893] OBJ_set_msgExt */
+I(0x67) I(0x2A) I(0x03)                                /* [3896] OBJ_set_attr */
+I(0x67) I(0x2A) I(0x05)                                /* [3899] OBJ_set_policy */
+I(0x67) I(0x2A) I(0x07)                                /* [3902] OBJ_set_certExt */
+I(0x67) I(0x2A) I(0x08)                                /* [3905] OBJ_set_brand */
+I(0x67) I(0x2A) I(0x00) I(0x00)                        /* [3908] OBJ_setct_PANData */
+I(0x67) I(0x2A) I(0x00) I(0x01)                        /* [3912] OBJ_setct_PANToken */
+I(0x67) I(0x2A) I(0x00) I(0x02)                        /* [3916] OBJ_setct_PANOnly */
+I(0x67) I(0x2A) I(0x00) I(0x03)                        /* [3920] OBJ_setct_OIData */
+I(0x67) I(0x2A) I(0x00) I(0x04)                        /* [3924] OBJ_setct_PI */
+I(0x67) I(0x2A) I(0x00) I(0x05)                        /* [3928] OBJ_setct_PIData */
+I(0x67) I(0x2A) I(0x00) I(0x06)                        /* [3932] OBJ_setct_PIDataUnsigned */
+I(0x67) I(0x2A) I(0x00) I(0x07)                        /* [3936] OBJ_setct_HODInput */
+I(0x67) I(0x2A) I(0x00) I(0x08)                        /* [3940] OBJ_setct_AuthResBaggage */
+I(0x67) I(0x2A) I(0x00) I(0x09)                        /* [3944] OBJ_setct_AuthRevReqBaggage */
+I(0x67) I(0x2A) I(0x00) I(0x0A)                        /* [3948] OBJ_setct_AuthRevResBaggage */
+I(0x67) I(0x2A) I(0x00) I(0x0B)                        /* [3952] OBJ_setct_CapTokenSeq */
+I(0x67) I(0x2A) I(0x00) I(0x0C)                        /* [3956] OBJ_setct_PInitResData */
+I(0x67) I(0x2A) I(0x00) I(0x0D)                        /* [3960] OBJ_setct_PI_TBS */
+I(0x67) I(0x2A) I(0x00) I(0x0E)                        /* [3964] OBJ_setct_PResData */
+I(0x67) I(0x2A) I(0x00) I(0x10)                        /* [3968] OBJ_setct_AuthReqTBS */
+I(0x67) I(0x2A) I(0x00) I(0x11)                        /* [3972] OBJ_setct_AuthResTBS */
+I(0x67) I(0x2A) I(0x00) I(0x12)                        /* [3976] OBJ_setct_AuthResTBSX */
+I(0x67) I(0x2A) I(0x00) I(0x13)                        /* [3980] OBJ_setct_AuthTokenTBS */
+I(0x67) I(0x2A) I(0x00) I(0x14)                        /* [3984] OBJ_setct_CapTokenData */
+I(0x67) I(0x2A) I(0x00) I(0x15)                        /* [3988] OBJ_setct_CapTokenTBS */
+I(0x67) I(0x2A) I(0x00) I(0x16)                        /* [3992] OBJ_setct_AcqCardCodeMsg */
+I(0x67) I(0x2A) I(0x00) I(0x17)                        /* [3996] OBJ_setct_AuthRevReqTBS */
+I(0x67) I(0x2A) I(0x00) I(0x18)                        /* [4000] OBJ_setct_AuthRevResData */
+I(0x67) I(0x2A) I(0x00) I(0x19)                        /* [4004] OBJ_setct_AuthRevResTBS */
+I(0x67) I(0x2A) I(0x00) I(0x1A)                        /* [4008] OBJ_setct_CapReqTBS */
+I(0x67) I(0x2A) I(0x00) I(0x1B)                        /* [4012] OBJ_setct_CapReqTBSX */
+I(0x67) I(0x2A) I(0x00) I(0x1C)                        /* [4016] OBJ_setct_CapResData */
+I(0x67) I(0x2A) I(0x00) I(0x1D)                        /* [4020] OBJ_setct_CapRevReqTBS */
+I(0x67) I(0x2A) I(0x00) I(0x1E)                        /* [4024] OBJ_setct_CapRevReqTBSX */
+I(0x67) I(0x2A) I(0x00) I(0x1F)                        /* [4028] OBJ_setct_CapRevResData */
+I(0x67) I(0x2A) I(0x00) I(0x20)                        /* [4032] OBJ_setct_CredReqTBS */
+I(0x67) I(0x2A) I(0x00) I(0x21)                        /* [4036] OBJ_setct_CredReqTBSX */
+I(0x67) I(0x2A) I(0x00) I(0x22)                        /* [4040] OBJ_setct_CredResData */
+I(0x67) I(0x2A) I(0x00) I(0x23)                        /* [4044] OBJ_setct_CredRevReqTBS */
+I(0x67) I(0x2A) I(0x00) I(0x24)                        /* [4048] OBJ_setct_CredRevReqTBSX */
+I(0x67) I(0x2A) I(0x00) I(0x25)                        /* [4052] OBJ_setct_CredRevResData */
+I(0x67) I(0x2A) I(0x00) I(0x26)                        /* [4056] OBJ_setct_PCertReqData */
+I(0x67) I(0x2A) I(0x00) I(0x27)                        /* [4060] OBJ_setct_PCertResTBS */
+I(0x67) I(0x2A) I(0x00) I(0x28)                        /* [4064] OBJ_setct_BatchAdminReqData */
+I(0x67) I(0x2A) I(0x00) I(0x29)                        /* [4068] OBJ_setct_BatchAdminResData */
+I(0x67) I(0x2A) I(0x00) I(0x2A)                        /* [4072] OBJ_setct_CardCInitResTBS */
+I(0x67) I(0x2A) I(0x00) I(0x2B)                        /* [4076] OBJ_setct_MeAqCInitResTBS */
+I(0x67) I(0x2A) I(0x00) I(0x2C)                        /* [4080] OBJ_setct_RegFormResTBS */
+I(0x67) I(0x2A) I(0x00) I(0x2D)                        /* [4084] OBJ_setct_CertReqData */
+I(0x67) I(0x2A) I(0x00) I(0x2E)                        /* [4088] OBJ_setct_CertReqTBS */
+I(0x67) I(0x2A) I(0x00) I(0x2F)                        /* [4092] OBJ_setct_CertResData */
+I(0x67) I(0x2A) I(0x00) I(0x30)                        /* [4096] OBJ_setct_CertInqReqTBS */
+I(0x67) I(0x2A) I(0x00) I(0x31)                        /* [4100] OBJ_setct_ErrorTBS */
+I(0x67) I(0x2A) I(0x00) I(0x32)                        /* [4104] OBJ_setct_PIDualSignedTBE */
+I(0x67) I(0x2A) I(0x00) I(0x33)                        /* [4108] OBJ_setct_PIUnsignedTBE */
+I(0x67) I(0x2A) I(0x00) I(0x34)                        /* [4112] OBJ_setct_AuthReqTBE */
+I(0x67) I(0x2A) I(0x00) I(0x35)                        /* [4116] OBJ_setct_AuthResTBE */
+I(0x67) I(0x2A) I(0x00) I(0x36)                        /* [4120] OBJ_setct_AuthResTBEX */
+I(0x67) I(0x2A) I(0x00) I(0x37)                        /* [4124] OBJ_setct_AuthTokenTBE */
+I(0x67) I(0x2A) I(0x00) I(0x38)                        /* [4128] OBJ_setct_CapTokenTBE */
+I(0x67) I(0x2A) I(0x00) I(0x39)                        /* [4132] OBJ_setct_CapTokenTBEX */
+I(0x67) I(0x2A) I(0x00) I(0x3A)                        /* [4136] OBJ_setct_AcqCardCodeMsgTBE */
+I(0x67) I(0x2A) I(0x00) I(0x3B)                        /* [4140] OBJ_setct_AuthRevReqTBE */
+I(0x67) I(0x2A) I(0x00) I(0x3C)                        /* [4144] OBJ_setct_AuthRevResTBE */
+I(0x67) I(0x2A) I(0x00) I(0x3D)                        /* [4148] OBJ_setct_AuthRevResTBEB */
+I(0x67) I(0x2A) I(0x00) I(0x3E)                        /* [4152] OBJ_setct_CapReqTBE */
+I(0x67) I(0x2A) I(0x00) I(0x3F)                        /* [4156] OBJ_setct_CapReqTBEX */
+I(0x67) I(0x2A) I(0x00) I(0x40)                        /* [4160] OBJ_setct_CapResTBE */
+I(0x67) I(0x2A) I(0x00) I(0x41)                        /* [4164] OBJ_setct_CapRevReqTBE */
+I(0x67) I(0x2A) I(0x00) I(0x42)                        /* [4168] OBJ_setct_CapRevReqTBEX */
+I(0x67) I(0x2A) I(0x00) I(0x43)                        /* [4172] OBJ_setct_CapRevResTBE */
+I(0x67) I(0x2A) I(0x00) I(0x44)                        /* [4176] OBJ_setct_CredReqTBE */
+I(0x67) I(0x2A) I(0x00) I(0x45)                        /* [4180] OBJ_setct_CredReqTBEX */
+I(0x67) I(0x2A) I(0x00) I(0x46)                        /* [4184] OBJ_setct_CredResTBE */
+I(0x67) I(0x2A) I(0x00) I(0x47)                        /* [4188] OBJ_setct_CredRevReqTBE */
+I(0x67) I(0x2A) I(0x00) I(0x48)                        /* [4192] OBJ_setct_CredRevReqTBEX */
+I(0x67) I(0x2A) I(0x00) I(0x49)                        /* [4196] OBJ_setct_CredRevResTBE */
+I(0x67) I(0x2A) I(0x00) I(0x4A)                        /* [4200] OBJ_setct_BatchAdminReqTBE */
+I(0x67) I(0x2A) I(0x00) I(0x4B)                        /* [4204] OBJ_setct_BatchAdminResTBE */
+I(0x67) I(0x2A) I(0x00) I(0x4C)                        /* [4208] OBJ_setct_RegFormReqTBE */
+I(0x67) I(0x2A) I(0x00) I(0x4D)                        /* [4212] OBJ_setct_CertReqTBE */
+I(0x67) I(0x2A) I(0x00) I(0x4E)                        /* [4216] OBJ_setct_CertReqTBEX */
+I(0x67) I(0x2A) I(0x00) I(0x4F)                        /* [4220] OBJ_setct_CertResTBE */
+I(0x67) I(0x2A) I(0x00) I(0x50)                        /* [4224] OBJ_setct_CRLNotificationTBS */
+I(0x67) I(0x2A) I(0x00) I(0x51)                        /* [4228] OBJ_setct_CRLNotificationResTBS */
+I(0x67) I(0x2A) I(0x00) I(0x52)                        /* [4232] OBJ_setct_BCIDistributionTBS */
+I(0x67) I(0x2A) I(0x01) I(0x01)                        /* [4236] OBJ_setext_genCrypt */
+I(0x67) I(0x2A) I(0x01) I(0x03)                        /* [4240] OBJ_setext_miAuth */
+I(0x67) I(0x2A) I(0x01) I(0x04)                        /* [4244] OBJ_setext_pinSecure */
+I(0x67) I(0x2A) I(0x01) I(0x05)                        /* [4248] OBJ_setext_pinAny */
+I(0x67) I(0x2A) I(0x01) I(0x07)                        /* [4252] OBJ_setext_track2 */
+I(0x67) I(0x2A) I(0x01) I(0x08)                        /* [4256] OBJ_setext_cv */
+I(0x67) I(0x2A) I(0x05) I(0x00)                        /* [4260] OBJ_set_policy_root */
+I(0x67) I(0x2A) I(0x07) I(0x00)                        /* [4264] OBJ_setCext_hashedRoot */
+I(0x67) I(0x2A) I(0x07) I(0x01)                        /* [4268] OBJ_setCext_certType */
+I(0x67) I(0x2A) I(0x07) I(0x02)                        /* [4272] OBJ_setCext_merchData */
+I(0x67) I(0x2A) I(0x07) I(0x03)                        /* [4276] OBJ_setCext_cCertRequired */
+I(0x67) I(0x2A) I(0x07) I(0x04)                        /* [4280] OBJ_setCext_tunneling */
+I(0x67) I(0x2A) I(0x07) I(0x05)                        /* [4284] OBJ_setCext_setExt */
+I(0x67) I(0x2A) I(0x07) I(0x06)                        /* [4288] OBJ_setCext_setQualf */
+I(0x67) I(0x2A) I(0x07) I(0x07)                        /* [4292] OBJ_setCext_PGWYcapabilities */
+I(0x67) I(0x2A) I(0x07) I(0x08)                        /* [4296] OBJ_setCext_TokenIdentifier */
+I(0x67) I(0x2A) I(0x07) I(0x09)                        /* [4300] OBJ_setCext_Track2Data */
+I(0x67) I(0x2A) I(0x07) I(0x0A)                        /* [4304] OBJ_setCext_TokenType */
+I(0x67) I(0x2A) I(0x07) I(0x0B)                        /* [4308] OBJ_setCext_IssuerCapabilities */
+I(0x67) I(0x2A) I(0x03) I(0x00)                        /* [4312] OBJ_setAttr_Cert */
+I(0x67) I(0x2A) I(0x03) I(0x01)                        /* [4316] OBJ_setAttr_PGWYcap */
+I(0x67) I(0x2A) I(0x03) I(0x02)                        /* [4320] OBJ_setAttr_TokenType */
+I(0x67) I(0x2A) I(0x03) I(0x03)                        /* [4324] OBJ_setAttr_IssCap */
+I(0x67) I(0x2A) I(0x03) I(0x00) I(0x00)                /* [4328] OBJ_set_rootKeyThumb */
+I(0x67) I(0x2A) I(0x03) I(0x00) I(0x01)                /* [4333] OBJ_set_addPolicy */
+I(0x67) I(0x2A) I(0x03) I(0x02) I(0x01)                /* [4338] OBJ_setAttr_Token_EMV */
+I(0x67) I(0x2A) I(0x03) I(0x02) I(0x02)                /* [4343] OBJ_setAttr_Token_B0Prime */
+I(0x67) I(0x2A) I(0x03) I(0x03) I(0x03)                /* [4348] OBJ_setAttr_IssCap_CVM */
+I(0x67) I(0x2A) I(0x03) I(0x03) I(0x04)                /* [4353] OBJ_setAttr_IssCap_T2 */
+I(0x67) I(0x2A) I(0x03) I(0x03) I(0x05)                /* [4358] OBJ_setAttr_IssCap_Sig */
+I(0x67) I(0x2A) I(0x03) I(0x03) I(0x03) I(0x01)        /* [4363] OBJ_setAttr_GenCryptgrm */
+I(0x67) I(0x2A) I(0x03) I(0x03) I(0x04) I(0x01)        /* [4369] OBJ_setAttr_T2Enc */
+I(0x67) I(0x2A) I(0x03) I(0x03) I(0x04) I(0x02)        /* [4375] OBJ_setAttr_T2cleartxt */
+I(0x67) I(0x2A) I(0x03) I(0x03) I(0x05) I(0x01)        /* [4381] OBJ_setAttr_TokICCsig */
+I(0x67) I(0x2A) I(0x03) I(0x03) I(0x05) I(0x02)        /* [4387] OBJ_setAttr_SecDevSig */
+I(0x67) I(0x2A) I(0x08) I(0x01)                        /* [4393] OBJ_set_brand_IATA_ATA */
+I(0x67) I(0x2A) I(0x08) I(0x1E)                        /* [4397] OBJ_set_brand_Diners */
+I(0x67) I(0x2A) I(0x08) I(0x22)                        /* [4401] OBJ_set_brand_AmericanExpress */
+I(0x67) I(0x2A) I(0x08) I(0x23)                        /* [4405] OBJ_set_brand_JCB */
+I(0x67) I(0x2A) I(0x08) I(0x04)                        /* [4409] OBJ_set_brand_Visa */
+I(0x67) I(0x2A) I(0x08) I(0x05)                        /* [4413] OBJ_set_brand_MasterCard */
+I(0x67) I(0x2A) I(0x08) I(0xAE) I(0x7B)                /* [4417] OBJ_set_brand_Novus */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x03) I(0x0A) /* [4422] OBJ_des_cdmf */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) I(0x06) /* [4430] OBJ_rsaOAEPEncryptionSET */
+I(0x00)                                                /* [4439] OBJ_itu_t */
+I(0x50)                                                /* [4440] OBJ_joint_iso_itu_t */
+I(0x67)                                                /* [4441] OBJ_international_organizations */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x82) I(0x37) I(0x14) I(0x02) I(0x02) /* [4442] OBJ_ms_smartcard_login */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x82) I(0x37) I(0x14) I(0x02) I(0x03) /* [4452] OBJ_ms_upn */
+I(0x55) I(0x04) I(0x09)                                /* [4462] OBJ_streetAddress */
+I(0x55) I(0x04) I(0x11)                                /* [4465] OBJ_postalCode */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x15) /* [4468] OBJ_id_ppl */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x01) I(0x0E) /* [4475] OBJ_proxyCertInfo */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x15) I(0x00) /* [4483] OBJ_id_ppl_anyLanguage */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x15) I(0x01) /* [4491] OBJ_id_ppl_inheritAll */
+I(0x55) I(0x1D) I(0x1E)                                /* [4499] OBJ_name_constraints */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x15) I(0x02) /* [4502] OBJ_Independent */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) I(0x0B) /* [4510] OBJ_sha256WithRSAEncryption */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) I(0x0C) /* [4519] OBJ_sha384WithRSAEncryption */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) I(0x0D) /* [4528] OBJ_sha512WithRSAEncryption */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x01) I(0x0E) /* [4537] OBJ_sha224WithRSAEncryption */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x02) I(0x01) /* [4546] OBJ_sha256 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x02) I(0x02) /* [4555] OBJ_sha384 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x02) I(0x03) /* [4564] OBJ_sha512 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x02) I(0x04) /* [4573] OBJ_sha224 */
+I(0x2B)                                                /* [4582] OBJ_identified_organization */
+I(0x2B) I(0x81) I(0x04)                                /* [4583] OBJ_certicom_arc */
+I(0x67) I(0x2B)                                        /* [4586] OBJ_wap */
+I(0x67) I(0x2B) I(0x01)                                /* [4588] OBJ_wap_wsg */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x01) I(0x02) I(0x03) /* [4591] OBJ_X9_62_id_characteristic_two_basis */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x01) I(0x02) I(0x03) I(0x01) /* [4599] OBJ_X9_62_onBasis */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x01) I(0x02) I(0x03) I(0x02) /* [4608] OBJ_X9_62_tpBasis */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x01) I(0x02) I(0x03) I(0x03) /* [4617] OBJ_X9_62_ppBasis */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x01) /* [4626] OBJ_X9_62_c2pnb163v1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x02) /* [4634] OBJ_X9_62_c2pnb163v2 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x03) /* [4642] OBJ_X9_62_c2pnb163v3 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x04) /* [4650] OBJ_X9_62_c2pnb176v1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x05) /* [4658] OBJ_X9_62_c2tnb191v1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x06) /* [4666] OBJ_X9_62_c2tnb191v2 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x07) /* [4674] OBJ_X9_62_c2tnb191v3 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x08) /* [4682] OBJ_X9_62_c2onb191v4 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x09) /* [4690] OBJ_X9_62_c2onb191v5 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x0A) /* [4698] OBJ_X9_62_c2pnb208w1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x0B) /* [4706] OBJ_X9_62_c2tnb239v1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x0C) /* [4714] OBJ_X9_62_c2tnb239v2 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x0D) /* [4722] OBJ_X9_62_c2tnb239v3 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x0E) /* [4730] OBJ_X9_62_c2onb239v4 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x0F) /* [4738] OBJ_X9_62_c2onb239v5 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x10) /* [4746] OBJ_X9_62_c2pnb272w1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x11) /* [4754] OBJ_X9_62_c2pnb304w1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x12) /* [4762] OBJ_X9_62_c2tnb359v1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x13) /* [4770] OBJ_X9_62_c2pnb368w1 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x03) I(0x00) I(0x14) /* [4778] OBJ_X9_62_c2tnb431r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x06)                /* [4786] OBJ_secp112r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x07)                /* [4791] OBJ_secp112r2 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x1C)                /* [4796] OBJ_secp128r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x1D)                /* [4801] OBJ_secp128r2 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x09)                /* [4806] OBJ_secp160k1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x08)                /* [4811] OBJ_secp160r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x1E)                /* [4816] OBJ_secp160r2 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x1F)                /* [4821] OBJ_secp192k1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x20)                /* [4826] OBJ_secp224k1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x21)                /* [4831] OBJ_secp224r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x0A)                /* [4836] OBJ_secp256k1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x22)                /* [4841] OBJ_secp384r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x23)                /* [4846] OBJ_secp521r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x04)                /* [4851] OBJ_sect113r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x05)                /* [4856] OBJ_sect113r2 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x16)                /* [4861] OBJ_sect131r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x17)                /* [4866] OBJ_sect131r2 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x01)                /* [4871] OBJ_sect163k1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x02)                /* [4876] OBJ_sect163r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x0F)                /* [4881] OBJ_sect163r2 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x18)                /* [4886] OBJ_sect193r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x19)                /* [4891] OBJ_sect193r2 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x1A)                /* [4896] OBJ_sect233k1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x1B)                /* [4901] OBJ_sect233r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x03)                /* [4906] OBJ_sect239k1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x10)                /* [4911] OBJ_sect283k1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x11)                /* [4916] OBJ_sect283r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x24)                /* [4921] OBJ_sect409k1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x25)                /* [4926] OBJ_sect409r1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x26)                /* [4931] OBJ_sect571k1 */
+I(0x2B) I(0x81) I(0x04) I(0x00) I(0x27)                /* [4936] OBJ_sect571r1 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x01)                /* [4941] OBJ_wap_wsg_idm_ecid_wtls1 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x03)                /* [4946] OBJ_wap_wsg_idm_ecid_wtls3 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x04)                /* [4951] OBJ_wap_wsg_idm_ecid_wtls4 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x05)                /* [4956] OBJ_wap_wsg_idm_ecid_wtls5 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x06)                /* [4961] OBJ_wap_wsg_idm_ecid_wtls6 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x07)                /* [4966] OBJ_wap_wsg_idm_ecid_wtls7 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x08)                /* [4971] OBJ_wap_wsg_idm_ecid_wtls8 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x09)                /* [4976] OBJ_wap_wsg_idm_ecid_wtls9 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x0A)                /* [4981] OBJ_wap_wsg_idm_ecid_wtls10 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x0B)                /* [4986] OBJ_wap_wsg_idm_ecid_wtls11 */
+I(0x67) I(0x2B) I(0x01) I(0x04) I(0x0C)                /* [4991] OBJ_wap_wsg_idm_ecid_wtls12 */
+I(0x55) I(0x1D) I(0x20) I(0x00)                        /* [4996] OBJ_any_policy */
+I(0x55) I(0x1D) I(0x21)                                /* [5000] OBJ_policy_mappings */
+I(0x55) I(0x1D) I(0x36)                                /* [5003] OBJ_inhibit_any_policy */
+I(0x2A) I(0x83) I(0x08) I(0x8C) I(0x9A) I(0x4B) I(0x3D) I(0x01) I(0x01) I(0x01) I(0x02) /* [5006] OBJ_camellia_128_cbc */
+I(0x2A) I(0x83) I(0x08) I(0x8C) I(0x9A) I(0x4B) I(0x3D) I(0x01) I(0x01) I(0x01) I(0x03) /* [5017] OBJ_camellia_192_cbc */
+I(0x2A) I(0x83) I(0x08) I(0x8C) I(0x9A) I(0x4B) I(0x3D) I(0x01) I(0x01) I(0x01) I(0x04) /* [5028] OBJ_camellia_256_cbc */
+I(0x03) I(0xA2) I(0x31) I(0x05) I(0x03) I(0x01) I(0x09) I(0x01) /* [5039] OBJ_camellia_128_ecb */
+I(0x03) I(0xA2) I(0x31) I(0x05) I(0x03) I(0x01) I(0x09) I(0x15) /* [5047] OBJ_camellia_192_ecb */
+I(0x03) I(0xA2) I(0x31) I(0x05) I(0x03) I(0x01) I(0x09) I(0x29) /* [5055] OBJ_camellia_256_ecb */
+I(0x03) I(0xA2) I(0x31) I(0x05) I(0x03) I(0x01) I(0x09) I(0x04) /* [5063] OBJ_camellia_128_cfb128 */
+I(0x03) I(0xA2) I(0x31) I(0x05) I(0x03) I(0x01) I(0x09) I(0x18) /* [5071] OBJ_camellia_192_cfb128 */
+I(0x03) I(0xA2) I(0x31) I(0x05) I(0x03) I(0x01) I(0x09) I(0x2C) /* [5079] OBJ_camellia_256_cfb128 */
+I(0x03) I(0xA2) I(0x31) I(0x05) I(0x03) I(0x01) I(0x09) I(0x03) /* [5087] OBJ_camellia_128_ofb128 */
+I(0x03) I(0xA2) I(0x31) I(0x05) I(0x03) I(0x01) I(0x09) I(0x17) /* [5095] OBJ_camellia_192_ofb128 */
+I(0x03) I(0xA2) I(0x31) I(0x05) I(0x03) I(0x01) I(0x09) I(0x2B) /* [5103] OBJ_camellia_256_ofb128 */
+I(0x55) I(0x1D) I(0x09)                                /* [5111] OBJ_subject_directory_attributes */
+I(0x55) I(0x1D) I(0x1C)                                /* [5114] OBJ_issuing_distribution_point */
+I(0x55) I(0x1D) I(0x1D)                                /* [5117] OBJ_certificate_issuer */
+I(0x2A) I(0x83) I(0x1A) I(0x8C) I(0x9A) I(0x44)        /* [5120] OBJ_kisa */
+I(0x2A) I(0x83) I(0x1A) I(0x8C) I(0x9A) I(0x44) I(0x01) I(0x03) /* [5126] OBJ_seed_ecb */
+I(0x2A) I(0x83) I(0x1A) I(0x8C) I(0x9A) I(0x44) I(0x01) I(0x04) /* [5134] OBJ_seed_cbc */
+I(0x2A) I(0x83) I(0x1A) I(0x8C) I(0x9A) I(0x44) I(0x01) I(0x06) /* [5142] OBJ_seed_ofb128 */
+I(0x2A) I(0x83) I(0x1A) I(0x8C) I(0x9A) I(0x44) I(0x01) I(0x05) /* [5150] OBJ_seed_cfb128 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x08) I(0x01) I(0x01) /* [5158] OBJ_hmac_md5 */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x08) I(0x01) I(0x02) /* [5166] OBJ_hmac_sha1 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF6) I(0x7D) I(0x07) I(0x42) I(0x0D) /* [5174] OBJ_id_PasswordBasedMAC */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF6) I(0x7D) I(0x07) I(0x42) I(0x1E) /* [5183] OBJ_id_DHBasedMac */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x04) I(0x10) /* [5192] OBJ_id_it_suppLangTags */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x30) I(0x05) /* [5200] OBJ_caRepository */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) I(0x09) /* [5208] OBJ_id_smime_ct_compressedData */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x01) I(0x09) I(0x10) I(0x01) I(0x1B) /* [5219] OBJ_id_ct_asciiTextWithCRLF */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x05) /* [5230] OBJ_id_aes128_wrap */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x19) /* [5239] OBJ_id_aes192_wrap */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x01) I(0x2D) /* [5248] OBJ_id_aes256_wrap */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x04) I(0x02) /* [5257] OBJ_ecdsa_with_Recommended */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x04) I(0x03) /* [5264] OBJ_ecdsa_with_Specified */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x04) I(0x03) I(0x01) /* [5271] OBJ_ecdsa_with_SHA224 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x04) I(0x03) I(0x02) /* [5279] OBJ_ecdsa_with_SHA256 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x04) I(0x03) I(0x03) /* [5287] OBJ_ecdsa_with_SHA384 */
+I(0x2A) I(0x86) I(0x48) I(0xCE) I(0x3D) I(0x04) I(0x03) I(0x04) /* [5295] OBJ_ecdsa_with_SHA512 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x02) I(0x06) /* [5303] OBJ_hmacWithMD5 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x02) I(0x08) /* [5311] OBJ_hmacWithSHA224 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x02) I(0x09) /* [5319] OBJ_hmacWithSHA256 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x02) I(0x0A) /* [5327] OBJ_hmacWithSHA384 */
+I(0x2A) I(0x86) I(0x48) I(0x86) I(0xF7) I(0x0D) I(0x02) I(0x0B) /* [5335] OBJ_hmacWithSHA512 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x03) I(0x01) /* [5343] OBJ_dsa_with_SHA224 */
+I(0x60) I(0x86) I(0x48) I(0x01) I(0x65) I(0x03) I(0x04) I(0x03) I(0x02) /* [5352] OBJ_dsa_with_SHA256 */
+I(0x28) I(0xCF) I(0x06) I(0x03) I(0x00) I(0x37)        /* [5361] OBJ_whirlpool */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02)                /* [5367] OBJ_cryptopro */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x09)                /* [5372] OBJ_cryptocom */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x03)        /* [5377] OBJ_id_GostR3411_94_with_GostR3410_2001 */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x04)        /* [5383] OBJ_id_GostR3411_94_with_GostR3410_94 */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x09)        /* [5389] OBJ_id_GostR3411_94 */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x0A)        /* [5395] OBJ_id_HMACGostR3411_94 */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x13)        /* [5401] OBJ_id_GostR3410_2001 */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x14)        /* [5407] OBJ_id_GostR3410_94 */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x15)        /* [5413] OBJ_id_Gost28147_89 */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x16)        /* [5419] OBJ_id_Gost28147_89_MAC */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x17)        /* [5425] OBJ_id_GostR3411_94_prf */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x62)        /* [5431] OBJ_id_GostR3410_2001DH */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x63)        /* [5437] OBJ_id_GostR3410_94DH */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x0E) I(0x01) /* [5443] OBJ_id_Gost28147_89_CryptoPro_KeyMeshing */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x0E) I(0x00) /* [5450] OBJ_id_Gost28147_89_None_KeyMeshing */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x1E) I(0x00) /* [5457] OBJ_id_GostR3411_94_TestParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x1E) I(0x01) /* [5464] OBJ_id_GostR3411_94_CryptoProParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x1F) I(0x00) /* [5471] OBJ_id_Gost28147_89_TestParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x1F) I(0x01) /* [5478] OBJ_id_Gost28147_89_CryptoPro_A_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x1F) I(0x02) /* [5485] OBJ_id_Gost28147_89_CryptoPro_B_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x1F) I(0x03) /* [5492] OBJ_id_Gost28147_89_CryptoPro_C_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x1F) I(0x04) /* [5499] OBJ_id_Gost28147_89_CryptoPro_D_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x1F) I(0x05) /* [5506] OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x1F) I(0x06) /* [5513] OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x1F) I(0x07) /* [5520] OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x20) I(0x00) /* [5527] OBJ_id_GostR3410_94_TestParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x20) I(0x02) /* [5534] OBJ_id_GostR3410_94_CryptoPro_A_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x20) I(0x03) /* [5541] OBJ_id_GostR3410_94_CryptoPro_B_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x20) I(0x04) /* [5548] OBJ_id_GostR3410_94_CryptoPro_C_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x20) I(0x05) /* [5555] OBJ_id_GostR3410_94_CryptoPro_D_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x21) I(0x01) /* [5562] OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x21) I(0x02) /* [5569] OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x21) I(0x03) /* [5576] OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x23) I(0x00) /* [5583] OBJ_id_GostR3410_2001_TestParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x23) I(0x01) /* [5590] OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x23) I(0x02) /* [5597] OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x23) I(0x03) /* [5604] OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x24) I(0x00) /* [5611] OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x24) I(0x01) /* [5618] OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x14) I(0x01) /* [5625] OBJ_id_GostR3410_94_a */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x14) I(0x02) /* [5632] OBJ_id_GostR3410_94_aBis */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x14) I(0x03) /* [5639] OBJ_id_GostR3410_94_b */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x02) I(0x14) I(0x04) /* [5646] OBJ_id_GostR3410_94_bBis */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x09) I(0x01) I(0x06) I(0x01) /* [5653] OBJ_id_Gost28147_89_cc */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x09) I(0x01) I(0x05) I(0x03) /* [5661] OBJ_id_GostR3410_94_cc */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x09) I(0x01) I(0x05) I(0x04) /* [5669] OBJ_id_GostR3410_2001_cc */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x09) I(0x01) I(0x03) I(0x03) /* [5677] OBJ_id_GostR3411_94_with_GostR3410_94_cc */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x09) I(0x01) I(0x03) I(0x04) /* [5685] OBJ_id_GostR3411_94_with_GostR3410_2001_cc */
+I(0x2A) I(0x85) I(0x03) I(0x02) I(0x09) I(0x01) I(0x08) I(0x01) /* [5693] OBJ_id_GostR3410_2001_ParamSet_cc */
+I(0x2B) I(0x06) I(0x01) I(0x04) I(0x01) I(0x82) I(0x37) I(0x11) I(0x02) /* [5701] OBJ_LocalKeySet */
+I(0x55) I(0x1D) I(0x2E)                                /* [5710] OBJ_freshest_crl */
+I(0x2B) I(0x06) I(0x01) I(0x05) I(0x05) I(0x07) I(0x08) I(0x03) /* [5713] OBJ_id_on_permanentIdentifier */
+I(0x55) I(0x04) I(0x0E)                                /* [5721] OBJ_searchGuide */
+I(0x55) I(0x04) I(0x0F)                                /* [5724] OBJ_businessCategory */
+I(0x55) I(0x04) I(0x10)                                /* [5727] OBJ_postalAddress */
+I(0x55) I(0x04) I(0x12)                                /* [5730] OBJ_postOfficeBox */
+I(0x55) I(0x04) I(0x13)                                /* [5733] OBJ_physicalDeliveryOfficeName */
+I(0x55) I(0x04) I(0x14)                                /* [5736] OBJ_telephoneNumber */
+I(0x55) I(0x04) I(0x15)                                /* [5739] OBJ_telexNumber */
+I(0x55) I(0x04) I(0x16)                                /* [5742] OBJ_teletexTerminalIdentifier */
+I(0x55) I(0x04) I(0x17)                                /* [5745] OBJ_facsimileTelephoneNumber */
+I(0x55) I(0x04) I(0x18)                                /* [5748] OBJ_x121Address */
+I(0x55) I(0x04) I(0x19)                                /* [5751] OBJ_internationaliSDNNumber */
+I(0x55) I(0x04) I(0x1A)                                /* [5754] OBJ_registeredAddress */
+I(0x55) I(0x04) I(0x1B)                                /* [5757] OBJ_destinationIndicator */
+I(0x55) I(0x04) I(0x1C)                                /* [5760] OBJ_preferredDeliveryMethod */
+I(0x55) I(0x04) I(0x1D)                                /* [5763] OBJ_presentationAddress */
+I(0x55) I(0x04) I(0x1E)                                /* [5766] OBJ_supportedApplicationContext */
+I(0x55) I(0x04) I(0x1F)                                /* [5769] OBJ_member */
+I(0x55) I(0x04) I(0x20)                                /* [5772] OBJ_owner */
+I(0x55) I(0x04) I(0x21)                                /* [5775] OBJ_roleOccupant */
+I(0x55) I(0x04) I(0x22)                                /* [5778] OBJ_seeAlso */
+I(0x55) I(0x04) I(0x23)                                /* [5781] OBJ_userPassword */
+I(0x55) I(0x04) I(0x24)                                /* [5784] OBJ_userCertificate */
+I(0x55) I(0x04) I(0x25)                                /* [5787] OBJ_cACertificate */
+I(0x55) I(0x04) I(0x26)                                /* [5790] OBJ_authorityRevocationList */
+I(0x55) I(0x04) I(0x27)                                /* [5793] OBJ_certificateRevocationList */
+I(0x55) I(0x04) I(0x28)                                /* [5796] OBJ_crossCertificatePair */
+I(0x55) I(0x04) I(0x2F)                                /* [5799] OBJ_enhancedSearchGuide */
+I(0x55) I(0x04) I(0x30)                                /* [5802] OBJ_protocolInformation */
+I(0x55) I(0x04) I(0x31)                                /* [5805] OBJ_distinguishedName */
+I(0x55) I(0x04) I(0x32)                                /* [5808] OBJ_uniqueMember */
+I(0x55) I(0x04) I(0x33)                                /* [5811] OBJ_houseIdentifier */
+I(0x55) I(0x04) I(0x34)                                /* [5814] OBJ_supportedAlgorithms */
+I(0x55) I(0x04) I(0x35)                                /* [5817] OBJ_deltaRevocationList */
+I(0x55) I(0x04) I(0x36)                                /* [5820] OBJ_dmdName */
+LVALUES_END
 
-static const ASN1_OBJECT nid_objs[NUM_NID]={
-{"UNDEF","undefined",NID_undef,1,&(lvalues[0]),0},
-{"rsadsi","RSA Data Security, Inc.",NID_rsadsi,6,&(lvalues[1]),0},
-{"pkcs","RSA Data Security, Inc. PKCS",NID_pkcs,7,&(lvalues[7]),0},
-{"MD2","md2",NID_md2,8,&(lvalues[14]),0},
-{"MD5","md5",NID_md5,8,&(lvalues[22]),0},
-{"RC4","rc4",NID_rc4,8,&(lvalues[30]),0},
-{"rsaEncryption","rsaEncryption",NID_rsaEncryption,9,&(lvalues[38]),0},
-{"RSA-MD2","md2WithRSAEncryption",NID_md2WithRSAEncryption,9,
-	&(lvalues[47]),0},
-{"RSA-MD5","md5WithRSAEncryption",NID_md5WithRSAEncryption,9,
-	&(lvalues[56]),0},
-{"PBE-MD2-DES","pbeWithMD2AndDES-CBC",NID_pbeWithMD2AndDES_CBC,9,
-	&(lvalues[65]),0},
-{"PBE-MD5-DES","pbeWithMD5AndDES-CBC",NID_pbeWithMD5AndDES_CBC,9,
-	&(lvalues[74]),0},
-{"X500","directory services (X.500)",NID_X500,1,&(lvalues[83]),0},
-{"X509","X509",NID_X509,2,&(lvalues[84]),0},
-{"CN","commonName",NID_commonName,3,&(lvalues[86]),0},
-{"C","countryName",NID_countryName,3,&(lvalues[89]),0},
-{"L","localityName",NID_localityName,3,&(lvalues[92]),0},
-{"ST","stateOrProvinceName",NID_stateOrProvinceName,3,&(lvalues[95]),0},
-{"O","organizationName",NID_organizationName,3,&(lvalues[98]),0},
-{"OU","organizationalUnitName",NID_organizationalUnitName,3,
-	&(lvalues[101]),0},
-{"RSA","rsa",NID_rsa,4,&(lvalues[104]),0},
-{"pkcs7","pkcs7",NID_pkcs7,8,&(lvalues[108]),0},
-{"pkcs7-data","pkcs7-data",NID_pkcs7_data,9,&(lvalues[116]),0},
-{"pkcs7-signedData","pkcs7-signedData",NID_pkcs7_signed,9,
-	&(lvalues[125]),0},
-{"pkcs7-envelopedData","pkcs7-envelopedData",NID_pkcs7_enveloped,9,
-	&(lvalues[134]),0},
-{"pkcs7-signedAndEnvelopedData","pkcs7-signedAndEnvelopedData",
-	NID_pkcs7_signedAndEnveloped,9,&(lvalues[143]),0},
-{"pkcs7-digestData","pkcs7-digestData",NID_pkcs7_digest,9,
-	&(lvalues[152]),0},
-{"pkcs7-encryptedData","pkcs7-encryptedData",NID_pkcs7_encrypted,9,
-	&(lvalues[161]),0},
-{"pkcs3","pkcs3",NID_pkcs3,8,&(lvalues[170]),0},
-{"dhKeyAgreement","dhKeyAgreement",NID_dhKeyAgreement,9,
-	&(lvalues[178]),0},
-{"DES-ECB","des-ecb",NID_des_ecb,5,&(lvalues[187]),0},
-{"DES-CFB","des-cfb",NID_des_cfb64,5,&(lvalues[192]),0},
-{"DES-CBC","des-cbc",NID_des_cbc,5,&(lvalues[197]),0},
-{"DES-EDE","des-ede",NID_des_ede_ecb,5,&(lvalues[202]),0},
-{"DES-EDE3","des-ede3",NID_des_ede3_ecb,0,NULL,0},
-{"IDEA-CBC","idea-cbc",NID_idea_cbc,11,&(lvalues[207]),0},
-{"IDEA-CFB","idea-cfb",NID_idea_cfb64,0,NULL,0},
-{"IDEA-ECB","idea-ecb",NID_idea_ecb,0,NULL,0},
-{"RC2-CBC","rc2-cbc",NID_rc2_cbc,8,&(lvalues[218]),0},
-{"RC2-ECB","rc2-ecb",NID_rc2_ecb,0,NULL,0},
-{"RC2-CFB","rc2-cfb",NID_rc2_cfb64,0,NULL,0},
-{"RC2-OFB","rc2-ofb",NID_rc2_ofb64,0,NULL,0},
-{"SHA","sha",NID_sha,5,&(lvalues[226]),0},
-{"RSA-SHA","shaWithRSAEncryption",NID_shaWithRSAEncryption,5,
-	&(lvalues[231]),0},
-{"DES-EDE-CBC","des-ede-cbc",NID_des_ede_cbc,0,NULL,0},
-{"DES-EDE3-CBC","des-ede3-cbc",NID_des_ede3_cbc,8,&(lvalues[236]),0},
-{"DES-OFB","des-ofb",NID_des_ofb64,5,&(lvalues[244]),0},
-{"IDEA-OFB","idea-ofb",NID_idea_ofb64,0,NULL,0},
-{"pkcs9","pkcs9",NID_pkcs9,8,&(lvalues[249]),0},
-{"emailAddress","emailAddress",NID_pkcs9_emailAddress,9,
-	&(lvalues[257]),0},
-{"unstructuredName","unstructuredName",NID_pkcs9_unstructuredName,9,
-	&(lvalues[266]),0},
-{"contentType","contentType",NID_pkcs9_contentType,9,&(lvalues[275]),0},
-{"messageDigest","messageDigest",NID_pkcs9_messageDigest,9,
-	&(lvalues[284]),0},
-{"signingTime","signingTime",NID_pkcs9_signingTime,9,&(lvalues[293]),0},
-{"countersignature","countersignature",NID_pkcs9_countersignature,9,
-	&(lvalues[302]),0},
-{"challengePassword","challengePassword",NID_pkcs9_challengePassword,
-	9,&(lvalues[311]),0},
-{"unstructuredAddress","unstructuredAddress",
-	NID_pkcs9_unstructuredAddress,9,&(lvalues[320]),0},
-{"extendedCertificateAttributes","extendedCertificateAttributes",
-	NID_pkcs9_extCertAttributes,9,&(lvalues[329]),0},
-{"Netscape","Netscape Communications Corp.",NID_netscape,7,
-	&(lvalues[338]),0},
-{"nsCertExt","Netscape Certificate Extension",
-	NID_netscape_cert_extension,8,&(lvalues[345]),0},
-{"nsDataType","Netscape Data Type",NID_netscape_data_type,8,
-	&(lvalues[353]),0},
-{"DES-EDE-CFB","des-ede-cfb",NID_des_ede_cfb64,0,NULL,0},
-{"DES-EDE3-CFB","des-ede3-cfb",NID_des_ede3_cfb64,0,NULL,0},
-{"DES-EDE-OFB","des-ede-ofb",NID_des_ede_ofb64,0,NULL,0},
-{"DES-EDE3-OFB","des-ede3-ofb",NID_des_ede3_ofb64,0,NULL,0},
-{"SHA1","sha1",NID_sha1,5,&(lvalues[361]),0},
-{"RSA-SHA1","sha1WithRSAEncryption",NID_sha1WithRSAEncryption,9,
-	&(lvalues[366]),0},
-{"DSA-SHA","dsaWithSHA",NID_dsaWithSHA,5,&(lvalues[375]),0},
-{"DSA-old","dsaEncryption-old",NID_dsa_2,5,&(lvalues[380]),0},
-{"PBE-SHA1-RC2-64","pbeWithSHA1AndRC2-CBC",NID_pbeWithSHA1AndRC2_CBC,
-	9,&(lvalues[385]),0},
-{"PBKDF2","PBKDF2",NID_id_pbkdf2,9,&(lvalues[394]),0},
-{"DSA-SHA1-old","dsaWithSHA1-old",NID_dsaWithSHA1_2,5,&(lvalues[403]),0},
-{"nsCertType","Netscape Cert Type",NID_netscape_cert_type,9,
-	&(lvalues[408]),0},
-{"nsBaseUrl","Netscape Base Url",NID_netscape_base_url,9,
-	&(lvalues[417]),0},
-{"nsRevocationUrl","Netscape Revocation Url",
-	NID_netscape_revocation_url,9,&(lvalues[426]),0},
-{"nsCaRevocationUrl","Netscape CA Revocation Url",
-	NID_netscape_ca_revocation_url,9,&(lvalues[435]),0},
-{"nsRenewalUrl","Netscape Renewal Url",NID_netscape_renewal_url,9,
-	&(lvalues[444]),0},
-{"nsCaPolicyUrl","Netscape CA Policy Url",NID_netscape_ca_policy_url,
-	9,&(lvalues[453]),0},
-{"nsSslServerName","Netscape SSL Server Name",
-	NID_netscape_ssl_server_name,9,&(lvalues[462]),0},
-{"nsComment","Netscape Comment",NID_netscape_comment,9,&(lvalues[471]),0},
-{"nsCertSequence","Netscape Certificate Sequence",
-	NID_netscape_cert_sequence,9,&(lvalues[480]),0},
-{"DESX-CBC","desx-cbc",NID_desx_cbc,0,NULL,0},
-{"id-ce","id-ce",NID_id_ce,2,&(lvalues[489]),0},
-{"subjectKeyIdentifier","X509v3 Subject Key Identifier",
-	NID_subject_key_identifier,3,&(lvalues[491]),0},
-{"keyUsage","X509v3 Key Usage",NID_key_usage,3,&(lvalues[494]),0},
-{"privateKeyUsagePeriod","X509v3 Private Key Usage Period",
-	NID_private_key_usage_period,3,&(lvalues[497]),0},
-{"subjectAltName","X509v3 Subject Alternative Name",
-	NID_subject_alt_name,3,&(lvalues[500]),0},
-{"issuerAltName","X509v3 Issuer Alternative Name",NID_issuer_alt_name,
-	3,&(lvalues[503]),0},
-{"basicConstraints","X509v3 Basic Constraints",NID_basic_constraints,
-	3,&(lvalues[506]),0},
-{"crlNumber","X509v3 CRL Number",NID_crl_number,3,&(lvalues[509]),0},
-{"certificatePolicies","X509v3 Certificate Policies",
-	NID_certificate_policies,3,&(lvalues[512]),0},
-{"authorityKeyIdentifier","X509v3 Authority Key Identifier",
-	NID_authority_key_identifier,3,&(lvalues[515]),0},
-{"BF-CBC","bf-cbc",NID_bf_cbc,9,&(lvalues[518]),0},
-{"BF-ECB","bf-ecb",NID_bf_ecb,0,NULL,0},
-{"BF-CFB","bf-cfb",NID_bf_cfb64,0,NULL,0},
-{"BF-OFB","bf-ofb",NID_bf_ofb64,0,NULL,0},
-{"MDC2","mdc2",NID_mdc2,4,&(lvalues[527]),0},
-{"RSA-MDC2","mdc2WithRSA",NID_mdc2WithRSA,4,&(lvalues[531]),0},
-{"RC4-40","rc4-40",NID_rc4_40,0,NULL,0},
-{"RC2-40-CBC","rc2-40-cbc",NID_rc2_40_cbc,0,NULL,0},
-{"GN","givenName",NID_givenName,3,&(lvalues[535]),0},
-{"SN","surname",NID_surname,3,&(lvalues[538]),0},
-{"initials","initials",NID_initials,3,&(lvalues[541]),0},
-{NULL,NULL,NID_undef,0,NULL,0},
-{"crlDistributionPoints","X509v3 CRL Distribution Points",
-	NID_crl_distribution_points,3,&(lvalues[544]),0},
-{"RSA-NP-MD5","md5WithRSA",NID_md5WithRSA,5,&(lvalues[547]),0},
-{"serialNumber","serialNumber",NID_serialNumber,3,&(lvalues[552]),0},
-{"title","title",NID_title,3,&(lvalues[555]),0},
-{"description","description",NID_description,3,&(lvalues[558]),0},
-{"CAST5-CBC","cast5-cbc",NID_cast5_cbc,9,&(lvalues[561]),0},
-{"CAST5-ECB","cast5-ecb",NID_cast5_ecb,0,NULL,0},
-{"CAST5-CFB","cast5-cfb",NID_cast5_cfb64,0,NULL,0},
-{"CAST5-OFB","cast5-ofb",NID_cast5_ofb64,0,NULL,0},
-{"pbeWithMD5AndCast5CBC","pbeWithMD5AndCast5CBC",
-	NID_pbeWithMD5AndCast5_CBC,9,&(lvalues[570]),0},
-{"DSA-SHA1","dsaWithSHA1",NID_dsaWithSHA1,7,&(lvalues[579]),0},
-{"MD5-SHA1","md5-sha1",NID_md5_sha1,0,NULL,0},
-{"RSA-SHA1-2","sha1WithRSA",NID_sha1WithRSA,5,&(lvalues[586]),0},
-{"DSA","dsaEncryption",NID_dsa,7,&(lvalues[591]),0},
-{"RIPEMD160","ripemd160",NID_ripemd160,5,&(lvalues[598]),0},
-{NULL,NULL,NID_undef,0,NULL,0},
-{"RSA-RIPEMD160","ripemd160WithRSA",NID_ripemd160WithRSA,6,
-	&(lvalues[603]),0},
-{"RC5-CBC","rc5-cbc",NID_rc5_cbc,8,&(lvalues[609]),0},
-{"RC5-ECB","rc5-ecb",NID_rc5_ecb,0,NULL,0},
-{"RC5-CFB","rc5-cfb",NID_rc5_cfb64,0,NULL,0},
-{"RC5-OFB","rc5-ofb",NID_rc5_ofb64,0,NULL,0},
-{"RLE","run length compression",NID_rle_compression,6,&(lvalues[617]),0},
-{"ZLIB","zlib compression",NID_zlib_compression,11,&(lvalues[623]),0},
-{"extendedKeyUsage","X509v3 Extended Key Usage",NID_ext_key_usage,3,
-	&(lvalues[634]),0},
-{"PKIX","PKIX",NID_id_pkix,6,&(lvalues[637]),0},
-{"id-kp","id-kp",NID_id_kp,7,&(lvalues[643]),0},
-{"serverAuth","TLS Web Server Authentication",NID_server_auth,8,
-	&(lvalues[650]),0},
-{"clientAuth","TLS Web Client Authentication",NID_client_auth,8,
-	&(lvalues[658]),0},
-{"codeSigning","Code Signing",NID_code_sign,8,&(lvalues[666]),0},
-{"emailProtection","E-mail Protection",NID_email_protect,8,
-	&(lvalues[674]),0},
-{"timeStamping","Time Stamping",NID_time_stamp,8,&(lvalues[682]),0},
-{"msCodeInd","Microsoft Individual Code Signing",NID_ms_code_ind,10,
-	&(lvalues[690]),0},
-{"msCodeCom","Microsoft Commercial Code Signing",NID_ms_code_com,10,
-	&(lvalues[700]),0},
-{"msCTLSign","Microsoft Trust List Signing",NID_ms_ctl_sign,10,
-	&(lvalues[710]),0},
-{"msSGC","Microsoft Server Gated Crypto",NID_ms_sgc,10,&(lvalues[720]),0},
-{"msEFS","Microsoft Encrypted File System",NID_ms_efs,10,
-	&(lvalues[730]),0},
-{"nsSGC","Netscape Server Gated Crypto",NID_ns_sgc,9,&(lvalues[740]),0},
-{"deltaCRL","X509v3 Delta CRL Indicator",NID_delta_crl,3,
-	&(lvalues[749]),0},
-{"CRLReason","X509v3 CRL Reason Code",NID_crl_reason,3,&(lvalues[752]),0},
-{"invalidityDate","Invalidity Date",NID_invalidity_date,3,
-	&(lvalues[755]),0},
-{"SXNetID","Strong Extranet ID",NID_sxnet,5,&(lvalues[758]),0},
-{"PBE-SHA1-RC4-128","pbeWithSHA1And128BitRC4",
-	NID_pbe_WithSHA1And128BitRC4,10,&(lvalues[763]),0},
-{"PBE-SHA1-RC4-40","pbeWithSHA1And40BitRC4",
-	NID_pbe_WithSHA1And40BitRC4,10,&(lvalues[773]),0},
-{"PBE-SHA1-3DES","pbeWithSHA1And3-KeyTripleDES-CBC",
-	NID_pbe_WithSHA1And3_Key_TripleDES_CBC,10,&(lvalues[783]),0},
-{"PBE-SHA1-2DES","pbeWithSHA1And2-KeyTripleDES-CBC",
-	NID_pbe_WithSHA1And2_Key_TripleDES_CBC,10,&(lvalues[793]),0},
-{"PBE-SHA1-RC2-128","pbeWithSHA1And128BitRC2-CBC",
-	NID_pbe_WithSHA1And128BitRC2_CBC,10,&(lvalues[803]),0},
-{"PBE-SHA1-RC2-40","pbeWithSHA1And40BitRC2-CBC",
-	NID_pbe_WithSHA1And40BitRC2_CBC,10,&(lvalues[813]),0},
-{"keyBag","keyBag",NID_keyBag,11,&(lvalues[823]),0},
-{"pkcs8ShroudedKeyBag","pkcs8ShroudedKeyBag",NID_pkcs8ShroudedKeyBag,
-	11,&(lvalues[834]),0},
-{"certBag","certBag",NID_certBag,11,&(lvalues[845]),0},
-{"crlBag","crlBag",NID_crlBag,11,&(lvalues[856]),0},
-{"secretBag","secretBag",NID_secretBag,11,&(lvalues[867]),0},
-{"safeContentsBag","safeContentsBag",NID_safeContentsBag,11,
-	&(lvalues[878]),0},
-{"friendlyName","friendlyName",NID_friendlyName,9,&(lvalues[889]),0},
-{"localKeyID","localKeyID",NID_localKeyID,9,&(lvalues[898]),0},
-{"x509Certificate","x509Certificate",NID_x509Certificate,10,
-	&(lvalues[907]),0},
-{"sdsiCertificate","sdsiCertificate",NID_sdsiCertificate,10,
-	&(lvalues[917]),0},
-{"x509Crl","x509Crl",NID_x509Crl,10,&(lvalues[927]),0},
-{"PBES2","PBES2",NID_pbes2,9,&(lvalues[937]),0},
-{"PBMAC1","PBMAC1",NID_pbmac1,9,&(lvalues[946]),0},
-{"hmacWithSHA1","hmacWithSHA1",NID_hmacWithSHA1,8,&(lvalues[955]),0},
-{"id-qt-cps","Policy Qualifier CPS",NID_id_qt_cps,8,&(lvalues[963]),0},
-{"id-qt-unotice","Policy Qualifier User Notice",NID_id_qt_unotice,8,
-	&(lvalues[971]),0},
-{"RC2-64-CBC","rc2-64-cbc",NID_rc2_64_cbc,0,NULL,0},
-{"SMIME-CAPS","S/MIME Capabilities",NID_SMIMECapabilities,9,
-	&(lvalues[979]),0},
-{"PBE-MD2-RC2-64","pbeWithMD2AndRC2-CBC",NID_pbeWithMD2AndRC2_CBC,9,
-	&(lvalues[988]),0},
-{"PBE-MD5-RC2-64","pbeWithMD5AndRC2-CBC",NID_pbeWithMD5AndRC2_CBC,9,
-	&(lvalues[997]),0},
-{"PBE-SHA1-DES","pbeWithSHA1AndDES-CBC",NID_pbeWithSHA1AndDES_CBC,9,
-	&(lvalues[1006]),0},
-{"msExtReq","Microsoft Extension Request",NID_ms_ext_req,10,
-	&(lvalues[1015]),0},
-{"extReq","Extension Request",NID_ext_req,9,&(lvalues[1025]),0},
-{"name","name",NID_name,3,&(lvalues[1034]),0},
-{"dnQualifier","dnQualifier",NID_dnQualifier,3,&(lvalues[1037]),0},
-{"id-pe","id-pe",NID_id_pe,7,&(lvalues[1040]),0},
-{"id-ad","id-ad",NID_id_ad,7,&(lvalues[1047]),0},
-{"authorityInfoAccess","Authority Information Access",NID_info_access,
-	8,&(lvalues[1054]),0},
-{"OCSP","OCSP",NID_ad_OCSP,8,&(lvalues[1062]),0},
-{"caIssuers","CA Issuers",NID_ad_ca_issuers,8,&(lvalues[1070]),0},
-{"OCSPSigning","OCSP Signing",NID_OCSP_sign,8,&(lvalues[1078]),0},
-{"ISO","iso",NID_iso,1,&(lvalues[1086]),0},
-{"member-body","ISO Member Body",NID_member_body,1,&(lvalues[1087]),0},
-{"ISO-US","ISO US Member Body",NID_ISO_US,3,&(lvalues[1088]),0},
-{"X9-57","X9.57",NID_X9_57,5,&(lvalues[1091]),0},
-{"X9cm","X9.57 CM ?",NID_X9cm,6,&(lvalues[1096]),0},
-{"pkcs1","pkcs1",NID_pkcs1,8,&(lvalues[1102]),0},
-{"pkcs5","pkcs5",NID_pkcs5,8,&(lvalues[1110]),0},
-{"SMIME","S/MIME",NID_SMIME,9,&(lvalues[1118]),0},
-{"id-smime-mod","id-smime-mod",NID_id_smime_mod,10,&(lvalues[1127]),0},
-{"id-smime-ct","id-smime-ct",NID_id_smime_ct,10,&(lvalues[1137]),0},
-{"id-smime-aa","id-smime-aa",NID_id_smime_aa,10,&(lvalues[1147]),0},
-{"id-smime-alg","id-smime-alg",NID_id_smime_alg,10,&(lvalues[1157]),0},
-{"id-smime-cd","id-smime-cd",NID_id_smime_cd,10,&(lvalues[1167]),0},
-{"id-smime-spq","id-smime-spq",NID_id_smime_spq,10,&(lvalues[1177]),0},
-{"id-smime-cti","id-smime-cti",NID_id_smime_cti,10,&(lvalues[1187]),0},
-{"id-smime-mod-cms","id-smime-mod-cms",NID_id_smime_mod_cms,11,
-	&(lvalues[1197]),0},
-{"id-smime-mod-ess","id-smime-mod-ess",NID_id_smime_mod_ess,11,
-	&(lvalues[1208]),0},
-{"id-smime-mod-oid","id-smime-mod-oid",NID_id_smime_mod_oid,11,
-	&(lvalues[1219]),0},
-{"id-smime-mod-msg-v3","id-smime-mod-msg-v3",NID_id_smime_mod_msg_v3,
-	11,&(lvalues[1230]),0},
-{"id-smime-mod-ets-eSignature-88","id-smime-mod-ets-eSignature-88",
-	NID_id_smime_mod_ets_eSignature_88,11,&(lvalues[1241]),0},
-{"id-smime-mod-ets-eSignature-97","id-smime-mod-ets-eSignature-97",
-	NID_id_smime_mod_ets_eSignature_97,11,&(lvalues[1252]),0},
-{"id-smime-mod-ets-eSigPolicy-88","id-smime-mod-ets-eSigPolicy-88",
-	NID_id_smime_mod_ets_eSigPolicy_88,11,&(lvalues[1263]),0},
-{"id-smime-mod-ets-eSigPolicy-97","id-smime-mod-ets-eSigPolicy-97",
-	NID_id_smime_mod_ets_eSigPolicy_97,11,&(lvalues[1274]),0},
-{"id-smime-ct-receipt","id-smime-ct-receipt",NID_id_smime_ct_receipt,
-	11,&(lvalues[1285]),0},
-{"id-smime-ct-authData","id-smime-ct-authData",
-	NID_id_smime_ct_authData,11,&(lvalues[1296]),0},
-{"id-smime-ct-publishCert","id-smime-ct-publishCert",
-	NID_id_smime_ct_publishCert,11,&(lvalues[1307]),0},
-{"id-smime-ct-TSTInfo","id-smime-ct-TSTInfo",NID_id_smime_ct_TSTInfo,
-	11,&(lvalues[1318]),0},
-{"id-smime-ct-TDTInfo","id-smime-ct-TDTInfo",NID_id_smime_ct_TDTInfo,
-	11,&(lvalues[1329]),0},
-{"id-smime-ct-contentInfo","id-smime-ct-contentInfo",
-	NID_id_smime_ct_contentInfo,11,&(lvalues[1340]),0},
-{"id-smime-ct-DVCSRequestData","id-smime-ct-DVCSRequestData",
-	NID_id_smime_ct_DVCSRequestData,11,&(lvalues[1351]),0},
-{"id-smime-ct-DVCSResponseData","id-smime-ct-DVCSResponseData",
-	NID_id_smime_ct_DVCSResponseData,11,&(lvalues[1362]),0},
-{"id-smime-aa-receiptRequest","id-smime-aa-receiptRequest",
-	NID_id_smime_aa_receiptRequest,11,&(lvalues[1373]),0},
-{"id-smime-aa-securityLabel","id-smime-aa-securityLabel",
-	NID_id_smime_aa_securityLabel,11,&(lvalues[1384]),0},
-{"id-smime-aa-mlExpandHistory","id-smime-aa-mlExpandHistory",
-	NID_id_smime_aa_mlExpandHistory,11,&(lvalues[1395]),0},
-{"id-smime-aa-contentHint","id-smime-aa-contentHint",
-	NID_id_smime_aa_contentHint,11,&(lvalues[1406]),0},
-{"id-smime-aa-msgSigDigest","id-smime-aa-msgSigDigest",
-	NID_id_smime_aa_msgSigDigest,11,&(lvalues[1417]),0},
-{"id-smime-aa-encapContentType","id-smime-aa-encapContentType",
-	NID_id_smime_aa_encapContentType,11,&(lvalues[1428]),0},
-{"id-smime-aa-contentIdentifier","id-smime-aa-contentIdentifier",
-	NID_id_smime_aa_contentIdentifier,11,&(lvalues[1439]),0},
-{"id-smime-aa-macValue","id-smime-aa-macValue",
-	NID_id_smime_aa_macValue,11,&(lvalues[1450]),0},
-{"id-smime-aa-equivalentLabels","id-smime-aa-equivalentLabels",
-	NID_id_smime_aa_equivalentLabels,11,&(lvalues[1461]),0},
-{"id-smime-aa-contentReference","id-smime-aa-contentReference",
-	NID_id_smime_aa_contentReference,11,&(lvalues[1472]),0},
-{"id-smime-aa-encrypKeyPref","id-smime-aa-encrypKeyPref",
-	NID_id_smime_aa_encrypKeyPref,11,&(lvalues[1483]),0},
-{"id-smime-aa-signingCertificate","id-smime-aa-signingCertificate",
-	NID_id_smime_aa_signingCertificate,11,&(lvalues[1494]),0},
-{"id-smime-aa-smimeEncryptCerts","id-smime-aa-smimeEncryptCerts",
-	NID_id_smime_aa_smimeEncryptCerts,11,&(lvalues[1505]),0},
-{"id-smime-aa-timeStampToken","id-smime-aa-timeStampToken",
-	NID_id_smime_aa_timeStampToken,11,&(lvalues[1516]),0},
-{"id-smime-aa-ets-sigPolicyId","id-smime-aa-ets-sigPolicyId",
-	NID_id_smime_aa_ets_sigPolicyId,11,&(lvalues[1527]),0},
-{"id-smime-aa-ets-commitmentType","id-smime-aa-ets-commitmentType",
-	NID_id_smime_aa_ets_commitmentType,11,&(lvalues[1538]),0},
-{"id-smime-aa-ets-signerLocation","id-smime-aa-ets-signerLocation",
-	NID_id_smime_aa_ets_signerLocation,11,&(lvalues[1549]),0},
-{"id-smime-aa-ets-signerAttr","id-smime-aa-ets-signerAttr",
-	NID_id_smime_aa_ets_signerAttr,11,&(lvalues[1560]),0},
-{"id-smime-aa-ets-otherSigCert","id-smime-aa-ets-otherSigCert",
-	NID_id_smime_aa_ets_otherSigCert,11,&(lvalues[1571]),0},
-{"id-smime-aa-ets-contentTimestamp",
-	"id-smime-aa-ets-contentTimestamp",
-	NID_id_smime_aa_ets_contentTimestamp,11,&(lvalues[1582]),0},
-{"id-smime-aa-ets-CertificateRefs","id-smime-aa-ets-CertificateRefs",
-	NID_id_smime_aa_ets_CertificateRefs,11,&(lvalues[1593]),0},
-{"id-smime-aa-ets-RevocationRefs","id-smime-aa-ets-RevocationRefs",
-	NID_id_smime_aa_ets_RevocationRefs,11,&(lvalues[1604]),0},
-{"id-smime-aa-ets-certValues","id-smime-aa-ets-certValues",
-	NID_id_smime_aa_ets_certValues,11,&(lvalues[1615]),0},
-{"id-smime-aa-ets-revocationValues",
-	"id-smime-aa-ets-revocationValues",
-	NID_id_smime_aa_ets_revocationValues,11,&(lvalues[1626]),0},
-{"id-smime-aa-ets-escTimeStamp","id-smime-aa-ets-escTimeStamp",
-	NID_id_smime_aa_ets_escTimeStamp,11,&(lvalues[1637]),0},
-{"id-smime-aa-ets-certCRLTimestamp",
-	"id-smime-aa-ets-certCRLTimestamp",
-	NID_id_smime_aa_ets_certCRLTimestamp,11,&(lvalues[1648]),0},
-{"id-smime-aa-ets-archiveTimeStamp",
-	"id-smime-aa-ets-archiveTimeStamp",
-	NID_id_smime_aa_ets_archiveTimeStamp,11,&(lvalues[1659]),0},
-{"id-smime-aa-signatureType","id-smime-aa-signatureType",
-	NID_id_smime_aa_signatureType,11,&(lvalues[1670]),0},
-{"id-smime-aa-dvcs-dvc","id-smime-aa-dvcs-dvc",
-	NID_id_smime_aa_dvcs_dvc,11,&(lvalues[1681]),0},
-{"id-smime-alg-ESDHwith3DES","id-smime-alg-ESDHwith3DES",
-	NID_id_smime_alg_ESDHwith3DES,11,&(lvalues[1692]),0},
-{"id-smime-alg-ESDHwithRC2","id-smime-alg-ESDHwithRC2",
-	NID_id_smime_alg_ESDHwithRC2,11,&(lvalues[1703]),0},
-{"id-smime-alg-3DESwrap","id-smime-alg-3DESwrap",
-	NID_id_smime_alg_3DESwrap,11,&(lvalues[1714]),0},
-{"id-smime-alg-RC2wrap","id-smime-alg-RC2wrap",
-	NID_id_smime_alg_RC2wrap,11,&(lvalues[1725]),0},
-{"id-smime-alg-ESDH","id-smime-alg-ESDH",NID_id_smime_alg_ESDH,11,
-	&(lvalues[1736]),0},
-{"id-smime-alg-CMS3DESwrap","id-smime-alg-CMS3DESwrap",
-	NID_id_smime_alg_CMS3DESwrap,11,&(lvalues[1747]),0},
-{"id-smime-alg-CMSRC2wrap","id-smime-alg-CMSRC2wrap",
-	NID_id_smime_alg_CMSRC2wrap,11,&(lvalues[1758]),0},
-{"id-smime-cd-ldap","id-smime-cd-ldap",NID_id_smime_cd_ldap,11,
-	&(lvalues[1769]),0},
-{"id-smime-spq-ets-sqt-uri","id-smime-spq-ets-sqt-uri",
-	NID_id_smime_spq_ets_sqt_uri,11,&(lvalues[1780]),0},
-{"id-smime-spq-ets-sqt-unotice","id-smime-spq-ets-sqt-unotice",
-	NID_id_smime_spq_ets_sqt_unotice,11,&(lvalues[1791]),0},
-{"id-smime-cti-ets-proofOfOrigin","id-smime-cti-ets-proofOfOrigin",
-	NID_id_smime_cti_ets_proofOfOrigin,11,&(lvalues[1802]),0},
-{"id-smime-cti-ets-proofOfReceipt","id-smime-cti-ets-proofOfReceipt",
-	NID_id_smime_cti_ets_proofOfReceipt,11,&(lvalues[1813]),0},
-{"id-smime-cti-ets-proofOfDelivery",
-	"id-smime-cti-ets-proofOfDelivery",
-	NID_id_smime_cti_ets_proofOfDelivery,11,&(lvalues[1824]),0},
-{"id-smime-cti-ets-proofOfSender","id-smime-cti-ets-proofOfSender",
-	NID_id_smime_cti_ets_proofOfSender,11,&(lvalues[1835]),0},
-{"id-smime-cti-ets-proofOfApproval",
-	"id-smime-cti-ets-proofOfApproval",
-	NID_id_smime_cti_ets_proofOfApproval,11,&(lvalues[1846]),0},
-{"id-smime-cti-ets-proofOfCreation",
-	"id-smime-cti-ets-proofOfCreation",
-	NID_id_smime_cti_ets_proofOfCreation,11,&(lvalues[1857]),0},
-{"MD4","md4",NID_md4,8,&(lvalues[1868]),0},
-{"id-pkix-mod","id-pkix-mod",NID_id_pkix_mod,7,&(lvalues[1876]),0},
-{"id-qt","id-qt",NID_id_qt,7,&(lvalues[1883]),0},
-{"id-it","id-it",NID_id_it,7,&(lvalues[1890]),0},
-{"id-pkip","id-pkip",NID_id_pkip,7,&(lvalues[1897]),0},
-{"id-alg","id-alg",NID_id_alg,7,&(lvalues[1904]),0},
-{"id-cmc","id-cmc",NID_id_cmc,7,&(lvalues[1911]),0},
-{"id-on","id-on",NID_id_on,7,&(lvalues[1918]),0},
-{"id-pda","id-pda",NID_id_pda,7,&(lvalues[1925]),0},
-{"id-aca","id-aca",NID_id_aca,7,&(lvalues[1932]),0},
-{"id-qcs","id-qcs",NID_id_qcs,7,&(lvalues[1939]),0},
-{"id-cct","id-cct",NID_id_cct,7,&(lvalues[1946]),0},
-{"id-pkix1-explicit-88","id-pkix1-explicit-88",
-	NID_id_pkix1_explicit_88,8,&(lvalues[1953]),0},
-{"id-pkix1-implicit-88","id-pkix1-implicit-88",
-	NID_id_pkix1_implicit_88,8,&(lvalues[1961]),0},
-{"id-pkix1-explicit-93","id-pkix1-explicit-93",
-	NID_id_pkix1_explicit_93,8,&(lvalues[1969]),0},
-{"id-pkix1-implicit-93","id-pkix1-implicit-93",
-	NID_id_pkix1_implicit_93,8,&(lvalues[1977]),0},
-{"id-mod-crmf","id-mod-crmf",NID_id_mod_crmf,8,&(lvalues[1985]),0},
-{"id-mod-cmc","id-mod-cmc",NID_id_mod_cmc,8,&(lvalues[1993]),0},
-{"id-mod-kea-profile-88","id-mod-kea-profile-88",
-	NID_id_mod_kea_profile_88,8,&(lvalues[2001]),0},
-{"id-mod-kea-profile-93","id-mod-kea-profile-93",
-	NID_id_mod_kea_profile_93,8,&(lvalues[2009]),0},
-{"id-mod-cmp","id-mod-cmp",NID_id_mod_cmp,8,&(lvalues[2017]),0},
-{"id-mod-qualified-cert-88","id-mod-qualified-cert-88",
-	NID_id_mod_qualified_cert_88,8,&(lvalues[2025]),0},
-{"id-mod-qualified-cert-93","id-mod-qualified-cert-93",
-	NID_id_mod_qualified_cert_93,8,&(lvalues[2033]),0},
-{"id-mod-attribute-cert","id-mod-attribute-cert",
-	NID_id_mod_attribute_cert,8,&(lvalues[2041]),0},
-{"id-mod-timestamp-protocol","id-mod-timestamp-protocol",
-	NID_id_mod_timestamp_protocol,8,&(lvalues[2049]),0},
-{"id-mod-ocsp","id-mod-ocsp",NID_id_mod_ocsp,8,&(lvalues[2057]),0},
-{"id-mod-dvcs","id-mod-dvcs",NID_id_mod_dvcs,8,&(lvalues[2065]),0},
-{"id-mod-cmp2000","id-mod-cmp2000",NID_id_mod_cmp2000,8,
-	&(lvalues[2073]),0},
-{"biometricInfo","Biometric Info",NID_biometricInfo,8,&(lvalues[2081]),0},
-{"qcStatements","qcStatements",NID_qcStatements,8,&(lvalues[2089]),0},
-{"ac-auditEntity","ac-auditEntity",NID_ac_auditEntity,8,
-	&(lvalues[2097]),0},
-{"ac-targeting","ac-targeting",NID_ac_targeting,8,&(lvalues[2105]),0},
-{"aaControls","aaControls",NID_aaControls,8,&(lvalues[2113]),0},
-{"sbgp-ipAddrBlock","sbgp-ipAddrBlock",NID_sbgp_ipAddrBlock,8,
-	&(lvalues[2121]),0},
-{"sbgp-autonomousSysNum","sbgp-autonomousSysNum",
-	NID_sbgp_autonomousSysNum,8,&(lvalues[2129]),0},
-{"sbgp-routerIdentifier","sbgp-routerIdentifier",
-	NID_sbgp_routerIdentifier,8,&(lvalues[2137]),0},
-{"textNotice","textNotice",NID_textNotice,8,&(lvalues[2145]),0},
-{"ipsecEndSystem","IPSec End System",NID_ipsecEndSystem,8,
-	&(lvalues[2153]),0},
-{"ipsecTunnel","IPSec Tunnel",NID_ipsecTunnel,8,&(lvalues[2161]),0},
-{"ipsecUser","IPSec User",NID_ipsecUser,8,&(lvalues[2169]),0},
-{"DVCS","dvcs",NID_dvcs,8,&(lvalues[2177]),0},
-{"id-it-caProtEncCert","id-it-caProtEncCert",NID_id_it_caProtEncCert,
-	8,&(lvalues[2185]),0},
-{"id-it-signKeyPairTypes","id-it-signKeyPairTypes",
-	NID_id_it_signKeyPairTypes,8,&(lvalues[2193]),0},
-{"id-it-encKeyPairTypes","id-it-encKeyPairTypes",
-	NID_id_it_encKeyPairTypes,8,&(lvalues[2201]),0},
-{"id-it-preferredSymmAlg","id-it-preferredSymmAlg",
-	NID_id_it_preferredSymmAlg,8,&(lvalues[2209]),0},
-{"id-it-caKeyUpdateInfo","id-it-caKeyUpdateInfo",
-	NID_id_it_caKeyUpdateInfo,8,&(lvalues[2217]),0},
-{"id-it-currentCRL","id-it-currentCRL",NID_id_it_currentCRL,8,
-	&(lvalues[2225]),0},
-{"id-it-unsupportedOIDs","id-it-unsupportedOIDs",
-	NID_id_it_unsupportedOIDs,8,&(lvalues[2233]),0},
-{"id-it-subscriptionRequest","id-it-subscriptionRequest",
-	NID_id_it_subscriptionRequest,8,&(lvalues[2241]),0},
-{"id-it-subscriptionResponse","id-it-subscriptionResponse",
-	NID_id_it_subscriptionResponse,8,&(lvalues[2249]),0},
-{"id-it-keyPairParamReq","id-it-keyPairParamReq",
-	NID_id_it_keyPairParamReq,8,&(lvalues[2257]),0},
-{"id-it-keyPairParamRep","id-it-keyPairParamRep",
-	NID_id_it_keyPairParamRep,8,&(lvalues[2265]),0},
-{"id-it-revPassphrase","id-it-revPassphrase",NID_id_it_revPassphrase,
-	8,&(lvalues[2273]),0},
-{"id-it-implicitConfirm","id-it-implicitConfirm",
-	NID_id_it_implicitConfirm,8,&(lvalues[2281]),0},
-{"id-it-confirmWaitTime","id-it-confirmWaitTime",
-	NID_id_it_confirmWaitTime,8,&(lvalues[2289]),0},
-{"id-it-origPKIMessage","id-it-origPKIMessage",
-	NID_id_it_origPKIMessage,8,&(lvalues[2297]),0},
-{"id-regCtrl","id-regCtrl",NID_id_regCtrl,8,&(lvalues[2305]),0},
-{"id-regInfo","id-regInfo",NID_id_regInfo,8,&(lvalues[2313]),0},
-{"id-regCtrl-regToken","id-regCtrl-regToken",NID_id_regCtrl_regToken,
-	9,&(lvalues[2321]),0},
-{"id-regCtrl-authenticator","id-regCtrl-authenticator",
-	NID_id_regCtrl_authenticator,9,&(lvalues[2330]),0},
-{"id-regCtrl-pkiPublicationInfo","id-regCtrl-pkiPublicationInfo",
-	NID_id_regCtrl_pkiPublicationInfo,9,&(lvalues[2339]),0},
-{"id-regCtrl-pkiArchiveOptions","id-regCtrl-pkiArchiveOptions",
-	NID_id_regCtrl_pkiArchiveOptions,9,&(lvalues[2348]),0},
-{"id-regCtrl-oldCertID","id-regCtrl-oldCertID",
-	NID_id_regCtrl_oldCertID,9,&(lvalues[2357]),0},
-{"id-regCtrl-protocolEncrKey","id-regCtrl-protocolEncrKey",
-	NID_id_regCtrl_protocolEncrKey,9,&(lvalues[2366]),0},
-{"id-regInfo-utf8Pairs","id-regInfo-utf8Pairs",
-	NID_id_regInfo_utf8Pairs,9,&(lvalues[2375]),0},
-{"id-regInfo-certReq","id-regInfo-certReq",NID_id_regInfo_certReq,9,
-	&(lvalues[2384]),0},
-{"id-alg-des40","id-alg-des40",NID_id_alg_des40,8,&(lvalues[2393]),0},
-{"id-alg-noSignature","id-alg-noSignature",NID_id_alg_noSignature,8,
-	&(lvalues[2401]),0},
-{"id-alg-dh-sig-hmac-sha1","id-alg-dh-sig-hmac-sha1",
-	NID_id_alg_dh_sig_hmac_sha1,8,&(lvalues[2409]),0},
-{"id-alg-dh-pop","id-alg-dh-pop",NID_id_alg_dh_pop,8,&(lvalues[2417]),0},
-{"id-cmc-statusInfo","id-cmc-statusInfo",NID_id_cmc_statusInfo,8,
-	&(lvalues[2425]),0},
-{"id-cmc-identification","id-cmc-identification",
-	NID_id_cmc_identification,8,&(lvalues[2433]),0},
-{"id-cmc-identityProof","id-cmc-identityProof",
-	NID_id_cmc_identityProof,8,&(lvalues[2441]),0},
-{"id-cmc-dataReturn","id-cmc-dataReturn",NID_id_cmc_dataReturn,8,
-	&(lvalues[2449]),0},
-{"id-cmc-transactionId","id-cmc-transactionId",
-	NID_id_cmc_transactionId,8,&(lvalues[2457]),0},
-{"id-cmc-senderNonce","id-cmc-senderNonce",NID_id_cmc_senderNonce,8,
-	&(lvalues[2465]),0},
-{"id-cmc-recipientNonce","id-cmc-recipientNonce",
-	NID_id_cmc_recipientNonce,8,&(lvalues[2473]),0},
-{"id-cmc-addExtensions","id-cmc-addExtensions",
-	NID_id_cmc_addExtensions,8,&(lvalues[2481]),0},
-{"id-cmc-encryptedPOP","id-cmc-encryptedPOP",NID_id_cmc_encryptedPOP,
-	8,&(lvalues[2489]),0},
-{"id-cmc-decryptedPOP","id-cmc-decryptedPOP",NID_id_cmc_decryptedPOP,
-	8,&(lvalues[2497]),0},
-{"id-cmc-lraPOPWitness","id-cmc-lraPOPWitness",
-	NID_id_cmc_lraPOPWitness,8,&(lvalues[2505]),0},
-{"id-cmc-getCert","id-cmc-getCert",NID_id_cmc_getCert,8,
-	&(lvalues[2513]),0},
-{"id-cmc-getCRL","id-cmc-getCRL",NID_id_cmc_getCRL,8,&(lvalues[2521]),0},
-{"id-cmc-revokeRequest","id-cmc-revokeRequest",
-	NID_id_cmc_revokeRequest,8,&(lvalues[2529]),0},
-{"id-cmc-regInfo","id-cmc-regInfo",NID_id_cmc_regInfo,8,
-	&(lvalues[2537]),0},
-{"id-cmc-responseInfo","id-cmc-responseInfo",NID_id_cmc_responseInfo,
-	8,&(lvalues[2545]),0},
-{"id-cmc-queryPending","id-cmc-queryPending",NID_id_cmc_queryPending,
-	8,&(lvalues[2553]),0},
-{"id-cmc-popLinkRandom","id-cmc-popLinkRandom",
-	NID_id_cmc_popLinkRandom,8,&(lvalues[2561]),0},
-{"id-cmc-popLinkWitness","id-cmc-popLinkWitness",
-	NID_id_cmc_popLinkWitness,8,&(lvalues[2569]),0},
-{"id-cmc-confirmCertAcceptance","id-cmc-confirmCertAcceptance",
-	NID_id_cmc_confirmCertAcceptance,8,&(lvalues[2577]),0},
-{"id-on-personalData","id-on-personalData",NID_id_on_personalData,8,
-	&(lvalues[2585]),0},
-{"id-pda-dateOfBirth","id-pda-dateOfBirth",NID_id_pda_dateOfBirth,8,
-	&(lvalues[2593]),0},
-{"id-pda-placeOfBirth","id-pda-placeOfBirth",NID_id_pda_placeOfBirth,
-	8,&(lvalues[2601]),0},
-{NULL,NULL,NID_undef,0,NULL,0},
-{"id-pda-gender","id-pda-gender",NID_id_pda_gender,8,&(lvalues[2609]),0},
-{"id-pda-countryOfCitizenship","id-pda-countryOfCitizenship",
-	NID_id_pda_countryOfCitizenship,8,&(lvalues[2617]),0},
-{"id-pda-countryOfResidence","id-pda-countryOfResidence",
-	NID_id_pda_countryOfResidence,8,&(lvalues[2625]),0},
-{"id-aca-authenticationInfo","id-aca-authenticationInfo",
-	NID_id_aca_authenticationInfo,8,&(lvalues[2633]),0},
-{"id-aca-accessIdentity","id-aca-accessIdentity",
-	NID_id_aca_accessIdentity,8,&(lvalues[2641]),0},
-{"id-aca-chargingIdentity","id-aca-chargingIdentity",
-	NID_id_aca_chargingIdentity,8,&(lvalues[2649]),0},
-{"id-aca-group","id-aca-group",NID_id_aca_group,8,&(lvalues[2657]),0},
-{"id-aca-role","id-aca-role",NID_id_aca_role,8,&(lvalues[2665]),0},
-{"id-qcs-pkixQCSyntax-v1","id-qcs-pkixQCSyntax-v1",
-	NID_id_qcs_pkixQCSyntax_v1,8,&(lvalues[2673]),0},
-{"id-cct-crs","id-cct-crs",NID_id_cct_crs,8,&(lvalues[2681]),0},
-{"id-cct-PKIData","id-cct-PKIData",NID_id_cct_PKIData,8,
-	&(lvalues[2689]),0},
-{"id-cct-PKIResponse","id-cct-PKIResponse",NID_id_cct_PKIResponse,8,
-	&(lvalues[2697]),0},
-{"ad_timestamping","AD Time Stamping",NID_ad_timeStamping,8,
-	&(lvalues[2705]),0},
-{"AD_DVCS","ad dvcs",NID_ad_dvcs,8,&(lvalues[2713]),0},
-{"basicOCSPResponse","Basic OCSP Response",NID_id_pkix_OCSP_basic,9,
-	&(lvalues[2721]),0},
-{"Nonce","OCSP Nonce",NID_id_pkix_OCSP_Nonce,9,&(lvalues[2730]),0},
-{"CrlID","OCSP CRL ID",NID_id_pkix_OCSP_CrlID,9,&(lvalues[2739]),0},
-{"acceptableResponses","Acceptable OCSP Responses",
-	NID_id_pkix_OCSP_acceptableResponses,9,&(lvalues[2748]),0},
-{"noCheck","OCSP No Check",NID_id_pkix_OCSP_noCheck,9,&(lvalues[2757]),0},
-{"archiveCutoff","OCSP Archive Cutoff",NID_id_pkix_OCSP_archiveCutoff,
-	9,&(lvalues[2766]),0},
-{"serviceLocator","OCSP Service Locator",
-	NID_id_pkix_OCSP_serviceLocator,9,&(lvalues[2775]),0},
-{"extendedStatus","Extended OCSP Status",
-	NID_id_pkix_OCSP_extendedStatus,9,&(lvalues[2784]),0},
-{"valid","valid",NID_id_pkix_OCSP_valid,9,&(lvalues[2793]),0},
-{"path","path",NID_id_pkix_OCSP_path,9,&(lvalues[2802]),0},
-{"trustRoot","Trust Root",NID_id_pkix_OCSP_trustRoot,9,
-	&(lvalues[2811]),0},
-{"algorithm","algorithm",NID_algorithm,4,&(lvalues[2820]),0},
-{"rsaSignature","rsaSignature",NID_rsaSignature,5,&(lvalues[2824]),0},
-{"X500algorithms","directory services - algorithms",
-	NID_X500algorithms,2,&(lvalues[2829]),0},
-{"ORG","org",NID_org,1,&(lvalues[2831]),0},
-{"DOD","dod",NID_dod,2,&(lvalues[2832]),0},
-{"IANA","iana",NID_iana,3,&(lvalues[2834]),0},
-{"directory","Directory",NID_Directory,4,&(lvalues[2837]),0},
-{"mgmt","Management",NID_Management,4,&(lvalues[2841]),0},
-{"experimental","Experimental",NID_Experimental,4,&(lvalues[2845]),0},
-{"private","Private",NID_Private,4,&(lvalues[2849]),0},
-{"security","Security",NID_Security,4,&(lvalues[2853]),0},
-{"snmpv2","SNMPv2",NID_SNMPv2,4,&(lvalues[2857]),0},
-{"Mail","Mail",NID_Mail,4,&(lvalues[2861]),0},
-{"enterprises","Enterprises",NID_Enterprises,5,&(lvalues[2865]),0},
-{"dcobject","dcObject",NID_dcObject,9,&(lvalues[2870]),0},
-{"DC","domainComponent",NID_domainComponent,10,&(lvalues[2879]),0},
-{"domain","Domain",NID_Domain,10,&(lvalues[2889]),0},
-{"NULL","NULL",NID_joint_iso_ccitt,1,&(lvalues[2899]),0},
-{"selected-attribute-types","Selected Attribute Types",
-	NID_selected_attribute_types,3,&(lvalues[2900]),0},
-{"clearance","clearance",NID_clearance,4,&(lvalues[2903]),0},
-{"RSA-MD4","md4WithRSAEncryption",NID_md4WithRSAEncryption,9,
-	&(lvalues[2907]),0},
-{"ac-proxying","ac-proxying",NID_ac_proxying,8,&(lvalues[2916]),0},
-{"subjectInfoAccess","Subject Information Access",NID_sinfo_access,8,
-	&(lvalues[2924]),0},
-{"id-aca-encAttrs","id-aca-encAttrs",NID_id_aca_encAttrs,8,
-	&(lvalues[2932]),0},
-{"role","role",NID_role,3,&(lvalues[2940]),0},
-{"policyConstraints","X509v3 Policy Constraints",
-	NID_policy_constraints,3,&(lvalues[2943]),0},
-{"targetInformation","X509v3 AC Targeting",NID_target_information,3,
-	&(lvalues[2946]),0},
-{"noRevAvail","X509v3 No Revocation Available",NID_no_rev_avail,3,
-	&(lvalues[2949]),0},
-{"NULL","NULL",NID_ccitt,1,&(lvalues[2952]),0},
-{"ansi-X9-62","ANSI X9.62",NID_ansi_X9_62,5,&(lvalues[2953]),0},
-{"prime-field","prime-field",NID_X9_62_prime_field,7,&(lvalues[2958]),0},
-{"characteristic-two-field","characteristic-two-field",
-	NID_X9_62_characteristic_two_field,7,&(lvalues[2965]),0},
-{"id-ecPublicKey","id-ecPublicKey",NID_X9_62_id_ecPublicKey,7,
-	&(lvalues[2972]),0},
-{"prime192v1","prime192v1",NID_X9_62_prime192v1,8,&(lvalues[2979]),0},
-{"prime192v2","prime192v2",NID_X9_62_prime192v2,8,&(lvalues[2987]),0},
-{"prime192v3","prime192v3",NID_X9_62_prime192v3,8,&(lvalues[2995]),0},
-{"prime239v1","prime239v1",NID_X9_62_prime239v1,8,&(lvalues[3003]),0},
-{"prime239v2","prime239v2",NID_X9_62_prime239v2,8,&(lvalues[3011]),0},
-{"prime239v3","prime239v3",NID_X9_62_prime239v3,8,&(lvalues[3019]),0},
-{"prime256v1","prime256v1",NID_X9_62_prime256v1,8,&(lvalues[3027]),0},
-{"ecdsa-with-SHA1","ecdsa-with-SHA1",NID_ecdsa_with_SHA1,7,
-	&(lvalues[3035]),0},
-{"CSPName","Microsoft CSP Name",NID_ms_csp_name,9,&(lvalues[3042]),0},
-{"AES-128-ECB","aes-128-ecb",NID_aes_128_ecb,9,&(lvalues[3051]),0},
-{"AES-128-CBC","aes-128-cbc",NID_aes_128_cbc,9,&(lvalues[3060]),0},
-{"AES-128-OFB","aes-128-ofb",NID_aes_128_ofb128,9,&(lvalues[3069]),0},
-{"AES-128-CFB","aes-128-cfb",NID_aes_128_cfb128,9,&(lvalues[3078]),0},
-{"AES-192-ECB","aes-192-ecb",NID_aes_192_ecb,9,&(lvalues[3087]),0},
-{"AES-192-CBC","aes-192-cbc",NID_aes_192_cbc,9,&(lvalues[3096]),0},
-{"AES-192-OFB","aes-192-ofb",NID_aes_192_ofb128,9,&(lvalues[3105]),0},
-{"AES-192-CFB","aes-192-cfb",NID_aes_192_cfb128,9,&(lvalues[3114]),0},
-{"AES-256-ECB","aes-256-ecb",NID_aes_256_ecb,9,&(lvalues[3123]),0},
-{"AES-256-CBC","aes-256-cbc",NID_aes_256_cbc,9,&(lvalues[3132]),0},
-{"AES-256-OFB","aes-256-ofb",NID_aes_256_ofb128,9,&(lvalues[3141]),0},
-{"AES-256-CFB","aes-256-cfb",NID_aes_256_cfb128,9,&(lvalues[3150]),0},
-{"holdInstructionCode","Hold Instruction Code",
-	NID_hold_instruction_code,3,&(lvalues[3159]),0},
-{"holdInstructionNone","Hold Instruction None",
-	NID_hold_instruction_none,7,&(lvalues[3162]),0},
-{"holdInstructionCallIssuer","Hold Instruction Call Issuer",
-	NID_hold_instruction_call_issuer,7,&(lvalues[3169]),0},
-{"holdInstructionReject","Hold Instruction Reject",
-	NID_hold_instruction_reject,7,&(lvalues[3176]),0},
-{"data","data",NID_data,1,&(lvalues[3183]),0},
-{"pss","pss",NID_pss,3,&(lvalues[3184]),0},
-{"ucl","ucl",NID_ucl,7,&(lvalues[3187]),0},
-{"pilot","pilot",NID_pilot,8,&(lvalues[3194]),0},
-{"pilotAttributeType","pilotAttributeType",NID_pilotAttributeType,9,
-	&(lvalues[3202]),0},
-{"pilotAttributeSyntax","pilotAttributeSyntax",
-	NID_pilotAttributeSyntax,9,&(lvalues[3211]),0},
-{"pilotObjectClass","pilotObjectClass",NID_pilotObjectClass,9,
-	&(lvalues[3220]),0},
-{"pilotGroups","pilotGroups",NID_pilotGroups,9,&(lvalues[3229]),0},
-{"iA5StringSyntax","iA5StringSyntax",NID_iA5StringSyntax,10,
-	&(lvalues[3238]),0},
-{"caseIgnoreIA5StringSyntax","caseIgnoreIA5StringSyntax",
-	NID_caseIgnoreIA5StringSyntax,10,&(lvalues[3248]),0},
-{"pilotObject","pilotObject",NID_pilotObject,10,&(lvalues[3258]),0},
-{"pilotPerson","pilotPerson",NID_pilotPerson,10,&(lvalues[3268]),0},
-{"account","account",NID_account,10,&(lvalues[3278]),0},
-{"document","document",NID_document,10,&(lvalues[3288]),0},
-{"room","room",NID_room,10,&(lvalues[3298]),0},
-{"documentSeries","documentSeries",NID_documentSeries,10,
-	&(lvalues[3308]),0},
-{"rFC822localPart","rFC822localPart",NID_rFC822localPart,10,
-	&(lvalues[3318]),0},
-{"dNSDomain","dNSDomain",NID_dNSDomain,10,&(lvalues[3328]),0},
-{"domainRelatedObject","domainRelatedObject",NID_domainRelatedObject,
-	10,&(lvalues[3338]),0},
-{"friendlyCountry","friendlyCountry",NID_friendlyCountry,10,
-	&(lvalues[3348]),0},
-{"simpleSecurityObject","simpleSecurityObject",
-	NID_simpleSecurityObject,10,&(lvalues[3358]),0},
-{"pilotOrganization","pilotOrganization",NID_pilotOrganization,10,
-	&(lvalues[3368]),0},
-{"pilotDSA","pilotDSA",NID_pilotDSA,10,&(lvalues[3378]),0},
-{"qualityLabelledData","qualityLabelledData",NID_qualityLabelledData,
-	10,&(lvalues[3388]),0},
-{"UID","userId",NID_userId,10,&(lvalues[3398]),0},
-{"textEncodedORAddress","textEncodedORAddress",
-	NID_textEncodedORAddress,10,&(lvalues[3408]),0},
-{"mail","rfc822Mailbox",NID_rfc822Mailbox,10,&(lvalues[3418]),0},
-{"info","info",NID_info,10,&(lvalues[3428]),0},
-{"favouriteDrink","favouriteDrink",NID_favouriteDrink,10,
-	&(lvalues[3438]),0},
-{"roomNumber","roomNumber",NID_roomNumber,10,&(lvalues[3448]),0},
-{"photo","photo",NID_photo,10,&(lvalues[3458]),0},
-{"userClass","userClass",NID_userClass,10,&(lvalues[3468]),0},
-{"host","host",NID_host,10,&(lvalues[3478]),0},
-{"manager","manager",NID_manager,10,&(lvalues[3488]),0},
-{"documentIdentifier","documentIdentifier",NID_documentIdentifier,10,
-	&(lvalues[3498]),0},
-{"documentTitle","documentTitle",NID_documentTitle,10,&(lvalues[3508]),0},
-{"documentVersion","documentVersion",NID_documentVersion,10,
-	&(lvalues[3518]),0},
-{"documentAuthor","documentAuthor",NID_documentAuthor,10,
-	&(lvalues[3528]),0},
-{"documentLocation","documentLocation",NID_documentLocation,10,
-	&(lvalues[3538]),0},
-{"homeTelephoneNumber","homeTelephoneNumber",NID_homeTelephoneNumber,
-	10,&(lvalues[3548]),0},
-{"secretary","secretary",NID_secretary,10,&(lvalues[3558]),0},
-{"otherMailbox","otherMailbox",NID_otherMailbox,10,&(lvalues[3568]),0},
-{"lastModifiedTime","lastModifiedTime",NID_lastModifiedTime,10,
-	&(lvalues[3578]),0},
-{"lastModifiedBy","lastModifiedBy",NID_lastModifiedBy,10,
-	&(lvalues[3588]),0},
-{"aRecord","aRecord",NID_aRecord,10,&(lvalues[3598]),0},
-{"pilotAttributeType27","pilotAttributeType27",
-	NID_pilotAttributeType27,10,&(lvalues[3608]),0},
-{"mXRecord","mXRecord",NID_mXRecord,10,&(lvalues[3618]),0},
-{"nSRecord","nSRecord",NID_nSRecord,10,&(lvalues[3628]),0},
-{"sOARecord","sOARecord",NID_sOARecord,10,&(lvalues[3638]),0},
-{"cNAMERecord","cNAMERecord",NID_cNAMERecord,10,&(lvalues[3648]),0},
-{"associatedDomain","associatedDomain",NID_associatedDomain,10,
-	&(lvalues[3658]),0},
-{"associatedName","associatedName",NID_associatedName,10,
-	&(lvalues[3668]),0},
-{"homePostalAddress","homePostalAddress",NID_homePostalAddress,10,
-	&(lvalues[3678]),0},
-{"personalTitle","personalTitle",NID_personalTitle,10,&(lvalues[3688]),0},
-{"mobileTelephoneNumber","mobileTelephoneNumber",
-	NID_mobileTelephoneNumber,10,&(lvalues[3698]),0},
-{"pagerTelephoneNumber","pagerTelephoneNumber",
-	NID_pagerTelephoneNumber,10,&(lvalues[3708]),0},
-{"friendlyCountryName","friendlyCountryName",NID_friendlyCountryName,
-	10,&(lvalues[3718]),0},
-{"organizationalStatus","organizationalStatus",
-	NID_organizationalStatus,10,&(lvalues[3728]),0},
-{"janetMailbox","janetMailbox",NID_janetMailbox,10,&(lvalues[3738]),0},
-{"mailPreferenceOption","mailPreferenceOption",
-	NID_mailPreferenceOption,10,&(lvalues[3748]),0},
-{"buildingName","buildingName",NID_buildingName,10,&(lvalues[3758]),0},
-{"dSAQuality","dSAQuality",NID_dSAQuality,10,&(lvalues[3768]),0},
-{"singleLevelQuality","singleLevelQuality",NID_singleLevelQuality,10,
-	&(lvalues[3778]),0},
-{"subtreeMinimumQuality","subtreeMinimumQuality",
-	NID_subtreeMinimumQuality,10,&(lvalues[3788]),0},
-{"subtreeMaximumQuality","subtreeMaximumQuality",
-	NID_subtreeMaximumQuality,10,&(lvalues[3798]),0},
-{"personalSignature","personalSignature",NID_personalSignature,10,
-	&(lvalues[3808]),0},
-{"dITRedirect","dITRedirect",NID_dITRedirect,10,&(lvalues[3818]),0},
-{"audio","audio",NID_audio,10,&(lvalues[3828]),0},
-{"documentPublisher","documentPublisher",NID_documentPublisher,10,
-	&(lvalues[3838]),0},
-{"x500UniqueIdentifier","x500UniqueIdentifier",
-	NID_x500UniqueIdentifier,3,&(lvalues[3848]),0},
-{"mime-mhs","MIME MHS",NID_mime_mhs,5,&(lvalues[3851]),0},
-{"mime-mhs-headings","mime-mhs-headings",NID_mime_mhs_headings,6,
-	&(lvalues[3856]),0},
-{"mime-mhs-bodies","mime-mhs-bodies",NID_mime_mhs_bodies,6,
-	&(lvalues[3862]),0},
-{"id-hex-partial-message","id-hex-partial-message",
-	NID_id_hex_partial_message,7,&(lvalues[3868]),0},
-{"id-hex-multipart-message","id-hex-multipart-message",
-	NID_id_hex_multipart_message,7,&(lvalues[3875]),0},
-{"generationQualifier","generationQualifier",NID_generationQualifier,
-	3,&(lvalues[3882]),0},
-{"pseudonym","pseudonym",NID_pseudonym,3,&(lvalues[3885]),0},
-{NULL,NULL,NID_undef,0,NULL,0},
-{"id-set","Secure Electronic Transactions",NID_id_set,2,
-	&(lvalues[3888]),0},
-{"set-ctype","content types",NID_set_ctype,3,&(lvalues[3890]),0},
-{"set-msgExt","message extensions",NID_set_msgExt,3,&(lvalues[3893]),0},
-{"set-attr","set-attr",NID_set_attr,3,&(lvalues[3896]),0},
-{"set-policy","set-policy",NID_set_policy,3,&(lvalues[3899]),0},
-{"set-certExt","certificate extensions",NID_set_certExt,3,
-	&(lvalues[3902]),0},
-{"set-brand","set-brand",NID_set_brand,3,&(lvalues[3905]),0},
-{"setct-PANData","setct-PANData",NID_setct_PANData,4,&(lvalues[3908]),0},
-{"setct-PANToken","setct-PANToken",NID_setct_PANToken,4,
-	&(lvalues[3912]),0},
-{"setct-PANOnly","setct-PANOnly",NID_setct_PANOnly,4,&(lvalues[3916]),0},
-{"setct-OIData","setct-OIData",NID_setct_OIData,4,&(lvalues[3920]),0},
-{"setct-PI","setct-PI",NID_setct_PI,4,&(lvalues[3924]),0},
-{"setct-PIData","setct-PIData",NID_setct_PIData,4,&(lvalues[3928]),0},
-{"setct-PIDataUnsigned","setct-PIDataUnsigned",
-	NID_setct_PIDataUnsigned,4,&(lvalues[3932]),0},
-{"setct-HODInput","setct-HODInput",NID_setct_HODInput,4,
-	&(lvalues[3936]),0},
-{"setct-AuthResBaggage","setct-AuthResBaggage",
-	NID_setct_AuthResBaggage,4,&(lvalues[3940]),0},
-{"setct-AuthRevReqBaggage","setct-AuthRevReqBaggage",
-	NID_setct_AuthRevReqBaggage,4,&(lvalues[3944]),0},
-{"setct-AuthRevResBaggage","setct-AuthRevResBaggage",
-	NID_setct_AuthRevResBaggage,4,&(lvalues[3948]),0},
-{"setct-CapTokenSeq","setct-CapTokenSeq",NID_setct_CapTokenSeq,4,
-	&(lvalues[3952]),0},
-{"setct-PInitResData","setct-PInitResData",NID_setct_PInitResData,4,
-	&(lvalues[3956]),0},
-{"setct-PI-TBS","setct-PI-TBS",NID_setct_PI_TBS,4,&(lvalues[3960]),0},
-{"setct-PResData","setct-PResData",NID_setct_PResData,4,
-	&(lvalues[3964]),0},
-{"setct-AuthReqTBS","setct-AuthReqTBS",NID_setct_AuthReqTBS,4,
-	&(lvalues[3968]),0},
-{"setct-AuthResTBS","setct-AuthResTBS",NID_setct_AuthResTBS,4,
-	&(lvalues[3972]),0},
-{"setct-AuthResTBSX","setct-AuthResTBSX",NID_setct_AuthResTBSX,4,
-	&(lvalues[3976]),0},
-{"setct-AuthTokenTBS","setct-AuthTokenTBS",NID_setct_AuthTokenTBS,4,
-	&(lvalues[3980]),0},
-{"setct-CapTokenData","setct-CapTokenData",NID_setct_CapTokenData,4,
-	&(lvalues[3984]),0},
-{"setct-CapTokenTBS","setct-CapTokenTBS",NID_setct_CapTokenTBS,4,
-	&(lvalues[3988]),0},
-{"setct-AcqCardCodeMsg","setct-AcqCardCodeMsg",
-	NID_setct_AcqCardCodeMsg,4,&(lvalues[3992]),0},
-{"setct-AuthRevReqTBS","setct-AuthRevReqTBS",NID_setct_AuthRevReqTBS,
-	4,&(lvalues[3996]),0},
-{"setct-AuthRevResData","setct-AuthRevResData",
-	NID_setct_AuthRevResData,4,&(lvalues[4000]),0},
-{"setct-AuthRevResTBS","setct-AuthRevResTBS",NID_setct_AuthRevResTBS,
-	4,&(lvalues[4004]),0},
-{"setct-CapReqTBS","setct-CapReqTBS",NID_setct_CapReqTBS,4,
-	&(lvalues[4008]),0},
-{"setct-CapReqTBSX","setct-CapReqTBSX",NID_setct_CapReqTBSX,4,
-	&(lvalues[4012]),0},
-{"setct-CapResData","setct-CapResData",NID_setct_CapResData,4,
-	&(lvalues[4016]),0},
-{"setct-CapRevReqTBS","setct-CapRevReqTBS",NID_setct_CapRevReqTBS,4,
-	&(lvalues[4020]),0},
-{"setct-CapRevReqTBSX","setct-CapRevReqTBSX",NID_setct_CapRevReqTBSX,
-	4,&(lvalues[4024]),0},
-{"setct-CapRevResData","setct-CapRevResData",NID_setct_CapRevResData,
-	4,&(lvalues[4028]),0},
-{"setct-CredReqTBS","setct-CredReqTBS",NID_setct_CredReqTBS,4,
-	&(lvalues[4032]),0},
-{"setct-CredReqTBSX","setct-CredReqTBSX",NID_setct_CredReqTBSX,4,
-	&(lvalues[4036]),0},
-{"setct-CredResData","setct-CredResData",NID_setct_CredResData,4,
-	&(lvalues[4040]),0},
-{"setct-CredRevReqTBS","setct-CredRevReqTBS",NID_setct_CredRevReqTBS,
-	4,&(lvalues[4044]),0},
-{"setct-CredRevReqTBSX","setct-CredRevReqTBSX",
-	NID_setct_CredRevReqTBSX,4,&(lvalues[4048]),0},
-{"setct-CredRevResData","setct-CredRevResData",
-	NID_setct_CredRevResData,4,&(lvalues[4052]),0},
-{"setct-PCertReqData","setct-PCertReqData",NID_setct_PCertReqData,4,
-	&(lvalues[4056]),0},
-{"setct-PCertResTBS","setct-PCertResTBS",NID_setct_PCertResTBS,4,
-	&(lvalues[4060]),0},
-{"setct-BatchAdminReqData","setct-BatchAdminReqData",
-	NID_setct_BatchAdminReqData,4,&(lvalues[4064]),0},
-{"setct-BatchAdminResData","setct-BatchAdminResData",
-	NID_setct_BatchAdminResData,4,&(lvalues[4068]),0},
-{"setct-CardCInitResTBS","setct-CardCInitResTBS",
-	NID_setct_CardCInitResTBS,4,&(lvalues[4072]),0},
-{"setct-MeAqCInitResTBS","setct-MeAqCInitResTBS",
-	NID_setct_MeAqCInitResTBS,4,&(lvalues[4076]),0},
-{"setct-RegFormResTBS","setct-RegFormResTBS",NID_setct_RegFormResTBS,
-	4,&(lvalues[4080]),0},
-{"setct-CertReqData","setct-CertReqData",NID_setct_CertReqData,4,
-	&(lvalues[4084]),0},
-{"setct-CertReqTBS","setct-CertReqTBS",NID_setct_CertReqTBS,4,
-	&(lvalues[4088]),0},
-{"setct-CertResData","setct-CertResData",NID_setct_CertResData,4,
-	&(lvalues[4092]),0},
-{"setct-CertInqReqTBS","setct-CertInqReqTBS",NID_setct_CertInqReqTBS,
-	4,&(lvalues[4096]),0},
-{"setct-ErrorTBS","setct-ErrorTBS",NID_setct_ErrorTBS,4,
-	&(lvalues[4100]),0},
-{"setct-PIDualSignedTBE","setct-PIDualSignedTBE",
-	NID_setct_PIDualSignedTBE,4,&(lvalues[4104]),0},
-{"setct-PIUnsignedTBE","setct-PIUnsignedTBE",NID_setct_PIUnsignedTBE,
-	4,&(lvalues[4108]),0},
-{"setct-AuthReqTBE","setct-AuthReqTBE",NID_setct_AuthReqTBE,4,
-	&(lvalues[4112]),0},
-{"setct-AuthResTBE","setct-AuthResTBE",NID_setct_AuthResTBE,4,
-	&(lvalues[4116]),0},
-{"setct-AuthResTBEX","setct-AuthResTBEX",NID_setct_AuthResTBEX,4,
-	&(lvalues[4120]),0},
-{"setct-AuthTokenTBE","setct-AuthTokenTBE",NID_setct_AuthTokenTBE,4,
-	&(lvalues[4124]),0},
-{"setct-CapTokenTBE","setct-CapTokenTBE",NID_setct_CapTokenTBE,4,
-	&(lvalues[4128]),0},
-{"setct-CapTokenTBEX","setct-CapTokenTBEX",NID_setct_CapTokenTBEX,4,
-	&(lvalues[4132]),0},
-{"setct-AcqCardCodeMsgTBE","setct-AcqCardCodeMsgTBE",
-	NID_setct_AcqCardCodeMsgTBE,4,&(lvalues[4136]),0},
-{"setct-AuthRevReqTBE","setct-AuthRevReqTBE",NID_setct_AuthRevReqTBE,
-	4,&(lvalues[4140]),0},
-{"setct-AuthRevResTBE","setct-AuthRevResTBE",NID_setct_AuthRevResTBE,
-	4,&(lvalues[4144]),0},
-{"setct-AuthRevResTBEB","setct-AuthRevResTBEB",
-	NID_setct_AuthRevResTBEB,4,&(lvalues[4148]),0},
-{"setct-CapReqTBE","setct-CapReqTBE",NID_setct_CapReqTBE,4,
-	&(lvalues[4152]),0},
-{"setct-CapReqTBEX","setct-CapReqTBEX",NID_setct_CapReqTBEX,4,
-	&(lvalues[4156]),0},
-{"setct-CapResTBE","setct-CapResTBE",NID_setct_CapResTBE,4,
-	&(lvalues[4160]),0},
-{"setct-CapRevReqTBE","setct-CapRevReqTBE",NID_setct_CapRevReqTBE,4,
-	&(lvalues[4164]),0},
-{"setct-CapRevReqTBEX","setct-CapRevReqTBEX",NID_setct_CapRevReqTBEX,
-	4,&(lvalues[4168]),0},
-{"setct-CapRevResTBE","setct-CapRevResTBE",NID_setct_CapRevResTBE,4,
-	&(lvalues[4172]),0},
-{"setct-CredReqTBE","setct-CredReqTBE",NID_setct_CredReqTBE,4,
-	&(lvalues[4176]),0},
-{"setct-CredReqTBEX","setct-CredReqTBEX",NID_setct_CredReqTBEX,4,
-	&(lvalues[4180]),0},
-{"setct-CredResTBE","setct-CredResTBE",NID_setct_CredResTBE,4,
-	&(lvalues[4184]),0},
-{"setct-CredRevReqTBE","setct-CredRevReqTBE",NID_setct_CredRevReqTBE,
-	4,&(lvalues[4188]),0},
-{"setct-CredRevReqTBEX","setct-CredRevReqTBEX",
-	NID_setct_CredRevReqTBEX,4,&(lvalues[4192]),0},
-{"setct-CredRevResTBE","setct-CredRevResTBE",NID_setct_CredRevResTBE,
-	4,&(lvalues[4196]),0},
-{"setct-BatchAdminReqTBE","setct-BatchAdminReqTBE",
-	NID_setct_BatchAdminReqTBE,4,&(lvalues[4200]),0},
-{"setct-BatchAdminResTBE","setct-BatchAdminResTBE",
-	NID_setct_BatchAdminResTBE,4,&(lvalues[4204]),0},
-{"setct-RegFormReqTBE","setct-RegFormReqTBE",NID_setct_RegFormReqTBE,
-	4,&(lvalues[4208]),0},
-{"setct-CertReqTBE","setct-CertReqTBE",NID_setct_CertReqTBE,4,
-	&(lvalues[4212]),0},
-{"setct-CertReqTBEX","setct-CertReqTBEX",NID_setct_CertReqTBEX,4,
-	&(lvalues[4216]),0},
-{"setct-CertResTBE","setct-CertResTBE",NID_setct_CertResTBE,4,
-	&(lvalues[4220]),0},
-{"setct-CRLNotificationTBS","setct-CRLNotificationTBS",
-	NID_setct_CRLNotificationTBS,4,&(lvalues[4224]),0},
-{"setct-CRLNotificationResTBS","setct-CRLNotificationResTBS",
-	NID_setct_CRLNotificationResTBS,4,&(lvalues[4228]),0},
-{"setct-BCIDistributionTBS","setct-BCIDistributionTBS",
-	NID_setct_BCIDistributionTBS,4,&(lvalues[4232]),0},
-{"setext-genCrypt","generic cryptogram",NID_setext_genCrypt,4,
-	&(lvalues[4236]),0},
-{"setext-miAuth","merchant initiated auth",NID_setext_miAuth,4,
-	&(lvalues[4240]),0},
-{"setext-pinSecure","setext-pinSecure",NID_setext_pinSecure,4,
-	&(lvalues[4244]),0},
-{"setext-pinAny","setext-pinAny",NID_setext_pinAny,4,&(lvalues[4248]),0},
-{"setext-track2","setext-track2",NID_setext_track2,4,&(lvalues[4252]),0},
-{"setext-cv","additional verification",NID_setext_cv,4,
-	&(lvalues[4256]),0},
-{"set-policy-root","set-policy-root",NID_set_policy_root,4,
-	&(lvalues[4260]),0},
-{"setCext-hashedRoot","setCext-hashedRoot",NID_setCext_hashedRoot,4,
-	&(lvalues[4264]),0},
-{"setCext-certType","setCext-certType",NID_setCext_certType,4,
-	&(lvalues[4268]),0},
-{"setCext-merchData","setCext-merchData",NID_setCext_merchData,4,
-	&(lvalues[4272]),0},
-{"setCext-cCertRequired","setCext-cCertRequired",
-	NID_setCext_cCertRequired,4,&(lvalues[4276]),0},
-{"setCext-tunneling","setCext-tunneling",NID_setCext_tunneling,4,
-	&(lvalues[4280]),0},
-{"setCext-setExt","setCext-setExt",NID_setCext_setExt,4,
-	&(lvalues[4284]),0},
-{"setCext-setQualf","setCext-setQualf",NID_setCext_setQualf,4,
-	&(lvalues[4288]),0},
-{"setCext-PGWYcapabilities","setCext-PGWYcapabilities",
-	NID_setCext_PGWYcapabilities,4,&(lvalues[4292]),0},
-{"setCext-TokenIdentifier","setCext-TokenIdentifier",
-	NID_setCext_TokenIdentifier,4,&(lvalues[4296]),0},
-{"setCext-Track2Data","setCext-Track2Data",NID_setCext_Track2Data,4,
-	&(lvalues[4300]),0},
-{"setCext-TokenType","setCext-TokenType",NID_setCext_TokenType,4,
-	&(lvalues[4304]),0},
-{"setCext-IssuerCapabilities","setCext-IssuerCapabilities",
-	NID_setCext_IssuerCapabilities,4,&(lvalues[4308]),0},
-{"setAttr-Cert","setAttr-Cert",NID_setAttr_Cert,4,&(lvalues[4312]),0},
-{"setAttr-PGWYcap","payment gateway capabilities",NID_setAttr_PGWYcap,
-	4,&(lvalues[4316]),0},
-{"setAttr-TokenType","setAttr-TokenType",NID_setAttr_TokenType,4,
-	&(lvalues[4320]),0},
-{"setAttr-IssCap","issuer capabilities",NID_setAttr_IssCap,4,
-	&(lvalues[4324]),0},
-{"set-rootKeyThumb","set-rootKeyThumb",NID_set_rootKeyThumb,5,
-	&(lvalues[4328]),0},
-{"set-addPolicy","set-addPolicy",NID_set_addPolicy,5,&(lvalues[4333]),0},
-{"setAttr-Token-EMV","setAttr-Token-EMV",NID_setAttr_Token_EMV,5,
-	&(lvalues[4338]),0},
-{"setAttr-Token-B0Prime","setAttr-Token-B0Prime",
-	NID_setAttr_Token_B0Prime,5,&(lvalues[4343]),0},
-{"setAttr-IssCap-CVM","setAttr-IssCap-CVM",NID_setAttr_IssCap_CVM,5,
-	&(lvalues[4348]),0},
-{"setAttr-IssCap-T2","setAttr-IssCap-T2",NID_setAttr_IssCap_T2,5,
-	&(lvalues[4353]),0},
-{"setAttr-IssCap-Sig","setAttr-IssCap-Sig",NID_setAttr_IssCap_Sig,5,
-	&(lvalues[4358]),0},
-{"setAttr-GenCryptgrm","generate cryptogram",NID_setAttr_GenCryptgrm,
-	6,&(lvalues[4363]),0},
-{"setAttr-T2Enc","encrypted track 2",NID_setAttr_T2Enc,6,
-	&(lvalues[4369]),0},
-{"setAttr-T2cleartxt","cleartext track 2",NID_setAttr_T2cleartxt,6,
-	&(lvalues[4375]),0},
-{"setAttr-TokICCsig","ICC or token signature",NID_setAttr_TokICCsig,6,
-	&(lvalues[4381]),0},
-{"setAttr-SecDevSig","secure device signature",NID_setAttr_SecDevSig,
-	6,&(lvalues[4387]),0},
-{"set-brand-IATA-ATA","set-brand-IATA-ATA",NID_set_brand_IATA_ATA,4,
-	&(lvalues[4393]),0},
-{"set-brand-Diners","set-brand-Diners",NID_set_brand_Diners,4,
-	&(lvalues[4397]),0},
-{"set-brand-AmericanExpress","set-brand-AmericanExpress",
-	NID_set_brand_AmericanExpress,4,&(lvalues[4401]),0},
-{"set-brand-JCB","set-brand-JCB",NID_set_brand_JCB,4,&(lvalues[4405]),0},
-{"set-brand-Visa","set-brand-Visa",NID_set_brand_Visa,4,
-	&(lvalues[4409]),0},
-{"set-brand-MasterCard","set-brand-MasterCard",
-	NID_set_brand_MasterCard,4,&(lvalues[4413]),0},
-{"set-brand-Novus","set-brand-Novus",NID_set_brand_Novus,5,
-	&(lvalues[4417]),0},
-{"DES-CDMF","des-cdmf",NID_des_cdmf,8,&(lvalues[4422]),0},
-{"rsaOAEPEncryptionSET","rsaOAEPEncryptionSET",
-	NID_rsaOAEPEncryptionSET,9,&(lvalues[4430]),0},
-{"ITU-T","itu-t",NID_itu_t,1,&(lvalues[4439]),0},
-{"JOINT-ISO-ITU-T","joint-iso-itu-t",NID_joint_iso_itu_t,1,
-	&(lvalues[4440]),0},
-{"international-organizations","International Organizations",
-	NID_international_organizations,1,&(lvalues[4441]),0},
-{"msSmartcardLogin","Microsoft Smartcardlogin",NID_ms_smartcard_login,
-	10,&(lvalues[4442]),0},
-{"msUPN","Microsoft Universal Principal Name",NID_ms_upn,10,
-	&(lvalues[4452]),0},
-{"AES-128-CFB1","aes-128-cfb1",NID_aes_128_cfb1,0,NULL,0},
-{"AES-192-CFB1","aes-192-cfb1",NID_aes_192_cfb1,0,NULL,0},
-{"AES-256-CFB1","aes-256-cfb1",NID_aes_256_cfb1,0,NULL,0},
-{"AES-128-CFB8","aes-128-cfb8",NID_aes_128_cfb8,0,NULL,0},
-{"AES-192-CFB8","aes-192-cfb8",NID_aes_192_cfb8,0,NULL,0},
-{"AES-256-CFB8","aes-256-cfb8",NID_aes_256_cfb8,0,NULL,0},
-{"DES-CFB1","des-cfb1",NID_des_cfb1,0,NULL,0},
-{"DES-CFB8","des-cfb8",NID_des_cfb8,0,NULL,0},
-{"DES-EDE3-CFB1","des-ede3-cfb1",NID_des_ede3_cfb1,0,NULL,0},
-{"DES-EDE3-CFB8","des-ede3-cfb8",NID_des_ede3_cfb8,0,NULL,0},
-{"street","streetAddress",NID_streetAddress,3,&(lvalues[4462]),0},
-{"postalCode","postalCode",NID_postalCode,3,&(lvalues[4465]),0},
-{"id-ppl","id-ppl",NID_id_ppl,7,&(lvalues[4468]),0},
-{"proxyCertInfo","Proxy Certificate Information",NID_proxyCertInfo,8,
-	&(lvalues[4475]),0},
-{"id-ppl-anyLanguage","Any language",NID_id_ppl_anyLanguage,8,
-	&(lvalues[4483]),0},
-{"id-ppl-inheritAll","Inherit all",NID_id_ppl_inheritAll,8,
-	&(lvalues[4491]),0},
-{"nameConstraints","X509v3 Name Constraints",NID_name_constraints,3,
-	&(lvalues[4499]),0},
-{"id-ppl-independent","Independent",NID_Independent,8,&(lvalues[4502]),0},
-{"RSA-SHA256","sha256WithRSAEncryption",NID_sha256WithRSAEncryption,9,
-	&(lvalues[4510]),0},
-{"RSA-SHA384","sha384WithRSAEncryption",NID_sha384WithRSAEncryption,9,
-	&(lvalues[4519]),0},
-{"RSA-SHA512","sha512WithRSAEncryption",NID_sha512WithRSAEncryption,9,
-	&(lvalues[4528]),0},
-{"RSA-SHA224","sha224WithRSAEncryption",NID_sha224WithRSAEncryption,9,
-	&(lvalues[4537]),0},
-{"SHA256","sha256",NID_sha256,9,&(lvalues[4546]),0},
-{"SHA384","sha384",NID_sha384,9,&(lvalues[4555]),0},
-{"SHA512","sha512",NID_sha512,9,&(lvalues[4564]),0},
-{"SHA224","sha224",NID_sha224,9,&(lvalues[4573]),0},
-{"identified-organization","identified-organization",
-	NID_identified_organization,1,&(lvalues[4582]),0},
-{"certicom-arc","certicom-arc",NID_certicom_arc,3,&(lvalues[4583]),0},
-{"wap","wap",NID_wap,2,&(lvalues[4586]),0},
-{"wap-wsg","wap-wsg",NID_wap_wsg,3,&(lvalues[4588]),0},
-{"id-characteristic-two-basis","id-characteristic-two-basis",
-	NID_X9_62_id_characteristic_two_basis,8,&(lvalues[4591]),0},
-{"onBasis","onBasis",NID_X9_62_onBasis,9,&(lvalues[4599]),0},
-{"tpBasis","tpBasis",NID_X9_62_tpBasis,9,&(lvalues[4608]),0},
-{"ppBasis","ppBasis",NID_X9_62_ppBasis,9,&(lvalues[4617]),0},
-{"c2pnb163v1","c2pnb163v1",NID_X9_62_c2pnb163v1,8,&(lvalues[4626]),0},
-{"c2pnb163v2","c2pnb163v2",NID_X9_62_c2pnb163v2,8,&(lvalues[4634]),0},
-{"c2pnb163v3","c2pnb163v3",NID_X9_62_c2pnb163v3,8,&(lvalues[4642]),0},
-{"c2pnb176v1","c2pnb176v1",NID_X9_62_c2pnb176v1,8,&(lvalues[4650]),0},
-{"c2tnb191v1","c2tnb191v1",NID_X9_62_c2tnb191v1,8,&(lvalues[4658]),0},
-{"c2tnb191v2","c2tnb191v2",NID_X9_62_c2tnb191v2,8,&(lvalues[4666]),0},
-{"c2tnb191v3","c2tnb191v3",NID_X9_62_c2tnb191v3,8,&(lvalues[4674]),0},
-{"c2onb191v4","c2onb191v4",NID_X9_62_c2onb191v4,8,&(lvalues[4682]),0},
-{"c2onb191v5","c2onb191v5",NID_X9_62_c2onb191v5,8,&(lvalues[4690]),0},
-{"c2pnb208w1","c2pnb208w1",NID_X9_62_c2pnb208w1,8,&(lvalues[4698]),0},
-{"c2tnb239v1","c2tnb239v1",NID_X9_62_c2tnb239v1,8,&(lvalues[4706]),0},
-{"c2tnb239v2","c2tnb239v2",NID_X9_62_c2tnb239v2,8,&(lvalues[4714]),0},
-{"c2tnb239v3","c2tnb239v3",NID_X9_62_c2tnb239v3,8,&(lvalues[4722]),0},
-{"c2onb239v4","c2onb239v4",NID_X9_62_c2onb239v4,8,&(lvalues[4730]),0},
-{"c2onb239v5","c2onb239v5",NID_X9_62_c2onb239v5,8,&(lvalues[4738]),0},
-{"c2pnb272w1","c2pnb272w1",NID_X9_62_c2pnb272w1,8,&(lvalues[4746]),0},
-{"c2pnb304w1","c2pnb304w1",NID_X9_62_c2pnb304w1,8,&(lvalues[4754]),0},
-{"c2tnb359v1","c2tnb359v1",NID_X9_62_c2tnb359v1,8,&(lvalues[4762]),0},
-{"c2pnb368w1","c2pnb368w1",NID_X9_62_c2pnb368w1,8,&(lvalues[4770]),0},
-{"c2tnb431r1","c2tnb431r1",NID_X9_62_c2tnb431r1,8,&(lvalues[4778]),0},
-{"secp112r1","secp112r1",NID_secp112r1,5,&(lvalues[4786]),0},
-{"secp112r2","secp112r2",NID_secp112r2,5,&(lvalues[4791]),0},
-{"secp128r1","secp128r1",NID_secp128r1,5,&(lvalues[4796]),0},
-{"secp128r2","secp128r2",NID_secp128r2,5,&(lvalues[4801]),0},
-{"secp160k1","secp160k1",NID_secp160k1,5,&(lvalues[4806]),0},
-{"secp160r1","secp160r1",NID_secp160r1,5,&(lvalues[4811]),0},
-{"secp160r2","secp160r2",NID_secp160r2,5,&(lvalues[4816]),0},
-{"secp192k1","secp192k1",NID_secp192k1,5,&(lvalues[4821]),0},
-{"secp224k1","secp224k1",NID_secp224k1,5,&(lvalues[4826]),0},
-{"secp224r1","secp224r1",NID_secp224r1,5,&(lvalues[4831]),0},
-{"secp256k1","secp256k1",NID_secp256k1,5,&(lvalues[4836]),0},
-{"secp384r1","secp384r1",NID_secp384r1,5,&(lvalues[4841]),0},
-{"secp521r1","secp521r1",NID_secp521r1,5,&(lvalues[4846]),0},
-{"sect113r1","sect113r1",NID_sect113r1,5,&(lvalues[4851]),0},
-{"sect113r2","sect113r2",NID_sect113r2,5,&(lvalues[4856]),0},
-{"sect131r1","sect131r1",NID_sect131r1,5,&(lvalues[4861]),0},
-{"sect131r2","sect131r2",NID_sect131r2,5,&(lvalues[4866]),0},
-{"sect163k1","sect163k1",NID_sect163k1,5,&(lvalues[4871]),0},
-{"sect163r1","sect163r1",NID_sect163r1,5,&(lvalues[4876]),0},
-{"sect163r2","sect163r2",NID_sect163r2,5,&(lvalues[4881]),0},
-{"sect193r1","sect193r1",NID_sect193r1,5,&(lvalues[4886]),0},
-{"sect193r2","sect193r2",NID_sect193r2,5,&(lvalues[4891]),0},
-{"sect233k1","sect233k1",NID_sect233k1,5,&(lvalues[4896]),0},
-{"sect233r1","sect233r1",NID_sect233r1,5,&(lvalues[4901]),0},
-{"sect239k1","sect239k1",NID_sect239k1,5,&(lvalues[4906]),0},
-{"sect283k1","sect283k1",NID_sect283k1,5,&(lvalues[4911]),0},
-{"sect283r1","sect283r1",NID_sect283r1,5,&(lvalues[4916]),0},
-{"sect409k1","sect409k1",NID_sect409k1,5,&(lvalues[4921]),0},
-{"sect409r1","sect409r1",NID_sect409r1,5,&(lvalues[4926]),0},
-{"sect571k1","sect571k1",NID_sect571k1,5,&(lvalues[4931]),0},
-{"sect571r1","sect571r1",NID_sect571r1,5,&(lvalues[4936]),0},
-{"wap-wsg-idm-ecid-wtls1","wap-wsg-idm-ecid-wtls1",
-	NID_wap_wsg_idm_ecid_wtls1,5,&(lvalues[4941]),0},
-{"wap-wsg-idm-ecid-wtls3","wap-wsg-idm-ecid-wtls3",
-	NID_wap_wsg_idm_ecid_wtls3,5,&(lvalues[4946]),0},
-{"wap-wsg-idm-ecid-wtls4","wap-wsg-idm-ecid-wtls4",
-	NID_wap_wsg_idm_ecid_wtls4,5,&(lvalues[4951]),0},
-{"wap-wsg-idm-ecid-wtls5","wap-wsg-idm-ecid-wtls5",
-	NID_wap_wsg_idm_ecid_wtls5,5,&(lvalues[4956]),0},
-{"wap-wsg-idm-ecid-wtls6","wap-wsg-idm-ecid-wtls6",
-	NID_wap_wsg_idm_ecid_wtls6,5,&(lvalues[4961]),0},
-{"wap-wsg-idm-ecid-wtls7","wap-wsg-idm-ecid-wtls7",
-	NID_wap_wsg_idm_ecid_wtls7,5,&(lvalues[4966]),0},
-{"wap-wsg-idm-ecid-wtls8","wap-wsg-idm-ecid-wtls8",
-	NID_wap_wsg_idm_ecid_wtls8,5,&(lvalues[4971]),0},
-{"wap-wsg-idm-ecid-wtls9","wap-wsg-idm-ecid-wtls9",
-	NID_wap_wsg_idm_ecid_wtls9,5,&(lvalues[4976]),0},
-{"wap-wsg-idm-ecid-wtls10","wap-wsg-idm-ecid-wtls10",
-	NID_wap_wsg_idm_ecid_wtls10,5,&(lvalues[4981]),0},
-{"wap-wsg-idm-ecid-wtls11","wap-wsg-idm-ecid-wtls11",
-	NID_wap_wsg_idm_ecid_wtls11,5,&(lvalues[4986]),0},
-{"wap-wsg-idm-ecid-wtls12","wap-wsg-idm-ecid-wtls12",
-	NID_wap_wsg_idm_ecid_wtls12,5,&(lvalues[4991]),0},
-{"anyPolicy","X509v3 Any Policy",NID_any_policy,4,&(lvalues[4996]),0},
-{"policyMappings","X509v3 Policy Mappings",NID_policy_mappings,3,
-	&(lvalues[5000]),0},
-{"inhibitAnyPolicy","X509v3 Inhibit Any Policy",
-	NID_inhibit_any_policy,3,&(lvalues[5003]),0},
-{"Oakley-EC2N-3","ipsec3",NID_ipsec3,0,NULL,0},
-{"Oakley-EC2N-4","ipsec4",NID_ipsec4,0,NULL,0},
-{"CAMELLIA-128-CBC","camellia-128-cbc",NID_camellia_128_cbc,11,
-	&(lvalues[5006]),0},
-{"CAMELLIA-192-CBC","camellia-192-cbc",NID_camellia_192_cbc,11,
-	&(lvalues[5017]),0},
-{"CAMELLIA-256-CBC","camellia-256-cbc",NID_camellia_256_cbc,11,
-	&(lvalues[5028]),0},
-{"CAMELLIA-128-ECB","camellia-128-ecb",NID_camellia_128_ecb,8,
-	&(lvalues[5039]),0},
-{"CAMELLIA-192-ECB","camellia-192-ecb",NID_camellia_192_ecb,8,
-	&(lvalues[5047]),0},
-{"CAMELLIA-256-ECB","camellia-256-ecb",NID_camellia_256_ecb,8,
-	&(lvalues[5055]),0},
-{"CAMELLIA-128-CFB","camellia-128-cfb",NID_camellia_128_cfb128,8,
-	&(lvalues[5063]),0},
-{"CAMELLIA-192-CFB","camellia-192-cfb",NID_camellia_192_cfb128,8,
-	&(lvalues[5071]),0},
-{"CAMELLIA-256-CFB","camellia-256-cfb",NID_camellia_256_cfb128,8,
-	&(lvalues[5079]),0},
-{"CAMELLIA-128-CFB1","camellia-128-cfb1",NID_camellia_128_cfb1,0,NULL,0},
-{"CAMELLIA-192-CFB1","camellia-192-cfb1",NID_camellia_192_cfb1,0,NULL,0},
-{"CAMELLIA-256-CFB1","camellia-256-cfb1",NID_camellia_256_cfb1,0,NULL,0},
-{"CAMELLIA-128-CFB8","camellia-128-cfb8",NID_camellia_128_cfb8,0,NULL,0},
-{"CAMELLIA-192-CFB8","camellia-192-cfb8",NID_camellia_192_cfb8,0,NULL,0},
-{"CAMELLIA-256-CFB8","camellia-256-cfb8",NID_camellia_256_cfb8,0,NULL,0},
-{"CAMELLIA-128-OFB","camellia-128-ofb",NID_camellia_128_ofb128,8,
-	&(lvalues[5087]),0},
-{"CAMELLIA-192-OFB","camellia-192-ofb",NID_camellia_192_ofb128,8,
-	&(lvalues[5095]),0},
-{"CAMELLIA-256-OFB","camellia-256-ofb",NID_camellia_256_ofb128,8,
-	&(lvalues[5103]),0},
-{"subjectDirectoryAttributes","X509v3 Subject Directory Attributes",
-	NID_subject_directory_attributes,3,&(lvalues[5111]),0},
-{"issuingDistributionPoint","X509v3 Issuing Distrubution Point",
-	NID_issuing_distribution_point,3,&(lvalues[5114]),0},
-{"certificateIssuer","X509v3 Certificate Issuer",
-	NID_certificate_issuer,3,&(lvalues[5117]),0},
-{NULL,NULL,NID_undef,0,NULL,0},
-{"KISA","kisa",NID_kisa,6,&(lvalues[5120]),0},
-{NULL,NULL,NID_undef,0,NULL,0},
-{NULL,NULL,NID_undef,0,NULL,0},
-{"SEED-ECB","seed-ecb",NID_seed_ecb,8,&(lvalues[5126]),0},
-{"SEED-CBC","seed-cbc",NID_seed_cbc,8,&(lvalues[5134]),0},
-{"SEED-OFB","seed-ofb",NID_seed_ofb128,8,&(lvalues[5142]),0},
-{"SEED-CFB","seed-cfb",NID_seed_cfb128,8,&(lvalues[5150]),0},
-{"HMAC-MD5","hmac-md5",NID_hmac_md5,8,&(lvalues[5158]),0},
-{"HMAC-SHA1","hmac-sha1",NID_hmac_sha1,8,&(lvalues[5166]),0},
-{"id-PasswordBasedMAC","password based MAC",NID_id_PasswordBasedMAC,9,
-	&(lvalues[5174]),0},
-{"id-DHBasedMac","Diffie-Hellman based MAC",NID_id_DHBasedMac,9,
-	&(lvalues[5183]),0},
-{"id-it-suppLangTags","id-it-suppLangTags",NID_id_it_suppLangTags,8,
-	&(lvalues[5192]),0},
-{"caRepository","CA Repository",NID_caRepository,8,&(lvalues[5200]),0},
-{"id-smime-ct-compressedData","id-smime-ct-compressedData",
-	NID_id_smime_ct_compressedData,11,&(lvalues[5208]),0},
-{"id-ct-asciiTextWithCRLF","id-ct-asciiTextWithCRLF",
-	NID_id_ct_asciiTextWithCRLF,11,&(lvalues[5219]),0},
-{"id-aes128-wrap","id-aes128-wrap",NID_id_aes128_wrap,9,
-	&(lvalues[5230]),0},
-{"id-aes192-wrap","id-aes192-wrap",NID_id_aes192_wrap,9,
-	&(lvalues[5239]),0},
-{"id-aes256-wrap","id-aes256-wrap",NID_id_aes256_wrap,9,
-	&(lvalues[5248]),0},
-{"ecdsa-with-Recommended","ecdsa-with-Recommended",
-	NID_ecdsa_with_Recommended,7,&(lvalues[5257]),0},
-{"ecdsa-with-Specified","ecdsa-with-Specified",
-	NID_ecdsa_with_Specified,7,&(lvalues[5264]),0},
-{"ecdsa-with-SHA224","ecdsa-with-SHA224",NID_ecdsa_with_SHA224,8,
-	&(lvalues[5271]),0},
-{"ecdsa-with-SHA256","ecdsa-with-SHA256",NID_ecdsa_with_SHA256,8,
-	&(lvalues[5279]),0},
-{"ecdsa-with-SHA384","ecdsa-with-SHA384",NID_ecdsa_with_SHA384,8,
-	&(lvalues[5287]),0},
-{"ecdsa-with-SHA512","ecdsa-with-SHA512",NID_ecdsa_with_SHA512,8,
-	&(lvalues[5295]),0},
-{"hmacWithMD5","hmacWithMD5",NID_hmacWithMD5,8,&(lvalues[5303]),0},
-{"hmacWithSHA224","hmacWithSHA224",NID_hmacWithSHA224,8,
-	&(lvalues[5311]),0},
-{"hmacWithSHA256","hmacWithSHA256",NID_hmacWithSHA256,8,
-	&(lvalues[5319]),0},
-{"hmacWithSHA384","hmacWithSHA384",NID_hmacWithSHA384,8,
-	&(lvalues[5327]),0},
-{"hmacWithSHA512","hmacWithSHA512",NID_hmacWithSHA512,8,
-	&(lvalues[5335]),0},
-{"dsa_with_SHA224","dsa_with_SHA224",NID_dsa_with_SHA224,9,
-	&(lvalues[5343]),0},
-{"dsa_with_SHA256","dsa_with_SHA256",NID_dsa_with_SHA256,9,
-	&(lvalues[5352]),0},
-{"whirlpool","whirlpool",NID_whirlpool,6,&(lvalues[5361]),0},
-{"cryptopro","cryptopro",NID_cryptopro,5,&(lvalues[5367]),0},
-{"cryptocom","cryptocom",NID_cryptocom,5,&(lvalues[5372]),0},
-{"id-GostR3411-94-with-GostR3410-2001",
-	"GOST R 34.11-94 with GOST R 34.10-2001",
-	NID_id_GostR3411_94_with_GostR3410_2001,6,&(lvalues[5377]),0},
-{"id-GostR3411-94-with-GostR3410-94",
-	"GOST R 34.11-94 with GOST R 34.10-94",
-	NID_id_GostR3411_94_with_GostR3410_94,6,&(lvalues[5383]),0},
-{"md_gost94","GOST R 34.11-94",NID_id_GostR3411_94,6,&(lvalues[5389]),0},
-{"id-HMACGostR3411-94","HMAC GOST 34.11-94",NID_id_HMACGostR3411_94,6,
-	&(lvalues[5395]),0},
-{"gost2001","GOST R 34.10-2001",NID_id_GostR3410_2001,6,
-	&(lvalues[5401]),0},
-{"gost94","GOST R 34.10-94",NID_id_GostR3410_94,6,&(lvalues[5407]),0},
-{"gost89","GOST 28147-89",NID_id_Gost28147_89,6,&(lvalues[5413]),0},
-{"gost89-cnt","gost89-cnt",NID_gost89_cnt,0,NULL,0},
-{"gost-mac","GOST 28147-89 MAC",NID_id_Gost28147_89_MAC,6,
-	&(lvalues[5419]),0},
-{"prf-gostr3411-94","GOST R 34.11-94 PRF",NID_id_GostR3411_94_prf,6,
-	&(lvalues[5425]),0},
-{"id-GostR3410-2001DH","GOST R 34.10-2001 DH",NID_id_GostR3410_2001DH,
-	6,&(lvalues[5431]),0},
-{"id-GostR3410-94DH","GOST R 34.10-94 DH",NID_id_GostR3410_94DH,6,
-	&(lvalues[5437]),0},
-{"id-Gost28147-89-CryptoPro-KeyMeshing",
-	"id-Gost28147-89-CryptoPro-KeyMeshing",
-	NID_id_Gost28147_89_CryptoPro_KeyMeshing,7,&(lvalues[5443]),0},
-{"id-Gost28147-89-None-KeyMeshing","id-Gost28147-89-None-KeyMeshing",
-	NID_id_Gost28147_89_None_KeyMeshing,7,&(lvalues[5450]),0},
-{"id-GostR3411-94-TestParamSet","id-GostR3411-94-TestParamSet",
-	NID_id_GostR3411_94_TestParamSet,7,&(lvalues[5457]),0},
-{"id-GostR3411-94-CryptoProParamSet",
-	"id-GostR3411-94-CryptoProParamSet",
-	NID_id_GostR3411_94_CryptoProParamSet,7,&(lvalues[5464]),0},
-{"id-Gost28147-89-TestParamSet","id-Gost28147-89-TestParamSet",
-	NID_id_Gost28147_89_TestParamSet,7,&(lvalues[5471]),0},
-{"id-Gost28147-89-CryptoPro-A-ParamSet",
-	"id-Gost28147-89-CryptoPro-A-ParamSet",
-	NID_id_Gost28147_89_CryptoPro_A_ParamSet,7,&(lvalues[5478]),0},
-{"id-Gost28147-89-CryptoPro-B-ParamSet",
-	"id-Gost28147-89-CryptoPro-B-ParamSet",
-	NID_id_Gost28147_89_CryptoPro_B_ParamSet,7,&(lvalues[5485]),0},
-{"id-Gost28147-89-CryptoPro-C-ParamSet",
-	"id-Gost28147-89-CryptoPro-C-ParamSet",
-	NID_id_Gost28147_89_CryptoPro_C_ParamSet,7,&(lvalues[5492]),0},
-{"id-Gost28147-89-CryptoPro-D-ParamSet",
-	"id-Gost28147-89-CryptoPro-D-ParamSet",
-	NID_id_Gost28147_89_CryptoPro_D_ParamSet,7,&(lvalues[5499]),0},
-{"id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet",
+#ifdef NEED_LVALUES_OVERRIDE
+// Some compilers (e.g. ADS) expands macros differently from most other compilers, so this have to be declared down here
+#define lvalues OPENSSL_GLOBAL_ARRAY_NAME(lvalues)
+#endif
+
+OPENSSL_PREFIX_CONST_ARRAY(static, ASN1_OBJECT, nid_objs, libopeay)
+CONST_ENTRY_NID("UNDEF","undefined",NID_undef,1,&(lvalues[0]),0)
+CONST_ENTRY_NID("rsadsi","RSA Data Security, Inc.",NID_rsadsi,6,&(lvalues[1]),0)
+CONST_ENTRY_NID("pkcs","RSA Data Security, Inc. PKCS",NID_pkcs,7,&(lvalues[7]),0)
+CONST_ENTRY_NID("MD2","md2",NID_md2,8,&(lvalues[14]),0)
+CONST_ENTRY_NID("MD5","md5",NID_md5,8,&(lvalues[22]),0)
+CONST_ENTRY_NID("RC4","rc4",NID_rc4,8,&(lvalues[30]),0)
+CONST_ENTRY_NID("rsaEncryption","rsaEncryption",NID_rsaEncryption,9,&(lvalues[38]),0)
+CONST_ENTRY_NID("RSA-MD2","md2WithRSAEncryption",NID_md2WithRSAEncryption,9,
+	&(lvalues[47]),0)
+CONST_ENTRY_NID("RSA-MD5","md5WithRSAEncryption",NID_md5WithRSAEncryption,9,
+	&(lvalues[56]),0)
+CONST_ENTRY_NID("PBE-MD2-DES","pbeWithMD2AndDES-CBC",NID_pbeWithMD2AndDES_CBC,9,
+	&(lvalues[65]),0)
+CONST_ENTRY_NID("PBE-MD5-DES","pbeWithMD5AndDES-CBC",NID_pbeWithMD5AndDES_CBC,9,
+	&(lvalues[74]),0)
+CONST_ENTRY_NID("X500","directory services (X.500)",NID_X500,1,&(lvalues[83]),0)
+CONST_ENTRY_NID("X509","X509",NID_X509,2,&(lvalues[84]),0)
+CONST_ENTRY_NID("CN","commonName",NID_commonName,3,&(lvalues[86]),0)
+CONST_ENTRY_NID("C","countryName",NID_countryName,3,&(lvalues[89]),0)
+CONST_ENTRY_NID("L","localityName",NID_localityName,3,&(lvalues[92]),0)
+CONST_ENTRY_NID("ST","stateOrProvinceName",NID_stateOrProvinceName,3,&(lvalues[95]),0)
+CONST_ENTRY_NID("O","organizationName",NID_organizationName,3,&(lvalues[98]),0)
+CONST_ENTRY_NID("OU","organizationalUnitName",NID_organizationalUnitName,3,
+	&(lvalues[101]),0)
+CONST_ENTRY_NID("RSA","rsa",NID_rsa,4,&(lvalues[104]),0)
+CONST_ENTRY_NID("pkcs7","pkcs7",NID_pkcs7,8,&(lvalues[108]),0)
+CONST_ENTRY_NID("pkcs7-data","pkcs7-data",NID_pkcs7_data,9,&(lvalues[116]),0)
+CONST_ENTRY_NID("pkcs7-signedData","pkcs7-signedData",NID_pkcs7_signed,9,
+	&(lvalues[125]),0)
+CONST_ENTRY_NID("pkcs7-envelopedData","pkcs7-envelopedData",NID_pkcs7_enveloped,9,
+	&(lvalues[134]),0)
+CONST_ENTRY_NID("pkcs7-signedAndEnvelopedData","pkcs7-signedAndEnvelopedData",
+	NID_pkcs7_signedAndEnveloped,9,&(lvalues[143]),0)
+CONST_ENTRY_NID("pkcs7-digestData","pkcs7-digestData",NID_pkcs7_digest,9,
+	&(lvalues[152]),0)
+CONST_ENTRY_NID("pkcs7-encryptedData","pkcs7-encryptedData",NID_pkcs7_encrypted,9,
+	&(lvalues[161]),0)
+CONST_ENTRY_NID("pkcs3","pkcs3",NID_pkcs3,8,&(lvalues[170]),0)
+CONST_ENTRY_NID("dhKeyAgreement","dhKeyAgreement",NID_dhKeyAgreement,9,
+	&(lvalues[178]),0)
+CONST_ENTRY_NID("DES-ECB","des-ecb",NID_des_ecb,5,&(lvalues[187]),0)
+CONST_ENTRY_NID("DES-CFB","des-cfb",NID_des_cfb64,5,&(lvalues[192]),0)
+CONST_ENTRY_NID("DES-CBC","des-cbc",NID_des_cbc,5,&(lvalues[197]),0)
+CONST_ENTRY_NID("DES-EDE","des-ede",NID_des_ede_ecb,5,&(lvalues[202]),0)
+CONST_ENTRY_NID("DES-EDE3","des-ede3",NID_des_ede3_ecb,0,NULL,0)
+CONST_ENTRY_NID("IDEA-CBC","idea-cbc",NID_idea_cbc,11,&(lvalues[207]),0)
+CONST_ENTRY_NID("IDEA-CFB","idea-cfb",NID_idea_cfb64,0,NULL,0)
+CONST_ENTRY_NID("IDEA-ECB","idea-ecb",NID_idea_ecb,0,NULL,0)
+CONST_ENTRY_NID("RC2-CBC","rc2-cbc",NID_rc2_cbc,8,&(lvalues[218]),0)
+CONST_ENTRY_NID("RC2-ECB","rc2-ecb",NID_rc2_ecb,0,NULL,0)
+CONST_ENTRY_NID("RC2-CFB","rc2-cfb",NID_rc2_cfb64,0,NULL,0)
+CONST_ENTRY_NID("RC2-OFB","rc2-ofb",NID_rc2_ofb64,0,NULL,0)
+CONST_ENTRY_NID("SHA","sha",NID_sha,5,&(lvalues[226]),0)
+CONST_ENTRY_NID("RSA-SHA","shaWithRSAEncryption",NID_shaWithRSAEncryption,5,
+	&(lvalues[231]),0)
+CONST_ENTRY_NID("DES-EDE-CBC","des-ede-cbc",NID_des_ede_cbc,0,NULL,0)
+CONST_ENTRY_NID("DES-EDE3-CBC","des-ede3-cbc",NID_des_ede3_cbc,8,&(lvalues[236]),0)
+CONST_ENTRY_NID("DES-OFB","des-ofb",NID_des_ofb64,5,&(lvalues[244]),0)
+CONST_ENTRY_NID("IDEA-OFB","idea-ofb",NID_idea_ofb64,0,NULL,0)
+CONST_ENTRY_NID("pkcs9","pkcs9",NID_pkcs9,8,&(lvalues[249]),0)
+CONST_ENTRY_NID("emailAddress","emailAddress",NID_pkcs9_emailAddress,9,
+	&(lvalues[257]),0)
+CONST_ENTRY_NID("unstructuredName","unstructuredName",NID_pkcs9_unstructuredName,9,
+	&(lvalues[266]),0)
+CONST_ENTRY_NID("contentType","contentType",NID_pkcs9_contentType,9,&(lvalues[275]),0)
+CONST_ENTRY_NID("messageDigest","messageDigest",NID_pkcs9_messageDigest,9,
+	&(lvalues[284]),0)
+CONST_ENTRY_NID("signingTime","signingTime",NID_pkcs9_signingTime,9,&(lvalues[293]),0)
+CONST_ENTRY_NID("countersignature","countersignature",NID_pkcs9_countersignature,9,
+	&(lvalues[302]),0)
+CONST_ENTRY_NID("challengePassword","challengePassword",NID_pkcs9_challengePassword,
+	9,&(lvalues[311]),0)
+CONST_ENTRY_NID("unstructuredAddress","unstructuredAddress",
+	NID_pkcs9_unstructuredAddress,9,&(lvalues[320]),0)
+CONST_ENTRY_NID("extendedCertificateAttributes","extendedCertificateAttributes",
+	NID_pkcs9_extCertAttributes,9,&(lvalues[329]),0)
+CONST_ENTRY_NID("Netscape","Netscape Communications Corp.",NID_netscape,7,
+	&(lvalues[338]),0)
+CONST_ENTRY_NID("nsCertExt","Netscape Certificate Extension",
+	NID_netscape_cert_extension,8,&(lvalues[345]),0)
+CONST_ENTRY_NID("nsDataType","Netscape Data Type",NID_netscape_data_type,8,
+	&(lvalues[353]),0)
+CONST_ENTRY_NID("DES-EDE-CFB","des-ede-cfb",NID_des_ede_cfb64,0,NULL,0)
+CONST_ENTRY_NID("DES-EDE3-CFB","des-ede3-cfb",NID_des_ede3_cfb64,0,NULL,0)
+CONST_ENTRY_NID("DES-EDE-OFB","des-ede-ofb",NID_des_ede_ofb64,0,NULL,0)
+CONST_ENTRY_NID("DES-EDE3-OFB","des-ede3-ofb",NID_des_ede3_ofb64,0,NULL,0)
+CONST_ENTRY_NID("SHA1","sha1",NID_sha1,5,&(lvalues[361]),0)
+CONST_ENTRY_NID("RSA-SHA1","sha1WithRSAEncryption",NID_sha1WithRSAEncryption,9,
+	&(lvalues[366]),0)
+CONST_ENTRY_NID("DSA-SHA","dsaWithSHA",NID_dsaWithSHA,5,&(lvalues[375]),0)
+CONST_ENTRY_NID("DSA-old","dsaEncryption-old",NID_dsa_2,5,&(lvalues[380]),0)
+CONST_ENTRY_NID("PBE-SHA1-RC2-64","pbeWithSHA1AndRC2-CBC",NID_pbeWithSHA1AndRC2_CBC,
+	9,&(lvalues[385]),0)
+CONST_ENTRY_NID("PBKDF2","PBKDF2",NID_id_pbkdf2,9,&(lvalues[394]),0)
+CONST_ENTRY_NID("DSA-SHA1-old","dsaWithSHA1-old",NID_dsaWithSHA1_2,5,&(lvalues[403]),0)
+CONST_ENTRY_NID("nsCertType","Netscape Cert Type",NID_netscape_cert_type,9,
+	&(lvalues[408]),0)
+CONST_ENTRY_NID("nsBaseUrl","Netscape Base Url",NID_netscape_base_url,9,
+	&(lvalues[417]),0)
+CONST_ENTRY_NID("nsRevocationUrl","Netscape Revocation Url",
+	NID_netscape_revocation_url,9,&(lvalues[426]),0)
+CONST_ENTRY_NID("nsCaRevocationUrl","Netscape CA Revocation Url",
+	NID_netscape_ca_revocation_url,9,&(lvalues[435]),0)
+CONST_ENTRY_NID("nsRenewalUrl","Netscape Renewal Url",NID_netscape_renewal_url,9,
+	&(lvalues[444]),0)
+CONST_ENTRY_NID("nsCaPolicyUrl","Netscape CA Policy Url",NID_netscape_ca_policy_url,
+	9,&(lvalues[453]),0)
+CONST_ENTRY_NID("nsSslServerName","Netscape SSL Server Name",
+	NID_netscape_ssl_server_name,9,&(lvalues[462]),0)
+CONST_ENTRY_NID("nsComment","Netscape Comment",NID_netscape_comment,9,&(lvalues[471]),0)
+CONST_ENTRY_NID("nsCertSequence","Netscape Certificate Sequence",
+	NID_netscape_cert_sequence,9,&(lvalues[480]),0)
+CONST_ENTRY_NID("DESX-CBC","desx-cbc",NID_desx_cbc,0,NULL,0)
+CONST_ENTRY_NID("id-ce","id-ce",NID_id_ce,2,&(lvalues[489]),0)
+CONST_ENTRY_NID("subjectKeyIdentifier","X509v3 Subject Key Identifier",
+	NID_subject_key_identifier,3,&(lvalues[491]),0)
+CONST_ENTRY_NID("keyUsage","X509v3 Key Usage",NID_key_usage,3,&(lvalues[494]),0)
+CONST_ENTRY_NID("privateKeyUsagePeriod","X509v3 Private Key Usage Period",
+	NID_private_key_usage_period,3,&(lvalues[497]),0)
+CONST_ENTRY_NID("subjectAltName","X509v3 Subject Alternative Name",
+	NID_subject_alt_name,3,&(lvalues[500]),0)
+CONST_ENTRY_NID("issuerAltName","X509v3 Issuer Alternative Name",NID_issuer_alt_name,
+	3,&(lvalues[503]),0)
+CONST_ENTRY_NID("basicConstraints","X509v3 Basic Constraints",NID_basic_constraints,
+	3,&(lvalues[506]),0)
+CONST_ENTRY_NID("crlNumber","X509v3 CRL Number",NID_crl_number,3,&(lvalues[509]),0)
+CONST_ENTRY_NID("certificatePolicies","X509v3 Certificate Policies",
+	NID_certificate_policies,3,&(lvalues[512]),0)
+CONST_ENTRY_NID("authorityKeyIdentifier","X509v3 Authority Key Identifier",
+	NID_authority_key_identifier,3,&(lvalues[515]),0)
+CONST_ENTRY_NID("BF-CBC","bf-cbc",NID_bf_cbc,9,&(lvalues[518]),0)
+CONST_ENTRY_NID("BF-ECB","bf-ecb",NID_bf_ecb,0,NULL,0)
+CONST_ENTRY_NID("BF-CFB","bf-cfb",NID_bf_cfb64,0,NULL,0)
+CONST_ENTRY_NID("BF-OFB","bf-ofb",NID_bf_ofb64,0,NULL,0)
+CONST_ENTRY_NID("MDC2","mdc2",NID_mdc2,4,&(lvalues[527]),0)
+CONST_ENTRY_NID("RSA-MDC2","mdc2WithRSA",NID_mdc2WithRSA,4,&(lvalues[531]),0)
+CONST_ENTRY_NID("RC4-40","rc4-40",NID_rc4_40,0,NULL,0)
+CONST_ENTRY_NID("RC2-40-CBC","rc2-40-cbc",NID_rc2_40_cbc,0,NULL,0)
+CONST_ENTRY_NID("GN","givenName",NID_givenName,3,&(lvalues[535]),0)
+CONST_ENTRY_NID("SN","surname",NID_surname,3,&(lvalues[538]),0)
+CONST_ENTRY_NID("initials","initials",NID_initials,3,&(lvalues[541]),0)
+CONST_ENTRY_NID(NULL,NULL,NID_undef,0,NULL,0)
+CONST_ENTRY_NID("crlDistributionPoints","X509v3 CRL Distribution Points",
+	NID_crl_distribution_points,3,&(lvalues[544]),0)
+CONST_ENTRY_NID("RSA-NP-MD5","md5WithRSA",NID_md5WithRSA,5,&(lvalues[547]),0)
+CONST_ENTRY_NID("serialNumber","serialNumber",NID_serialNumber,3,&(lvalues[552]),0)
+CONST_ENTRY_NID("title","title",NID_title,3,&(lvalues[555]),0)
+CONST_ENTRY_NID("description","description",NID_description,3,&(lvalues[558]),0)
+CONST_ENTRY_NID("CAST5-CBC","cast5-cbc",NID_cast5_cbc,9,&(lvalues[561]),0)
+CONST_ENTRY_NID("CAST5-ECB","cast5-ecb",NID_cast5_ecb,0,NULL,0)
+CONST_ENTRY_NID("CAST5-CFB","cast5-cfb",NID_cast5_cfb64,0,NULL,0)
+CONST_ENTRY_NID("CAST5-OFB","cast5-ofb",NID_cast5_ofb64,0,NULL,0)
+CONST_ENTRY_NID("pbeWithMD5AndCast5CBC","pbeWithMD5AndCast5CBC",
+	NID_pbeWithMD5AndCast5_CBC,9,&(lvalues[570]),0)
+CONST_ENTRY_NID("DSA-SHA1","dsaWithSHA1",NID_dsaWithSHA1,7,&(lvalues[579]),0)
+CONST_ENTRY_NID("MD5-SHA1","md5-sha1",NID_md5_sha1,0,NULL,0)
+CONST_ENTRY_NID("RSA-SHA1-2","sha1WithRSA",NID_sha1WithRSA,5,&(lvalues[586]),0)
+CONST_ENTRY_NID("DSA","dsaEncryption",NID_dsa,7,&(lvalues[591]),0)
+CONST_ENTRY_NID("RIPEMD160","ripemd160",NID_ripemd160,5,&(lvalues[598]),0)
+CONST_ENTRY_NID(NULL,NULL,NID_undef,0,NULL,0)
+CONST_ENTRY_NID("RSA-RIPEMD160","ripemd160WithRSA",NID_ripemd160WithRSA,6,
+	&(lvalues[603]),0)
+CONST_ENTRY_NID("RC5-CBC","rc5-cbc",NID_rc5_cbc,8,&(lvalues[609]),0)
+CONST_ENTRY_NID("RC5-ECB","rc5-ecb",NID_rc5_ecb,0,NULL,0)
+CONST_ENTRY_NID("RC5-CFB","rc5-cfb",NID_rc5_cfb64,0,NULL,0)
+CONST_ENTRY_NID("RC5-OFB","rc5-ofb",NID_rc5_ofb64,0,NULL,0)
+CONST_ENTRY_NID("RLE","run length compression",NID_rle_compression,6,&(lvalues[617]),0)
+CONST_ENTRY_NID("ZLIB","zlib compression",NID_zlib_compression,11,&(lvalues[623]),0)
+CONST_ENTRY_NID("extendedKeyUsage","X509v3 Extended Key Usage",NID_ext_key_usage,3,
+	&(lvalues[634]),0)
+CONST_ENTRY_NID("PKIX","PKIX",NID_id_pkix,6,&(lvalues[637]),0)
+CONST_ENTRY_NID("id-kp","id-kp",NID_id_kp,7,&(lvalues[643]),0)
+CONST_ENTRY_NID("serverAuth","TLS Web Server Authentication",NID_server_auth,8,
+	&(lvalues[650]),0)
+CONST_ENTRY_NID("clientAuth","TLS Web Client Authentication",NID_client_auth,8,
+	&(lvalues[658]),0)
+CONST_ENTRY_NID("codeSigning","Code Signing",NID_code_sign,8,&(lvalues[666]),0)
+CONST_ENTRY_NID("emailProtection","E-mail Protection",NID_email_protect,8,
+	&(lvalues[674]),0)
+CONST_ENTRY_NID("timeStamping","Time Stamping",NID_time_stamp,8,&(lvalues[682]),0)
+CONST_ENTRY_NID("msCodeInd","Microsoft Individual Code Signing",NID_ms_code_ind,10,
+	&(lvalues[690]),0)
+CONST_ENTRY_NID("msCodeCom","Microsoft Commercial Code Signing",NID_ms_code_com,10,
+	&(lvalues[700]),0)
+CONST_ENTRY_NID("msCTLSign","Microsoft Trust List Signing",NID_ms_ctl_sign,10,
+	&(lvalues[710]),0)
+CONST_ENTRY_NID("msSGC","Microsoft Server Gated Crypto",NID_ms_sgc,10,&(lvalues[720]),0)
+CONST_ENTRY_NID("msEFS","Microsoft Encrypted File System",NID_ms_efs,10,
+	&(lvalues[730]),0)
+CONST_ENTRY_NID("nsSGC","Netscape Server Gated Crypto",NID_ns_sgc,9,&(lvalues[740]),0)
+CONST_ENTRY_NID("deltaCRL","X509v3 Delta CRL Indicator",NID_delta_crl,3,
+	&(lvalues[749]),0)
+CONST_ENTRY_NID("CRLReason","X509v3 CRL Reason Code",NID_crl_reason,3,&(lvalues[752]),0)
+CONST_ENTRY_NID("invalidityDate","Invalidity Date",NID_invalidity_date,3,
+	&(lvalues[755]),0)
+CONST_ENTRY_NID("SXNetID","Strong Extranet ID",NID_sxnet,5,&(lvalues[758]),0)
+CONST_ENTRY_NID("PBE-SHA1-RC4-128","pbeWithSHA1And128BitRC4",
+	NID_pbe_WithSHA1And128BitRC4,10,&(lvalues[763]),0)
+CONST_ENTRY_NID("PBE-SHA1-RC4-40","pbeWithSHA1And40BitRC4",
+	NID_pbe_WithSHA1And40BitRC4,10,&(lvalues[773]),0)
+CONST_ENTRY_NID("PBE-SHA1-3DES","pbeWithSHA1And3-KeyTripleDES-CBC",
+	NID_pbe_WithSHA1And3_Key_TripleDES_CBC,10,&(lvalues[783]),0)
+CONST_ENTRY_NID("PBE-SHA1-2DES","pbeWithSHA1And2-KeyTripleDES-CBC",
+	NID_pbe_WithSHA1And2_Key_TripleDES_CBC,10,&(lvalues[793]),0)
+CONST_ENTRY_NID("PBE-SHA1-RC2-128","pbeWithSHA1And128BitRC2-CBC",
+	NID_pbe_WithSHA1And128BitRC2_CBC,10,&(lvalues[803]),0)
+CONST_ENTRY_NID("PBE-SHA1-RC2-40","pbeWithSHA1And40BitRC2-CBC",
+	NID_pbe_WithSHA1And40BitRC2_CBC,10,&(lvalues[813]),0)
+CONST_ENTRY_NID("keyBag","keyBag",NID_keyBag,11,&(lvalues[823]),0)
+CONST_ENTRY_NID("pkcs8ShroudedKeyBag","pkcs8ShroudedKeyBag",NID_pkcs8ShroudedKeyBag,
+	11,&(lvalues[834]),0)
+CONST_ENTRY_NID("certBag","certBag",NID_certBag,11,&(lvalues[845]),0)
+CONST_ENTRY_NID("crlBag","crlBag",NID_crlBag,11,&(lvalues[856]),0)
+CONST_ENTRY_NID("secretBag","secretBag",NID_secretBag,11,&(lvalues[867]),0)
+CONST_ENTRY_NID("safeContentsBag","safeContentsBag",NID_safeContentsBag,11,
+	&(lvalues[878]),0)
+CONST_ENTRY_NID("friendlyName","friendlyName",NID_friendlyName,9,&(lvalues[889]),0)
+CONST_ENTRY_NID("localKeyID","localKeyID",NID_localKeyID,9,&(lvalues[898]),0)
+CONST_ENTRY_NID("x509Certificate","x509Certificate",NID_x509Certificate,10,
+	&(lvalues[907]),0)
+CONST_ENTRY_NID("sdsiCertificate","sdsiCertificate",NID_sdsiCertificate,10,
+	&(lvalues[917]),0)
+CONST_ENTRY_NID("x509Crl","x509Crl",NID_x509Crl,10,&(lvalues[927]),0)
+CONST_ENTRY_NID("PBES2","PBES2",NID_pbes2,9,&(lvalues[937]),0)
+CONST_ENTRY_NID("PBMAC1","PBMAC1",NID_pbmac1,9,&(lvalues[946]),0)
+CONST_ENTRY_NID("hmacWithSHA1","hmacWithSHA1",NID_hmacWithSHA1,8,&(lvalues[955]),0)
+CONST_ENTRY_NID("id-qt-cps","Policy Qualifier CPS",NID_id_qt_cps,8,&(lvalues[963]),0)
+CONST_ENTRY_NID("id-qt-unotice","Policy Qualifier User Notice",NID_id_qt_unotice,8,
+	&(lvalues[971]),0)
+CONST_ENTRY_NID("RC2-64-CBC","rc2-64-cbc",NID_rc2_64_cbc,0,NULL,0)
+CONST_ENTRY_NID("SMIME-CAPS","S/MIME Capabilities",NID_SMIMECapabilities,9,
+	&(lvalues[979]),0)
+CONST_ENTRY_NID("PBE-MD2-RC2-64","pbeWithMD2AndRC2-CBC",NID_pbeWithMD2AndRC2_CBC,9,
+	&(lvalues[988]),0)
+CONST_ENTRY_NID("PBE-MD5-RC2-64","pbeWithMD5AndRC2-CBC",NID_pbeWithMD5AndRC2_CBC,9,
+	&(lvalues[997]),0)
+CONST_ENTRY_NID("PBE-SHA1-DES","pbeWithSHA1AndDES-CBC",NID_pbeWithSHA1AndDES_CBC,9,
+	&(lvalues[1006]),0)
+CONST_ENTRY_NID("msExtReq","Microsoft Extension Request",NID_ms_ext_req,10,
+	&(lvalues[1015]),0)
+CONST_ENTRY_NID("extReq","Extension Request",NID_ext_req,9,&(lvalues[1025]),0)
+CONST_ENTRY_NID("name","name",NID_name,3,&(lvalues[1034]),0)
+CONST_ENTRY_NID("dnQualifier","dnQualifier",NID_dnQualifier,3,&(lvalues[1037]),0)
+CONST_ENTRY_NID("id-pe","id-pe",NID_id_pe,7,&(lvalues[1040]),0)
+CONST_ENTRY_NID("id-ad","id-ad",NID_id_ad,7,&(lvalues[1047]),0)
+CONST_ENTRY_NID("authorityInfoAccess","Authority Information Access",NID_info_access,
+	8,&(lvalues[1054]),0)
+CONST_ENTRY_NID("OCSP","OCSP",NID_ad_OCSP,8,&(lvalues[1062]),0)
+CONST_ENTRY_NID("caIssuers","CA Issuers",NID_ad_ca_issuers,8,&(lvalues[1070]),0)
+CONST_ENTRY_NID("OCSPSigning","OCSP Signing",NID_OCSP_sign,8,&(lvalues[1078]),0)
+CONST_ENTRY_NID("ISO","iso",NID_iso,1,&(lvalues[1086]),0)
+CONST_ENTRY_NID("member-body","ISO Member Body",NID_member_body,1,&(lvalues[1087]),0)
+CONST_ENTRY_NID("ISO-US","ISO US Member Body",NID_ISO_US,3,&(lvalues[1088]),0)
+CONST_ENTRY_NID("X9-57","X9.57",NID_X9_57,5,&(lvalues[1091]),0)
+CONST_ENTRY_NID("X9cm","X9.57 CM ?",NID_X9cm,6,&(lvalues[1096]),0)
+CONST_ENTRY_NID("pkcs1","pkcs1",NID_pkcs1,8,&(lvalues[1102]),0)
+CONST_ENTRY_NID("pkcs5","pkcs5",NID_pkcs5,8,&(lvalues[1110]),0)
+CONST_ENTRY_NID("SMIME","S/MIME",NID_SMIME,9,&(lvalues[1118]),0)
+CONST_ENTRY_NID("id-smime-mod","id-smime-mod",NID_id_smime_mod,10,&(lvalues[1127]),0)
+CONST_ENTRY_NID("id-smime-ct","id-smime-ct",NID_id_smime_ct,10,&(lvalues[1137]),0)
+CONST_ENTRY_NID("id-smime-aa","id-smime-aa",NID_id_smime_aa,10,&(lvalues[1147]),0)
+CONST_ENTRY_NID("id-smime-alg","id-smime-alg",NID_id_smime_alg,10,&(lvalues[1157]),0)
+CONST_ENTRY_NID("id-smime-cd","id-smime-cd",NID_id_smime_cd,10,&(lvalues[1167]),0)
+CONST_ENTRY_NID("id-smime-spq","id-smime-spq",NID_id_smime_spq,10,&(lvalues[1177]),0)
+CONST_ENTRY_NID("id-smime-cti","id-smime-cti",NID_id_smime_cti,10,&(lvalues[1187]),0)
+CONST_ENTRY_NID("id-smime-mod-cms","id-smime-mod-cms",NID_id_smime_mod_cms,11,
+	&(lvalues[1197]),0)
+CONST_ENTRY_NID("id-smime-mod-ess","id-smime-mod-ess",NID_id_smime_mod_ess,11,
+	&(lvalues[1208]),0)
+CONST_ENTRY_NID("id-smime-mod-oid","id-smime-mod-oid",NID_id_smime_mod_oid,11,
+	&(lvalues[1219]),0)
+CONST_ENTRY_NID("id-smime-mod-msg-v3","id-smime-mod-msg-v3",NID_id_smime_mod_msg_v3,
+	11,&(lvalues[1230]),0)
+CONST_ENTRY_NID("id-smime-mod-ets-eSignature-88","id-smime-mod-ets-eSignature-88",
+	NID_id_smime_mod_ets_eSignature_88,11,&(lvalues[1241]),0)
+CONST_ENTRY_NID("id-smime-mod-ets-eSignature-97","id-smime-mod-ets-eSignature-97",
+	NID_id_smime_mod_ets_eSignature_97,11,&(lvalues[1252]),0)
+CONST_ENTRY_NID("id-smime-mod-ets-eSigPolicy-88","id-smime-mod-ets-eSigPolicy-88",
+	NID_id_smime_mod_ets_eSigPolicy_88,11,&(lvalues[1263]),0)
+CONST_ENTRY_NID("id-smime-mod-ets-eSigPolicy-97","id-smime-mod-ets-eSigPolicy-97",
+	NID_id_smime_mod_ets_eSigPolicy_97,11,&(lvalues[1274]),0)
+CONST_ENTRY_NID("id-smime-ct-receipt","id-smime-ct-receipt",NID_id_smime_ct_receipt,
+	11,&(lvalues[1285]),0)
+CONST_ENTRY_NID("id-smime-ct-authData","id-smime-ct-authData",
+	NID_id_smime_ct_authData,11,&(lvalues[1296]),0)
+CONST_ENTRY_NID("id-smime-ct-publishCert","id-smime-ct-publishCert",
+	NID_id_smime_ct_publishCert,11,&(lvalues[1307]),0)
+CONST_ENTRY_NID("id-smime-ct-TSTInfo","id-smime-ct-TSTInfo",NID_id_smime_ct_TSTInfo,
+	11,&(lvalues[1318]),0)
+CONST_ENTRY_NID("id-smime-ct-TDTInfo","id-smime-ct-TDTInfo",NID_id_smime_ct_TDTInfo,
+	11,&(lvalues[1329]),0)
+CONST_ENTRY_NID("id-smime-ct-contentInfo","id-smime-ct-contentInfo",
+	NID_id_smime_ct_contentInfo,11,&(lvalues[1340]),0)
+CONST_ENTRY_NID("id-smime-ct-DVCSRequestData","id-smime-ct-DVCSRequestData",
+	NID_id_smime_ct_DVCSRequestData,11,&(lvalues[1351]),0)
+CONST_ENTRY_NID("id-smime-ct-DVCSResponseData","id-smime-ct-DVCSResponseData",
+	NID_id_smime_ct_DVCSResponseData,11,&(lvalues[1362]),0)
+CONST_ENTRY_NID("id-smime-aa-receiptRequest","id-smime-aa-receiptRequest",
+	NID_id_smime_aa_receiptRequest,11,&(lvalues[1373]),0)
+CONST_ENTRY_NID("id-smime-aa-securityLabel","id-smime-aa-securityLabel",
+	NID_id_smime_aa_securityLabel,11,&(lvalues[1384]),0)
+CONST_ENTRY_NID("id-smime-aa-mlExpandHistory","id-smime-aa-mlExpandHistory",
+	NID_id_smime_aa_mlExpandHistory,11,&(lvalues[1395]),0)
+CONST_ENTRY_NID("id-smime-aa-contentHint","id-smime-aa-contentHint",
+	NID_id_smime_aa_contentHint,11,&(lvalues[1406]),0)
+CONST_ENTRY_NID("id-smime-aa-msgSigDigest","id-smime-aa-msgSigDigest",
+	NID_id_smime_aa_msgSigDigest,11,&(lvalues[1417]),0)
+CONST_ENTRY_NID("id-smime-aa-encapContentType","id-smime-aa-encapContentType",
+	NID_id_smime_aa_encapContentType,11,&(lvalues[1428]),0)
+CONST_ENTRY_NID("id-smime-aa-contentIdentifier","id-smime-aa-contentIdentifier",
+	NID_id_smime_aa_contentIdentifier,11,&(lvalues[1439]),0)
+CONST_ENTRY_NID("id-smime-aa-macValue","id-smime-aa-macValue",
+	NID_id_smime_aa_macValue,11,&(lvalues[1450]),0)
+CONST_ENTRY_NID("id-smime-aa-equivalentLabels","id-smime-aa-equivalentLabels",
+	NID_id_smime_aa_equivalentLabels,11,&(lvalues[1461]),0)
+CONST_ENTRY_NID("id-smime-aa-contentReference","id-smime-aa-contentReference",
+	NID_id_smime_aa_contentReference,11,&(lvalues[1472]),0)
+CONST_ENTRY_NID("id-smime-aa-encrypKeyPref","id-smime-aa-encrypKeyPref",
+	NID_id_smime_aa_encrypKeyPref,11,&(lvalues[1483]),0)
+CONST_ENTRY_NID("id-smime-aa-signingCertificate","id-smime-aa-signingCertificate",
+	NID_id_smime_aa_signingCertificate,11,&(lvalues[1494]),0)
+CONST_ENTRY_NID("id-smime-aa-smimeEncryptCerts","id-smime-aa-smimeEncryptCerts",
+	NID_id_smime_aa_smimeEncryptCerts,11,&(lvalues[1505]),0)
+CONST_ENTRY_NID("id-smime-aa-timeStampToken","id-smime-aa-timeStampToken",
+	NID_id_smime_aa_timeStampToken,11,&(lvalues[1516]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-sigPolicyId","id-smime-aa-ets-sigPolicyId",
+	NID_id_smime_aa_ets_sigPolicyId,11,&(lvalues[1527]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-commitmentType","id-smime-aa-ets-commitmentType",
+	NID_id_smime_aa_ets_commitmentType,11,&(lvalues[1538]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-signerLocation","id-smime-aa-ets-signerLocation",
+	NID_id_smime_aa_ets_signerLocation,11,&(lvalues[1549]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-signerAttr","id-smime-aa-ets-signerAttr",
+	NID_id_smime_aa_ets_signerAttr,11,&(lvalues[1560]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-otherSigCert","id-smime-aa-ets-otherSigCert",
+	NID_id_smime_aa_ets_otherSigCert,11,&(lvalues[1571]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-contentTimestamp",
+	"id-smime-aa-ets-contentTimestamp",NID_id_smime_aa_ets_contentTimestamp,11,
+	&(lvalues[1582]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-CertificateRefs","id-smime-aa-ets-CertificateRefs",
+	NID_id_smime_aa_ets_CertificateRefs,11,&(lvalues[1593]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-RevocationRefs","id-smime-aa-ets-RevocationRefs",
+	NID_id_smime_aa_ets_RevocationRefs,11,&(lvalues[1604]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-certValues","id-smime-aa-ets-certValues",
+	NID_id_smime_aa_ets_certValues,11,&(lvalues[1615]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-revocationValues",
+	"id-smime-aa-ets-revocationValues",NID_id_smime_aa_ets_revocationValues,11,
+	&(lvalues[1626]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-escTimeStamp","id-smime-aa-ets-escTimeStamp",
+	NID_id_smime_aa_ets_escTimeStamp,11,&(lvalues[1637]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-certCRLTimestamp",
+	"id-smime-aa-ets-certCRLTimestamp",NID_id_smime_aa_ets_certCRLTimestamp,11,
+	&(lvalues[1648]),0)
+CONST_ENTRY_NID("id-smime-aa-ets-archiveTimeStamp",
+	"id-smime-aa-ets-archiveTimeStamp",NID_id_smime_aa_ets_archiveTimeStamp,11,
+	&(lvalues[1659]),0)
+CONST_ENTRY_NID("id-smime-aa-signatureType","id-smime-aa-signatureType",
+	NID_id_smime_aa_signatureType,11,&(lvalues[1670]),0)
+CONST_ENTRY_NID("id-smime-aa-dvcs-dvc","id-smime-aa-dvcs-dvc",
+	NID_id_smime_aa_dvcs_dvc,11,&(lvalues[1681]),0)
+CONST_ENTRY_NID("id-smime-alg-ESDHwith3DES","id-smime-alg-ESDHwith3DES",
+	NID_id_smime_alg_ESDHwith3DES,11,&(lvalues[1692]),0)
+CONST_ENTRY_NID("id-smime-alg-ESDHwithRC2","id-smime-alg-ESDHwithRC2",
+	NID_id_smime_alg_ESDHwithRC2,11,&(lvalues[1703]),0)
+CONST_ENTRY_NID("id-smime-alg-3DESwrap","id-smime-alg-3DESwrap",
+	NID_id_smime_alg_3DESwrap,11,&(lvalues[1714]),0)
+CONST_ENTRY_NID("id-smime-alg-RC2wrap","id-smime-alg-RC2wrap",
+	NID_id_smime_alg_RC2wrap,11,&(lvalues[1725]),0)
+CONST_ENTRY_NID("id-smime-alg-ESDH","id-smime-alg-ESDH",NID_id_smime_alg_ESDH,11,
+	&(lvalues[1736]),0)
+CONST_ENTRY_NID("id-smime-alg-CMS3DESwrap","id-smime-alg-CMS3DESwrap",
+	NID_id_smime_alg_CMS3DESwrap,11,&(lvalues[1747]),0)
+CONST_ENTRY_NID("id-smime-alg-CMSRC2wrap","id-smime-alg-CMSRC2wrap",
+	NID_id_smime_alg_CMSRC2wrap,11,&(lvalues[1758]),0)
+CONST_ENTRY_NID("id-smime-cd-ldap","id-smime-cd-ldap",NID_id_smime_cd_ldap,11,
+	&(lvalues[1769]),0)
+CONST_ENTRY_NID("id-smime-spq-ets-sqt-uri","id-smime-spq-ets-sqt-uri",
+	NID_id_smime_spq_ets_sqt_uri,11,&(lvalues[1780]),0)
+CONST_ENTRY_NID("id-smime-spq-ets-sqt-unotice","id-smime-spq-ets-sqt-unotice",
+	NID_id_smime_spq_ets_sqt_unotice,11,&(lvalues[1791]),0)
+CONST_ENTRY_NID("id-smime-cti-ets-proofOfOrigin","id-smime-cti-ets-proofOfOrigin",
+	NID_id_smime_cti_ets_proofOfOrigin,11,&(lvalues[1802]),0)
+CONST_ENTRY_NID("id-smime-cti-ets-proofOfReceipt","id-smime-cti-ets-proofOfReceipt",
+	NID_id_smime_cti_ets_proofOfReceipt,11,&(lvalues[1813]),0)
+CONST_ENTRY_NID("id-smime-cti-ets-proofOfDelivery",
+	"id-smime-cti-ets-proofOfDelivery",NID_id_smime_cti_ets_proofOfDelivery,11,
+	&(lvalues[1824]),0)
+CONST_ENTRY_NID("id-smime-cti-ets-proofOfSender","id-smime-cti-ets-proofOfSender",
+	NID_id_smime_cti_ets_proofOfSender,11,&(lvalues[1835]),0)
+CONST_ENTRY_NID("id-smime-cti-ets-proofOfApproval",
+	"id-smime-cti-ets-proofOfApproval",NID_id_smime_cti_ets_proofOfApproval,11,
+	&(lvalues[1846]),0)
+CONST_ENTRY_NID("id-smime-cti-ets-proofOfCreation",
+	"id-smime-cti-ets-proofOfCreation",NID_id_smime_cti_ets_proofOfCreation,11,
+	&(lvalues[1857]),0)
+CONST_ENTRY_NID("MD4","md4",NID_md4,8,&(lvalues[1868]),0)
+CONST_ENTRY_NID("id-pkix-mod","id-pkix-mod",NID_id_pkix_mod,7,&(lvalues[1876]),0)
+CONST_ENTRY_NID("id-qt","id-qt",NID_id_qt,7,&(lvalues[1883]),0)
+CONST_ENTRY_NID("id-it","id-it",NID_id_it,7,&(lvalues[1890]),0)
+CONST_ENTRY_NID("id-pkip","id-pkip",NID_id_pkip,7,&(lvalues[1897]),0)
+CONST_ENTRY_NID("id-alg","id-alg",NID_id_alg,7,&(lvalues[1904]),0)
+CONST_ENTRY_NID("id-cmc","id-cmc",NID_id_cmc,7,&(lvalues[1911]),0)
+CONST_ENTRY_NID("id-on","id-on",NID_id_on,7,&(lvalues[1918]),0)
+CONST_ENTRY_NID("id-pda","id-pda",NID_id_pda,7,&(lvalues[1925]),0)
+CONST_ENTRY_NID("id-aca","id-aca",NID_id_aca,7,&(lvalues[1932]),0)
+CONST_ENTRY_NID("id-qcs","id-qcs",NID_id_qcs,7,&(lvalues[1939]),0)
+CONST_ENTRY_NID("id-cct","id-cct",NID_id_cct,7,&(lvalues[1946]),0)
+CONST_ENTRY_NID("id-pkix1-explicit-88","id-pkix1-explicit-88",
+	NID_id_pkix1_explicit_88,8,&(lvalues[1953]),0)
+CONST_ENTRY_NID("id-pkix1-implicit-88","id-pkix1-implicit-88",
+	NID_id_pkix1_implicit_88,8,&(lvalues[1961]),0)
+CONST_ENTRY_NID("id-pkix1-explicit-93","id-pkix1-explicit-93",
+	NID_id_pkix1_explicit_93,8,&(lvalues[1969]),0)
+CONST_ENTRY_NID("id-pkix1-implicit-93","id-pkix1-implicit-93",
+	NID_id_pkix1_implicit_93,8,&(lvalues[1977]),0)
+CONST_ENTRY_NID("id-mod-crmf","id-mod-crmf",NID_id_mod_crmf,8,&(lvalues[1985]),0)
+CONST_ENTRY_NID("id-mod-cmc","id-mod-cmc",NID_id_mod_cmc,8,&(lvalues[1993]),0)
+CONST_ENTRY_NID("id-mod-kea-profile-88","id-mod-kea-profile-88",
+	NID_id_mod_kea_profile_88,8,&(lvalues[2001]),0)
+CONST_ENTRY_NID("id-mod-kea-profile-93","id-mod-kea-profile-93",
+	NID_id_mod_kea_profile_93,8,&(lvalues[2009]),0)
+CONST_ENTRY_NID("id-mod-cmp","id-mod-cmp",NID_id_mod_cmp,8,&(lvalues[2017]),0)
+CONST_ENTRY_NID("id-mod-qualified-cert-88","id-mod-qualified-cert-88",
+	NID_id_mod_qualified_cert_88,8,&(lvalues[2025]),0)
+CONST_ENTRY_NID("id-mod-qualified-cert-93","id-mod-qualified-cert-93",
+	NID_id_mod_qualified_cert_93,8,&(lvalues[2033]),0)
+CONST_ENTRY_NID("id-mod-attribute-cert","id-mod-attribute-cert",
+	NID_id_mod_attribute_cert,8,&(lvalues[2041]),0)
+CONST_ENTRY_NID("id-mod-timestamp-protocol","id-mod-timestamp-protocol",
+	NID_id_mod_timestamp_protocol,8,&(lvalues[2049]),0)
+CONST_ENTRY_NID("id-mod-ocsp","id-mod-ocsp",NID_id_mod_ocsp,8,&(lvalues[2057]),0)
+CONST_ENTRY_NID("id-mod-dvcs","id-mod-dvcs",NID_id_mod_dvcs,8,&(lvalues[2065]),0)
+CONST_ENTRY_NID("id-mod-cmp2000","id-mod-cmp2000",NID_id_mod_cmp2000,8,
+	&(lvalues[2073]),0)
+CONST_ENTRY_NID("biometricInfo","Biometric Info",NID_biometricInfo,8,&(lvalues[2081]),0)
+CONST_ENTRY_NID("qcStatements","qcStatements",NID_qcStatements,8,&(lvalues[2089]),0)
+CONST_ENTRY_NID("ac-auditEntity","ac-auditEntity",NID_ac_auditEntity,8,
+	&(lvalues[2097]),0)
+CONST_ENTRY_NID("ac-targeting","ac-targeting",NID_ac_targeting,8,&(lvalues[2105]),0)
+CONST_ENTRY_NID("aaControls","aaControls",NID_aaControls,8,&(lvalues[2113]),0)
+CONST_ENTRY_NID("sbgp-ipAddrBlock","sbgp-ipAddrBlock",NID_sbgp_ipAddrBlock,8,
+	&(lvalues[2121]),0)
+CONST_ENTRY_NID("sbgp-autonomousSysNum","sbgp-autonomousSysNum",
+	NID_sbgp_autonomousSysNum,8,&(lvalues[2129]),0)
+CONST_ENTRY_NID("sbgp-routerIdentifier","sbgp-routerIdentifier",
+	NID_sbgp_routerIdentifier,8,&(lvalues[2137]),0)
+CONST_ENTRY_NID("textNotice","textNotice",NID_textNotice,8,&(lvalues[2145]),0)
+CONST_ENTRY_NID("ipsecEndSystem","IPSec End System",NID_ipsecEndSystem,8,
+	&(lvalues[2153]),0)
+CONST_ENTRY_NID("ipsecTunnel","IPSec Tunnel",NID_ipsecTunnel,8,&(lvalues[2161]),0)
+CONST_ENTRY_NID("ipsecUser","IPSec User",NID_ipsecUser,8,&(lvalues[2169]),0)
+CONST_ENTRY_NID("DVCS","dvcs",NID_dvcs,8,&(lvalues[2177]),0)
+CONST_ENTRY_NID("id-it-caProtEncCert","id-it-caProtEncCert",NID_id_it_caProtEncCert,
+	8,&(lvalues[2185]),0)
+CONST_ENTRY_NID("id-it-signKeyPairTypes","id-it-signKeyPairTypes",
+	NID_id_it_signKeyPairTypes,8,&(lvalues[2193]),0)
+CONST_ENTRY_NID("id-it-encKeyPairTypes","id-it-encKeyPairTypes",
+	NID_id_it_encKeyPairTypes,8,&(lvalues[2201]),0)
+CONST_ENTRY_NID("id-it-preferredSymmAlg","id-it-preferredSymmAlg",
+	NID_id_it_preferredSymmAlg,8,&(lvalues[2209]),0)
+CONST_ENTRY_NID("id-it-caKeyUpdateInfo","id-it-caKeyUpdateInfo",
+	NID_id_it_caKeyUpdateInfo,8,&(lvalues[2217]),0)
+CONST_ENTRY_NID("id-it-currentCRL","id-it-currentCRL",NID_id_it_currentCRL,8,
+	&(lvalues[2225]),0)
+CONST_ENTRY_NID("id-it-unsupportedOIDs","id-it-unsupportedOIDs",
+	NID_id_it_unsupportedOIDs,8,&(lvalues[2233]),0)
+CONST_ENTRY_NID("id-it-subscriptionRequest","id-it-subscriptionRequest",
+	NID_id_it_subscriptionRequest,8,&(lvalues[2241]),0)
+CONST_ENTRY_NID("id-it-subscriptionResponse","id-it-subscriptionResponse",
+	NID_id_it_subscriptionResponse,8,&(lvalues[2249]),0)
+CONST_ENTRY_NID("id-it-keyPairParamReq","id-it-keyPairParamReq",
+	NID_id_it_keyPairParamReq,8,&(lvalues[2257]),0)
+CONST_ENTRY_NID("id-it-keyPairParamRep","id-it-keyPairParamRep",
+	NID_id_it_keyPairParamRep,8,&(lvalues[2265]),0)
+CONST_ENTRY_NID("id-it-revPassphrase","id-it-revPassphrase",NID_id_it_revPassphrase,
+	8,&(lvalues[2273]),0)
+CONST_ENTRY_NID("id-it-implicitConfirm","id-it-implicitConfirm",
+	NID_id_it_implicitConfirm,8,&(lvalues[2281]),0)
+CONST_ENTRY_NID("id-it-confirmWaitTime","id-it-confirmWaitTime",
+	NID_id_it_confirmWaitTime,8,&(lvalues[2289]),0)
+CONST_ENTRY_NID("id-it-origPKIMessage","id-it-origPKIMessage",
+	NID_id_it_origPKIMessage,8,&(lvalues[2297]),0)
+CONST_ENTRY_NID("id-regCtrl","id-regCtrl",NID_id_regCtrl,8,&(lvalues[2305]),0)
+CONST_ENTRY_NID("id-regInfo","id-regInfo",NID_id_regInfo,8,&(lvalues[2313]),0)
+CONST_ENTRY_NID("id-regCtrl-regToken","id-regCtrl-regToken",NID_id_regCtrl_regToken,
+	9,&(lvalues[2321]),0)
+CONST_ENTRY_NID("id-regCtrl-authenticator","id-regCtrl-authenticator",
+	NID_id_regCtrl_authenticator,9,&(lvalues[2330]),0)
+CONST_ENTRY_NID("id-regCtrl-pkiPublicationInfo","id-regCtrl-pkiPublicationInfo",
+	NID_id_regCtrl_pkiPublicationInfo,9,&(lvalues[2339]),0)
+CONST_ENTRY_NID("id-regCtrl-pkiArchiveOptions","id-regCtrl-pkiArchiveOptions",
+	NID_id_regCtrl_pkiArchiveOptions,9,&(lvalues[2348]),0)
+CONST_ENTRY_NID("id-regCtrl-oldCertID","id-regCtrl-oldCertID",
+	NID_id_regCtrl_oldCertID,9,&(lvalues[2357]),0)
+CONST_ENTRY_NID("id-regCtrl-protocolEncrKey","id-regCtrl-protocolEncrKey",
+	NID_id_regCtrl_protocolEncrKey,9,&(lvalues[2366]),0)
+CONST_ENTRY_NID("id-regInfo-utf8Pairs","id-regInfo-utf8Pairs",
+	NID_id_regInfo_utf8Pairs,9,&(lvalues[2375]),0)
+CONST_ENTRY_NID("id-regInfo-certReq","id-regInfo-certReq",NID_id_regInfo_certReq,9,
+	&(lvalues[2384]),0)
+CONST_ENTRY_NID("id-alg-des40","id-alg-des40",NID_id_alg_des40,8,&(lvalues[2393]),0)
+CONST_ENTRY_NID("id-alg-noSignature","id-alg-noSignature",NID_id_alg_noSignature,8,
+	&(lvalues[2401]),0)
+CONST_ENTRY_NID("id-alg-dh-sig-hmac-sha1","id-alg-dh-sig-hmac-sha1",
+	NID_id_alg_dh_sig_hmac_sha1,8,&(lvalues[2409]),0)
+CONST_ENTRY_NID("id-alg-dh-pop","id-alg-dh-pop",NID_id_alg_dh_pop,8,&(lvalues[2417]),0)
+CONST_ENTRY_NID("id-cmc-statusInfo","id-cmc-statusInfo",NID_id_cmc_statusInfo,8,
+	&(lvalues[2425]),0)
+CONST_ENTRY_NID("id-cmc-identification","id-cmc-identification",
+	NID_id_cmc_identification,8,&(lvalues[2433]),0)
+CONST_ENTRY_NID("id-cmc-identityProof","id-cmc-identityProof",
+	NID_id_cmc_identityProof,8,&(lvalues[2441]),0)
+CONST_ENTRY_NID("id-cmc-dataReturn","id-cmc-dataReturn",NID_id_cmc_dataReturn,8,
+	&(lvalues[2449]),0)
+CONST_ENTRY_NID("id-cmc-transactionId","id-cmc-transactionId",
+	NID_id_cmc_transactionId,8,&(lvalues[2457]),0)
+CONST_ENTRY_NID("id-cmc-senderNonce","id-cmc-senderNonce",NID_id_cmc_senderNonce,8,
+	&(lvalues[2465]),0)
+CONST_ENTRY_NID("id-cmc-recipientNonce","id-cmc-recipientNonce",
+	NID_id_cmc_recipientNonce,8,&(lvalues[2473]),0)
+CONST_ENTRY_NID("id-cmc-addExtensions","id-cmc-addExtensions",
+	NID_id_cmc_addExtensions,8,&(lvalues[2481]),0)
+CONST_ENTRY_NID("id-cmc-encryptedPOP","id-cmc-encryptedPOP",NID_id_cmc_encryptedPOP,
+	8,&(lvalues[2489]),0)
+CONST_ENTRY_NID("id-cmc-decryptedPOP","id-cmc-decryptedPOP",NID_id_cmc_decryptedPOP,
+	8,&(lvalues[2497]),0)
+CONST_ENTRY_NID("id-cmc-lraPOPWitness","id-cmc-lraPOPWitness",
+	NID_id_cmc_lraPOPWitness,8,&(lvalues[2505]),0)
+CONST_ENTRY_NID("id-cmc-getCert","id-cmc-getCert",NID_id_cmc_getCert,8,
+	&(lvalues[2513]),0)
+CONST_ENTRY_NID("id-cmc-getCRL","id-cmc-getCRL",NID_id_cmc_getCRL,8,&(lvalues[2521]),0)
+CONST_ENTRY_NID("id-cmc-revokeRequest","id-cmc-revokeRequest",
+	NID_id_cmc_revokeRequest,8,&(lvalues[2529]),0)
+CONST_ENTRY_NID("id-cmc-regInfo","id-cmc-regInfo",NID_id_cmc_regInfo,8,
+	&(lvalues[2537]),0)
+CONST_ENTRY_NID("id-cmc-responseInfo","id-cmc-responseInfo",NID_id_cmc_responseInfo,
+	8,&(lvalues[2545]),0)
+CONST_ENTRY_NID("id-cmc-queryPending","id-cmc-queryPending",NID_id_cmc_queryPending,
+	8,&(lvalues[2553]),0)
+CONST_ENTRY_NID("id-cmc-popLinkRandom","id-cmc-popLinkRandom",
+	NID_id_cmc_popLinkRandom,8,&(lvalues[2561]),0)
+CONST_ENTRY_NID("id-cmc-popLinkWitness","id-cmc-popLinkWitness",
+	NID_id_cmc_popLinkWitness,8,&(lvalues[2569]),0)
+CONST_ENTRY_NID("id-cmc-confirmCertAcceptance","id-cmc-confirmCertAcceptance",
+	NID_id_cmc_confirmCertAcceptance,8,&(lvalues[2577]),0)
+CONST_ENTRY_NID("id-on-personalData","id-on-personalData",NID_id_on_personalData,8,
+	&(lvalues[2585]),0)
+CONST_ENTRY_NID("id-pda-dateOfBirth","id-pda-dateOfBirth",NID_id_pda_dateOfBirth,8,
+	&(lvalues[2593]),0)
+CONST_ENTRY_NID("id-pda-placeOfBirth","id-pda-placeOfBirth",NID_id_pda_placeOfBirth,
+	8,&(lvalues[2601]),0)
+CONST_ENTRY_NID(NULL,NULL,NID_undef,0,NULL,0)
+CONST_ENTRY_NID("id-pda-gender","id-pda-gender",NID_id_pda_gender,8,&(lvalues[2609]),0)
+CONST_ENTRY_NID("id-pda-countryOfCitizenship","id-pda-countryOfCitizenship",
+	NID_id_pda_countryOfCitizenship,8,&(lvalues[2617]),0)
+CONST_ENTRY_NID("id-pda-countryOfResidence","id-pda-countryOfResidence",
+	NID_id_pda_countryOfResidence,8,&(lvalues[2625]),0)
+CONST_ENTRY_NID("id-aca-authenticationInfo","id-aca-authenticationInfo",
+	NID_id_aca_authenticationInfo,8,&(lvalues[2633]),0)
+CONST_ENTRY_NID("id-aca-accessIdentity","id-aca-accessIdentity",
+	NID_id_aca_accessIdentity,8,&(lvalues[2641]),0)
+CONST_ENTRY_NID("id-aca-chargingIdentity","id-aca-chargingIdentity",
+	NID_id_aca_chargingIdentity,8,&(lvalues[2649]),0)
+CONST_ENTRY_NID("id-aca-group","id-aca-group",NID_id_aca_group,8,&(lvalues[2657]),0)
+CONST_ENTRY_NID("id-aca-role","id-aca-role",NID_id_aca_role,8,&(lvalues[2665]),0)
+CONST_ENTRY_NID("id-qcs-pkixQCSyntax-v1","id-qcs-pkixQCSyntax-v1",
+	NID_id_qcs_pkixQCSyntax_v1,8,&(lvalues[2673]),0)
+CONST_ENTRY_NID("id-cct-crs","id-cct-crs",NID_id_cct_crs,8,&(lvalues[2681]),0)
+CONST_ENTRY_NID("id-cct-PKIData","id-cct-PKIData",NID_id_cct_PKIData,8,
+	&(lvalues[2689]),0)
+CONST_ENTRY_NID("id-cct-PKIResponse","id-cct-PKIResponse",NID_id_cct_PKIResponse,8,
+	&(lvalues[2697]),0)
+CONST_ENTRY_NID("ad_timestamping","AD Time Stamping",NID_ad_timeStamping,8,
+	&(lvalues[2705]),0)
+CONST_ENTRY_NID("AD_DVCS","ad dvcs",NID_ad_dvcs,8,&(lvalues[2713]),0)
+CONST_ENTRY_NID("basicOCSPResponse","Basic OCSP Response",NID_id_pkix_OCSP_basic,9,
+	&(lvalues[2721]),0)
+CONST_ENTRY_NID("Nonce","OCSP Nonce",NID_id_pkix_OCSP_Nonce,9,&(lvalues[2730]),0)
+CONST_ENTRY_NID("CrlID","OCSP CRL ID",NID_id_pkix_OCSP_CrlID,9,&(lvalues[2739]),0)
+CONST_ENTRY_NID("acceptableResponses","Acceptable OCSP Responses",
+	NID_id_pkix_OCSP_acceptableResponses,9,&(lvalues[2748]),0)
+CONST_ENTRY_NID("noCheck","OCSP No Check",NID_id_pkix_OCSP_noCheck,9,&(lvalues[2757]),0)
+CONST_ENTRY_NID("archiveCutoff","OCSP Archive Cutoff",NID_id_pkix_OCSP_archiveCutoff,
+	9,&(lvalues[2766]),0)
+CONST_ENTRY_NID("serviceLocator","OCSP Service Locator",
+	NID_id_pkix_OCSP_serviceLocator,9,&(lvalues[2775]),0)
+CONST_ENTRY_NID("extendedStatus","Extended OCSP Status",
+	NID_id_pkix_OCSP_extendedStatus,9,&(lvalues[2784]),0)
+CONST_ENTRY_NID("valid","valid",NID_id_pkix_OCSP_valid,9,&(lvalues[2793]),0)
+CONST_ENTRY_NID("path","path",NID_id_pkix_OCSP_path,9,&(lvalues[2802]),0)
+CONST_ENTRY_NID("trustRoot","Trust Root",NID_id_pkix_OCSP_trustRoot,9,
+	&(lvalues[2811]),0)
+CONST_ENTRY_NID("algorithm","algorithm",NID_algorithm,4,&(lvalues[2820]),0)
+CONST_ENTRY_NID("rsaSignature","rsaSignature",NID_rsaSignature,5,&(lvalues[2824]),0)
+CONST_ENTRY_NID("X500algorithms","directory services - algorithms",
+	NID_X500algorithms,2,&(lvalues[2829]),0)
+CONST_ENTRY_NID("ORG","org",NID_org,1,&(lvalues[2831]),0)
+CONST_ENTRY_NID("DOD","dod",NID_dod,2,&(lvalues[2832]),0)
+CONST_ENTRY_NID("IANA","iana",NID_iana,3,&(lvalues[2834]),0)
+CONST_ENTRY_NID("directory","Directory",NID_Directory,4,&(lvalues[2837]),0)
+CONST_ENTRY_NID("mgmt","Management",NID_Management,4,&(lvalues[2841]),0)
+CONST_ENTRY_NID("experimental","Experimental",NID_Experimental,4,&(lvalues[2845]),0)
+CONST_ENTRY_NID("private","Private",NID_Private,4,&(lvalues[2849]),0)
+CONST_ENTRY_NID("security","Security",NID_Security,4,&(lvalues[2853]),0)
+CONST_ENTRY_NID("snmpv2","SNMPv2",NID_SNMPv2,4,&(lvalues[2857]),0)
+CONST_ENTRY_NID("Mail","Mail",NID_Mail,4,&(lvalues[2861]),0)
+CONST_ENTRY_NID("enterprises","Enterprises",NID_Enterprises,5,&(lvalues[2865]),0)
+CONST_ENTRY_NID("dcobject","dcObject",NID_dcObject,9,&(lvalues[2870]),0)
+CONST_ENTRY_NID("DC","domainComponent",NID_domainComponent,10,&(lvalues[2879]),0)
+CONST_ENTRY_NID("domain","Domain",NID_Domain,10,&(lvalues[2889]),0)
+CONST_ENTRY_NID("NULL","NULL",NID_joint_iso_ccitt,1,&(lvalues[2899]),0)
+CONST_ENTRY_NID("selected-attribute-types","Selected Attribute Types",
+	NID_selected_attribute_types,3,&(lvalues[2900]),0)
+CONST_ENTRY_NID("clearance","clearance",NID_clearance,4,&(lvalues[2903]),0)
+CONST_ENTRY_NID("RSA-MD4","md4WithRSAEncryption",NID_md4WithRSAEncryption,9,
+	&(lvalues[2907]),0)
+CONST_ENTRY_NID("ac-proxying","ac-proxying",NID_ac_proxying,8,&(lvalues[2916]),0)
+CONST_ENTRY_NID("subjectInfoAccess","Subject Information Access",NID_sinfo_access,8,
+	&(lvalues[2924]),0)
+CONST_ENTRY_NID("id-aca-encAttrs","id-aca-encAttrs",NID_id_aca_encAttrs,8,
+	&(lvalues[2932]),0)
+CONST_ENTRY_NID("role","role",NID_role,3,&(lvalues[2940]),0)
+CONST_ENTRY_NID("policyConstraints","X509v3 Policy Constraints",
+	NID_policy_constraints,3,&(lvalues[2943]),0)
+CONST_ENTRY_NID("targetInformation","X509v3 AC Targeting",NID_target_information,3,
+	&(lvalues[2946]),0)
+CONST_ENTRY_NID("noRevAvail","X509v3 No Revocation Available",NID_no_rev_avail,3,
+	&(lvalues[2949]),0)
+CONST_ENTRY_NID("NULL","NULL",NID_ccitt,1,&(lvalues[2952]),0)
+CONST_ENTRY_NID("ansi-X9-62","ANSI X9.62",NID_ansi_X9_62,5,&(lvalues[2953]),0)
+CONST_ENTRY_NID("prime-field","prime-field",NID_X9_62_prime_field,7,&(lvalues[2958]),0)
+CONST_ENTRY_NID("characteristic-two-field","characteristic-two-field",
+	NID_X9_62_characteristic_two_field,7,&(lvalues[2965]),0)
+CONST_ENTRY_NID("id-ecPublicKey","id-ecPublicKey",NID_X9_62_id_ecPublicKey,7,
+	&(lvalues[2972]),0)
+CONST_ENTRY_NID("prime192v1","prime192v1",NID_X9_62_prime192v1,8,&(lvalues[2979]),0)
+CONST_ENTRY_NID("prime192v2","prime192v2",NID_X9_62_prime192v2,8,&(lvalues[2987]),0)
+CONST_ENTRY_NID("prime192v3","prime192v3",NID_X9_62_prime192v3,8,&(lvalues[2995]),0)
+CONST_ENTRY_NID("prime239v1","prime239v1",NID_X9_62_prime239v1,8,&(lvalues[3003]),0)
+CONST_ENTRY_NID("prime239v2","prime239v2",NID_X9_62_prime239v2,8,&(lvalues[3011]),0)
+CONST_ENTRY_NID("prime239v3","prime239v3",NID_X9_62_prime239v3,8,&(lvalues[3019]),0)
+CONST_ENTRY_NID("prime256v1","prime256v1",NID_X9_62_prime256v1,8,&(lvalues[3027]),0)
+CONST_ENTRY_NID("ecdsa-with-SHA1","ecdsa-with-SHA1",NID_ecdsa_with_SHA1,7,
+	&(lvalues[3035]),0)
+CONST_ENTRY_NID("CSPName","Microsoft CSP Name",NID_ms_csp_name,9,&(lvalues[3042]),0)
+CONST_ENTRY_NID("AES-128-ECB","aes-128-ecb",NID_aes_128_ecb,9,&(lvalues[3051]),0)
+CONST_ENTRY_NID("AES-128-CBC","aes-128-cbc",NID_aes_128_cbc,9,&(lvalues[3060]),0)
+CONST_ENTRY_NID("AES-128-OFB","aes-128-ofb",NID_aes_128_ofb128,9,&(lvalues[3069]),0)
+CONST_ENTRY_NID("AES-128-CFB","aes-128-cfb",NID_aes_128_cfb128,9,&(lvalues[3078]),0)
+CONST_ENTRY_NID("AES-192-ECB","aes-192-ecb",NID_aes_192_ecb,9,&(lvalues[3087]),0)
+CONST_ENTRY_NID("AES-192-CBC","aes-192-cbc",NID_aes_192_cbc,9,&(lvalues[3096]),0)
+CONST_ENTRY_NID("AES-192-OFB","aes-192-ofb",NID_aes_192_ofb128,9,&(lvalues[3105]),0)
+CONST_ENTRY_NID("AES-192-CFB","aes-192-cfb",NID_aes_192_cfb128,9,&(lvalues[3114]),0)
+CONST_ENTRY_NID("AES-256-ECB","aes-256-ecb",NID_aes_256_ecb,9,&(lvalues[3123]),0)
+CONST_ENTRY_NID("AES-256-CBC","aes-256-cbc",NID_aes_256_cbc,9,&(lvalues[3132]),0)
+CONST_ENTRY_NID("AES-256-OFB","aes-256-ofb",NID_aes_256_ofb128,9,&(lvalues[3141]),0)
+CONST_ENTRY_NID("AES-256-CFB","aes-256-cfb",NID_aes_256_cfb128,9,&(lvalues[3150]),0)
+CONST_ENTRY_NID("holdInstructionCode","Hold Instruction Code",
+	NID_hold_instruction_code,3,&(lvalues[3159]),0)
+CONST_ENTRY_NID("holdInstructionNone","Hold Instruction None",
+	NID_hold_instruction_none,7,&(lvalues[3162]),0)
+CONST_ENTRY_NID("holdInstructionCallIssuer","Hold Instruction Call Issuer",
+	NID_hold_instruction_call_issuer,7,&(lvalues[3169]),0)
+CONST_ENTRY_NID("holdInstructionReject","Hold Instruction Reject",
+	NID_hold_instruction_reject,7,&(lvalues[3176]),0)
+CONST_ENTRY_NID("data","data",NID_data,1,&(lvalues[3183]),0)
+CONST_ENTRY_NID("pss","pss",NID_pss,3,&(lvalues[3184]),0)
+CONST_ENTRY_NID("ucl","ucl",NID_ucl,7,&(lvalues[3187]),0)
+CONST_ENTRY_NID("pilot","pilot",NID_pilot,8,&(lvalues[3194]),0)
+CONST_ENTRY_NID("pilotAttributeType","pilotAttributeType",NID_pilotAttributeType,9,
+	&(lvalues[3202]),0)
+CONST_ENTRY_NID("pilotAttributeSyntax","pilotAttributeSyntax",
+	NID_pilotAttributeSyntax,9,&(lvalues[3211]),0)
+CONST_ENTRY_NID("pilotObjectClass","pilotObjectClass",NID_pilotObjectClass,9,
+	&(lvalues[3220]),0)
+CONST_ENTRY_NID("pilotGroups","pilotGroups",NID_pilotGroups,9,&(lvalues[3229]),0)
+CONST_ENTRY_NID("iA5StringSyntax","iA5StringSyntax",NID_iA5StringSyntax,10,
+	&(lvalues[3238]),0)
+CONST_ENTRY_NID("caseIgnoreIA5StringSyntax","caseIgnoreIA5StringSyntax",
+	NID_caseIgnoreIA5StringSyntax,10,&(lvalues[3248]),0)
+CONST_ENTRY_NID("pilotObject","pilotObject",NID_pilotObject,10,&(lvalues[3258]),0)
+CONST_ENTRY_NID("pilotPerson","pilotPerson",NID_pilotPerson,10,&(lvalues[3268]),0)
+CONST_ENTRY_NID("account","account",NID_account,10,&(lvalues[3278]),0)
+CONST_ENTRY_NID("document","document",NID_document,10,&(lvalues[3288]),0)
+CONST_ENTRY_NID("room","room",NID_room,10,&(lvalues[3298]),0)
+CONST_ENTRY_NID("documentSeries","documentSeries",NID_documentSeries,10,
+	&(lvalues[3308]),0)
+CONST_ENTRY_NID("rFC822localPart","rFC822localPart",NID_rFC822localPart,10,
+	&(lvalues[3318]),0)
+CONST_ENTRY_NID("dNSDomain","dNSDomain",NID_dNSDomain,10,&(lvalues[3328]),0)
+CONST_ENTRY_NID("domainRelatedObject","domainRelatedObject",NID_domainRelatedObject,
+	10,&(lvalues[3338]),0)
+CONST_ENTRY_NID("friendlyCountry","friendlyCountry",NID_friendlyCountry,10,
+	&(lvalues[3348]),0)
+CONST_ENTRY_NID("simpleSecurityObject","simpleSecurityObject",
+	NID_simpleSecurityObject,10,&(lvalues[3358]),0)
+CONST_ENTRY_NID("pilotOrganization","pilotOrganization",NID_pilotOrganization,10,
+	&(lvalues[3368]),0)
+CONST_ENTRY_NID("pilotDSA","pilotDSA",NID_pilotDSA,10,&(lvalues[3378]),0)
+CONST_ENTRY_NID("qualityLabelledData","qualityLabelledData",NID_qualityLabelledData,
+	10,&(lvalues[3388]),0)
+CONST_ENTRY_NID("UID","userId",NID_userId,10,&(lvalues[3398]),0)
+CONST_ENTRY_NID("textEncodedORAddress","textEncodedORAddress",
+	NID_textEncodedORAddress,10,&(lvalues[3408]),0)
+CONST_ENTRY_NID("mail","rfc822Mailbox",NID_rfc822Mailbox,10,&(lvalues[3418]),0)
+CONST_ENTRY_NID("info","info",NID_info,10,&(lvalues[3428]),0)
+CONST_ENTRY_NID("favouriteDrink","favouriteDrink",NID_favouriteDrink,10,
+	&(lvalues[3438]),0)
+CONST_ENTRY_NID("roomNumber","roomNumber",NID_roomNumber,10,&(lvalues[3448]),0)
+CONST_ENTRY_NID("photo","photo",NID_photo,10,&(lvalues[3458]),0)
+CONST_ENTRY_NID("userClass","userClass",NID_userClass,10,&(lvalues[3468]),0)
+CONST_ENTRY_NID("host","host",NID_host,10,&(lvalues[3478]),0)
+CONST_ENTRY_NID("manager","manager",NID_manager,10,&(lvalues[3488]),0)
+CONST_ENTRY_NID("documentIdentifier","documentIdentifier",NID_documentIdentifier,10,
+	&(lvalues[3498]),0)
+CONST_ENTRY_NID("documentTitle","documentTitle",NID_documentTitle,10,&(lvalues[3508]),0)
+CONST_ENTRY_NID("documentVersion","documentVersion",NID_documentVersion,10,
+	&(lvalues[3518]),0)
+CONST_ENTRY_NID("documentAuthor","documentAuthor",NID_documentAuthor,10,
+	&(lvalues[3528]),0)
+CONST_ENTRY_NID("documentLocation","documentLocation",NID_documentLocation,10,
+	&(lvalues[3538]),0)
+CONST_ENTRY_NID("homeTelephoneNumber","homeTelephoneNumber",NID_homeTelephoneNumber,
+	10,&(lvalues[3548]),0)
+CONST_ENTRY_NID("secretary","secretary",NID_secretary,10,&(lvalues[3558]),0)
+CONST_ENTRY_NID("otherMailbox","otherMailbox",NID_otherMailbox,10,&(lvalues[3568]),0)
+CONST_ENTRY_NID("lastModifiedTime","lastModifiedTime",NID_lastModifiedTime,10,
+	&(lvalues[3578]),0)
+CONST_ENTRY_NID("lastModifiedBy","lastModifiedBy",NID_lastModifiedBy,10,
+	&(lvalues[3588]),0)
+CONST_ENTRY_NID("aRecord","aRecord",NID_aRecord,10,&(lvalues[3598]),0)
+CONST_ENTRY_NID("pilotAttributeType27","pilotAttributeType27",
+	NID_pilotAttributeType27,10,&(lvalues[3608]),0)
+CONST_ENTRY_NID("mXRecord","mXRecord",NID_mXRecord,10,&(lvalues[3618]),0)
+CONST_ENTRY_NID("nSRecord","nSRecord",NID_nSRecord,10,&(lvalues[3628]),0)
+CONST_ENTRY_NID("sOARecord","sOARecord",NID_sOARecord,10,&(lvalues[3638]),0)
+CONST_ENTRY_NID("cNAMERecord","cNAMERecord",NID_cNAMERecord,10,&(lvalues[3648]),0)
+CONST_ENTRY_NID("associatedDomain","associatedDomain",NID_associatedDomain,10,
+	&(lvalues[3658]),0)
+CONST_ENTRY_NID("associatedName","associatedName",NID_associatedName,10,
+	&(lvalues[3668]),0)
+CONST_ENTRY_NID("homePostalAddress","homePostalAddress",NID_homePostalAddress,10,
+	&(lvalues[3678]),0)
+CONST_ENTRY_NID("personalTitle","personalTitle",NID_personalTitle,10,&(lvalues[3688]),0)
+CONST_ENTRY_NID("mobileTelephoneNumber","mobileTelephoneNumber",
+	NID_mobileTelephoneNumber,10,&(lvalues[3698]),0)
+CONST_ENTRY_NID("pagerTelephoneNumber","pagerTelephoneNumber",
+	NID_pagerTelephoneNumber,10,&(lvalues[3708]),0)
+CONST_ENTRY_NID("friendlyCountryName","friendlyCountryName",NID_friendlyCountryName,
+	10,&(lvalues[3718]),0)
+CONST_ENTRY_NID("organizationalStatus","organizationalStatus",
+	NID_organizationalStatus,10,&(lvalues[3728]),0)
+CONST_ENTRY_NID("janetMailbox","janetMailbox",NID_janetMailbox,10,&(lvalues[3738]),0)
+CONST_ENTRY_NID("mailPreferenceOption","mailPreferenceOption",
+	NID_mailPreferenceOption,10,&(lvalues[3748]),0)
+CONST_ENTRY_NID("buildingName","buildingName",NID_buildingName,10,&(lvalues[3758]),0)
+CONST_ENTRY_NID("dSAQuality","dSAQuality",NID_dSAQuality,10,&(lvalues[3768]),0)
+CONST_ENTRY_NID("singleLevelQuality","singleLevelQuality",NID_singleLevelQuality,10,
+	&(lvalues[3778]),0)
+CONST_ENTRY_NID("subtreeMinimumQuality","subtreeMinimumQuality",
+	NID_subtreeMinimumQuality,10,&(lvalues[3788]),0)
+CONST_ENTRY_NID("subtreeMaximumQuality","subtreeMaximumQuality",
+	NID_subtreeMaximumQuality,10,&(lvalues[3798]),0)
+CONST_ENTRY_NID("personalSignature","personalSignature",NID_personalSignature,10,
+	&(lvalues[3808]),0)
+CONST_ENTRY_NID("dITRedirect","dITRedirect",NID_dITRedirect,10,&(lvalues[3818]),0)
+CONST_ENTRY_NID("audio","audio",NID_audio,10,&(lvalues[3828]),0)
+CONST_ENTRY_NID("documentPublisher","documentPublisher",NID_documentPublisher,10,
+	&(lvalues[3838]),0)
+CONST_ENTRY_NID("x500UniqueIdentifier","x500UniqueIdentifier",
+	NID_x500UniqueIdentifier,3,&(lvalues[3848]),0)
+CONST_ENTRY_NID("mime-mhs","MIME MHS",NID_mime_mhs,5,&(lvalues[3851]),0)
+CONST_ENTRY_NID("mime-mhs-headings","mime-mhs-headings",NID_mime_mhs_headings,6,
+	&(lvalues[3856]),0)
+CONST_ENTRY_NID("mime-mhs-bodies","mime-mhs-bodies",NID_mime_mhs_bodies,6,
+	&(lvalues[3862]),0)
+CONST_ENTRY_NID("id-hex-partial-message","id-hex-partial-message",
+	NID_id_hex_partial_message,7,&(lvalues[3868]),0)
+CONST_ENTRY_NID("id-hex-multipart-message","id-hex-multipart-message",
+	NID_id_hex_multipart_message,7,&(lvalues[3875]),0)
+CONST_ENTRY_NID("generationQualifier","generationQualifier",NID_generationQualifier,
+	3,&(lvalues[3882]),0)
+CONST_ENTRY_NID("pseudonym","pseudonym",NID_pseudonym,3,&(lvalues[3885]),0)
+CONST_ENTRY_NID(NULL,NULL,NID_undef,0,NULL,0)
+CONST_ENTRY_NID("id-set","Secure Electronic Transactions",NID_id_set,2,
+	&(lvalues[3888]),0)
+CONST_ENTRY_NID("set-ctype","content types",NID_set_ctype,3,&(lvalues[3890]),0)
+CONST_ENTRY_NID("set-msgExt","message extensions",NID_set_msgExt,3,&(lvalues[3893]),0)
+CONST_ENTRY_NID("set-attr","set-attr",NID_set_attr,3,&(lvalues[3896]),0)
+CONST_ENTRY_NID("set-policy","set-policy",NID_set_policy,3,&(lvalues[3899]),0)
+CONST_ENTRY_NID("set-certExt","certificate extensions",NID_set_certExt,3,
+	&(lvalues[3902]),0)
+CONST_ENTRY_NID("set-brand","set-brand",NID_set_brand,3,&(lvalues[3905]),0)
+CONST_ENTRY_NID("setct-PANData","setct-PANData",NID_setct_PANData,4,&(lvalues[3908]),0)
+CONST_ENTRY_NID("setct-PANToken","setct-PANToken",NID_setct_PANToken,4,
+	&(lvalues[3912]),0)
+CONST_ENTRY_NID("setct-PANOnly","setct-PANOnly",NID_setct_PANOnly,4,&(lvalues[3916]),0)
+CONST_ENTRY_NID("setct-OIData","setct-OIData",NID_setct_OIData,4,&(lvalues[3920]),0)
+CONST_ENTRY_NID("setct-PI","setct-PI",NID_setct_PI,4,&(lvalues[3924]),0)
+CONST_ENTRY_NID("setct-PIData","setct-PIData",NID_setct_PIData,4,&(lvalues[3928]),0)
+CONST_ENTRY_NID("setct-PIDataUnsigned","setct-PIDataUnsigned",
+	NID_setct_PIDataUnsigned,4,&(lvalues[3932]),0)
+CONST_ENTRY_NID("setct-HODInput","setct-HODInput",NID_setct_HODInput,4,
+	&(lvalues[3936]),0)
+CONST_ENTRY_NID("setct-AuthResBaggage","setct-AuthResBaggage",
+	NID_setct_AuthResBaggage,4,&(lvalues[3940]),0)
+CONST_ENTRY_NID("setct-AuthRevReqBaggage","setct-AuthRevReqBaggage",
+	NID_setct_AuthRevReqBaggage,4,&(lvalues[3944]),0)
+CONST_ENTRY_NID("setct-AuthRevResBaggage","setct-AuthRevResBaggage",
+	NID_setct_AuthRevResBaggage,4,&(lvalues[3948]),0)
+CONST_ENTRY_NID("setct-CapTokenSeq","setct-CapTokenSeq",NID_setct_CapTokenSeq,4,
+	&(lvalues[3952]),0)
+CONST_ENTRY_NID("setct-PInitResData","setct-PInitResData",NID_setct_PInitResData,4,
+	&(lvalues[3956]),0)
+CONST_ENTRY_NID("setct-PI-TBS","setct-PI-TBS",NID_setct_PI_TBS,4,&(lvalues[3960]),0)
+CONST_ENTRY_NID("setct-PResData","setct-PResData",NID_setct_PResData,4,
+	&(lvalues[3964]),0)
+CONST_ENTRY_NID("setct-AuthReqTBS","setct-AuthReqTBS",NID_setct_AuthReqTBS,4,
+	&(lvalues[3968]),0)
+CONST_ENTRY_NID("setct-AuthResTBS","setct-AuthResTBS",NID_setct_AuthResTBS,4,
+	&(lvalues[3972]),0)
+CONST_ENTRY_NID("setct-AuthResTBSX","setct-AuthResTBSX",NID_setct_AuthResTBSX,4,
+	&(lvalues[3976]),0)
+CONST_ENTRY_NID("setct-AuthTokenTBS","setct-AuthTokenTBS",NID_setct_AuthTokenTBS,4,
+	&(lvalues[3980]),0)
+CONST_ENTRY_NID("setct-CapTokenData","setct-CapTokenData",NID_setct_CapTokenData,4,
+	&(lvalues[3984]),0)
+CONST_ENTRY_NID("setct-CapTokenTBS","setct-CapTokenTBS",NID_setct_CapTokenTBS,4,
+	&(lvalues[3988]),0)
+CONST_ENTRY_NID("setct-AcqCardCodeMsg","setct-AcqCardCodeMsg",
+	NID_setct_AcqCardCodeMsg,4,&(lvalues[3992]),0)
+CONST_ENTRY_NID("setct-AuthRevReqTBS","setct-AuthRevReqTBS",NID_setct_AuthRevReqTBS,
+	4,&(lvalues[3996]),0)
+CONST_ENTRY_NID("setct-AuthRevResData","setct-AuthRevResData",
+	NID_setct_AuthRevResData,4,&(lvalues[4000]),0)
+CONST_ENTRY_NID("setct-AuthRevResTBS","setct-AuthRevResTBS",NID_setct_AuthRevResTBS,
+	4,&(lvalues[4004]),0)
+CONST_ENTRY_NID("setct-CapReqTBS","setct-CapReqTBS",NID_setct_CapReqTBS,4,
+	&(lvalues[4008]),0)
+CONST_ENTRY_NID("setct-CapReqTBSX","setct-CapReqTBSX",NID_setct_CapReqTBSX,4,
+	&(lvalues[4012]),0)
+CONST_ENTRY_NID("setct-CapResData","setct-CapResData",NID_setct_CapResData,4,
+	&(lvalues[4016]),0)
+CONST_ENTRY_NID("setct-CapRevReqTBS","setct-CapRevReqTBS",NID_setct_CapRevReqTBS,4,
+	&(lvalues[4020]),0)
+CONST_ENTRY_NID("setct-CapRevReqTBSX","setct-CapRevReqTBSX",NID_setct_CapRevReqTBSX,
+	4,&(lvalues[4024]),0)
+CONST_ENTRY_NID("setct-CapRevResData","setct-CapRevResData",NID_setct_CapRevResData,
+	4,&(lvalues[4028]),0)
+CONST_ENTRY_NID("setct-CredReqTBS","setct-CredReqTBS",NID_setct_CredReqTBS,4,
+	&(lvalues[4032]),0)
+CONST_ENTRY_NID("setct-CredReqTBSX","setct-CredReqTBSX",NID_setct_CredReqTBSX,4,
+	&(lvalues[4036]),0)
+CONST_ENTRY_NID("setct-CredResData","setct-CredResData",NID_setct_CredResData,4,
+	&(lvalues[4040]),0)
+CONST_ENTRY_NID("setct-CredRevReqTBS","setct-CredRevReqTBS",NID_setct_CredRevReqTBS,
+	4,&(lvalues[4044]),0)
+CONST_ENTRY_NID("setct-CredRevReqTBSX","setct-CredRevReqTBSX",
+	NID_setct_CredRevReqTBSX,4,&(lvalues[4048]),0)
+CONST_ENTRY_NID("setct-CredRevResData","setct-CredRevResData",
+	NID_setct_CredRevResData,4,&(lvalues[4052]),0)
+CONST_ENTRY_NID("setct-PCertReqData","setct-PCertReqData",NID_setct_PCertReqData,4,
+	&(lvalues[4056]),0)
+CONST_ENTRY_NID("setct-PCertResTBS","setct-PCertResTBS",NID_setct_PCertResTBS,4,
+	&(lvalues[4060]),0)
+CONST_ENTRY_NID("setct-BatchAdminReqData","setct-BatchAdminReqData",
+	NID_setct_BatchAdminReqData,4,&(lvalues[4064]),0)
+CONST_ENTRY_NID("setct-BatchAdminResData","setct-BatchAdminResData",
+	NID_setct_BatchAdminResData,4,&(lvalues[4068]),0)
+CONST_ENTRY_NID("setct-CardCInitResTBS","setct-CardCInitResTBS",
+	NID_setct_CardCInitResTBS,4,&(lvalues[4072]),0)
+CONST_ENTRY_NID("setct-MeAqCInitResTBS","setct-MeAqCInitResTBS",
+	NID_setct_MeAqCInitResTBS,4,&(lvalues[4076]),0)
+CONST_ENTRY_NID("setct-RegFormResTBS","setct-RegFormResTBS",NID_setct_RegFormResTBS,
+	4,&(lvalues[4080]),0)
+CONST_ENTRY_NID("setct-CertReqData","setct-CertReqData",NID_setct_CertReqData,4,
+	&(lvalues[4084]),0)
+CONST_ENTRY_NID("setct-CertReqTBS","setct-CertReqTBS",NID_setct_CertReqTBS,4,
+	&(lvalues[4088]),0)
+CONST_ENTRY_NID("setct-CertResData","setct-CertResData",NID_setct_CertResData,4,
+	&(lvalues[4092]),0)
+CONST_ENTRY_NID("setct-CertInqReqTBS","setct-CertInqReqTBS",NID_setct_CertInqReqTBS,
+	4,&(lvalues[4096]),0)
+CONST_ENTRY_NID("setct-ErrorTBS","setct-ErrorTBS",NID_setct_ErrorTBS,4,
+	&(lvalues[4100]),0)
+CONST_ENTRY_NID("setct-PIDualSignedTBE","setct-PIDualSignedTBE",
+	NID_setct_PIDualSignedTBE,4,&(lvalues[4104]),0)
+CONST_ENTRY_NID("setct-PIUnsignedTBE","setct-PIUnsignedTBE",NID_setct_PIUnsignedTBE,
+	4,&(lvalues[4108]),0)
+CONST_ENTRY_NID("setct-AuthReqTBE","setct-AuthReqTBE",NID_setct_AuthReqTBE,4,
+	&(lvalues[4112]),0)
+CONST_ENTRY_NID("setct-AuthResTBE","setct-AuthResTBE",NID_setct_AuthResTBE,4,
+	&(lvalues[4116]),0)
+CONST_ENTRY_NID("setct-AuthResTBEX","setct-AuthResTBEX",NID_setct_AuthResTBEX,4,
+	&(lvalues[4120]),0)
+CONST_ENTRY_NID("setct-AuthTokenTBE","setct-AuthTokenTBE",NID_setct_AuthTokenTBE,4,
+	&(lvalues[4124]),0)
+CONST_ENTRY_NID("setct-CapTokenTBE","setct-CapTokenTBE",NID_setct_CapTokenTBE,4,
+	&(lvalues[4128]),0)
+CONST_ENTRY_NID("setct-CapTokenTBEX","setct-CapTokenTBEX",NID_setct_CapTokenTBEX,4,
+	&(lvalues[4132]),0)
+CONST_ENTRY_NID("setct-AcqCardCodeMsgTBE","setct-AcqCardCodeMsgTBE",
+	NID_setct_AcqCardCodeMsgTBE,4,&(lvalues[4136]),0)
+CONST_ENTRY_NID("setct-AuthRevReqTBE","setct-AuthRevReqTBE",NID_setct_AuthRevReqTBE,
+	4,&(lvalues[4140]),0)
+CONST_ENTRY_NID("setct-AuthRevResTBE","setct-AuthRevResTBE",NID_setct_AuthRevResTBE,
+	4,&(lvalues[4144]),0)
+CONST_ENTRY_NID("setct-AuthRevResTBEB","setct-AuthRevResTBEB",
+	NID_setct_AuthRevResTBEB,4,&(lvalues[4148]),0)
+CONST_ENTRY_NID("setct-CapReqTBE","setct-CapReqTBE",NID_setct_CapReqTBE,4,
+	&(lvalues[4152]),0)
+CONST_ENTRY_NID("setct-CapReqTBEX","setct-CapReqTBEX",NID_setct_CapReqTBEX,4,
+	&(lvalues[4156]),0)
+CONST_ENTRY_NID("setct-CapResTBE","setct-CapResTBE",NID_setct_CapResTBE,4,
+	&(lvalues[4160]),0)
+CONST_ENTRY_NID("setct-CapRevReqTBE","setct-CapRevReqTBE",NID_setct_CapRevReqTBE,4,
+	&(lvalues[4164]),0)
+CONST_ENTRY_NID("setct-CapRevReqTBEX","setct-CapRevReqTBEX",NID_setct_CapRevReqTBEX,
+	4,&(lvalues[4168]),0)
+CONST_ENTRY_NID("setct-CapRevResTBE","setct-CapRevResTBE",NID_setct_CapRevResTBE,4,
+	&(lvalues[4172]),0)
+CONST_ENTRY_NID("setct-CredReqTBE","setct-CredReqTBE",NID_setct_CredReqTBE,4,
+	&(lvalues[4176]),0)
+CONST_ENTRY_NID("setct-CredReqTBEX","setct-CredReqTBEX",NID_setct_CredReqTBEX,4,
+	&(lvalues[4180]),0)
+CONST_ENTRY_NID("setct-CredResTBE","setct-CredResTBE",NID_setct_CredResTBE,4,
+	&(lvalues[4184]),0)
+CONST_ENTRY_NID("setct-CredRevReqTBE","setct-CredRevReqTBE",NID_setct_CredRevReqTBE,
+	4,&(lvalues[4188]),0)
+CONST_ENTRY_NID("setct-CredRevReqTBEX","setct-CredRevReqTBEX",
+	NID_setct_CredRevReqTBEX,4,&(lvalues[4192]),0)
+CONST_ENTRY_NID("setct-CredRevResTBE","setct-CredRevResTBE",NID_setct_CredRevResTBE,
+	4,&(lvalues[4196]),0)
+CONST_ENTRY_NID("setct-BatchAdminReqTBE","setct-BatchAdminReqTBE",
+	NID_setct_BatchAdminReqTBE,4,&(lvalues[4200]),0)
+CONST_ENTRY_NID("setct-BatchAdminResTBE","setct-BatchAdminResTBE",
+	NID_setct_BatchAdminResTBE,4,&(lvalues[4204]),0)
+CONST_ENTRY_NID("setct-RegFormReqTBE","setct-RegFormReqTBE",NID_setct_RegFormReqTBE,
+	4,&(lvalues[4208]),0)
+CONST_ENTRY_NID("setct-CertReqTBE","setct-CertReqTBE",NID_setct_CertReqTBE,4,
+	&(lvalues[4212]),0)
+CONST_ENTRY_NID("setct-CertReqTBEX","setct-CertReqTBEX",NID_setct_CertReqTBEX,4,
+	&(lvalues[4216]),0)
+CONST_ENTRY_NID("setct-CertResTBE","setct-CertResTBE",NID_setct_CertResTBE,4,
+	&(lvalues[4220]),0)
+CONST_ENTRY_NID("setct-CRLNotificationTBS","setct-CRLNotificationTBS",
+	NID_setct_CRLNotificationTBS,4,&(lvalues[4224]),0)
+CONST_ENTRY_NID("setct-CRLNotificationResTBS","setct-CRLNotificationResTBS",
+	NID_setct_CRLNotificationResTBS,4,&(lvalues[4228]),0)
+CONST_ENTRY_NID("setct-BCIDistributionTBS","setct-BCIDistributionTBS",
+	NID_setct_BCIDistributionTBS,4,&(lvalues[4232]),0)
+CONST_ENTRY_NID("setext-genCrypt","generic cryptogram",NID_setext_genCrypt,4,
+	&(lvalues[4236]),0)
+CONST_ENTRY_NID("setext-miAuth","merchant initiated auth",NID_setext_miAuth,4,
+	&(lvalues[4240]),0)
+CONST_ENTRY_NID("setext-pinSecure","setext-pinSecure",NID_setext_pinSecure,4,
+	&(lvalues[4244]),0)
+CONST_ENTRY_NID("setext-pinAny","setext-pinAny",NID_setext_pinAny,4,&(lvalues[4248]),0)
+CONST_ENTRY_NID("setext-track2","setext-track2",NID_setext_track2,4,&(lvalues[4252]),0)
+CONST_ENTRY_NID("setext-cv","additional verification",NID_setext_cv,4,
+	&(lvalues[4256]),0)
+CONST_ENTRY_NID("set-policy-root","set-policy-root",NID_set_policy_root,4,
+	&(lvalues[4260]),0)
+CONST_ENTRY_NID("setCext-hashedRoot","setCext-hashedRoot",NID_setCext_hashedRoot,4,
+	&(lvalues[4264]),0)
+CONST_ENTRY_NID("setCext-certType","setCext-certType",NID_setCext_certType,4,
+	&(lvalues[4268]),0)
+CONST_ENTRY_NID("setCext-merchData","setCext-merchData",NID_setCext_merchData,4,
+	&(lvalues[4272]),0)
+CONST_ENTRY_NID("setCext-cCertRequired","setCext-cCertRequired",
+	NID_setCext_cCertRequired,4,&(lvalues[4276]),0)
+CONST_ENTRY_NID("setCext-tunneling","setCext-tunneling",NID_setCext_tunneling,4,
+	&(lvalues[4280]),0)
+CONST_ENTRY_NID("setCext-setExt","setCext-setExt",NID_setCext_setExt,4,
+	&(lvalues[4284]),0)
+CONST_ENTRY_NID("setCext-setQualf","setCext-setQualf",NID_setCext_setQualf,4,
+	&(lvalues[4288]),0)
+CONST_ENTRY_NID("setCext-PGWYcapabilities","setCext-PGWYcapabilities",
+	NID_setCext_PGWYcapabilities,4,&(lvalues[4292]),0)
+CONST_ENTRY_NID("setCext-TokenIdentifier","setCext-TokenIdentifier",
+	NID_setCext_TokenIdentifier,4,&(lvalues[4296]),0)
+CONST_ENTRY_NID("setCext-Track2Data","setCext-Track2Data",NID_setCext_Track2Data,4,
+	&(lvalues[4300]),0)
+CONST_ENTRY_NID("setCext-TokenType","setCext-TokenType",NID_setCext_TokenType,4,
+	&(lvalues[4304]),0)
+CONST_ENTRY_NID("setCext-IssuerCapabilities","setCext-IssuerCapabilities",
+	NID_setCext_IssuerCapabilities,4,&(lvalues[4308]),0)
+CONST_ENTRY_NID("setAttr-Cert","setAttr-Cert",NID_setAttr_Cert,4,&(lvalues[4312]),0)
+CONST_ENTRY_NID("setAttr-PGWYcap","payment gateway capabilities",NID_setAttr_PGWYcap,
+	4,&(lvalues[4316]),0)
+CONST_ENTRY_NID("setAttr-TokenType","setAttr-TokenType",NID_setAttr_TokenType,4,
+	&(lvalues[4320]),0)
+CONST_ENTRY_NID("setAttr-IssCap","issuer capabilities",NID_setAttr_IssCap,4,
+	&(lvalues[4324]),0)
+CONST_ENTRY_NID("set-rootKeyThumb","set-rootKeyThumb",NID_set_rootKeyThumb,5,
+	&(lvalues[4328]),0)
+CONST_ENTRY_NID("set-addPolicy","set-addPolicy",NID_set_addPolicy,5,&(lvalues[4333]),0)
+CONST_ENTRY_NID("setAttr-Token-EMV","setAttr-Token-EMV",NID_setAttr_Token_EMV,5,
+	&(lvalues[4338]),0)
+CONST_ENTRY_NID("setAttr-Token-B0Prime","setAttr-Token-B0Prime",
+	NID_setAttr_Token_B0Prime,5,&(lvalues[4343]),0)
+CONST_ENTRY_NID("setAttr-IssCap-CVM","setAttr-IssCap-CVM",NID_setAttr_IssCap_CVM,5,
+	&(lvalues[4348]),0)
+CONST_ENTRY_NID("setAttr-IssCap-T2","setAttr-IssCap-T2",NID_setAttr_IssCap_T2,5,
+	&(lvalues[4353]),0)
+CONST_ENTRY_NID("setAttr-IssCap-Sig","setAttr-IssCap-Sig",NID_setAttr_IssCap_Sig,5,
+	&(lvalues[4358]),0)
+CONST_ENTRY_NID("setAttr-GenCryptgrm","generate cryptogram",NID_setAttr_GenCryptgrm,
+	6,&(lvalues[4363]),0)
+CONST_ENTRY_NID("setAttr-T2Enc","encrypted track 2",NID_setAttr_T2Enc,6,
+	&(lvalues[4369]),0)
+CONST_ENTRY_NID("setAttr-T2cleartxt","cleartext track 2",NID_setAttr_T2cleartxt,6,
+	&(lvalues[4375]),0)
+CONST_ENTRY_NID("setAttr-TokICCsig","ICC or token signature",NID_setAttr_TokICCsig,6,
+	&(lvalues[4381]),0)
+CONST_ENTRY_NID("setAttr-SecDevSig","secure device signature",NID_setAttr_SecDevSig,
+	6,&(lvalues[4387]),0)
+CONST_ENTRY_NID("set-brand-IATA-ATA","set-brand-IATA-ATA",NID_set_brand_IATA_ATA,4,
+	&(lvalues[4393]),0)
+CONST_ENTRY_NID("set-brand-Diners","set-brand-Diners",NID_set_brand_Diners,4,
+	&(lvalues[4397]),0)
+CONST_ENTRY_NID("set-brand-AmericanExpress","set-brand-AmericanExpress",
+	NID_set_brand_AmericanExpress,4,&(lvalues[4401]),0)
+CONST_ENTRY_NID("set-brand-JCB","set-brand-JCB",NID_set_brand_JCB,4,&(lvalues[4405]),0)
+CONST_ENTRY_NID("set-brand-Visa","set-brand-Visa",NID_set_brand_Visa,4,
+	&(lvalues[4409]),0)
+CONST_ENTRY_NID("set-brand-MasterCard","set-brand-MasterCard",
+	NID_set_brand_MasterCard,4,&(lvalues[4413]),0)
+CONST_ENTRY_NID("set-brand-Novus","set-brand-Novus",NID_set_brand_Novus,5,
+	&(lvalues[4417]),0)
+CONST_ENTRY_NID("DES-CDMF","des-cdmf",NID_des_cdmf,8,&(lvalues[4422]),0)
+CONST_ENTRY_NID("rsaOAEPEncryptionSET","rsaOAEPEncryptionSET",
+	NID_rsaOAEPEncryptionSET,9,&(lvalues[4430]),0)
+CONST_ENTRY_NID("ITU-T","itu-t",NID_itu_t,1,&(lvalues[4439]),0)
+CONST_ENTRY_NID("JOINT-ISO-ITU-T","joint-iso-itu-t",NID_joint_iso_itu_t,1,
+	&(lvalues[4440]),0)
+CONST_ENTRY_NID("international-organizations","International Organizations",
+	NID_international_organizations,1,&(lvalues[4441]),0)
+CONST_ENTRY_NID("msSmartcardLogin","Microsoft Smartcardlogin",NID_ms_smartcard_login,
+	10,&(lvalues[4442]),0)
+CONST_ENTRY_NID("msUPN","Microsoft Universal Principal Name",NID_ms_upn,10,
+	&(lvalues[4452]),0)
+CONST_ENTRY_NID("AES-128-CFB1","aes-128-cfb1",NID_aes_128_cfb1,0,NULL,0)
+CONST_ENTRY_NID("AES-192-CFB1","aes-192-cfb1",NID_aes_192_cfb1,0,NULL,0)
+CONST_ENTRY_NID("AES-256-CFB1","aes-256-cfb1",NID_aes_256_cfb1,0,NULL,0)
+CONST_ENTRY_NID("AES-128-CFB8","aes-128-cfb8",NID_aes_128_cfb8,0,NULL,0)
+CONST_ENTRY_NID("AES-192-CFB8","aes-192-cfb8",NID_aes_192_cfb8,0,NULL,0)
+CONST_ENTRY_NID("AES-256-CFB8","aes-256-cfb8",NID_aes_256_cfb8,0,NULL,0)
+CONST_ENTRY_NID("DES-CFB1","des-cfb1",NID_des_cfb1,0,NULL,0)
+CONST_ENTRY_NID("DES-CFB8","des-cfb8",NID_des_cfb8,0,NULL,0)
+CONST_ENTRY_NID("DES-EDE3-CFB1","des-ede3-cfb1",NID_des_ede3_cfb1,0,NULL,0)
+CONST_ENTRY_NID("DES-EDE3-CFB8","des-ede3-cfb8",NID_des_ede3_cfb8,0,NULL,0)
+CONST_ENTRY_NID("street","streetAddress",NID_streetAddress,3,&(lvalues[4462]),0)
+CONST_ENTRY_NID("postalCode","postalCode",NID_postalCode,3,&(lvalues[4465]),0)
+CONST_ENTRY_NID("id-ppl","id-ppl",NID_id_ppl,7,&(lvalues[4468]),0)
+CONST_ENTRY_NID("proxyCertInfo","Proxy Certificate Information",NID_proxyCertInfo,8,
+	&(lvalues[4475]),0)
+CONST_ENTRY_NID("id-ppl-anyLanguage","Any language",NID_id_ppl_anyLanguage,8,
+	&(lvalues[4483]),0)
+CONST_ENTRY_NID("id-ppl-inheritAll","Inherit all",NID_id_ppl_inheritAll,8,
+	&(lvalues[4491]),0)
+CONST_ENTRY_NID("nameConstraints","X509v3 Name Constraints",NID_name_constraints,3,
+	&(lvalues[4499]),0)
+CONST_ENTRY_NID("id-ppl-independent","Independent",NID_Independent,8,&(lvalues[4502]),0)
+CONST_ENTRY_NID("RSA-SHA256","sha256WithRSAEncryption",NID_sha256WithRSAEncryption,9,
+	&(lvalues[4510]),0)
+CONST_ENTRY_NID("RSA-SHA384","sha384WithRSAEncryption",NID_sha384WithRSAEncryption,9,
+	&(lvalues[4519]),0)
+CONST_ENTRY_NID("RSA-SHA512","sha512WithRSAEncryption",NID_sha512WithRSAEncryption,9,
+	&(lvalues[4528]),0)
+CONST_ENTRY_NID("RSA-SHA224","sha224WithRSAEncryption",NID_sha224WithRSAEncryption,9,
+	&(lvalues[4537]),0)
+CONST_ENTRY_NID("SHA256","sha256",NID_sha256,9,&(lvalues[4546]),0)
+CONST_ENTRY_NID("SHA384","sha384",NID_sha384,9,&(lvalues[4555]),0)
+CONST_ENTRY_NID("SHA512","sha512",NID_sha512,9,&(lvalues[4564]),0)
+CONST_ENTRY_NID("SHA224","sha224",NID_sha224,9,&(lvalues[4573]),0)
+CONST_ENTRY_NID("identified-organization","identified-organization",
+	NID_identified_organization,1,&(lvalues[4582]),0)
+CONST_ENTRY_NID("certicom-arc","certicom-arc",NID_certicom_arc,3,&(lvalues[4583]),0)
+CONST_ENTRY_NID("wap","wap",NID_wap,2,&(lvalues[4586]),0)
+CONST_ENTRY_NID("wap-wsg","wap-wsg",NID_wap_wsg,3,&(lvalues[4588]),0)
+CONST_ENTRY_NID("id-characteristic-two-basis","id-characteristic-two-basis",
+	NID_X9_62_id_characteristic_two_basis,8,&(lvalues[4591]),0)
+CONST_ENTRY_NID("onBasis","onBasis",NID_X9_62_onBasis,9,&(lvalues[4599]),0)
+CONST_ENTRY_NID("tpBasis","tpBasis",NID_X9_62_tpBasis,9,&(lvalues[4608]),0)
+CONST_ENTRY_NID("ppBasis","ppBasis",NID_X9_62_ppBasis,9,&(lvalues[4617]),0)
+CONST_ENTRY_NID("c2pnb163v1","c2pnb163v1",NID_X9_62_c2pnb163v1,8,&(lvalues[4626]),0)
+CONST_ENTRY_NID("c2pnb163v2","c2pnb163v2",NID_X9_62_c2pnb163v2,8,&(lvalues[4634]),0)
+CONST_ENTRY_NID("c2pnb163v3","c2pnb163v3",NID_X9_62_c2pnb163v3,8,&(lvalues[4642]),0)
+CONST_ENTRY_NID("c2pnb176v1","c2pnb176v1",NID_X9_62_c2pnb176v1,8,&(lvalues[4650]),0)
+CONST_ENTRY_NID("c2tnb191v1","c2tnb191v1",NID_X9_62_c2tnb191v1,8,&(lvalues[4658]),0)
+CONST_ENTRY_NID("c2tnb191v2","c2tnb191v2",NID_X9_62_c2tnb191v2,8,&(lvalues[4666]),0)
+CONST_ENTRY_NID("c2tnb191v3","c2tnb191v3",NID_X9_62_c2tnb191v3,8,&(lvalues[4674]),0)
+CONST_ENTRY_NID("c2onb191v4","c2onb191v4",NID_X9_62_c2onb191v4,8,&(lvalues[4682]),0)
+CONST_ENTRY_NID("c2onb191v5","c2onb191v5",NID_X9_62_c2onb191v5,8,&(lvalues[4690]),0)
+CONST_ENTRY_NID("c2pnb208w1","c2pnb208w1",NID_X9_62_c2pnb208w1,8,&(lvalues[4698]),0)
+CONST_ENTRY_NID("c2tnb239v1","c2tnb239v1",NID_X9_62_c2tnb239v1,8,&(lvalues[4706]),0)
+CONST_ENTRY_NID("c2tnb239v2","c2tnb239v2",NID_X9_62_c2tnb239v2,8,&(lvalues[4714]),0)
+CONST_ENTRY_NID("c2tnb239v3","c2tnb239v3",NID_X9_62_c2tnb239v3,8,&(lvalues[4722]),0)
+CONST_ENTRY_NID("c2onb239v4","c2onb239v4",NID_X9_62_c2onb239v4,8,&(lvalues[4730]),0)
+CONST_ENTRY_NID("c2onb239v5","c2onb239v5",NID_X9_62_c2onb239v5,8,&(lvalues[4738]),0)
+CONST_ENTRY_NID("c2pnb272w1","c2pnb272w1",NID_X9_62_c2pnb272w1,8,&(lvalues[4746]),0)
+CONST_ENTRY_NID("c2pnb304w1","c2pnb304w1",NID_X9_62_c2pnb304w1,8,&(lvalues[4754]),0)
+CONST_ENTRY_NID("c2tnb359v1","c2tnb359v1",NID_X9_62_c2tnb359v1,8,&(lvalues[4762]),0)
+CONST_ENTRY_NID("c2pnb368w1","c2pnb368w1",NID_X9_62_c2pnb368w1,8,&(lvalues[4770]),0)
+CONST_ENTRY_NID("c2tnb431r1","c2tnb431r1",NID_X9_62_c2tnb431r1,8,&(lvalues[4778]),0)
+CONST_ENTRY_NID("secp112r1","secp112r1",NID_secp112r1,5,&(lvalues[4786]),0)
+CONST_ENTRY_NID("secp112r2","secp112r2",NID_secp112r2,5,&(lvalues[4791]),0)
+CONST_ENTRY_NID("secp128r1","secp128r1",NID_secp128r1,5,&(lvalues[4796]),0)
+CONST_ENTRY_NID("secp128r2","secp128r2",NID_secp128r2,5,&(lvalues[4801]),0)
+CONST_ENTRY_NID("secp160k1","secp160k1",NID_secp160k1,5,&(lvalues[4806]),0)
+CONST_ENTRY_NID("secp160r1","secp160r1",NID_secp160r1,5,&(lvalues[4811]),0)
+CONST_ENTRY_NID("secp160r2","secp160r2",NID_secp160r2,5,&(lvalues[4816]),0)
+CONST_ENTRY_NID("secp192k1","secp192k1",NID_secp192k1,5,&(lvalues[4821]),0)
+CONST_ENTRY_NID("secp224k1","secp224k1",NID_secp224k1,5,&(lvalues[4826]),0)
+CONST_ENTRY_NID("secp224r1","secp224r1",NID_secp224r1,5,&(lvalues[4831]),0)
+CONST_ENTRY_NID("secp256k1","secp256k1",NID_secp256k1,5,&(lvalues[4836]),0)
+CONST_ENTRY_NID("secp384r1","secp384r1",NID_secp384r1,5,&(lvalues[4841]),0)
+CONST_ENTRY_NID("secp521r1","secp521r1",NID_secp521r1,5,&(lvalues[4846]),0)
+CONST_ENTRY_NID("sect113r1","sect113r1",NID_sect113r1,5,&(lvalues[4851]),0)
+CONST_ENTRY_NID("sect113r2","sect113r2",NID_sect113r2,5,&(lvalues[4856]),0)
+CONST_ENTRY_NID("sect131r1","sect131r1",NID_sect131r1,5,&(lvalues[4861]),0)
+CONST_ENTRY_NID("sect131r2","sect131r2",NID_sect131r2,5,&(lvalues[4866]),0)
+CONST_ENTRY_NID("sect163k1","sect163k1",NID_sect163k1,5,&(lvalues[4871]),0)
+CONST_ENTRY_NID("sect163r1","sect163r1",NID_sect163r1,5,&(lvalues[4876]),0)
+CONST_ENTRY_NID("sect163r2","sect163r2",NID_sect163r2,5,&(lvalues[4881]),0)
+CONST_ENTRY_NID("sect193r1","sect193r1",NID_sect193r1,5,&(lvalues[4886]),0)
+CONST_ENTRY_NID("sect193r2","sect193r2",NID_sect193r2,5,&(lvalues[4891]),0)
+CONST_ENTRY_NID("sect233k1","sect233k1",NID_sect233k1,5,&(lvalues[4896]),0)
+CONST_ENTRY_NID("sect233r1","sect233r1",NID_sect233r1,5,&(lvalues[4901]),0)
+CONST_ENTRY_NID("sect239k1","sect239k1",NID_sect239k1,5,&(lvalues[4906]),0)
+CONST_ENTRY_NID("sect283k1","sect283k1",NID_sect283k1,5,&(lvalues[4911]),0)
+CONST_ENTRY_NID("sect283r1","sect283r1",NID_sect283r1,5,&(lvalues[4916]),0)
+CONST_ENTRY_NID("sect409k1","sect409k1",NID_sect409k1,5,&(lvalues[4921]),0)
+CONST_ENTRY_NID("sect409r1","sect409r1",NID_sect409r1,5,&(lvalues[4926]),0)
+CONST_ENTRY_NID("sect571k1","sect571k1",NID_sect571k1,5,&(lvalues[4931]),0)
+CONST_ENTRY_NID("sect571r1","sect571r1",NID_sect571r1,5,&(lvalues[4936]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls1","wap-wsg-idm-ecid-wtls1",
+	NID_wap_wsg_idm_ecid_wtls1,5,&(lvalues[4941]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls3","wap-wsg-idm-ecid-wtls3",
+	NID_wap_wsg_idm_ecid_wtls3,5,&(lvalues[4946]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls4","wap-wsg-idm-ecid-wtls4",
+	NID_wap_wsg_idm_ecid_wtls4,5,&(lvalues[4951]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls5","wap-wsg-idm-ecid-wtls5",
+	NID_wap_wsg_idm_ecid_wtls5,5,&(lvalues[4956]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls6","wap-wsg-idm-ecid-wtls6",
+	NID_wap_wsg_idm_ecid_wtls6,5,&(lvalues[4961]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls7","wap-wsg-idm-ecid-wtls7",
+	NID_wap_wsg_idm_ecid_wtls7,5,&(lvalues[4966]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls8","wap-wsg-idm-ecid-wtls8",
+	NID_wap_wsg_idm_ecid_wtls8,5,&(lvalues[4971]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls9","wap-wsg-idm-ecid-wtls9",
+	NID_wap_wsg_idm_ecid_wtls9,5,&(lvalues[4976]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls10","wap-wsg-idm-ecid-wtls10",
+	NID_wap_wsg_idm_ecid_wtls10,5,&(lvalues[4981]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls11","wap-wsg-idm-ecid-wtls11",
+	NID_wap_wsg_idm_ecid_wtls11,5,&(lvalues[4986]),0)
+CONST_ENTRY_NID("wap-wsg-idm-ecid-wtls12","wap-wsg-idm-ecid-wtls12",
+	NID_wap_wsg_idm_ecid_wtls12,5,&(lvalues[4991]),0)
+CONST_ENTRY_NID("anyPolicy","X509v3 Any Policy",NID_any_policy,4,&(lvalues[4996]),0)
+CONST_ENTRY_NID("policyMappings","X509v3 Policy Mappings",NID_policy_mappings,3,
+	&(lvalues[5000]),0)
+CONST_ENTRY_NID("inhibitAnyPolicy","X509v3 Inhibit Any Policy",
+	NID_inhibit_any_policy,3,&(lvalues[5003]),0)
+CONST_ENTRY_NID("Oakley-EC2N-3","ipsec3",NID_ipsec3,0,NULL,0)
+CONST_ENTRY_NID("Oakley-EC2N-4","ipsec4",NID_ipsec4,0,NULL,0)
+CONST_ENTRY_NID("CAMELLIA-128-CBC","camellia-128-cbc",NID_camellia_128_cbc,11,
+	&(lvalues[5006]),0)
+CONST_ENTRY_NID("CAMELLIA-192-CBC","camellia-192-cbc",NID_camellia_192_cbc,11,
+	&(lvalues[5017]),0)
+CONST_ENTRY_NID("CAMELLIA-256-CBC","camellia-256-cbc",NID_camellia_256_cbc,11,
+	&(lvalues[5028]),0)
+CONST_ENTRY_NID("CAMELLIA-128-ECB","camellia-128-ecb",NID_camellia_128_ecb,8,
+	&(lvalues[5039]),0)
+CONST_ENTRY_NID("CAMELLIA-192-ECB","camellia-192-ecb",NID_camellia_192_ecb,8,
+	&(lvalues[5047]),0)
+CONST_ENTRY_NID("CAMELLIA-256-ECB","camellia-256-ecb",NID_camellia_256_ecb,8,
+	&(lvalues[5055]),0)
+CONST_ENTRY_NID("CAMELLIA-128-CFB","camellia-128-cfb",NID_camellia_128_cfb128,8,
+	&(lvalues[5063]),0)
+CONST_ENTRY_NID("CAMELLIA-192-CFB","camellia-192-cfb",NID_camellia_192_cfb128,8,
+	&(lvalues[5071]),0)
+CONST_ENTRY_NID("CAMELLIA-256-CFB","camellia-256-cfb",NID_camellia_256_cfb128,8,
+	&(lvalues[5079]),0)
+CONST_ENTRY_NID("CAMELLIA-128-CFB1","camellia-128-cfb1",NID_camellia_128_cfb1,0,NULL,0)
+CONST_ENTRY_NID("CAMELLIA-192-CFB1","camellia-192-cfb1",NID_camellia_192_cfb1,0,NULL,0)
+CONST_ENTRY_NID("CAMELLIA-256-CFB1","camellia-256-cfb1",NID_camellia_256_cfb1,0,NULL,0)
+CONST_ENTRY_NID("CAMELLIA-128-CFB8","camellia-128-cfb8",NID_camellia_128_cfb8,0,NULL,0)
+CONST_ENTRY_NID("CAMELLIA-192-CFB8","camellia-192-cfb8",NID_camellia_192_cfb8,0,NULL,0)
+CONST_ENTRY_NID("CAMELLIA-256-CFB8","camellia-256-cfb8",NID_camellia_256_cfb8,0,NULL,0)
+CONST_ENTRY_NID("CAMELLIA-128-OFB","camellia-128-ofb",NID_camellia_128_ofb128,8,
+	&(lvalues[5087]),0)
+CONST_ENTRY_NID("CAMELLIA-192-OFB","camellia-192-ofb",NID_camellia_192_ofb128,8,
+	&(lvalues[5095]),0)
+CONST_ENTRY_NID("CAMELLIA-256-OFB","camellia-256-ofb",NID_camellia_256_ofb128,8,
+	&(lvalues[5103]),0)
+CONST_ENTRY_NID("subjectDirectoryAttributes","X509v3 Subject Directory Attributes",
+	NID_subject_directory_attributes,3,&(lvalues[5111]),0)
+CONST_ENTRY_NID("issuingDistributionPoint","X509v3 Issuing Distrubution Point",
+	NID_issuing_distribution_point,3,&(lvalues[5114]),0)
+CONST_ENTRY_NID("certificateIssuer","X509v3 Certificate Issuer",
+	NID_certificate_issuer,3,&(lvalues[5117]),0)
+CONST_ENTRY_NID(NULL,NULL,NID_undef,0,NULL,0)
+CONST_ENTRY_NID("KISA","kisa",NID_kisa,6,&(lvalues[5120]),0)
+CONST_ENTRY_NID(NULL,NULL,NID_undef,0,NULL,0)
+CONST_ENTRY_NID(NULL,NULL,NID_undef,0,NULL,0)
+CONST_ENTRY_NID("SEED-ECB","seed-ecb",NID_seed_ecb,8,&(lvalues[5126]),0)
+CONST_ENTRY_NID("SEED-CBC","seed-cbc",NID_seed_cbc,8,&(lvalues[5134]),0)
+CONST_ENTRY_NID("SEED-OFB","seed-ofb",NID_seed_ofb128,8,&(lvalues[5142]),0)
+CONST_ENTRY_NID("SEED-CFB","seed-cfb",NID_seed_cfb128,8,&(lvalues[5150]),0)
+CONST_ENTRY_NID("HMAC-MD5","hmac-md5",NID_hmac_md5,8,&(lvalues[5158]),0)
+CONST_ENTRY_NID("HMAC-SHA1","hmac-sha1",NID_hmac_sha1,8,&(lvalues[5166]),0)
+CONST_ENTRY_NID("id-PasswordBasedMAC","password based MAC",NID_id_PasswordBasedMAC,9,
+	&(lvalues[5174]),0)
+CONST_ENTRY_NID("id-DHBasedMac","Diffie-Hellman based MAC",NID_id_DHBasedMac,9,
+	&(lvalues[5183]),0)
+CONST_ENTRY_NID("id-it-suppLangTags","id-it-suppLangTags",NID_id_it_suppLangTags,8,
+	&(lvalues[5192]),0)
+CONST_ENTRY_NID("caRepository","CA Repository",NID_caRepository,8,&(lvalues[5200]),0)
+CONST_ENTRY_NID("id-smime-ct-compressedData","id-smime-ct-compressedData",
+	NID_id_smime_ct_compressedData,11,&(lvalues[5208]),0)
+CONST_ENTRY_NID("id-ct-asciiTextWithCRLF","id-ct-asciiTextWithCRLF",
+	NID_id_ct_asciiTextWithCRLF,11,&(lvalues[5219]),0)
+CONST_ENTRY_NID("id-aes128-wrap","id-aes128-wrap",NID_id_aes128_wrap,9,
+	&(lvalues[5230]),0)
+CONST_ENTRY_NID("id-aes192-wrap","id-aes192-wrap",NID_id_aes192_wrap,9,
+	&(lvalues[5239]),0)
+CONST_ENTRY_NID("id-aes256-wrap","id-aes256-wrap",NID_id_aes256_wrap,9,
+	&(lvalues[5248]),0)
+CONST_ENTRY_NID("ecdsa-with-Recommended","ecdsa-with-Recommended",
+	NID_ecdsa_with_Recommended,7,&(lvalues[5257]),0)
+CONST_ENTRY_NID("ecdsa-with-Specified","ecdsa-with-Specified",
+	NID_ecdsa_with_Specified,7,&(lvalues[5264]),0)
+CONST_ENTRY_NID("ecdsa-with-SHA224","ecdsa-with-SHA224",NID_ecdsa_with_SHA224,8,
+	&(lvalues[5271]),0)
+CONST_ENTRY_NID("ecdsa-with-SHA256","ecdsa-with-SHA256",NID_ecdsa_with_SHA256,8,
+	&(lvalues[5279]),0)
+CONST_ENTRY_NID("ecdsa-with-SHA384","ecdsa-with-SHA384",NID_ecdsa_with_SHA384,8,
+	&(lvalues[5287]),0)
+CONST_ENTRY_NID("ecdsa-with-SHA512","ecdsa-with-SHA512",NID_ecdsa_with_SHA512,8,
+	&(lvalues[5295]),0)
+CONST_ENTRY_NID("hmacWithMD5","hmacWithMD5",NID_hmacWithMD5,8,&(lvalues[5303]),0)
+CONST_ENTRY_NID("hmacWithSHA224","hmacWithSHA224",NID_hmacWithSHA224,8,
+	&(lvalues[5311]),0)
+CONST_ENTRY_NID("hmacWithSHA256","hmacWithSHA256",NID_hmacWithSHA256,8,
+	&(lvalues[5319]),0)
+CONST_ENTRY_NID("hmacWithSHA384","hmacWithSHA384",NID_hmacWithSHA384,8,
+	&(lvalues[5327]),0)
+CONST_ENTRY_NID("hmacWithSHA512","hmacWithSHA512",NID_hmacWithSHA512,8,
+	&(lvalues[5335]),0)
+CONST_ENTRY_NID("dsa_with_SHA224","dsa_with_SHA224",NID_dsa_with_SHA224,9,
+	&(lvalues[5343]),0)
+CONST_ENTRY_NID("dsa_with_SHA256","dsa_with_SHA256",NID_dsa_with_SHA256,9,
+	&(lvalues[5352]),0)
+CONST_ENTRY_NID("whirlpool","whirlpool",NID_whirlpool,6,&(lvalues[5361]),0)
+CONST_ENTRY_NID("cryptopro","cryptopro",NID_cryptopro,5,&(lvalues[5367]),0)
+CONST_ENTRY_NID("cryptocom","cryptocom",NID_cryptocom,5,&(lvalues[5372]),0)
+CONST_ENTRY_NID("id-GostR3411-94-with-GostR3410-2001",
+	"GOST R 34.11-94 with GOST R 34.10-2001",NID_id_GostR3411_94_with_GostR3410_2001,6,
+	&(lvalues[5377]),0)
+CONST_ENTRY_NID("id-GostR3411-94-with-GostR3410-94",
+	"GOST R 34.11-94 with GOST R 34.10-94",NID_id_GostR3411_94_with_GostR3410_94,6,
+	&(lvalues[5383]),0)
+CONST_ENTRY_NID("md_gost94","GOST R 34.11-94",NID_id_GostR3411_94,6,&(lvalues[5389]),0)
+CONST_ENTRY_NID("id-HMACGostR3411-94","HMAC GOST 34.11-94",NID_id_HMACGostR3411_94,6,
+	&(lvalues[5395]),0)
+CONST_ENTRY_NID("gost2001","GOST R 34.10-2001",NID_id_GostR3410_2001,6,
+	&(lvalues[5401]),0)
+CONST_ENTRY_NID("gost94","GOST R 34.10-94",NID_id_GostR3410_94,6,&(lvalues[5407]),0)
+CONST_ENTRY_NID("gost89","GOST 28147-89",NID_id_Gost28147_89,6,&(lvalues[5413]),0)
+CONST_ENTRY_NID("gost89-cnt","gost89-cnt",NID_gost89_cnt,0,NULL,0)
+CONST_ENTRY_NID("gost-mac","GOST 28147-89 MAC",NID_id_Gost28147_89_MAC,6,
+	&(lvalues[5419]),0)
+CONST_ENTRY_NID("prf-gostr3411-94","GOST R 34.11-94 PRF",NID_id_GostR3411_94_prf,6,
+	&(lvalues[5425]),0)
+CONST_ENTRY_NID("id-GostR3410-2001DH","GOST R 34.10-2001 DH",NID_id_GostR3410_2001DH,
+	6,&(lvalues[5431]),0)
+CONST_ENTRY_NID("id-GostR3410-94DH","GOST R 34.10-94 DH",NID_id_GostR3410_94DH,6,
+	&(lvalues[5437]),0)
+CONST_ENTRY_NID("id-Gost28147-89-CryptoPro-KeyMeshing",
+	"id-Gost28147-89-CryptoPro-KeyMeshing",NID_id_Gost28147_89_CryptoPro_KeyMeshing,7,
+	&(lvalues[5443]),0)
+CONST_ENTRY_NID("id-Gost28147-89-None-KeyMeshing","id-Gost28147-89-None-KeyMeshing",
+	NID_id_Gost28147_89_None_KeyMeshing,7,&(lvalues[5450]),0)
+CONST_ENTRY_NID("id-GostR3411-94-TestParamSet","id-GostR3411-94-TestParamSet",
+	NID_id_GostR3411_94_TestParamSet,7,&(lvalues[5457]),0)
+CONST_ENTRY_NID("id-GostR3411-94-CryptoProParamSet",
+	"id-GostR3411-94-CryptoProParamSet",NID_id_GostR3411_94_CryptoProParamSet,7,
+	&(lvalues[5464]),0)
+CONST_ENTRY_NID("id-Gost28147-89-TestParamSet","id-Gost28147-89-TestParamSet",
+	NID_id_Gost28147_89_TestParamSet,7,&(lvalues[5471]),0)
+CONST_ENTRY_NID("id-Gost28147-89-CryptoPro-A-ParamSet",
+	"id-Gost28147-89-CryptoPro-A-ParamSet",NID_id_Gost28147_89_CryptoPro_A_ParamSet,7,
+	&(lvalues[5478]),0)
+CONST_ENTRY_NID("id-Gost28147-89-CryptoPro-B-ParamSet",
+	"id-Gost28147-89-CryptoPro-B-ParamSet",NID_id_Gost28147_89_CryptoPro_B_ParamSet,7,
+	&(lvalues[5485]),0)
+CONST_ENTRY_NID("id-Gost28147-89-CryptoPro-C-ParamSet",
+	"id-Gost28147-89-CryptoPro-C-ParamSet",NID_id_Gost28147_89_CryptoPro_C_ParamSet,7,
+	&(lvalues[5492]),0)
+CONST_ENTRY_NID("id-Gost28147-89-CryptoPro-D-ParamSet",
+	"id-Gost28147-89-CryptoPro-D-ParamSet",NID_id_Gost28147_89_CryptoPro_D_ParamSet,7,
+	&(lvalues[5499]),0)
+CONST_ENTRY_NID("id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet",
 	"id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet",
-	NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet,7,&(lvalues[5506]),
-	0},
-{"id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet",
+	NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet,7,&(lvalues[5506]),0)
+CONST_ENTRY_NID("id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet",
 	"id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet",
-	NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet,7,&(lvalues[5513]),
-	0},
-{"id-Gost28147-89-CryptoPro-RIC-1-ParamSet",
+	NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet,7,&(lvalues[5513]),0)
+CONST_ENTRY_NID("id-Gost28147-89-CryptoPro-RIC-1-ParamSet",
 	"id-Gost28147-89-CryptoPro-RIC-1-ParamSet",
-	NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet,7,&(lvalues[5520]),0},
-{"id-GostR3410-94-TestParamSet","id-GostR3410-94-TestParamSet",
-	NID_id_GostR3410_94_TestParamSet,7,&(lvalues[5527]),0},
-{"id-GostR3410-94-CryptoPro-A-ParamSet",
-	"id-GostR3410-94-CryptoPro-A-ParamSet",
-	NID_id_GostR3410_94_CryptoPro_A_ParamSet,7,&(lvalues[5534]),0},
-{"id-GostR3410-94-CryptoPro-B-ParamSet",
-	"id-GostR3410-94-CryptoPro-B-ParamSet",
-	NID_id_GostR3410_94_CryptoPro_B_ParamSet,7,&(lvalues[5541]),0},
-{"id-GostR3410-94-CryptoPro-C-ParamSet",
-	"id-GostR3410-94-CryptoPro-C-ParamSet",
-	NID_id_GostR3410_94_CryptoPro_C_ParamSet,7,&(lvalues[5548]),0},
-{"id-GostR3410-94-CryptoPro-D-ParamSet",
-	"id-GostR3410-94-CryptoPro-D-ParamSet",
-	NID_id_GostR3410_94_CryptoPro_D_ParamSet,7,&(lvalues[5555]),0},
-{"id-GostR3410-94-CryptoPro-XchA-ParamSet",
+	NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet,7,&(lvalues[5520]),0)
+CONST_ENTRY_NID("id-GostR3410-94-TestParamSet","id-GostR3410-94-TestParamSet",
+	NID_id_GostR3410_94_TestParamSet,7,&(lvalues[5527]),0)
+CONST_ENTRY_NID("id-GostR3410-94-CryptoPro-A-ParamSet",
+	"id-GostR3410-94-CryptoPro-A-ParamSet",NID_id_GostR3410_94_CryptoPro_A_ParamSet,7,
+	&(lvalues[5534]),0)
+CONST_ENTRY_NID("id-GostR3410-94-CryptoPro-B-ParamSet",
+	"id-GostR3410-94-CryptoPro-B-ParamSet",NID_id_GostR3410_94_CryptoPro_B_ParamSet,7,
+	&(lvalues[5541]),0)
+CONST_ENTRY_NID("id-GostR3410-94-CryptoPro-C-ParamSet",
+	"id-GostR3410-94-CryptoPro-C-ParamSet",NID_id_GostR3410_94_CryptoPro_C_ParamSet,7,
+	&(lvalues[5548]),0)
+CONST_ENTRY_NID("id-GostR3410-94-CryptoPro-D-ParamSet",
+	"id-GostR3410-94-CryptoPro-D-ParamSet",NID_id_GostR3410_94_CryptoPro_D_ParamSet,7,
+	&(lvalues[5555]),0)
+CONST_ENTRY_NID("id-GostR3410-94-CryptoPro-XchA-ParamSet",
 	"id-GostR3410-94-CryptoPro-XchA-ParamSet",
-	NID_id_GostR3410_94_CryptoPro_XchA_ParamSet,7,&(lvalues[5562]),0},
-{"id-GostR3410-94-CryptoPro-XchB-ParamSet",
+	NID_id_GostR3410_94_CryptoPro_XchA_ParamSet,7,&(lvalues[5562]),0)
+CONST_ENTRY_NID("id-GostR3410-94-CryptoPro-XchB-ParamSet",
 	"id-GostR3410-94-CryptoPro-XchB-ParamSet",
-	NID_id_GostR3410_94_CryptoPro_XchB_ParamSet,7,&(lvalues[5569]),0},
-{"id-GostR3410-94-CryptoPro-XchC-ParamSet",
+	NID_id_GostR3410_94_CryptoPro_XchB_ParamSet,7,&(lvalues[5569]),0)
+CONST_ENTRY_NID("id-GostR3410-94-CryptoPro-XchC-ParamSet",
 	"id-GostR3410-94-CryptoPro-XchC-ParamSet",
-	NID_id_GostR3410_94_CryptoPro_XchC_ParamSet,7,&(lvalues[5576]),0},
-{"id-GostR3410-2001-TestParamSet","id-GostR3410-2001-TestParamSet",
-	NID_id_GostR3410_2001_TestParamSet,7,&(lvalues[5583]),0},
-{"id-GostR3410-2001-CryptoPro-A-ParamSet",
-	"id-GostR3410-2001-CryptoPro-A-ParamSet",
-	NID_id_GostR3410_2001_CryptoPro_A_ParamSet,7,&(lvalues[5590]),0},
-{"id-GostR3410-2001-CryptoPro-B-ParamSet",
-	"id-GostR3410-2001-CryptoPro-B-ParamSet",
-	NID_id_GostR3410_2001_CryptoPro_B_ParamSet,7,&(lvalues[5597]),0},
-{"id-GostR3410-2001-CryptoPro-C-ParamSet",
-	"id-GostR3410-2001-CryptoPro-C-ParamSet",
-	NID_id_GostR3410_2001_CryptoPro_C_ParamSet,7,&(lvalues[5604]),0},
-{"id-GostR3410-2001-CryptoPro-XchA-ParamSet",
+	NID_id_GostR3410_94_CryptoPro_XchC_ParamSet,7,&(lvalues[5576]),0)
+CONST_ENTRY_NID("id-GostR3410-2001-TestParamSet","id-GostR3410-2001-TestParamSet",
+	NID_id_GostR3410_2001_TestParamSet,7,&(lvalues[5583]),0)
+CONST_ENTRY_NID("id-GostR3410-2001-CryptoPro-A-ParamSet",
+	"id-GostR3410-2001-CryptoPro-A-ParamSet",NID_id_GostR3410_2001_CryptoPro_A_ParamSet,
+	7,&(lvalues[5590]),0)
+CONST_ENTRY_NID("id-GostR3410-2001-CryptoPro-B-ParamSet",
+	"id-GostR3410-2001-CryptoPro-B-ParamSet",NID_id_GostR3410_2001_CryptoPro_B_ParamSet,
+	7,&(lvalues[5597]),0)
+CONST_ENTRY_NID("id-GostR3410-2001-CryptoPro-C-ParamSet",
+	"id-GostR3410-2001-CryptoPro-C-ParamSet",NID_id_GostR3410_2001_CryptoPro_C_ParamSet,
+	7,&(lvalues[5604]),0)
+CONST_ENTRY_NID("id-GostR3410-2001-CryptoPro-XchA-ParamSet",
 	"id-GostR3410-2001-CryptoPro-XchA-ParamSet",
-	NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet,7,&(lvalues[5611]),0},
-	
-{"id-GostR3410-2001-CryptoPro-XchB-ParamSet",
+	NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet,7,&(lvalues[5611]),0)
+CONST_ENTRY_NID("id-GostR3410-2001-CryptoPro-XchB-ParamSet",
 	"id-GostR3410-2001-CryptoPro-XchB-ParamSet",
-	NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet,7,&(lvalues[5618]),0},
-	
-{"id-GostR3410-94-a","id-GostR3410-94-a",NID_id_GostR3410_94_a,7,
-	&(lvalues[5625]),0},
-{"id-GostR3410-94-aBis","id-GostR3410-94-aBis",
-	NID_id_GostR3410_94_aBis,7,&(lvalues[5632]),0},
-{"id-GostR3410-94-b","id-GostR3410-94-b",NID_id_GostR3410_94_b,7,
-	&(lvalues[5639]),0},
-{"id-GostR3410-94-bBis","id-GostR3410-94-bBis",
-	NID_id_GostR3410_94_bBis,7,&(lvalues[5646]),0},
-{"id-Gost28147-89-cc","GOST 28147-89 Cryptocom ParamSet",
-	NID_id_Gost28147_89_cc,8,&(lvalues[5653]),0},
-{"gost94cc","GOST 34.10-94 Cryptocom",NID_id_GostR3410_94_cc,8,
-	&(lvalues[5661]),0},
-{"gost2001cc","GOST 34.10-2001 Cryptocom",NID_id_GostR3410_2001_cc,8,
-	&(lvalues[5669]),0},
-{"id-GostR3411-94-with-GostR3410-94-cc",
+	NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet,7,&(lvalues[5618]),0)
+CONST_ENTRY_NID("id-GostR3410-94-a","id-GostR3410-94-a",NID_id_GostR3410_94_a,7,
+	&(lvalues[5625]),0)
+CONST_ENTRY_NID("id-GostR3410-94-aBis","id-GostR3410-94-aBis",
+	NID_id_GostR3410_94_aBis,7,&(lvalues[5632]),0)
+CONST_ENTRY_NID("id-GostR3410-94-b","id-GostR3410-94-b",NID_id_GostR3410_94_b,7,
+	&(lvalues[5639]),0)
+CONST_ENTRY_NID("id-GostR3410-94-bBis","id-GostR3410-94-bBis",
+	NID_id_GostR3410_94_bBis,7,&(lvalues[5646]),0)
+CONST_ENTRY_NID("id-Gost28147-89-cc","GOST 28147-89 Cryptocom ParamSet",
+	NID_id_Gost28147_89_cc,8,&(lvalues[5653]),0)
+CONST_ENTRY_NID("gost94cc","GOST 34.10-94 Cryptocom",NID_id_GostR3410_94_cc,8,
+	&(lvalues[5661]),0)
+CONST_ENTRY_NID("gost2001cc","GOST 34.10-2001 Cryptocom",NID_id_GostR3410_2001_cc,8,
+	&(lvalues[5669]),0)
+CONST_ENTRY_NID("id-GostR3411-94-with-GostR3410-94-cc",
 	"GOST R 34.11-94 with GOST R 34.10-94 Cryptocom",
-	NID_id_GostR3411_94_with_GostR3410_94_cc,8,&(lvalues[5677]),0},
-{"id-GostR3411-94-with-GostR3410-2001-cc",
+	NID_id_GostR3411_94_with_GostR3410_94_cc,8,&(lvalues[5677]),0)
+CONST_ENTRY_NID("id-GostR3411-94-with-GostR3410-2001-cc",
 	"GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom",
-	NID_id_GostR3411_94_with_GostR3410_2001_cc,8,&(lvalues[5685]),0},
-{"id-GostR3410-2001-ParamSet-cc",
-	"GOST R 3410-2001 Parameter Set Cryptocom",
-	NID_id_GostR3410_2001_ParamSet_cc,8,&(lvalues[5693]),0},
-{"HMAC","hmac",NID_hmac,0,NULL,0},
-{"LocalKeySet","Microsoft Local Key set",NID_LocalKeySet,9,
-	&(lvalues[5701]),0},
-{"freshestCRL","X509v3 Freshest CRL",NID_freshest_crl,3,
-	&(lvalues[5710]),0},
-{"id-on-permanentIdentifier","Permanent Identifier",
-	NID_id_on_permanentIdentifier,8,&(lvalues[5713]),0},
-{"searchGuide","searchGuide",NID_searchGuide,3,&(lvalues[5721]),0},
-{"businessCategory","businessCategory",NID_businessCategory,3,
-	&(lvalues[5724]),0},
-{"postalAddress","postalAddress",NID_postalAddress,3,&(lvalues[5727]),0},
-{"postOfficeBox","postOfficeBox",NID_postOfficeBox,3,&(lvalues[5730]),0},
-{"physicalDeliveryOfficeName","physicalDeliveryOfficeName",
-	NID_physicalDeliveryOfficeName,3,&(lvalues[5733]),0},
-{"telephoneNumber","telephoneNumber",NID_telephoneNumber,3,
-	&(lvalues[5736]),0},
-{"telexNumber","telexNumber",NID_telexNumber,3,&(lvalues[5739]),0},
-{"teletexTerminalIdentifier","teletexTerminalIdentifier",
-	NID_teletexTerminalIdentifier,3,&(lvalues[5742]),0},
-{"facsimileTelephoneNumber","facsimileTelephoneNumber",
-	NID_facsimileTelephoneNumber,3,&(lvalues[5745]),0},
-{"x121Address","x121Address",NID_x121Address,3,&(lvalues[5748]),0},
-{"internationaliSDNNumber","internationaliSDNNumber",
-	NID_internationaliSDNNumber,3,&(lvalues[5751]),0},
-{"registeredAddress","registeredAddress",NID_registeredAddress,3,
-	&(lvalues[5754]),0},
-{"destinationIndicator","destinationIndicator",
-	NID_destinationIndicator,3,&(lvalues[5757]),0},
-{"preferredDeliveryMethod","preferredDeliveryMethod",
-	NID_preferredDeliveryMethod,3,&(lvalues[5760]),0},
-{"presentationAddress","presentationAddress",NID_presentationAddress,
-	3,&(lvalues[5763]),0},
-{"supportedApplicationContext","supportedApplicationContext",
-	NID_supportedApplicationContext,3,&(lvalues[5766]),0},
-{"member","member",NID_member,3,&(lvalues[5769]),0},
-{"owner","owner",NID_owner,3,&(lvalues[5772]),0},
-{"roleOccupant","roleOccupant",NID_roleOccupant,3,&(lvalues[5775]),0},
-{"seeAlso","seeAlso",NID_seeAlso,3,&(lvalues[5778]),0},
-{"userPassword","userPassword",NID_userPassword,3,&(lvalues[5781]),0},
-{"userCertificate","userCertificate",NID_userCertificate,3,
-	&(lvalues[5784]),0},
-{"cACertificate","cACertificate",NID_cACertificate,3,&(lvalues[5787]),0},
-{"authorityRevocationList","authorityRevocationList",
-	NID_authorityRevocationList,3,&(lvalues[5790]),0},
-{"certificateRevocationList","certificateRevocationList",
-	NID_certificateRevocationList,3,&(lvalues[5793]),0},
-{"crossCertificatePair","crossCertificatePair",
-	NID_crossCertificatePair,3,&(lvalues[5796]),0},
-{"enhancedSearchGuide","enhancedSearchGuide",NID_enhancedSearchGuide,
-	3,&(lvalues[5799]),0},
-{"protocolInformation","protocolInformation",NID_protocolInformation,
-	3,&(lvalues[5802]),0},
-{"distinguishedName","distinguishedName",NID_distinguishedName,3,
-	&(lvalues[5805]),0},
-{"uniqueMember","uniqueMember",NID_uniqueMember,3,&(lvalues[5808]),0},
-{"houseIdentifier","houseIdentifier",NID_houseIdentifier,3,
-	&(lvalues[5811]),0},
-{"supportedAlgorithms","supportedAlgorithms",NID_supportedAlgorithms,
-	3,&(lvalues[5814]),0},
-{"deltaRevocationList","deltaRevocationList",NID_deltaRevocationList,
-	3,&(lvalues[5817]),0},
-{"dmdName","dmdName",NID_dmdName,3,&(lvalues[5820]),0},
-};
+	NID_id_GostR3411_94_with_GostR3410_2001_cc,8,&(lvalues[5685]),0)
+CONST_ENTRY_NID("id-GostR3410-2001-ParamSet-cc",
+	"GOST R 3410-2001 Parameter Set Cryptocom",NID_id_GostR3410_2001_ParamSet_cc,8,
+	&(lvalues[5693]),0)
+CONST_ENTRY_NID("HMAC","hmac",NID_hmac,0,NULL,0)
+CONST_ENTRY_NID("LocalKeySet","Microsoft Local Key set",NID_LocalKeySet,9,
+	&(lvalues[5701]),0)
+CONST_ENTRY_NID("freshestCRL","X509v3 Freshest CRL",NID_freshest_crl,3,
+	&(lvalues[5710]),0)
+CONST_ENTRY_NID("id-on-permanentIdentifier","Permanent Identifier",
+	NID_id_on_permanentIdentifier,8,&(lvalues[5713]),0)
+CONST_ENTRY_NID("searchGuide","searchGuide",NID_searchGuide,3,&(lvalues[5721]),0)
+CONST_ENTRY_NID("businessCategory","businessCategory",NID_businessCategory,3,
+	&(lvalues[5724]),0)
+CONST_ENTRY_NID("postalAddress","postalAddress",NID_postalAddress,3,&(lvalues[5727]),0)
+CONST_ENTRY_NID("postOfficeBox","postOfficeBox",NID_postOfficeBox,3,&(lvalues[5730]),0)
+CONST_ENTRY_NID("physicalDeliveryOfficeName","physicalDeliveryOfficeName",
+	NID_physicalDeliveryOfficeName,3,&(lvalues[5733]),0)
+CONST_ENTRY_NID("telephoneNumber","telephoneNumber",NID_telephoneNumber,3,
+	&(lvalues[5736]),0)
+CONST_ENTRY_NID("telexNumber","telexNumber",NID_telexNumber,3,&(lvalues[5739]),0)
+CONST_ENTRY_NID("teletexTerminalIdentifier","teletexTerminalIdentifier",
+	NID_teletexTerminalIdentifier,3,&(lvalues[5742]),0)
+CONST_ENTRY_NID("facsimileTelephoneNumber","facsimileTelephoneNumber",
+	NID_facsimileTelephoneNumber,3,&(lvalues[5745]),0)
+CONST_ENTRY_NID("x121Address","x121Address",NID_x121Address,3,&(lvalues[5748]),0)
+CONST_ENTRY_NID("internationaliSDNNumber","internationaliSDNNumber",
+	NID_internationaliSDNNumber,3,&(lvalues[5751]),0)
+CONST_ENTRY_NID("registeredAddress","registeredAddress",NID_registeredAddress,3,
+	&(lvalues[5754]),0)
+CONST_ENTRY_NID("destinationIndicator","destinationIndicator",
+	NID_destinationIndicator,3,&(lvalues[5757]),0)
+CONST_ENTRY_NID("preferredDeliveryMethod","preferredDeliveryMethod",
+	NID_preferredDeliveryMethod,3,&(lvalues[5760]),0)
+CONST_ENTRY_NID("presentationAddress","presentationAddress",NID_presentationAddress,
+	3,&(lvalues[5763]),0)
+CONST_ENTRY_NID("supportedApplicationContext","supportedApplicationContext",
+	NID_supportedApplicationContext,3,&(lvalues[5766]),0)
+CONST_ENTRY_NID("member","member",NID_member,3,&(lvalues[5769]),0)
+CONST_ENTRY_NID("owner","owner",NID_owner,3,&(lvalues[5772]),0)
+CONST_ENTRY_NID("roleOccupant","roleOccupant",NID_roleOccupant,3,&(lvalues[5775]),0)
+CONST_ENTRY_NID("seeAlso","seeAlso",NID_seeAlso,3,&(lvalues[5778]),0)
+CONST_ENTRY_NID("userPassword","userPassword",NID_userPassword,3,&(lvalues[5781]),0)
+CONST_ENTRY_NID("userCertificate","userCertificate",NID_userCertificate,3,
+	&(lvalues[5784]),0)
+CONST_ENTRY_NID("cACertificate","cACertificate",NID_cACertificate,3,&(lvalues[5787]),0)
+CONST_ENTRY_NID("authorityRevocationList","authorityRevocationList",
+	NID_authorityRevocationList,3,&(lvalues[5790]),0)
+CONST_ENTRY_NID("certificateRevocationList","certificateRevocationList",
+	NID_certificateRevocationList,3,&(lvalues[5793]),0)
+CONST_ENTRY_NID("crossCertificatePair","crossCertificatePair",
+	NID_crossCertificatePair,3,&(lvalues[5796]),0)
+CONST_ENTRY_NID("enhancedSearchGuide","enhancedSearchGuide",NID_enhancedSearchGuide,
+	3,&(lvalues[5799]),0)
+CONST_ENTRY_NID("protocolInformation","protocolInformation",NID_protocolInformation,
+	3,&(lvalues[5802]),0)
+CONST_ENTRY_NID("distinguishedName","distinguishedName",NID_distinguishedName,3,
+	&(lvalues[5805]),0)
+CONST_ENTRY_NID("uniqueMember","uniqueMember",NID_uniqueMember,3,&(lvalues[5808]),0)
+CONST_ENTRY_NID("houseIdentifier","houseIdentifier",NID_houseIdentifier,3,
+	&(lvalues[5811]),0)
+CONST_ENTRY_NID("supportedAlgorithms","supportedAlgorithms",NID_supportedAlgorithms,
+	3,&(lvalues[5814]),0)
+CONST_ENTRY_NID("deltaRevocationList","deltaRevocationList",NID_deltaRevocationList,
+	3,&(lvalues[5817]),0)
+CONST_ENTRY_NID("dmdName","dmdName",NID_dmdName,3,&(lvalues[5820]),0)
+CONST_END(nid_objs);
+
+#define nid_objs OPENSSL_GLOBAL_ARRAY_NAME(nid_objs)
+
+#ifndef OPERA_SMALL_VERSION
+OPENSSL_PREFIX_CONST_ARRAY(static, unsigned int, sn_objs, libopeay)
+CONST_ENTRY(364)	/* "AD_DVCS" */
+CONST_ENTRY(419)	/* "AES-128-CBC" */
+CONST_ENTRY(421)	/* "AES-128-CFB" */
+CONST_ENTRY(650)	/* "AES-128-CFB1" */
+CONST_ENTRY(653)	/* "AES-128-CFB8" */
+CONST_ENTRY(418)	/* "AES-128-ECB" */
+CONST_ENTRY(420)	/* "AES-128-OFB" */
+CONST_ENTRY(423)	/* "AES-192-CBC" */
+CONST_ENTRY(425)	/* "AES-192-CFB" */
+CONST_ENTRY(651)	/* "AES-192-CFB1" */
+CONST_ENTRY(654)	/* "AES-192-CFB8" */
+CONST_ENTRY(422)	/* "AES-192-ECB" */
+CONST_ENTRY(424)	/* "AES-192-OFB" */
+CONST_ENTRY(427)	/* "AES-256-CBC" */
+CONST_ENTRY(429)	/* "AES-256-CFB" */
+CONST_ENTRY(652)	/* "AES-256-CFB1" */
+CONST_ENTRY(655)	/* "AES-256-CFB8" */
+CONST_ENTRY(426)	/* "AES-256-ECB" */
+CONST_ENTRY(428)	/* "AES-256-OFB" */
+CONST_ENTRY(91)	/* "BF-CBC" */
+CONST_ENTRY(93)	/* "BF-CFB" */
+CONST_ENTRY(92)	/* "BF-ECB" */
+CONST_ENTRY(94)	/* "BF-OFB" */
+CONST_ENTRY(14)	/* "C" */
+CONST_ENTRY(751)	/* "CAMELLIA-128-CBC" */
+CONST_ENTRY(757)	/* "CAMELLIA-128-CFB" */
+CONST_ENTRY(760)	/* "CAMELLIA-128-CFB1" */
+CONST_ENTRY(763)	/* "CAMELLIA-128-CFB8" */
+CONST_ENTRY(754)	/* "CAMELLIA-128-ECB" */
+CONST_ENTRY(766)	/* "CAMELLIA-128-OFB" */
+CONST_ENTRY(752)	/* "CAMELLIA-192-CBC" */
+CONST_ENTRY(758)	/* "CAMELLIA-192-CFB" */
+CONST_ENTRY(761)	/* "CAMELLIA-192-CFB1" */
+CONST_ENTRY(764)	/* "CAMELLIA-192-CFB8" */
+CONST_ENTRY(755)	/* "CAMELLIA-192-ECB" */
+CONST_ENTRY(767)	/* "CAMELLIA-192-OFB" */
+CONST_ENTRY(753)	/* "CAMELLIA-256-CBC" */
+CONST_ENTRY(759)	/* "CAMELLIA-256-CFB" */
+CONST_ENTRY(762)	/* "CAMELLIA-256-CFB1" */
+CONST_ENTRY(765)	/* "CAMELLIA-256-CFB8" */
+CONST_ENTRY(756)	/* "CAMELLIA-256-ECB" */
+CONST_ENTRY(768)	/* "CAMELLIA-256-OFB" */
+CONST_ENTRY(108)	/* "CAST5-CBC" */
+CONST_ENTRY(110)	/* "CAST5-CFB" */
+CONST_ENTRY(109)	/* "CAST5-ECB" */
+CONST_ENTRY(111)	/* "CAST5-OFB" */
+CONST_ENTRY(13)	/* "CN" */
+CONST_ENTRY(141)	/* "CRLReason" */
+CONST_ENTRY(417)	/* "CSPName" */
+CONST_ENTRY(367)	/* "CrlID" */
+CONST_ENTRY(391)	/* "DC" */
+CONST_ENTRY(31)	/* "DES-CBC" */
+CONST_ENTRY(643)	/* "DES-CDMF" */
+CONST_ENTRY(30)	/* "DES-CFB" */
+CONST_ENTRY(656)	/* "DES-CFB1" */
+CONST_ENTRY(657)	/* "DES-CFB8" */
+CONST_ENTRY(29)	/* "DES-ECB" */
+CONST_ENTRY(32)	/* "DES-EDE" */
+CONST_ENTRY(43)	/* "DES-EDE-CBC" */
+CONST_ENTRY(60)	/* "DES-EDE-CFB" */
+CONST_ENTRY(62)	/* "DES-EDE-OFB" */
+CONST_ENTRY(33)	/* "DES-EDE3" */
+CONST_ENTRY(44)	/* "DES-EDE3-CBC" */
+CONST_ENTRY(61)	/* "DES-EDE3-CFB" */
+CONST_ENTRY(658)	/* "DES-EDE3-CFB1" */
+CONST_ENTRY(659)	/* "DES-EDE3-CFB8" */
+CONST_ENTRY(63)	/* "DES-EDE3-OFB" */
+CONST_ENTRY(45)	/* "DES-OFB" */
+CONST_ENTRY(80)	/* "DESX-CBC" */
+CONST_ENTRY(380)	/* "DOD" */
+CONST_ENTRY(116)	/* "DSA" */
+CONST_ENTRY(66)	/* "DSA-SHA" */
+CONST_ENTRY(113)	/* "DSA-SHA1" */
+CONST_ENTRY(70)	/* "DSA-SHA1-old" */
+CONST_ENTRY(67)	/* "DSA-old" */
+CONST_ENTRY(297)	/* "DVCS" */
+CONST_ENTRY(99)	/* "GN" */
+CONST_ENTRY(855)	/* "HMAC" */
+CONST_ENTRY(780)	/* "HMAC-MD5" */
+CONST_ENTRY(781)	/* "HMAC-SHA1" */
+CONST_ENTRY(381)	/* "IANA" */
+CONST_ENTRY(34)	/* "IDEA-CBC" */
+CONST_ENTRY(35)	/* "IDEA-CFB" */
+CONST_ENTRY(36)	/* "IDEA-ECB" */
+CONST_ENTRY(46)	/* "IDEA-OFB" */
+CONST_ENTRY(181)	/* "ISO" */
+CONST_ENTRY(183)	/* "ISO-US" */
+CONST_ENTRY(645)	/* "ITU-T" */
+CONST_ENTRY(646)	/* "JOINT-ISO-ITU-T" */
+CONST_ENTRY(773)	/* "KISA" */
+CONST_ENTRY(15)	/* "L" */
+CONST_ENTRY(856)	/* "LocalKeySet" */
+CONST_ENTRY( 3)	/* "MD2" */
+CONST_ENTRY(257)	/* "MD4" */
+CONST_ENTRY( 4)	/* "MD5" */
+CONST_ENTRY(114)	/* "MD5-SHA1" */
+CONST_ENTRY(95)	/* "MDC2" */
+CONST_ENTRY(388)	/* "Mail" */
+CONST_ENTRY(393)	/* "NULL" */
+CONST_ENTRY(404)	/* "NULL" */
+CONST_ENTRY(57)	/* "Netscape" */
+CONST_ENTRY(366)	/* "Nonce" */
+CONST_ENTRY(17)	/* "O" */
+CONST_ENTRY(178)	/* "OCSP" */
+CONST_ENTRY(180)	/* "OCSPSigning" */
+CONST_ENTRY(379)	/* "ORG" */
+CONST_ENTRY(18)	/* "OU" */
+CONST_ENTRY(749)	/* "Oakley-EC2N-3" */
+CONST_ENTRY(750)	/* "Oakley-EC2N-4" */
+CONST_ENTRY( 9)	/* "PBE-MD2-DES" */
+CONST_ENTRY(168)	/* "PBE-MD2-RC2-64" */
+CONST_ENTRY(10)	/* "PBE-MD5-DES" */
+CONST_ENTRY(169)	/* "PBE-MD5-RC2-64" */
+CONST_ENTRY(147)	/* "PBE-SHA1-2DES" */
+CONST_ENTRY(146)	/* "PBE-SHA1-3DES" */
+CONST_ENTRY(170)	/* "PBE-SHA1-DES" */
+CONST_ENTRY(148)	/* "PBE-SHA1-RC2-128" */
+CONST_ENTRY(149)	/* "PBE-SHA1-RC2-40" */
+CONST_ENTRY(68)	/* "PBE-SHA1-RC2-64" */
+CONST_ENTRY(144)	/* "PBE-SHA1-RC4-128" */
+CONST_ENTRY(145)	/* "PBE-SHA1-RC4-40" */
+CONST_ENTRY(161)	/* "PBES2" */
+CONST_ENTRY(69)	/* "PBKDF2" */
+CONST_ENTRY(162)	/* "PBMAC1" */
+CONST_ENTRY(127)	/* "PKIX" */
+CONST_ENTRY(98)	/* "RC2-40-CBC" */
+CONST_ENTRY(166)	/* "RC2-64-CBC" */
+CONST_ENTRY(37)	/* "RC2-CBC" */
+CONST_ENTRY(39)	/* "RC2-CFB" */
+CONST_ENTRY(38)	/* "RC2-ECB" */
+CONST_ENTRY(40)	/* "RC2-OFB" */
+CONST_ENTRY( 5)	/* "RC4" */
+CONST_ENTRY(97)	/* "RC4-40" */
+CONST_ENTRY(120)	/* "RC5-CBC" */
+CONST_ENTRY(122)	/* "RC5-CFB" */
+CONST_ENTRY(121)	/* "RC5-ECB" */
+CONST_ENTRY(123)	/* "RC5-OFB" */
+CONST_ENTRY(117)	/* "RIPEMD160" */
+CONST_ENTRY(124)	/* "RLE" */
+CONST_ENTRY(19)	/* "RSA" */
+CONST_ENTRY( 7)	/* "RSA-MD2" */
+CONST_ENTRY(396)	/* "RSA-MD4" */
+CONST_ENTRY( 8)	/* "RSA-MD5" */
+CONST_ENTRY(96)	/* "RSA-MDC2" */
+CONST_ENTRY(104)	/* "RSA-NP-MD5" */
+CONST_ENTRY(119)	/* "RSA-RIPEMD160" */
+CONST_ENTRY(42)	/* "RSA-SHA" */
+CONST_ENTRY(65)	/* "RSA-SHA1" */
+CONST_ENTRY(115)	/* "RSA-SHA1-2" */
+CONST_ENTRY(671)	/* "RSA-SHA224" */
+CONST_ENTRY(668)	/* "RSA-SHA256" */
+CONST_ENTRY(669)	/* "RSA-SHA384" */
+CONST_ENTRY(670)	/* "RSA-SHA512" */
+CONST_ENTRY(777)	/* "SEED-CBC" */
+CONST_ENTRY(779)	/* "SEED-CFB" */
+CONST_ENTRY(776)	/* "SEED-ECB" */
+CONST_ENTRY(778)	/* "SEED-OFB" */
+CONST_ENTRY(41)	/* "SHA" */
+CONST_ENTRY(64)	/* "SHA1" */
+CONST_ENTRY(675)	/* "SHA224" */
+CONST_ENTRY(672)	/* "SHA256" */
+CONST_ENTRY(673)	/* "SHA384" */
+CONST_ENTRY(674)	/* "SHA512" */
+CONST_ENTRY(188)	/* "SMIME" */
+CONST_ENTRY(167)	/* "SMIME-CAPS" */
+CONST_ENTRY(100)	/* "SN" */
+CONST_ENTRY(16)	/* "ST" */
+CONST_ENTRY(143)	/* "SXNetID" */
+CONST_ENTRY(458)	/* "UID" */
+CONST_ENTRY( 0)	/* "UNDEF" */
+CONST_ENTRY(11)	/* "X500" */
+CONST_ENTRY(378)	/* "X500algorithms" */
+CONST_ENTRY(12)	/* "X509" */
+CONST_ENTRY(184)	/* "X9-57" */
+CONST_ENTRY(185)	/* "X9cm" */
+CONST_ENTRY(125)	/* "ZLIB" */
+CONST_ENTRY(478)	/* "aRecord" */
+CONST_ENTRY(289)	/* "aaControls" */
+CONST_ENTRY(287)	/* "ac-auditEntity" */
+CONST_ENTRY(397)	/* "ac-proxying" */
+CONST_ENTRY(288)	/* "ac-targeting" */
+CONST_ENTRY(368)	/* "acceptableResponses" */
+CONST_ENTRY(446)	/* "account" */
+CONST_ENTRY(363)	/* "ad_timestamping" */
+CONST_ENTRY(376)	/* "algorithm" */
+CONST_ENTRY(405)	/* "ansi-X9-62" */
+CONST_ENTRY(746)	/* "anyPolicy" */
+CONST_ENTRY(370)	/* "archiveCutoff" */
+CONST_ENTRY(484)	/* "associatedDomain" */
+CONST_ENTRY(485)	/* "associatedName" */
+CONST_ENTRY(501)	/* "audio" */
+CONST_ENTRY(177)	/* "authorityInfoAccess" */
+CONST_ENTRY(90)	/* "authorityKeyIdentifier" */
+CONST_ENTRY(882)	/* "authorityRevocationList" */
+CONST_ENTRY(87)	/* "basicConstraints" */
+CONST_ENTRY(365)	/* "basicOCSPResponse" */
+CONST_ENTRY(285)	/* "biometricInfo" */
+CONST_ENTRY(494)	/* "buildingName" */
+CONST_ENTRY(860)	/* "businessCategory" */
+CONST_ENTRY(691)	/* "c2onb191v4" */
+CONST_ENTRY(692)	/* "c2onb191v5" */
+CONST_ENTRY(697)	/* "c2onb239v4" */
+CONST_ENTRY(698)	/* "c2onb239v5" */
+CONST_ENTRY(684)	/* "c2pnb163v1" */
+CONST_ENTRY(685)	/* "c2pnb163v2" */
+CONST_ENTRY(686)	/* "c2pnb163v3" */
+CONST_ENTRY(687)	/* "c2pnb176v1" */
+CONST_ENTRY(693)	/* "c2pnb208w1" */
+CONST_ENTRY(699)	/* "c2pnb272w1" */
+CONST_ENTRY(700)	/* "c2pnb304w1" */
+CONST_ENTRY(702)	/* "c2pnb368w1" */
+CONST_ENTRY(688)	/* "c2tnb191v1" */
+CONST_ENTRY(689)	/* "c2tnb191v2" */
+CONST_ENTRY(690)	/* "c2tnb191v3" */
+CONST_ENTRY(694)	/* "c2tnb239v1" */
+CONST_ENTRY(695)	/* "c2tnb239v2" */
+CONST_ENTRY(696)	/* "c2tnb239v3" */
+CONST_ENTRY(701)	/* "c2tnb359v1" */
+CONST_ENTRY(703)	/* "c2tnb431r1" */
+CONST_ENTRY(881)	/* "cACertificate" */
+CONST_ENTRY(483)	/* "cNAMERecord" */
+CONST_ENTRY(179)	/* "caIssuers" */
+CONST_ENTRY(785)	/* "caRepository" */
+CONST_ENTRY(443)	/* "caseIgnoreIA5StringSyntax" */
+CONST_ENTRY(152)	/* "certBag" */
+CONST_ENTRY(677)	/* "certicom-arc" */
+CONST_ENTRY(771)	/* "certificateIssuer" */
+CONST_ENTRY(89)	/* "certificatePolicies" */
+CONST_ENTRY(883)	/* "certificateRevocationList" */
+CONST_ENTRY(54)	/* "challengePassword" */
+CONST_ENTRY(407)	/* "characteristic-two-field" */
+CONST_ENTRY(395)	/* "clearance" */
+CONST_ENTRY(130)	/* "clientAuth" */
+CONST_ENTRY(131)	/* "codeSigning" */
+CONST_ENTRY(50)	/* "contentType" */
+CONST_ENTRY(53)	/* "countersignature" */
+CONST_ENTRY(153)	/* "crlBag" */
+CONST_ENTRY(103)	/* "crlDistributionPoints" */
+CONST_ENTRY(88)	/* "crlNumber" */
+CONST_ENTRY(884)	/* "crossCertificatePair" */
+CONST_ENTRY(806)	/* "cryptocom" */
+CONST_ENTRY(805)	/* "cryptopro" */
+CONST_ENTRY(500)	/* "dITRedirect" */
+CONST_ENTRY(451)	/* "dNSDomain" */
+CONST_ENTRY(495)	/* "dSAQuality" */
+CONST_ENTRY(434)	/* "data" */
+CONST_ENTRY(390)	/* "dcobject" */
+CONST_ENTRY(140)	/* "deltaCRL" */
+CONST_ENTRY(891)	/* "deltaRevocationList" */
+CONST_ENTRY(107)	/* "description" */
+CONST_ENTRY(871)	/* "destinationIndicator" */
+CONST_ENTRY(28)	/* "dhKeyAgreement" */
+CONST_ENTRY(382)	/* "directory" */
+CONST_ENTRY(887)	/* "distinguishedName" */
+CONST_ENTRY(892)	/* "dmdName" */
+CONST_ENTRY(174)	/* "dnQualifier" */
+CONST_ENTRY(447)	/* "document" */
+CONST_ENTRY(471)	/* "documentAuthor" */
+CONST_ENTRY(468)	/* "documentIdentifier" */
+CONST_ENTRY(472)	/* "documentLocation" */
+CONST_ENTRY(502)	/* "documentPublisher" */
+CONST_ENTRY(449)	/* "documentSeries" */
+CONST_ENTRY(469)	/* "documentTitle" */
+CONST_ENTRY(470)	/* "documentVersion" */
+CONST_ENTRY(392)	/* "domain" */
+CONST_ENTRY(452)	/* "domainRelatedObject" */
+CONST_ENTRY(802)	/* "dsa_with_SHA224" */
+CONST_ENTRY(803)	/* "dsa_with_SHA256" */
+CONST_ENTRY(791)	/* "ecdsa-with-Recommended" */
+CONST_ENTRY(416)	/* "ecdsa-with-SHA1" */
+CONST_ENTRY(793)	/* "ecdsa-with-SHA224" */
+CONST_ENTRY(794)	/* "ecdsa-with-SHA256" */
+CONST_ENTRY(795)	/* "ecdsa-with-SHA384" */
+CONST_ENTRY(796)	/* "ecdsa-with-SHA512" */
+CONST_ENTRY(792)	/* "ecdsa-with-Specified" */
+CONST_ENTRY(48)	/* "emailAddress" */
+CONST_ENTRY(132)	/* "emailProtection" */
+CONST_ENTRY(885)	/* "enhancedSearchGuide" */
+CONST_ENTRY(389)	/* "enterprises" */
+CONST_ENTRY(384)	/* "experimental" */
+CONST_ENTRY(172)	/* "extReq" */
+CONST_ENTRY(56)	/* "extendedCertificateAttributes" */
+CONST_ENTRY(126)	/* "extendedKeyUsage" */
+CONST_ENTRY(372)	/* "extendedStatus" */
+CONST_ENTRY(867)	/* "facsimileTelephoneNumber" */
+CONST_ENTRY(462)	/* "favouriteDrink" */
+CONST_ENTRY(857)	/* "freshestCRL" */
+CONST_ENTRY(453)	/* "friendlyCountry" */
+CONST_ENTRY(490)	/* "friendlyCountryName" */
+CONST_ENTRY(156)	/* "friendlyName" */
+CONST_ENTRY(509)	/* "generationQualifier" */
+CONST_ENTRY(815)	/* "gost-mac" */
+CONST_ENTRY(811)	/* "gost2001" */
+CONST_ENTRY(851)	/* "gost2001cc" */
+CONST_ENTRY(813)	/* "gost89" */
+CONST_ENTRY(814)	/* "gost89-cnt" */
+CONST_ENTRY(812)	/* "gost94" */
+CONST_ENTRY(850)	/* "gost94cc" */
+CONST_ENTRY(797)	/* "hmacWithMD5" */
+CONST_ENTRY(163)	/* "hmacWithSHA1" */
+CONST_ENTRY(798)	/* "hmacWithSHA224" */
+CONST_ENTRY(799)	/* "hmacWithSHA256" */
+CONST_ENTRY(800)	/* "hmacWithSHA384" */
+CONST_ENTRY(801)	/* "hmacWithSHA512" */
+CONST_ENTRY(432)	/* "holdInstructionCallIssuer" */
+CONST_ENTRY(430)	/* "holdInstructionCode" */
+CONST_ENTRY(431)	/* "holdInstructionNone" */
+CONST_ENTRY(433)	/* "holdInstructionReject" */
+CONST_ENTRY(486)	/* "homePostalAddress" */
+CONST_ENTRY(473)	/* "homeTelephoneNumber" */
+CONST_ENTRY(466)	/* "host" */
+CONST_ENTRY(889)	/* "houseIdentifier" */
+CONST_ENTRY(442)	/* "iA5StringSyntax" */
+CONST_ENTRY(783)	/* "id-DHBasedMac" */
+CONST_ENTRY(824)	/* "id-Gost28147-89-CryptoPro-A-ParamSet" */
+CONST_ENTRY(825)	/* "id-Gost28147-89-CryptoPro-B-ParamSet" */
+CONST_ENTRY(826)	/* "id-Gost28147-89-CryptoPro-C-ParamSet" */
+CONST_ENTRY(827)	/* "id-Gost28147-89-CryptoPro-D-ParamSet" */
+CONST_ENTRY(819)	/* "id-Gost28147-89-CryptoPro-KeyMeshing" */
+CONST_ENTRY(829)	/* "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" */
+CONST_ENTRY(828)	/* "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" */
+CONST_ENTRY(830)	/* "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" */
+CONST_ENTRY(820)	/* "id-Gost28147-89-None-KeyMeshing" */
+CONST_ENTRY(823)	/* "id-Gost28147-89-TestParamSet" */
+CONST_ENTRY(849)	/* "id-Gost28147-89-cc" */
+CONST_ENTRY(840)	/* "id-GostR3410-2001-CryptoPro-A-ParamSet" */
+CONST_ENTRY(841)	/* "id-GostR3410-2001-CryptoPro-B-ParamSet" */
+CONST_ENTRY(842)	/* "id-GostR3410-2001-CryptoPro-C-ParamSet" */
+CONST_ENTRY(843)	/* "id-GostR3410-2001-CryptoPro-XchA-ParamSet" */
+CONST_ENTRY(844)	/* "id-GostR3410-2001-CryptoPro-XchB-ParamSet" */
+CONST_ENTRY(854)	/* "id-GostR3410-2001-ParamSet-cc" */
+CONST_ENTRY(839)	/* "id-GostR3410-2001-TestParamSet" */
+CONST_ENTRY(817)	/* "id-GostR3410-2001DH" */
+CONST_ENTRY(832)	/* "id-GostR3410-94-CryptoPro-A-ParamSet" */
+CONST_ENTRY(833)	/* "id-GostR3410-94-CryptoPro-B-ParamSet" */
+CONST_ENTRY(834)	/* "id-GostR3410-94-CryptoPro-C-ParamSet" */
+CONST_ENTRY(835)	/* "id-GostR3410-94-CryptoPro-D-ParamSet" */
+CONST_ENTRY(836)	/* "id-GostR3410-94-CryptoPro-XchA-ParamSet" */
+CONST_ENTRY(837)	/* "id-GostR3410-94-CryptoPro-XchB-ParamSet" */
+CONST_ENTRY(838)	/* "id-GostR3410-94-CryptoPro-XchC-ParamSet" */
+CONST_ENTRY(831)	/* "id-GostR3410-94-TestParamSet" */
+CONST_ENTRY(845)	/* "id-GostR3410-94-a" */
+CONST_ENTRY(846)	/* "id-GostR3410-94-aBis" */
+CONST_ENTRY(847)	/* "id-GostR3410-94-b" */
+CONST_ENTRY(848)	/* "id-GostR3410-94-bBis" */
+CONST_ENTRY(818)	/* "id-GostR3410-94DH" */
+CONST_ENTRY(822)	/* "id-GostR3411-94-CryptoProParamSet" */
+CONST_ENTRY(821)	/* "id-GostR3411-94-TestParamSet" */
+CONST_ENTRY(807)	/* "id-GostR3411-94-with-GostR3410-2001" */
+CONST_ENTRY(853)	/* "id-GostR3411-94-with-GostR3410-2001-cc" */
+CONST_ENTRY(808)	/* "id-GostR3411-94-with-GostR3410-94" */
+CONST_ENTRY(852)	/* "id-GostR3411-94-with-GostR3410-94-cc" */
+CONST_ENTRY(810)	/* "id-HMACGostR3411-94" */
+CONST_ENTRY(782)	/* "id-PasswordBasedMAC" */
+CONST_ENTRY(266)	/* "id-aca" */
+CONST_ENTRY(355)	/* "id-aca-accessIdentity" */
+CONST_ENTRY(354)	/* "id-aca-authenticationInfo" */
+CONST_ENTRY(356)	/* "id-aca-chargingIdentity" */
+CONST_ENTRY(399)	/* "id-aca-encAttrs" */
+CONST_ENTRY(357)	/* "id-aca-group" */
+CONST_ENTRY(358)	/* "id-aca-role" */
+CONST_ENTRY(176)	/* "id-ad" */
+CONST_ENTRY(788)	/* "id-aes128-wrap" */
+CONST_ENTRY(789)	/* "id-aes192-wrap" */
+CONST_ENTRY(790)	/* "id-aes256-wrap" */
+CONST_ENTRY(262)	/* "id-alg" */
+CONST_ENTRY(323)	/* "id-alg-des40" */
+CONST_ENTRY(326)	/* "id-alg-dh-pop" */
+CONST_ENTRY(325)	/* "id-alg-dh-sig-hmac-sha1" */
+CONST_ENTRY(324)	/* "id-alg-noSignature" */
+CONST_ENTRY(268)	/* "id-cct" */
+CONST_ENTRY(361)	/* "id-cct-PKIData" */
+CONST_ENTRY(362)	/* "id-cct-PKIResponse" */
+CONST_ENTRY(360)	/* "id-cct-crs" */
+CONST_ENTRY(81)	/* "id-ce" */
+CONST_ENTRY(680)	/* "id-characteristic-two-basis" */
+CONST_ENTRY(263)	/* "id-cmc" */
+CONST_ENTRY(334)	/* "id-cmc-addExtensions" */
+CONST_ENTRY(346)	/* "id-cmc-confirmCertAcceptance" */
+CONST_ENTRY(330)	/* "id-cmc-dataReturn" */
+CONST_ENTRY(336)	/* "id-cmc-decryptedPOP" */
+CONST_ENTRY(335)	/* "id-cmc-encryptedPOP" */
+CONST_ENTRY(339)	/* "id-cmc-getCRL" */
+CONST_ENTRY(338)	/* "id-cmc-getCert" */
+CONST_ENTRY(328)	/* "id-cmc-identification" */
+CONST_ENTRY(329)	/* "id-cmc-identityProof" */
+CONST_ENTRY(337)	/* "id-cmc-lraPOPWitness" */
+CONST_ENTRY(344)	/* "id-cmc-popLinkRandom" */
+CONST_ENTRY(345)	/* "id-cmc-popLinkWitness" */
+CONST_ENTRY(343)	/* "id-cmc-queryPending" */
+CONST_ENTRY(333)	/* "id-cmc-recipientNonce" */
+CONST_ENTRY(341)	/* "id-cmc-regInfo" */
+CONST_ENTRY(342)	/* "id-cmc-responseInfo" */
+CONST_ENTRY(340)	/* "id-cmc-revokeRequest" */
+CONST_ENTRY(332)	/* "id-cmc-senderNonce" */
+CONST_ENTRY(327)	/* "id-cmc-statusInfo" */
+CONST_ENTRY(331)	/* "id-cmc-transactionId" */
+CONST_ENTRY(787)	/* "id-ct-asciiTextWithCRLF" */
+CONST_ENTRY(408)	/* "id-ecPublicKey" */
+CONST_ENTRY(508)	/* "id-hex-multipart-message" */
+CONST_ENTRY(507)	/* "id-hex-partial-message" */
+CONST_ENTRY(260)	/* "id-it" */
+CONST_ENTRY(302)	/* "id-it-caKeyUpdateInfo" */
+CONST_ENTRY(298)	/* "id-it-caProtEncCert" */
+CONST_ENTRY(311)	/* "id-it-confirmWaitTime" */
+CONST_ENTRY(303)	/* "id-it-currentCRL" */
+CONST_ENTRY(300)	/* "id-it-encKeyPairTypes" */
+CONST_ENTRY(310)	/* "id-it-implicitConfirm" */
+CONST_ENTRY(308)	/* "id-it-keyPairParamRep" */
+CONST_ENTRY(307)	/* "id-it-keyPairParamReq" */
+CONST_ENTRY(312)	/* "id-it-origPKIMessage" */
+CONST_ENTRY(301)	/* "id-it-preferredSymmAlg" */
+CONST_ENTRY(309)	/* "id-it-revPassphrase" */
+CONST_ENTRY(299)	/* "id-it-signKeyPairTypes" */
+CONST_ENTRY(305)	/* "id-it-subscriptionRequest" */
+CONST_ENTRY(306)	/* "id-it-subscriptionResponse" */
+CONST_ENTRY(784)	/* "id-it-suppLangTags" */
+CONST_ENTRY(304)	/* "id-it-unsupportedOIDs" */
+CONST_ENTRY(128)	/* "id-kp" */
+CONST_ENTRY(280)	/* "id-mod-attribute-cert" */
+CONST_ENTRY(274)	/* "id-mod-cmc" */
+CONST_ENTRY(277)	/* "id-mod-cmp" */
+CONST_ENTRY(284)	/* "id-mod-cmp2000" */
+CONST_ENTRY(273)	/* "id-mod-crmf" */
+CONST_ENTRY(283)	/* "id-mod-dvcs" */
+CONST_ENTRY(275)	/* "id-mod-kea-profile-88" */
+CONST_ENTRY(276)	/* "id-mod-kea-profile-93" */
+CONST_ENTRY(282)	/* "id-mod-ocsp" */
+CONST_ENTRY(278)	/* "id-mod-qualified-cert-88" */
+CONST_ENTRY(279)	/* "id-mod-qualified-cert-93" */
+CONST_ENTRY(281)	/* "id-mod-timestamp-protocol" */
+CONST_ENTRY(264)	/* "id-on" */
+CONST_ENTRY(858)	/* "id-on-permanentIdentifier" */
+CONST_ENTRY(347)	/* "id-on-personalData" */
+CONST_ENTRY(265)	/* "id-pda" */
+CONST_ENTRY(352)	/* "id-pda-countryOfCitizenship" */
+CONST_ENTRY(353)	/* "id-pda-countryOfResidence" */
+CONST_ENTRY(348)	/* "id-pda-dateOfBirth" */
+CONST_ENTRY(351)	/* "id-pda-gender" */
+CONST_ENTRY(349)	/* "id-pda-placeOfBirth" */
+CONST_ENTRY(175)	/* "id-pe" */
+CONST_ENTRY(261)	/* "id-pkip" */
+CONST_ENTRY(258)	/* "id-pkix-mod" */
+CONST_ENTRY(269)	/* "id-pkix1-explicit-88" */
+CONST_ENTRY(271)	/* "id-pkix1-explicit-93" */
+CONST_ENTRY(270)	/* "id-pkix1-implicit-88" */
+CONST_ENTRY(272)	/* "id-pkix1-implicit-93" */
+CONST_ENTRY(662)	/* "id-ppl" */
+CONST_ENTRY(664)	/* "id-ppl-anyLanguage" */
+CONST_ENTRY(667)	/* "id-ppl-independent" */
+CONST_ENTRY(665)	/* "id-ppl-inheritAll" */
+CONST_ENTRY(267)	/* "id-qcs" */
+CONST_ENTRY(359)	/* "id-qcs-pkixQCSyntax-v1" */
+CONST_ENTRY(259)	/* "id-qt" */
+CONST_ENTRY(164)	/* "id-qt-cps" */
+CONST_ENTRY(165)	/* "id-qt-unotice" */
+CONST_ENTRY(313)	/* "id-regCtrl" */
+CONST_ENTRY(316)	/* "id-regCtrl-authenticator" */
+CONST_ENTRY(319)	/* "id-regCtrl-oldCertID" */
+CONST_ENTRY(318)	/* "id-regCtrl-pkiArchiveOptions" */
+CONST_ENTRY(317)	/* "id-regCtrl-pkiPublicationInfo" */
+CONST_ENTRY(320)	/* "id-regCtrl-protocolEncrKey" */
+CONST_ENTRY(315)	/* "id-regCtrl-regToken" */
+CONST_ENTRY(314)	/* "id-regInfo" */
+CONST_ENTRY(322)	/* "id-regInfo-certReq" */
+CONST_ENTRY(321)	/* "id-regInfo-utf8Pairs" */
+CONST_ENTRY(512)	/* "id-set" */
+CONST_ENTRY(191)	/* "id-smime-aa" */
+CONST_ENTRY(215)	/* "id-smime-aa-contentHint" */
+CONST_ENTRY(218)	/* "id-smime-aa-contentIdentifier" */
+CONST_ENTRY(221)	/* "id-smime-aa-contentReference" */
+CONST_ENTRY(240)	/* "id-smime-aa-dvcs-dvc" */
+CONST_ENTRY(217)	/* "id-smime-aa-encapContentType" */
+CONST_ENTRY(222)	/* "id-smime-aa-encrypKeyPref" */
+CONST_ENTRY(220)	/* "id-smime-aa-equivalentLabels" */
+CONST_ENTRY(232)	/* "id-smime-aa-ets-CertificateRefs" */
+CONST_ENTRY(233)	/* "id-smime-aa-ets-RevocationRefs" */
+CONST_ENTRY(238)	/* "id-smime-aa-ets-archiveTimeStamp" */
+CONST_ENTRY(237)	/* "id-smime-aa-ets-certCRLTimestamp" */
+CONST_ENTRY(234)	/* "id-smime-aa-ets-certValues" */
+CONST_ENTRY(227)	/* "id-smime-aa-ets-commitmentType" */
+CONST_ENTRY(231)	/* "id-smime-aa-ets-contentTimestamp" */
+CONST_ENTRY(236)	/* "id-smime-aa-ets-escTimeStamp" */
+CONST_ENTRY(230)	/* "id-smime-aa-ets-otherSigCert" */
+CONST_ENTRY(235)	/* "id-smime-aa-ets-revocationValues" */
+CONST_ENTRY(226)	/* "id-smime-aa-ets-sigPolicyId" */
+CONST_ENTRY(229)	/* "id-smime-aa-ets-signerAttr" */
+CONST_ENTRY(228)	/* "id-smime-aa-ets-signerLocation" */
+CONST_ENTRY(219)	/* "id-smime-aa-macValue" */
+CONST_ENTRY(214)	/* "id-smime-aa-mlExpandHistory" */
+CONST_ENTRY(216)	/* "id-smime-aa-msgSigDigest" */
+CONST_ENTRY(212)	/* "id-smime-aa-receiptRequest" */
+CONST_ENTRY(213)	/* "id-smime-aa-securityLabel" */
+CONST_ENTRY(239)	/* "id-smime-aa-signatureType" */
+CONST_ENTRY(223)	/* "id-smime-aa-signingCertificate" */
+CONST_ENTRY(224)	/* "id-smime-aa-smimeEncryptCerts" */
+CONST_ENTRY(225)	/* "id-smime-aa-timeStampToken" */
+CONST_ENTRY(192)	/* "id-smime-alg" */
+CONST_ENTRY(243)	/* "id-smime-alg-3DESwrap" */
+CONST_ENTRY(246)	/* "id-smime-alg-CMS3DESwrap" */
+CONST_ENTRY(247)	/* "id-smime-alg-CMSRC2wrap" */
+CONST_ENTRY(245)	/* "id-smime-alg-ESDH" */
+CONST_ENTRY(241)	/* "id-smime-alg-ESDHwith3DES" */
+CONST_ENTRY(242)	/* "id-smime-alg-ESDHwithRC2" */
+CONST_ENTRY(244)	/* "id-smime-alg-RC2wrap" */
+CONST_ENTRY(193)	/* "id-smime-cd" */
+CONST_ENTRY(248)	/* "id-smime-cd-ldap" */
+CONST_ENTRY(190)	/* "id-smime-ct" */
+CONST_ENTRY(210)	/* "id-smime-ct-DVCSRequestData" */
+CONST_ENTRY(211)	/* "id-smime-ct-DVCSResponseData" */
+CONST_ENTRY(208)	/* "id-smime-ct-TDTInfo" */
+CONST_ENTRY(207)	/* "id-smime-ct-TSTInfo" */
+CONST_ENTRY(205)	/* "id-smime-ct-authData" */
+CONST_ENTRY(786)	/* "id-smime-ct-compressedData" */
+CONST_ENTRY(209)	/* "id-smime-ct-contentInfo" */
+CONST_ENTRY(206)	/* "id-smime-ct-publishCert" */
+CONST_ENTRY(204)	/* "id-smime-ct-receipt" */
+CONST_ENTRY(195)	/* "id-smime-cti" */
+CONST_ENTRY(255)	/* "id-smime-cti-ets-proofOfApproval" */
+CONST_ENTRY(256)	/* "id-smime-cti-ets-proofOfCreation" */
+CONST_ENTRY(253)	/* "id-smime-cti-ets-proofOfDelivery" */
+CONST_ENTRY(251)	/* "id-smime-cti-ets-proofOfOrigin" */
+CONST_ENTRY(252)	/* "id-smime-cti-ets-proofOfReceipt" */
+CONST_ENTRY(254)	/* "id-smime-cti-ets-proofOfSender" */
+CONST_ENTRY(189)	/* "id-smime-mod" */
+CONST_ENTRY(196)	/* "id-smime-mod-cms" */
+CONST_ENTRY(197)	/* "id-smime-mod-ess" */
+CONST_ENTRY(202)	/* "id-smime-mod-ets-eSigPolicy-88" */
+CONST_ENTRY(203)	/* "id-smime-mod-ets-eSigPolicy-97" */
+CONST_ENTRY(200)	/* "id-smime-mod-ets-eSignature-88" */
+CONST_ENTRY(201)	/* "id-smime-mod-ets-eSignature-97" */
+CONST_ENTRY(199)	/* "id-smime-mod-msg-v3" */
+CONST_ENTRY(198)	/* "id-smime-mod-oid" */
+CONST_ENTRY(194)	/* "id-smime-spq" */
+CONST_ENTRY(250)	/* "id-smime-spq-ets-sqt-unotice" */
+CONST_ENTRY(249)	/* "id-smime-spq-ets-sqt-uri" */
+CONST_ENTRY(676)	/* "identified-organization" */
+CONST_ENTRY(461)	/* "info" */
+CONST_ENTRY(748)	/* "inhibitAnyPolicy" */
+CONST_ENTRY(101)	/* "initials" */
+CONST_ENTRY(647)	/* "international-organizations" */
+CONST_ENTRY(869)	/* "internationaliSDNNumber" */
+CONST_ENTRY(142)	/* "invalidityDate" */
+CONST_ENTRY(294)	/* "ipsecEndSystem" */
+CONST_ENTRY(295)	/* "ipsecTunnel" */
+CONST_ENTRY(296)	/* "ipsecUser" */
+CONST_ENTRY(86)	/* "issuerAltName" */
+CONST_ENTRY(770)	/* "issuingDistributionPoint" */
+CONST_ENTRY(492)	/* "janetMailbox" */
+CONST_ENTRY(150)	/* "keyBag" */
+CONST_ENTRY(83)	/* "keyUsage" */
+CONST_ENTRY(477)	/* "lastModifiedBy" */
+CONST_ENTRY(476)	/* "lastModifiedTime" */
+CONST_ENTRY(157)	/* "localKeyID" */
+CONST_ENTRY(480)	/* "mXRecord" */
+CONST_ENTRY(460)	/* "mail" */
+CONST_ENTRY(493)	/* "mailPreferenceOption" */
+CONST_ENTRY(467)	/* "manager" */
+CONST_ENTRY(809)	/* "md_gost94" */
+CONST_ENTRY(875)	/* "member" */
+CONST_ENTRY(182)	/* "member-body" */
+CONST_ENTRY(51)	/* "messageDigest" */
+CONST_ENTRY(383)	/* "mgmt" */
+CONST_ENTRY(504)	/* "mime-mhs" */
+CONST_ENTRY(506)	/* "mime-mhs-bodies" */
+CONST_ENTRY(505)	/* "mime-mhs-headings" */
+CONST_ENTRY(488)	/* "mobileTelephoneNumber" */
+CONST_ENTRY(136)	/* "msCTLSign" */
+CONST_ENTRY(135)	/* "msCodeCom" */
+CONST_ENTRY(134)	/* "msCodeInd" */
+CONST_ENTRY(138)	/* "msEFS" */
+CONST_ENTRY(171)	/* "msExtReq" */
+CONST_ENTRY(137)	/* "msSGC" */
+CONST_ENTRY(648)	/* "msSmartcardLogin" */
+CONST_ENTRY(649)	/* "msUPN" */
+CONST_ENTRY(481)	/* "nSRecord" */
+CONST_ENTRY(173)	/* "name" */
+CONST_ENTRY(666)	/* "nameConstraints" */
+CONST_ENTRY(369)	/* "noCheck" */
+CONST_ENTRY(403)	/* "noRevAvail" */
+CONST_ENTRY(72)	/* "nsBaseUrl" */
+CONST_ENTRY(76)	/* "nsCaPolicyUrl" */
+CONST_ENTRY(74)	/* "nsCaRevocationUrl" */
+CONST_ENTRY(58)	/* "nsCertExt" */
+CONST_ENTRY(79)	/* "nsCertSequence" */
+CONST_ENTRY(71)	/* "nsCertType" */
+CONST_ENTRY(78)	/* "nsComment" */
+CONST_ENTRY(59)	/* "nsDataType" */
+CONST_ENTRY(75)	/* "nsRenewalUrl" */
+CONST_ENTRY(73)	/* "nsRevocationUrl" */
+CONST_ENTRY(139)	/* "nsSGC" */
+CONST_ENTRY(77)	/* "nsSslServerName" */
+CONST_ENTRY(681)	/* "onBasis" */
+CONST_ENTRY(491)	/* "organizationalStatus" */
+CONST_ENTRY(475)	/* "otherMailbox" */
+CONST_ENTRY(876)	/* "owner" */
+CONST_ENTRY(489)	/* "pagerTelephoneNumber" */
+CONST_ENTRY(374)	/* "path" */
+CONST_ENTRY(112)	/* "pbeWithMD5AndCast5CBC" */
+CONST_ENTRY(499)	/* "personalSignature" */
+CONST_ENTRY(487)	/* "personalTitle" */
+CONST_ENTRY(464)	/* "photo" */
+CONST_ENTRY(863)	/* "physicalDeliveryOfficeName" */
+CONST_ENTRY(437)	/* "pilot" */
+CONST_ENTRY(439)	/* "pilotAttributeSyntax" */
+CONST_ENTRY(438)	/* "pilotAttributeType" */
+CONST_ENTRY(479)	/* "pilotAttributeType27" */
+CONST_ENTRY(456)	/* "pilotDSA" */
+CONST_ENTRY(441)	/* "pilotGroups" */
+CONST_ENTRY(444)	/* "pilotObject" */
+CONST_ENTRY(440)	/* "pilotObjectClass" */
+CONST_ENTRY(455)	/* "pilotOrganization" */
+CONST_ENTRY(445)	/* "pilotPerson" */
+CONST_ENTRY( 2)	/* "pkcs" */
+CONST_ENTRY(186)	/* "pkcs1" */
+CONST_ENTRY(27)	/* "pkcs3" */
+CONST_ENTRY(187)	/* "pkcs5" */
+CONST_ENTRY(20)	/* "pkcs7" */
+CONST_ENTRY(21)	/* "pkcs7-data" */
+CONST_ENTRY(25)	/* "pkcs7-digestData" */
+CONST_ENTRY(26)	/* "pkcs7-encryptedData" */
+CONST_ENTRY(23)	/* "pkcs7-envelopedData" */
+CONST_ENTRY(24)	/* "pkcs7-signedAndEnvelopedData" */
+CONST_ENTRY(22)	/* "pkcs7-signedData" */
+CONST_ENTRY(151)	/* "pkcs8ShroudedKeyBag" */
+CONST_ENTRY(47)	/* "pkcs9" */
+CONST_ENTRY(401)	/* "policyConstraints" */
+CONST_ENTRY(747)	/* "policyMappings" */
+CONST_ENTRY(862)	/* "postOfficeBox" */
+CONST_ENTRY(861)	/* "postalAddress" */
+CONST_ENTRY(661)	/* "postalCode" */
+CONST_ENTRY(683)	/* "ppBasis" */
+CONST_ENTRY(872)	/* "preferredDeliveryMethod" */
+CONST_ENTRY(873)	/* "presentationAddress" */
+CONST_ENTRY(816)	/* "prf-gostr3411-94" */
+CONST_ENTRY(406)	/* "prime-field" */
+CONST_ENTRY(409)	/* "prime192v1" */
+CONST_ENTRY(410)	/* "prime192v2" */
+CONST_ENTRY(411)	/* "prime192v3" */
+CONST_ENTRY(412)	/* "prime239v1" */
+CONST_ENTRY(413)	/* "prime239v2" */
+CONST_ENTRY(414)	/* "prime239v3" */
+CONST_ENTRY(415)	/* "prime256v1" */
+CONST_ENTRY(385)	/* "private" */
+CONST_ENTRY(84)	/* "privateKeyUsagePeriod" */
+CONST_ENTRY(886)	/* "protocolInformation" */
+CONST_ENTRY(663)	/* "proxyCertInfo" */
+CONST_ENTRY(510)	/* "pseudonym" */
+CONST_ENTRY(435)	/* "pss" */
+CONST_ENTRY(286)	/* "qcStatements" */
+CONST_ENTRY(457)	/* "qualityLabelledData" */
+CONST_ENTRY(450)	/* "rFC822localPart" */
+CONST_ENTRY(870)	/* "registeredAddress" */
+CONST_ENTRY(400)	/* "role" */
+CONST_ENTRY(877)	/* "roleOccupant" */
+CONST_ENTRY(448)	/* "room" */
+CONST_ENTRY(463)	/* "roomNumber" */
+CONST_ENTRY( 6)	/* "rsaEncryption" */
+CONST_ENTRY(644)	/* "rsaOAEPEncryptionSET" */
+CONST_ENTRY(377)	/* "rsaSignature" */
+CONST_ENTRY( 1)	/* "rsadsi" */
+CONST_ENTRY(482)	/* "sOARecord" */
+CONST_ENTRY(155)	/* "safeContentsBag" */
+CONST_ENTRY(291)	/* "sbgp-autonomousSysNum" */
+CONST_ENTRY(290)	/* "sbgp-ipAddrBlock" */
+CONST_ENTRY(292)	/* "sbgp-routerIdentifier" */
+CONST_ENTRY(159)	/* "sdsiCertificate" */
+CONST_ENTRY(859)	/* "searchGuide" */
+CONST_ENTRY(704)	/* "secp112r1" */
+CONST_ENTRY(705)	/* "secp112r2" */
+CONST_ENTRY(706)	/* "secp128r1" */
+CONST_ENTRY(707)	/* "secp128r2" */
+CONST_ENTRY(708)	/* "secp160k1" */
+CONST_ENTRY(709)	/* "secp160r1" */
+CONST_ENTRY(710)	/* "secp160r2" */
+CONST_ENTRY(711)	/* "secp192k1" */
+CONST_ENTRY(712)	/* "secp224k1" */
+CONST_ENTRY(713)	/* "secp224r1" */
+CONST_ENTRY(714)	/* "secp256k1" */
+CONST_ENTRY(715)	/* "secp384r1" */
+CONST_ENTRY(716)	/* "secp521r1" */
+CONST_ENTRY(154)	/* "secretBag" */
+CONST_ENTRY(474)	/* "secretary" */
+CONST_ENTRY(717)	/* "sect113r1" */
+CONST_ENTRY(718)	/* "sect113r2" */
+CONST_ENTRY(719)	/* "sect131r1" */
+CONST_ENTRY(720)	/* "sect131r2" */
+CONST_ENTRY(721)	/* "sect163k1" */
+CONST_ENTRY(722)	/* "sect163r1" */
+CONST_ENTRY(723)	/* "sect163r2" */
+CONST_ENTRY(724)	/* "sect193r1" */
+CONST_ENTRY(725)	/* "sect193r2" */
+CONST_ENTRY(726)	/* "sect233k1" */
+CONST_ENTRY(727)	/* "sect233r1" */
+CONST_ENTRY(728)	/* "sect239k1" */
+CONST_ENTRY(729)	/* "sect283k1" */
+CONST_ENTRY(730)	/* "sect283r1" */
+CONST_ENTRY(731)	/* "sect409k1" */
+CONST_ENTRY(732)	/* "sect409r1" */
+CONST_ENTRY(733)	/* "sect571k1" */
+CONST_ENTRY(734)	/* "sect571r1" */
+CONST_ENTRY(386)	/* "security" */
+CONST_ENTRY(878)	/* "seeAlso" */
+CONST_ENTRY(394)	/* "selected-attribute-types" */
+CONST_ENTRY(105)	/* "serialNumber" */
+CONST_ENTRY(129)	/* "serverAuth" */
+CONST_ENTRY(371)	/* "serviceLocator" */
+CONST_ENTRY(625)	/* "set-addPolicy" */
+CONST_ENTRY(515)	/* "set-attr" */
+CONST_ENTRY(518)	/* "set-brand" */
+CONST_ENTRY(638)	/* "set-brand-AmericanExpress" */
+CONST_ENTRY(637)	/* "set-brand-Diners" */
+CONST_ENTRY(636)	/* "set-brand-IATA-ATA" */
+CONST_ENTRY(639)	/* "set-brand-JCB" */
+CONST_ENTRY(641)	/* "set-brand-MasterCard" */
+CONST_ENTRY(642)	/* "set-brand-Novus" */
+CONST_ENTRY(640)	/* "set-brand-Visa" */
+CONST_ENTRY(517)	/* "set-certExt" */
+CONST_ENTRY(513)	/* "set-ctype" */
+CONST_ENTRY(514)	/* "set-msgExt" */
+CONST_ENTRY(516)	/* "set-policy" */
+CONST_ENTRY(607)	/* "set-policy-root" */
+CONST_ENTRY(624)	/* "set-rootKeyThumb" */
+CONST_ENTRY(620)	/* "setAttr-Cert" */
+CONST_ENTRY(631)	/* "setAttr-GenCryptgrm" */
+CONST_ENTRY(623)	/* "setAttr-IssCap" */
+CONST_ENTRY(628)	/* "setAttr-IssCap-CVM" */
+CONST_ENTRY(630)	/* "setAttr-IssCap-Sig" */
+CONST_ENTRY(629)	/* "setAttr-IssCap-T2" */
+CONST_ENTRY(621)	/* "setAttr-PGWYcap" */
+CONST_ENTRY(635)	/* "setAttr-SecDevSig" */
+CONST_ENTRY(632)	/* "setAttr-T2Enc" */
+CONST_ENTRY(633)	/* "setAttr-T2cleartxt" */
+CONST_ENTRY(634)	/* "setAttr-TokICCsig" */
+CONST_ENTRY(627)	/* "setAttr-Token-B0Prime" */
+CONST_ENTRY(626)	/* "setAttr-Token-EMV" */
+CONST_ENTRY(622)	/* "setAttr-TokenType" */
+CONST_ENTRY(619)	/* "setCext-IssuerCapabilities" */
+CONST_ENTRY(615)	/* "setCext-PGWYcapabilities" */
+CONST_ENTRY(616)	/* "setCext-TokenIdentifier" */
+CONST_ENTRY(618)	/* "setCext-TokenType" */
+CONST_ENTRY(617)	/* "setCext-Track2Data" */
+CONST_ENTRY(611)	/* "setCext-cCertRequired" */
+CONST_ENTRY(609)	/* "setCext-certType" */
+CONST_ENTRY(608)	/* "setCext-hashedRoot" */
+CONST_ENTRY(610)	/* "setCext-merchData" */
+CONST_ENTRY(613)	/* "setCext-setExt" */
+CONST_ENTRY(614)	/* "setCext-setQualf" */
+CONST_ENTRY(612)	/* "setCext-tunneling" */
+CONST_ENTRY(540)	/* "setct-AcqCardCodeMsg" */
+CONST_ENTRY(576)	/* "setct-AcqCardCodeMsgTBE" */
+CONST_ENTRY(570)	/* "setct-AuthReqTBE" */
+CONST_ENTRY(534)	/* "setct-AuthReqTBS" */
+CONST_ENTRY(527)	/* "setct-AuthResBaggage" */
+CONST_ENTRY(571)	/* "setct-AuthResTBE" */
+CONST_ENTRY(572)	/* "setct-AuthResTBEX" */
+CONST_ENTRY(535)	/* "setct-AuthResTBS" */
+CONST_ENTRY(536)	/* "setct-AuthResTBSX" */
+CONST_ENTRY(528)	/* "setct-AuthRevReqBaggage" */
+CONST_ENTRY(577)	/* "setct-AuthRevReqTBE" */
+CONST_ENTRY(541)	/* "setct-AuthRevReqTBS" */
+CONST_ENTRY(529)	/* "setct-AuthRevResBaggage" */
+CONST_ENTRY(542)	/* "setct-AuthRevResData" */
+CONST_ENTRY(578)	/* "setct-AuthRevResTBE" */
+CONST_ENTRY(579)	/* "setct-AuthRevResTBEB" */
+CONST_ENTRY(543)	/* "setct-AuthRevResTBS" */
+CONST_ENTRY(573)	/* "setct-AuthTokenTBE" */
+CONST_ENTRY(537)	/* "setct-AuthTokenTBS" */
+CONST_ENTRY(600)	/* "setct-BCIDistributionTBS" */
+CONST_ENTRY(558)	/* "setct-BatchAdminReqData" */
+CONST_ENTRY(592)	/* "setct-BatchAdminReqTBE" */
+CONST_ENTRY(559)	/* "setct-BatchAdminResData" */
+CONST_ENTRY(593)	/* "setct-BatchAdminResTBE" */
+CONST_ENTRY(599)	/* "setct-CRLNotificationResTBS" */
+CONST_ENTRY(598)	/* "setct-CRLNotificationTBS" */
+CONST_ENTRY(580)	/* "setct-CapReqTBE" */
+CONST_ENTRY(581)	/* "setct-CapReqTBEX" */
+CONST_ENTRY(544)	/* "setct-CapReqTBS" */
+CONST_ENTRY(545)	/* "setct-CapReqTBSX" */
+CONST_ENTRY(546)	/* "setct-CapResData" */
+CONST_ENTRY(582)	/* "setct-CapResTBE" */
+CONST_ENTRY(583)	/* "setct-CapRevReqTBE" */
+CONST_ENTRY(584)	/* "setct-CapRevReqTBEX" */
+CONST_ENTRY(547)	/* "setct-CapRevReqTBS" */
+CONST_ENTRY(548)	/* "setct-CapRevReqTBSX" */
+CONST_ENTRY(549)	/* "setct-CapRevResData" */
+CONST_ENTRY(585)	/* "setct-CapRevResTBE" */
+CONST_ENTRY(538)	/* "setct-CapTokenData" */
+CONST_ENTRY(530)	/* "setct-CapTokenSeq" */
+CONST_ENTRY(574)	/* "setct-CapTokenTBE" */
+CONST_ENTRY(575)	/* "setct-CapTokenTBEX" */
+CONST_ENTRY(539)	/* "setct-CapTokenTBS" */
+CONST_ENTRY(560)	/* "setct-CardCInitResTBS" */
+CONST_ENTRY(566)	/* "setct-CertInqReqTBS" */
+CONST_ENTRY(563)	/* "setct-CertReqData" */
+CONST_ENTRY(595)	/* "setct-CertReqTBE" */
+CONST_ENTRY(596)	/* "setct-CertReqTBEX" */
+CONST_ENTRY(564)	/* "setct-CertReqTBS" */
+CONST_ENTRY(565)	/* "setct-CertResData" */
+CONST_ENTRY(597)	/* "setct-CertResTBE" */
+CONST_ENTRY(586)	/* "setct-CredReqTBE" */
+CONST_ENTRY(587)	/* "setct-CredReqTBEX" */
+CONST_ENTRY(550)	/* "setct-CredReqTBS" */
+CONST_ENTRY(551)	/* "setct-CredReqTBSX" */
+CONST_ENTRY(552)	/* "setct-CredResData" */
+CONST_ENTRY(588)	/* "setct-CredResTBE" */
+CONST_ENTRY(589)	/* "setct-CredRevReqTBE" */
+CONST_ENTRY(590)	/* "setct-CredRevReqTBEX" */
+CONST_ENTRY(553)	/* "setct-CredRevReqTBS" */
+CONST_ENTRY(554)	/* "setct-CredRevReqTBSX" */
+CONST_ENTRY(555)	/* "setct-CredRevResData" */
+CONST_ENTRY(591)	/* "setct-CredRevResTBE" */
+CONST_ENTRY(567)	/* "setct-ErrorTBS" */
+CONST_ENTRY(526)	/* "setct-HODInput" */
+CONST_ENTRY(561)	/* "setct-MeAqCInitResTBS" */
+CONST_ENTRY(522)	/* "setct-OIData" */
+CONST_ENTRY(519)	/* "setct-PANData" */
+CONST_ENTRY(521)	/* "setct-PANOnly" */
+CONST_ENTRY(520)	/* "setct-PANToken" */
+CONST_ENTRY(556)	/* "setct-PCertReqData" */
+CONST_ENTRY(557)	/* "setct-PCertResTBS" */
+CONST_ENTRY(523)	/* "setct-PI" */
+CONST_ENTRY(532)	/* "setct-PI-TBS" */
+CONST_ENTRY(524)	/* "setct-PIData" */
+CONST_ENTRY(525)	/* "setct-PIDataUnsigned" */
+CONST_ENTRY(568)	/* "setct-PIDualSignedTBE" */
+CONST_ENTRY(569)	/* "setct-PIUnsignedTBE" */
+CONST_ENTRY(531)	/* "setct-PInitResData" */
+CONST_ENTRY(533)	/* "setct-PResData" */
+CONST_ENTRY(594)	/* "setct-RegFormReqTBE" */
+CONST_ENTRY(562)	/* "setct-RegFormResTBS" */
+CONST_ENTRY(606)	/* "setext-cv" */
+CONST_ENTRY(601)	/* "setext-genCrypt" */
+CONST_ENTRY(602)	/* "setext-miAuth" */
+CONST_ENTRY(604)	/* "setext-pinAny" */
+CONST_ENTRY(603)	/* "setext-pinSecure" */
+CONST_ENTRY(605)	/* "setext-track2" */
+CONST_ENTRY(52)	/* "signingTime" */
+CONST_ENTRY(454)	/* "simpleSecurityObject" */
+CONST_ENTRY(496)	/* "singleLevelQuality" */
+CONST_ENTRY(387)	/* "snmpv2" */
+CONST_ENTRY(660)	/* "street" */
+CONST_ENTRY(85)	/* "subjectAltName" */
+CONST_ENTRY(769)	/* "subjectDirectoryAttributes" */
+CONST_ENTRY(398)	/* "subjectInfoAccess" */
+CONST_ENTRY(82)	/* "subjectKeyIdentifier" */
+CONST_ENTRY(498)	/* "subtreeMaximumQuality" */
+CONST_ENTRY(497)	/* "subtreeMinimumQuality" */
+CONST_ENTRY(890)	/* "supportedAlgorithms" */
+CONST_ENTRY(874)	/* "supportedApplicationContext" */
+CONST_ENTRY(402)	/* "targetInformation" */
+CONST_ENTRY(864)	/* "telephoneNumber" */
+CONST_ENTRY(866)	/* "teletexTerminalIdentifier" */
+CONST_ENTRY(865)	/* "telexNumber" */
+CONST_ENTRY(459)	/* "textEncodedORAddress" */
+CONST_ENTRY(293)	/* "textNotice" */
+CONST_ENTRY(133)	/* "timeStamping" */
+CONST_ENTRY(106)	/* "title" */
+CONST_ENTRY(682)	/* "tpBasis" */
+CONST_ENTRY(375)	/* "trustRoot" */
+CONST_ENTRY(436)	/* "ucl" */
+CONST_ENTRY(888)	/* "uniqueMember" */
+CONST_ENTRY(55)	/* "unstructuredAddress" */
+CONST_ENTRY(49)	/* "unstructuredName" */
+CONST_ENTRY(880)	/* "userCertificate" */
+CONST_ENTRY(465)	/* "userClass" */
+CONST_ENTRY(879)	/* "userPassword" */
+CONST_ENTRY(373)	/* "valid" */
+CONST_ENTRY(678)	/* "wap" */
+CONST_ENTRY(679)	/* "wap-wsg" */
+CONST_ENTRY(735)	/* "wap-wsg-idm-ecid-wtls1" */
+CONST_ENTRY(743)	/* "wap-wsg-idm-ecid-wtls10" */
+CONST_ENTRY(744)	/* "wap-wsg-idm-ecid-wtls11" */
+CONST_ENTRY(745)	/* "wap-wsg-idm-ecid-wtls12" */
+CONST_ENTRY(736)	/* "wap-wsg-idm-ecid-wtls3" */
+CONST_ENTRY(737)	/* "wap-wsg-idm-ecid-wtls4" */
+CONST_ENTRY(738)	/* "wap-wsg-idm-ecid-wtls5" */
+CONST_ENTRY(739)	/* "wap-wsg-idm-ecid-wtls6" */
+CONST_ENTRY(740)	/* "wap-wsg-idm-ecid-wtls7" */
+CONST_ENTRY(741)	/* "wap-wsg-idm-ecid-wtls8" */
+CONST_ENTRY(742)	/* "wap-wsg-idm-ecid-wtls9" */
+CONST_ENTRY(804)	/* "whirlpool" */
+CONST_ENTRY(868)	/* "x121Address" */
+CONST_ENTRY(503)	/* "x500UniqueIdentifier" */
+CONST_ENTRY(158)	/* "x509Certificate" */
+CONST_ENTRY(160)	/* "x509Crl" */
+CONST_END(sn_objs)
+
+#endif // !OPERA_SMALL_VERSION
+
+#ifndef OPERA_SMALL_VERSION
+OPENSSL_PREFIX_CONST_ARRAY(static, unsigned int, ln_objs, libopeay)
+CONST_ENTRY(363)	/* "AD Time Stamping" */
+CONST_ENTRY(405)	/* "ANSI X9.62" */
+CONST_ENTRY(368)	/* "Acceptable OCSP Responses" */
+CONST_ENTRY(664)	/* "Any language" */
+CONST_ENTRY(177)	/* "Authority Information Access" */
+CONST_ENTRY(365)	/* "Basic OCSP Response" */
+CONST_ENTRY(285)	/* "Biometric Info" */
+CONST_ENTRY(179)	/* "CA Issuers" */
+CONST_ENTRY(785)	/* "CA Repository" */
+CONST_ENTRY(131)	/* "Code Signing" */
+CONST_ENTRY(783)	/* "Diffie-Hellman based MAC" */
+CONST_ENTRY(382)	/* "Directory" */
+CONST_ENTRY(392)	/* "Domain" */
+CONST_ENTRY(132)	/* "E-mail Protection" */
+CONST_ENTRY(389)	/* "Enterprises" */
+CONST_ENTRY(384)	/* "Experimental" */
+CONST_ENTRY(372)	/* "Extended OCSP Status" */
+CONST_ENTRY(172)	/* "Extension Request" */
+CONST_ENTRY(813)	/* "GOST 28147-89" */
+CONST_ENTRY(849)	/* "GOST 28147-89 Cryptocom ParamSet" */
+CONST_ENTRY(815)	/* "GOST 28147-89 MAC" */
+CONST_ENTRY(851)	/* "GOST 34.10-2001 Cryptocom" */
+CONST_ENTRY(850)	/* "GOST 34.10-94 Cryptocom" */
+CONST_ENTRY(811)	/* "GOST R 34.10-2001" */
+CONST_ENTRY(817)	/* "GOST R 34.10-2001 DH" */
+CONST_ENTRY(812)	/* "GOST R 34.10-94" */
+CONST_ENTRY(818)	/* "GOST R 34.10-94 DH" */
+CONST_ENTRY(809)	/* "GOST R 34.11-94" */
+CONST_ENTRY(816)	/* "GOST R 34.11-94 PRF" */
+CONST_ENTRY(807)	/* "GOST R 34.11-94 with GOST R 34.10-2001" */
+CONST_ENTRY(853)	/* "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom" */
+CONST_ENTRY(808)	/* "GOST R 34.11-94 with GOST R 34.10-94" */
+CONST_ENTRY(852)	/* "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom" */
+CONST_ENTRY(854)	/* "GOST R 3410-2001 Parameter Set Cryptocom" */
+CONST_ENTRY(810)	/* "HMAC GOST 34.11-94" */
+CONST_ENTRY(432)	/* "Hold Instruction Call Issuer" */
+CONST_ENTRY(430)	/* "Hold Instruction Code" */
+CONST_ENTRY(431)	/* "Hold Instruction None" */
+CONST_ENTRY(433)	/* "Hold Instruction Reject" */
+CONST_ENTRY(634)	/* "ICC or token signature" */
+CONST_ENTRY(294)	/* "IPSec End System" */
+CONST_ENTRY(295)	/* "IPSec Tunnel" */
+CONST_ENTRY(296)	/* "IPSec User" */
+CONST_ENTRY(182)	/* "ISO Member Body" */
+CONST_ENTRY(183)	/* "ISO US Member Body" */
+CONST_ENTRY(667)	/* "Independent" */
+CONST_ENTRY(665)	/* "Inherit all" */
+CONST_ENTRY(647)	/* "International Organizations" */
+CONST_ENTRY(142)	/* "Invalidity Date" */
+CONST_ENTRY(504)	/* "MIME MHS" */
+CONST_ENTRY(388)	/* "Mail" */
+CONST_ENTRY(383)	/* "Management" */
+CONST_ENTRY(417)	/* "Microsoft CSP Name" */
+CONST_ENTRY(135)	/* "Microsoft Commercial Code Signing" */
+CONST_ENTRY(138)	/* "Microsoft Encrypted File System" */
+CONST_ENTRY(171)	/* "Microsoft Extension Request" */
+CONST_ENTRY(134)	/* "Microsoft Individual Code Signing" */
+CONST_ENTRY(856)	/* "Microsoft Local Key set" */
+CONST_ENTRY(137)	/* "Microsoft Server Gated Crypto" */
+CONST_ENTRY(648)	/* "Microsoft Smartcardlogin" */
+CONST_ENTRY(136)	/* "Microsoft Trust List Signing" */
+CONST_ENTRY(649)	/* "Microsoft Universal Principal Name" */
+CONST_ENTRY(393)	/* "NULL" */
+CONST_ENTRY(404)	/* "NULL" */
+CONST_ENTRY(72)	/* "Netscape Base Url" */
+CONST_ENTRY(76)	/* "Netscape CA Policy Url" */
+CONST_ENTRY(74)	/* "Netscape CA Revocation Url" */
+CONST_ENTRY(71)	/* "Netscape Cert Type" */
+CONST_ENTRY(58)	/* "Netscape Certificate Extension" */
+CONST_ENTRY(79)	/* "Netscape Certificate Sequence" */
+CONST_ENTRY(78)	/* "Netscape Comment" */
+CONST_ENTRY(57)	/* "Netscape Communications Corp." */
+CONST_ENTRY(59)	/* "Netscape Data Type" */
+CONST_ENTRY(75)	/* "Netscape Renewal Url" */
+CONST_ENTRY(73)	/* "Netscape Revocation Url" */
+CONST_ENTRY(77)	/* "Netscape SSL Server Name" */
+CONST_ENTRY(139)	/* "Netscape Server Gated Crypto" */
+CONST_ENTRY(178)	/* "OCSP" */
+CONST_ENTRY(370)	/* "OCSP Archive Cutoff" */
+CONST_ENTRY(367)	/* "OCSP CRL ID" */
+CONST_ENTRY(369)	/* "OCSP No Check" */
+CONST_ENTRY(366)	/* "OCSP Nonce" */
+CONST_ENTRY(371)	/* "OCSP Service Locator" */
+CONST_ENTRY(180)	/* "OCSP Signing" */
+CONST_ENTRY(161)	/* "PBES2" */
+CONST_ENTRY(69)	/* "PBKDF2" */
+CONST_ENTRY(162)	/* "PBMAC1" */
+CONST_ENTRY(127)	/* "PKIX" */
+CONST_ENTRY(858)	/* "Permanent Identifier" */
+CONST_ENTRY(164)	/* "Policy Qualifier CPS" */
+CONST_ENTRY(165)	/* "Policy Qualifier User Notice" */
+CONST_ENTRY(385)	/* "Private" */
+CONST_ENTRY(663)	/* "Proxy Certificate Information" */
+CONST_ENTRY( 1)	/* "RSA Data Security, Inc." */
+CONST_ENTRY( 2)	/* "RSA Data Security, Inc. PKCS" */
+CONST_ENTRY(188)	/* "S/MIME" */
+CONST_ENTRY(167)	/* "S/MIME Capabilities" */
+CONST_ENTRY(387)	/* "SNMPv2" */
+CONST_ENTRY(512)	/* "Secure Electronic Transactions" */
+CONST_ENTRY(386)	/* "Security" */
+CONST_ENTRY(394)	/* "Selected Attribute Types" */
+CONST_ENTRY(143)	/* "Strong Extranet ID" */
+CONST_ENTRY(398)	/* "Subject Information Access" */
+CONST_ENTRY(130)	/* "TLS Web Client Authentication" */
+CONST_ENTRY(129)	/* "TLS Web Server Authentication" */
+CONST_ENTRY(133)	/* "Time Stamping" */
+CONST_ENTRY(375)	/* "Trust Root" */
+CONST_ENTRY(12)	/* "X509" */
+CONST_ENTRY(402)	/* "X509v3 AC Targeting" */
+CONST_ENTRY(746)	/* "X509v3 Any Policy" */
+CONST_ENTRY(90)	/* "X509v3 Authority Key Identifier" */
+CONST_ENTRY(87)	/* "X509v3 Basic Constraints" */
+CONST_ENTRY(103)	/* "X509v3 CRL Distribution Points" */
+CONST_ENTRY(88)	/* "X509v3 CRL Number" */
+CONST_ENTRY(141)	/* "X509v3 CRL Reason Code" */
+CONST_ENTRY(771)	/* "X509v3 Certificate Issuer" */
+CONST_ENTRY(89)	/* "X509v3 Certificate Policies" */
+CONST_ENTRY(140)	/* "X509v3 Delta CRL Indicator" */
+CONST_ENTRY(126)	/* "X509v3 Extended Key Usage" */
+CONST_ENTRY(857)	/* "X509v3 Freshest CRL" */
+CONST_ENTRY(748)	/* "X509v3 Inhibit Any Policy" */
+CONST_ENTRY(86)	/* "X509v3 Issuer Alternative Name" */
+CONST_ENTRY(770)	/* "X509v3 Issuing Distrubution Point" */
+CONST_ENTRY(83)	/* "X509v3 Key Usage" */
+CONST_ENTRY(666)	/* "X509v3 Name Constraints" */
+CONST_ENTRY(403)	/* "X509v3 No Revocation Available" */
+CONST_ENTRY(401)	/* "X509v3 Policy Constraints" */
+CONST_ENTRY(747)	/* "X509v3 Policy Mappings" */
+CONST_ENTRY(84)	/* "X509v3 Private Key Usage Period" */
+CONST_ENTRY(85)	/* "X509v3 Subject Alternative Name" */
+CONST_ENTRY(769)	/* "X509v3 Subject Directory Attributes" */
+CONST_ENTRY(82)	/* "X509v3 Subject Key Identifier" */
+CONST_ENTRY(184)	/* "X9.57" */
+CONST_ENTRY(185)	/* "X9.57 CM ?" */
+CONST_ENTRY(478)	/* "aRecord" */
+CONST_ENTRY(289)	/* "aaControls" */
+CONST_ENTRY(287)	/* "ac-auditEntity" */
+CONST_ENTRY(397)	/* "ac-proxying" */
+CONST_ENTRY(288)	/* "ac-targeting" */
+CONST_ENTRY(446)	/* "account" */
+CONST_ENTRY(364)	/* "ad dvcs" */
+CONST_ENTRY(606)	/* "additional verification" */
+CONST_ENTRY(419)	/* "aes-128-cbc" */
+CONST_ENTRY(421)	/* "aes-128-cfb" */
+CONST_ENTRY(650)	/* "aes-128-cfb1" */
+CONST_ENTRY(653)	/* "aes-128-cfb8" */
+CONST_ENTRY(418)	/* "aes-128-ecb" */
+CONST_ENTRY(420)	/* "aes-128-ofb" */
+CONST_ENTRY(423)	/* "aes-192-cbc" */
+CONST_ENTRY(425)	/* "aes-192-cfb" */
+CONST_ENTRY(651)	/* "aes-192-cfb1" */
+CONST_ENTRY(654)	/* "aes-192-cfb8" */
+CONST_ENTRY(422)	/* "aes-192-ecb" */
+CONST_ENTRY(424)	/* "aes-192-ofb" */
+CONST_ENTRY(427)	/* "aes-256-cbc" */
+CONST_ENTRY(429)	/* "aes-256-cfb" */
+CONST_ENTRY(652)	/* "aes-256-cfb1" */
+CONST_ENTRY(655)	/* "aes-256-cfb8" */
+CONST_ENTRY(426)	/* "aes-256-ecb" */
+CONST_ENTRY(428)	/* "aes-256-ofb" */
+CONST_ENTRY(376)	/* "algorithm" */
+CONST_ENTRY(484)	/* "associatedDomain" */
+CONST_ENTRY(485)	/* "associatedName" */
+CONST_ENTRY(501)	/* "audio" */
+CONST_ENTRY(882)	/* "authorityRevocationList" */
+CONST_ENTRY(91)	/* "bf-cbc" */
+CONST_ENTRY(93)	/* "bf-cfb" */
+CONST_ENTRY(92)	/* "bf-ecb" */
+CONST_ENTRY(94)	/* "bf-ofb" */
+CONST_ENTRY(494)	/* "buildingName" */
+CONST_ENTRY(860)	/* "businessCategory" */
+CONST_ENTRY(691)	/* "c2onb191v4" */
+CONST_ENTRY(692)	/* "c2onb191v5" */
+CONST_ENTRY(697)	/* "c2onb239v4" */
+CONST_ENTRY(698)	/* "c2onb239v5" */
+CONST_ENTRY(684)	/* "c2pnb163v1" */
+CONST_ENTRY(685)	/* "c2pnb163v2" */
+CONST_ENTRY(686)	/* "c2pnb163v3" */
+CONST_ENTRY(687)	/* "c2pnb176v1" */
+CONST_ENTRY(693)	/* "c2pnb208w1" */
+CONST_ENTRY(699)	/* "c2pnb272w1" */
+CONST_ENTRY(700)	/* "c2pnb304w1" */
+CONST_ENTRY(702)	/* "c2pnb368w1" */
+CONST_ENTRY(688)	/* "c2tnb191v1" */
+CONST_ENTRY(689)	/* "c2tnb191v2" */
+CONST_ENTRY(690)	/* "c2tnb191v3" */
+CONST_ENTRY(694)	/* "c2tnb239v1" */
+CONST_ENTRY(695)	/* "c2tnb239v2" */
+CONST_ENTRY(696)	/* "c2tnb239v3" */
+CONST_ENTRY(701)	/* "c2tnb359v1" */
+CONST_ENTRY(703)	/* "c2tnb431r1" */
+CONST_ENTRY(881)	/* "cACertificate" */
+CONST_ENTRY(483)	/* "cNAMERecord" */
+CONST_ENTRY(751)	/* "camellia-128-cbc" */
+CONST_ENTRY(757)	/* "camellia-128-cfb" */
+CONST_ENTRY(760)	/* "camellia-128-cfb1" */
+CONST_ENTRY(763)	/* "camellia-128-cfb8" */
+CONST_ENTRY(754)	/* "camellia-128-ecb" */
+CONST_ENTRY(766)	/* "camellia-128-ofb" */
+CONST_ENTRY(752)	/* "camellia-192-cbc" */
+CONST_ENTRY(758)	/* "camellia-192-cfb" */
+CONST_ENTRY(761)	/* "camellia-192-cfb1" */
+CONST_ENTRY(764)	/* "camellia-192-cfb8" */
+CONST_ENTRY(755)	/* "camellia-192-ecb" */
+CONST_ENTRY(767)	/* "camellia-192-ofb" */
+CONST_ENTRY(753)	/* "camellia-256-cbc" */
+CONST_ENTRY(759)	/* "camellia-256-cfb" */
+CONST_ENTRY(762)	/* "camellia-256-cfb1" */
+CONST_ENTRY(765)	/* "camellia-256-cfb8" */
+CONST_ENTRY(756)	/* "camellia-256-ecb" */
+CONST_ENTRY(768)	/* "camellia-256-ofb" */
+CONST_ENTRY(443)	/* "caseIgnoreIA5StringSyntax" */
+CONST_ENTRY(108)	/* "cast5-cbc" */
+CONST_ENTRY(110)	/* "cast5-cfb" */
+CONST_ENTRY(109)	/* "cast5-ecb" */
+CONST_ENTRY(111)	/* "cast5-ofb" */
+CONST_ENTRY(152)	/* "certBag" */
+CONST_ENTRY(677)	/* "certicom-arc" */
+CONST_ENTRY(517)	/* "certificate extensions" */
+CONST_ENTRY(883)	/* "certificateRevocationList" */
+CONST_ENTRY(54)	/* "challengePassword" */
+CONST_ENTRY(407)	/* "characteristic-two-field" */
+CONST_ENTRY(395)	/* "clearance" */
+CONST_ENTRY(633)	/* "cleartext track 2" */
+CONST_ENTRY(13)	/* "commonName" */
+CONST_ENTRY(513)	/* "content types" */
+CONST_ENTRY(50)	/* "contentType" */
+CONST_ENTRY(53)	/* "countersignature" */
+CONST_ENTRY(14)	/* "countryName" */
+CONST_ENTRY(153)	/* "crlBag" */
+CONST_ENTRY(884)	/* "crossCertificatePair" */
+CONST_ENTRY(806)	/* "cryptocom" */
+CONST_ENTRY(805)	/* "cryptopro" */
+CONST_ENTRY(500)	/* "dITRedirect" */
+CONST_ENTRY(451)	/* "dNSDomain" */
+CONST_ENTRY(495)	/* "dSAQuality" */
+CONST_ENTRY(434)	/* "data" */
+CONST_ENTRY(390)	/* "dcObject" */
+CONST_ENTRY(891)	/* "deltaRevocationList" */
+CONST_ENTRY(31)	/* "des-cbc" */
+CONST_ENTRY(643)	/* "des-cdmf" */
+CONST_ENTRY(30)	/* "des-cfb" */
+CONST_ENTRY(656)	/* "des-cfb1" */
+CONST_ENTRY(657)	/* "des-cfb8" */
+CONST_ENTRY(29)	/* "des-ecb" */
+CONST_ENTRY(32)	/* "des-ede" */
+CONST_ENTRY(43)	/* "des-ede-cbc" */
+CONST_ENTRY(60)	/* "des-ede-cfb" */
+CONST_ENTRY(62)	/* "des-ede-ofb" */
+CONST_ENTRY(33)	/* "des-ede3" */
+CONST_ENTRY(44)	/* "des-ede3-cbc" */
+CONST_ENTRY(61)	/* "des-ede3-cfb" */
+CONST_ENTRY(658)	/* "des-ede3-cfb1" */
+CONST_ENTRY(659)	/* "des-ede3-cfb8" */
+CONST_ENTRY(63)	/* "des-ede3-ofb" */
+CONST_ENTRY(45)	/* "des-ofb" */
+CONST_ENTRY(107)	/* "description" */
+CONST_ENTRY(871)	/* "destinationIndicator" */
+CONST_ENTRY(80)	/* "desx-cbc" */
+CONST_ENTRY(28)	/* "dhKeyAgreement" */
+CONST_ENTRY(11)	/* "directory services (X.500)" */
+CONST_ENTRY(378)	/* "directory services - algorithms" */
+CONST_ENTRY(887)	/* "distinguishedName" */
+CONST_ENTRY(892)	/* "dmdName" */
+CONST_ENTRY(174)	/* "dnQualifier" */
+CONST_ENTRY(447)	/* "document" */
+CONST_ENTRY(471)	/* "documentAuthor" */
+CONST_ENTRY(468)	/* "documentIdentifier" */
+CONST_ENTRY(472)	/* "documentLocation" */
+CONST_ENTRY(502)	/* "documentPublisher" */
+CONST_ENTRY(449)	/* "documentSeries" */
+CONST_ENTRY(469)	/* "documentTitle" */
+CONST_ENTRY(470)	/* "documentVersion" */
+CONST_ENTRY(380)	/* "dod" */
+CONST_ENTRY(391)	/* "domainComponent" */
+CONST_ENTRY(452)	/* "domainRelatedObject" */
+CONST_ENTRY(116)	/* "dsaEncryption" */
+CONST_ENTRY(67)	/* "dsaEncryption-old" */
+CONST_ENTRY(66)	/* "dsaWithSHA" */
+CONST_ENTRY(113)	/* "dsaWithSHA1" */
+CONST_ENTRY(70)	/* "dsaWithSHA1-old" */
+CONST_ENTRY(802)	/* "dsa_with_SHA224" */
+CONST_ENTRY(803)	/* "dsa_with_SHA256" */
+CONST_ENTRY(297)	/* "dvcs" */
+CONST_ENTRY(791)	/* "ecdsa-with-Recommended" */
+CONST_ENTRY(416)	/* "ecdsa-with-SHA1" */
+CONST_ENTRY(793)	/* "ecdsa-with-SHA224" */
+CONST_ENTRY(794)	/* "ecdsa-with-SHA256" */
+CONST_ENTRY(795)	/* "ecdsa-with-SHA384" */
+CONST_ENTRY(796)	/* "ecdsa-with-SHA512" */
+CONST_ENTRY(792)	/* "ecdsa-with-Specified" */
+CONST_ENTRY(48)	/* "emailAddress" */
+CONST_ENTRY(632)	/* "encrypted track 2" */
+CONST_ENTRY(885)	/* "enhancedSearchGuide" */
+CONST_ENTRY(56)	/* "extendedCertificateAttributes" */
+CONST_ENTRY(867)	/* "facsimileTelephoneNumber" */
+CONST_ENTRY(462)	/* "favouriteDrink" */
+CONST_ENTRY(453)	/* "friendlyCountry" */
+CONST_ENTRY(490)	/* "friendlyCountryName" */
+CONST_ENTRY(156)	/* "friendlyName" */
+CONST_ENTRY(631)	/* "generate cryptogram" */
+CONST_ENTRY(509)	/* "generationQualifier" */
+CONST_ENTRY(601)	/* "generic cryptogram" */
+CONST_ENTRY(99)	/* "givenName" */
+CONST_ENTRY(814)	/* "gost89-cnt" */
+CONST_ENTRY(855)	/* "hmac" */
+CONST_ENTRY(780)	/* "hmac-md5" */
+CONST_ENTRY(781)	/* "hmac-sha1" */
+CONST_ENTRY(797)	/* "hmacWithMD5" */
+CONST_ENTRY(163)	/* "hmacWithSHA1" */
+CONST_ENTRY(798)	/* "hmacWithSHA224" */
+CONST_ENTRY(799)	/* "hmacWithSHA256" */
+CONST_ENTRY(800)	/* "hmacWithSHA384" */
+CONST_ENTRY(801)	/* "hmacWithSHA512" */
+CONST_ENTRY(486)	/* "homePostalAddress" */
+CONST_ENTRY(473)	/* "homeTelephoneNumber" */
+CONST_ENTRY(466)	/* "host" */
+CONST_ENTRY(889)	/* "houseIdentifier" */
+CONST_ENTRY(442)	/* "iA5StringSyntax" */
+CONST_ENTRY(381)	/* "iana" */
+CONST_ENTRY(824)	/* "id-Gost28147-89-CryptoPro-A-ParamSet" */
+CONST_ENTRY(825)	/* "id-Gost28147-89-CryptoPro-B-ParamSet" */
+CONST_ENTRY(826)	/* "id-Gost28147-89-CryptoPro-C-ParamSet" */
+CONST_ENTRY(827)	/* "id-Gost28147-89-CryptoPro-D-ParamSet" */
+CONST_ENTRY(819)	/* "id-Gost28147-89-CryptoPro-KeyMeshing" */
+CONST_ENTRY(829)	/* "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" */
+CONST_ENTRY(828)	/* "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" */
+CONST_ENTRY(830)	/* "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" */
+CONST_ENTRY(820)	/* "id-Gost28147-89-None-KeyMeshing" */
+CONST_ENTRY(823)	/* "id-Gost28147-89-TestParamSet" */
+CONST_ENTRY(840)	/* "id-GostR3410-2001-CryptoPro-A-ParamSet" */
+CONST_ENTRY(841)	/* "id-GostR3410-2001-CryptoPro-B-ParamSet" */
+CONST_ENTRY(842)	/* "id-GostR3410-2001-CryptoPro-C-ParamSet" */
+CONST_ENTRY(843)	/* "id-GostR3410-2001-CryptoPro-XchA-ParamSet" */
+CONST_ENTRY(844)	/* "id-GostR3410-2001-CryptoPro-XchB-ParamSet" */
+CONST_ENTRY(839)	/* "id-GostR3410-2001-TestParamSet" */
+CONST_ENTRY(832)	/* "id-GostR3410-94-CryptoPro-A-ParamSet" */
+CONST_ENTRY(833)	/* "id-GostR3410-94-CryptoPro-B-ParamSet" */
+CONST_ENTRY(834)	/* "id-GostR3410-94-CryptoPro-C-ParamSet" */
+CONST_ENTRY(835)	/* "id-GostR3410-94-CryptoPro-D-ParamSet" */
+CONST_ENTRY(836)	/* "id-GostR3410-94-CryptoPro-XchA-ParamSet" */
+CONST_ENTRY(837)	/* "id-GostR3410-94-CryptoPro-XchB-ParamSet" */
+CONST_ENTRY(838)	/* "id-GostR3410-94-CryptoPro-XchC-ParamSet" */
+CONST_ENTRY(831)	/* "id-GostR3410-94-TestParamSet" */
+CONST_ENTRY(845)	/* "id-GostR3410-94-a" */
+CONST_ENTRY(846)	/* "id-GostR3410-94-aBis" */
+CONST_ENTRY(847)	/* "id-GostR3410-94-b" */
+CONST_ENTRY(848)	/* "id-GostR3410-94-bBis" */
+CONST_ENTRY(822)	/* "id-GostR3411-94-CryptoProParamSet" */
+CONST_ENTRY(821)	/* "id-GostR3411-94-TestParamSet" */
+CONST_ENTRY(266)	/* "id-aca" */
+CONST_ENTRY(355)	/* "id-aca-accessIdentity" */
+CONST_ENTRY(354)	/* "id-aca-authenticationInfo" */
+CONST_ENTRY(356)	/* "id-aca-chargingIdentity" */
+CONST_ENTRY(399)	/* "id-aca-encAttrs" */
+CONST_ENTRY(357)	/* "id-aca-group" */
+CONST_ENTRY(358)	/* "id-aca-role" */
+CONST_ENTRY(176)	/* "id-ad" */
+CONST_ENTRY(788)	/* "id-aes128-wrap" */
+CONST_ENTRY(789)	/* "id-aes192-wrap" */
+CONST_ENTRY(790)	/* "id-aes256-wrap" */
+CONST_ENTRY(262)	/* "id-alg" */
+CONST_ENTRY(323)	/* "id-alg-des40" */
+CONST_ENTRY(326)	/* "id-alg-dh-pop" */
+CONST_ENTRY(325)	/* "id-alg-dh-sig-hmac-sha1" */
+CONST_ENTRY(324)	/* "id-alg-noSignature" */
+CONST_ENTRY(268)	/* "id-cct" */
+CONST_ENTRY(361)	/* "id-cct-PKIData" */
+CONST_ENTRY(362)	/* "id-cct-PKIResponse" */
+CONST_ENTRY(360)	/* "id-cct-crs" */
+CONST_ENTRY(81)	/* "id-ce" */
+CONST_ENTRY(680)	/* "id-characteristic-two-basis" */
+CONST_ENTRY(263)	/* "id-cmc" */
+CONST_ENTRY(334)	/* "id-cmc-addExtensions" */
+CONST_ENTRY(346)	/* "id-cmc-confirmCertAcceptance" */
+CONST_ENTRY(330)	/* "id-cmc-dataReturn" */
+CONST_ENTRY(336)	/* "id-cmc-decryptedPOP" */
+CONST_ENTRY(335)	/* "id-cmc-encryptedPOP" */
+CONST_ENTRY(339)	/* "id-cmc-getCRL" */
+CONST_ENTRY(338)	/* "id-cmc-getCert" */
+CONST_ENTRY(328)	/* "id-cmc-identification" */
+CONST_ENTRY(329)	/* "id-cmc-identityProof" */
+CONST_ENTRY(337)	/* "id-cmc-lraPOPWitness" */
+CONST_ENTRY(344)	/* "id-cmc-popLinkRandom" */
+CONST_ENTRY(345)	/* "id-cmc-popLinkWitness" */
+CONST_ENTRY(343)	/* "id-cmc-queryPending" */
+CONST_ENTRY(333)	/* "id-cmc-recipientNonce" */
+CONST_ENTRY(341)	/* "id-cmc-regInfo" */
+CONST_ENTRY(342)	/* "id-cmc-responseInfo" */
+CONST_ENTRY(340)	/* "id-cmc-revokeRequest" */
+CONST_ENTRY(332)	/* "id-cmc-senderNonce" */
+CONST_ENTRY(327)	/* "id-cmc-statusInfo" */
+CONST_ENTRY(331)	/* "id-cmc-transactionId" */
+CONST_ENTRY(787)	/* "id-ct-asciiTextWithCRLF" */
+CONST_ENTRY(408)	/* "id-ecPublicKey" */
+CONST_ENTRY(508)	/* "id-hex-multipart-message" */
+CONST_ENTRY(507)	/* "id-hex-partial-message" */
+CONST_ENTRY(260)	/* "id-it" */
+CONST_ENTRY(302)	/* "id-it-caKeyUpdateInfo" */
+CONST_ENTRY(298)	/* "id-it-caProtEncCert" */
+CONST_ENTRY(311)	/* "id-it-confirmWaitTime" */
+CONST_ENTRY(303)	/* "id-it-currentCRL" */
+CONST_ENTRY(300)	/* "id-it-encKeyPairTypes" */
+CONST_ENTRY(310)	/* "id-it-implicitConfirm" */
+CONST_ENTRY(308)	/* "id-it-keyPairParamRep" */
+CONST_ENTRY(307)	/* "id-it-keyPairParamReq" */
+CONST_ENTRY(312)	/* "id-it-origPKIMessage" */
+CONST_ENTRY(301)	/* "id-it-preferredSymmAlg" */
+CONST_ENTRY(309)	/* "id-it-revPassphrase" */
+CONST_ENTRY(299)	/* "id-it-signKeyPairTypes" */
+CONST_ENTRY(305)	/* "id-it-subscriptionRequest" */
+CONST_ENTRY(306)	/* "id-it-subscriptionResponse" */
+CONST_ENTRY(784)	/* "id-it-suppLangTags" */
+CONST_ENTRY(304)	/* "id-it-unsupportedOIDs" */
+CONST_ENTRY(128)	/* "id-kp" */
+CONST_ENTRY(280)	/* "id-mod-attribute-cert" */
+CONST_ENTRY(274)	/* "id-mod-cmc" */
+CONST_ENTRY(277)	/* "id-mod-cmp" */
+CONST_ENTRY(284)	/* "id-mod-cmp2000" */
+CONST_ENTRY(273)	/* "id-mod-crmf" */
+CONST_ENTRY(283)	/* "id-mod-dvcs" */
+CONST_ENTRY(275)	/* "id-mod-kea-profile-88" */
+CONST_ENTRY(276)	/* "id-mod-kea-profile-93" */
+CONST_ENTRY(282)	/* "id-mod-ocsp" */
+CONST_ENTRY(278)	/* "id-mod-qualified-cert-88" */
+CONST_ENTRY(279)	/* "id-mod-qualified-cert-93" */
+CONST_ENTRY(281)	/* "id-mod-timestamp-protocol" */
+CONST_ENTRY(264)	/* "id-on" */
+CONST_ENTRY(347)	/* "id-on-personalData" */
+CONST_ENTRY(265)	/* "id-pda" */
+CONST_ENTRY(352)	/* "id-pda-countryOfCitizenship" */
+CONST_ENTRY(353)	/* "id-pda-countryOfResidence" */
+CONST_ENTRY(348)	/* "id-pda-dateOfBirth" */
+CONST_ENTRY(351)	/* "id-pda-gender" */
+CONST_ENTRY(349)	/* "id-pda-placeOfBirth" */
+CONST_ENTRY(175)	/* "id-pe" */
+CONST_ENTRY(261)	/* "id-pkip" */
+CONST_ENTRY(258)	/* "id-pkix-mod" */
+CONST_ENTRY(269)	/* "id-pkix1-explicit-88" */
+CONST_ENTRY(271)	/* "id-pkix1-explicit-93" */
+CONST_ENTRY(270)	/* "id-pkix1-implicit-88" */
+CONST_ENTRY(272)	/* "id-pkix1-implicit-93" */
+CONST_ENTRY(662)	/* "id-ppl" */
+CONST_ENTRY(267)	/* "id-qcs" */
+CONST_ENTRY(359)	/* "id-qcs-pkixQCSyntax-v1" */
+CONST_ENTRY(259)	/* "id-qt" */
+CONST_ENTRY(313)	/* "id-regCtrl" */
+CONST_ENTRY(316)	/* "id-regCtrl-authenticator" */
+CONST_ENTRY(319)	/* "id-regCtrl-oldCertID" */
+CONST_ENTRY(318)	/* "id-regCtrl-pkiArchiveOptions" */
+CONST_ENTRY(317)	/* "id-regCtrl-pkiPublicationInfo" */
+CONST_ENTRY(320)	/* "id-regCtrl-protocolEncrKey" */
+CONST_ENTRY(315)	/* "id-regCtrl-regToken" */
+CONST_ENTRY(314)	/* "id-regInfo" */
+CONST_ENTRY(322)	/* "id-regInfo-certReq" */
+CONST_ENTRY(321)	/* "id-regInfo-utf8Pairs" */
+CONST_ENTRY(191)	/* "id-smime-aa" */
+CONST_ENTRY(215)	/* "id-smime-aa-contentHint" */
+CONST_ENTRY(218)	/* "id-smime-aa-contentIdentifier" */
+CONST_ENTRY(221)	/* "id-smime-aa-contentReference" */
+CONST_ENTRY(240)	/* "id-smime-aa-dvcs-dvc" */
+CONST_ENTRY(217)	/* "id-smime-aa-encapContentType" */
+CONST_ENTRY(222)	/* "id-smime-aa-encrypKeyPref" */
+CONST_ENTRY(220)	/* "id-smime-aa-equivalentLabels" */
+CONST_ENTRY(232)	/* "id-smime-aa-ets-CertificateRefs" */
+CONST_ENTRY(233)	/* "id-smime-aa-ets-RevocationRefs" */
+CONST_ENTRY(238)	/* "id-smime-aa-ets-archiveTimeStamp" */
+CONST_ENTRY(237)	/* "id-smime-aa-ets-certCRLTimestamp" */
+CONST_ENTRY(234)	/* "id-smime-aa-ets-certValues" */
+CONST_ENTRY(227)	/* "id-smime-aa-ets-commitmentType" */
+CONST_ENTRY(231)	/* "id-smime-aa-ets-contentTimestamp" */
+CONST_ENTRY(236)	/* "id-smime-aa-ets-escTimeStamp" */
+CONST_ENTRY(230)	/* "id-smime-aa-ets-otherSigCert" */
+CONST_ENTRY(235)	/* "id-smime-aa-ets-revocationValues" */
+CONST_ENTRY(226)	/* "id-smime-aa-ets-sigPolicyId" */
+CONST_ENTRY(229)	/* "id-smime-aa-ets-signerAttr" */
+CONST_ENTRY(228)	/* "id-smime-aa-ets-signerLocation" */
+CONST_ENTRY(219)	/* "id-smime-aa-macValue" */
+CONST_ENTRY(214)	/* "id-smime-aa-mlExpandHistory" */
+CONST_ENTRY(216)	/* "id-smime-aa-msgSigDigest" */
+CONST_ENTRY(212)	/* "id-smime-aa-receiptRequest" */
+CONST_ENTRY(213)	/* "id-smime-aa-securityLabel" */
+CONST_ENTRY(239)	/* "id-smime-aa-signatureType" */
+CONST_ENTRY(223)	/* "id-smime-aa-signingCertificate" */
+CONST_ENTRY(224)	/* "id-smime-aa-smimeEncryptCerts" */
+CONST_ENTRY(225)	/* "id-smime-aa-timeStampToken" */
+CONST_ENTRY(192)	/* "id-smime-alg" */
+CONST_ENTRY(243)	/* "id-smime-alg-3DESwrap" */
+CONST_ENTRY(246)	/* "id-smime-alg-CMS3DESwrap" */
+CONST_ENTRY(247)	/* "id-smime-alg-CMSRC2wrap" */
+CONST_ENTRY(245)	/* "id-smime-alg-ESDH" */
+CONST_ENTRY(241)	/* "id-smime-alg-ESDHwith3DES" */
+CONST_ENTRY(242)	/* "id-smime-alg-ESDHwithRC2" */
+CONST_ENTRY(244)	/* "id-smime-alg-RC2wrap" */
+CONST_ENTRY(193)	/* "id-smime-cd" */
+CONST_ENTRY(248)	/* "id-smime-cd-ldap" */
+CONST_ENTRY(190)	/* "id-smime-ct" */
+CONST_ENTRY(210)	/* "id-smime-ct-DVCSRequestData" */
+CONST_ENTRY(211)	/* "id-smime-ct-DVCSResponseData" */
+CONST_ENTRY(208)	/* "id-smime-ct-TDTInfo" */
+CONST_ENTRY(207)	/* "id-smime-ct-TSTInfo" */
+CONST_ENTRY(205)	/* "id-smime-ct-authData" */
+CONST_ENTRY(786)	/* "id-smime-ct-compressedData" */
+CONST_ENTRY(209)	/* "id-smime-ct-contentInfo" */
+CONST_ENTRY(206)	/* "id-smime-ct-publishCert" */
+CONST_ENTRY(204)	/* "id-smime-ct-receipt" */
+CONST_ENTRY(195)	/* "id-smime-cti" */
+CONST_ENTRY(255)	/* "id-smime-cti-ets-proofOfApproval" */
+CONST_ENTRY(256)	/* "id-smime-cti-ets-proofOfCreation" */
+CONST_ENTRY(253)	/* "id-smime-cti-ets-proofOfDelivery" */
+CONST_ENTRY(251)	/* "id-smime-cti-ets-proofOfOrigin" */
+CONST_ENTRY(252)	/* "id-smime-cti-ets-proofOfReceipt" */
+CONST_ENTRY(254)	/* "id-smime-cti-ets-proofOfSender" */
+CONST_ENTRY(189)	/* "id-smime-mod" */
+CONST_ENTRY(196)	/* "id-smime-mod-cms" */
+CONST_ENTRY(197)	/* "id-smime-mod-ess" */
+CONST_ENTRY(202)	/* "id-smime-mod-ets-eSigPolicy-88" */
+CONST_ENTRY(203)	/* "id-smime-mod-ets-eSigPolicy-97" */
+CONST_ENTRY(200)	/* "id-smime-mod-ets-eSignature-88" */
+CONST_ENTRY(201)	/* "id-smime-mod-ets-eSignature-97" */
+CONST_ENTRY(199)	/* "id-smime-mod-msg-v3" */
+CONST_ENTRY(198)	/* "id-smime-mod-oid" */
+CONST_ENTRY(194)	/* "id-smime-spq" */
+CONST_ENTRY(250)	/* "id-smime-spq-ets-sqt-unotice" */
+CONST_ENTRY(249)	/* "id-smime-spq-ets-sqt-uri" */
+CONST_ENTRY(34)	/* "idea-cbc" */
+CONST_ENTRY(35)	/* "idea-cfb" */
+CONST_ENTRY(36)	/* "idea-ecb" */
+CONST_ENTRY(46)	/* "idea-ofb" */
+CONST_ENTRY(676)	/* "identified-organization" */
+CONST_ENTRY(461)	/* "info" */
+CONST_ENTRY(101)	/* "initials" */
+CONST_ENTRY(869)	/* "internationaliSDNNumber" */
+CONST_ENTRY(749)	/* "ipsec3" */
+CONST_ENTRY(750)	/* "ipsec4" */
+CONST_ENTRY(181)	/* "iso" */
+CONST_ENTRY(623)	/* "issuer capabilities" */
+CONST_ENTRY(645)	/* "itu-t" */
+CONST_ENTRY(492)	/* "janetMailbox" */
+CONST_ENTRY(646)	/* "joint-iso-itu-t" */
+CONST_ENTRY(150)	/* "keyBag" */
+CONST_ENTRY(773)	/* "kisa" */
+CONST_ENTRY(477)	/* "lastModifiedBy" */
+CONST_ENTRY(476)	/* "lastModifiedTime" */
+CONST_ENTRY(157)	/* "localKeyID" */
+CONST_ENTRY(15)	/* "localityName" */
+CONST_ENTRY(480)	/* "mXRecord" */
+CONST_ENTRY(493)	/* "mailPreferenceOption" */
+CONST_ENTRY(467)	/* "manager" */
+CONST_ENTRY( 3)	/* "md2" */
+CONST_ENTRY( 7)	/* "md2WithRSAEncryption" */
+CONST_ENTRY(257)	/* "md4" */
+CONST_ENTRY(396)	/* "md4WithRSAEncryption" */
+CONST_ENTRY( 4)	/* "md5" */
+CONST_ENTRY(114)	/* "md5-sha1" */
+CONST_ENTRY(104)	/* "md5WithRSA" */
+CONST_ENTRY( 8)	/* "md5WithRSAEncryption" */
+CONST_ENTRY(95)	/* "mdc2" */
+CONST_ENTRY(96)	/* "mdc2WithRSA" */
+CONST_ENTRY(875)	/* "member" */
+CONST_ENTRY(602)	/* "merchant initiated auth" */
+CONST_ENTRY(514)	/* "message extensions" */
+CONST_ENTRY(51)	/* "messageDigest" */
+CONST_ENTRY(506)	/* "mime-mhs-bodies" */
+CONST_ENTRY(505)	/* "mime-mhs-headings" */
+CONST_ENTRY(488)	/* "mobileTelephoneNumber" */
+CONST_ENTRY(481)	/* "nSRecord" */
+CONST_ENTRY(173)	/* "name" */
+CONST_ENTRY(681)	/* "onBasis" */
+CONST_ENTRY(379)	/* "org" */
+CONST_ENTRY(17)	/* "organizationName" */
+CONST_ENTRY(491)	/* "organizationalStatus" */
+CONST_ENTRY(18)	/* "organizationalUnitName" */
+CONST_ENTRY(475)	/* "otherMailbox" */
+CONST_ENTRY(876)	/* "owner" */
+CONST_ENTRY(489)	/* "pagerTelephoneNumber" */
+CONST_ENTRY(782)	/* "password based MAC" */
+CONST_ENTRY(374)	/* "path" */
+CONST_ENTRY(621)	/* "payment gateway capabilities" */
+CONST_ENTRY( 9)	/* "pbeWithMD2AndDES-CBC" */
+CONST_ENTRY(168)	/* "pbeWithMD2AndRC2-CBC" */
+CONST_ENTRY(112)	/* "pbeWithMD5AndCast5CBC" */
+CONST_ENTRY(10)	/* "pbeWithMD5AndDES-CBC" */
+CONST_ENTRY(169)	/* "pbeWithMD5AndRC2-CBC" */
+CONST_ENTRY(148)	/* "pbeWithSHA1And128BitRC2-CBC" */
+CONST_ENTRY(144)	/* "pbeWithSHA1And128BitRC4" */
+CONST_ENTRY(147)	/* "pbeWithSHA1And2-KeyTripleDES-CBC" */
+CONST_ENTRY(146)	/* "pbeWithSHA1And3-KeyTripleDES-CBC" */
+CONST_ENTRY(149)	/* "pbeWithSHA1And40BitRC2-CBC" */
+CONST_ENTRY(145)	/* "pbeWithSHA1And40BitRC4" */
+CONST_ENTRY(170)	/* "pbeWithSHA1AndDES-CBC" */
+CONST_ENTRY(68)	/* "pbeWithSHA1AndRC2-CBC" */
+CONST_ENTRY(499)	/* "personalSignature" */
+CONST_ENTRY(487)	/* "personalTitle" */
+CONST_ENTRY(464)	/* "photo" */
+CONST_ENTRY(863)	/* "physicalDeliveryOfficeName" */
+CONST_ENTRY(437)	/* "pilot" */
+CONST_ENTRY(439)	/* "pilotAttributeSyntax" */
+CONST_ENTRY(438)	/* "pilotAttributeType" */
+CONST_ENTRY(479)	/* "pilotAttributeType27" */
+CONST_ENTRY(456)	/* "pilotDSA" */
+CONST_ENTRY(441)	/* "pilotGroups" */
+CONST_ENTRY(444)	/* "pilotObject" */
+CONST_ENTRY(440)	/* "pilotObjectClass" */
+CONST_ENTRY(455)	/* "pilotOrganization" */
+CONST_ENTRY(445)	/* "pilotPerson" */
+CONST_ENTRY(186)	/* "pkcs1" */
+CONST_ENTRY(27)	/* "pkcs3" */
+CONST_ENTRY(187)	/* "pkcs5" */
+CONST_ENTRY(20)	/* "pkcs7" */
+CONST_ENTRY(21)	/* "pkcs7-data" */
+CONST_ENTRY(25)	/* "pkcs7-digestData" */
+CONST_ENTRY(26)	/* "pkcs7-encryptedData" */
+CONST_ENTRY(23)	/* "pkcs7-envelopedData" */
+CONST_ENTRY(24)	/* "pkcs7-signedAndEnvelopedData" */
+CONST_ENTRY(22)	/* "pkcs7-signedData" */
+CONST_ENTRY(151)	/* "pkcs8ShroudedKeyBag" */
+CONST_ENTRY(47)	/* "pkcs9" */
+CONST_ENTRY(862)	/* "postOfficeBox" */
+CONST_ENTRY(861)	/* "postalAddress" */
+CONST_ENTRY(661)	/* "postalCode" */
+CONST_ENTRY(683)	/* "ppBasis" */
+CONST_ENTRY(872)	/* "preferredDeliveryMethod" */
+CONST_ENTRY(873)	/* "presentationAddress" */
+CONST_ENTRY(406)	/* "prime-field" */
+CONST_ENTRY(409)	/* "prime192v1" */
+CONST_ENTRY(410)	/* "prime192v2" */
+CONST_ENTRY(411)	/* "prime192v3" */
+CONST_ENTRY(412)	/* "prime239v1" */
+CONST_ENTRY(413)	/* "prime239v2" */
+CONST_ENTRY(414)	/* "prime239v3" */
+CONST_ENTRY(415)	/* "prime256v1" */
+CONST_ENTRY(886)	/* "protocolInformation" */
+CONST_ENTRY(510)	/* "pseudonym" */
+CONST_ENTRY(435)	/* "pss" */
+CONST_ENTRY(286)	/* "qcStatements" */
+CONST_ENTRY(457)	/* "qualityLabelledData" */
+CONST_ENTRY(450)	/* "rFC822localPart" */
+CONST_ENTRY(98)	/* "rc2-40-cbc" */
+CONST_ENTRY(166)	/* "rc2-64-cbc" */
+CONST_ENTRY(37)	/* "rc2-cbc" */
+CONST_ENTRY(39)	/* "rc2-cfb" */
+CONST_ENTRY(38)	/* "rc2-ecb" */
+CONST_ENTRY(40)	/* "rc2-ofb" */
+CONST_ENTRY( 5)	/* "rc4" */
+CONST_ENTRY(97)	/* "rc4-40" */
+CONST_ENTRY(120)	/* "rc5-cbc" */
+CONST_ENTRY(122)	/* "rc5-cfb" */
+CONST_ENTRY(121)	/* "rc5-ecb" */
+CONST_ENTRY(123)	/* "rc5-ofb" */
+CONST_ENTRY(870)	/* "registeredAddress" */
+CONST_ENTRY(460)	/* "rfc822Mailbox" */
+CONST_ENTRY(117)	/* "ripemd160" */
+CONST_ENTRY(119)	/* "ripemd160WithRSA" */
+CONST_ENTRY(400)	/* "role" */
+CONST_ENTRY(877)	/* "roleOccupant" */
+CONST_ENTRY(448)	/* "room" */
+CONST_ENTRY(463)	/* "roomNumber" */
+CONST_ENTRY(19)	/* "rsa" */
+CONST_ENTRY( 6)	/* "rsaEncryption" */
+CONST_ENTRY(644)	/* "rsaOAEPEncryptionSET" */
+CONST_ENTRY(377)	/* "rsaSignature" */
+CONST_ENTRY(124)	/* "run length compression" */
+CONST_ENTRY(482)	/* "sOARecord" */
+CONST_ENTRY(155)	/* "safeContentsBag" */
+CONST_ENTRY(291)	/* "sbgp-autonomousSysNum" */
+CONST_ENTRY(290)	/* "sbgp-ipAddrBlock" */
+CONST_ENTRY(292)	/* "sbgp-routerIdentifier" */
+CONST_ENTRY(159)	/* "sdsiCertificate" */
+CONST_ENTRY(859)	/* "searchGuide" */
+CONST_ENTRY(704)	/* "secp112r1" */
+CONST_ENTRY(705)	/* "secp112r2" */
+CONST_ENTRY(706)	/* "secp128r1" */
+CONST_ENTRY(707)	/* "secp128r2" */
+CONST_ENTRY(708)	/* "secp160k1" */
+CONST_ENTRY(709)	/* "secp160r1" */
+CONST_ENTRY(710)	/* "secp160r2" */
+CONST_ENTRY(711)	/* "secp192k1" */
+CONST_ENTRY(712)	/* "secp224k1" */
+CONST_ENTRY(713)	/* "secp224r1" */
+CONST_ENTRY(714)	/* "secp256k1" */
+CONST_ENTRY(715)	/* "secp384r1" */
+CONST_ENTRY(716)	/* "secp521r1" */
+CONST_ENTRY(154)	/* "secretBag" */
+CONST_ENTRY(474)	/* "secretary" */
+CONST_ENTRY(717)	/* "sect113r1" */
+CONST_ENTRY(718)	/* "sect113r2" */
+CONST_ENTRY(719)	/* "sect131r1" */
+CONST_ENTRY(720)	/* "sect131r2" */
+CONST_ENTRY(721)	/* "sect163k1" */
+CONST_ENTRY(722)	/* "sect163r1" */
+CONST_ENTRY(723)	/* "sect163r2" */
+CONST_ENTRY(724)	/* "sect193r1" */
+CONST_ENTRY(725)	/* "sect193r2" */
+CONST_ENTRY(726)	/* "sect233k1" */
+CONST_ENTRY(727)	/* "sect233r1" */
+CONST_ENTRY(728)	/* "sect239k1" */
+CONST_ENTRY(729)	/* "sect283k1" */
+CONST_ENTRY(730)	/* "sect283r1" */
+CONST_ENTRY(731)	/* "sect409k1" */
+CONST_ENTRY(732)	/* "sect409r1" */
+CONST_ENTRY(733)	/* "sect571k1" */
+CONST_ENTRY(734)	/* "sect571r1" */
+CONST_ENTRY(635)	/* "secure device signature" */
+CONST_ENTRY(878)	/* "seeAlso" */
+CONST_ENTRY(777)	/* "seed-cbc" */
+CONST_ENTRY(779)	/* "seed-cfb" */
+CONST_ENTRY(776)	/* "seed-ecb" */
+CONST_ENTRY(778)	/* "seed-ofb" */
+CONST_ENTRY(105)	/* "serialNumber" */
+CONST_ENTRY(625)	/* "set-addPolicy" */
+CONST_ENTRY(515)	/* "set-attr" */
+CONST_ENTRY(518)	/* "set-brand" */
+CONST_ENTRY(638)	/* "set-brand-AmericanExpress" */
+CONST_ENTRY(637)	/* "set-brand-Diners" */
+CONST_ENTRY(636)	/* "set-brand-IATA-ATA" */
+CONST_ENTRY(639)	/* "set-brand-JCB" */
+CONST_ENTRY(641)	/* "set-brand-MasterCard" */
+CONST_ENTRY(642)	/* "set-brand-Novus" */
+CONST_ENTRY(640)	/* "set-brand-Visa" */
+CONST_ENTRY(516)	/* "set-policy" */
+CONST_ENTRY(607)	/* "set-policy-root" */
+CONST_ENTRY(624)	/* "set-rootKeyThumb" */
+CONST_ENTRY(620)	/* "setAttr-Cert" */
+CONST_ENTRY(628)	/* "setAttr-IssCap-CVM" */
+CONST_ENTRY(630)	/* "setAttr-IssCap-Sig" */
+CONST_ENTRY(629)	/* "setAttr-IssCap-T2" */
+CONST_ENTRY(627)	/* "setAttr-Token-B0Prime" */
+CONST_ENTRY(626)	/* "setAttr-Token-EMV" */
+CONST_ENTRY(622)	/* "setAttr-TokenType" */
+CONST_ENTRY(619)	/* "setCext-IssuerCapabilities" */
+CONST_ENTRY(615)	/* "setCext-PGWYcapabilities" */
+CONST_ENTRY(616)	/* "setCext-TokenIdentifier" */
+CONST_ENTRY(618)	/* "setCext-TokenType" */
+CONST_ENTRY(617)	/* "setCext-Track2Data" */
+CONST_ENTRY(611)	/* "setCext-cCertRequired" */
+CONST_ENTRY(609)	/* "setCext-certType" */
+CONST_ENTRY(608)	/* "setCext-hashedRoot" */
+CONST_ENTRY(610)	/* "setCext-merchData" */
+CONST_ENTRY(613)	/* "setCext-setExt" */
+CONST_ENTRY(614)	/* "setCext-setQualf" */
+CONST_ENTRY(612)	/* "setCext-tunneling" */
+CONST_ENTRY(540)	/* "setct-AcqCardCodeMsg" */
+CONST_ENTRY(576)	/* "setct-AcqCardCodeMsgTBE" */
+CONST_ENTRY(570)	/* "setct-AuthReqTBE" */
+CONST_ENTRY(534)	/* "setct-AuthReqTBS" */
+CONST_ENTRY(527)	/* "setct-AuthResBaggage" */
+CONST_ENTRY(571)	/* "setct-AuthResTBE" */
+CONST_ENTRY(572)	/* "setct-AuthResTBEX" */
+CONST_ENTRY(535)	/* "setct-AuthResTBS" */
+CONST_ENTRY(536)	/* "setct-AuthResTBSX" */
+CONST_ENTRY(528)	/* "setct-AuthRevReqBaggage" */
+CONST_ENTRY(577)	/* "setct-AuthRevReqTBE" */
+CONST_ENTRY(541)	/* "setct-AuthRevReqTBS" */
+CONST_ENTRY(529)	/* "setct-AuthRevResBaggage" */
+CONST_ENTRY(542)	/* "setct-AuthRevResData" */
+CONST_ENTRY(578)	/* "setct-AuthRevResTBE" */
+CONST_ENTRY(579)	/* "setct-AuthRevResTBEB" */
+CONST_ENTRY(543)	/* "setct-AuthRevResTBS" */
+CONST_ENTRY(573)	/* "setct-AuthTokenTBE" */
+CONST_ENTRY(537)	/* "setct-AuthTokenTBS" */
+CONST_ENTRY(600)	/* "setct-BCIDistributionTBS" */
+CONST_ENTRY(558)	/* "setct-BatchAdminReqData" */
+CONST_ENTRY(592)	/* "setct-BatchAdminReqTBE" */
+CONST_ENTRY(559)	/* "setct-BatchAdminResData" */
+CONST_ENTRY(593)	/* "setct-BatchAdminResTBE" */
+CONST_ENTRY(599)	/* "setct-CRLNotificationResTBS" */
+CONST_ENTRY(598)	/* "setct-CRLNotificationTBS" */
+CONST_ENTRY(580)	/* "setct-CapReqTBE" */
+CONST_ENTRY(581)	/* "setct-CapReqTBEX" */
+CONST_ENTRY(544)	/* "setct-CapReqTBS" */
+CONST_ENTRY(545)	/* "setct-CapReqTBSX" */
+CONST_ENTRY(546)	/* "setct-CapResData" */
+CONST_ENTRY(582)	/* "setct-CapResTBE" */
+CONST_ENTRY(583)	/* "setct-CapRevReqTBE" */
+CONST_ENTRY(584)	/* "setct-CapRevReqTBEX" */
+CONST_ENTRY(547)	/* "setct-CapRevReqTBS" */
+CONST_ENTRY(548)	/* "setct-CapRevReqTBSX" */
+CONST_ENTRY(549)	/* "setct-CapRevResData" */
+CONST_ENTRY(585)	/* "setct-CapRevResTBE" */
+CONST_ENTRY(538)	/* "setct-CapTokenData" */
+CONST_ENTRY(530)	/* "setct-CapTokenSeq" */
+CONST_ENTRY(574)	/* "setct-CapTokenTBE" */
+CONST_ENTRY(575)	/* "setct-CapTokenTBEX" */
+CONST_ENTRY(539)	/* "setct-CapTokenTBS" */
+CONST_ENTRY(560)	/* "setct-CardCInitResTBS" */
+CONST_ENTRY(566)	/* "setct-CertInqReqTBS" */
+CONST_ENTRY(563)	/* "setct-CertReqData" */
+CONST_ENTRY(595)	/* "setct-CertReqTBE" */
+CONST_ENTRY(596)	/* "setct-CertReqTBEX" */
+CONST_ENTRY(564)	/* "setct-CertReqTBS" */
+CONST_ENTRY(565)	/* "setct-CertResData" */
+CONST_ENTRY(597)	/* "setct-CertResTBE" */
+CONST_ENTRY(586)	/* "setct-CredReqTBE" */
+CONST_ENTRY(587)	/* "setct-CredReqTBEX" */
+CONST_ENTRY(550)	/* "setct-CredReqTBS" */
+CONST_ENTRY(551)	/* "setct-CredReqTBSX" */
+CONST_ENTRY(552)	/* "setct-CredResData" */
+CONST_ENTRY(588)	/* "setct-CredResTBE" */
+CONST_ENTRY(589)	/* "setct-CredRevReqTBE" */
+CONST_ENTRY(590)	/* "setct-CredRevReqTBEX" */
+CONST_ENTRY(553)	/* "setct-CredRevReqTBS" */
+CONST_ENTRY(554)	/* "setct-CredRevReqTBSX" */
+CONST_ENTRY(555)	/* "setct-CredRevResData" */
+CONST_ENTRY(591)	/* "setct-CredRevResTBE" */
+CONST_ENTRY(567)	/* "setct-ErrorTBS" */
+CONST_ENTRY(526)	/* "setct-HODInput" */
+CONST_ENTRY(561)	/* "setct-MeAqCInitResTBS" */
+CONST_ENTRY(522)	/* "setct-OIData" */
+CONST_ENTRY(519)	/* "setct-PANData" */
+CONST_ENTRY(521)	/* "setct-PANOnly" */
+CONST_ENTRY(520)	/* "setct-PANToken" */
+CONST_ENTRY(556)	/* "setct-PCertReqData" */
+CONST_ENTRY(557)	/* "setct-PCertResTBS" */
+CONST_ENTRY(523)	/* "setct-PI" */
+CONST_ENTRY(532)	/* "setct-PI-TBS" */
+CONST_ENTRY(524)	/* "setct-PIData" */
+CONST_ENTRY(525)	/* "setct-PIDataUnsigned" */
+CONST_ENTRY(568)	/* "setct-PIDualSignedTBE" */
+CONST_ENTRY(569)	/* "setct-PIUnsignedTBE" */
+CONST_ENTRY(531)	/* "setct-PInitResData" */
+CONST_ENTRY(533)	/* "setct-PResData" */
+CONST_ENTRY(594)	/* "setct-RegFormReqTBE" */
+CONST_ENTRY(562)	/* "setct-RegFormResTBS" */
+CONST_ENTRY(604)	/* "setext-pinAny" */
+CONST_ENTRY(603)	/* "setext-pinSecure" */
+CONST_ENTRY(605)	/* "setext-track2" */
+CONST_ENTRY(41)	/* "sha" */
+CONST_ENTRY(64)	/* "sha1" */
+CONST_ENTRY(115)	/* "sha1WithRSA" */
+CONST_ENTRY(65)	/* "sha1WithRSAEncryption" */
+CONST_ENTRY(675)	/* "sha224" */
+CONST_ENTRY(671)	/* "sha224WithRSAEncryption" */
+CONST_ENTRY(672)	/* "sha256" */
+CONST_ENTRY(668)	/* "sha256WithRSAEncryption" */
+CONST_ENTRY(673)	/* "sha384" */
+CONST_ENTRY(669)	/* "sha384WithRSAEncryption" */
+CONST_ENTRY(674)	/* "sha512" */
+CONST_ENTRY(670)	/* "sha512WithRSAEncryption" */
+CONST_ENTRY(42)	/* "shaWithRSAEncryption" */
+CONST_ENTRY(52)	/* "signingTime" */
+CONST_ENTRY(454)	/* "simpleSecurityObject" */
+CONST_ENTRY(496)	/* "singleLevelQuality" */
+CONST_ENTRY(16)	/* "stateOrProvinceName" */
+CONST_ENTRY(660)	/* "streetAddress" */
+CONST_ENTRY(498)	/* "subtreeMaximumQuality" */
+CONST_ENTRY(497)	/* "subtreeMinimumQuality" */
+CONST_ENTRY(890)	/* "supportedAlgorithms" */
+CONST_ENTRY(874)	/* "supportedApplicationContext" */
+CONST_ENTRY(100)	/* "surname" */
+CONST_ENTRY(864)	/* "telephoneNumber" */
+CONST_ENTRY(866)	/* "teletexTerminalIdentifier" */
+CONST_ENTRY(865)	/* "telexNumber" */
+CONST_ENTRY(459)	/* "textEncodedORAddress" */
+CONST_ENTRY(293)	/* "textNotice" */
+CONST_ENTRY(106)	/* "title" */
+CONST_ENTRY(682)	/* "tpBasis" */
+CONST_ENTRY(436)	/* "ucl" */
+CONST_ENTRY( 0)	/* "undefined" */
+CONST_ENTRY(888)	/* "uniqueMember" */
+CONST_ENTRY(55)	/* "unstructuredAddress" */
+CONST_ENTRY(49)	/* "unstructuredName" */
+CONST_ENTRY(880)	/* "userCertificate" */
+CONST_ENTRY(465)	/* "userClass" */
+CONST_ENTRY(458)	/* "userId" */
+CONST_ENTRY(879)	/* "userPassword" */
+CONST_ENTRY(373)	/* "valid" */
+CONST_ENTRY(678)	/* "wap" */
+CONST_ENTRY(679)	/* "wap-wsg" */
+CONST_ENTRY(735)	/* "wap-wsg-idm-ecid-wtls1" */
+CONST_ENTRY(743)	/* "wap-wsg-idm-ecid-wtls10" */
+CONST_ENTRY(744)	/* "wap-wsg-idm-ecid-wtls11" */
+CONST_ENTRY(745)	/* "wap-wsg-idm-ecid-wtls12" */
+CONST_ENTRY(736)	/* "wap-wsg-idm-ecid-wtls3" */
+CONST_ENTRY(737)	/* "wap-wsg-idm-ecid-wtls4" */
+CONST_ENTRY(738)	/* "wap-wsg-idm-ecid-wtls5" */
+CONST_ENTRY(739)	/* "wap-wsg-idm-ecid-wtls6" */
+CONST_ENTRY(740)	/* "wap-wsg-idm-ecid-wtls7" */
+CONST_ENTRY(741)	/* "wap-wsg-idm-ecid-wtls8" */
+CONST_ENTRY(742)	/* "wap-wsg-idm-ecid-wtls9" */
+CONST_ENTRY(804)	/* "whirlpool" */
+CONST_ENTRY(868)	/* "x121Address" */
+CONST_ENTRY(503)	/* "x500UniqueIdentifier" */
+CONST_ENTRY(158)	/* "x509Certificate" */
+CONST_ENTRY(160)	/* "x509Crl" */
+CONST_ENTRY(125)	/* "zlib compression" */
+CONST_END(ln_objs)
+#endif // !OPERA_SMALL_VERSION
 
-static const unsigned int sn_objs[NUM_SN]={
-364,	/* "AD_DVCS" */
-419,	/* "AES-128-CBC" */
-421,	/* "AES-128-CFB" */
-650,	/* "AES-128-CFB1" */
-653,	/* "AES-128-CFB8" */
-418,	/* "AES-128-ECB" */
-420,	/* "AES-128-OFB" */
-423,	/* "AES-192-CBC" */
-425,	/* "AES-192-CFB" */
-651,	/* "AES-192-CFB1" */
-654,	/* "AES-192-CFB8" */
-422,	/* "AES-192-ECB" */
-424,	/* "AES-192-OFB" */
-427,	/* "AES-256-CBC" */
-429,	/* "AES-256-CFB" */
-652,	/* "AES-256-CFB1" */
-655,	/* "AES-256-CFB8" */
-426,	/* "AES-256-ECB" */
-428,	/* "AES-256-OFB" */
-91,	/* "BF-CBC" */
-93,	/* "BF-CFB" */
-92,	/* "BF-ECB" */
-94,	/* "BF-OFB" */
-14,	/* "C" */
-751,	/* "CAMELLIA-128-CBC" */
-757,	/* "CAMELLIA-128-CFB" */
-760,	/* "CAMELLIA-128-CFB1" */
-763,	/* "CAMELLIA-128-CFB8" */
-754,	/* "CAMELLIA-128-ECB" */
-766,	/* "CAMELLIA-128-OFB" */
-752,	/* "CAMELLIA-192-CBC" */
-758,	/* "CAMELLIA-192-CFB" */
-761,	/* "CAMELLIA-192-CFB1" */
-764,	/* "CAMELLIA-192-CFB8" */
-755,	/* "CAMELLIA-192-ECB" */
-767,	/* "CAMELLIA-192-OFB" */
-753,	/* "CAMELLIA-256-CBC" */
-759,	/* "CAMELLIA-256-CFB" */
-762,	/* "CAMELLIA-256-CFB1" */
-765,	/* "CAMELLIA-256-CFB8" */
-756,	/* "CAMELLIA-256-ECB" */
-768,	/* "CAMELLIA-256-OFB" */
-108,	/* "CAST5-CBC" */
-110,	/* "CAST5-CFB" */
-109,	/* "CAST5-ECB" */
-111,	/* "CAST5-OFB" */
-13,	/* "CN" */
-141,	/* "CRLReason" */
-417,	/* "CSPName" */
-367,	/* "CrlID" */
-391,	/* "DC" */
-31,	/* "DES-CBC" */
-643,	/* "DES-CDMF" */
-30,	/* "DES-CFB" */
-656,	/* "DES-CFB1" */
-657,	/* "DES-CFB8" */
-29,	/* "DES-ECB" */
-32,	/* "DES-EDE" */
-43,	/* "DES-EDE-CBC" */
-60,	/* "DES-EDE-CFB" */
-62,	/* "DES-EDE-OFB" */
-33,	/* "DES-EDE3" */
-44,	/* "DES-EDE3-CBC" */
-61,	/* "DES-EDE3-CFB" */
-658,	/* "DES-EDE3-CFB1" */
-659,	/* "DES-EDE3-CFB8" */
-63,	/* "DES-EDE3-OFB" */
-45,	/* "DES-OFB" */
-80,	/* "DESX-CBC" */
-380,	/* "DOD" */
-116,	/* "DSA" */
-66,	/* "DSA-SHA" */
-113,	/* "DSA-SHA1" */
-70,	/* "DSA-SHA1-old" */
-67,	/* "DSA-old" */
-297,	/* "DVCS" */
-99,	/* "GN" */
-855,	/* "HMAC" */
-780,	/* "HMAC-MD5" */
-781,	/* "HMAC-SHA1" */
-381,	/* "IANA" */
-34,	/* "IDEA-CBC" */
-35,	/* "IDEA-CFB" */
-36,	/* "IDEA-ECB" */
-46,	/* "IDEA-OFB" */
-181,	/* "ISO" */
-183,	/* "ISO-US" */
-645,	/* "ITU-T" */
-646,	/* "JOINT-ISO-ITU-T" */
-773,	/* "KISA" */
-15,	/* "L" */
-856,	/* "LocalKeySet" */
- 3,	/* "MD2" */
-257,	/* "MD4" */
- 4,	/* "MD5" */
-114,	/* "MD5-SHA1" */
-95,	/* "MDC2" */
-388,	/* "Mail" */
-393,	/* "NULL" */
-404,	/* "NULL" */
-57,	/* "Netscape" */
-366,	/* "Nonce" */
-17,	/* "O" */
-178,	/* "OCSP" */
-180,	/* "OCSPSigning" */
-379,	/* "ORG" */
-18,	/* "OU" */
-749,	/* "Oakley-EC2N-3" */
-750,	/* "Oakley-EC2N-4" */
- 9,	/* "PBE-MD2-DES" */
-168,	/* "PBE-MD2-RC2-64" */
-10,	/* "PBE-MD5-DES" */
-169,	/* "PBE-MD5-RC2-64" */
-147,	/* "PBE-SHA1-2DES" */
-146,	/* "PBE-SHA1-3DES" */
-170,	/* "PBE-SHA1-DES" */
-148,	/* "PBE-SHA1-RC2-128" */
-149,	/* "PBE-SHA1-RC2-40" */
-68,	/* "PBE-SHA1-RC2-64" */
-144,	/* "PBE-SHA1-RC4-128" */
-145,	/* "PBE-SHA1-RC4-40" */
-161,	/* "PBES2" */
-69,	/* "PBKDF2" */
-162,	/* "PBMAC1" */
-127,	/* "PKIX" */
-98,	/* "RC2-40-CBC" */
-166,	/* "RC2-64-CBC" */
-37,	/* "RC2-CBC" */
-39,	/* "RC2-CFB" */
-38,	/* "RC2-ECB" */
-40,	/* "RC2-OFB" */
- 5,	/* "RC4" */
-97,	/* "RC4-40" */
-120,	/* "RC5-CBC" */
-122,	/* "RC5-CFB" */
-121,	/* "RC5-ECB" */
-123,	/* "RC5-OFB" */
-117,	/* "RIPEMD160" */
-124,	/* "RLE" */
-19,	/* "RSA" */
- 7,	/* "RSA-MD2" */
-396,	/* "RSA-MD4" */
- 8,	/* "RSA-MD5" */
-96,	/* "RSA-MDC2" */
-104,	/* "RSA-NP-MD5" */
-119,	/* "RSA-RIPEMD160" */
-42,	/* "RSA-SHA" */
-65,	/* "RSA-SHA1" */
-115,	/* "RSA-SHA1-2" */
-671,	/* "RSA-SHA224" */
-668,	/* "RSA-SHA256" */
-669,	/* "RSA-SHA384" */
-670,	/* "RSA-SHA512" */
-777,	/* "SEED-CBC" */
-779,	/* "SEED-CFB" */
-776,	/* "SEED-ECB" */
-778,	/* "SEED-OFB" */
-41,	/* "SHA" */
-64,	/* "SHA1" */
-675,	/* "SHA224" */
-672,	/* "SHA256" */
-673,	/* "SHA384" */
-674,	/* "SHA512" */
-188,	/* "SMIME" */
-167,	/* "SMIME-CAPS" */
-100,	/* "SN" */
-16,	/* "ST" */
-143,	/* "SXNetID" */
-458,	/* "UID" */
- 0,	/* "UNDEF" */
-11,	/* "X500" */
-378,	/* "X500algorithms" */
-12,	/* "X509" */
-184,	/* "X9-57" */
-185,	/* "X9cm" */
-125,	/* "ZLIB" */
-478,	/* "aRecord" */
-289,	/* "aaControls" */
-287,	/* "ac-auditEntity" */
-397,	/* "ac-proxying" */
-288,	/* "ac-targeting" */
-368,	/* "acceptableResponses" */
-446,	/* "account" */
-363,	/* "ad_timestamping" */
-376,	/* "algorithm" */
-405,	/* "ansi-X9-62" */
-746,	/* "anyPolicy" */
-370,	/* "archiveCutoff" */
-484,	/* "associatedDomain" */
-485,	/* "associatedName" */
-501,	/* "audio" */
-177,	/* "authorityInfoAccess" */
-90,	/* "authorityKeyIdentifier" */
-882,	/* "authorityRevocationList" */
-87,	/* "basicConstraints" */
-365,	/* "basicOCSPResponse" */
-285,	/* "biometricInfo" */
-494,	/* "buildingName" */
-860,	/* "businessCategory" */
-691,	/* "c2onb191v4" */
-692,	/* "c2onb191v5" */
-697,	/* "c2onb239v4" */
-698,	/* "c2onb239v5" */
-684,	/* "c2pnb163v1" */
-685,	/* "c2pnb163v2" */
-686,	/* "c2pnb163v3" */
-687,	/* "c2pnb176v1" */
-693,	/* "c2pnb208w1" */
-699,	/* "c2pnb272w1" */
-700,	/* "c2pnb304w1" */
-702,	/* "c2pnb368w1" */
-688,	/* "c2tnb191v1" */
-689,	/* "c2tnb191v2" */
-690,	/* "c2tnb191v3" */
-694,	/* "c2tnb239v1" */
-695,	/* "c2tnb239v2" */
-696,	/* "c2tnb239v3" */
-701,	/* "c2tnb359v1" */
-703,	/* "c2tnb431r1" */
-881,	/* "cACertificate" */
-483,	/* "cNAMERecord" */
-179,	/* "caIssuers" */
-785,	/* "caRepository" */
-443,	/* "caseIgnoreIA5StringSyntax" */
-152,	/* "certBag" */
-677,	/* "certicom-arc" */
-771,	/* "certificateIssuer" */
-89,	/* "certificatePolicies" */
-883,	/* "certificateRevocationList" */
-54,	/* "challengePassword" */
-407,	/* "characteristic-two-field" */
-395,	/* "clearance" */
-130,	/* "clientAuth" */
-131,	/* "codeSigning" */
-50,	/* "contentType" */
-53,	/* "countersignature" */
-153,	/* "crlBag" */
-103,	/* "crlDistributionPoints" */
-88,	/* "crlNumber" */
-884,	/* "crossCertificatePair" */
-806,	/* "cryptocom" */
-805,	/* "cryptopro" */
-500,	/* "dITRedirect" */
-451,	/* "dNSDomain" */
-495,	/* "dSAQuality" */
-434,	/* "data" */
-390,	/* "dcobject" */
-140,	/* "deltaCRL" */
-891,	/* "deltaRevocationList" */
-107,	/* "description" */
-871,	/* "destinationIndicator" */
-28,	/* "dhKeyAgreement" */
-382,	/* "directory" */
-887,	/* "distinguishedName" */
-892,	/* "dmdName" */
-174,	/* "dnQualifier" */
-447,	/* "document" */
-471,	/* "documentAuthor" */
-468,	/* "documentIdentifier" */
-472,	/* "documentLocation" */
-502,	/* "documentPublisher" */
-449,	/* "documentSeries" */
-469,	/* "documentTitle" */
-470,	/* "documentVersion" */
-392,	/* "domain" */
-452,	/* "domainRelatedObject" */
-802,	/* "dsa_with_SHA224" */
-803,	/* "dsa_with_SHA256" */
-791,	/* "ecdsa-with-Recommended" */
-416,	/* "ecdsa-with-SHA1" */
-793,	/* "ecdsa-with-SHA224" */
-794,	/* "ecdsa-with-SHA256" */
-795,	/* "ecdsa-with-SHA384" */
-796,	/* "ecdsa-with-SHA512" */
-792,	/* "ecdsa-with-Specified" */
-48,	/* "emailAddress" */
-132,	/* "emailProtection" */
-885,	/* "enhancedSearchGuide" */
-389,	/* "enterprises" */
-384,	/* "experimental" */
-172,	/* "extReq" */
-56,	/* "extendedCertificateAttributes" */
-126,	/* "extendedKeyUsage" */
-372,	/* "extendedStatus" */
-867,	/* "facsimileTelephoneNumber" */
-462,	/* "favouriteDrink" */
-857,	/* "freshestCRL" */
-453,	/* "friendlyCountry" */
-490,	/* "friendlyCountryName" */
-156,	/* "friendlyName" */
-509,	/* "generationQualifier" */
-815,	/* "gost-mac" */
-811,	/* "gost2001" */
-851,	/* "gost2001cc" */
-813,	/* "gost89" */
-814,	/* "gost89-cnt" */
-812,	/* "gost94" */
-850,	/* "gost94cc" */
-797,	/* "hmacWithMD5" */
-163,	/* "hmacWithSHA1" */
-798,	/* "hmacWithSHA224" */
-799,	/* "hmacWithSHA256" */
-800,	/* "hmacWithSHA384" */
-801,	/* "hmacWithSHA512" */
-432,	/* "holdInstructionCallIssuer" */
-430,	/* "holdInstructionCode" */
-431,	/* "holdInstructionNone" */
-433,	/* "holdInstructionReject" */
-486,	/* "homePostalAddress" */
-473,	/* "homeTelephoneNumber" */
-466,	/* "host" */
-889,	/* "houseIdentifier" */
-442,	/* "iA5StringSyntax" */
-783,	/* "id-DHBasedMac" */
-824,	/* "id-Gost28147-89-CryptoPro-A-ParamSet" */
-825,	/* "id-Gost28147-89-CryptoPro-B-ParamSet" */
-826,	/* "id-Gost28147-89-CryptoPro-C-ParamSet" */
-827,	/* "id-Gost28147-89-CryptoPro-D-ParamSet" */
-819,	/* "id-Gost28147-89-CryptoPro-KeyMeshing" */
-829,	/* "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" */
-828,	/* "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" */
-830,	/* "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" */
-820,	/* "id-Gost28147-89-None-KeyMeshing" */
-823,	/* "id-Gost28147-89-TestParamSet" */
-849,	/* "id-Gost28147-89-cc" */
-840,	/* "id-GostR3410-2001-CryptoPro-A-ParamSet" */
-841,	/* "id-GostR3410-2001-CryptoPro-B-ParamSet" */
-842,	/* "id-GostR3410-2001-CryptoPro-C-ParamSet" */
-843,	/* "id-GostR3410-2001-CryptoPro-XchA-ParamSet" */
-844,	/* "id-GostR3410-2001-CryptoPro-XchB-ParamSet" */
-854,	/* "id-GostR3410-2001-ParamSet-cc" */
-839,	/* "id-GostR3410-2001-TestParamSet" */
-817,	/* "id-GostR3410-2001DH" */
-832,	/* "id-GostR3410-94-CryptoPro-A-ParamSet" */
-833,	/* "id-GostR3410-94-CryptoPro-B-ParamSet" */
-834,	/* "id-GostR3410-94-CryptoPro-C-ParamSet" */
-835,	/* "id-GostR3410-94-CryptoPro-D-ParamSet" */
-836,	/* "id-GostR3410-94-CryptoPro-XchA-ParamSet" */
-837,	/* "id-GostR3410-94-CryptoPro-XchB-ParamSet" */
-838,	/* "id-GostR3410-94-CryptoPro-XchC-ParamSet" */
-831,	/* "id-GostR3410-94-TestParamSet" */
-845,	/* "id-GostR3410-94-a" */
-846,	/* "id-GostR3410-94-aBis" */
-847,	/* "id-GostR3410-94-b" */
-848,	/* "id-GostR3410-94-bBis" */
-818,	/* "id-GostR3410-94DH" */
-822,	/* "id-GostR3411-94-CryptoProParamSet" */
-821,	/* "id-GostR3411-94-TestParamSet" */
-807,	/* "id-GostR3411-94-with-GostR3410-2001" */
-853,	/* "id-GostR3411-94-with-GostR3410-2001-cc" */
-808,	/* "id-GostR3411-94-with-GostR3410-94" */
-852,	/* "id-GostR3411-94-with-GostR3410-94-cc" */
-810,	/* "id-HMACGostR3411-94" */
-782,	/* "id-PasswordBasedMAC" */
-266,	/* "id-aca" */
-355,	/* "id-aca-accessIdentity" */
-354,	/* "id-aca-authenticationInfo" */
-356,	/* "id-aca-chargingIdentity" */
-399,	/* "id-aca-encAttrs" */
-357,	/* "id-aca-group" */
-358,	/* "id-aca-role" */
-176,	/* "id-ad" */
-788,	/* "id-aes128-wrap" */
-789,	/* "id-aes192-wrap" */
-790,	/* "id-aes256-wrap" */
-262,	/* "id-alg" */
-323,	/* "id-alg-des40" */
-326,	/* "id-alg-dh-pop" */
-325,	/* "id-alg-dh-sig-hmac-sha1" */
-324,	/* "id-alg-noSignature" */
-268,	/* "id-cct" */
-361,	/* "id-cct-PKIData" */
-362,	/* "id-cct-PKIResponse" */
-360,	/* "id-cct-crs" */
-81,	/* "id-ce" */
-680,	/* "id-characteristic-two-basis" */
-263,	/* "id-cmc" */
-334,	/* "id-cmc-addExtensions" */
-346,	/* "id-cmc-confirmCertAcceptance" */
-330,	/* "id-cmc-dataReturn" */
-336,	/* "id-cmc-decryptedPOP" */
-335,	/* "id-cmc-encryptedPOP" */
-339,	/* "id-cmc-getCRL" */
-338,	/* "id-cmc-getCert" */
-328,	/* "id-cmc-identification" */
-329,	/* "id-cmc-identityProof" */
-337,	/* "id-cmc-lraPOPWitness" */
-344,	/* "id-cmc-popLinkRandom" */
-345,	/* "id-cmc-popLinkWitness" */
-343,	/* "id-cmc-queryPending" */
-333,	/* "id-cmc-recipientNonce" */
-341,	/* "id-cmc-regInfo" */
-342,	/* "id-cmc-responseInfo" */
-340,	/* "id-cmc-revokeRequest" */
-332,	/* "id-cmc-senderNonce" */
-327,	/* "id-cmc-statusInfo" */
-331,	/* "id-cmc-transactionId" */
-787,	/* "id-ct-asciiTextWithCRLF" */
-408,	/* "id-ecPublicKey" */
-508,	/* "id-hex-multipart-message" */
-507,	/* "id-hex-partial-message" */
-260,	/* "id-it" */
-302,	/* "id-it-caKeyUpdateInfo" */
-298,	/* "id-it-caProtEncCert" */
-311,	/* "id-it-confirmWaitTime" */
-303,	/* "id-it-currentCRL" */
-300,	/* "id-it-encKeyPairTypes" */
-310,	/* "id-it-implicitConfirm" */
-308,	/* "id-it-keyPairParamRep" */
-307,	/* "id-it-keyPairParamReq" */
-312,	/* "id-it-origPKIMessage" */
-301,	/* "id-it-preferredSymmAlg" */
-309,	/* "id-it-revPassphrase" */
-299,	/* "id-it-signKeyPairTypes" */
-305,	/* "id-it-subscriptionRequest" */
-306,	/* "id-it-subscriptionResponse" */
-784,	/* "id-it-suppLangTags" */
-304,	/* "id-it-unsupportedOIDs" */
-128,	/* "id-kp" */
-280,	/* "id-mod-attribute-cert" */
-274,	/* "id-mod-cmc" */
-277,	/* "id-mod-cmp" */
-284,	/* "id-mod-cmp2000" */
-273,	/* "id-mod-crmf" */
-283,	/* "id-mod-dvcs" */
-275,	/* "id-mod-kea-profile-88" */
-276,	/* "id-mod-kea-profile-93" */
-282,	/* "id-mod-ocsp" */
-278,	/* "id-mod-qualified-cert-88" */
-279,	/* "id-mod-qualified-cert-93" */
-281,	/* "id-mod-timestamp-protocol" */
-264,	/* "id-on" */
-858,	/* "id-on-permanentIdentifier" */
-347,	/* "id-on-personalData" */
-265,	/* "id-pda" */
-352,	/* "id-pda-countryOfCitizenship" */
-353,	/* "id-pda-countryOfResidence" */
-348,	/* "id-pda-dateOfBirth" */
-351,	/* "id-pda-gender" */
-349,	/* "id-pda-placeOfBirth" */
-175,	/* "id-pe" */
-261,	/* "id-pkip" */
-258,	/* "id-pkix-mod" */
-269,	/* "id-pkix1-explicit-88" */
-271,	/* "id-pkix1-explicit-93" */
-270,	/* "id-pkix1-implicit-88" */
-272,	/* "id-pkix1-implicit-93" */
-662,	/* "id-ppl" */
-664,	/* "id-ppl-anyLanguage" */
-667,	/* "id-ppl-independent" */
-665,	/* "id-ppl-inheritAll" */
-267,	/* "id-qcs" */
-359,	/* "id-qcs-pkixQCSyntax-v1" */
-259,	/* "id-qt" */
-164,	/* "id-qt-cps" */
-165,	/* "id-qt-unotice" */
-313,	/* "id-regCtrl" */
-316,	/* "id-regCtrl-authenticator" */
-319,	/* "id-regCtrl-oldCertID" */
-318,	/* "id-regCtrl-pkiArchiveOptions" */
-317,	/* "id-regCtrl-pkiPublicationInfo" */
-320,	/* "id-regCtrl-protocolEncrKey" */
-315,	/* "id-regCtrl-regToken" */
-314,	/* "id-regInfo" */
-322,	/* "id-regInfo-certReq" */
-321,	/* "id-regInfo-utf8Pairs" */
-512,	/* "id-set" */
-191,	/* "id-smime-aa" */
-215,	/* "id-smime-aa-contentHint" */
-218,	/* "id-smime-aa-contentIdentifier" */
-221,	/* "id-smime-aa-contentReference" */
-240,	/* "id-smime-aa-dvcs-dvc" */
-217,	/* "id-smime-aa-encapContentType" */
-222,	/* "id-smime-aa-encrypKeyPref" */
-220,	/* "id-smime-aa-equivalentLabels" */
-232,	/* "id-smime-aa-ets-CertificateRefs" */
-233,	/* "id-smime-aa-ets-RevocationRefs" */
-238,	/* "id-smime-aa-ets-archiveTimeStamp" */
-237,	/* "id-smime-aa-ets-certCRLTimestamp" */
-234,	/* "id-smime-aa-ets-certValues" */
-227,	/* "id-smime-aa-ets-commitmentType" */
-231,	/* "id-smime-aa-ets-contentTimestamp" */
-236,	/* "id-smime-aa-ets-escTimeStamp" */
-230,	/* "id-smime-aa-ets-otherSigCert" */
-235,	/* "id-smime-aa-ets-revocationValues" */
-226,	/* "id-smime-aa-ets-sigPolicyId" */
-229,	/* "id-smime-aa-ets-signerAttr" */
-228,	/* "id-smime-aa-ets-signerLocation" */
-219,	/* "id-smime-aa-macValue" */
-214,	/* "id-smime-aa-mlExpandHistory" */
-216,	/* "id-smime-aa-msgSigDigest" */
-212,	/* "id-smime-aa-receiptRequest" */
-213,	/* "id-smime-aa-securityLabel" */
-239,	/* "id-smime-aa-signatureType" */
-223,	/* "id-smime-aa-signingCertificate" */
-224,	/* "id-smime-aa-smimeEncryptCerts" */
-225,	/* "id-smime-aa-timeStampToken" */
-192,	/* "id-smime-alg" */
-243,	/* "id-smime-alg-3DESwrap" */
-246,	/* "id-smime-alg-CMS3DESwrap" */
-247,	/* "id-smime-alg-CMSRC2wrap" */
-245,	/* "id-smime-alg-ESDH" */
-241,	/* "id-smime-alg-ESDHwith3DES" */
-242,	/* "id-smime-alg-ESDHwithRC2" */
-244,	/* "id-smime-alg-RC2wrap" */
-193,	/* "id-smime-cd" */
-248,	/* "id-smime-cd-ldap" */
-190,	/* "id-smime-ct" */
-210,	/* "id-smime-ct-DVCSRequestData" */
-211,	/* "id-smime-ct-DVCSResponseData" */
-208,	/* "id-smime-ct-TDTInfo" */
-207,	/* "id-smime-ct-TSTInfo" */
-205,	/* "id-smime-ct-authData" */
-786,	/* "id-smime-ct-compressedData" */
-209,	/* "id-smime-ct-contentInfo" */
-206,	/* "id-smime-ct-publishCert" */
-204,	/* "id-smime-ct-receipt" */
-195,	/* "id-smime-cti" */
-255,	/* "id-smime-cti-ets-proofOfApproval" */
-256,	/* "id-smime-cti-ets-proofOfCreation" */
-253,	/* "id-smime-cti-ets-proofOfDelivery" */
-251,	/* "id-smime-cti-ets-proofOfOrigin" */
-252,	/* "id-smime-cti-ets-proofOfReceipt" */
-254,	/* "id-smime-cti-ets-proofOfSender" */
-189,	/* "id-smime-mod" */
-196,	/* "id-smime-mod-cms" */
-197,	/* "id-smime-mod-ess" */
-202,	/* "id-smime-mod-ets-eSigPolicy-88" */
-203,	/* "id-smime-mod-ets-eSigPolicy-97" */
-200,	/* "id-smime-mod-ets-eSignature-88" */
-201,	/* "id-smime-mod-ets-eSignature-97" */
-199,	/* "id-smime-mod-msg-v3" */
-198,	/* "id-smime-mod-oid" */
-194,	/* "id-smime-spq" */
-250,	/* "id-smime-spq-ets-sqt-unotice" */
-249,	/* "id-smime-spq-ets-sqt-uri" */
-676,	/* "identified-organization" */
-461,	/* "info" */
-748,	/* "inhibitAnyPolicy" */
-101,	/* "initials" */
-647,	/* "international-organizations" */
-869,	/* "internationaliSDNNumber" */
-142,	/* "invalidityDate" */
-294,	/* "ipsecEndSystem" */
-295,	/* "ipsecTunnel" */
-296,	/* "ipsecUser" */
-86,	/* "issuerAltName" */
-770,	/* "issuingDistributionPoint" */
-492,	/* "janetMailbox" */
-150,	/* "keyBag" */
-83,	/* "keyUsage" */
-477,	/* "lastModifiedBy" */
-476,	/* "lastModifiedTime" */
-157,	/* "localKeyID" */
-480,	/* "mXRecord" */
-460,	/* "mail" */
-493,	/* "mailPreferenceOption" */
-467,	/* "manager" */
-809,	/* "md_gost94" */
-875,	/* "member" */
-182,	/* "member-body" */
-51,	/* "messageDigest" */
-383,	/* "mgmt" */
-504,	/* "mime-mhs" */
-506,	/* "mime-mhs-bodies" */
-505,	/* "mime-mhs-headings" */
-488,	/* "mobileTelephoneNumber" */
-136,	/* "msCTLSign" */
-135,	/* "msCodeCom" */
-134,	/* "msCodeInd" */
-138,	/* "msEFS" */
-171,	/* "msExtReq" */
-137,	/* "msSGC" */
-648,	/* "msSmartcardLogin" */
-649,	/* "msUPN" */
-481,	/* "nSRecord" */
-173,	/* "name" */
-666,	/* "nameConstraints" */
-369,	/* "noCheck" */
-403,	/* "noRevAvail" */
-72,	/* "nsBaseUrl" */
-76,	/* "nsCaPolicyUrl" */
-74,	/* "nsCaRevocationUrl" */
-58,	/* "nsCertExt" */
-79,	/* "nsCertSequence" */
-71,	/* "nsCertType" */
-78,	/* "nsComment" */
-59,	/* "nsDataType" */
-75,	/* "nsRenewalUrl" */
-73,	/* "nsRevocationUrl" */
-139,	/* "nsSGC" */
-77,	/* "nsSslServerName" */
-681,	/* "onBasis" */
-491,	/* "organizationalStatus" */
-475,	/* "otherMailbox" */
-876,	/* "owner" */
-489,	/* "pagerTelephoneNumber" */
-374,	/* "path" */
-112,	/* "pbeWithMD5AndCast5CBC" */
-499,	/* "personalSignature" */
-487,	/* "personalTitle" */
-464,	/* "photo" */
-863,	/* "physicalDeliveryOfficeName" */
-437,	/* "pilot" */
-439,	/* "pilotAttributeSyntax" */
-438,	/* "pilotAttributeType" */
-479,	/* "pilotAttributeType27" */
-456,	/* "pilotDSA" */
-441,	/* "pilotGroups" */
-444,	/* "pilotObject" */
-440,	/* "pilotObjectClass" */
-455,	/* "pilotOrganization" */
-445,	/* "pilotPerson" */
- 2,	/* "pkcs" */
-186,	/* "pkcs1" */
-27,	/* "pkcs3" */
-187,	/* "pkcs5" */
-20,	/* "pkcs7" */
-21,	/* "pkcs7-data" */
-25,	/* "pkcs7-digestData" */
-26,	/* "pkcs7-encryptedData" */
-23,	/* "pkcs7-envelopedData" */
-24,	/* "pkcs7-signedAndEnvelopedData" */
-22,	/* "pkcs7-signedData" */
-151,	/* "pkcs8ShroudedKeyBag" */
-47,	/* "pkcs9" */
-401,	/* "policyConstraints" */
-747,	/* "policyMappings" */
-862,	/* "postOfficeBox" */
-861,	/* "postalAddress" */
-661,	/* "postalCode" */
-683,	/* "ppBasis" */
-872,	/* "preferredDeliveryMethod" */
-873,	/* "presentationAddress" */
-816,	/* "prf-gostr3411-94" */
-406,	/* "prime-field" */
-409,	/* "prime192v1" */
-410,	/* "prime192v2" */
-411,	/* "prime192v3" */
-412,	/* "prime239v1" */
-413,	/* "prime239v2" */
-414,	/* "prime239v3" */
-415,	/* "prime256v1" */
-385,	/* "private" */
-84,	/* "privateKeyUsagePeriod" */
-886,	/* "protocolInformation" */
-663,	/* "proxyCertInfo" */
-510,	/* "pseudonym" */
-435,	/* "pss" */
-286,	/* "qcStatements" */
-457,	/* "qualityLabelledData" */
-450,	/* "rFC822localPart" */
-870,	/* "registeredAddress" */
-400,	/* "role" */
-877,	/* "roleOccupant" */
-448,	/* "room" */
-463,	/* "roomNumber" */
- 6,	/* "rsaEncryption" */
-644,	/* "rsaOAEPEncryptionSET" */
-377,	/* "rsaSignature" */
- 1,	/* "rsadsi" */
-482,	/* "sOARecord" */
-155,	/* "safeContentsBag" */
-291,	/* "sbgp-autonomousSysNum" */
-290,	/* "sbgp-ipAddrBlock" */
-292,	/* "sbgp-routerIdentifier" */
-159,	/* "sdsiCertificate" */
-859,	/* "searchGuide" */
-704,	/* "secp112r1" */
-705,	/* "secp112r2" */
-706,	/* "secp128r1" */
-707,	/* "secp128r2" */
-708,	/* "secp160k1" */
-709,	/* "secp160r1" */
-710,	/* "secp160r2" */
-711,	/* "secp192k1" */
-712,	/* "secp224k1" */
-713,	/* "secp224r1" */
-714,	/* "secp256k1" */
-715,	/* "secp384r1" */
-716,	/* "secp521r1" */
-154,	/* "secretBag" */
-474,	/* "secretary" */
-717,	/* "sect113r1" */
-718,	/* "sect113r2" */
-719,	/* "sect131r1" */
-720,	/* "sect131r2" */
-721,	/* "sect163k1" */
-722,	/* "sect163r1" */
-723,	/* "sect163r2" */
-724,	/* "sect193r1" */
-725,	/* "sect193r2" */
-726,	/* "sect233k1" */
-727,	/* "sect233r1" */
-728,	/* "sect239k1" */
-729,	/* "sect283k1" */
-730,	/* "sect283r1" */
-731,	/* "sect409k1" */
-732,	/* "sect409r1" */
-733,	/* "sect571k1" */
-734,	/* "sect571r1" */
-386,	/* "security" */
-878,	/* "seeAlso" */
-394,	/* "selected-attribute-types" */
-105,	/* "serialNumber" */
-129,	/* "serverAuth" */
-371,	/* "serviceLocator" */
-625,	/* "set-addPolicy" */
-515,	/* "set-attr" */
-518,	/* "set-brand" */
-638,	/* "set-brand-AmericanExpress" */
-637,	/* "set-brand-Diners" */
-636,	/* "set-brand-IATA-ATA" */
-639,	/* "set-brand-JCB" */
-641,	/* "set-brand-MasterCard" */
-642,	/* "set-brand-Novus" */
-640,	/* "set-brand-Visa" */
-517,	/* "set-certExt" */
-513,	/* "set-ctype" */
-514,	/* "set-msgExt" */
-516,	/* "set-policy" */
-607,	/* "set-policy-root" */
-624,	/* "set-rootKeyThumb" */
-620,	/* "setAttr-Cert" */
-631,	/* "setAttr-GenCryptgrm" */
-623,	/* "setAttr-IssCap" */
-628,	/* "setAttr-IssCap-CVM" */
-630,	/* "setAttr-IssCap-Sig" */
-629,	/* "setAttr-IssCap-T2" */
-621,	/* "setAttr-PGWYcap" */
-635,	/* "setAttr-SecDevSig" */
-632,	/* "setAttr-T2Enc" */
-633,	/* "setAttr-T2cleartxt" */
-634,	/* "setAttr-TokICCsig" */
-627,	/* "setAttr-Token-B0Prime" */
-626,	/* "setAttr-Token-EMV" */
-622,	/* "setAttr-TokenType" */
-619,	/* "setCext-IssuerCapabilities" */
-615,	/* "setCext-PGWYcapabilities" */
-616,	/* "setCext-TokenIdentifier" */
-618,	/* "setCext-TokenType" */
-617,	/* "setCext-Track2Data" */
-611,	/* "setCext-cCertRequired" */
-609,	/* "setCext-certType" */
-608,	/* "setCext-hashedRoot" */
-610,	/* "setCext-merchData" */
-613,	/* "setCext-setExt" */
-614,	/* "setCext-setQualf" */
-612,	/* "setCext-tunneling" */
-540,	/* "setct-AcqCardCodeMsg" */
-576,	/* "setct-AcqCardCodeMsgTBE" */
-570,	/* "setct-AuthReqTBE" */
-534,	/* "setct-AuthReqTBS" */
-527,	/* "setct-AuthResBaggage" */
-571,	/* "setct-AuthResTBE" */
-572,	/* "setct-AuthResTBEX" */
-535,	/* "setct-AuthResTBS" */
-536,	/* "setct-AuthResTBSX" */
-528,	/* "setct-AuthRevReqBaggage" */
-577,	/* "setct-AuthRevReqTBE" */
-541,	/* "setct-AuthRevReqTBS" */
-529,	/* "setct-AuthRevResBaggage" */
-542,	/* "setct-AuthRevResData" */
-578,	/* "setct-AuthRevResTBE" */
-579,	/* "setct-AuthRevResTBEB" */
-543,	/* "setct-AuthRevResTBS" */
-573,	/* "setct-AuthTokenTBE" */
-537,	/* "setct-AuthTokenTBS" */
-600,	/* "setct-BCIDistributionTBS" */
-558,	/* "setct-BatchAdminReqData" */
-592,	/* "setct-BatchAdminReqTBE" */
-559,	/* "setct-BatchAdminResData" */
-593,	/* "setct-BatchAdminResTBE" */
-599,	/* "setct-CRLNotificationResTBS" */
-598,	/* "setct-CRLNotificationTBS" */
-580,	/* "setct-CapReqTBE" */
-581,	/* "setct-CapReqTBEX" */
-544,	/* "setct-CapReqTBS" */
-545,	/* "setct-CapReqTBSX" */
-546,	/* "setct-CapResData" */
-582,	/* "setct-CapResTBE" */
-583,	/* "setct-CapRevReqTBE" */
-584,	/* "setct-CapRevReqTBEX" */
-547,	/* "setct-CapRevReqTBS" */
-548,	/* "setct-CapRevReqTBSX" */
-549,	/* "setct-CapRevResData" */
-585,	/* "setct-CapRevResTBE" */
-538,	/* "setct-CapTokenData" */
-530,	/* "setct-CapTokenSeq" */
-574,	/* "setct-CapTokenTBE" */
-575,	/* "setct-CapTokenTBEX" */
-539,	/* "setct-CapTokenTBS" */
-560,	/* "setct-CardCInitResTBS" */
-566,	/* "setct-CertInqReqTBS" */
-563,	/* "setct-CertReqData" */
-595,	/* "setct-CertReqTBE" */
-596,	/* "setct-CertReqTBEX" */
-564,	/* "setct-CertReqTBS" */
-565,	/* "setct-CertResData" */
-597,	/* "setct-CertResTBE" */
-586,	/* "setct-CredReqTBE" */
-587,	/* "setct-CredReqTBEX" */
-550,	/* "setct-CredReqTBS" */
-551,	/* "setct-CredReqTBSX" */
-552,	/* "setct-CredResData" */
-588,	/* "setct-CredResTBE" */
-589,	/* "setct-CredRevReqTBE" */
-590,	/* "setct-CredRevReqTBEX" */
-553,	/* "setct-CredRevReqTBS" */
-554,	/* "setct-CredRevReqTBSX" */
-555,	/* "setct-CredRevResData" */
-591,	/* "setct-CredRevResTBE" */
-567,	/* "setct-ErrorTBS" */
-526,	/* "setct-HODInput" */
-561,	/* "setct-MeAqCInitResTBS" */
-522,	/* "setct-OIData" */
-519,	/* "setct-PANData" */
-521,	/* "setct-PANOnly" */
-520,	/* "setct-PANToken" */
-556,	/* "setct-PCertReqData" */
-557,	/* "setct-PCertResTBS" */
-523,	/* "setct-PI" */
-532,	/* "setct-PI-TBS" */
-524,	/* "setct-PIData" */
-525,	/* "setct-PIDataUnsigned" */
-568,	/* "setct-PIDualSignedTBE" */
-569,	/* "setct-PIUnsignedTBE" */
-531,	/* "setct-PInitResData" */
-533,	/* "setct-PResData" */
-594,	/* "setct-RegFormReqTBE" */
-562,	/* "setct-RegFormResTBS" */
-606,	/* "setext-cv" */
-601,	/* "setext-genCrypt" */
-602,	/* "setext-miAuth" */
-604,	/* "setext-pinAny" */
-603,	/* "setext-pinSecure" */
-605,	/* "setext-track2" */
-52,	/* "signingTime" */
-454,	/* "simpleSecurityObject" */
-496,	/* "singleLevelQuality" */
-387,	/* "snmpv2" */
-660,	/* "street" */
-85,	/* "subjectAltName" */
-769,	/* "subjectDirectoryAttributes" */
-398,	/* "subjectInfoAccess" */
-82,	/* "subjectKeyIdentifier" */
-498,	/* "subtreeMaximumQuality" */
-497,	/* "subtreeMinimumQuality" */
-890,	/* "supportedAlgorithms" */
-874,	/* "supportedApplicationContext" */
-402,	/* "targetInformation" */
-864,	/* "telephoneNumber" */
-866,	/* "teletexTerminalIdentifier" */
-865,	/* "telexNumber" */
-459,	/* "textEncodedORAddress" */
-293,	/* "textNotice" */
-133,	/* "timeStamping" */
-106,	/* "title" */
-682,	/* "tpBasis" */
-375,	/* "trustRoot" */
-436,	/* "ucl" */
-888,	/* "uniqueMember" */
-55,	/* "unstructuredAddress" */
-49,	/* "unstructuredName" */
-880,	/* "userCertificate" */
-465,	/* "userClass" */
-879,	/* "userPassword" */
-373,	/* "valid" */
-678,	/* "wap" */
-679,	/* "wap-wsg" */
-735,	/* "wap-wsg-idm-ecid-wtls1" */
-743,	/* "wap-wsg-idm-ecid-wtls10" */
-744,	/* "wap-wsg-idm-ecid-wtls11" */
-745,	/* "wap-wsg-idm-ecid-wtls12" */
-736,	/* "wap-wsg-idm-ecid-wtls3" */
-737,	/* "wap-wsg-idm-ecid-wtls4" */
-738,	/* "wap-wsg-idm-ecid-wtls5" */
-739,	/* "wap-wsg-idm-ecid-wtls6" */
-740,	/* "wap-wsg-idm-ecid-wtls7" */
-741,	/* "wap-wsg-idm-ecid-wtls8" */
-742,	/* "wap-wsg-idm-ecid-wtls9" */
-804,	/* "whirlpool" */
-868,	/* "x121Address" */
-503,	/* "x500UniqueIdentifier" */
-158,	/* "x509Certificate" */
-160,	/* "x509Crl" */
-};
+OPENSSL_PREFIX_CONST_ARRAY(static, unsigned int, obj_objs, libopeay)
+CONST_ENTRY( 0)	/* OBJ_undef                        0 */
+CONST_ENTRY(393)	/* OBJ_joint_iso_ccitt              OBJ_joint_iso_itu_t */
+CONST_ENTRY(404)	/* OBJ_ccitt                        OBJ_itu_t */
+CONST_ENTRY(645)	/* OBJ_itu_t                        0 */
+CONST_ENTRY(434)	/* OBJ_data                         0 9 */
+CONST_ENTRY(181)	/* OBJ_iso                          1 */
+CONST_ENTRY(182)	/* OBJ_member_body                  1 2 */
+CONST_ENTRY(379)	/* OBJ_org                          1 3 */
+CONST_ENTRY(676)	/* OBJ_identified_organization      1 3 */
+CONST_ENTRY(646)	/* OBJ_joint_iso_itu_t              2 */
+CONST_ENTRY(11)	/* OBJ_X500                         2 5 */
+CONST_ENTRY(647)	/* OBJ_international_organizations  2 23 */
+CONST_ENTRY(380)	/* OBJ_dod                          1 3 6 */
+CONST_ENTRY(12)	/* OBJ_X509                         2 5 4 */
+CONST_ENTRY(378)	/* OBJ_X500algorithms               2 5 8 */
+CONST_ENTRY(81)	/* OBJ_id_ce                        2 5 29 */
+CONST_ENTRY(512)	/* OBJ_id_set                       2 23 42 */
+CONST_ENTRY(678)	/* OBJ_wap                          2 23 43 */
+CONST_ENTRY(435)	/* OBJ_pss                          0 9 2342 */
+CONST_ENTRY(183)	/* OBJ_ISO_US                       1 2 840 */
+CONST_ENTRY(381)	/* OBJ_iana                         1 3 6 1 */
+CONST_ENTRY(677)	/* OBJ_certicom_arc                 1 3 132 */
+CONST_ENTRY(394)	/* OBJ_selected_attribute_types     2 5 1 5 */
+CONST_ENTRY(13)	/* OBJ_commonName                   2 5 4 3 */
+CONST_ENTRY(100)	/* OBJ_surname                      2 5 4 4 */
+CONST_ENTRY(105)	/* OBJ_serialNumber                 2 5 4 5 */
+CONST_ENTRY(14)	/* OBJ_countryName                  2 5 4 6 */
+CONST_ENTRY(15)	/* OBJ_localityName                 2 5 4 7 */
+CONST_ENTRY(16)	/* OBJ_stateOrProvinceName          2 5 4 8 */
+CONST_ENTRY(660)	/* OBJ_streetAddress                2 5 4 9 */
+CONST_ENTRY(17)	/* OBJ_organizationName             2 5 4 10 */
+CONST_ENTRY(18)	/* OBJ_organizationalUnitName       2 5 4 11 */
+CONST_ENTRY(106)	/* OBJ_title                        2 5 4 12 */
+CONST_ENTRY(107)	/* OBJ_description                  2 5 4 13 */
+CONST_ENTRY(859)	/* OBJ_searchGuide                  2 5 4 14 */
+CONST_ENTRY(860)	/* OBJ_businessCategory             2 5 4 15 */
+CONST_ENTRY(861)	/* OBJ_postalAddress                2 5 4 16 */
+CONST_ENTRY(661)	/* OBJ_postalCode                   2 5 4 17 */
+CONST_ENTRY(862)	/* OBJ_postOfficeBox                2 5 4 18 */
+CONST_ENTRY(863)	/* OBJ_physicalDeliveryOfficeName   2 5 4 19 */
+CONST_ENTRY(864)	/* OBJ_telephoneNumber              2 5 4 20 */
+CONST_ENTRY(865)	/* OBJ_telexNumber                  2 5 4 21 */
+CONST_ENTRY(866)	/* OBJ_teletexTerminalIdentifier    2 5 4 22 */
+CONST_ENTRY(867)	/* OBJ_facsimileTelephoneNumber     2 5 4 23 */
+CONST_ENTRY(868)	/* OBJ_x121Address                  2 5 4 24 */
+CONST_ENTRY(869)	/* OBJ_internationaliSDNNumber      2 5 4 25 */
+CONST_ENTRY(870)	/* OBJ_registeredAddress            2 5 4 26 */
+CONST_ENTRY(871)	/* OBJ_destinationIndicator         2 5 4 27 */
+CONST_ENTRY(872)	/* OBJ_preferredDeliveryMethod      2 5 4 28 */
+CONST_ENTRY(873)	/* OBJ_presentationAddress          2 5 4 29 */
+CONST_ENTRY(874)	/* OBJ_supportedApplicationContext  2 5 4 30 */
+CONST_ENTRY(875)	/* OBJ_member                       2 5 4 31 */
+CONST_ENTRY(876)	/* OBJ_owner                        2 5 4 32 */
+CONST_ENTRY(877)	/* OBJ_roleOccupant                 2 5 4 33 */
+CONST_ENTRY(878)	/* OBJ_seeAlso                      2 5 4 34 */
+CONST_ENTRY(879)	/* OBJ_userPassword                 2 5 4 35 */
+CONST_ENTRY(880)	/* OBJ_userCertificate              2 5 4 36 */
+CONST_ENTRY(881)	/* OBJ_cACertificate                2 5 4 37 */
+CONST_ENTRY(882)	/* OBJ_authorityRevocationList      2 5 4 38 */
+CONST_ENTRY(883)	/* OBJ_certificateRevocationList    2 5 4 39 */
+CONST_ENTRY(884)	/* OBJ_crossCertificatePair         2 5 4 40 */
+CONST_ENTRY(173)	/* OBJ_name                         2 5 4 41 */
+CONST_ENTRY(99)	/* OBJ_givenName                    2 5 4 42 */
+CONST_ENTRY(101)	/* OBJ_initials                     2 5 4 43 */
+CONST_ENTRY(509)	/* OBJ_generationQualifier          2 5 4 44 */
+CONST_ENTRY(503)	/* OBJ_x500UniqueIdentifier         2 5 4 45 */
+CONST_ENTRY(174)	/* OBJ_dnQualifier                  2 5 4 46 */
+CONST_ENTRY(885)	/* OBJ_enhancedSearchGuide          2 5 4 47 */
+CONST_ENTRY(886)	/* OBJ_protocolInformation          2 5 4 48 */
+CONST_ENTRY(887)	/* OBJ_distinguishedName            2 5 4 49 */
+CONST_ENTRY(888)	/* OBJ_uniqueMember                 2 5 4 50 */
+CONST_ENTRY(889)	/* OBJ_houseIdentifier              2 5 4 51 */
+CONST_ENTRY(890)	/* OBJ_supportedAlgorithms          2 5 4 52 */
+CONST_ENTRY(891)	/* OBJ_deltaRevocationList          2 5 4 53 */
+CONST_ENTRY(892)	/* OBJ_dmdName                      2 5 4 54 */
+CONST_ENTRY(510)	/* OBJ_pseudonym                    2 5 4 65 */
+CONST_ENTRY(400)	/* OBJ_role                         2 5 4 72 */
+CONST_ENTRY(769)	/* OBJ_subject_directory_attributes 2 5 29 9 */
+CONST_ENTRY(82)	/* OBJ_subject_key_identifier       2 5 29 14 */
+CONST_ENTRY(83)	/* OBJ_key_usage                    2 5 29 15 */
+CONST_ENTRY(84)	/* OBJ_private_key_usage_period     2 5 29 16 */
+CONST_ENTRY(85)	/* OBJ_subject_alt_name             2 5 29 17 */
+CONST_ENTRY(86)	/* OBJ_issuer_alt_name              2 5 29 18 */
+CONST_ENTRY(87)	/* OBJ_basic_constraints            2 5 29 19 */
+CONST_ENTRY(88)	/* OBJ_crl_number                   2 5 29 20 */
+CONST_ENTRY(141)	/* OBJ_crl_reason                   2 5 29 21 */
+CONST_ENTRY(430)	/* OBJ_hold_instruction_code        2 5 29 23 */
+CONST_ENTRY(142)	/* OBJ_invalidity_date              2 5 29 24 */
+CONST_ENTRY(140)	/* OBJ_delta_crl                    2 5 29 27 */
+CONST_ENTRY(770)	/* OBJ_issuing_distribution_point   2 5 29 28 */
+CONST_ENTRY(771)	/* OBJ_certificate_issuer           2 5 29 29 */
+CONST_ENTRY(666)	/* OBJ_name_constraints             2 5 29 30 */
+CONST_ENTRY(103)	/* OBJ_crl_distribution_points      2 5 29 31 */
+CONST_ENTRY(89)	/* OBJ_certificate_policies         2 5 29 32 */
+CONST_ENTRY(747)	/* OBJ_policy_mappings              2 5 29 33 */
+CONST_ENTRY(90)	/* OBJ_authority_key_identifier     2 5 29 35 */
+CONST_ENTRY(401)	/* OBJ_policy_constraints           2 5 29 36 */
+CONST_ENTRY(126)	/* OBJ_ext_key_usage                2 5 29 37 */
+CONST_ENTRY(857)	/* OBJ_freshest_crl                 2 5 29 46 */
+CONST_ENTRY(748)	/* OBJ_inhibit_any_policy           2 5 29 54 */
+CONST_ENTRY(402)	/* OBJ_target_information           2 5 29 55 */
+CONST_ENTRY(403)	/* OBJ_no_rev_avail                 2 5 29 56 */
+CONST_ENTRY(513)	/* OBJ_set_ctype                    2 23 42 0 */
+CONST_ENTRY(514)	/* OBJ_set_msgExt                   2 23 42 1 */
+CONST_ENTRY(515)	/* OBJ_set_attr                     2 23 42 3 */
+CONST_ENTRY(516)	/* OBJ_set_policy                   2 23 42 5 */
+CONST_ENTRY(517)	/* OBJ_set_certExt                  2 23 42 7 */
+CONST_ENTRY(518)	/* OBJ_set_brand                    2 23 42 8 */
+CONST_ENTRY(679)	/* OBJ_wap_wsg                      2 23 43 1 */
+CONST_ENTRY(382)	/* OBJ_Directory                    1 3 6 1 1 */
+CONST_ENTRY(383)	/* OBJ_Management                   1 3 6 1 2 */
+CONST_ENTRY(384)	/* OBJ_Experimental                 1 3 6 1 3 */
+CONST_ENTRY(385)	/* OBJ_Private                      1 3 6 1 4 */
+CONST_ENTRY(386)	/* OBJ_Security                     1 3 6 1 5 */
+CONST_ENTRY(387)	/* OBJ_SNMPv2                       1 3 6 1 6 */
+CONST_ENTRY(388)	/* OBJ_Mail                         1 3 6 1 7 */
+CONST_ENTRY(376)	/* OBJ_algorithm                    1 3 14 3 2 */
+CONST_ENTRY(395)	/* OBJ_clearance                    2 5 1 5 55 */
+CONST_ENTRY(19)	/* OBJ_rsa                          2 5 8 1 1 */
+CONST_ENTRY(96)	/* OBJ_mdc2WithRSA                  2 5 8 3 100 */
+CONST_ENTRY(95)	/* OBJ_mdc2                         2 5 8 3 101 */
+CONST_ENTRY(746)	/* OBJ_any_policy                   2 5 29 32 0 */
+CONST_ENTRY(519)	/* OBJ_setct_PANData                2 23 42 0 0 */
+CONST_ENTRY(520)	/* OBJ_setct_PANToken               2 23 42 0 1 */
+CONST_ENTRY(521)	/* OBJ_setct_PANOnly                2 23 42 0 2 */
+CONST_ENTRY(522)	/* OBJ_setct_OIData                 2 23 42 0 3 */
+CONST_ENTRY(523)	/* OBJ_setct_PI                     2 23 42 0 4 */
+CONST_ENTRY(524)	/* OBJ_setct_PIData                 2 23 42 0 5 */
+CONST_ENTRY(525)	/* OBJ_setct_PIDataUnsigned         2 23 42 0 6 */
+CONST_ENTRY(526)	/* OBJ_setct_HODInput               2 23 42 0 7 */
+CONST_ENTRY(527)	/* OBJ_setct_AuthResBaggage         2 23 42 0 8 */
+CONST_ENTRY(528)	/* OBJ_setct_AuthRevReqBaggage      2 23 42 0 9 */
+CONST_ENTRY(529)	/* OBJ_setct_AuthRevResBaggage      2 23 42 0 10 */
+CONST_ENTRY(530)	/* OBJ_setct_CapTokenSeq            2 23 42 0 11 */
+CONST_ENTRY(531)	/* OBJ_setct_PInitResData           2 23 42 0 12 */
+CONST_ENTRY(532)	/* OBJ_setct_PI_TBS                 2 23 42 0 13 */
+CONST_ENTRY(533)	/* OBJ_setct_PResData               2 23 42 0 14 */
+CONST_ENTRY(534)	/* OBJ_setct_AuthReqTBS             2 23 42 0 16 */
+CONST_ENTRY(535)	/* OBJ_setct_AuthResTBS             2 23 42 0 17 */
+CONST_ENTRY(536)	/* OBJ_setct_AuthResTBSX            2 23 42 0 18 */
+CONST_ENTRY(537)	/* OBJ_setct_AuthTokenTBS           2 23 42 0 19 */
+CONST_ENTRY(538)	/* OBJ_setct_CapTokenData           2 23 42 0 20 */
+CONST_ENTRY(539)	/* OBJ_setct_CapTokenTBS            2 23 42 0 21 */
+CONST_ENTRY(540)	/* OBJ_setct_AcqCardCodeMsg         2 23 42 0 22 */
+CONST_ENTRY(541)	/* OBJ_setct_AuthRevReqTBS          2 23 42 0 23 */
+CONST_ENTRY(542)	/* OBJ_setct_AuthRevResData         2 23 42 0 24 */
+CONST_ENTRY(543)	/* OBJ_setct_AuthRevResTBS          2 23 42 0 25 */
+CONST_ENTRY(544)	/* OBJ_setct_CapReqTBS              2 23 42 0 26 */
+CONST_ENTRY(545)	/* OBJ_setct_CapReqTBSX             2 23 42 0 27 */
+CONST_ENTRY(546)	/* OBJ_setct_CapResData             2 23 42 0 28 */
+CONST_ENTRY(547)	/* OBJ_setct_CapRevReqTBS           2 23 42 0 29 */
+CONST_ENTRY(548)	/* OBJ_setct_CapRevReqTBSX          2 23 42 0 30 */
+CONST_ENTRY(549)	/* OBJ_setct_CapRevResData          2 23 42 0 31 */
+CONST_ENTRY(550)	/* OBJ_setct_CredReqTBS             2 23 42 0 32 */
+CONST_ENTRY(551)	/* OBJ_setct_CredReqTBSX            2 23 42 0 33 */
+CONST_ENTRY(552)	/* OBJ_setct_CredResData            2 23 42 0 34 */
+CONST_ENTRY(553)	/* OBJ_setct_CredRevReqTBS          2 23 42 0 35 */
+CONST_ENTRY(554)	/* OBJ_setct_CredRevReqTBSX         2 23 42 0 36 */
+CONST_ENTRY(555)	/* OBJ_setct_CredRevResData         2 23 42 0 37 */
+CONST_ENTRY(556)	/* OBJ_setct_PCertReqData           2 23 42 0 38 */
+CONST_ENTRY(557)	/* OBJ_setct_PCertResTBS            2 23 42 0 39 */
+CONST_ENTRY(558)	/* OBJ_setct_BatchAdminReqData      2 23 42 0 40 */
+CONST_ENTRY(559)	/* OBJ_setct_BatchAdminResData      2 23 42 0 41 */
+CONST_ENTRY(560)	/* OBJ_setct_CardCInitResTBS        2 23 42 0 42 */
+CONST_ENTRY(561)	/* OBJ_setct_MeAqCInitResTBS        2 23 42 0 43 */
+CONST_ENTRY(562)	/* OBJ_setct_RegFormResTBS          2 23 42 0 44 */
+CONST_ENTRY(563)	/* OBJ_setct_CertReqData            2 23 42 0 45 */
+CONST_ENTRY(564)	/* OBJ_setct_CertReqTBS             2 23 42 0 46 */
+CONST_ENTRY(565)	/* OBJ_setct_CertResData            2 23 42 0 47 */
+CONST_ENTRY(566)	/* OBJ_setct_CertInqReqTBS          2 23 42 0 48 */
+CONST_ENTRY(567)	/* OBJ_setct_ErrorTBS               2 23 42 0 49 */
+CONST_ENTRY(568)	/* OBJ_setct_PIDualSignedTBE        2 23 42 0 50 */
+CONST_ENTRY(569)	/* OBJ_setct_PIUnsignedTBE          2 23 42 0 51 */
+CONST_ENTRY(570)	/* OBJ_setct_AuthReqTBE             2 23 42 0 52 */
+CONST_ENTRY(571)	/* OBJ_setct_AuthResTBE             2 23 42 0 53 */
+CONST_ENTRY(572)	/* OBJ_setct_AuthResTBEX            2 23 42 0 54 */
+CONST_ENTRY(573)	/* OBJ_setct_AuthTokenTBE           2 23 42 0 55 */
+CONST_ENTRY(574)	/* OBJ_setct_CapTokenTBE            2 23 42 0 56 */
+CONST_ENTRY(575)	/* OBJ_setct_CapTokenTBEX           2 23 42 0 57 */
+CONST_ENTRY(576)	/* OBJ_setct_AcqCardCodeMsgTBE      2 23 42 0 58 */
+CONST_ENTRY(577)	/* OBJ_setct_AuthRevReqTBE          2 23 42 0 59 */
+CONST_ENTRY(578)	/* OBJ_setct_AuthRevResTBE          2 23 42 0 60 */
+CONST_ENTRY(579)	/* OBJ_setct_AuthRevResTBEB         2 23 42 0 61 */
+CONST_ENTRY(580)	/* OBJ_setct_CapReqTBE              2 23 42 0 62 */
+CONST_ENTRY(581)	/* OBJ_setct_CapReqTBEX             2 23 42 0 63 */
+CONST_ENTRY(582)	/* OBJ_setct_CapResTBE              2 23 42 0 64 */
+CONST_ENTRY(583)	/* OBJ_setct_CapRevReqTBE           2 23 42 0 65 */
+CONST_ENTRY(584)	/* OBJ_setct_CapRevReqTBEX          2 23 42 0 66 */
+CONST_ENTRY(585)	/* OBJ_setct_CapRevResTBE           2 23 42 0 67 */
+CONST_ENTRY(586)	/* OBJ_setct_CredReqTBE             2 23 42 0 68 */
+CONST_ENTRY(587)	/* OBJ_setct_CredReqTBEX            2 23 42 0 69 */
+CONST_ENTRY(588)	/* OBJ_setct_CredResTBE             2 23 42 0 70 */
+CONST_ENTRY(589)	/* OBJ_setct_CredRevReqTBE          2 23 42 0 71 */
+CONST_ENTRY(590)	/* OBJ_setct_CredRevReqTBEX         2 23 42 0 72 */
+CONST_ENTRY(591)	/* OBJ_setct_CredRevResTBE          2 23 42 0 73 */
+CONST_ENTRY(592)	/* OBJ_setct_BatchAdminReqTBE       2 23 42 0 74 */
+CONST_ENTRY(593)	/* OBJ_setct_BatchAdminResTBE       2 23 42 0 75 */
+CONST_ENTRY(594)	/* OBJ_setct_RegFormReqTBE          2 23 42 0 76 */
+CONST_ENTRY(595)	/* OBJ_setct_CertReqTBE             2 23 42 0 77 */
+CONST_ENTRY(596)	/* OBJ_setct_CertReqTBEX            2 23 42 0 78 */
+CONST_ENTRY(597)	/* OBJ_setct_CertResTBE             2 23 42 0 79 */
+CONST_ENTRY(598)	/* OBJ_setct_CRLNotificationTBS     2 23 42 0 80 */
+CONST_ENTRY(599)	/* OBJ_setct_CRLNotificationResTBS  2 23 42 0 81 */
+CONST_ENTRY(600)	/* OBJ_setct_BCIDistributionTBS     2 23 42 0 82 */
+CONST_ENTRY(601)	/* OBJ_setext_genCrypt              2 23 42 1 1 */
+CONST_ENTRY(602)	/* OBJ_setext_miAuth                2 23 42 1 3 */
+CONST_ENTRY(603)	/* OBJ_setext_pinSecure             2 23 42 1 4 */
+CONST_ENTRY(604)	/* OBJ_setext_pinAny                2 23 42 1 5 */
+CONST_ENTRY(605)	/* OBJ_setext_track2                2 23 42 1 7 */
+CONST_ENTRY(606)	/* OBJ_setext_cv                    2 23 42 1 8 */
+CONST_ENTRY(620)	/* OBJ_setAttr_Cert                 2 23 42 3 0 */
+CONST_ENTRY(621)	/* OBJ_setAttr_PGWYcap              2 23 42 3 1 */
+CONST_ENTRY(622)	/* OBJ_setAttr_TokenType            2 23 42 3 2 */
+CONST_ENTRY(623)	/* OBJ_setAttr_IssCap               2 23 42 3 3 */
+CONST_ENTRY(607)	/* OBJ_set_policy_root              2 23 42 5 0 */
+CONST_ENTRY(608)	/* OBJ_setCext_hashedRoot           2 23 42 7 0 */
+CONST_ENTRY(609)	/* OBJ_setCext_certType             2 23 42 7 1 */
+CONST_ENTRY(610)	/* OBJ_setCext_merchData            2 23 42 7 2 */
+CONST_ENTRY(611)	/* OBJ_setCext_cCertRequired        2 23 42 7 3 */
+CONST_ENTRY(612)	/* OBJ_setCext_tunneling            2 23 42 7 4 */
+CONST_ENTRY(613)	/* OBJ_setCext_setExt               2 23 42 7 5 */
+CONST_ENTRY(614)	/* OBJ_setCext_setQualf             2 23 42 7 6 */
+CONST_ENTRY(615)	/* OBJ_setCext_PGWYcapabilities     2 23 42 7 7 */
+CONST_ENTRY(616)	/* OBJ_setCext_TokenIdentifier      2 23 42 7 8 */
+CONST_ENTRY(617)	/* OBJ_setCext_Track2Data           2 23 42 7 9 */
+CONST_ENTRY(618)	/* OBJ_setCext_TokenType            2 23 42 7 10 */
+CONST_ENTRY(619)	/* OBJ_setCext_IssuerCapabilities   2 23 42 7 11 */
+CONST_ENTRY(636)	/* OBJ_set_brand_IATA_ATA           2 23 42 8 1 */
+CONST_ENTRY(640)	/* OBJ_set_brand_Visa               2 23 42 8 4 */
+CONST_ENTRY(641)	/* OBJ_set_brand_MasterCard         2 23 42 8 5 */
+CONST_ENTRY(637)	/* OBJ_set_brand_Diners             2 23 42 8 30 */
+CONST_ENTRY(638)	/* OBJ_set_brand_AmericanExpress    2 23 42 8 34 */
+CONST_ENTRY(639)	/* OBJ_set_brand_JCB                2 23 42 8 35 */
+CONST_ENTRY(805)	/* OBJ_cryptopro                    1 2 643 2 2 */
+CONST_ENTRY(806)	/* OBJ_cryptocom                    1 2 643 2 9 */
+CONST_ENTRY(184)	/* OBJ_X9_57                        1 2 840 10040 */
+CONST_ENTRY(405)	/* OBJ_ansi_X9_62                   1 2 840 10045 */
+CONST_ENTRY(389)	/* OBJ_Enterprises                  1 3 6 1 4 1 */
+CONST_ENTRY(504)	/* OBJ_mime_mhs                     1 3 6 1 7 1 */
+CONST_ENTRY(104)	/* OBJ_md5WithRSA                   1 3 14 3 2 3 */
+CONST_ENTRY(29)	/* OBJ_des_ecb                      1 3 14 3 2 6 */
+CONST_ENTRY(31)	/* OBJ_des_cbc                      1 3 14 3 2 7 */
+CONST_ENTRY(45)	/* OBJ_des_ofb64                    1 3 14 3 2 8 */
+CONST_ENTRY(30)	/* OBJ_des_cfb64                    1 3 14 3 2 9 */
+CONST_ENTRY(377)	/* OBJ_rsaSignature                 1 3 14 3 2 11 */
+CONST_ENTRY(67)	/* OBJ_dsa_2                        1 3 14 3 2 12 */
+CONST_ENTRY(66)	/* OBJ_dsaWithSHA                   1 3 14 3 2 13 */
+CONST_ENTRY(42)	/* OBJ_shaWithRSAEncryption         1 3 14 3 2 15 */
+CONST_ENTRY(32)	/* OBJ_des_ede_ecb                  1 3 14 3 2 17 */
+CONST_ENTRY(41)	/* OBJ_sha                          1 3 14 3 2 18 */
+CONST_ENTRY(64)	/* OBJ_sha1                         1 3 14 3 2 26 */
+CONST_ENTRY(70)	/* OBJ_dsaWithSHA1_2                1 3 14 3 2 27 */
+CONST_ENTRY(115)	/* OBJ_sha1WithRSA                  1 3 14 3 2 29 */
+CONST_ENTRY(117)	/* OBJ_ripemd160                    1 3 36 3 2 1 */
+CONST_ENTRY(143)	/* OBJ_sxnet                        1 3 101 1 4 1 */
+CONST_ENTRY(721)	/* OBJ_sect163k1                    1 3 132 0 1 */
+CONST_ENTRY(722)	/* OBJ_sect163r1                    1 3 132 0 2 */
+CONST_ENTRY(728)	/* OBJ_sect239k1                    1 3 132 0 3 */
+CONST_ENTRY(717)	/* OBJ_sect113r1                    1 3 132 0 4 */
+CONST_ENTRY(718)	/* OBJ_sect113r2                    1 3 132 0 5 */
+CONST_ENTRY(704)	/* OBJ_secp112r1                    1 3 132 0 6 */
+CONST_ENTRY(705)	/* OBJ_secp112r2                    1 3 132 0 7 */
+CONST_ENTRY(709)	/* OBJ_secp160r1                    1 3 132 0 8 */
+CONST_ENTRY(708)	/* OBJ_secp160k1                    1 3 132 0 9 */
+CONST_ENTRY(714)	/* OBJ_secp256k1                    1 3 132 0 10 */
+CONST_ENTRY(723)	/* OBJ_sect163r2                    1 3 132 0 15 */
+CONST_ENTRY(729)	/* OBJ_sect283k1                    1 3 132 0 16 */
+CONST_ENTRY(730)	/* OBJ_sect283r1                    1 3 132 0 17 */
+CONST_ENTRY(719)	/* OBJ_sect131r1                    1 3 132 0 22 */
+CONST_ENTRY(720)	/* OBJ_sect131r2                    1 3 132 0 23 */
+CONST_ENTRY(724)	/* OBJ_sect193r1                    1 3 132 0 24 */
+CONST_ENTRY(725)	/* OBJ_sect193r2                    1 3 132 0 25 */
+CONST_ENTRY(726)	/* OBJ_sect233k1                    1 3 132 0 26 */
+CONST_ENTRY(727)	/* OBJ_sect233r1                    1 3 132 0 27 */
+CONST_ENTRY(706)	/* OBJ_secp128r1                    1 3 132 0 28 */
+CONST_ENTRY(707)	/* OBJ_secp128r2                    1 3 132 0 29 */
+CONST_ENTRY(710)	/* OBJ_secp160r2                    1 3 132 0 30 */
+CONST_ENTRY(711)	/* OBJ_secp192k1                    1 3 132 0 31 */
+CONST_ENTRY(712)	/* OBJ_secp224k1                    1 3 132 0 32 */
+CONST_ENTRY(713)	/* OBJ_secp224r1                    1 3 132 0 33 */
+CONST_ENTRY(715)	/* OBJ_secp384r1                    1 3 132 0 34 */
+CONST_ENTRY(716)	/* OBJ_secp521r1                    1 3 132 0 35 */
+CONST_ENTRY(731)	/* OBJ_sect409k1                    1 3 132 0 36 */
+CONST_ENTRY(732)	/* OBJ_sect409r1                    1 3 132 0 37 */
+CONST_ENTRY(733)	/* OBJ_sect571k1                    1 3 132 0 38 */
+CONST_ENTRY(734)	/* OBJ_sect571r1                    1 3 132 0 39 */
+CONST_ENTRY(624)	/* OBJ_set_rootKeyThumb             2 23 42 3 0 0 */
+CONST_ENTRY(625)	/* OBJ_set_addPolicy                2 23 42 3 0 1 */
+CONST_ENTRY(626)	/* OBJ_setAttr_Token_EMV            2 23 42 3 2 1 */
+CONST_ENTRY(627)	/* OBJ_setAttr_Token_B0Prime        2 23 42 3 2 2 */
+CONST_ENTRY(628)	/* OBJ_setAttr_IssCap_CVM           2 23 42 3 3 3 */
+CONST_ENTRY(629)	/* OBJ_setAttr_IssCap_T2            2 23 42 3 3 4 */
+CONST_ENTRY(630)	/* OBJ_setAttr_IssCap_Sig           2 23 42 3 3 5 */
+CONST_ENTRY(642)	/* OBJ_set_brand_Novus              2 23 42 8 6011 */
+CONST_ENTRY(735)	/* OBJ_wap_wsg_idm_ecid_wtls1       2 23 43 1 4 1 */
+CONST_ENTRY(736)	/* OBJ_wap_wsg_idm_ecid_wtls3       2 23 43 1 4 3 */
+CONST_ENTRY(737)	/* OBJ_wap_wsg_idm_ecid_wtls4       2 23 43 1 4 4 */
+CONST_ENTRY(738)	/* OBJ_wap_wsg_idm_ecid_wtls5       2 23 43 1 4 5 */
+CONST_ENTRY(739)	/* OBJ_wap_wsg_idm_ecid_wtls6       2 23 43 1 4 6 */
+CONST_ENTRY(740)	/* OBJ_wap_wsg_idm_ecid_wtls7       2 23 43 1 4 7 */
+CONST_ENTRY(741)	/* OBJ_wap_wsg_idm_ecid_wtls8       2 23 43 1 4 8 */
+CONST_ENTRY(742)	/* OBJ_wap_wsg_idm_ecid_wtls9       2 23 43 1 4 9 */
+CONST_ENTRY(743)	/* OBJ_wap_wsg_idm_ecid_wtls10      2 23 43 1 4 10 */
+CONST_ENTRY(744)	/* OBJ_wap_wsg_idm_ecid_wtls11      2 23 43 1 4 11 */
+CONST_ENTRY(745)	/* OBJ_wap_wsg_idm_ecid_wtls12      2 23 43 1 4 12 */
+CONST_ENTRY(804)	/* OBJ_whirlpool                    1 0 10118 3 0 55 */
+CONST_ENTRY(124)	/* OBJ_rle_compression              1 1 1 1 666 1 */
+CONST_ENTRY(773)	/* OBJ_kisa                         1 2 410 200004 */
+CONST_ENTRY(807)	/* OBJ_id_GostR3411_94_with_GostR3410_2001 1 2 643 2 2 3 */
+CONST_ENTRY(808)	/* OBJ_id_GostR3411_94_with_GostR3410_94 1 2 643 2 2 4 */
+CONST_ENTRY(809)	/* OBJ_id_GostR3411_94              1 2 643 2 2 9 */
+CONST_ENTRY(810)	/* OBJ_id_HMACGostR3411_94          1 2 643 2 2 10 */
+CONST_ENTRY(811)	/* OBJ_id_GostR3410_2001            1 2 643 2 2 19 */
+CONST_ENTRY(812)	/* OBJ_id_GostR3410_94              1 2 643 2 2 20 */
+CONST_ENTRY(813)	/* OBJ_id_Gost28147_89              1 2 643 2 2 21 */
+CONST_ENTRY(815)	/* OBJ_id_Gost28147_89_MAC          1 2 643 2 2 22 */
+CONST_ENTRY(816)	/* OBJ_id_GostR3411_94_prf          1 2 643 2 2 23 */
+CONST_ENTRY(817)	/* OBJ_id_GostR3410_2001DH          1 2 643 2 2 98 */
+CONST_ENTRY(818)	/* OBJ_id_GostR3410_94DH            1 2 643 2 2 99 */
+CONST_ENTRY( 1)	/* OBJ_rsadsi                       1 2 840 113549 */
+CONST_ENTRY(185)	/* OBJ_X9cm                         1 2 840 10040 4 */
+CONST_ENTRY(127)	/* OBJ_id_pkix                      1 3 6 1 5 5 7 */
+CONST_ENTRY(505)	/* OBJ_mime_mhs_headings            1 3 6 1 7 1 1 */
+CONST_ENTRY(506)	/* OBJ_mime_mhs_bodies              1 3 6 1 7 1 2 */
+CONST_ENTRY(119)	/* OBJ_ripemd160WithRSA             1 3 36 3 3 1 2 */
+CONST_ENTRY(631)	/* OBJ_setAttr_GenCryptgrm          2 23 42 3 3 3 1 */
+CONST_ENTRY(632)	/* OBJ_setAttr_T2Enc                2 23 42 3 3 4 1 */
+CONST_ENTRY(633)	/* OBJ_setAttr_T2cleartxt           2 23 42 3 3 4 2 */
+CONST_ENTRY(634)	/* OBJ_setAttr_TokICCsig            2 23 42 3 3 5 1 */
+CONST_ENTRY(635)	/* OBJ_setAttr_SecDevSig            2 23 42 3 3 5 2 */
+CONST_ENTRY(436)	/* OBJ_ucl                          0 9 2342 19200300 */
+CONST_ENTRY(820)	/* OBJ_id_Gost28147_89_None_KeyMeshing 1 2 643 2 2 14 0 */
+CONST_ENTRY(819)	/* OBJ_id_Gost28147_89_CryptoPro_KeyMeshing 1 2 643 2 2 14 1 */
+CONST_ENTRY(845)	/* OBJ_id_GostR3410_94_a            1 2 643 2 2 20 1 */
+CONST_ENTRY(846)	/* OBJ_id_GostR3410_94_aBis         1 2 643 2 2 20 2 */
+CONST_ENTRY(847)	/* OBJ_id_GostR3410_94_b            1 2 643 2 2 20 3 */
+CONST_ENTRY(848)	/* OBJ_id_GostR3410_94_bBis         1 2 643 2 2 20 4 */
+CONST_ENTRY(821)	/* OBJ_id_GostR3411_94_TestParamSet 1 2 643 2 2 30 0 */
+CONST_ENTRY(822)	/* OBJ_id_GostR3411_94_CryptoProParamSet 1 2 643 2 2 30 1 */
+CONST_ENTRY(823)	/* OBJ_id_Gost28147_89_TestParamSet 1 2 643 2 2 31 0 */
+CONST_ENTRY(824)	/* OBJ_id_Gost28147_89_CryptoPro_A_ParamSet 1 2 643 2 2 31 1 */
+CONST_ENTRY(825)	/* OBJ_id_Gost28147_89_CryptoPro_B_ParamSet 1 2 643 2 2 31 2 */
+CONST_ENTRY(826)	/* OBJ_id_Gost28147_89_CryptoPro_C_ParamSet 1 2 643 2 2 31 3 */
+CONST_ENTRY(827)	/* OBJ_id_Gost28147_89_CryptoPro_D_ParamSet 1 2 643 2 2 31 4 */
+CONST_ENTRY(828)	/* OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 1 2 643 2 2 31 5 */
+CONST_ENTRY(829)	/* OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 1 2 643 2 2 31 6 */
+CONST_ENTRY(830)	/* OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 1 2 643 2 2 31 7 */
+CONST_ENTRY(831)	/* OBJ_id_GostR3410_94_TestParamSet 1 2 643 2 2 32 0 */
+CONST_ENTRY(832)	/* OBJ_id_GostR3410_94_CryptoPro_A_ParamSet 1 2 643 2 2 32 2 */
+CONST_ENTRY(833)	/* OBJ_id_GostR3410_94_CryptoPro_B_ParamSet 1 2 643 2 2 32 3 */
+CONST_ENTRY(834)	/* OBJ_id_GostR3410_94_CryptoPro_C_ParamSet 1 2 643 2 2 32 4 */
+CONST_ENTRY(835)	/* OBJ_id_GostR3410_94_CryptoPro_D_ParamSet 1 2 643 2 2 32 5 */
+CONST_ENTRY(836)	/* OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet 1 2 643 2 2 33 1 */
+CONST_ENTRY(837)	/* OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet 1 2 643 2 2 33 2 */
+CONST_ENTRY(838)	/* OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet 1 2 643 2 2 33 3 */
+CONST_ENTRY(839)	/* OBJ_id_GostR3410_2001_TestParamSet 1 2 643 2 2 35 0 */
+CONST_ENTRY(840)	/* OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet 1 2 643 2 2 35 1 */
+CONST_ENTRY(841)	/* OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet 1 2 643 2 2 35 2 */
+CONST_ENTRY(842)	/* OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet 1 2 643 2 2 35 3 */
+CONST_ENTRY(843)	/* OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet 1 2 643 2 2 36 0 */
+CONST_ENTRY(844)	/* OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet 1 2 643 2 2 36 1 */
+CONST_ENTRY( 2)	/* OBJ_pkcs                         1 2 840 113549 1 */
+CONST_ENTRY(431)	/* OBJ_hold_instruction_none        1 2 840 10040 2 1 */
+CONST_ENTRY(432)	/* OBJ_hold_instruction_call_issuer 1 2 840 10040 2 2 */
+CONST_ENTRY(433)	/* OBJ_hold_instruction_reject      1 2 840 10040 2 3 */
+CONST_ENTRY(116)	/* OBJ_dsa                          1 2 840 10040 4 1 */
+CONST_ENTRY(113)	/* OBJ_dsaWithSHA1                  1 2 840 10040 4 3 */
+CONST_ENTRY(406)	/* OBJ_X9_62_prime_field            1 2 840 10045 1 1 */
+CONST_ENTRY(407)	/* OBJ_X9_62_characteristic_two_field 1 2 840 10045 1 2 */
+CONST_ENTRY(408)	/* OBJ_X9_62_id_ecPublicKey         1 2 840 10045 2 1 */
+CONST_ENTRY(416)	/* OBJ_ecdsa_with_SHA1              1 2 840 10045 4 1 */
+CONST_ENTRY(791)	/* OBJ_ecdsa_with_Recommended       1 2 840 10045 4 2 */
+CONST_ENTRY(792)	/* OBJ_ecdsa_with_Specified         1 2 840 10045 4 3 */
+CONST_ENTRY(258)	/* OBJ_id_pkix_mod                  1 3 6 1 5 5 7 0 */
+CONST_ENTRY(175)	/* OBJ_id_pe                        1 3 6 1 5 5 7 1 */
+CONST_ENTRY(259)	/* OBJ_id_qt                        1 3 6 1 5 5 7 2 */
+CONST_ENTRY(128)	/* OBJ_id_kp                        1 3 6 1 5 5 7 3 */
+CONST_ENTRY(260)	/* OBJ_id_it                        1 3 6 1 5 5 7 4 */
+CONST_ENTRY(261)	/* OBJ_id_pkip                      1 3 6 1 5 5 7 5 */
+CONST_ENTRY(262)	/* OBJ_id_alg                       1 3 6 1 5 5 7 6 */
+CONST_ENTRY(263)	/* OBJ_id_cmc                       1 3 6 1 5 5 7 7 */
+CONST_ENTRY(264)	/* OBJ_id_on                        1 3 6 1 5 5 7 8 */
+CONST_ENTRY(265)	/* OBJ_id_pda                       1 3 6 1 5 5 7 9 */
+CONST_ENTRY(266)	/* OBJ_id_aca                       1 3 6 1 5 5 7 10 */
+CONST_ENTRY(267)	/* OBJ_id_qcs                       1 3 6 1 5 5 7 11 */
+CONST_ENTRY(268)	/* OBJ_id_cct                       1 3 6 1 5 5 7 12 */
+CONST_ENTRY(662)	/* OBJ_id_ppl                       1 3 6 1 5 5 7 21 */
+CONST_ENTRY(176)	/* OBJ_id_ad                        1 3 6 1 5 5 7 48 */
+CONST_ENTRY(507)	/* OBJ_id_hex_partial_message       1 3 6 1 7 1 1 1 */
+CONST_ENTRY(508)	/* OBJ_id_hex_multipart_message     1 3 6 1 7 1 1 2 */
+CONST_ENTRY(57)	/* OBJ_netscape                     2 16 840 1 113730 */
+CONST_ENTRY(754)	/* OBJ_camellia_128_ecb             0 3 4401 5 3 1 9 1 */
+CONST_ENTRY(766)	/* OBJ_camellia_128_ofb128          0 3 4401 5 3 1 9 3 */
+CONST_ENTRY(757)	/* OBJ_camellia_128_cfb128          0 3 4401 5 3 1 9 4 */
+CONST_ENTRY(755)	/* OBJ_camellia_192_ecb             0 3 4401 5 3 1 9 21 */
+CONST_ENTRY(767)	/* OBJ_camellia_192_ofb128          0 3 4401 5 3 1 9 23 */
+CONST_ENTRY(758)	/* OBJ_camellia_192_cfb128          0 3 4401 5 3 1 9 24 */
+CONST_ENTRY(756)	/* OBJ_camellia_256_ecb             0 3 4401 5 3 1 9 41 */
+CONST_ENTRY(768)	/* OBJ_camellia_256_ofb128          0 3 4401 5 3 1 9 43 */
+CONST_ENTRY(759)	/* OBJ_camellia_256_cfb128          0 3 4401 5 3 1 9 44 */
+CONST_ENTRY(437)	/* OBJ_pilot                        0 9 2342 19200300 100 */
+CONST_ENTRY(776)	/* OBJ_seed_ecb                     1 2 410 200004 1 3 */
+CONST_ENTRY(777)	/* OBJ_seed_cbc                     1 2 410 200004 1 4 */
+CONST_ENTRY(779)	/* OBJ_seed_cfb128                  1 2 410 200004 1 5 */
+CONST_ENTRY(778)	/* OBJ_seed_ofb128                  1 2 410 200004 1 6 */
+CONST_ENTRY(852)	/* OBJ_id_GostR3411_94_with_GostR3410_94_cc 1 2 643 2 9 1 3 3 */
+CONST_ENTRY(853)	/* OBJ_id_GostR3411_94_with_GostR3410_2001_cc 1 2 643 2 9 1 3 4 */
+CONST_ENTRY(850)	/* OBJ_id_GostR3410_94_cc           1 2 643 2 9 1 5 3 */
+CONST_ENTRY(851)	/* OBJ_id_GostR3410_2001_cc         1 2 643 2 9 1 5 4 */
+CONST_ENTRY(849)	/* OBJ_id_Gost28147_89_cc           1 2 643 2 9 1 6 1 */
+CONST_ENTRY(854)	/* OBJ_id_GostR3410_2001_ParamSet_cc 1 2 643 2 9 1 8 1 */
+CONST_ENTRY(186)	/* OBJ_pkcs1                        1 2 840 113549 1 1 */
+CONST_ENTRY(27)	/* OBJ_pkcs3                        1 2 840 113549 1 3 */
+CONST_ENTRY(187)	/* OBJ_pkcs5                        1 2 840 113549 1 5 */
+CONST_ENTRY(20)	/* OBJ_pkcs7                        1 2 840 113549 1 7 */
+CONST_ENTRY(47)	/* OBJ_pkcs9                        1 2 840 113549 1 9 */
+CONST_ENTRY( 3)	/* OBJ_md2                          1 2 840 113549 2 2 */
+CONST_ENTRY(257)	/* OBJ_md4                          1 2 840 113549 2 4 */
+CONST_ENTRY( 4)	/* OBJ_md5                          1 2 840 113549 2 5 */
+CONST_ENTRY(797)	/* OBJ_hmacWithMD5                  1 2 840 113549 2 6 */
+CONST_ENTRY(163)	/* OBJ_hmacWithSHA1                 1 2 840 113549 2 7 */
+CONST_ENTRY(798)	/* OBJ_hmacWithSHA224               1 2 840 113549 2 8 */
+CONST_ENTRY(799)	/* OBJ_hmacWithSHA256               1 2 840 113549 2 9 */
+CONST_ENTRY(800)	/* OBJ_hmacWithSHA384               1 2 840 113549 2 10 */
+CONST_ENTRY(801)	/* OBJ_hmacWithSHA512               1 2 840 113549 2 11 */
+CONST_ENTRY(37)	/* OBJ_rc2_cbc                      1 2 840 113549 3 2 */
+CONST_ENTRY( 5)	/* OBJ_rc4                          1 2 840 113549 3 4 */
+CONST_ENTRY(44)	/* OBJ_des_ede3_cbc                 1 2 840 113549 3 7 */
+CONST_ENTRY(120)	/* OBJ_rc5_cbc                      1 2 840 113549 3 8 */
+CONST_ENTRY(643)	/* OBJ_des_cdmf                     1 2 840 113549 3 10 */
+CONST_ENTRY(680)	/* OBJ_X9_62_id_characteristic_two_basis 1 2 840 10045 1 2 3 */
+CONST_ENTRY(684)	/* OBJ_X9_62_c2pnb163v1             1 2 840 10045 3 0 1 */
+CONST_ENTRY(685)	/* OBJ_X9_62_c2pnb163v2             1 2 840 10045 3 0 2 */
+CONST_ENTRY(686)	/* OBJ_X9_62_c2pnb163v3             1 2 840 10045 3 0 3 */
+CONST_ENTRY(687)	/* OBJ_X9_62_c2pnb176v1             1 2 840 10045 3 0 4 */
+CONST_ENTRY(688)	/* OBJ_X9_62_c2tnb191v1             1 2 840 10045 3 0 5 */
+CONST_ENTRY(689)	/* OBJ_X9_62_c2tnb191v2             1 2 840 10045 3 0 6 */
+CONST_ENTRY(690)	/* OBJ_X9_62_c2tnb191v3             1 2 840 10045 3 0 7 */
+CONST_ENTRY(691)	/* OBJ_X9_62_c2onb191v4             1 2 840 10045 3 0 8 */
+CONST_ENTRY(692)	/* OBJ_X9_62_c2onb191v5             1 2 840 10045 3 0 9 */
+CONST_ENTRY(693)	/* OBJ_X9_62_c2pnb208w1             1 2 840 10045 3 0 10 */
+CONST_ENTRY(694)	/* OBJ_X9_62_c2tnb239v1             1 2 840 10045 3 0 11 */
+CONST_ENTRY(695)	/* OBJ_X9_62_c2tnb239v2             1 2 840 10045 3 0 12 */
+CONST_ENTRY(696)	/* OBJ_X9_62_c2tnb239v3             1 2 840 10045 3 0 13 */
+CONST_ENTRY(697)	/* OBJ_X9_62_c2onb239v4             1 2 840 10045 3 0 14 */
+CONST_ENTRY(698)	/* OBJ_X9_62_c2onb239v5             1 2 840 10045 3 0 15 */
+CONST_ENTRY(699)	/* OBJ_X9_62_c2pnb272w1             1 2 840 10045 3 0 16 */
+CONST_ENTRY(700)	/* OBJ_X9_62_c2pnb304w1             1 2 840 10045 3 0 17 */
+CONST_ENTRY(701)	/* OBJ_X9_62_c2tnb359v1             1 2 840 10045 3 0 18 */
+CONST_ENTRY(702)	/* OBJ_X9_62_c2pnb368w1             1 2 840 10045 3 0 19 */
+CONST_ENTRY(703)	/* OBJ_X9_62_c2tnb431r1             1 2 840 10045 3 0 20 */
+CONST_ENTRY(409)	/* OBJ_X9_62_prime192v1             1 2 840 10045 3 1 1 */
+CONST_ENTRY(410)	/* OBJ_X9_62_prime192v2             1 2 840 10045 3 1 2 */
+CONST_ENTRY(411)	/* OBJ_X9_62_prime192v3             1 2 840 10045 3 1 3 */
+CONST_ENTRY(412)	/* OBJ_X9_62_prime239v1             1 2 840 10045 3 1 4 */
+CONST_ENTRY(413)	/* OBJ_X9_62_prime239v2             1 2 840 10045 3 1 5 */
+CONST_ENTRY(414)	/* OBJ_X9_62_prime239v3             1 2 840 10045 3 1 6 */
+CONST_ENTRY(415)	/* OBJ_X9_62_prime256v1             1 2 840 10045 3 1 7 */
+CONST_ENTRY(793)	/* OBJ_ecdsa_with_SHA224            1 2 840 10045 4 3 1 */
+CONST_ENTRY(794)	/* OBJ_ecdsa_with_SHA256            1 2 840 10045 4 3 2 */
+CONST_ENTRY(795)	/* OBJ_ecdsa_with_SHA384            1 2 840 10045 4 3 3 */
+CONST_ENTRY(796)	/* OBJ_ecdsa_with_SHA512            1 2 840 10045 4 3 4 */
+CONST_ENTRY(269)	/* OBJ_id_pkix1_explicit_88         1 3 6 1 5 5 7 0 1 */
+CONST_ENTRY(270)	/* OBJ_id_pkix1_implicit_88         1 3 6 1 5 5 7 0 2 */
+CONST_ENTRY(271)	/* OBJ_id_pkix1_explicit_93         1 3 6 1 5 5 7 0 3 */
+CONST_ENTRY(272)	/* OBJ_id_pkix1_implicit_93         1 3 6 1 5 5 7 0 4 */
+CONST_ENTRY(273)	/* OBJ_id_mod_crmf                  1 3 6 1 5 5 7 0 5 */
+CONST_ENTRY(274)	/* OBJ_id_mod_cmc                   1 3 6 1 5 5 7 0 6 */
+CONST_ENTRY(275)	/* OBJ_id_mod_kea_profile_88        1 3 6 1 5 5 7 0 7 */
+CONST_ENTRY(276)	/* OBJ_id_mod_kea_profile_93        1 3 6 1 5 5 7 0 8 */
+CONST_ENTRY(277)	/* OBJ_id_mod_cmp                   1 3 6 1 5 5 7 0 9 */
+CONST_ENTRY(278)	/* OBJ_id_mod_qualified_cert_88     1 3 6 1 5 5 7 0 10 */
+CONST_ENTRY(279)	/* OBJ_id_mod_qualified_cert_93     1 3 6 1 5 5 7 0 11 */
+CONST_ENTRY(280)	/* OBJ_id_mod_attribute_cert        1 3 6 1 5 5 7 0 12 */
+CONST_ENTRY(281)	/* OBJ_id_mod_timestamp_protocol    1 3 6 1 5 5 7 0 13 */
+CONST_ENTRY(282)	/* OBJ_id_mod_ocsp                  1 3 6 1 5 5 7 0 14 */
+CONST_ENTRY(283)	/* OBJ_id_mod_dvcs                  1 3 6 1 5 5 7 0 15 */
+CONST_ENTRY(284)	/* OBJ_id_mod_cmp2000               1 3 6 1 5 5 7 0 16 */
+CONST_ENTRY(177)	/* OBJ_info_access                  1 3 6 1 5 5 7 1 1 */
+CONST_ENTRY(285)	/* OBJ_biometricInfo                1 3 6 1 5 5 7 1 2 */
+CONST_ENTRY(286)	/* OBJ_qcStatements                 1 3 6 1 5 5 7 1 3 */
+CONST_ENTRY(287)	/* OBJ_ac_auditEntity               1 3 6 1 5 5 7 1 4 */
+CONST_ENTRY(288)	/* OBJ_ac_targeting                 1 3 6 1 5 5 7 1 5 */
+CONST_ENTRY(289)	/* OBJ_aaControls                   1 3 6 1 5 5 7 1 6 */
+CONST_ENTRY(290)	/* OBJ_sbgp_ipAddrBlock             1 3 6 1 5 5 7 1 7 */
+CONST_ENTRY(291)	/* OBJ_sbgp_autonomousSysNum        1 3 6 1 5 5 7 1 8 */
+CONST_ENTRY(292)	/* OBJ_sbgp_routerIdentifier        1 3 6 1 5 5 7 1 9 */
+CONST_ENTRY(397)	/* OBJ_ac_proxying                  1 3 6 1 5 5 7 1 10 */
+CONST_ENTRY(398)	/* OBJ_sinfo_access                 1 3 6 1 5 5 7 1 11 */
+CONST_ENTRY(663)	/* OBJ_proxyCertInfo                1 3 6 1 5 5 7 1 14 */
+CONST_ENTRY(164)	/* OBJ_id_qt_cps                    1 3 6 1 5 5 7 2 1 */
+CONST_ENTRY(165)	/* OBJ_id_qt_unotice                1 3 6 1 5 5 7 2 2 */
+CONST_ENTRY(293)	/* OBJ_textNotice                   1 3 6 1 5 5 7 2 3 */
+CONST_ENTRY(129)	/* OBJ_server_auth                  1 3 6 1 5 5 7 3 1 */
+CONST_ENTRY(130)	/* OBJ_client_auth                  1 3 6 1 5 5 7 3 2 */
+CONST_ENTRY(131)	/* OBJ_code_sign                    1 3 6 1 5 5 7 3 3 */
+CONST_ENTRY(132)	/* OBJ_email_protect                1 3 6 1 5 5 7 3 4 */
+CONST_ENTRY(294)	/* OBJ_ipsecEndSystem               1 3 6 1 5 5 7 3 5 */
+CONST_ENTRY(295)	/* OBJ_ipsecTunnel                  1 3 6 1 5 5 7 3 6 */
+CONST_ENTRY(296)	/* OBJ_ipsecUser                    1 3 6 1 5 5 7 3 7 */
+CONST_ENTRY(133)	/* OBJ_time_stamp                   1 3 6 1 5 5 7 3 8 */
+CONST_ENTRY(180)	/* OBJ_OCSP_sign                    1 3 6 1 5 5 7 3 9 */
+CONST_ENTRY(297)	/* OBJ_dvcs                         1 3 6 1 5 5 7 3 10 */
+CONST_ENTRY(298)	/* OBJ_id_it_caProtEncCert          1 3 6 1 5 5 7 4 1 */
+CONST_ENTRY(299)	/* OBJ_id_it_signKeyPairTypes       1 3 6 1 5 5 7 4 2 */
+CONST_ENTRY(300)	/* OBJ_id_it_encKeyPairTypes        1 3 6 1 5 5 7 4 3 */
+CONST_ENTRY(301)	/* OBJ_id_it_preferredSymmAlg       1 3 6 1 5 5 7 4 4 */
+CONST_ENTRY(302)	/* OBJ_id_it_caKeyUpdateInfo        1 3 6 1 5 5 7 4 5 */
+CONST_ENTRY(303)	/* OBJ_id_it_currentCRL             1 3 6 1 5 5 7 4 6 */
+CONST_ENTRY(304)	/* OBJ_id_it_unsupportedOIDs        1 3 6 1 5 5 7 4 7 */
+CONST_ENTRY(305)	/* OBJ_id_it_subscriptionRequest    1 3 6 1 5 5 7 4 8 */
+CONST_ENTRY(306)	/* OBJ_id_it_subscriptionResponse   1 3 6 1 5 5 7 4 9 */
+CONST_ENTRY(307)	/* OBJ_id_it_keyPairParamReq        1 3 6 1 5 5 7 4 10 */
+CONST_ENTRY(308)	/* OBJ_id_it_keyPairParamRep        1 3 6 1 5 5 7 4 11 */
+CONST_ENTRY(309)	/* OBJ_id_it_revPassphrase          1 3 6 1 5 5 7 4 12 */
+CONST_ENTRY(310)	/* OBJ_id_it_implicitConfirm        1 3 6 1 5 5 7 4 13 */
+CONST_ENTRY(311)	/* OBJ_id_it_confirmWaitTime        1 3 6 1 5 5 7 4 14 */
+CONST_ENTRY(312)	/* OBJ_id_it_origPKIMessage         1 3 6 1 5 5 7 4 15 */
+CONST_ENTRY(784)	/* OBJ_id_it_suppLangTags           1 3 6 1 5 5 7 4 16 */
+CONST_ENTRY(313)	/* OBJ_id_regCtrl                   1 3 6 1 5 5 7 5 1 */
+CONST_ENTRY(314)	/* OBJ_id_regInfo                   1 3 6 1 5 5 7 5 2 */
+CONST_ENTRY(323)	/* OBJ_id_alg_des40                 1 3 6 1 5 5 7 6 1 */
+CONST_ENTRY(324)	/* OBJ_id_alg_noSignature           1 3 6 1 5 5 7 6 2 */
+CONST_ENTRY(325)	/* OBJ_id_alg_dh_sig_hmac_sha1      1 3 6 1 5 5 7 6 3 */
+CONST_ENTRY(326)	/* OBJ_id_alg_dh_pop                1 3 6 1 5 5 7 6 4 */
+CONST_ENTRY(327)	/* OBJ_id_cmc_statusInfo            1 3 6 1 5 5 7 7 1 */
+CONST_ENTRY(328)	/* OBJ_id_cmc_identification        1 3 6 1 5 5 7 7 2 */
+CONST_ENTRY(329)	/* OBJ_id_cmc_identityProof         1 3 6 1 5 5 7 7 3 */
+CONST_ENTRY(330)	/* OBJ_id_cmc_dataReturn            1 3 6 1 5 5 7 7 4 */
+CONST_ENTRY(331)	/* OBJ_id_cmc_transactionId         1 3 6 1 5 5 7 7 5 */
+CONST_ENTRY(332)	/* OBJ_id_cmc_senderNonce           1 3 6 1 5 5 7 7 6 */
+CONST_ENTRY(333)	/* OBJ_id_cmc_recipientNonce        1 3 6 1 5 5 7 7 7 */
+CONST_ENTRY(334)	/* OBJ_id_cmc_addExtensions         1 3 6 1 5 5 7 7 8 */
+CONST_ENTRY(335)	/* OBJ_id_cmc_encryptedPOP          1 3 6 1 5 5 7 7 9 */
+CONST_ENTRY(336)	/* OBJ_id_cmc_decryptedPOP          1 3 6 1 5 5 7 7 10 */
+CONST_ENTRY(337)	/* OBJ_id_cmc_lraPOPWitness         1 3 6 1 5 5 7 7 11 */
+CONST_ENTRY(338)	/* OBJ_id_cmc_getCert               1 3 6 1 5 5 7 7 15 */
+CONST_ENTRY(339)	/* OBJ_id_cmc_getCRL                1 3 6 1 5 5 7 7 16 */
+CONST_ENTRY(340)	/* OBJ_id_cmc_revokeRequest         1 3 6 1 5 5 7 7 17 */
+CONST_ENTRY(341)	/* OBJ_id_cmc_regInfo               1 3 6 1 5 5 7 7 18 */
+CONST_ENTRY(342)	/* OBJ_id_cmc_responseInfo          1 3 6 1 5 5 7 7 19 */
+CONST_ENTRY(343)	/* OBJ_id_cmc_queryPending          1 3 6 1 5 5 7 7 21 */
+CONST_ENTRY(344)	/* OBJ_id_cmc_popLinkRandom         1 3 6 1 5 5 7 7 22 */
+CONST_ENTRY(345)	/* OBJ_id_cmc_popLinkWitness        1 3 6 1 5 5 7 7 23 */
+CONST_ENTRY(346)	/* OBJ_id_cmc_confirmCertAcceptance 1 3 6 1 5 5 7 7 24 */
+CONST_ENTRY(347)	/* OBJ_id_on_personalData           1 3 6 1 5 5 7 8 1 */
+CONST_ENTRY(858)	/* OBJ_id_on_permanentIdentifier    1 3 6 1 5 5 7 8 3 */
+CONST_ENTRY(348)	/* OBJ_id_pda_dateOfBirth           1 3 6 1 5 5 7 9 1 */
+CONST_ENTRY(349)	/* OBJ_id_pda_placeOfBirth          1 3 6 1 5 5 7 9 2 */
+CONST_ENTRY(351)	/* OBJ_id_pda_gender                1 3 6 1 5 5 7 9 3 */
+CONST_ENTRY(352)	/* OBJ_id_pda_countryOfCitizenship  1 3 6 1 5 5 7 9 4 */
+CONST_ENTRY(353)	/* OBJ_id_pda_countryOfResidence    1 3 6 1 5 5 7 9 5 */
+CONST_ENTRY(354)	/* OBJ_id_aca_authenticationInfo    1 3 6 1 5 5 7 10 1 */
+CONST_ENTRY(355)	/* OBJ_id_aca_accessIdentity        1 3 6 1 5 5 7 10 2 */
+CONST_ENTRY(356)	/* OBJ_id_aca_chargingIdentity      1 3 6 1 5 5 7 10 3 */
+CONST_ENTRY(357)	/* OBJ_id_aca_group                 1 3 6 1 5 5 7 10 4 */
+CONST_ENTRY(358)	/* OBJ_id_aca_role                  1 3 6 1 5 5 7 10 5 */
+CONST_ENTRY(399)	/* OBJ_id_aca_encAttrs              1 3 6 1 5 5 7 10 6 */
+CONST_ENTRY(359)	/* OBJ_id_qcs_pkixQCSyntax_v1       1 3 6 1 5 5 7 11 1 */
+CONST_ENTRY(360)	/* OBJ_id_cct_crs                   1 3 6 1 5 5 7 12 1 */
+CONST_ENTRY(361)	/* OBJ_id_cct_PKIData               1 3 6 1 5 5 7 12 2 */
+CONST_ENTRY(362)	/* OBJ_id_cct_PKIResponse           1 3 6 1 5 5 7 12 3 */
+CONST_ENTRY(664)	/* OBJ_id_ppl_anyLanguage           1 3 6 1 5 5 7 21 0 */
+CONST_ENTRY(665)	/* OBJ_id_ppl_inheritAll            1 3 6 1 5 5 7 21 1 */
+CONST_ENTRY(667)	/* OBJ_Independent                  1 3 6 1 5 5 7 21 2 */
+CONST_ENTRY(178)	/* OBJ_ad_OCSP                      1 3 6 1 5 5 7 48 1 */
+CONST_ENTRY(179)	/* OBJ_ad_ca_issuers                1 3 6 1 5 5 7 48 2 */
+CONST_ENTRY(363)	/* OBJ_ad_timeStamping              1 3 6 1 5 5 7 48 3 */
+CONST_ENTRY(364)	/* OBJ_ad_dvcs                      1 3 6 1 5 5 7 48 4 */
+CONST_ENTRY(785)	/* OBJ_caRepository                 1 3 6 1 5 5 7 48 5 */
+CONST_ENTRY(780)	/* OBJ_hmac_md5                     1 3 6 1 5 5 8 1 1 */
+CONST_ENTRY(781)	/* OBJ_hmac_sha1                    1 3 6 1 5 5 8 1 2 */
+CONST_ENTRY(58)	/* OBJ_netscape_cert_extension      2 16 840 1 113730 1 */
+CONST_ENTRY(59)	/* OBJ_netscape_data_type           2 16 840 1 113730 2 */
+CONST_ENTRY(438)	/* OBJ_pilotAttributeType           0 9 2342 19200300 100 1 */
+CONST_ENTRY(439)	/* OBJ_pilotAttributeSyntax         0 9 2342 19200300 100 3 */
+CONST_ENTRY(440)	/* OBJ_pilotObjectClass             0 9 2342 19200300 100 4 */
+CONST_ENTRY(441)	/* OBJ_pilotGroups                  0 9 2342 19200300 100 10 */
+CONST_ENTRY(108)	/* OBJ_cast5_cbc                    1 2 840 113533 7 66 10 */
+CONST_ENTRY(112)	/* OBJ_pbeWithMD5AndCast5_CBC       1 2 840 113533 7 66 12 */
+CONST_ENTRY(782)	/* OBJ_id_PasswordBasedMAC          1 2 840 113533 7 66 13 */
+CONST_ENTRY(783)	/* OBJ_id_DHBasedMac                1 2 840 113533 7 66 30 */
+CONST_ENTRY( 6)	/* OBJ_rsaEncryption                1 2 840 113549 1 1 1 */
+CONST_ENTRY( 7)	/* OBJ_md2WithRSAEncryption         1 2 840 113549 1 1 2 */
+CONST_ENTRY(396)	/* OBJ_md4WithRSAEncryption         1 2 840 113549 1 1 3 */
+CONST_ENTRY( 8)	/* OBJ_md5WithRSAEncryption         1 2 840 113549 1 1 4 */
+CONST_ENTRY(65)	/* OBJ_sha1WithRSAEncryption        1 2 840 113549 1 1 5 */
+CONST_ENTRY(644)	/* OBJ_rsaOAEPEncryptionSET         1 2 840 113549 1 1 6 */
+CONST_ENTRY(668)	/* OBJ_sha256WithRSAEncryption      1 2 840 113549 1 1 11 */
+CONST_ENTRY(669)	/* OBJ_sha384WithRSAEncryption      1 2 840 113549 1 1 12 */
+CONST_ENTRY(670)	/* OBJ_sha512WithRSAEncryption      1 2 840 113549 1 1 13 */
+CONST_ENTRY(671)	/* OBJ_sha224WithRSAEncryption      1 2 840 113549 1 1 14 */
+CONST_ENTRY(28)	/* OBJ_dhKeyAgreement               1 2 840 113549 1 3 1 */
+CONST_ENTRY( 9)	/* OBJ_pbeWithMD2AndDES_CBC         1 2 840 113549 1 5 1 */
+CONST_ENTRY(10)	/* OBJ_pbeWithMD5AndDES_CBC         1 2 840 113549 1 5 3 */
+CONST_ENTRY(168)	/* OBJ_pbeWithMD2AndRC2_CBC         1 2 840 113549 1 5 4 */
+CONST_ENTRY(169)	/* OBJ_pbeWithMD5AndRC2_CBC         1 2 840 113549 1 5 6 */
+CONST_ENTRY(170)	/* OBJ_pbeWithSHA1AndDES_CBC        1 2 840 113549 1 5 10 */
+CONST_ENTRY(68)	/* OBJ_pbeWithSHA1AndRC2_CBC        1 2 840 113549 1 5 11 */
+CONST_ENTRY(69)	/* OBJ_id_pbkdf2                    1 2 840 113549 1 5 12 */
+CONST_ENTRY(161)	/* OBJ_pbes2                        1 2 840 113549 1 5 13 */
+CONST_ENTRY(162)	/* OBJ_pbmac1                       1 2 840 113549 1 5 14 */
+CONST_ENTRY(21)	/* OBJ_pkcs7_data                   1 2 840 113549 1 7 1 */
+CONST_ENTRY(22)	/* OBJ_pkcs7_signed                 1 2 840 113549 1 7 2 */
+CONST_ENTRY(23)	/* OBJ_pkcs7_enveloped              1 2 840 113549 1 7 3 */
+CONST_ENTRY(24)	/* OBJ_pkcs7_signedAndEnveloped     1 2 840 113549 1 7 4 */
+CONST_ENTRY(25)	/* OBJ_pkcs7_digest                 1 2 840 113549 1 7 5 */
+CONST_ENTRY(26)	/* OBJ_pkcs7_encrypted              1 2 840 113549 1 7 6 */
+CONST_ENTRY(48)	/* OBJ_pkcs9_emailAddress           1 2 840 113549 1 9 1 */
+CONST_ENTRY(49)	/* OBJ_pkcs9_unstructuredName       1 2 840 113549 1 9 2 */
+CONST_ENTRY(50)	/* OBJ_pkcs9_contentType            1 2 840 113549 1 9 3 */
+CONST_ENTRY(51)	/* OBJ_pkcs9_messageDigest          1 2 840 113549 1 9 4 */
+CONST_ENTRY(52)	/* OBJ_pkcs9_signingTime            1 2 840 113549 1 9 5 */
+CONST_ENTRY(53)	/* OBJ_pkcs9_countersignature       1 2 840 113549 1 9 6 */
+CONST_ENTRY(54)	/* OBJ_pkcs9_challengePassword      1 2 840 113549 1 9 7 */
+CONST_ENTRY(55)	/* OBJ_pkcs9_unstructuredAddress    1 2 840 113549 1 9 8 */
+CONST_ENTRY(56)	/* OBJ_pkcs9_extCertAttributes      1 2 840 113549 1 9 9 */
+CONST_ENTRY(172)	/* OBJ_ext_req                      1 2 840 113549 1 9 14 */
+CONST_ENTRY(167)	/* OBJ_SMIMECapabilities            1 2 840 113549 1 9 15 */
+CONST_ENTRY(188)	/* OBJ_SMIME                        1 2 840 113549 1 9 16 */
+CONST_ENTRY(156)	/* OBJ_friendlyName                 1 2 840 113549 1 9 20 */
+CONST_ENTRY(157)	/* OBJ_localKeyID                   1 2 840 113549 1 9 21 */
+CONST_ENTRY(681)	/* OBJ_X9_62_onBasis                1 2 840 10045 1 2 3 1 */
+CONST_ENTRY(682)	/* OBJ_X9_62_tpBasis                1 2 840 10045 1 2 3 2 */
+CONST_ENTRY(683)	/* OBJ_X9_62_ppBasis                1 2 840 10045 1 2 3 3 */
+CONST_ENTRY(417)	/* OBJ_ms_csp_name                  1 3 6 1 4 1 311 17 1 */
+CONST_ENTRY(856)	/* OBJ_LocalKeySet                  1 3 6 1 4 1 311 17 2 */
+CONST_ENTRY(390)	/* OBJ_dcObject                     1 3 6 1 4 1 1466 344 */
+CONST_ENTRY(91)	/* OBJ_bf_cbc                       1 3 6 1 4 1 3029 1 2 */
+CONST_ENTRY(315)	/* OBJ_id_regCtrl_regToken          1 3 6 1 5 5 7 5 1 1 */
+CONST_ENTRY(316)	/* OBJ_id_regCtrl_authenticator     1 3 6 1 5 5 7 5 1 2 */
+CONST_ENTRY(317)	/* OBJ_id_regCtrl_pkiPublicationInfo 1 3 6 1 5 5 7 5 1 3 */
+CONST_ENTRY(318)	/* OBJ_id_regCtrl_pkiArchiveOptions 1 3 6 1 5 5 7 5 1 4 */
+CONST_ENTRY(319)	/* OBJ_id_regCtrl_oldCertID         1 3 6 1 5 5 7 5 1 5 */
+CONST_ENTRY(320)	/* OBJ_id_regCtrl_protocolEncrKey   1 3 6 1 5 5 7 5 1 6 */
+CONST_ENTRY(321)	/* OBJ_id_regInfo_utf8Pairs         1 3 6 1 5 5 7 5 2 1 */
+CONST_ENTRY(322)	/* OBJ_id_regInfo_certReq           1 3 6 1 5 5 7 5 2 2 */
+CONST_ENTRY(365)	/* OBJ_id_pkix_OCSP_basic           1 3 6 1 5 5 7 48 1 1 */
+CONST_ENTRY(366)	/* OBJ_id_pkix_OCSP_Nonce           1 3 6 1 5 5 7 48 1 2 */
+CONST_ENTRY(367)	/* OBJ_id_pkix_OCSP_CrlID           1 3 6 1 5 5 7 48 1 3 */
+CONST_ENTRY(368)	/* OBJ_id_pkix_OCSP_acceptableResponses 1 3 6 1 5 5 7 48 1 4 */
+CONST_ENTRY(369)	/* OBJ_id_pkix_OCSP_noCheck         1 3 6 1 5 5 7 48 1 5 */
+CONST_ENTRY(370)	/* OBJ_id_pkix_OCSP_archiveCutoff   1 3 6 1 5 5 7 48 1 6 */
+CONST_ENTRY(371)	/* OBJ_id_pkix_OCSP_serviceLocator  1 3 6 1 5 5 7 48 1 7 */
+CONST_ENTRY(372)	/* OBJ_id_pkix_OCSP_extendedStatus  1 3 6 1 5 5 7 48 1 8 */
+CONST_ENTRY(373)	/* OBJ_id_pkix_OCSP_valid           1 3 6 1 5 5 7 48 1 9 */
+CONST_ENTRY(374)	/* OBJ_id_pkix_OCSP_path            1 3 6 1 5 5 7 48 1 10 */
+CONST_ENTRY(375)	/* OBJ_id_pkix_OCSP_trustRoot       1 3 6 1 5 5 7 48 1 11 */
+CONST_ENTRY(418)	/* OBJ_aes_128_ecb                  2 16 840 1 101 3 4 1 1 */
+CONST_ENTRY(419)	/* OBJ_aes_128_cbc                  2 16 840 1 101 3 4 1 2 */
+CONST_ENTRY(420)	/* OBJ_aes_128_ofb128               2 16 840 1 101 3 4 1 3 */
+CONST_ENTRY(421)	/* OBJ_aes_128_cfb128               2 16 840 1 101 3 4 1 4 */
+CONST_ENTRY(788)	/* OBJ_id_aes128_wrap               2 16 840 1 101 3 4 1 5 */
+CONST_ENTRY(422)	/* OBJ_aes_192_ecb                  2 16 840 1 101 3 4 1 21 */
+CONST_ENTRY(423)	/* OBJ_aes_192_cbc                  2 16 840 1 101 3 4 1 22 */
+CONST_ENTRY(424)	/* OBJ_aes_192_ofb128               2 16 840 1 101 3 4 1 23 */
+CONST_ENTRY(425)	/* OBJ_aes_192_cfb128               2 16 840 1 101 3 4 1 24 */
+CONST_ENTRY(789)	/* OBJ_id_aes192_wrap               2 16 840 1 101 3 4 1 25 */
+CONST_ENTRY(426)	/* OBJ_aes_256_ecb                  2 16 840 1 101 3 4 1 41 */
+CONST_ENTRY(427)	/* OBJ_aes_256_cbc                  2 16 840 1 101 3 4 1 42 */
+CONST_ENTRY(428)	/* OBJ_aes_256_ofb128               2 16 840 1 101 3 4 1 43 */
+CONST_ENTRY(429)	/* OBJ_aes_256_cfb128               2 16 840 1 101 3 4 1 44 */
+CONST_ENTRY(790)	/* OBJ_id_aes256_wrap               2 16 840 1 101 3 4 1 45 */
+CONST_ENTRY(672)	/* OBJ_sha256                       2 16 840 1 101 3 4 2 1 */
+CONST_ENTRY(673)	/* OBJ_sha384                       2 16 840 1 101 3 4 2 2 */
+CONST_ENTRY(674)	/* OBJ_sha512                       2 16 840 1 101 3 4 2 3 */
+CONST_ENTRY(675)	/* OBJ_sha224                       2 16 840 1 101 3 4 2 4 */
+CONST_ENTRY(802)	/* OBJ_dsa_with_SHA224              2 16 840 1 101 3 4 3 1 */
+CONST_ENTRY(803)	/* OBJ_dsa_with_SHA256              2 16 840 1 101 3 4 3 2 */
+CONST_ENTRY(71)	/* OBJ_netscape_cert_type           2 16 840 1 113730 1 1 */
+CONST_ENTRY(72)	/* OBJ_netscape_base_url            2 16 840 1 113730 1 2 */
+CONST_ENTRY(73)	/* OBJ_netscape_revocation_url      2 16 840 1 113730 1 3 */
+CONST_ENTRY(74)	/* OBJ_netscape_ca_revocation_url   2 16 840 1 113730 1 4 */
+CONST_ENTRY(75)	/* OBJ_netscape_renewal_url         2 16 840 1 113730 1 7 */
+CONST_ENTRY(76)	/* OBJ_netscape_ca_policy_url       2 16 840 1 113730 1 8 */
+CONST_ENTRY(77)	/* OBJ_netscape_ssl_server_name     2 16 840 1 113730 1 12 */
+CONST_ENTRY(78)	/* OBJ_netscape_comment             2 16 840 1 113730 1 13 */
+CONST_ENTRY(79)	/* OBJ_netscape_cert_sequence       2 16 840 1 113730 2 5 */
+CONST_ENTRY(139)	/* OBJ_ns_sgc                       2 16 840 1 113730 4 1 */
+CONST_ENTRY(458)	/* OBJ_userId                       0 9 2342 19200300 100 1 1 */
+CONST_ENTRY(459)	/* OBJ_textEncodedORAddress         0 9 2342 19200300 100 1 2 */
+CONST_ENTRY(460)	/* OBJ_rfc822Mailbox                0 9 2342 19200300 100 1 3 */
+CONST_ENTRY(461)	/* OBJ_info                         0 9 2342 19200300 100 1 4 */
+CONST_ENTRY(462)	/* OBJ_favouriteDrink               0 9 2342 19200300 100 1 5 */
+CONST_ENTRY(463)	/* OBJ_roomNumber                   0 9 2342 19200300 100 1 6 */
+CONST_ENTRY(464)	/* OBJ_photo                        0 9 2342 19200300 100 1 7 */
+CONST_ENTRY(465)	/* OBJ_userClass                    0 9 2342 19200300 100 1 8 */
+CONST_ENTRY(466)	/* OBJ_host                         0 9 2342 19200300 100 1 9 */
+CONST_ENTRY(467)	/* OBJ_manager                      0 9 2342 19200300 100 1 10 */
+CONST_ENTRY(468)	/* OBJ_documentIdentifier           0 9 2342 19200300 100 1 11 */
+CONST_ENTRY(469)	/* OBJ_documentTitle                0 9 2342 19200300 100 1 12 */
+CONST_ENTRY(470)	/* OBJ_documentVersion              0 9 2342 19200300 100 1 13 */
+CONST_ENTRY(471)	/* OBJ_documentAuthor               0 9 2342 19200300 100 1 14 */
+CONST_ENTRY(472)	/* OBJ_documentLocation             0 9 2342 19200300 100 1 15 */
+CONST_ENTRY(473)	/* OBJ_homeTelephoneNumber          0 9 2342 19200300 100 1 20 */
+CONST_ENTRY(474)	/* OBJ_secretary                    0 9 2342 19200300 100 1 21 */
+CONST_ENTRY(475)	/* OBJ_otherMailbox                 0 9 2342 19200300 100 1 22 */
+CONST_ENTRY(476)	/* OBJ_lastModifiedTime             0 9 2342 19200300 100 1 23 */
+CONST_ENTRY(477)	/* OBJ_lastModifiedBy               0 9 2342 19200300 100 1 24 */
+CONST_ENTRY(391)	/* OBJ_domainComponent              0 9 2342 19200300 100 1 25 */
+CONST_ENTRY(478)	/* OBJ_aRecord                      0 9 2342 19200300 100 1 26 */
+CONST_ENTRY(479)	/* OBJ_pilotAttributeType27         0 9 2342 19200300 100 1 27 */
+CONST_ENTRY(480)	/* OBJ_mXRecord                     0 9 2342 19200300 100 1 28 */
+CONST_ENTRY(481)	/* OBJ_nSRecord                     0 9 2342 19200300 100 1 29 */
+CONST_ENTRY(482)	/* OBJ_sOARecord                    0 9 2342 19200300 100 1 30 */
+CONST_ENTRY(483)	/* OBJ_cNAMERecord                  0 9 2342 19200300 100 1 31 */
+CONST_ENTRY(484)	/* OBJ_associatedDomain             0 9 2342 19200300 100 1 37 */
+CONST_ENTRY(485)	/* OBJ_associatedName               0 9 2342 19200300 100 1 38 */
+CONST_ENTRY(486)	/* OBJ_homePostalAddress            0 9 2342 19200300 100 1 39 */
+CONST_ENTRY(487)	/* OBJ_personalTitle                0 9 2342 19200300 100 1 40 */
+CONST_ENTRY(488)	/* OBJ_mobileTelephoneNumber        0 9 2342 19200300 100 1 41 */
+CONST_ENTRY(489)	/* OBJ_pagerTelephoneNumber         0 9 2342 19200300 100 1 42 */
+CONST_ENTRY(490)	/* OBJ_friendlyCountryName          0 9 2342 19200300 100 1 43 */
+CONST_ENTRY(491)	/* OBJ_organizationalStatus         0 9 2342 19200300 100 1 45 */
+CONST_ENTRY(492)	/* OBJ_janetMailbox                 0 9 2342 19200300 100 1 46 */
+CONST_ENTRY(493)	/* OBJ_mailPreferenceOption         0 9 2342 19200300 100 1 47 */
+CONST_ENTRY(494)	/* OBJ_buildingName                 0 9 2342 19200300 100 1 48 */
+CONST_ENTRY(495)	/* OBJ_dSAQuality                   0 9 2342 19200300 100 1 49 */
+CONST_ENTRY(496)	/* OBJ_singleLevelQuality           0 9 2342 19200300 100 1 50 */
+CONST_ENTRY(497)	/* OBJ_subtreeMinimumQuality        0 9 2342 19200300 100 1 51 */
+CONST_ENTRY(498)	/* OBJ_subtreeMaximumQuality        0 9 2342 19200300 100 1 52 */
+CONST_ENTRY(499)	/* OBJ_personalSignature            0 9 2342 19200300 100 1 53 */
+CONST_ENTRY(500)	/* OBJ_dITRedirect                  0 9 2342 19200300 100 1 54 */
+CONST_ENTRY(501)	/* OBJ_audio                        0 9 2342 19200300 100 1 55 */
+CONST_ENTRY(502)	/* OBJ_documentPublisher            0 9 2342 19200300 100 1 56 */
+CONST_ENTRY(442)	/* OBJ_iA5StringSyntax              0 9 2342 19200300 100 3 4 */
+CONST_ENTRY(443)	/* OBJ_caseIgnoreIA5StringSyntax    0 9 2342 19200300 100 3 5 */
+CONST_ENTRY(444)	/* OBJ_pilotObject                  0 9 2342 19200300 100 4 3 */
+CONST_ENTRY(445)	/* OBJ_pilotPerson                  0 9 2342 19200300 100 4 4 */
+CONST_ENTRY(446)	/* OBJ_account                      0 9 2342 19200300 100 4 5 */
+CONST_ENTRY(447)	/* OBJ_document                     0 9 2342 19200300 100 4 6 */
+CONST_ENTRY(448)	/* OBJ_room                         0 9 2342 19200300 100 4 7 */
+CONST_ENTRY(449)	/* OBJ_documentSeries               0 9 2342 19200300 100 4 9 */
+CONST_ENTRY(392)	/* OBJ_Domain                       0 9 2342 19200300 100 4 13 */
+CONST_ENTRY(450)	/* OBJ_rFC822localPart              0 9 2342 19200300 100 4 14 */
+CONST_ENTRY(451)	/* OBJ_dNSDomain                    0 9 2342 19200300 100 4 15 */
+CONST_ENTRY(452)	/* OBJ_domainRelatedObject          0 9 2342 19200300 100 4 17 */
+CONST_ENTRY(453)	/* OBJ_friendlyCountry              0 9 2342 19200300 100 4 18 */
+CONST_ENTRY(454)	/* OBJ_simpleSecurityObject         0 9 2342 19200300 100 4 19 */
+CONST_ENTRY(455)	/* OBJ_pilotOrganization            0 9 2342 19200300 100 4 20 */
+CONST_ENTRY(456)	/* OBJ_pilotDSA                     0 9 2342 19200300 100 4 21 */
+CONST_ENTRY(457)	/* OBJ_qualityLabelledData          0 9 2342 19200300 100 4 22 */
+CONST_ENTRY(189)	/* OBJ_id_smime_mod                 1 2 840 113549 1 9 16 0 */
+CONST_ENTRY(190)	/* OBJ_id_smime_ct                  1 2 840 113549 1 9 16 1 */
+CONST_ENTRY(191)	/* OBJ_id_smime_aa                  1 2 840 113549 1 9 16 2 */
+CONST_ENTRY(192)	/* OBJ_id_smime_alg                 1 2 840 113549 1 9 16 3 */
+CONST_ENTRY(193)	/* OBJ_id_smime_cd                  1 2 840 113549 1 9 16 4 */
+CONST_ENTRY(194)	/* OBJ_id_smime_spq                 1 2 840 113549 1 9 16 5 */
+CONST_ENTRY(195)	/* OBJ_id_smime_cti                 1 2 840 113549 1 9 16 6 */
+CONST_ENTRY(158)	/* OBJ_x509Certificate              1 2 840 113549 1 9 22 1 */
+CONST_ENTRY(159)	/* OBJ_sdsiCertificate              1 2 840 113549 1 9 22 2 */
+CONST_ENTRY(160)	/* OBJ_x509Crl                      1 2 840 113549 1 9 23 1 */
+CONST_ENTRY(144)	/* OBJ_pbe_WithSHA1And128BitRC4     1 2 840 113549 1 12 1 1 */
+CONST_ENTRY(145)	/* OBJ_pbe_WithSHA1And40BitRC4      1 2 840 113549 1 12 1 2 */
+CONST_ENTRY(146)	/* OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC 1 2 840 113549 1 12 1 3 */
+CONST_ENTRY(147)	/* OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC 1 2 840 113549 1 12 1 4 */
+CONST_ENTRY(148)	/* OBJ_pbe_WithSHA1And128BitRC2_CBC 1 2 840 113549 1 12 1 5 */
+CONST_ENTRY(149)	/* OBJ_pbe_WithSHA1And40BitRC2_CBC  1 2 840 113549 1 12 1 6 */
+CONST_ENTRY(171)	/* OBJ_ms_ext_req                   1 3 6 1 4 1 311 2 1 14 */
+CONST_ENTRY(134)	/* OBJ_ms_code_ind                  1 3 6 1 4 1 311 2 1 21 */
+CONST_ENTRY(135)	/* OBJ_ms_code_com                  1 3 6 1 4 1 311 2 1 22 */
+CONST_ENTRY(136)	/* OBJ_ms_ctl_sign                  1 3 6 1 4 1 311 10 3 1 */
+CONST_ENTRY(137)	/* OBJ_ms_sgc                       1 3 6 1 4 1 311 10 3 3 */
+CONST_ENTRY(138)	/* OBJ_ms_efs                       1 3 6 1 4 1 311 10 3 4 */
+CONST_ENTRY(648)	/* OBJ_ms_smartcard_login           1 3 6 1 4 1 311 20 2 2 */
+CONST_ENTRY(649)	/* OBJ_ms_upn                       1 3 6 1 4 1 311 20 2 3 */
+CONST_ENTRY(751)	/* OBJ_camellia_128_cbc             1 2 392 200011 61 1 1 1 2 */
+CONST_ENTRY(752)	/* OBJ_camellia_192_cbc             1 2 392 200011 61 1 1 1 3 */
+CONST_ENTRY(753)	/* OBJ_camellia_256_cbc             1 2 392 200011 61 1 1 1 4 */
+CONST_ENTRY(196)	/* OBJ_id_smime_mod_cms             1 2 840 113549 1 9 16 0 1 */
+CONST_ENTRY(197)	/* OBJ_id_smime_mod_ess             1 2 840 113549 1 9 16 0 2 */
+CONST_ENTRY(198)	/* OBJ_id_smime_mod_oid             1 2 840 113549 1 9 16 0 3 */
+CONST_ENTRY(199)	/* OBJ_id_smime_mod_msg_v3          1 2 840 113549 1 9 16 0 4 */
+CONST_ENTRY(200)	/* OBJ_id_smime_mod_ets_eSignature_88 1 2 840 113549 1 9 16 0 5 */
+CONST_ENTRY(201)	/* OBJ_id_smime_mod_ets_eSignature_97 1 2 840 113549 1 9 16 0 6 */
+CONST_ENTRY(202)	/* OBJ_id_smime_mod_ets_eSigPolicy_88 1 2 840 113549 1 9 16 0 7 */
+CONST_ENTRY(203)	/* OBJ_id_smime_mod_ets_eSigPolicy_97 1 2 840 113549 1 9 16 0 8 */
+CONST_ENTRY(204)	/* OBJ_id_smime_ct_receipt          1 2 840 113549 1 9 16 1 1 */
+CONST_ENTRY(205)	/* OBJ_id_smime_ct_authData         1 2 840 113549 1 9 16 1 2 */
+CONST_ENTRY(206)	/* OBJ_id_smime_ct_publishCert      1 2 840 113549 1 9 16 1 3 */
+CONST_ENTRY(207)	/* OBJ_id_smime_ct_TSTInfo          1 2 840 113549 1 9 16 1 4 */
+CONST_ENTRY(208)	/* OBJ_id_smime_ct_TDTInfo          1 2 840 113549 1 9 16 1 5 */
+CONST_ENTRY(209)	/* OBJ_id_smime_ct_contentInfo      1 2 840 113549 1 9 16 1 6 */
+CONST_ENTRY(210)	/* OBJ_id_smime_ct_DVCSRequestData  1 2 840 113549 1 9 16 1 7 */
+CONST_ENTRY(211)	/* OBJ_id_smime_ct_DVCSResponseData 1 2 840 113549 1 9 16 1 8 */
+CONST_ENTRY(786)	/* OBJ_id_smime_ct_compressedData   1 2 840 113549 1 9 16 1 9 */
+CONST_ENTRY(787)	/* OBJ_id_ct_asciiTextWithCRLF      1 2 840 113549 1 9 16 1 27 */
+CONST_ENTRY(212)	/* OBJ_id_smime_aa_receiptRequest   1 2 840 113549 1 9 16 2 1 */
+CONST_ENTRY(213)	/* OBJ_id_smime_aa_securityLabel    1 2 840 113549 1 9 16 2 2 */
+CONST_ENTRY(214)	/* OBJ_id_smime_aa_mlExpandHistory  1 2 840 113549 1 9 16 2 3 */
+CONST_ENTRY(215)	/* OBJ_id_smime_aa_contentHint      1 2 840 113549 1 9 16 2 4 */
+CONST_ENTRY(216)	/* OBJ_id_smime_aa_msgSigDigest     1 2 840 113549 1 9 16 2 5 */
+CONST_ENTRY(217)	/* OBJ_id_smime_aa_encapContentType 1 2 840 113549 1 9 16 2 6 */
+CONST_ENTRY(218)	/* OBJ_id_smime_aa_contentIdentifier 1 2 840 113549 1 9 16 2 7 */
+CONST_ENTRY(219)	/* OBJ_id_smime_aa_macValue         1 2 840 113549 1 9 16 2 8 */
+CONST_ENTRY(220)	/* OBJ_id_smime_aa_equivalentLabels 1 2 840 113549 1 9 16 2 9 */
+CONST_ENTRY(221)	/* OBJ_id_smime_aa_contentReference 1 2 840 113549 1 9 16 2 10 */
+CONST_ENTRY(222)	/* OBJ_id_smime_aa_encrypKeyPref    1 2 840 113549 1 9 16 2 11 */
+CONST_ENTRY(223)	/* OBJ_id_smime_aa_signingCertificate 1 2 840 113549 1 9 16 2 12 */
+CONST_ENTRY(224)	/* OBJ_id_smime_aa_smimeEncryptCerts 1 2 840 113549 1 9 16 2 13 */
+CONST_ENTRY(225)	/* OBJ_id_smime_aa_timeStampToken   1 2 840 113549 1 9 16 2 14 */
+CONST_ENTRY(226)	/* OBJ_id_smime_aa_ets_sigPolicyId  1 2 840 113549 1 9 16 2 15 */
+CONST_ENTRY(227)	/* OBJ_id_smime_aa_ets_commitmentType 1 2 840 113549 1 9 16 2 16 */
+CONST_ENTRY(228)	/* OBJ_id_smime_aa_ets_signerLocation 1 2 840 113549 1 9 16 2 17 */
+CONST_ENTRY(229)	/* OBJ_id_smime_aa_ets_signerAttr   1 2 840 113549 1 9 16 2 18 */
+CONST_ENTRY(230)	/* OBJ_id_smime_aa_ets_otherSigCert 1 2 840 113549 1 9 16 2 19 */
+CONST_ENTRY(231)	/* OBJ_id_smime_aa_ets_contentTimestamp 1 2 840 113549 1 9 16 2 20 */
+CONST_ENTRY(232)	/* OBJ_id_smime_aa_ets_CertificateRefs 1 2 840 113549 1 9 16 2 21 */
+CONST_ENTRY(233)	/* OBJ_id_smime_aa_ets_RevocationRefs 1 2 840 113549 1 9 16 2 22 */
+CONST_ENTRY(234)	/* OBJ_id_smime_aa_ets_certValues   1 2 840 113549 1 9 16 2 23 */
+CONST_ENTRY(235)	/* OBJ_id_smime_aa_ets_revocationValues 1 2 840 113549 1 9 16 2 24 */
+CONST_ENTRY(236)	/* OBJ_id_smime_aa_ets_escTimeStamp 1 2 840 113549 1 9 16 2 25 */
+CONST_ENTRY(237)	/* OBJ_id_smime_aa_ets_certCRLTimestamp 1 2 840 113549 1 9 16 2 26 */
+CONST_ENTRY(238)	/* OBJ_id_smime_aa_ets_archiveTimeStamp 1 2 840 113549 1 9 16 2 27 */
+CONST_ENTRY(239)	/* OBJ_id_smime_aa_signatureType    1 2 840 113549 1 9 16 2 28 */
+CONST_ENTRY(240)	/* OBJ_id_smime_aa_dvcs_dvc         1 2 840 113549 1 9 16 2 29 */
+CONST_ENTRY(241)	/* OBJ_id_smime_alg_ESDHwith3DES    1 2 840 113549 1 9 16 3 1 */
+CONST_ENTRY(242)	/* OBJ_id_smime_alg_ESDHwithRC2     1 2 840 113549 1 9 16 3 2 */
+CONST_ENTRY(243)	/* OBJ_id_smime_alg_3DESwrap        1 2 840 113549 1 9 16 3 3 */
+CONST_ENTRY(244)	/* OBJ_id_smime_alg_RC2wrap         1 2 840 113549 1 9 16 3 4 */
+CONST_ENTRY(245)	/* OBJ_id_smime_alg_ESDH            1 2 840 113549 1 9 16 3 5 */
+CONST_ENTRY(246)	/* OBJ_id_smime_alg_CMS3DESwrap     1 2 840 113549 1 9 16 3 6 */
+CONST_ENTRY(247)	/* OBJ_id_smime_alg_CMSRC2wrap      1 2 840 113549 1 9 16 3 7 */
+CONST_ENTRY(125)	/* OBJ_zlib_compression             1 2 840 113549 1 9 16 3 8 */
+CONST_ENTRY(248)	/* OBJ_id_smime_cd_ldap             1 2 840 113549 1 9 16 4 1 */
+CONST_ENTRY(249)	/* OBJ_id_smime_spq_ets_sqt_uri     1 2 840 113549 1 9 16 5 1 */
+CONST_ENTRY(250)	/* OBJ_id_smime_spq_ets_sqt_unotice 1 2 840 113549 1 9 16 5 2 */
+CONST_ENTRY(251)	/* OBJ_id_smime_cti_ets_proofOfOrigin 1 2 840 113549 1 9 16 6 1 */
+CONST_ENTRY(252)	/* OBJ_id_smime_cti_ets_proofOfReceipt 1 2 840 113549 1 9 16 6 2 */
+CONST_ENTRY(253)	/* OBJ_id_smime_cti_ets_proofOfDelivery 1 2 840 113549 1 9 16 6 3 */
+CONST_ENTRY(254)	/* OBJ_id_smime_cti_ets_proofOfSender 1 2 840 113549 1 9 16 6 4 */
+CONST_ENTRY(255)	/* OBJ_id_smime_cti_ets_proofOfApproval 1 2 840 113549 1 9 16 6 5 */
+CONST_ENTRY(256)	/* OBJ_id_smime_cti_ets_proofOfCreation 1 2 840 113549 1 9 16 6 6 */
+CONST_ENTRY(150)	/* OBJ_keyBag                       1 2 840 113549 1 12 10 1 1 */
+CONST_ENTRY(151)	/* OBJ_pkcs8ShroudedKeyBag          1 2 840 113549 1 12 10 1 2 */
+CONST_ENTRY(152)	/* OBJ_certBag                      1 2 840 113549 1 12 10 1 3 */
+CONST_ENTRY(153)	/* OBJ_crlBag                       1 2 840 113549 1 12 10 1 4 */
+CONST_ENTRY(154)	/* OBJ_secretBag                    1 2 840 113549 1 12 10 1 5 */
+CONST_ENTRY(155)	/* OBJ_safeContentsBag              1 2 840 113549 1 12 10 1 6 */
+CONST_ENTRY(34)	/* OBJ_idea_cbc                     1 3 6 1 4 1 188 7 1 1 2 */
+CONST_END(obj_objs)
 
-static const unsigned int ln_objs[NUM_LN]={
-363,	/* "AD Time Stamping" */
-405,	/* "ANSI X9.62" */
-368,	/* "Acceptable OCSP Responses" */
-664,	/* "Any language" */
-177,	/* "Authority Information Access" */
-365,	/* "Basic OCSP Response" */
-285,	/* "Biometric Info" */
-179,	/* "CA Issuers" */
-785,	/* "CA Repository" */
-131,	/* "Code Signing" */
-783,	/* "Diffie-Hellman based MAC" */
-382,	/* "Directory" */
-392,	/* "Domain" */
-132,	/* "E-mail Protection" */
-389,	/* "Enterprises" */
-384,	/* "Experimental" */
-372,	/* "Extended OCSP Status" */
-172,	/* "Extension Request" */
-813,	/* "GOST 28147-89" */
-849,	/* "GOST 28147-89 Cryptocom ParamSet" */
-815,	/* "GOST 28147-89 MAC" */
-851,	/* "GOST 34.10-2001 Cryptocom" */
-850,	/* "GOST 34.10-94 Cryptocom" */
-811,	/* "GOST R 34.10-2001" */
-817,	/* "GOST R 34.10-2001 DH" */
-812,	/* "GOST R 34.10-94" */
-818,	/* "GOST R 34.10-94 DH" */
-809,	/* "GOST R 34.11-94" */
-816,	/* "GOST R 34.11-94 PRF" */
-807,	/* "GOST R 34.11-94 with GOST R 34.10-2001" */
-853,	/* "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom" */
-808,	/* "GOST R 34.11-94 with GOST R 34.10-94" */
-852,	/* "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom" */
-854,	/* "GOST R 3410-2001 Parameter Set Cryptocom" */
-810,	/* "HMAC GOST 34.11-94" */
-432,	/* "Hold Instruction Call Issuer" */
-430,	/* "Hold Instruction Code" */
-431,	/* "Hold Instruction None" */
-433,	/* "Hold Instruction Reject" */
-634,	/* "ICC or token signature" */
-294,	/* "IPSec End System" */
-295,	/* "IPSec Tunnel" */
-296,	/* "IPSec User" */
-182,	/* "ISO Member Body" */
-183,	/* "ISO US Member Body" */
-667,	/* "Independent" */
-665,	/* "Inherit all" */
-647,	/* "International Organizations" */
-142,	/* "Invalidity Date" */
-504,	/* "MIME MHS" */
-388,	/* "Mail" */
-383,	/* "Management" */
-417,	/* "Microsoft CSP Name" */
-135,	/* "Microsoft Commercial Code Signing" */
-138,	/* "Microsoft Encrypted File System" */
-171,	/* "Microsoft Extension Request" */
-134,	/* "Microsoft Individual Code Signing" */
-856,	/* "Microsoft Local Key set" */
-137,	/* "Microsoft Server Gated Crypto" */
-648,	/* "Microsoft Smartcardlogin" */
-136,	/* "Microsoft Trust List Signing" */
-649,	/* "Microsoft Universal Principal Name" */
-393,	/* "NULL" */
-404,	/* "NULL" */
-72,	/* "Netscape Base Url" */
-76,	/* "Netscape CA Policy Url" */
-74,	/* "Netscape CA Revocation Url" */
-71,	/* "Netscape Cert Type" */
-58,	/* "Netscape Certificate Extension" */
-79,	/* "Netscape Certificate Sequence" */
-78,	/* "Netscape Comment" */
-57,	/* "Netscape Communications Corp." */
-59,	/* "Netscape Data Type" */
-75,	/* "Netscape Renewal Url" */
-73,	/* "Netscape Revocation Url" */
-77,	/* "Netscape SSL Server Name" */
-139,	/* "Netscape Server Gated Crypto" */
-178,	/* "OCSP" */
-370,	/* "OCSP Archive Cutoff" */
-367,	/* "OCSP CRL ID" */
-369,	/* "OCSP No Check" */
-366,	/* "OCSP Nonce" */
-371,	/* "OCSP Service Locator" */
-180,	/* "OCSP Signing" */
-161,	/* "PBES2" */
-69,	/* "PBKDF2" */
-162,	/* "PBMAC1" */
-127,	/* "PKIX" */
-858,	/* "Permanent Identifier" */
-164,	/* "Policy Qualifier CPS" */
-165,	/* "Policy Qualifier User Notice" */
-385,	/* "Private" */
-663,	/* "Proxy Certificate Information" */
- 1,	/* "RSA Data Security, Inc." */
- 2,	/* "RSA Data Security, Inc. PKCS" */
-188,	/* "S/MIME" */
-167,	/* "S/MIME Capabilities" */
-387,	/* "SNMPv2" */
-512,	/* "Secure Electronic Transactions" */
-386,	/* "Security" */
-394,	/* "Selected Attribute Types" */
-143,	/* "Strong Extranet ID" */
-398,	/* "Subject Information Access" */
-130,	/* "TLS Web Client Authentication" */
-129,	/* "TLS Web Server Authentication" */
-133,	/* "Time Stamping" */
-375,	/* "Trust Root" */
-12,	/* "X509" */
-402,	/* "X509v3 AC Targeting" */
-746,	/* "X509v3 Any Policy" */
-90,	/* "X509v3 Authority Key Identifier" */
-87,	/* "X509v3 Basic Constraints" */
-103,	/* "X509v3 CRL Distribution Points" */
-88,	/* "X509v3 CRL Number" */
-141,	/* "X509v3 CRL Reason Code" */
-771,	/* "X509v3 Certificate Issuer" */
-89,	/* "X509v3 Certificate Policies" */
-140,	/* "X509v3 Delta CRL Indicator" */
-126,	/* "X509v3 Extended Key Usage" */
-857,	/* "X509v3 Freshest CRL" */
-748,	/* "X509v3 Inhibit Any Policy" */
-86,	/* "X509v3 Issuer Alternative Name" */
-770,	/* "X509v3 Issuing Distrubution Point" */
-83,	/* "X509v3 Key Usage" */
-666,	/* "X509v3 Name Constraints" */
-403,	/* "X509v3 No Revocation Available" */
-401,	/* "X509v3 Policy Constraints" */
-747,	/* "X509v3 Policy Mappings" */
-84,	/* "X509v3 Private Key Usage Period" */
-85,	/* "X509v3 Subject Alternative Name" */
-769,	/* "X509v3 Subject Directory Attributes" */
-82,	/* "X509v3 Subject Key Identifier" */
-184,	/* "X9.57" */
-185,	/* "X9.57 CM ?" */
-478,	/* "aRecord" */
-289,	/* "aaControls" */
-287,	/* "ac-auditEntity" */
-397,	/* "ac-proxying" */
-288,	/* "ac-targeting" */
-446,	/* "account" */
-364,	/* "ad dvcs" */
-606,	/* "additional verification" */
-419,	/* "aes-128-cbc" */
-421,	/* "aes-128-cfb" */
-650,	/* "aes-128-cfb1" */
-653,	/* "aes-128-cfb8" */
-418,	/* "aes-128-ecb" */
-420,	/* "aes-128-ofb" */
-423,	/* "aes-192-cbc" */
-425,	/* "aes-192-cfb" */
-651,	/* "aes-192-cfb1" */
-654,	/* "aes-192-cfb8" */
-422,	/* "aes-192-ecb" */
-424,	/* "aes-192-ofb" */
-427,	/* "aes-256-cbc" */
-429,	/* "aes-256-cfb" */
-652,	/* "aes-256-cfb1" */
-655,	/* "aes-256-cfb8" */
-426,	/* "aes-256-ecb" */
-428,	/* "aes-256-ofb" */
-376,	/* "algorithm" */
-484,	/* "associatedDomain" */
-485,	/* "associatedName" */
-501,	/* "audio" */
-882,	/* "authorityRevocationList" */
-91,	/* "bf-cbc" */
-93,	/* "bf-cfb" */
-92,	/* "bf-ecb" */
-94,	/* "bf-ofb" */
-494,	/* "buildingName" */
-860,	/* "businessCategory" */
-691,	/* "c2onb191v4" */
-692,	/* "c2onb191v5" */
-697,	/* "c2onb239v4" */
-698,	/* "c2onb239v5" */
-684,	/* "c2pnb163v1" */
-685,	/* "c2pnb163v2" */
-686,	/* "c2pnb163v3" */
-687,	/* "c2pnb176v1" */
-693,	/* "c2pnb208w1" */
-699,	/* "c2pnb272w1" */
-700,	/* "c2pnb304w1" */
-702,	/* "c2pnb368w1" */
-688,	/* "c2tnb191v1" */
-689,	/* "c2tnb191v2" */
-690,	/* "c2tnb191v3" */
-694,	/* "c2tnb239v1" */
-695,	/* "c2tnb239v2" */
-696,	/* "c2tnb239v3" */
-701,	/* "c2tnb359v1" */
-703,	/* "c2tnb431r1" */
-881,	/* "cACertificate" */
-483,	/* "cNAMERecord" */
-751,	/* "camellia-128-cbc" */
-757,	/* "camellia-128-cfb" */
-760,	/* "camellia-128-cfb1" */
-763,	/* "camellia-128-cfb8" */
-754,	/* "camellia-128-ecb" */
-766,	/* "camellia-128-ofb" */
-752,	/* "camellia-192-cbc" */
-758,	/* "camellia-192-cfb" */
-761,	/* "camellia-192-cfb1" */
-764,	/* "camellia-192-cfb8" */
-755,	/* "camellia-192-ecb" */
-767,	/* "camellia-192-ofb" */
-753,	/* "camellia-256-cbc" */
-759,	/* "camellia-256-cfb" */
-762,	/* "camellia-256-cfb1" */
-765,	/* "camellia-256-cfb8" */
-756,	/* "camellia-256-ecb" */
-768,	/* "camellia-256-ofb" */
-443,	/* "caseIgnoreIA5StringSyntax" */
-108,	/* "cast5-cbc" */
-110,	/* "cast5-cfb" */
-109,	/* "cast5-ecb" */
-111,	/* "cast5-ofb" */
-152,	/* "certBag" */
-677,	/* "certicom-arc" */
-517,	/* "certificate extensions" */
-883,	/* "certificateRevocationList" */
-54,	/* "challengePassword" */
-407,	/* "characteristic-two-field" */
-395,	/* "clearance" */
-633,	/* "cleartext track 2" */
-13,	/* "commonName" */
-513,	/* "content types" */
-50,	/* "contentType" */
-53,	/* "countersignature" */
-14,	/* "countryName" */
-153,	/* "crlBag" */
-884,	/* "crossCertificatePair" */
-806,	/* "cryptocom" */
-805,	/* "cryptopro" */
-500,	/* "dITRedirect" */
-451,	/* "dNSDomain" */
-495,	/* "dSAQuality" */
-434,	/* "data" */
-390,	/* "dcObject" */
-891,	/* "deltaRevocationList" */
-31,	/* "des-cbc" */
-643,	/* "des-cdmf" */
-30,	/* "des-cfb" */
-656,	/* "des-cfb1" */
-657,	/* "des-cfb8" */
-29,	/* "des-ecb" */
-32,	/* "des-ede" */
-43,	/* "des-ede-cbc" */
-60,	/* "des-ede-cfb" */
-62,	/* "des-ede-ofb" */
-33,	/* "des-ede3" */
-44,	/* "des-ede3-cbc" */
-61,	/* "des-ede3-cfb" */
-658,	/* "des-ede3-cfb1" */
-659,	/* "des-ede3-cfb8" */
-63,	/* "des-ede3-ofb" */
-45,	/* "des-ofb" */
-107,	/* "description" */
-871,	/* "destinationIndicator" */
-80,	/* "desx-cbc" */
-28,	/* "dhKeyAgreement" */
-11,	/* "directory services (X.500)" */
-378,	/* "directory services - algorithms" */
-887,	/* "distinguishedName" */
-892,	/* "dmdName" */
-174,	/* "dnQualifier" */
-447,	/* "document" */
-471,	/* "documentAuthor" */
-468,	/* "documentIdentifier" */
-472,	/* "documentLocation" */
-502,	/* "documentPublisher" */
-449,	/* "documentSeries" */
-469,	/* "documentTitle" */
-470,	/* "documentVersion" */
-380,	/* "dod" */
-391,	/* "domainComponent" */
-452,	/* "domainRelatedObject" */
-116,	/* "dsaEncryption" */
-67,	/* "dsaEncryption-old" */
-66,	/* "dsaWithSHA" */
-113,	/* "dsaWithSHA1" */
-70,	/* "dsaWithSHA1-old" */
-802,	/* "dsa_with_SHA224" */
-803,	/* "dsa_with_SHA256" */
-297,	/* "dvcs" */
-791,	/* "ecdsa-with-Recommended" */
-416,	/* "ecdsa-with-SHA1" */
-793,	/* "ecdsa-with-SHA224" */
-794,	/* "ecdsa-with-SHA256" */
-795,	/* "ecdsa-with-SHA384" */
-796,	/* "ecdsa-with-SHA512" */
-792,	/* "ecdsa-with-Specified" */
-48,	/* "emailAddress" */
-632,	/* "encrypted track 2" */
-885,	/* "enhancedSearchGuide" */
-56,	/* "extendedCertificateAttributes" */
-867,	/* "facsimileTelephoneNumber" */
-462,	/* "favouriteDrink" */
-453,	/* "friendlyCountry" */
-490,	/* "friendlyCountryName" */
-156,	/* "friendlyName" */
-631,	/* "generate cryptogram" */
-509,	/* "generationQualifier" */
-601,	/* "generic cryptogram" */
-99,	/* "givenName" */
-814,	/* "gost89-cnt" */
-855,	/* "hmac" */
-780,	/* "hmac-md5" */
-781,	/* "hmac-sha1" */
-797,	/* "hmacWithMD5" */
-163,	/* "hmacWithSHA1" */
-798,	/* "hmacWithSHA224" */
-799,	/* "hmacWithSHA256" */
-800,	/* "hmacWithSHA384" */
-801,	/* "hmacWithSHA512" */
-486,	/* "homePostalAddress" */
-473,	/* "homeTelephoneNumber" */
-466,	/* "host" */
-889,	/* "houseIdentifier" */
-442,	/* "iA5StringSyntax" */
-381,	/* "iana" */
-824,	/* "id-Gost28147-89-CryptoPro-A-ParamSet" */
-825,	/* "id-Gost28147-89-CryptoPro-B-ParamSet" */
-826,	/* "id-Gost28147-89-CryptoPro-C-ParamSet" */
-827,	/* "id-Gost28147-89-CryptoPro-D-ParamSet" */
-819,	/* "id-Gost28147-89-CryptoPro-KeyMeshing" */
-829,	/* "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" */
-828,	/* "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" */
-830,	/* "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" */
-820,	/* "id-Gost28147-89-None-KeyMeshing" */
-823,	/* "id-Gost28147-89-TestParamSet" */
-840,	/* "id-GostR3410-2001-CryptoPro-A-ParamSet" */
-841,	/* "id-GostR3410-2001-CryptoPro-B-ParamSet" */
-842,	/* "id-GostR3410-2001-CryptoPro-C-ParamSet" */
-843,	/* "id-GostR3410-2001-CryptoPro-XchA-ParamSet" */
-844,	/* "id-GostR3410-2001-CryptoPro-XchB-ParamSet" */
-839,	/* "id-GostR3410-2001-TestParamSet" */
-832,	/* "id-GostR3410-94-CryptoPro-A-ParamSet" */
-833,	/* "id-GostR3410-94-CryptoPro-B-ParamSet" */
-834,	/* "id-GostR3410-94-CryptoPro-C-ParamSet" */
-835,	/* "id-GostR3410-94-CryptoPro-D-ParamSet" */
-836,	/* "id-GostR3410-94-CryptoPro-XchA-ParamSet" */
-837,	/* "id-GostR3410-94-CryptoPro-XchB-ParamSet" */
-838,	/* "id-GostR3410-94-CryptoPro-XchC-ParamSet" */
-831,	/* "id-GostR3410-94-TestParamSet" */
-845,	/* "id-GostR3410-94-a" */
-846,	/* "id-GostR3410-94-aBis" */
-847,	/* "id-GostR3410-94-b" */
-848,	/* "id-GostR3410-94-bBis" */
-822,	/* "id-GostR3411-94-CryptoProParamSet" */
-821,	/* "id-GostR3411-94-TestParamSet" */
-266,	/* "id-aca" */
-355,	/* "id-aca-accessIdentity" */
-354,	/* "id-aca-authenticationInfo" */
-356,	/* "id-aca-chargingIdentity" */
-399,	/* "id-aca-encAttrs" */
-357,	/* "id-aca-group" */
-358,	/* "id-aca-role" */
-176,	/* "id-ad" */
-788,	/* "id-aes128-wrap" */
-789,	/* "id-aes192-wrap" */
-790,	/* "id-aes256-wrap" */
-262,	/* "id-alg" */
-323,	/* "id-alg-des40" */
-326,	/* "id-alg-dh-pop" */
-325,	/* "id-alg-dh-sig-hmac-sha1" */
-324,	/* "id-alg-noSignature" */
-268,	/* "id-cct" */
-361,	/* "id-cct-PKIData" */
-362,	/* "id-cct-PKIResponse" */
-360,	/* "id-cct-crs" */
-81,	/* "id-ce" */
-680,	/* "id-characteristic-two-basis" */
-263,	/* "id-cmc" */
-334,	/* "id-cmc-addExtensions" */
-346,	/* "id-cmc-confirmCertAcceptance" */
-330,	/* "id-cmc-dataReturn" */
-336,	/* "id-cmc-decryptedPOP" */
-335,	/* "id-cmc-encryptedPOP" */
-339,	/* "id-cmc-getCRL" */
-338,	/* "id-cmc-getCert" */
-328,	/* "id-cmc-identification" */
-329,	/* "id-cmc-identityProof" */
-337,	/* "id-cmc-lraPOPWitness" */
-344,	/* "id-cmc-popLinkRandom" */
-345,	/* "id-cmc-popLinkWitness" */
-343,	/* "id-cmc-queryPending" */
-333,	/* "id-cmc-recipientNonce" */
-341,	/* "id-cmc-regInfo" */
-342,	/* "id-cmc-responseInfo" */
-340,	/* "id-cmc-revokeRequest" */
-332,	/* "id-cmc-senderNonce" */
-327,	/* "id-cmc-statusInfo" */
-331,	/* "id-cmc-transactionId" */
-787,	/* "id-ct-asciiTextWithCRLF" */
-408,	/* "id-ecPublicKey" */
-508,	/* "id-hex-multipart-message" */
-507,	/* "id-hex-partial-message" */
-260,	/* "id-it" */
-302,	/* "id-it-caKeyUpdateInfo" */
-298,	/* "id-it-caProtEncCert" */
-311,	/* "id-it-confirmWaitTime" */
-303,	/* "id-it-currentCRL" */
-300,	/* "id-it-encKeyPairTypes" */
-310,	/* "id-it-implicitConfirm" */
-308,	/* "id-it-keyPairParamRep" */
-307,	/* "id-it-keyPairParamReq" */
-312,	/* "id-it-origPKIMessage" */
-301,	/* "id-it-preferredSymmAlg" */
-309,	/* "id-it-revPassphrase" */
-299,	/* "id-it-signKeyPairTypes" */
-305,	/* "id-it-subscriptionRequest" */
-306,	/* "id-it-subscriptionResponse" */
-784,	/* "id-it-suppLangTags" */
-304,	/* "id-it-unsupportedOIDs" */
-128,	/* "id-kp" */
-280,	/* "id-mod-attribute-cert" */
-274,	/* "id-mod-cmc" */
-277,	/* "id-mod-cmp" */
-284,	/* "id-mod-cmp2000" */
-273,	/* "id-mod-crmf" */
-283,	/* "id-mod-dvcs" */
-275,	/* "id-mod-kea-profile-88" */
-276,	/* "id-mod-kea-profile-93" */
-282,	/* "id-mod-ocsp" */
-278,	/* "id-mod-qualified-cert-88" */
-279,	/* "id-mod-qualified-cert-93" */
-281,	/* "id-mod-timestamp-protocol" */
-264,	/* "id-on" */
-347,	/* "id-on-personalData" */
-265,	/* "id-pda" */
-352,	/* "id-pda-countryOfCitizenship" */
-353,	/* "id-pda-countryOfResidence" */
-348,	/* "id-pda-dateOfBirth" */
-351,	/* "id-pda-gender" */
-349,	/* "id-pda-placeOfBirth" */
-175,	/* "id-pe" */
-261,	/* "id-pkip" */
-258,	/* "id-pkix-mod" */
-269,	/* "id-pkix1-explicit-88" */
-271,	/* "id-pkix1-explicit-93" */
-270,	/* "id-pkix1-implicit-88" */
-272,	/* "id-pkix1-implicit-93" */
-662,	/* "id-ppl" */
-267,	/* "id-qcs" */
-359,	/* "id-qcs-pkixQCSyntax-v1" */
-259,	/* "id-qt" */
-313,	/* "id-regCtrl" */
-316,	/* "id-regCtrl-authenticator" */
-319,	/* "id-regCtrl-oldCertID" */
-318,	/* "id-regCtrl-pkiArchiveOptions" */
-317,	/* "id-regCtrl-pkiPublicationInfo" */
-320,	/* "id-regCtrl-protocolEncrKey" */
-315,	/* "id-regCtrl-regToken" */
-314,	/* "id-regInfo" */
-322,	/* "id-regInfo-certReq" */
-321,	/* "id-regInfo-utf8Pairs" */
-191,	/* "id-smime-aa" */
-215,	/* "id-smime-aa-contentHint" */
-218,	/* "id-smime-aa-contentIdentifier" */
-221,	/* "id-smime-aa-contentReference" */
-240,	/* "id-smime-aa-dvcs-dvc" */
-217,	/* "id-smime-aa-encapContentType" */
-222,	/* "id-smime-aa-encrypKeyPref" */
-220,	/* "id-smime-aa-equivalentLabels" */
-232,	/* "id-smime-aa-ets-CertificateRefs" */
-233,	/* "id-smime-aa-ets-RevocationRefs" */
-238,	/* "id-smime-aa-ets-archiveTimeStamp" */
-237,	/* "id-smime-aa-ets-certCRLTimestamp" */
-234,	/* "id-smime-aa-ets-certValues" */
-227,	/* "id-smime-aa-ets-commitmentType" */
-231,	/* "id-smime-aa-ets-contentTimestamp" */
-236,	/* "id-smime-aa-ets-escTimeStamp" */
-230,	/* "id-smime-aa-ets-otherSigCert" */
-235,	/* "id-smime-aa-ets-revocationValues" */
-226,	/* "id-smime-aa-ets-sigPolicyId" */
-229,	/* "id-smime-aa-ets-signerAttr" */
-228,	/* "id-smime-aa-ets-signerLocation" */
-219,	/* "id-smime-aa-macValue" */
-214,	/* "id-smime-aa-mlExpandHistory" */
-216,	/* "id-smime-aa-msgSigDigest" */
-212,	/* "id-smime-aa-receiptRequest" */
-213,	/* "id-smime-aa-securityLabel" */
-239,	/* "id-smime-aa-signatureType" */
-223,	/* "id-smime-aa-signingCertificate" */
-224,	/* "id-smime-aa-smimeEncryptCerts" */
-225,	/* "id-smime-aa-timeStampToken" */
-192,	/* "id-smime-alg" */
-243,	/* "id-smime-alg-3DESwrap" */
-246,	/* "id-smime-alg-CMS3DESwrap" */
-247,	/* "id-smime-alg-CMSRC2wrap" */
-245,	/* "id-smime-alg-ESDH" */
-241,	/* "id-smime-alg-ESDHwith3DES" */
-242,	/* "id-smime-alg-ESDHwithRC2" */
-244,	/* "id-smime-alg-RC2wrap" */
-193,	/* "id-smime-cd" */
-248,	/* "id-smime-cd-ldap" */
-190,	/* "id-smime-ct" */
-210,	/* "id-smime-ct-DVCSRequestData" */
-211,	/* "id-smime-ct-DVCSResponseData" */
-208,	/* "id-smime-ct-TDTInfo" */
-207,	/* "id-smime-ct-TSTInfo" */
-205,	/* "id-smime-ct-authData" */
-786,	/* "id-smime-ct-compressedData" */
-209,	/* "id-smime-ct-contentInfo" */
-206,	/* "id-smime-ct-publishCert" */
-204,	/* "id-smime-ct-receipt" */
-195,	/* "id-smime-cti" */
-255,	/* "id-smime-cti-ets-proofOfApproval" */
-256,	/* "id-smime-cti-ets-proofOfCreation" */
-253,	/* "id-smime-cti-ets-proofOfDelivery" */
-251,	/* "id-smime-cti-ets-proofOfOrigin" */
-252,	/* "id-smime-cti-ets-proofOfReceipt" */
-254,	/* "id-smime-cti-ets-proofOfSender" */
-189,	/* "id-smime-mod" */
-196,	/* "id-smime-mod-cms" */
-197,	/* "id-smime-mod-ess" */
-202,	/* "id-smime-mod-ets-eSigPolicy-88" */
-203,	/* "id-smime-mod-ets-eSigPolicy-97" */
-200,	/* "id-smime-mod-ets-eSignature-88" */
-201,	/* "id-smime-mod-ets-eSignature-97" */
-199,	/* "id-smime-mod-msg-v3" */
-198,	/* "id-smime-mod-oid" */
-194,	/* "id-smime-spq" */
-250,	/* "id-smime-spq-ets-sqt-unotice" */
-249,	/* "id-smime-spq-ets-sqt-uri" */
-34,	/* "idea-cbc" */
-35,	/* "idea-cfb" */
-36,	/* "idea-ecb" */
-46,	/* "idea-ofb" */
-676,	/* "identified-organization" */
-461,	/* "info" */
-101,	/* "initials" */
-869,	/* "internationaliSDNNumber" */
-749,	/* "ipsec3" */
-750,	/* "ipsec4" */
-181,	/* "iso" */
-623,	/* "issuer capabilities" */
-645,	/* "itu-t" */
-492,	/* "janetMailbox" */
-646,	/* "joint-iso-itu-t" */
-150,	/* "keyBag" */
-773,	/* "kisa" */
-477,	/* "lastModifiedBy" */
-476,	/* "lastModifiedTime" */
-157,	/* "localKeyID" */
-15,	/* "localityName" */
-480,	/* "mXRecord" */
-493,	/* "mailPreferenceOption" */
-467,	/* "manager" */
- 3,	/* "md2" */
- 7,	/* "md2WithRSAEncryption" */
-257,	/* "md4" */
-396,	/* "md4WithRSAEncryption" */
- 4,	/* "md5" */
-114,	/* "md5-sha1" */
-104,	/* "md5WithRSA" */
- 8,	/* "md5WithRSAEncryption" */
-95,	/* "mdc2" */
-96,	/* "mdc2WithRSA" */
-875,	/* "member" */
-602,	/* "merchant initiated auth" */
-514,	/* "message extensions" */
-51,	/* "messageDigest" */
-506,	/* "mime-mhs-bodies" */
-505,	/* "mime-mhs-headings" */
-488,	/* "mobileTelephoneNumber" */
-481,	/* "nSRecord" */
-173,	/* "name" */
-681,	/* "onBasis" */
-379,	/* "org" */
-17,	/* "organizationName" */
-491,	/* "organizationalStatus" */
-18,	/* "organizationalUnitName" */
-475,	/* "otherMailbox" */
-876,	/* "owner" */
-489,	/* "pagerTelephoneNumber" */
-782,	/* "password based MAC" */
-374,	/* "path" */
-621,	/* "payment gateway capabilities" */
- 9,	/* "pbeWithMD2AndDES-CBC" */
-168,	/* "pbeWithMD2AndRC2-CBC" */
-112,	/* "pbeWithMD5AndCast5CBC" */
-10,	/* "pbeWithMD5AndDES-CBC" */
-169,	/* "pbeWithMD5AndRC2-CBC" */
-148,	/* "pbeWithSHA1And128BitRC2-CBC" */
-144,	/* "pbeWithSHA1And128BitRC4" */
-147,	/* "pbeWithSHA1And2-KeyTripleDES-CBC" */
-146,	/* "pbeWithSHA1And3-KeyTripleDES-CBC" */
-149,	/* "pbeWithSHA1And40BitRC2-CBC" */
-145,	/* "pbeWithSHA1And40BitRC4" */
-170,	/* "pbeWithSHA1AndDES-CBC" */
-68,	/* "pbeWithSHA1AndRC2-CBC" */
-499,	/* "personalSignature" */
-487,	/* "personalTitle" */
-464,	/* "photo" */
-863,	/* "physicalDeliveryOfficeName" */
-437,	/* "pilot" */
-439,	/* "pilotAttributeSyntax" */
-438,	/* "pilotAttributeType" */
-479,	/* "pilotAttributeType27" */
-456,	/* "pilotDSA" */
-441,	/* "pilotGroups" */
-444,	/* "pilotObject" */
-440,	/* "pilotObjectClass" */
-455,	/* "pilotOrganization" */
-445,	/* "pilotPerson" */
-186,	/* "pkcs1" */
-27,	/* "pkcs3" */
-187,	/* "pkcs5" */
-20,	/* "pkcs7" */
-21,	/* "pkcs7-data" */
-25,	/* "pkcs7-digestData" */
-26,	/* "pkcs7-encryptedData" */
-23,	/* "pkcs7-envelopedData" */
-24,	/* "pkcs7-signedAndEnvelopedData" */
-22,	/* "pkcs7-signedData" */
-151,	/* "pkcs8ShroudedKeyBag" */
-47,	/* "pkcs9" */
-862,	/* "postOfficeBox" */
-861,	/* "postalAddress" */
-661,	/* "postalCode" */
-683,	/* "ppBasis" */
-872,	/* "preferredDeliveryMethod" */
-873,	/* "presentationAddress" */
-406,	/* "prime-field" */
-409,	/* "prime192v1" */
-410,	/* "prime192v2" */
-411,	/* "prime192v3" */
-412,	/* "prime239v1" */
-413,	/* "prime239v2" */
-414,	/* "prime239v3" */
-415,	/* "prime256v1" */
-886,	/* "protocolInformation" */
-510,	/* "pseudonym" */
-435,	/* "pss" */
-286,	/* "qcStatements" */
-457,	/* "qualityLabelledData" */
-450,	/* "rFC822localPart" */
-98,	/* "rc2-40-cbc" */
-166,	/* "rc2-64-cbc" */
-37,	/* "rc2-cbc" */
-39,	/* "rc2-cfb" */
-38,	/* "rc2-ecb" */
-40,	/* "rc2-ofb" */
- 5,	/* "rc4" */
-97,	/* "rc4-40" */
-120,	/* "rc5-cbc" */
-122,	/* "rc5-cfb" */
-121,	/* "rc5-ecb" */
-123,	/* "rc5-ofb" */
-870,	/* "registeredAddress" */
-460,	/* "rfc822Mailbox" */
-117,	/* "ripemd160" */
-119,	/* "ripemd160WithRSA" */
-400,	/* "role" */
-877,	/* "roleOccupant" */
-448,	/* "room" */
-463,	/* "roomNumber" */
-19,	/* "rsa" */
- 6,	/* "rsaEncryption" */
-644,	/* "rsaOAEPEncryptionSET" */
-377,	/* "rsaSignature" */
-124,	/* "run length compression" */
-482,	/* "sOARecord" */
-155,	/* "safeContentsBag" */
-291,	/* "sbgp-autonomousSysNum" */
-290,	/* "sbgp-ipAddrBlock" */
-292,	/* "sbgp-routerIdentifier" */
-159,	/* "sdsiCertificate" */
-859,	/* "searchGuide" */
-704,	/* "secp112r1" */
-705,	/* "secp112r2" */
-706,	/* "secp128r1" */
-707,	/* "secp128r2" */
-708,	/* "secp160k1" */
-709,	/* "secp160r1" */
-710,	/* "secp160r2" */
-711,	/* "secp192k1" */
-712,	/* "secp224k1" */
-713,	/* "secp224r1" */
-714,	/* "secp256k1" */
-715,	/* "secp384r1" */
-716,	/* "secp521r1" */
-154,	/* "secretBag" */
-474,	/* "secretary" */
-717,	/* "sect113r1" */
-718,	/* "sect113r2" */
-719,	/* "sect131r1" */
-720,	/* "sect131r2" */
-721,	/* "sect163k1" */
-722,	/* "sect163r1" */
-723,	/* "sect163r2" */
-724,	/* "sect193r1" */
-725,	/* "sect193r2" */
-726,	/* "sect233k1" */
-727,	/* "sect233r1" */
-728,	/* "sect239k1" */
-729,	/* "sect283k1" */
-730,	/* "sect283r1" */
-731,	/* "sect409k1" */
-732,	/* "sect409r1" */
-733,	/* "sect571k1" */
-734,	/* "sect571r1" */
-635,	/* "secure device signature" */
-878,	/* "seeAlso" */
-777,	/* "seed-cbc" */
-779,	/* "seed-cfb" */
-776,	/* "seed-ecb" */
-778,	/* "seed-ofb" */
-105,	/* "serialNumber" */
-625,	/* "set-addPolicy" */
-515,	/* "set-attr" */
-518,	/* "set-brand" */
-638,	/* "set-brand-AmericanExpress" */
-637,	/* "set-brand-Diners" */
-636,	/* "set-brand-IATA-ATA" */
-639,	/* "set-brand-JCB" */
-641,	/* "set-brand-MasterCard" */
-642,	/* "set-brand-Novus" */
-640,	/* "set-brand-Visa" */
-516,	/* "set-policy" */
-607,	/* "set-policy-root" */
-624,	/* "set-rootKeyThumb" */
-620,	/* "setAttr-Cert" */
-628,	/* "setAttr-IssCap-CVM" */
-630,	/* "setAttr-IssCap-Sig" */
-629,	/* "setAttr-IssCap-T2" */
-627,	/* "setAttr-Token-B0Prime" */
-626,	/* "setAttr-Token-EMV" */
-622,	/* "setAttr-TokenType" */
-619,	/* "setCext-IssuerCapabilities" */
-615,	/* "setCext-PGWYcapabilities" */
-616,	/* "setCext-TokenIdentifier" */
-618,	/* "setCext-TokenType" */
-617,	/* "setCext-Track2Data" */
-611,	/* "setCext-cCertRequired" */
-609,	/* "setCext-certType" */
-608,	/* "setCext-hashedRoot" */
-610,	/* "setCext-merchData" */
-613,	/* "setCext-setExt" */
-614,	/* "setCext-setQualf" */
-612,	/* "setCext-tunneling" */
-540,	/* "setct-AcqCardCodeMsg" */
-576,	/* "setct-AcqCardCodeMsgTBE" */
-570,	/* "setct-AuthReqTBE" */
-534,	/* "setct-AuthReqTBS" */
-527,	/* "setct-AuthResBaggage" */
-571,	/* "setct-AuthResTBE" */
-572,	/* "setct-AuthResTBEX" */
-535,	/* "setct-AuthResTBS" */
-536,	/* "setct-AuthResTBSX" */
-528,	/* "setct-AuthRevReqBaggage" */
-577,	/* "setct-AuthRevReqTBE" */
-541,	/* "setct-AuthRevReqTBS" */
-529,	/* "setct-AuthRevResBaggage" */
-542,	/* "setct-AuthRevResData" */
-578,	/* "setct-AuthRevResTBE" */
-579,	/* "setct-AuthRevResTBEB" */
-543,	/* "setct-AuthRevResTBS" */
-573,	/* "setct-AuthTokenTBE" */
-537,	/* "setct-AuthTokenTBS" */
-600,	/* "setct-BCIDistributionTBS" */
-558,	/* "setct-BatchAdminReqData" */
-592,	/* "setct-BatchAdminReqTBE" */
-559,	/* "setct-BatchAdminResData" */
-593,	/* "setct-BatchAdminResTBE" */
-599,	/* "setct-CRLNotificationResTBS" */
-598,	/* "setct-CRLNotificationTBS" */
-580,	/* "setct-CapReqTBE" */
-581,	/* "setct-CapReqTBEX" */
-544,	/* "setct-CapReqTBS" */
-545,	/* "setct-CapReqTBSX" */
-546,	/* "setct-CapResData" */
-582,	/* "setct-CapResTBE" */
-583,	/* "setct-CapRevReqTBE" */
-584,	/* "setct-CapRevReqTBEX" */
-547,	/* "setct-CapRevReqTBS" */
-548,	/* "setct-CapRevReqTBSX" */
-549,	/* "setct-CapRevResData" */
-585,	/* "setct-CapRevResTBE" */
-538,	/* "setct-CapTokenData" */
-530,	/* "setct-CapTokenSeq" */
-574,	/* "setct-CapTokenTBE" */
-575,	/* "setct-CapTokenTBEX" */
-539,	/* "setct-CapTokenTBS" */
-560,	/* "setct-CardCInitResTBS" */
-566,	/* "setct-CertInqReqTBS" */
-563,	/* "setct-CertReqData" */
-595,	/* "setct-CertReqTBE" */
-596,	/* "setct-CertReqTBEX" */
-564,	/* "setct-CertReqTBS" */
-565,	/* "setct-CertResData" */
-597,	/* "setct-CertResTBE" */
-586,	/* "setct-CredReqTBE" */
-587,	/* "setct-CredReqTBEX" */
-550,	/* "setct-CredReqTBS" */
-551,	/* "setct-CredReqTBSX" */
-552,	/* "setct-CredResData" */
-588,	/* "setct-CredResTBE" */
-589,	/* "setct-CredRevReqTBE" */
-590,	/* "setct-CredRevReqTBEX" */
-553,	/* "setct-CredRevReqTBS" */
-554,	/* "setct-CredRevReqTBSX" */
-555,	/* "setct-CredRevResData" */
-591,	/* "setct-CredRevResTBE" */
-567,	/* "setct-ErrorTBS" */
-526,	/* "setct-HODInput" */
-561,	/* "setct-MeAqCInitResTBS" */
-522,	/* "setct-OIData" */
-519,	/* "setct-PANData" */
-521,	/* "setct-PANOnly" */
-520,	/* "setct-PANToken" */
-556,	/* "setct-PCertReqData" */
-557,	/* "setct-PCertResTBS" */
-523,	/* "setct-PI" */
-532,	/* "setct-PI-TBS" */
-524,	/* "setct-PIData" */
-525,	/* "setct-PIDataUnsigned" */
-568,	/* "setct-PIDualSignedTBE" */
-569,	/* "setct-PIUnsignedTBE" */
-531,	/* "setct-PInitResData" */
-533,	/* "setct-PResData" */
-594,	/* "setct-RegFormReqTBE" */
-562,	/* "setct-RegFormResTBS" */
-604,	/* "setext-pinAny" */
-603,	/* "setext-pinSecure" */
-605,	/* "setext-track2" */
-41,	/* "sha" */
-64,	/* "sha1" */
-115,	/* "sha1WithRSA" */
-65,	/* "sha1WithRSAEncryption" */
-675,	/* "sha224" */
-671,	/* "sha224WithRSAEncryption" */
-672,	/* "sha256" */
-668,	/* "sha256WithRSAEncryption" */
-673,	/* "sha384" */
-669,	/* "sha384WithRSAEncryption" */
-674,	/* "sha512" */
-670,	/* "sha512WithRSAEncryption" */
-42,	/* "shaWithRSAEncryption" */
-52,	/* "signingTime" */
-454,	/* "simpleSecurityObject" */
-496,	/* "singleLevelQuality" */
-16,	/* "stateOrProvinceName" */
-660,	/* "streetAddress" */
-498,	/* "subtreeMaximumQuality" */
-497,	/* "subtreeMinimumQuality" */
-890,	/* "supportedAlgorithms" */
-874,	/* "supportedApplicationContext" */
-100,	/* "surname" */
-864,	/* "telephoneNumber" */
-866,	/* "teletexTerminalIdentifier" */
-865,	/* "telexNumber" */
-459,	/* "textEncodedORAddress" */
-293,	/* "textNotice" */
-106,	/* "title" */
-682,	/* "tpBasis" */
-436,	/* "ucl" */
- 0,	/* "undefined" */
-888,	/* "uniqueMember" */
-55,	/* "unstructuredAddress" */
-49,	/* "unstructuredName" */
-880,	/* "userCertificate" */
-465,	/* "userClass" */
-458,	/* "userId" */
-879,	/* "userPassword" */
-373,	/* "valid" */
-678,	/* "wap" */
-679,	/* "wap-wsg" */
-735,	/* "wap-wsg-idm-ecid-wtls1" */
-743,	/* "wap-wsg-idm-ecid-wtls10" */
-744,	/* "wap-wsg-idm-ecid-wtls11" */
-745,	/* "wap-wsg-idm-ecid-wtls12" */
-736,	/* "wap-wsg-idm-ecid-wtls3" */
-737,	/* "wap-wsg-idm-ecid-wtls4" */
-738,	/* "wap-wsg-idm-ecid-wtls5" */
-739,	/* "wap-wsg-idm-ecid-wtls6" */
-740,	/* "wap-wsg-idm-ecid-wtls7" */
-741,	/* "wap-wsg-idm-ecid-wtls8" */
-742,	/* "wap-wsg-idm-ecid-wtls9" */
-804,	/* "whirlpool" */
-868,	/* "x121Address" */
-503,	/* "x500UniqueIdentifier" */
-158,	/* "x509Certificate" */
-160,	/* "x509Crl" */
-125,	/* "zlib compression" */
-};
 
-static const unsigned int obj_objs[NUM_OBJ]={
- 0,	/* OBJ_undef                        0 */
-393,	/* OBJ_joint_iso_ccitt              OBJ_joint_iso_itu_t */
-404,	/* OBJ_ccitt                        OBJ_itu_t */
-645,	/* OBJ_itu_t                        0 */
-434,	/* OBJ_data                         0 9 */
-181,	/* OBJ_iso                          1 */
-182,	/* OBJ_member_body                  1 2 */
-379,	/* OBJ_org                          1 3 */
-676,	/* OBJ_identified_organization      1 3 */
-646,	/* OBJ_joint_iso_itu_t              2 */
-11,	/* OBJ_X500                         2 5 */
-647,	/* OBJ_international_organizations  2 23 */
-380,	/* OBJ_dod                          1 3 6 */
-12,	/* OBJ_X509                         2 5 4 */
-378,	/* OBJ_X500algorithms               2 5 8 */
-81,	/* OBJ_id_ce                        2 5 29 */
-512,	/* OBJ_id_set                       2 23 42 */
-678,	/* OBJ_wap                          2 23 43 */
-435,	/* OBJ_pss                          0 9 2342 */
-183,	/* OBJ_ISO_US                       1 2 840 */
-381,	/* OBJ_iana                         1 3 6 1 */
-677,	/* OBJ_certicom_arc                 1 3 132 */
-394,	/* OBJ_selected_attribute_types     2 5 1 5 */
-13,	/* OBJ_commonName                   2 5 4 3 */
-100,	/* OBJ_surname                      2 5 4 4 */
-105,	/* OBJ_serialNumber                 2 5 4 5 */
-14,	/* OBJ_countryName                  2 5 4 6 */
-15,	/* OBJ_localityName                 2 5 4 7 */
-16,	/* OBJ_stateOrProvinceName          2 5 4 8 */
-660,	/* OBJ_streetAddress                2 5 4 9 */
-17,	/* OBJ_organizationName             2 5 4 10 */
-18,	/* OBJ_organizationalUnitName       2 5 4 11 */
-106,	/* OBJ_title                        2 5 4 12 */
-107,	/* OBJ_description                  2 5 4 13 */
-859,	/* OBJ_searchGuide                  2 5 4 14 */
-860,	/* OBJ_businessCategory             2 5 4 15 */
-861,	/* OBJ_postalAddress                2 5 4 16 */
-661,	/* OBJ_postalCode                   2 5 4 17 */
-862,	/* OBJ_postOfficeBox                2 5 4 18 */
-863,	/* OBJ_physicalDeliveryOfficeName   2 5 4 19 */
-864,	/* OBJ_telephoneNumber              2 5 4 20 */
-865,	/* OBJ_telexNumber                  2 5 4 21 */
-866,	/* OBJ_teletexTerminalIdentifier    2 5 4 22 */
-867,	/* OBJ_facsimileTelephoneNumber     2 5 4 23 */
-868,	/* OBJ_x121Address                  2 5 4 24 */
-869,	/* OBJ_internationaliSDNNumber      2 5 4 25 */
-870,	/* OBJ_registeredAddress            2 5 4 26 */
-871,	/* OBJ_destinationIndicator         2 5 4 27 */
-872,	/* OBJ_preferredDeliveryMethod      2 5 4 28 */
-873,	/* OBJ_presentationAddress          2 5 4 29 */
-874,	/* OBJ_supportedApplicationContext  2 5 4 30 */
-875,	/* OBJ_member                       2 5 4 31 */
-876,	/* OBJ_owner                        2 5 4 32 */
-877,	/* OBJ_roleOccupant                 2 5 4 33 */
-878,	/* OBJ_seeAlso                      2 5 4 34 */
-879,	/* OBJ_userPassword                 2 5 4 35 */
-880,	/* OBJ_userCertificate              2 5 4 36 */
-881,	/* OBJ_cACertificate                2 5 4 37 */
-882,	/* OBJ_authorityRevocationList      2 5 4 38 */
-883,	/* OBJ_certificateRevocationList    2 5 4 39 */
-884,	/* OBJ_crossCertificatePair         2 5 4 40 */
-173,	/* OBJ_name                         2 5 4 41 */
-99,	/* OBJ_givenName                    2 5 4 42 */
-101,	/* OBJ_initials                     2 5 4 43 */
-509,	/* OBJ_generationQualifier          2 5 4 44 */
-503,	/* OBJ_x500UniqueIdentifier         2 5 4 45 */
-174,	/* OBJ_dnQualifier                  2 5 4 46 */
-885,	/* OBJ_enhancedSearchGuide          2 5 4 47 */
-886,	/* OBJ_protocolInformation          2 5 4 48 */
-887,	/* OBJ_distinguishedName            2 5 4 49 */
-888,	/* OBJ_uniqueMember                 2 5 4 50 */
-889,	/* OBJ_houseIdentifier              2 5 4 51 */
-890,	/* OBJ_supportedAlgorithms          2 5 4 52 */
-891,	/* OBJ_deltaRevocationList          2 5 4 53 */
-892,	/* OBJ_dmdName                      2 5 4 54 */
-510,	/* OBJ_pseudonym                    2 5 4 65 */
-400,	/* OBJ_role                         2 5 4 72 */
-769,	/* OBJ_subject_directory_attributes 2 5 29 9 */
-82,	/* OBJ_subject_key_identifier       2 5 29 14 */
-83,	/* OBJ_key_usage                    2 5 29 15 */
-84,	/* OBJ_private_key_usage_period     2 5 29 16 */
-85,	/* OBJ_subject_alt_name             2 5 29 17 */
-86,	/* OBJ_issuer_alt_name              2 5 29 18 */
-87,	/* OBJ_basic_constraints            2 5 29 19 */
-88,	/* OBJ_crl_number                   2 5 29 20 */
-141,	/* OBJ_crl_reason                   2 5 29 21 */
-430,	/* OBJ_hold_instruction_code        2 5 29 23 */
-142,	/* OBJ_invalidity_date              2 5 29 24 */
-140,	/* OBJ_delta_crl                    2 5 29 27 */
-770,	/* OBJ_issuing_distribution_point   2 5 29 28 */
-771,	/* OBJ_certificate_issuer           2 5 29 29 */
-666,	/* OBJ_name_constraints             2 5 29 30 */
-103,	/* OBJ_crl_distribution_points      2 5 29 31 */
-89,	/* OBJ_certificate_policies         2 5 29 32 */
-747,	/* OBJ_policy_mappings              2 5 29 33 */
-90,	/* OBJ_authority_key_identifier     2 5 29 35 */
-401,	/* OBJ_policy_constraints           2 5 29 36 */
-126,	/* OBJ_ext_key_usage                2 5 29 37 */
-857,	/* OBJ_freshest_crl                 2 5 29 46 */
-748,	/* OBJ_inhibit_any_policy           2 5 29 54 */
-402,	/* OBJ_target_information           2 5 29 55 */
-403,	/* OBJ_no_rev_avail                 2 5 29 56 */
-513,	/* OBJ_set_ctype                    2 23 42 0 */
-514,	/* OBJ_set_msgExt                   2 23 42 1 */
-515,	/* OBJ_set_attr                     2 23 42 3 */
-516,	/* OBJ_set_policy                   2 23 42 5 */
-517,	/* OBJ_set_certExt                  2 23 42 7 */
-518,	/* OBJ_set_brand                    2 23 42 8 */
-679,	/* OBJ_wap_wsg                      2 23 43 1 */
-382,	/* OBJ_Directory                    1 3 6 1 1 */
-383,	/* OBJ_Management                   1 3 6 1 2 */
-384,	/* OBJ_Experimental                 1 3 6 1 3 */
-385,	/* OBJ_Private                      1 3 6 1 4 */
-386,	/* OBJ_Security                     1 3 6 1 5 */
-387,	/* OBJ_SNMPv2                       1 3 6 1 6 */
-388,	/* OBJ_Mail                         1 3 6 1 7 */
-376,	/* OBJ_algorithm                    1 3 14 3 2 */
-395,	/* OBJ_clearance                    2 5 1 5 55 */
-19,	/* OBJ_rsa                          2 5 8 1 1 */
-96,	/* OBJ_mdc2WithRSA                  2 5 8 3 100 */
-95,	/* OBJ_mdc2                         2 5 8 3 101 */
-746,	/* OBJ_any_policy                   2 5 29 32 0 */
-519,	/* OBJ_setct_PANData                2 23 42 0 0 */
-520,	/* OBJ_setct_PANToken               2 23 42 0 1 */
-521,	/* OBJ_setct_PANOnly                2 23 42 0 2 */
-522,	/* OBJ_setct_OIData                 2 23 42 0 3 */
-523,	/* OBJ_setct_PI                     2 23 42 0 4 */
-524,	/* OBJ_setct_PIData                 2 23 42 0 5 */
-525,	/* OBJ_setct_PIDataUnsigned         2 23 42 0 6 */
-526,	/* OBJ_setct_HODInput               2 23 42 0 7 */
-527,	/* OBJ_setct_AuthResBaggage         2 23 42 0 8 */
-528,	/* OBJ_setct_AuthRevReqBaggage      2 23 42 0 9 */
-529,	/* OBJ_setct_AuthRevResBaggage      2 23 42 0 10 */
-530,	/* OBJ_setct_CapTokenSeq            2 23 42 0 11 */
-531,	/* OBJ_setct_PInitResData           2 23 42 0 12 */
-532,	/* OBJ_setct_PI_TBS                 2 23 42 0 13 */
-533,	/* OBJ_setct_PResData               2 23 42 0 14 */
-534,	/* OBJ_setct_AuthReqTBS             2 23 42 0 16 */
-535,	/* OBJ_setct_AuthResTBS             2 23 42 0 17 */
-536,	/* OBJ_setct_AuthResTBSX            2 23 42 0 18 */
-537,	/* OBJ_setct_AuthTokenTBS           2 23 42 0 19 */
-538,	/* OBJ_setct_CapTokenData           2 23 42 0 20 */
-539,	/* OBJ_setct_CapTokenTBS            2 23 42 0 21 */
-540,	/* OBJ_setct_AcqCardCodeMsg         2 23 42 0 22 */
-541,	/* OBJ_setct_AuthRevReqTBS          2 23 42 0 23 */
-542,	/* OBJ_setct_AuthRevResData         2 23 42 0 24 */
-543,	/* OBJ_setct_AuthRevResTBS          2 23 42 0 25 */
-544,	/* OBJ_setct_CapReqTBS              2 23 42 0 26 */
-545,	/* OBJ_setct_CapReqTBSX             2 23 42 0 27 */
-546,	/* OBJ_setct_CapResData             2 23 42 0 28 */
-547,	/* OBJ_setct_CapRevReqTBS           2 23 42 0 29 */
-548,	/* OBJ_setct_CapRevReqTBSX          2 23 42 0 30 */
-549,	/* OBJ_setct_CapRevResData          2 23 42 0 31 */
-550,	/* OBJ_setct_CredReqTBS             2 23 42 0 32 */
-551,	/* OBJ_setct_CredReqTBSX            2 23 42 0 33 */
-552,	/* OBJ_setct_CredResData            2 23 42 0 34 */
-553,	/* OBJ_setct_CredRevReqTBS          2 23 42 0 35 */
-554,	/* OBJ_setct_CredRevReqTBSX         2 23 42 0 36 */
-555,	/* OBJ_setct_CredRevResData         2 23 42 0 37 */
-556,	/* OBJ_setct_PCertReqData           2 23 42 0 38 */
-557,	/* OBJ_setct_PCertResTBS            2 23 42 0 39 */
-558,	/* OBJ_setct_BatchAdminReqData      2 23 42 0 40 */
-559,	/* OBJ_setct_BatchAdminResData      2 23 42 0 41 */
-560,	/* OBJ_setct_CardCInitResTBS        2 23 42 0 42 */
-561,	/* OBJ_setct_MeAqCInitResTBS        2 23 42 0 43 */
-562,	/* OBJ_setct_RegFormResTBS          2 23 42 0 44 */
-563,	/* OBJ_setct_CertReqData            2 23 42 0 45 */
-564,	/* OBJ_setct_CertReqTBS             2 23 42 0 46 */
-565,	/* OBJ_setct_CertResData            2 23 42 0 47 */
-566,	/* OBJ_setct_CertInqReqTBS          2 23 42 0 48 */
-567,	/* OBJ_setct_ErrorTBS               2 23 42 0 49 */
-568,	/* OBJ_setct_PIDualSignedTBE        2 23 42 0 50 */
-569,	/* OBJ_setct_PIUnsignedTBE          2 23 42 0 51 */
-570,	/* OBJ_setct_AuthReqTBE             2 23 42 0 52 */
-571,	/* OBJ_setct_AuthResTBE             2 23 42 0 53 */
-572,	/* OBJ_setct_AuthResTBEX            2 23 42 0 54 */
-573,	/* OBJ_setct_AuthTokenTBE           2 23 42 0 55 */
-574,	/* OBJ_setct_CapTokenTBE            2 23 42 0 56 */
-575,	/* OBJ_setct_CapTokenTBEX           2 23 42 0 57 */
-576,	/* OBJ_setct_AcqCardCodeMsgTBE      2 23 42 0 58 */
-577,	/* OBJ_setct_AuthRevReqTBE          2 23 42 0 59 */
-578,	/* OBJ_setct_AuthRevResTBE          2 23 42 0 60 */
-579,	/* OBJ_setct_AuthRevResTBEB         2 23 42 0 61 */
-580,	/* OBJ_setct_CapReqTBE              2 23 42 0 62 */
-581,	/* OBJ_setct_CapReqTBEX             2 23 42 0 63 */
-582,	/* OBJ_setct_CapResTBE              2 23 42 0 64 */
-583,	/* OBJ_setct_CapRevReqTBE           2 23 42 0 65 */
-584,	/* OBJ_setct_CapRevReqTBEX          2 23 42 0 66 */
-585,	/* OBJ_setct_CapRevResTBE           2 23 42 0 67 */
-586,	/* OBJ_setct_CredReqTBE             2 23 42 0 68 */
-587,	/* OBJ_setct_CredReqTBEX            2 23 42 0 69 */
-588,	/* OBJ_setct_CredResTBE             2 23 42 0 70 */
-589,	/* OBJ_setct_CredRevReqTBE          2 23 42 0 71 */
-590,	/* OBJ_setct_CredRevReqTBEX         2 23 42 0 72 */
-591,	/* OBJ_setct_CredRevResTBE          2 23 42 0 73 */
-592,	/* OBJ_setct_BatchAdminReqTBE       2 23 42 0 74 */
-593,	/* OBJ_setct_BatchAdminResTBE       2 23 42 0 75 */
-594,	/* OBJ_setct_RegFormReqTBE          2 23 42 0 76 */
-595,	/* OBJ_setct_CertReqTBE             2 23 42 0 77 */
-596,	/* OBJ_setct_CertReqTBEX            2 23 42 0 78 */
-597,	/* OBJ_setct_CertResTBE             2 23 42 0 79 */
-598,	/* OBJ_setct_CRLNotificationTBS     2 23 42 0 80 */
-599,	/* OBJ_setct_CRLNotificationResTBS  2 23 42 0 81 */
-600,	/* OBJ_setct_BCIDistributionTBS     2 23 42 0 82 */
-601,	/* OBJ_setext_genCrypt              2 23 42 1 1 */
-602,	/* OBJ_setext_miAuth                2 23 42 1 3 */
-603,	/* OBJ_setext_pinSecure             2 23 42 1 4 */
-604,	/* OBJ_setext_pinAny                2 23 42 1 5 */
-605,	/* OBJ_setext_track2                2 23 42 1 7 */
-606,	/* OBJ_setext_cv                    2 23 42 1 8 */
-620,	/* OBJ_setAttr_Cert                 2 23 42 3 0 */
-621,	/* OBJ_setAttr_PGWYcap              2 23 42 3 1 */
-622,	/* OBJ_setAttr_TokenType            2 23 42 3 2 */
-623,	/* OBJ_setAttr_IssCap               2 23 42 3 3 */
-607,	/* OBJ_set_policy_root              2 23 42 5 0 */
-608,	/* OBJ_setCext_hashedRoot           2 23 42 7 0 */
-609,	/* OBJ_setCext_certType             2 23 42 7 1 */
-610,	/* OBJ_setCext_merchData            2 23 42 7 2 */
-611,	/* OBJ_setCext_cCertRequired        2 23 42 7 3 */
-612,	/* OBJ_setCext_tunneling            2 23 42 7 4 */
-613,	/* OBJ_setCext_setExt               2 23 42 7 5 */
-614,	/* OBJ_setCext_setQualf             2 23 42 7 6 */
-615,	/* OBJ_setCext_PGWYcapabilities     2 23 42 7 7 */
-616,	/* OBJ_setCext_TokenIdentifier      2 23 42 7 8 */
-617,	/* OBJ_setCext_Track2Data           2 23 42 7 9 */
-618,	/* OBJ_setCext_TokenType            2 23 42 7 10 */
-619,	/* OBJ_setCext_IssuerCapabilities   2 23 42 7 11 */
-636,	/* OBJ_set_brand_IATA_ATA           2 23 42 8 1 */
-640,	/* OBJ_set_brand_Visa               2 23 42 8 4 */
-641,	/* OBJ_set_brand_MasterCard         2 23 42 8 5 */
-637,	/* OBJ_set_brand_Diners             2 23 42 8 30 */
-638,	/* OBJ_set_brand_AmericanExpress    2 23 42 8 34 */
-639,	/* OBJ_set_brand_JCB                2 23 42 8 35 */
-805,	/* OBJ_cryptopro                    1 2 643 2 2 */
-806,	/* OBJ_cryptocom                    1 2 643 2 9 */
-184,	/* OBJ_X9_57                        1 2 840 10040 */
-405,	/* OBJ_ansi_X9_62                   1 2 840 10045 */
-389,	/* OBJ_Enterprises                  1 3 6 1 4 1 */
-504,	/* OBJ_mime_mhs                     1 3 6 1 7 1 */
-104,	/* OBJ_md5WithRSA                   1 3 14 3 2 3 */
-29,	/* OBJ_des_ecb                      1 3 14 3 2 6 */
-31,	/* OBJ_des_cbc                      1 3 14 3 2 7 */
-45,	/* OBJ_des_ofb64                    1 3 14 3 2 8 */
-30,	/* OBJ_des_cfb64                    1 3 14 3 2 9 */
-377,	/* OBJ_rsaSignature                 1 3 14 3 2 11 */
-67,	/* OBJ_dsa_2                        1 3 14 3 2 12 */
-66,	/* OBJ_dsaWithSHA                   1 3 14 3 2 13 */
-42,	/* OBJ_shaWithRSAEncryption         1 3 14 3 2 15 */
-32,	/* OBJ_des_ede_ecb                  1 3 14 3 2 17 */
-41,	/* OBJ_sha                          1 3 14 3 2 18 */
-64,	/* OBJ_sha1                         1 3 14 3 2 26 */
-70,	/* OBJ_dsaWithSHA1_2                1 3 14 3 2 27 */
-115,	/* OBJ_sha1WithRSA                  1 3 14 3 2 29 */
-117,	/* OBJ_ripemd160                    1 3 36 3 2 1 */
-143,	/* OBJ_sxnet                        1 3 101 1 4 1 */
-721,	/* OBJ_sect163k1                    1 3 132 0 1 */
-722,	/* OBJ_sect163r1                    1 3 132 0 2 */
-728,	/* OBJ_sect239k1                    1 3 132 0 3 */
-717,	/* OBJ_sect113r1                    1 3 132 0 4 */
-718,	/* OBJ_sect113r2                    1 3 132 0 5 */
-704,	/* OBJ_secp112r1                    1 3 132 0 6 */
-705,	/* OBJ_secp112r2                    1 3 132 0 7 */
-709,	/* OBJ_secp160r1                    1 3 132 0 8 */
-708,	/* OBJ_secp160k1                    1 3 132 0 9 */
-714,	/* OBJ_secp256k1                    1 3 132 0 10 */
-723,	/* OBJ_sect163r2                    1 3 132 0 15 */
-729,	/* OBJ_sect283k1                    1 3 132 0 16 */
-730,	/* OBJ_sect283r1                    1 3 132 0 17 */
-719,	/* OBJ_sect131r1                    1 3 132 0 22 */
-720,	/* OBJ_sect131r2                    1 3 132 0 23 */
-724,	/* OBJ_sect193r1                    1 3 132 0 24 */
-725,	/* OBJ_sect193r2                    1 3 132 0 25 */
-726,	/* OBJ_sect233k1                    1 3 132 0 26 */
-727,	/* OBJ_sect233r1                    1 3 132 0 27 */
-706,	/* OBJ_secp128r1                    1 3 132 0 28 */
-707,	/* OBJ_secp128r2                    1 3 132 0 29 */
-710,	/* OBJ_secp160r2                    1 3 132 0 30 */
-711,	/* OBJ_secp192k1                    1 3 132 0 31 */
-712,	/* OBJ_secp224k1                    1 3 132 0 32 */
-713,	/* OBJ_secp224r1                    1 3 132 0 33 */
-715,	/* OBJ_secp384r1                    1 3 132 0 34 */
-716,	/* OBJ_secp521r1                    1 3 132 0 35 */
-731,	/* OBJ_sect409k1                    1 3 132 0 36 */
-732,	/* OBJ_sect409r1                    1 3 132 0 37 */
-733,	/* OBJ_sect571k1                    1 3 132 0 38 */
-734,	/* OBJ_sect571r1                    1 3 132 0 39 */
-624,	/* OBJ_set_rootKeyThumb             2 23 42 3 0 0 */
-625,	/* OBJ_set_addPolicy                2 23 42 3 0 1 */
-626,	/* OBJ_setAttr_Token_EMV            2 23 42 3 2 1 */
-627,	/* OBJ_setAttr_Token_B0Prime        2 23 42 3 2 2 */
-628,	/* OBJ_setAttr_IssCap_CVM           2 23 42 3 3 3 */
-629,	/* OBJ_setAttr_IssCap_T2            2 23 42 3 3 4 */
-630,	/* OBJ_setAttr_IssCap_Sig           2 23 42 3 3 5 */
-642,	/* OBJ_set_brand_Novus              2 23 42 8 6011 */
-735,	/* OBJ_wap_wsg_idm_ecid_wtls1       2 23 43 1 4 1 */
-736,	/* OBJ_wap_wsg_idm_ecid_wtls3       2 23 43 1 4 3 */
-737,	/* OBJ_wap_wsg_idm_ecid_wtls4       2 23 43 1 4 4 */
-738,	/* OBJ_wap_wsg_idm_ecid_wtls5       2 23 43 1 4 5 */
-739,	/* OBJ_wap_wsg_idm_ecid_wtls6       2 23 43 1 4 6 */
-740,	/* OBJ_wap_wsg_idm_ecid_wtls7       2 23 43 1 4 7 */
-741,	/* OBJ_wap_wsg_idm_ecid_wtls8       2 23 43 1 4 8 */
-742,	/* OBJ_wap_wsg_idm_ecid_wtls9       2 23 43 1 4 9 */
-743,	/* OBJ_wap_wsg_idm_ecid_wtls10      2 23 43 1 4 10 */
-744,	/* OBJ_wap_wsg_idm_ecid_wtls11      2 23 43 1 4 11 */
-745,	/* OBJ_wap_wsg_idm_ecid_wtls12      2 23 43 1 4 12 */
-804,	/* OBJ_whirlpool                    1 0 10118 3 0 55 */
-124,	/* OBJ_rle_compression              1 1 1 1 666 1 */
-773,	/* OBJ_kisa                         1 2 410 200004 */
-807,	/* OBJ_id_GostR3411_94_with_GostR3410_2001 1 2 643 2 2 3 */
-808,	/* OBJ_id_GostR3411_94_with_GostR3410_94 1 2 643 2 2 4 */
-809,	/* OBJ_id_GostR3411_94              1 2 643 2 2 9 */
-810,	/* OBJ_id_HMACGostR3411_94          1 2 643 2 2 10 */
-811,	/* OBJ_id_GostR3410_2001            1 2 643 2 2 19 */
-812,	/* OBJ_id_GostR3410_94              1 2 643 2 2 20 */
-813,	/* OBJ_id_Gost28147_89              1 2 643 2 2 21 */
-815,	/* OBJ_id_Gost28147_89_MAC          1 2 643 2 2 22 */
-816,	/* OBJ_id_GostR3411_94_prf          1 2 643 2 2 23 */
-817,	/* OBJ_id_GostR3410_2001DH          1 2 643 2 2 98 */
-818,	/* OBJ_id_GostR3410_94DH            1 2 643 2 2 99 */
- 1,	/* OBJ_rsadsi                       1 2 840 113549 */
-185,	/* OBJ_X9cm                         1 2 840 10040 4 */
-127,	/* OBJ_id_pkix                      1 3 6 1 5 5 7 */
-505,	/* OBJ_mime_mhs_headings            1 3 6 1 7 1 1 */
-506,	/* OBJ_mime_mhs_bodies              1 3 6 1 7 1 2 */
-119,	/* OBJ_ripemd160WithRSA             1 3 36 3 3 1 2 */
-631,	/* OBJ_setAttr_GenCryptgrm          2 23 42 3 3 3 1 */
-632,	/* OBJ_setAttr_T2Enc                2 23 42 3 3 4 1 */
-633,	/* OBJ_setAttr_T2cleartxt           2 23 42 3 3 4 2 */
-634,	/* OBJ_setAttr_TokICCsig            2 23 42 3 3 5 1 */
-635,	/* OBJ_setAttr_SecDevSig            2 23 42 3 3 5 2 */
-436,	/* OBJ_ucl                          0 9 2342 19200300 */
-820,	/* OBJ_id_Gost28147_89_None_KeyMeshing 1 2 643 2 2 14 0 */
-819,	/* OBJ_id_Gost28147_89_CryptoPro_KeyMeshing 1 2 643 2 2 14 1 */
-845,	/* OBJ_id_GostR3410_94_a            1 2 643 2 2 20 1 */
-846,	/* OBJ_id_GostR3410_94_aBis         1 2 643 2 2 20 2 */
-847,	/* OBJ_id_GostR3410_94_b            1 2 643 2 2 20 3 */
-848,	/* OBJ_id_GostR3410_94_bBis         1 2 643 2 2 20 4 */
-821,	/* OBJ_id_GostR3411_94_TestParamSet 1 2 643 2 2 30 0 */
-822,	/* OBJ_id_GostR3411_94_CryptoProParamSet 1 2 643 2 2 30 1 */
-823,	/* OBJ_id_Gost28147_89_TestParamSet 1 2 643 2 2 31 0 */
-824,	/* OBJ_id_Gost28147_89_CryptoPro_A_ParamSet 1 2 643 2 2 31 1 */
-825,	/* OBJ_id_Gost28147_89_CryptoPro_B_ParamSet 1 2 643 2 2 31 2 */
-826,	/* OBJ_id_Gost28147_89_CryptoPro_C_ParamSet 1 2 643 2 2 31 3 */
-827,	/* OBJ_id_Gost28147_89_CryptoPro_D_ParamSet 1 2 643 2 2 31 4 */
-828,	/* OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 1 2 643 2 2 31 5 */
-829,	/* OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 1 2 643 2 2 31 6 */
-830,	/* OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 1 2 643 2 2 31 7 */
-831,	/* OBJ_id_GostR3410_94_TestParamSet 1 2 643 2 2 32 0 */
-832,	/* OBJ_id_GostR3410_94_CryptoPro_A_ParamSet 1 2 643 2 2 32 2 */
-833,	/* OBJ_id_GostR3410_94_CryptoPro_B_ParamSet 1 2 643 2 2 32 3 */
-834,	/* OBJ_id_GostR3410_94_CryptoPro_C_ParamSet 1 2 643 2 2 32 4 */
-835,	/* OBJ_id_GostR3410_94_CryptoPro_D_ParamSet 1 2 643 2 2 32 5 */
-836,	/* OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet 1 2 643 2 2 33 1 */
-837,	/* OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet 1 2 643 2 2 33 2 */
-838,	/* OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet 1 2 643 2 2 33 3 */
-839,	/* OBJ_id_GostR3410_2001_TestParamSet 1 2 643 2 2 35 0 */
-840,	/* OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet 1 2 643 2 2 35 1 */
-841,	/* OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet 1 2 643 2 2 35 2 */
-842,	/* OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet 1 2 643 2 2 35 3 */
-843,	/* OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet 1 2 643 2 2 36 0 */
-844,	/* OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet 1 2 643 2 2 36 1 */
- 2,	/* OBJ_pkcs                         1 2 840 113549 1 */
-431,	/* OBJ_hold_instruction_none        1 2 840 10040 2 1 */
-432,	/* OBJ_hold_instruction_call_issuer 1 2 840 10040 2 2 */
-433,	/* OBJ_hold_instruction_reject      1 2 840 10040 2 3 */
-116,	/* OBJ_dsa                          1 2 840 10040 4 1 */
-113,	/* OBJ_dsaWithSHA1                  1 2 840 10040 4 3 */
-406,	/* OBJ_X9_62_prime_field            1 2 840 10045 1 1 */
-407,	/* OBJ_X9_62_characteristic_two_field 1 2 840 10045 1 2 */
-408,	/* OBJ_X9_62_id_ecPublicKey         1 2 840 10045 2 1 */
-416,	/* OBJ_ecdsa_with_SHA1              1 2 840 10045 4 1 */
-791,	/* OBJ_ecdsa_with_Recommended       1 2 840 10045 4 2 */
-792,	/* OBJ_ecdsa_with_Specified         1 2 840 10045 4 3 */
-258,	/* OBJ_id_pkix_mod                  1 3 6 1 5 5 7 0 */
-175,	/* OBJ_id_pe                        1 3 6 1 5 5 7 1 */
-259,	/* OBJ_id_qt                        1 3 6 1 5 5 7 2 */
-128,	/* OBJ_id_kp                        1 3 6 1 5 5 7 3 */
-260,	/* OBJ_id_it                        1 3 6 1 5 5 7 4 */
-261,	/* OBJ_id_pkip                      1 3 6 1 5 5 7 5 */
-262,	/* OBJ_id_alg                       1 3 6 1 5 5 7 6 */
-263,	/* OBJ_id_cmc                       1 3 6 1 5 5 7 7 */
-264,	/* OBJ_id_on                        1 3 6 1 5 5 7 8 */
-265,	/* OBJ_id_pda                       1 3 6 1 5 5 7 9 */
-266,	/* OBJ_id_aca                       1 3 6 1 5 5 7 10 */
-267,	/* OBJ_id_qcs                       1 3 6 1 5 5 7 11 */
-268,	/* OBJ_id_cct                       1 3 6 1 5 5 7 12 */
-662,	/* OBJ_id_ppl                       1 3 6 1 5 5 7 21 */
-176,	/* OBJ_id_ad                        1 3 6 1 5 5 7 48 */
-507,	/* OBJ_id_hex_partial_message       1 3 6 1 7 1 1 1 */
-508,	/* OBJ_id_hex_multipart_message     1 3 6 1 7 1 1 2 */
-57,	/* OBJ_netscape                     2 16 840 1 113730 */
-754,	/* OBJ_camellia_128_ecb             0 3 4401 5 3 1 9 1 */
-766,	/* OBJ_camellia_128_ofb128          0 3 4401 5 3 1 9 3 */
-757,	/* OBJ_camellia_128_cfb128          0 3 4401 5 3 1 9 4 */
-755,	/* OBJ_camellia_192_ecb             0 3 4401 5 3 1 9 21 */
-767,	/* OBJ_camellia_192_ofb128          0 3 4401 5 3 1 9 23 */
-758,	/* OBJ_camellia_192_cfb128          0 3 4401 5 3 1 9 24 */
-756,	/* OBJ_camellia_256_ecb             0 3 4401 5 3 1 9 41 */
-768,	/* OBJ_camellia_256_ofb128          0 3 4401 5 3 1 9 43 */
-759,	/* OBJ_camellia_256_cfb128          0 3 4401 5 3 1 9 44 */
-437,	/* OBJ_pilot                        0 9 2342 19200300 100 */
-776,	/* OBJ_seed_ecb                     1 2 410 200004 1 3 */
-777,	/* OBJ_seed_cbc                     1 2 410 200004 1 4 */
-779,	/* OBJ_seed_cfb128                  1 2 410 200004 1 5 */
-778,	/* OBJ_seed_ofb128                  1 2 410 200004 1 6 */
-852,	/* OBJ_id_GostR3411_94_with_GostR3410_94_cc 1 2 643 2 9 1 3 3 */
-853,	/* OBJ_id_GostR3411_94_with_GostR3410_2001_cc 1 2 643 2 9 1 3 4 */
-850,	/* OBJ_id_GostR3410_94_cc           1 2 643 2 9 1 5 3 */
-851,	/* OBJ_id_GostR3410_2001_cc         1 2 643 2 9 1 5 4 */
-849,	/* OBJ_id_Gost28147_89_cc           1 2 643 2 9 1 6 1 */
-854,	/* OBJ_id_GostR3410_2001_ParamSet_cc 1 2 643 2 9 1 8 1 */
-186,	/* OBJ_pkcs1                        1 2 840 113549 1 1 */
-27,	/* OBJ_pkcs3                        1 2 840 113549 1 3 */
-187,	/* OBJ_pkcs5                        1 2 840 113549 1 5 */
-20,	/* OBJ_pkcs7                        1 2 840 113549 1 7 */
-47,	/* OBJ_pkcs9                        1 2 840 113549 1 9 */
- 3,	/* OBJ_md2                          1 2 840 113549 2 2 */
-257,	/* OBJ_md4                          1 2 840 113549 2 4 */
- 4,	/* OBJ_md5                          1 2 840 113549 2 5 */
-797,	/* OBJ_hmacWithMD5                  1 2 840 113549 2 6 */
-163,	/* OBJ_hmacWithSHA1                 1 2 840 113549 2 7 */
-798,	/* OBJ_hmacWithSHA224               1 2 840 113549 2 8 */
-799,	/* OBJ_hmacWithSHA256               1 2 840 113549 2 9 */
-800,	/* OBJ_hmacWithSHA384               1 2 840 113549 2 10 */
-801,	/* OBJ_hmacWithSHA512               1 2 840 113549 2 11 */
-37,	/* OBJ_rc2_cbc                      1 2 840 113549 3 2 */
- 5,	/* OBJ_rc4                          1 2 840 113549 3 4 */
-44,	/* OBJ_des_ede3_cbc                 1 2 840 113549 3 7 */
-120,	/* OBJ_rc5_cbc                      1 2 840 113549 3 8 */
-643,	/* OBJ_des_cdmf                     1 2 840 113549 3 10 */
-680,	/* OBJ_X9_62_id_characteristic_two_basis 1 2 840 10045 1 2 3 */
-684,	/* OBJ_X9_62_c2pnb163v1             1 2 840 10045 3 0 1 */
-685,	/* OBJ_X9_62_c2pnb163v2             1 2 840 10045 3 0 2 */
-686,	/* OBJ_X9_62_c2pnb163v3             1 2 840 10045 3 0 3 */
-687,	/* OBJ_X9_62_c2pnb176v1             1 2 840 10045 3 0 4 */
-688,	/* OBJ_X9_62_c2tnb191v1             1 2 840 10045 3 0 5 */
-689,	/* OBJ_X9_62_c2tnb191v2             1 2 840 10045 3 0 6 */
-690,	/* OBJ_X9_62_c2tnb191v3             1 2 840 10045 3 0 7 */
-691,	/* OBJ_X9_62_c2onb191v4             1 2 840 10045 3 0 8 */
-692,	/* OBJ_X9_62_c2onb191v5             1 2 840 10045 3 0 9 */
-693,	/* OBJ_X9_62_c2pnb208w1             1 2 840 10045 3 0 10 */
-694,	/* OBJ_X9_62_c2tnb239v1             1 2 840 10045 3 0 11 */
-695,	/* OBJ_X9_62_c2tnb239v2             1 2 840 10045 3 0 12 */
-696,	/* OBJ_X9_62_c2tnb239v3             1 2 840 10045 3 0 13 */
-697,	/* OBJ_X9_62_c2onb239v4             1 2 840 10045 3 0 14 */
-698,	/* OBJ_X9_62_c2onb239v5             1 2 840 10045 3 0 15 */
-699,	/* OBJ_X9_62_c2pnb272w1             1 2 840 10045 3 0 16 */
-700,	/* OBJ_X9_62_c2pnb304w1             1 2 840 10045 3 0 17 */
-701,	/* OBJ_X9_62_c2tnb359v1             1 2 840 10045 3 0 18 */
-702,	/* OBJ_X9_62_c2pnb368w1             1 2 840 10045 3 0 19 */
-703,	/* OBJ_X9_62_c2tnb431r1             1 2 840 10045 3 0 20 */
-409,	/* OBJ_X9_62_prime192v1             1 2 840 10045 3 1 1 */
-410,	/* OBJ_X9_62_prime192v2             1 2 840 10045 3 1 2 */
-411,	/* OBJ_X9_62_prime192v3             1 2 840 10045 3 1 3 */
-412,	/* OBJ_X9_62_prime239v1             1 2 840 10045 3 1 4 */
-413,	/* OBJ_X9_62_prime239v2             1 2 840 10045 3 1 5 */
-414,	/* OBJ_X9_62_prime239v3             1 2 840 10045 3 1 6 */
-415,	/* OBJ_X9_62_prime256v1             1 2 840 10045 3 1 7 */
-793,	/* OBJ_ecdsa_with_SHA224            1 2 840 10045 4 3 1 */
-794,	/* OBJ_ecdsa_with_SHA256            1 2 840 10045 4 3 2 */
-795,	/* OBJ_ecdsa_with_SHA384            1 2 840 10045 4 3 3 */
-796,	/* OBJ_ecdsa_with_SHA512            1 2 840 10045 4 3 4 */
-269,	/* OBJ_id_pkix1_explicit_88         1 3 6 1 5 5 7 0 1 */
-270,	/* OBJ_id_pkix1_implicit_88         1 3 6 1 5 5 7 0 2 */
-271,	/* OBJ_id_pkix1_explicit_93         1 3 6 1 5 5 7 0 3 */
-272,	/* OBJ_id_pkix1_implicit_93         1 3 6 1 5 5 7 0 4 */
-273,	/* OBJ_id_mod_crmf                  1 3 6 1 5 5 7 0 5 */
-274,	/* OBJ_id_mod_cmc                   1 3 6 1 5 5 7 0 6 */
-275,	/* OBJ_id_mod_kea_profile_88        1 3 6 1 5 5 7 0 7 */
-276,	/* OBJ_id_mod_kea_profile_93        1 3 6 1 5 5 7 0 8 */
-277,	/* OBJ_id_mod_cmp                   1 3 6 1 5 5 7 0 9 */
-278,	/* OBJ_id_mod_qualified_cert_88     1 3 6 1 5 5 7 0 10 */
-279,	/* OBJ_id_mod_qualified_cert_93     1 3 6 1 5 5 7 0 11 */
-280,	/* OBJ_id_mod_attribute_cert        1 3 6 1 5 5 7 0 12 */
-281,	/* OBJ_id_mod_timestamp_protocol    1 3 6 1 5 5 7 0 13 */
-282,	/* OBJ_id_mod_ocsp                  1 3 6 1 5 5 7 0 14 */
-283,	/* OBJ_id_mod_dvcs                  1 3 6 1 5 5 7 0 15 */
-284,	/* OBJ_id_mod_cmp2000               1 3 6 1 5 5 7 0 16 */
-177,	/* OBJ_info_access                  1 3 6 1 5 5 7 1 1 */
-285,	/* OBJ_biometricInfo                1 3 6 1 5 5 7 1 2 */
-286,	/* OBJ_qcStatements                 1 3 6 1 5 5 7 1 3 */
-287,	/* OBJ_ac_auditEntity               1 3 6 1 5 5 7 1 4 */
-288,	/* OBJ_ac_targeting                 1 3 6 1 5 5 7 1 5 */
-289,	/* OBJ_aaControls                   1 3 6 1 5 5 7 1 6 */
-290,	/* OBJ_sbgp_ipAddrBlock             1 3 6 1 5 5 7 1 7 */
-291,	/* OBJ_sbgp_autonomousSysNum        1 3 6 1 5 5 7 1 8 */
-292,	/* OBJ_sbgp_routerIdentifier        1 3 6 1 5 5 7 1 9 */
-397,	/* OBJ_ac_proxying                  1 3 6 1 5 5 7 1 10 */
-398,	/* OBJ_sinfo_access                 1 3 6 1 5 5 7 1 11 */
-663,	/* OBJ_proxyCertInfo                1 3 6 1 5 5 7 1 14 */
-164,	/* OBJ_id_qt_cps                    1 3 6 1 5 5 7 2 1 */
-165,	/* OBJ_id_qt_unotice                1 3 6 1 5 5 7 2 2 */
-293,	/* OBJ_textNotice                   1 3 6 1 5 5 7 2 3 */
-129,	/* OBJ_server_auth                  1 3 6 1 5 5 7 3 1 */
-130,	/* OBJ_client_auth                  1 3 6 1 5 5 7 3 2 */
-131,	/* OBJ_code_sign                    1 3 6 1 5 5 7 3 3 */
-132,	/* OBJ_email_protect                1 3 6 1 5 5 7 3 4 */
-294,	/* OBJ_ipsecEndSystem               1 3 6 1 5 5 7 3 5 */
-295,	/* OBJ_ipsecTunnel                  1 3 6 1 5 5 7 3 6 */
-296,	/* OBJ_ipsecUser                    1 3 6 1 5 5 7 3 7 */
-133,	/* OBJ_time_stamp                   1 3 6 1 5 5 7 3 8 */
-180,	/* OBJ_OCSP_sign                    1 3 6 1 5 5 7 3 9 */
-297,	/* OBJ_dvcs                         1 3 6 1 5 5 7 3 10 */
-298,	/* OBJ_id_it_caProtEncCert          1 3 6 1 5 5 7 4 1 */
-299,	/* OBJ_id_it_signKeyPairTypes       1 3 6 1 5 5 7 4 2 */
-300,	/* OBJ_id_it_encKeyPairTypes        1 3 6 1 5 5 7 4 3 */
-301,	/* OBJ_id_it_preferredSymmAlg       1 3 6 1 5 5 7 4 4 */
-302,	/* OBJ_id_it_caKeyUpdateInfo        1 3 6 1 5 5 7 4 5 */
-303,	/* OBJ_id_it_currentCRL             1 3 6 1 5 5 7 4 6 */
-304,	/* OBJ_id_it_unsupportedOIDs        1 3 6 1 5 5 7 4 7 */
-305,	/* OBJ_id_it_subscriptionRequest    1 3 6 1 5 5 7 4 8 */
-306,	/* OBJ_id_it_subscriptionResponse   1 3 6 1 5 5 7 4 9 */
-307,	/* OBJ_id_it_keyPairParamReq        1 3 6 1 5 5 7 4 10 */
-308,	/* OBJ_id_it_keyPairParamRep        1 3 6 1 5 5 7 4 11 */
-309,	/* OBJ_id_it_revPassphrase          1 3 6 1 5 5 7 4 12 */
-310,	/* OBJ_id_it_implicitConfirm        1 3 6 1 5 5 7 4 13 */
-311,	/* OBJ_id_it_confirmWaitTime        1 3 6 1 5 5 7 4 14 */
-312,	/* OBJ_id_it_origPKIMessage         1 3 6 1 5 5 7 4 15 */
-784,	/* OBJ_id_it_suppLangTags           1 3 6 1 5 5 7 4 16 */
-313,	/* OBJ_id_regCtrl                   1 3 6 1 5 5 7 5 1 */
-314,	/* OBJ_id_regInfo                   1 3 6 1 5 5 7 5 2 */
-323,	/* OBJ_id_alg_des40                 1 3 6 1 5 5 7 6 1 */
-324,	/* OBJ_id_alg_noSignature           1 3 6 1 5 5 7 6 2 */
-325,	/* OBJ_id_alg_dh_sig_hmac_sha1      1 3 6 1 5 5 7 6 3 */
-326,	/* OBJ_id_alg_dh_pop                1 3 6 1 5 5 7 6 4 */
-327,	/* OBJ_id_cmc_statusInfo            1 3 6 1 5 5 7 7 1 */
-328,	/* OBJ_id_cmc_identification        1 3 6 1 5 5 7 7 2 */
-329,	/* OBJ_id_cmc_identityProof         1 3 6 1 5 5 7 7 3 */
-330,	/* OBJ_id_cmc_dataReturn            1 3 6 1 5 5 7 7 4 */
-331,	/* OBJ_id_cmc_transactionId         1 3 6 1 5 5 7 7 5 */
-332,	/* OBJ_id_cmc_senderNonce           1 3 6 1 5 5 7 7 6 */
-333,	/* OBJ_id_cmc_recipientNonce        1 3 6 1 5 5 7 7 7 */
-334,	/* OBJ_id_cmc_addExtensions         1 3 6 1 5 5 7 7 8 */
-335,	/* OBJ_id_cmc_encryptedPOP          1 3 6 1 5 5 7 7 9 */
-336,	/* OBJ_id_cmc_decryptedPOP          1 3 6 1 5 5 7 7 10 */
-337,	/* OBJ_id_cmc_lraPOPWitness         1 3 6 1 5 5 7 7 11 */
-338,	/* OBJ_id_cmc_getCert               1 3 6 1 5 5 7 7 15 */
-339,	/* OBJ_id_cmc_getCRL                1 3 6 1 5 5 7 7 16 */
-340,	/* OBJ_id_cmc_revokeRequest         1 3 6 1 5 5 7 7 17 */
-341,	/* OBJ_id_cmc_regInfo               1 3 6 1 5 5 7 7 18 */
-342,	/* OBJ_id_cmc_responseInfo          1 3 6 1 5 5 7 7 19 */
-343,	/* OBJ_id_cmc_queryPending          1 3 6 1 5 5 7 7 21 */
-344,	/* OBJ_id_cmc_popLinkRandom         1 3 6 1 5 5 7 7 22 */
-345,	/* OBJ_id_cmc_popLinkWitness        1 3 6 1 5 5 7 7 23 */
-346,	/* OBJ_id_cmc_confirmCertAcceptance 1 3 6 1 5 5 7 7 24 */
-347,	/* OBJ_id_on_personalData           1 3 6 1 5 5 7 8 1 */
-858,	/* OBJ_id_on_permanentIdentifier    1 3 6 1 5 5 7 8 3 */
-348,	/* OBJ_id_pda_dateOfBirth           1 3 6 1 5 5 7 9 1 */
-349,	/* OBJ_id_pda_placeOfBirth          1 3 6 1 5 5 7 9 2 */
-351,	/* OBJ_id_pda_gender                1 3 6 1 5 5 7 9 3 */
-352,	/* OBJ_id_pda_countryOfCitizenship  1 3 6 1 5 5 7 9 4 */
-353,	/* OBJ_id_pda_countryOfResidence    1 3 6 1 5 5 7 9 5 */
-354,	/* OBJ_id_aca_authenticationInfo    1 3 6 1 5 5 7 10 1 */
-355,	/* OBJ_id_aca_accessIdentity        1 3 6 1 5 5 7 10 2 */
-356,	/* OBJ_id_aca_chargingIdentity      1 3 6 1 5 5 7 10 3 */
-357,	/* OBJ_id_aca_group                 1 3 6 1 5 5 7 10 4 */
-358,	/* OBJ_id_aca_role                  1 3 6 1 5 5 7 10 5 */
-399,	/* OBJ_id_aca_encAttrs              1 3 6 1 5 5 7 10 6 */
-359,	/* OBJ_id_qcs_pkixQCSyntax_v1       1 3 6 1 5 5 7 11 1 */
-360,	/* OBJ_id_cct_crs                   1 3 6 1 5 5 7 12 1 */
-361,	/* OBJ_id_cct_PKIData               1 3 6 1 5 5 7 12 2 */
-362,	/* OBJ_id_cct_PKIResponse           1 3 6 1 5 5 7 12 3 */
-664,	/* OBJ_id_ppl_anyLanguage           1 3 6 1 5 5 7 21 0 */
-665,	/* OBJ_id_ppl_inheritAll            1 3 6 1 5 5 7 21 1 */
-667,	/* OBJ_Independent                  1 3 6 1 5 5 7 21 2 */
-178,	/* OBJ_ad_OCSP                      1 3 6 1 5 5 7 48 1 */
-179,	/* OBJ_ad_ca_issuers                1 3 6 1 5 5 7 48 2 */
-363,	/* OBJ_ad_timeStamping              1 3 6 1 5 5 7 48 3 */
-364,	/* OBJ_ad_dvcs                      1 3 6 1 5 5 7 48 4 */
-785,	/* OBJ_caRepository                 1 3 6 1 5 5 7 48 5 */
-780,	/* OBJ_hmac_md5                     1 3 6 1 5 5 8 1 1 */
-781,	/* OBJ_hmac_sha1                    1 3 6 1 5 5 8 1 2 */
-58,	/* OBJ_netscape_cert_extension      2 16 840 1 113730 1 */
-59,	/* OBJ_netscape_data_type           2 16 840 1 113730 2 */
-438,	/* OBJ_pilotAttributeType           0 9 2342 19200300 100 1 */
-439,	/* OBJ_pilotAttributeSyntax         0 9 2342 19200300 100 3 */
-440,	/* OBJ_pilotObjectClass             0 9 2342 19200300 100 4 */
-441,	/* OBJ_pilotGroups                  0 9 2342 19200300 100 10 */
-108,	/* OBJ_cast5_cbc                    1 2 840 113533 7 66 10 */
-112,	/* OBJ_pbeWithMD5AndCast5_CBC       1 2 840 113533 7 66 12 */
-782,	/* OBJ_id_PasswordBasedMAC          1 2 840 113533 7 66 13 */
-783,	/* OBJ_id_DHBasedMac                1 2 840 113533 7 66 30 */
- 6,	/* OBJ_rsaEncryption                1 2 840 113549 1 1 1 */
- 7,	/* OBJ_md2WithRSAEncryption         1 2 840 113549 1 1 2 */
-396,	/* OBJ_md4WithRSAEncryption         1 2 840 113549 1 1 3 */
- 8,	/* OBJ_md5WithRSAEncryption         1 2 840 113549 1 1 4 */
-65,	/* OBJ_sha1WithRSAEncryption        1 2 840 113549 1 1 5 */
-644,	/* OBJ_rsaOAEPEncryptionSET         1 2 840 113549 1 1 6 */
-668,	/* OBJ_sha256WithRSAEncryption      1 2 840 113549 1 1 11 */
-669,	/* OBJ_sha384WithRSAEncryption      1 2 840 113549 1 1 12 */
-670,	/* OBJ_sha512WithRSAEncryption      1 2 840 113549 1 1 13 */
-671,	/* OBJ_sha224WithRSAEncryption      1 2 840 113549 1 1 14 */
-28,	/* OBJ_dhKeyAgreement               1 2 840 113549 1 3 1 */
- 9,	/* OBJ_pbeWithMD2AndDES_CBC         1 2 840 113549 1 5 1 */
-10,	/* OBJ_pbeWithMD5AndDES_CBC         1 2 840 113549 1 5 3 */
-168,	/* OBJ_pbeWithMD2AndRC2_CBC         1 2 840 113549 1 5 4 */
-169,	/* OBJ_pbeWithMD5AndRC2_CBC         1 2 840 113549 1 5 6 */
-170,	/* OBJ_pbeWithSHA1AndDES_CBC        1 2 840 113549 1 5 10 */
-68,	/* OBJ_pbeWithSHA1AndRC2_CBC        1 2 840 113549 1 5 11 */
-69,	/* OBJ_id_pbkdf2                    1 2 840 113549 1 5 12 */
-161,	/* OBJ_pbes2                        1 2 840 113549 1 5 13 */
-162,	/* OBJ_pbmac1                       1 2 840 113549 1 5 14 */
-21,	/* OBJ_pkcs7_data                   1 2 840 113549 1 7 1 */
-22,	/* OBJ_pkcs7_signed                 1 2 840 113549 1 7 2 */
-23,	/* OBJ_pkcs7_enveloped              1 2 840 113549 1 7 3 */
-24,	/* OBJ_pkcs7_signedAndEnveloped     1 2 840 113549 1 7 4 */
-25,	/* OBJ_pkcs7_digest                 1 2 840 113549 1 7 5 */
-26,	/* OBJ_pkcs7_encrypted              1 2 840 113549 1 7 6 */
-48,	/* OBJ_pkcs9_emailAddress           1 2 840 113549 1 9 1 */
-49,	/* OBJ_pkcs9_unstructuredName       1 2 840 113549 1 9 2 */
-50,	/* OBJ_pkcs9_contentType            1 2 840 113549 1 9 3 */
-51,	/* OBJ_pkcs9_messageDigest          1 2 840 113549 1 9 4 */
-52,	/* OBJ_pkcs9_signingTime            1 2 840 113549 1 9 5 */
-53,	/* OBJ_pkcs9_countersignature       1 2 840 113549 1 9 6 */
-54,	/* OBJ_pkcs9_challengePassword      1 2 840 113549 1 9 7 */
-55,	/* OBJ_pkcs9_unstructuredAddress    1 2 840 113549 1 9 8 */
-56,	/* OBJ_pkcs9_extCertAttributes      1 2 840 113549 1 9 9 */
-172,	/* OBJ_ext_req                      1 2 840 113549 1 9 14 */
-167,	/* OBJ_SMIMECapabilities            1 2 840 113549 1 9 15 */
-188,	/* OBJ_SMIME                        1 2 840 113549 1 9 16 */
-156,	/* OBJ_friendlyName                 1 2 840 113549 1 9 20 */
-157,	/* OBJ_localKeyID                   1 2 840 113549 1 9 21 */
-681,	/* OBJ_X9_62_onBasis                1 2 840 10045 1 2 3 1 */
-682,	/* OBJ_X9_62_tpBasis                1 2 840 10045 1 2 3 2 */
-683,	/* OBJ_X9_62_ppBasis                1 2 840 10045 1 2 3 3 */
-417,	/* OBJ_ms_csp_name                  1 3 6 1 4 1 311 17 1 */
-856,	/* OBJ_LocalKeySet                  1 3 6 1 4 1 311 17 2 */
-390,	/* OBJ_dcObject                     1 3 6 1 4 1 1466 344 */
-91,	/* OBJ_bf_cbc                       1 3 6 1 4 1 3029 1 2 */
-315,	/* OBJ_id_regCtrl_regToken          1 3 6 1 5 5 7 5 1 1 */
-316,	/* OBJ_id_regCtrl_authenticator     1 3 6 1 5 5 7 5 1 2 */
-317,	/* OBJ_id_regCtrl_pkiPublicationInfo 1 3 6 1 5 5 7 5 1 3 */
-318,	/* OBJ_id_regCtrl_pkiArchiveOptions 1 3 6 1 5 5 7 5 1 4 */
-319,	/* OBJ_id_regCtrl_oldCertID         1 3 6 1 5 5 7 5 1 5 */
-320,	/* OBJ_id_regCtrl_protocolEncrKey   1 3 6 1 5 5 7 5 1 6 */
-321,	/* OBJ_id_regInfo_utf8Pairs         1 3 6 1 5 5 7 5 2 1 */
-322,	/* OBJ_id_regInfo_certReq           1 3 6 1 5 5 7 5 2 2 */
-365,	/* OBJ_id_pkix_OCSP_basic           1 3 6 1 5 5 7 48 1 1 */
-366,	/* OBJ_id_pkix_OCSP_Nonce           1 3 6 1 5 5 7 48 1 2 */
-367,	/* OBJ_id_pkix_OCSP_CrlID           1 3 6 1 5 5 7 48 1 3 */
-368,	/* OBJ_id_pkix_OCSP_acceptableResponses 1 3 6 1 5 5 7 48 1 4 */
-369,	/* OBJ_id_pkix_OCSP_noCheck         1 3 6 1 5 5 7 48 1 5 */
-370,	/* OBJ_id_pkix_OCSP_archiveCutoff   1 3 6 1 5 5 7 48 1 6 */
-371,	/* OBJ_id_pkix_OCSP_serviceLocator  1 3 6 1 5 5 7 48 1 7 */
-372,	/* OBJ_id_pkix_OCSP_extendedStatus  1 3 6 1 5 5 7 48 1 8 */
-373,	/* OBJ_id_pkix_OCSP_valid           1 3 6 1 5 5 7 48 1 9 */
-374,	/* OBJ_id_pkix_OCSP_path            1 3 6 1 5 5 7 48 1 10 */
-375,	/* OBJ_id_pkix_OCSP_trustRoot       1 3 6 1 5 5 7 48 1 11 */
-418,	/* OBJ_aes_128_ecb                  2 16 840 1 101 3 4 1 1 */
-419,	/* OBJ_aes_128_cbc                  2 16 840 1 101 3 4 1 2 */
-420,	/* OBJ_aes_128_ofb128               2 16 840 1 101 3 4 1 3 */
-421,	/* OBJ_aes_128_cfb128               2 16 840 1 101 3 4 1 4 */
-788,	/* OBJ_id_aes128_wrap               2 16 840 1 101 3 4 1 5 */
-422,	/* OBJ_aes_192_ecb                  2 16 840 1 101 3 4 1 21 */
-423,	/* OBJ_aes_192_cbc                  2 16 840 1 101 3 4 1 22 */
-424,	/* OBJ_aes_192_ofb128               2 16 840 1 101 3 4 1 23 */
-425,	/* OBJ_aes_192_cfb128               2 16 840 1 101 3 4 1 24 */
-789,	/* OBJ_id_aes192_wrap               2 16 840 1 101 3 4 1 25 */
-426,	/* OBJ_aes_256_ecb                  2 16 840 1 101 3 4 1 41 */
-427,	/* OBJ_aes_256_cbc                  2 16 840 1 101 3 4 1 42 */
-428,	/* OBJ_aes_256_ofb128               2 16 840 1 101 3 4 1 43 */
-429,	/* OBJ_aes_256_cfb128               2 16 840 1 101 3 4 1 44 */
-790,	/* OBJ_id_aes256_wrap               2 16 840 1 101 3 4 1 45 */
-672,	/* OBJ_sha256                       2 16 840 1 101 3 4 2 1 */
-673,	/* OBJ_sha384                       2 16 840 1 101 3 4 2 2 */
-674,	/* OBJ_sha512                       2 16 840 1 101 3 4 2 3 */
-675,	/* OBJ_sha224                       2 16 840 1 101 3 4 2 4 */
-802,	/* OBJ_dsa_with_SHA224              2 16 840 1 101 3 4 3 1 */
-803,	/* OBJ_dsa_with_SHA256              2 16 840 1 101 3 4 3 2 */
-71,	/* OBJ_netscape_cert_type           2 16 840 1 113730 1 1 */
-72,	/* OBJ_netscape_base_url            2 16 840 1 113730 1 2 */
-73,	/* OBJ_netscape_revocation_url      2 16 840 1 113730 1 3 */
-74,	/* OBJ_netscape_ca_revocation_url   2 16 840 1 113730 1 4 */
-75,	/* OBJ_netscape_renewal_url         2 16 840 1 113730 1 7 */
-76,	/* OBJ_netscape_ca_policy_url       2 16 840 1 113730 1 8 */
-77,	/* OBJ_netscape_ssl_server_name     2 16 840 1 113730 1 12 */
-78,	/* OBJ_netscape_comment             2 16 840 1 113730 1 13 */
-79,	/* OBJ_netscape_cert_sequence       2 16 840 1 113730 2 5 */
-139,	/* OBJ_ns_sgc                       2 16 840 1 113730 4 1 */
-458,	/* OBJ_userId                       0 9 2342 19200300 100 1 1 */
-459,	/* OBJ_textEncodedORAddress         0 9 2342 19200300 100 1 2 */
-460,	/* OBJ_rfc822Mailbox                0 9 2342 19200300 100 1 3 */
-461,	/* OBJ_info                         0 9 2342 19200300 100 1 4 */
-462,	/* OBJ_favouriteDrink               0 9 2342 19200300 100 1 5 */
-463,	/* OBJ_roomNumber                   0 9 2342 19200300 100 1 6 */
-464,	/* OBJ_photo                        0 9 2342 19200300 100 1 7 */
-465,	/* OBJ_userClass                    0 9 2342 19200300 100 1 8 */
-466,	/* OBJ_host                         0 9 2342 19200300 100 1 9 */
-467,	/* OBJ_manager                      0 9 2342 19200300 100 1 10 */
-468,	/* OBJ_documentIdentifier           0 9 2342 19200300 100 1 11 */
-469,	/* OBJ_documentTitle                0 9 2342 19200300 100 1 12 */
-470,	/* OBJ_documentVersion              0 9 2342 19200300 100 1 13 */
-471,	/* OBJ_documentAuthor               0 9 2342 19200300 100 1 14 */
-472,	/* OBJ_documentLocation             0 9 2342 19200300 100 1 15 */
-473,	/* OBJ_homeTelephoneNumber          0 9 2342 19200300 100 1 20 */
-474,	/* OBJ_secretary                    0 9 2342 19200300 100 1 21 */
-475,	/* OBJ_otherMailbox                 0 9 2342 19200300 100 1 22 */
-476,	/* OBJ_lastModifiedTime             0 9 2342 19200300 100 1 23 */
-477,	/* OBJ_lastModifiedBy               0 9 2342 19200300 100 1 24 */
-391,	/* OBJ_domainComponent              0 9 2342 19200300 100 1 25 */
-478,	/* OBJ_aRecord                      0 9 2342 19200300 100 1 26 */
-479,	/* OBJ_pilotAttributeType27         0 9 2342 19200300 100 1 27 */
-480,	/* OBJ_mXRecord                     0 9 2342 19200300 100 1 28 */
-481,	/* OBJ_nSRecord                     0 9 2342 19200300 100 1 29 */
-482,	/* OBJ_sOARecord                    0 9 2342 19200300 100 1 30 */
-483,	/* OBJ_cNAMERecord                  0 9 2342 19200300 100 1 31 */
-484,	/* OBJ_associatedDomain             0 9 2342 19200300 100 1 37 */
-485,	/* OBJ_associatedName               0 9 2342 19200300 100 1 38 */
-486,	/* OBJ_homePostalAddress            0 9 2342 19200300 100 1 39 */
-487,	/* OBJ_personalTitle                0 9 2342 19200300 100 1 40 */
-488,	/* OBJ_mobileTelephoneNumber        0 9 2342 19200300 100 1 41 */
-489,	/* OBJ_pagerTelephoneNumber         0 9 2342 19200300 100 1 42 */
-490,	/* OBJ_friendlyCountryName          0 9 2342 19200300 100 1 43 */
-491,	/* OBJ_organizationalStatus         0 9 2342 19200300 100 1 45 */
-492,	/* OBJ_janetMailbox                 0 9 2342 19200300 100 1 46 */
-493,	/* OBJ_mailPreferenceOption         0 9 2342 19200300 100 1 47 */
-494,	/* OBJ_buildingName                 0 9 2342 19200300 100 1 48 */
-495,	/* OBJ_dSAQuality                   0 9 2342 19200300 100 1 49 */
-496,	/* OBJ_singleLevelQuality           0 9 2342 19200300 100 1 50 */
-497,	/* OBJ_subtreeMinimumQuality        0 9 2342 19200300 100 1 51 */
-498,	/* OBJ_subtreeMaximumQuality        0 9 2342 19200300 100 1 52 */
-499,	/* OBJ_personalSignature            0 9 2342 19200300 100 1 53 */
-500,	/* OBJ_dITRedirect                  0 9 2342 19200300 100 1 54 */
-501,	/* OBJ_audio                        0 9 2342 19200300 100 1 55 */
-502,	/* OBJ_documentPublisher            0 9 2342 19200300 100 1 56 */
-442,	/* OBJ_iA5StringSyntax              0 9 2342 19200300 100 3 4 */
-443,	/* OBJ_caseIgnoreIA5StringSyntax    0 9 2342 19200300 100 3 5 */
-444,	/* OBJ_pilotObject                  0 9 2342 19200300 100 4 3 */
-445,	/* OBJ_pilotPerson                  0 9 2342 19200300 100 4 4 */
-446,	/* OBJ_account                      0 9 2342 19200300 100 4 5 */
-447,	/* OBJ_document                     0 9 2342 19200300 100 4 6 */
-448,	/* OBJ_room                         0 9 2342 19200300 100 4 7 */
-449,	/* OBJ_documentSeries               0 9 2342 19200300 100 4 9 */
-392,	/* OBJ_Domain                       0 9 2342 19200300 100 4 13 */
-450,	/* OBJ_rFC822localPart              0 9 2342 19200300 100 4 14 */
-451,	/* OBJ_dNSDomain                    0 9 2342 19200300 100 4 15 */
-452,	/* OBJ_domainRelatedObject          0 9 2342 19200300 100 4 17 */
-453,	/* OBJ_friendlyCountry              0 9 2342 19200300 100 4 18 */
-454,	/* OBJ_simpleSecurityObject         0 9 2342 19200300 100 4 19 */
-455,	/* OBJ_pilotOrganization            0 9 2342 19200300 100 4 20 */
-456,	/* OBJ_pilotDSA                     0 9 2342 19200300 100 4 21 */
-457,	/* OBJ_qualityLabelledData          0 9 2342 19200300 100 4 22 */
-189,	/* OBJ_id_smime_mod                 1 2 840 113549 1 9 16 0 */
-190,	/* OBJ_id_smime_ct                  1 2 840 113549 1 9 16 1 */
-191,	/* OBJ_id_smime_aa                  1 2 840 113549 1 9 16 2 */
-192,	/* OBJ_id_smime_alg                 1 2 840 113549 1 9 16 3 */
-193,	/* OBJ_id_smime_cd                  1 2 840 113549 1 9 16 4 */
-194,	/* OBJ_id_smime_spq                 1 2 840 113549 1 9 16 5 */
-195,	/* OBJ_id_smime_cti                 1 2 840 113549 1 9 16 6 */
-158,	/* OBJ_x509Certificate              1 2 840 113549 1 9 22 1 */
-159,	/* OBJ_sdsiCertificate              1 2 840 113549 1 9 22 2 */
-160,	/* OBJ_x509Crl                      1 2 840 113549 1 9 23 1 */
-144,	/* OBJ_pbe_WithSHA1And128BitRC4     1 2 840 113549 1 12 1 1 */
-145,	/* OBJ_pbe_WithSHA1And40BitRC4      1 2 840 113549 1 12 1 2 */
-146,	/* OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC 1 2 840 113549 1 12 1 3 */
-147,	/* OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC 1 2 840 113549 1 12 1 4 */
-148,	/* OBJ_pbe_WithSHA1And128BitRC2_CBC 1 2 840 113549 1 12 1 5 */
-149,	/* OBJ_pbe_WithSHA1And40BitRC2_CBC  1 2 840 113549 1 12 1 6 */
-171,	/* OBJ_ms_ext_req                   1 3 6 1 4 1 311 2 1 14 */
-134,	/* OBJ_ms_code_ind                  1 3 6 1 4 1 311 2 1 21 */
-135,	/* OBJ_ms_code_com                  1 3 6 1 4 1 311 2 1 22 */
-136,	/* OBJ_ms_ctl_sign                  1 3 6 1 4 1 311 10 3 1 */
-137,	/* OBJ_ms_sgc                       1 3 6 1 4 1 311 10 3 3 */
-138,	/* OBJ_ms_efs                       1 3 6 1 4 1 311 10 3 4 */
-648,	/* OBJ_ms_smartcard_login           1 3 6 1 4 1 311 20 2 2 */
-649,	/* OBJ_ms_upn                       1 3 6 1 4 1 311 20 2 3 */
-751,	/* OBJ_camellia_128_cbc             1 2 392 200011 61 1 1 1 2 */
-752,	/* OBJ_camellia_192_cbc             1 2 392 200011 61 1 1 1 3 */
-753,	/* OBJ_camellia_256_cbc             1 2 392 200011 61 1 1 1 4 */
-196,	/* OBJ_id_smime_mod_cms             1 2 840 113549 1 9 16 0 1 */
-197,	/* OBJ_id_smime_mod_ess             1 2 840 113549 1 9 16 0 2 */
-198,	/* OBJ_id_smime_mod_oid             1 2 840 113549 1 9 16 0 3 */
-199,	/* OBJ_id_smime_mod_msg_v3          1 2 840 113549 1 9 16 0 4 */
-200,	/* OBJ_id_smime_mod_ets_eSignature_88 1 2 840 113549 1 9 16 0 5 */
-201,	/* OBJ_id_smime_mod_ets_eSignature_97 1 2 840 113549 1 9 16 0 6 */
-202,	/* OBJ_id_smime_mod_ets_eSigPolicy_88 1 2 840 113549 1 9 16 0 7 */
-203,	/* OBJ_id_smime_mod_ets_eSigPolicy_97 1 2 840 113549 1 9 16 0 8 */
-204,	/* OBJ_id_smime_ct_receipt          1 2 840 113549 1 9 16 1 1 */
-205,	/* OBJ_id_smime_ct_authData         1 2 840 113549 1 9 16 1 2 */
-206,	/* OBJ_id_smime_ct_publishCert      1 2 840 113549 1 9 16 1 3 */
-207,	/* OBJ_id_smime_ct_TSTInfo          1 2 840 113549 1 9 16 1 4 */
-208,	/* OBJ_id_smime_ct_TDTInfo          1 2 840 113549 1 9 16 1 5 */
-209,	/* OBJ_id_smime_ct_contentInfo      1 2 840 113549 1 9 16 1 6 */
-210,	/* OBJ_id_smime_ct_DVCSRequestData  1 2 840 113549 1 9 16 1 7 */
-211,	/* OBJ_id_smime_ct_DVCSResponseData 1 2 840 113549 1 9 16 1 8 */
-786,	/* OBJ_id_smime_ct_compressedData   1 2 840 113549 1 9 16 1 9 */
-787,	/* OBJ_id_ct_asciiTextWithCRLF      1 2 840 113549 1 9 16 1 27 */
-212,	/* OBJ_id_smime_aa_receiptRequest   1 2 840 113549 1 9 16 2 1 */
-213,	/* OBJ_id_smime_aa_securityLabel    1 2 840 113549 1 9 16 2 2 */
-214,	/* OBJ_id_smime_aa_mlExpandHistory  1 2 840 113549 1 9 16 2 3 */
-215,	/* OBJ_id_smime_aa_contentHint      1 2 840 113549 1 9 16 2 4 */
-216,	/* OBJ_id_smime_aa_msgSigDigest     1 2 840 113549 1 9 16 2 5 */
-217,	/* OBJ_id_smime_aa_encapContentType 1 2 840 113549 1 9 16 2 6 */
-218,	/* OBJ_id_smime_aa_contentIdentifier 1 2 840 113549 1 9 16 2 7 */
-219,	/* OBJ_id_smime_aa_macValue         1 2 840 113549 1 9 16 2 8 */
-220,	/* OBJ_id_smime_aa_equivalentLabels 1 2 840 113549 1 9 16 2 9 */
-221,	/* OBJ_id_smime_aa_contentReference 1 2 840 113549 1 9 16 2 10 */
-222,	/* OBJ_id_smime_aa_encrypKeyPref    1 2 840 113549 1 9 16 2 11 */
-223,	/* OBJ_id_smime_aa_signingCertificate 1 2 840 113549 1 9 16 2 12 */
-224,	/* OBJ_id_smime_aa_smimeEncryptCerts 1 2 840 113549 1 9 16 2 13 */
-225,	/* OBJ_id_smime_aa_timeStampToken   1 2 840 113549 1 9 16 2 14 */
-226,	/* OBJ_id_smime_aa_ets_sigPolicyId  1 2 840 113549 1 9 16 2 15 */
-227,	/* OBJ_id_smime_aa_ets_commitmentType 1 2 840 113549 1 9 16 2 16 */
-228,	/* OBJ_id_smime_aa_ets_signerLocation 1 2 840 113549 1 9 16 2 17 */
-229,	/* OBJ_id_smime_aa_ets_signerAttr   1 2 840 113549 1 9 16 2 18 */
-230,	/* OBJ_id_smime_aa_ets_otherSigCert 1 2 840 113549 1 9 16 2 19 */
-231,	/* OBJ_id_smime_aa_ets_contentTimestamp 1 2 840 113549 1 9 16 2 20 */
-232,	/* OBJ_id_smime_aa_ets_CertificateRefs 1 2 840 113549 1 9 16 2 21 */
-233,	/* OBJ_id_smime_aa_ets_RevocationRefs 1 2 840 113549 1 9 16 2 22 */
-234,	/* OBJ_id_smime_aa_ets_certValues   1 2 840 113549 1 9 16 2 23 */
-235,	/* OBJ_id_smime_aa_ets_revocationValues 1 2 840 113549 1 9 16 2 24 */
-236,	/* OBJ_id_smime_aa_ets_escTimeStamp 1 2 840 113549 1 9 16 2 25 */
-237,	/* OBJ_id_smime_aa_ets_certCRLTimestamp 1 2 840 113549 1 9 16 2 26 */
-238,	/* OBJ_id_smime_aa_ets_archiveTimeStamp 1 2 840 113549 1 9 16 2 27 */
-239,	/* OBJ_id_smime_aa_signatureType    1 2 840 113549 1 9 16 2 28 */
-240,	/* OBJ_id_smime_aa_dvcs_dvc         1 2 840 113549 1 9 16 2 29 */
-241,	/* OBJ_id_smime_alg_ESDHwith3DES    1 2 840 113549 1 9 16 3 1 */
-242,	/* OBJ_id_smime_alg_ESDHwithRC2     1 2 840 113549 1 9 16 3 2 */
-243,	/* OBJ_id_smime_alg_3DESwrap        1 2 840 113549 1 9 16 3 3 */
-244,	/* OBJ_id_smime_alg_RC2wrap         1 2 840 113549 1 9 16 3 4 */
-245,	/* OBJ_id_smime_alg_ESDH            1 2 840 113549 1 9 16 3 5 */
-246,	/* OBJ_id_smime_alg_CMS3DESwrap     1 2 840 113549 1 9 16 3 6 */
-247,	/* OBJ_id_smime_alg_CMSRC2wrap      1 2 840 113549 1 9 16 3 7 */
-125,	/* OBJ_zlib_compression             1 2 840 113549 1 9 16 3 8 */
-248,	/* OBJ_id_smime_cd_ldap             1 2 840 113549 1 9 16 4 1 */
-249,	/* OBJ_id_smime_spq_ets_sqt_uri     1 2 840 113549 1 9 16 5 1 */
-250,	/* OBJ_id_smime_spq_ets_sqt_unotice 1 2 840 113549 1 9 16 5 2 */
-251,	/* OBJ_id_smime_cti_ets_proofOfOrigin 1 2 840 113549 1 9 16 6 1 */
-252,	/* OBJ_id_smime_cti_ets_proofOfReceipt 1 2 840 113549 1 9 16 6 2 */
-253,	/* OBJ_id_smime_cti_ets_proofOfDelivery 1 2 840 113549 1 9 16 6 3 */
-254,	/* OBJ_id_smime_cti_ets_proofOfSender 1 2 840 113549 1 9 16 6 4 */
-255,	/* OBJ_id_smime_cti_ets_proofOfApproval 1 2 840 113549 1 9 16 6 5 */
-256,	/* OBJ_id_smime_cti_ets_proofOfCreation 1 2 840 113549 1 9 16 6 6 */
-150,	/* OBJ_keyBag                       1 2 840 113549 1 12 10 1 1 */
-151,	/* OBJ_pkcs8ShroudedKeyBag          1 2 840 113549 1 12 10 1 2 */
-152,	/* OBJ_certBag                      1 2 840 113549 1 12 10 1 3 */
-153,	/* OBJ_crlBag                       1 2 840 113549 1 12 10 1 4 */
-154,	/* OBJ_secretBag                    1 2 840 113549 1 12 10 1 5 */
-155,	/* OBJ_safeContentsBag              1 2 840 113549 1 12 10 1 6 */
-34,	/* OBJ_idea_cbc                     1 3 6 1 4 1 188 7 1 1 2 */
-};
+#define sn_objs OPENSSL_GLOBAL_ARRAY_NAME(sn_objs)
+#define ln_objs OPENSSL_GLOBAL_ARRAY_NAME(ln_objs)
+#define obj_objs OPENSSL_GLOBAL_ARRAY_NAME(obj_objs)
 
diff -Naur openssl-1.0.0q.orig/crypto/objects/obj_dat.pl openssl-1.0.0q/crypto/objects/obj_dat.pl
--- openssl-1.0.0q.orig/crypto/objects/obj_dat.pl	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/obj_dat.pl	2017-04-25 16:23:40.528620254 +0200
@@ -94,7 +94,7 @@
 	{
 	if (!defined($nid{$i}))
 		{
-		push(@out,"{NULL,NULL,NID_undef,0,NULL,0},\n");
+		push(@out,"CONST_ENTRY_NID(NULL,NULL,NID_undef,0,NULL,0)\n");
 		}
 	else
 		{
@@ -111,7 +111,7 @@
 			$ln{$nid{$i}} = $sn;
 		}
 			
-		$out ="{";
+		$out ="CONST_ENTRY_NID(";
 		$out.="\"$sn\"";
 		$out.=","."\"$ln\"";
 		$out.=",NID_$nid{$i},";
@@ -125,13 +125,13 @@
 			$length=0;
 			foreach (unpack("C*",$r))
 				{
-				$z.=sprintf("0x%02X,",$_);
+				$z.=sprintf("I(0x%02X) ",$_);
 				$length++;
 				}
 			$obj_der{$obj{$nid{$i}}}=$z;
 			$obj_len{$obj{$nid{$i}}}=$length;
 
-			push(@lvalues,sprintf("%-45s/* [%3d] %s */\n",
+			push(@lvalues,sprintf("%-55s/* [%3d] %s */\n",
 				$z,$lvalues,$obj{$nid{$i}}));
 			$out.="$length,&(lvalues[$lvalues]),0";
 			$lvalues+=$length;
@@ -140,7 +140,7 @@
 			{
 			$out.="0,NULL,0";
 			}
-		$out.="},\n";
+		$out.=")\n";
 		push(@out,$out);
 		}
 	}
@@ -148,13 +148,13 @@
 @a=grep(defined($sn{$nid{$_}}),0 .. $n);
 foreach (sort { $sn{$nid{$a}} cmp $sn{$nid{$b}} } @a)
 	{
-	push(@sn,sprintf("%2d,\t/* \"$sn{$nid{$_}}\" */\n",$_));
+	push(@sn,sprintf("CONST_ENTRY(%2d)\t/* \"$sn{$nid{$_}}\" */\n",$_));
 	}
 
 @a=grep(defined($ln{$nid{$_}}),0 .. $n);
 foreach (sort { $ln{$nid{$a}} cmp $ln{$nid{$b}} } @a)
 	{
-	push(@ln,sprintf("%2d,\t/* \"$ln{$nid{$_}}\" */\n",$_));
+	push(@ln,sprintf("CONST_ENTRY(%2d)\t/* \"$ln{$nid{$_}}\" */\n",$_));
 	}
 
 @a=grep(defined($obj{$nid{$_}}),0 .. $n);
@@ -164,12 +164,15 @@
 	$v=$objd{$m};
 	$v =~ s/L//g;
 	$v =~ s/,/ /g;
-	push(@ob,sprintf("%2d,\t/* %-32s %s */\n",$_,$m,$v));
+	push(@ob,sprintf("CONST_ENTRY(%2d)\t/* %-32s %s */\n",$_,$m,$v));
 	}
 
 print OUT <<'EOF';
 /* crypto/objects/obj_dat.h */
 
+/* !!NOTE!!NOTE!! MAKE NO DIRECT CHANGES IN THIS FILE.
+ * IT IS GENERATED; **ALL** CHANGES WILL BE LOST */
+
 /* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
  * following command:
  * perl obj_dat.pl obj_mac.h obj_dat.h
@@ -232,6 +235,34 @@
  * [including the GNU Public Licence.]
  */
 
+#include "modules/libopeay/libopeay_arrays.h"
+#include "modules/libopeay/libopeay_implmodule.h"
+
+#define CONST_ENTRY_NID(_sn, _ln, _nid, len, _dat, _flg) \
+	CONST_ENTRY_START(sn, _sn)\
+	CONST_ENTRY_SINGLE(ln, _ln)\
+	CONST_ENTRY_SINGLE(nid, _nid)\
+	CONST_ENTRY_SINGLE(length, len)\
+	CONST_ENTRY_SINGLE(data, _dat)\
+	CONST_ENTRY_SINGLE(flags, _flg)\
+	CONST_ENTRY_END
+
+#ifndef ADS12
+#define LVALUES_START static const unsigned char lvalues[]={
+#define I(x) x,
+#define LVALUES_END };
+#else
+#define LVALUES_START OPENSSL_PREFIX_CONST_ARRAY(static, unsigned char, lvalues, libopeay)
+#define I(x) CONST_ENTRY(x)
+#define LVALUES_END CONST_END(lvalues)
+#define NEED_LVALUES_OVERRIDE
+#endif
+
+/* These arrays become too big for some compilers, e.g MSDev 6. In any case their size is under control */
+#undef TEST_CONST_ARRAY_SIZE
+#define TEST_CONST_ARRAY_SIZE ((void)0)
+
+
 EOF
 
 printf OUT "#define NUM_NID %d\n",$n;
@@ -239,20 +270,28 @@
 printf OUT "#define NUM_LN %d\n",$#ln+1;
 printf OUT "#define NUM_OBJ %d\n\n",$#ob+1;
 
-printf OUT "static const unsigned char lvalues[%d]={\n",$lvalues+1;
+print OUT "LVALUES_START\n";
 print OUT @lvalues;
-print OUT "};\n\n";
+print OUT <<'EOF';
+LVALUES_END
 
-printf OUT "static const ASN1_OBJECT nid_objs[NUM_NID]={\n";
+#ifdef NEED_LVALUES_OVERRIDE
+// Some compilers (e.g. ADS) expands macros differently from most other compilers, so this have to be declared down here
+#define lvalues OPENSSL_GLOBAL_ARRAY_NAME(lvalues)
+#endif
+
+EOF
+
+printf OUT "OPENSSL_PREFIX_CONST_ARRAY(static, ASN1_OBJECT, nid_objs, libopeay)\n";
 foreach (@out)
 	{
-	if (length($_) > 75)
+	if (length($_) >=90)
 		{
 		$out="";
 		foreach (split(/,/))
 			{
 			$t=$out.$_.",";
-			if (length($t) > 70)
+			if (length($t) > 85)
 				{
 				print OUT "$out\n";
 				$t="\t$_,";
@@ -265,19 +304,37 @@
 	else
 		{ print OUT $_; }
 	}
-print  OUT "};\n\n";
 
-printf OUT "static const unsigned int sn_objs[NUM_SN]={\n";
+print OUT <<'EOF';
+CONST_END(nid_objs);
+
+#define nid_objs OPENSSL_GLOBAL_ARRAY_NAME(nid_objs)
+
+EOF
+
+printf OUT "#ifndef OPERA_SMALL_VERSION\n";
+printf OUT "OPENSSL_PREFIX_CONST_ARRAY(static, unsigned int, sn_objs, libopeay)\n";
 print  OUT @sn;
-print  OUT "};\n\n";
+print  OUT "CONST_END(sn_objs)\n\n";
+printf OUT "#endif // !OPERA_SMALL_VERSION\n\n";
 
-printf OUT "static const unsigned int ln_objs[NUM_LN]={\n";
+printf OUT "#ifndef OPERA_SMALL_VERSION\n";
+printf OUT "OPENSSL_PREFIX_CONST_ARRAY(static, unsigned int, ln_objs, libopeay)\n";
 print  OUT @ln;
-print  OUT "};\n\n";
+print  OUT "CONST_END(ln_objs)\n";
+printf OUT "#endif // !OPERA_SMALL_VERSION\n\n";
 
-printf OUT "static const unsigned int obj_objs[NUM_OBJ]={\n";
+printf OUT "OPENSSL_PREFIX_CONST_ARRAY(static, unsigned int, obj_objs, libopeay)\n";
 print  OUT @ob;
-print  OUT "};\n\n";
+print  OUT "CONST_END(obj_objs)\n\n";
+
+print OUT <<'EOF';
+
+#define sn_objs OPENSSL_GLOBAL_ARRAY_NAME(sn_objs)
+#define ln_objs OPENSSL_GLOBAL_ARRAY_NAME(ln_objs)
+#define obj_objs OPENSSL_GLOBAL_ARRAY_NAME(obj_objs)
+
+EOF
 
 close OUT;
 
diff -Naur openssl-1.0.0q.orig/crypto/objects/obj_err.c openssl-1.0.0q/crypto/objects/obj_err.c
--- openssl-1.0.0q.orig/crypto/objects/obj_err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/obj_err.c	2017-04-25 16:23:40.529620940 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/objects.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/objects/obj_lib.c openssl-1.0.0q/crypto/objects/obj_lib.c
--- openssl-1.0.0q.orig/crypto/objects/obj_lib.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/obj_lib.c	2017-04-25 16:23:40.530620509 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
@@ -80,11 +82,11 @@
 		OBJerr(OBJ_F_OBJ_DUP,ERR_R_ASN1_LIB);
 		return(NULL);
 		}
-	data=OPENSSL_malloc(o->length);
+	data= (unsigned char *) OPENSSL_malloc(o->length);
 	if (data == NULL)
 		goto err;
 	if (o->data != NULL)
-		memcpy(data,o->data,o->length);
+		op_memcpy(data,o->data,o->length);
 	/* once data attached to object it remains const */
 	r->data = data;
 	r->length=o->length;
@@ -92,19 +94,19 @@
 	r->ln=r->sn=NULL;
 	if (o->ln != NULL)
 		{
-		i=strlen(o->ln)+1;
-		ln=OPENSSL_malloc(i);
+		i=op_strlen(o->ln)+1;
+		ln= (char *) OPENSSL_malloc(i);
 		if (ln == NULL) goto err;
-		memcpy(ln,o->ln,i);
+		op_memcpy(ln,o->ln,i);
 		r->ln=ln;
 		}
 
 	if (o->sn != NULL)
 		{
-		i=strlen(o->sn)+1;
-		sn=OPENSSL_malloc(i);
+		i=op_strlen(o->sn)+1;
+		sn= (char *) OPENSSL_malloc(i);
 		if (sn == NULL) goto err;
-		memcpy(sn,o->sn,i);
+		op_memcpy(sn,o->sn,i);
 		r->sn=sn;
 		}
 	r->flags=o->flags|(ASN1_OBJECT_FLAG_DYNAMIC|
@@ -125,5 +127,5 @@
 
 	ret=(a->length-b->length);
 	if (ret) return(ret);
-	return(memcmp(a->data,b->data,a->length));
+	return(op_memcmp(a->data,b->data,a->length));
 	}
diff -Naur openssl-1.0.0q.orig/crypto/objects/obj_xref.c openssl-1.0.0q/crypto/objects/obj_xref.c
--- openssl-1.0.0q.orig/crypto/objects/obj_xref.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/obj_xref.c	2017-04-25 16:23:40.531620077 +0200
@@ -58,6 +58,8 @@
 
 #include <openssl/objects.h>
 #include "obj_xref.h"
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 DECLARE_STACK_OF(nid_triple)
 STACK_OF(nid_triple) *sig_app, *sigx_app;
@@ -105,7 +107,7 @@
 	if (rv == NULL)
 		{
 		rv = OBJ_bsearch_sig(&tmp, sigoid_srt,
-				 sizeof(sigoid_srt) / sizeof(nid_triple));
+				OPENSSL_CONST_ARRAY_SIZE(obj_xref__sigoid_srt));
 		}
 #endif
 	if (rv == NULL)
@@ -138,7 +140,7 @@
 	if (rv == NULL)
 		{
 		rv = OBJ_bsearch_sigx(&t, sigoid_srt_xref,
-				 sizeof(sigoid_srt_xref) / sizeof(nid_triple *)
+				OPENSSL_CONST_ARRAY_SIZE(obj_xref__sigoid_srt_xref)
 				 );
 		}
 #endif
@@ -159,7 +161,7 @@
 		sigx_app = sk_nid_triple_new(sigx_cmp);
 	if (!sigx_app)
 		return 0;
-	ntr = OPENSSL_malloc(sizeof(int) * 3);
+	ntr = (nid_triple *)OPENSSL_malloc(sizeof(int) * 3);
 	if (!ntr)
 		return 0;
 	ntr->sign_id = signid;
@@ -208,14 +210,14 @@
 
 	int i, rv;
 #ifdef OBJ_XREF_TEST2
-	for (i = 0; i <	sizeof(sigoid_srt) / sizeof(nid_triple); i++)
+	for (i = 0; i <	OPENSSL_CONST_ARRAY_SIZE(obj_xref__sigoid_srt); i++)
 		{
 		OBJ_add_sigid(sigoid_srt[i][0], sigoid_srt[i][1],
 				sigoid_srt[i][2]);
 		}
 #endif
 
-	for (i = 0; i <	sizeof(sigoid_srt) / sizeof(nid_triple); i++)
+	for (i = 0; i <	OPENSSL_CONST_ARRAY_SIZE(obj_xref__sigoid_srt); i++)
 		{
 		n1 = sigoid_srt[i][0];
 		rv = OBJ_find_sigid_algs(n1, &n2, &n3);
diff -Naur openssl-1.0.0q.orig/crypto/objects/obj_xref.h openssl-1.0.0q/crypto/objects/obj_xref.h
--- openssl-1.0.0q.orig/crypto/objects/obj_xref.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/obj_xref.h	2017-04-25 16:23:40.532620763 +0200
@@ -1,73 +1,78 @@
 /* AUTOGENERATED BY crypto/objects/objxref.pl, DO NOT EDIT */
 
-typedef struct
+#include "modules/libopeay/libopeay_arrays.h"
+
+
+typedef struct nid_triple_st
 	{
 	int sign_id;
 	int hash_id;
 	int pkey_id;
 	} nid_triple;
 
-static const nid_triple sigoid_srt[] =
-	{
-	{NID_md2WithRSAEncryption, NID_md2, NID_rsaEncryption},
-	{NID_md5WithRSAEncryption, NID_md5, NID_rsaEncryption},
-	{NID_shaWithRSAEncryption, NID_sha, NID_rsaEncryption},
-	{NID_sha1WithRSAEncryption, NID_sha1, NID_rsaEncryption},
-	{NID_dsaWithSHA, NID_sha, NID_dsa},
-	{NID_dsaWithSHA1_2, NID_sha1, NID_dsa_2},
-	{NID_mdc2WithRSA, NID_mdc2, NID_rsaEncryption},
-	{NID_md5WithRSA, NID_md5, NID_rsa},
-	{NID_dsaWithSHA1, NID_sha1, NID_dsa},
-	{NID_sha1WithRSA, NID_sha1, NID_rsa},
-	{NID_ripemd160WithRSA, NID_ripemd160, NID_rsaEncryption},
-	{NID_md4WithRSAEncryption, NID_md4, NID_rsaEncryption},
-	{NID_ecdsa_with_SHA1, NID_sha1, NID_X9_62_id_ecPublicKey},
-	{NID_sha256WithRSAEncryption, NID_sha256, NID_rsaEncryption},
-	{NID_sha384WithRSAEncryption, NID_sha384, NID_rsaEncryption},
-	{NID_sha512WithRSAEncryption, NID_sha512, NID_rsaEncryption},
-	{NID_sha224WithRSAEncryption, NID_sha224, NID_rsaEncryption},
-	{NID_ecdsa_with_Recommended, NID_undef, NID_X9_62_id_ecPublicKey},
-	{NID_ecdsa_with_Specified, NID_undef, NID_X9_62_id_ecPublicKey},
-	{NID_ecdsa_with_SHA224, NID_sha224, NID_X9_62_id_ecPublicKey},
-	{NID_ecdsa_with_SHA256, NID_sha256, NID_X9_62_id_ecPublicKey},
-	{NID_ecdsa_with_SHA384, NID_sha384, NID_X9_62_id_ecPublicKey},
-	{NID_ecdsa_with_SHA512, NID_sha512, NID_X9_62_id_ecPublicKey},
-	{NID_dsa_with_SHA224, NID_sha224, NID_dsa},
-	{NID_dsa_with_SHA256, NID_sha256, NID_dsa},
-	{NID_id_GostR3411_94_with_GostR3410_2001, NID_id_GostR3411_94, NID_id_GostR3410_2001},
-	{NID_id_GostR3411_94_with_GostR3410_94, NID_id_GostR3411_94, NID_id_GostR3410_94},
-	{NID_id_GostR3411_94_with_GostR3410_94_cc, NID_id_GostR3411_94, NID_id_GostR3410_94_cc},
-	{NID_id_GostR3411_94_with_GostR3410_2001_cc, NID_id_GostR3411_94, NID_id_GostR3410_2001_cc},
-	};
+OPENSSL_PREFIX_CONST_ARRAY(extern, struct nid_triple_st, obj_xref__sigoid_srt, libopeay)
+	CONST_TRIPLE_ENTRY(sign_id,NID_md2WithRSAEncryption, hash_id,NID_md2, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_md5WithRSAEncryption, hash_id,NID_md5, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_shaWithRSAEncryption, hash_id,NID_sha, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_sha1WithRSAEncryption, hash_id,NID_sha1, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_dsaWithSHA, hash_id,NID_sha, pkey_id,NID_dsa)
+	CONST_TRIPLE_ENTRY(sign_id,NID_dsaWithSHA1_2, hash_id,NID_sha1, pkey_id,NID_dsa_2)
+	CONST_TRIPLE_ENTRY(sign_id,NID_mdc2WithRSA, hash_id,NID_mdc2, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_md5WithRSA, hash_id,NID_md5, pkey_id,NID_rsa)
+	CONST_TRIPLE_ENTRY(sign_id,NID_dsaWithSHA1, hash_id,NID_sha1, pkey_id,NID_dsa)
+	CONST_TRIPLE_ENTRY(sign_id,NID_sha1WithRSA, hash_id,NID_sha1, pkey_id,NID_rsa)
+	CONST_TRIPLE_ENTRY(sign_id,NID_ripemd160WithRSA, hash_id,NID_ripemd160, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_md4WithRSAEncryption, hash_id,NID_md4, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_ecdsa_with_SHA1, hash_id,NID_sha1, pkey_id,NID_X9_62_id_ecPublicKey)
+	CONST_TRIPLE_ENTRY(sign_id,NID_sha256WithRSAEncryption, hash_id,NID_sha256, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_sha384WithRSAEncryption, hash_id,NID_sha384, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_sha512WithRSAEncryption, hash_id,NID_sha512, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_sha224WithRSAEncryption, hash_id,NID_sha224, pkey_id,NID_rsaEncryption)
+	CONST_TRIPLE_ENTRY(sign_id,NID_ecdsa_with_Recommended, hash_id,NID_undef, pkey_id,NID_X9_62_id_ecPublicKey)
+	CONST_TRIPLE_ENTRY(sign_id,NID_ecdsa_with_Specified, hash_id,NID_undef, pkey_id,NID_X9_62_id_ecPublicKey)
+	CONST_TRIPLE_ENTRY(sign_id,NID_ecdsa_with_SHA224, hash_id,NID_sha224, pkey_id,NID_X9_62_id_ecPublicKey)
+	CONST_TRIPLE_ENTRY(sign_id,NID_ecdsa_with_SHA256, hash_id,NID_sha256, pkey_id,NID_X9_62_id_ecPublicKey)
+	CONST_TRIPLE_ENTRY(sign_id,NID_ecdsa_with_SHA384, hash_id,NID_sha384, pkey_id,NID_X9_62_id_ecPublicKey)
+	CONST_TRIPLE_ENTRY(sign_id,NID_ecdsa_with_SHA512, hash_id,NID_sha512, pkey_id,NID_X9_62_id_ecPublicKey)
+	CONST_TRIPLE_ENTRY(sign_id,NID_dsa_with_SHA224, hash_id,NID_sha224, pkey_id,NID_dsa)
+	CONST_TRIPLE_ENTRY(sign_id,NID_dsa_with_SHA256, hash_id,NID_sha256, pkey_id,NID_dsa)
+	CONST_TRIPLE_ENTRY(sign_id,NID_id_GostR3411_94_with_GostR3410_2001, hash_id,NID_id_GostR3411_94, pkey_id,NID_id_GostR3410_2001)
+	CONST_TRIPLE_ENTRY(sign_id,NID_id_GostR3411_94_with_GostR3410_94, hash_id,NID_id_GostR3411_94, pkey_id,NID_id_GostR3410_94)
+	CONST_TRIPLE_ENTRY(sign_id,NID_id_GostR3411_94_with_GostR3410_94_cc, hash_id,NID_id_GostR3411_94, pkey_id,NID_id_GostR3410_94_cc)
+	CONST_TRIPLE_ENTRY(sign_id,NID_id_GostR3411_94_with_GostR3410_2001_cc, hash_id,NID_id_GostR3411_94, pkey_id,NID_id_GostR3410_2001_cc)
+CONST_END(obj_xref__sigoid_srt)
+#define sigoid_srt OPENSSL_GLOBAL_ARRAY_NAME(obj_xref__sigoid_srt)
 
-static const nid_triple * const sigoid_srt_xref[] =
-	{
-	&sigoid_srt[0],
-	&sigoid_srt[1],
-	&sigoid_srt[7],
-	&sigoid_srt[2],
-	&sigoid_srt[4],
-	&sigoid_srt[3],
-	&sigoid_srt[9],
-	&sigoid_srt[5],
-	&sigoid_srt[8],
-	&sigoid_srt[12],
-	&sigoid_srt[6],
-	&sigoid_srt[10],
-	&sigoid_srt[11],
-	&sigoid_srt[13],
-	&sigoid_srt[24],
-	&sigoid_srt[20],
-	&sigoid_srt[14],
-	&sigoid_srt[21],
-	&sigoid_srt[15],
-	&sigoid_srt[22],
-	&sigoid_srt[16],
-	&sigoid_srt[23],
-	&sigoid_srt[19],
-	&sigoid_srt[25],
-	&sigoid_srt[26],
-	&sigoid_srt[27],
-	&sigoid_srt[28],
-	};
+OPENSSL_PREFIX_CONST_ARRAY(static, const struct nid_triple_st*, obj_xref__sigoid_srt_xref, libopeay)
+	CONST_ENTRY(&sigoid_srt[17])
+	CONST_ENTRY(&sigoid_srt[18])
+	CONST_ENTRY(&sigoid_srt[0])
+	CONST_ENTRY(&sigoid_srt[1])
+	CONST_ENTRY(&sigoid_srt[7])
+	CONST_ENTRY(&sigoid_srt[2])
+	CONST_ENTRY(&sigoid_srt[4])
+	CONST_ENTRY(&sigoid_srt[3])
+	CONST_ENTRY(&sigoid_srt[9])
+	CONST_ENTRY(&sigoid_srt[5])
+	CONST_ENTRY(&sigoid_srt[8])
+	CONST_ENTRY(&sigoid_srt[12])
+	CONST_ENTRY(&sigoid_srt[6])
+	CONST_ENTRY(&sigoid_srt[10])
+	CONST_ENTRY(&sigoid_srt[11])
+	CONST_ENTRY(&sigoid_srt[13])
+	CONST_ENTRY(&sigoid_srt[24])
+	CONST_ENTRY(&sigoid_srt[20])
+	CONST_ENTRY(&sigoid_srt[14])
+	CONST_ENTRY(&sigoid_srt[21])
+	CONST_ENTRY(&sigoid_srt[15])
+	CONST_ENTRY(&sigoid_srt[22])
+	CONST_ENTRY(&sigoid_srt[16])
+	CONST_ENTRY(&sigoid_srt[23])
+	CONST_ENTRY(&sigoid_srt[19])
+	CONST_ENTRY(&sigoid_srt[25])
+	CONST_ENTRY(&sigoid_srt[26])
+	CONST_ENTRY(&sigoid_srt[27])
+	CONST_ENTRY(&sigoid_srt[28])
+CONST_END(obj_xref__sigoid_srt_xref)
+#define sigoid_srt_xref OPENSSL_GLOBAL_ARRAY_NAME(obj_xref__sigoid_srt_xref)
 
diff -Naur openssl-1.0.0q.orig/crypto/objects/objects.h openssl-1.0.0q/crypto/objects/objects.h
--- openssl-1.0.0q.orig/crypto/objects/objects.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/objects.h	2017-04-25 16:23:40.533620890 +0200
@@ -1058,8 +1058,8 @@
 #define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm)	\
   static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_)	\
       { \
-      type1 const *a = a_; \
-      type2 const *b = b_; \
+      type1 const *a = (type1 const *) a_; \
+      type2 const *b = (type2 const *) b_; \
       return nm##_cmp(a,b); \
       } \
   static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
@@ -1072,8 +1072,8 @@
 #define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm)	\
   static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_)	\
       { \
-      type1 const *a = a_; \
-      type2 const *b = b_; \
+      type1 const *a = (type1 const *)a_; \
+      type2 const *b = (type2 const *)b_; \
       return nm##_cmp(a,b); \
       } \
   type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
diff -Naur openssl-1.0.0q.orig/crypto/objects/objxref.pl openssl-1.0.0q/crypto/objects/objxref.pl
--- openssl-1.0.0q.orig/crypto/objects/objxref.pl	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/objxref.pl	2017-04-25 16:23:40.534621296 +0200
@@ -62,14 +62,17 @@
 print <<EOF;
 /* AUTOGENERATED BY $pname, DO NOT EDIT */
 
-typedef struct
+#include "modules/libopeay/libopeay_arrays.h"
+
+
+typedef struct nid_triple_st
 	{
 	int sign_id;
 	int hash_id;
 	int pkey_id;
 	} nid_triple;
 
-static const nid_triple sigoid_srt[] =
+OPENSSL_PREFIX_CONST_ARRAY(extern, struct nid_triple_st, obj_xref__sigoid_srt, libopeay)
 	{
 EOF
 
@@ -77,15 +80,17 @@
 	{
 	my $xr = $_;
 	my ($p1, $p2) = @{$xref_tbl{$_}};
-	print "\t{NID_$xr, NID_$p1, NID_$p2},\n";
+	#print "\t{NID_$xr, NID_$p1, NID_$p2},\n";
+	print "\tCONST_TRIPLE_ENTRY(sign_id,NID_$xr, hash_id,NID_$p1, pkey_id,NID_$p2)\n";
 	}
 
 print "\t};";
 print <<EOF;
+CONST_END(obj_xref__sigoid_srt)
+#define sigoid_srt OPENSSL_GLOBAL_ARRAY_NAME(obj_xref__sigoid_srt)
 
 
-static const nid_triple * const sigoid_srt_xref[] =
-	{
+OPENSSL_PREFIX_CONST_ARRAY(static, const struct nid_triple_st*, obj_xref__sigoid_srt_xref, libopeay)
 EOF
 
 foreach (@srt2)
@@ -94,10 +99,14 @@
 	# If digest or signature algorithm is "undef" then the algorithm
 	# needs special handling and is excluded from the cross reference table.
 	next if $p1 eq "undef" || $p2 eq "undef";
-	print "\t\&sigoid_srt\[$x\],\n";
+	#print "\t\&sigoid_srt\[$x\],\n";
+	print "\tCONST_ENTRY(\&sigoid_srt\[$x\])\n";
 	}
 
-print "\t};\n\n";
+print <<EOF;
+CONST_END(obj_xref__sigoid_srt_xref)
+#define sigoid_srt_xref OPENSSL_GLOBAL_ARRAY_NAME(obj_xref__sigoid_srt_xref)
+EOF
 
 sub check_oid
 	{
diff -Naur openssl-1.0.0q.orig/crypto/objects/opera_o_names.cpp openssl-1.0.0q/crypto/objects/opera_o_names.cpp
--- openssl-1.0.0q.orig/crypto/objects/opera_o_names.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/opera_o_names.cpp	2017-04-25 16:23:40.535621423 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/objects/o_names.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/objects/opera_obj_dat.cpp openssl-1.0.0q/crypto/objects/opera_obj_dat.cpp
--- openssl-1.0.0q.orig/crypto/objects/opera_obj_dat.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/opera_obj_dat.cpp	2017-04-25 16:23:40.535621423 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/objects/obj_dat.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/objects/opera_obj_lib.cpp openssl-1.0.0q/crypto/objects/opera_obj_lib.cpp
--- openssl-1.0.0q.orig/crypto/objects/opera_obj_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/opera_obj_lib.cpp	2017-04-25 16:23:40.536619874 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/objects/obj_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/objects/opera_obj_xref.cpp openssl-1.0.0q/crypto/objects/opera_obj_xref.cpp
--- openssl-1.0.0q.orig/crypto/objects/opera_obj_xref.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/objects/opera_obj_xref.cpp	2017-04-25 16:23:40.536619874 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/objects/obj_xref.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/.gitignore openssl-1.0.0q/crypto/ocsp/.gitignore
--- openssl-1.0.0q.orig/crypto/ocsp/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/.gitignore	2017-04-25 16:23:40.537619722 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/ocsp.h openssl-1.0.0q/crypto/ocsp/ocsp.h
--- openssl-1.0.0q.orig/crypto/ocsp/ocsp.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/ocsp.h	2017-04-25 16:23:40.538620967 +0200
@@ -64,6 +64,11 @@
 #ifndef HEADER_OCSP_H
 #define HEADER_OCSP_H
 
+#ifdef OPENSSL_SYS_WIN32
+#undef OCSP_REQUEST
+#undef OCSP_RESPONSE
+#endif
+
 #include <openssl/ossl_typ.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/ocsp_asn.c openssl-1.0.0q/crypto/ocsp/ocsp_asn.c
--- openssl-1.0.0q.orig/crypto/ocsp/ocsp_asn.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/ocsp_asn.c	2017-04-25 16:23:40.539620535 +0200
@@ -55,128 +55,152 @@
  * Hudson (tjh@cryptsoft.com).
  *
  */
+
+
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/ocsp.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-ASN1_SEQUENCE(OCSP_SIGNATURE) = {
-	ASN1_SIMPLE(OCSP_SIGNATURE, signatureAlgorithm, X509_ALGOR),
-	ASN1_SIMPLE(OCSP_SIGNATURE, signature, ASN1_BIT_STRING),
+#ifndef OPENSSL_NO_OCSP
+
+ASN1_SEQUENCE(OCSP_SIGNATURE) 
+	ASN1_SIMPLE(OCSP_SIGNATURE, signatureAlgorithm, X509_ALGOR)
+	ASN1_SIMPLE(OCSP_SIGNATURE, signature, ASN1_BIT_STRING)
 	ASN1_EXP_SEQUENCE_OF_OPT(OCSP_SIGNATURE, certs, X509, 0)
-} ASN1_SEQUENCE_END(OCSP_SIGNATURE)
+ASN1_SEQUENCE_END(OCSP_SIGNATURE)
 
-IMPLEMENT_ASN1_FUNCTIONS(OCSP_SIGNATURE)
+IMPLEMENT_ASN1_FUNCTIONS31(OCSP_SIGNATURE)
 
-ASN1_SEQUENCE(OCSP_CERTID) = {
-	ASN1_SIMPLE(OCSP_CERTID, hashAlgorithm, X509_ALGOR),
-	ASN1_SIMPLE(OCSP_CERTID, issuerNameHash, ASN1_OCTET_STRING),
-	ASN1_SIMPLE(OCSP_CERTID, issuerKeyHash, ASN1_OCTET_STRING),
+ASN1_SEQUENCE(OCSP_CERTID) 
+	ASN1_SIMPLE(OCSP_CERTID, hashAlgorithm, X509_ALGOR)
+	ASN1_SIMPLE(OCSP_CERTID, issuerNameHash, ASN1_OCTET_STRING)
+	ASN1_SIMPLE(OCSP_CERTID, issuerKeyHash, ASN1_OCTET_STRING)
 	ASN1_SIMPLE(OCSP_CERTID, serialNumber, ASN1_INTEGER)
-} ASN1_SEQUENCE_END(OCSP_CERTID)
+ASN1_SEQUENCE_END(OCSP_CERTID)
 
-IMPLEMENT_ASN1_FUNCTIONS(OCSP_CERTID)
+IMPLEMENT_ASN1_FUNCTIONS3(OCSP_CERTID)
 
-ASN1_SEQUENCE(OCSP_ONEREQ) = {
-	ASN1_SIMPLE(OCSP_ONEREQ, reqCert, OCSP_CERTID),
+ASN1_SEQUENCE(OCSP_ONEREQ) 
+	ASN1_SIMPLE(OCSP_ONEREQ, reqCert, OCSP_CERTID)
 	ASN1_EXP_SEQUENCE_OF_OPT(OCSP_ONEREQ, singleRequestExtensions, X509_EXTENSION, 0)
-} ASN1_SEQUENCE_END(OCSP_ONEREQ)
+ASN1_SEQUENCE_END(OCSP_ONEREQ)
 
-IMPLEMENT_ASN1_FUNCTIONS(OCSP_ONEREQ)
+IMPLEMENT_ASN1_FUNCTIONS3(OCSP_ONEREQ)
 
-ASN1_SEQUENCE(OCSP_REQINFO) = {
-	ASN1_EXP_OPT(OCSP_REQINFO, version, ASN1_INTEGER, 0),
-	ASN1_EXP_OPT(OCSP_REQINFO, requestorName, GENERAL_NAME, 1),
-	ASN1_SEQUENCE_OF(OCSP_REQINFO, requestList, OCSP_ONEREQ),
+ASN1_SEQUENCE(OCSP_REQINFO) 
+	ASN1_EXP_OPT(OCSP_REQINFO, version, ASN1_INTEGER, 0)
+	ASN1_EXP_OPT(OCSP_REQINFO, requestorName, GENERAL_NAME, 1)
+	ASN1_SEQUENCE_OF(OCSP_REQINFO, requestList, OCSP_ONEREQ)
 	ASN1_EXP_SEQUENCE_OF_OPT(OCSP_REQINFO, requestExtensions, X509_EXTENSION, 2)
-} ASN1_SEQUENCE_END(OCSP_REQINFO)
+ASN1_SEQUENCE_END(OCSP_REQINFO)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(OCSP_REQINFO)
+#endif
 
-ASN1_SEQUENCE(OCSP_REQUEST) = {
-	ASN1_SIMPLE(OCSP_REQUEST, tbsRequest, OCSP_REQINFO),
+ASN1_SEQUENCE(OCSP_REQUEST) 
+	ASN1_SIMPLE(OCSP_REQUEST, tbsRequest, OCSP_REQINFO)
 	ASN1_EXP_OPT(OCSP_REQUEST, optionalSignature, OCSP_SIGNATURE, 0)
-} ASN1_SEQUENCE_END(OCSP_REQUEST)
+ASN1_SEQUENCE_END(OCSP_REQUEST)
 
-IMPLEMENT_ASN1_FUNCTIONS(OCSP_REQUEST)
+IMPLEMENT_ASN1_FUNCTIONS1(OCSP_REQUEST)
 
 /* OCSP_RESPONSE templates */
 
-ASN1_SEQUENCE(OCSP_RESPBYTES) = {
-	    ASN1_SIMPLE(OCSP_RESPBYTES, responseType, ASN1_OBJECT),
+ASN1_SEQUENCE(OCSP_RESPBYTES) 
+	    ASN1_SIMPLE(OCSP_RESPBYTES, responseType, ASN1_OBJECT)
 	    ASN1_SIMPLE(OCSP_RESPBYTES, response, ASN1_OCTET_STRING)
-} ASN1_SEQUENCE_END(OCSP_RESPBYTES)
+ASN1_SEQUENCE_END(OCSP_RESPBYTES)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(OCSP_RESPBYTES)
+#endif
 
-ASN1_SEQUENCE(OCSP_RESPONSE) = {
-	ASN1_SIMPLE(OCSP_RESPONSE, responseStatus, ASN1_ENUMERATED),
+ASN1_SEQUENCE(OCSP_RESPONSE) 
+	ASN1_SIMPLE(OCSP_RESPONSE, responseStatus, ASN1_ENUMERATED)
 	ASN1_EXP_OPT(OCSP_RESPONSE, responseBytes, OCSP_RESPBYTES, 0)
-} ASN1_SEQUENCE_END(OCSP_RESPONSE)
+ASN1_SEQUENCE_END(OCSP_RESPONSE)
 
-IMPLEMENT_ASN1_FUNCTIONS(OCSP_RESPONSE)
+IMPLEMENT_ASN1_FUNCTIONS2(OCSP_RESPONSE)
 
-ASN1_CHOICE(OCSP_RESPID) = {
-	   ASN1_EXP(OCSP_RESPID, value.byName, X509_NAME, 1),
+ASN1_CHOICE(OCSP_RESPID)
+	   ASN1_EXP(OCSP_RESPID, value.byName, X509_NAME, 1)
 	   ASN1_EXP(OCSP_RESPID, value.byKey, ASN1_OCTET_STRING, 2)
-} ASN1_CHOICE_END(OCSP_RESPID)
+ASN1_CHOICE_END(OCSP_RESPID)
 
 IMPLEMENT_ASN1_FUNCTIONS(OCSP_RESPID)
 
-ASN1_SEQUENCE(OCSP_REVOKEDINFO) = {
-	ASN1_SIMPLE(OCSP_REVOKEDINFO, revocationTime, ASN1_GENERALIZEDTIME),
+ASN1_SEQUENCE(OCSP_REVOKEDINFO)
+	ASN1_SIMPLE(OCSP_REVOKEDINFO, revocationTime, ASN1_GENERALIZEDTIME)
   	ASN1_EXP_OPT(OCSP_REVOKEDINFO, revocationReason, ASN1_ENUMERATED, 0)
-} ASN1_SEQUENCE_END(OCSP_REVOKEDINFO)
+ASN1_SEQUENCE_END(OCSP_REVOKEDINFO)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
+#endif
 
-ASN1_CHOICE(OCSP_CERTSTATUS) = {
-	ASN1_IMP(OCSP_CERTSTATUS, value.good, ASN1_NULL, 0),
-	ASN1_IMP(OCSP_CERTSTATUS, value.revoked, OCSP_REVOKEDINFO, 1),
+ASN1_CHOICE(OCSP_CERTSTATUS)
+	ASN1_IMP(OCSP_CERTSTATUS, value.good, ASN1_NULL, 0)
+	ASN1_IMP(OCSP_CERTSTATUS, value.revoked, OCSP_REVOKEDINFO, 1)
 	ASN1_IMP(OCSP_CERTSTATUS, value.unknown, ASN1_NULL, 2)
-} ASN1_CHOICE_END(OCSP_CERTSTATUS)
+ASN1_CHOICE_END(OCSP_CERTSTATUS)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
+#endif
 
-ASN1_SEQUENCE(OCSP_SINGLERESP) = {
-	   ASN1_SIMPLE(OCSP_SINGLERESP, certId, OCSP_CERTID),
-	   ASN1_SIMPLE(OCSP_SINGLERESP, certStatus, OCSP_CERTSTATUS),
-	   ASN1_SIMPLE(OCSP_SINGLERESP, thisUpdate, ASN1_GENERALIZEDTIME),
-	   ASN1_EXP_OPT(OCSP_SINGLERESP, nextUpdate, ASN1_GENERALIZEDTIME, 0),
+ASN1_SEQUENCE(OCSP_SINGLERESP) 
+	   ASN1_SIMPLE(OCSP_SINGLERESP, certId, OCSP_CERTID)
+	   ASN1_SIMPLE(OCSP_SINGLERESP, certStatus, OCSP_CERTSTATUS)
+	   ASN1_SIMPLE(OCSP_SINGLERESP, thisUpdate, ASN1_GENERALIZEDTIME)
+	   ASN1_EXP_OPT(OCSP_SINGLERESP, nextUpdate, ASN1_GENERALIZEDTIME, 0)
 	   ASN1_EXP_SEQUENCE_OF_OPT(OCSP_SINGLERESP, singleExtensions, X509_EXTENSION, 1)
-} ASN1_SEQUENCE_END(OCSP_SINGLERESP)
+ASN1_SEQUENCE_END(OCSP_SINGLERESP)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(OCSP_SINGLERESP)
+#endif
 
-ASN1_SEQUENCE(OCSP_RESPDATA) = {
-	   ASN1_EXP_OPT(OCSP_RESPDATA, version, ASN1_INTEGER, 0),
-	   ASN1_SIMPLE(OCSP_RESPDATA, responderId, OCSP_RESPID),
-	   ASN1_SIMPLE(OCSP_RESPDATA, producedAt, ASN1_GENERALIZEDTIME),
-	   ASN1_SEQUENCE_OF(OCSP_RESPDATA, responses, OCSP_SINGLERESP),
+ASN1_SEQUENCE(OCSP_RESPDATA) 
+	   ASN1_EXP_OPT(OCSP_RESPDATA, version, ASN1_INTEGER, 0)
+	   ASN1_SIMPLE(OCSP_RESPDATA, responderId, OCSP_RESPID)
+	   ASN1_SIMPLE(OCSP_RESPDATA, producedAt, ASN1_GENERALIZEDTIME)
+	   ASN1_SEQUENCE_OF(OCSP_RESPDATA, responses, OCSP_SINGLERESP)
 	   ASN1_EXP_SEQUENCE_OF_OPT(OCSP_RESPDATA, responseExtensions, X509_EXTENSION, 1)
-} ASN1_SEQUENCE_END(OCSP_RESPDATA)
+ASN1_SEQUENCE_END(OCSP_RESPDATA)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(OCSP_RESPDATA)
+#endif
 
-ASN1_SEQUENCE(OCSP_BASICRESP) = {
-	   ASN1_SIMPLE(OCSP_BASICRESP, tbsResponseData, OCSP_RESPDATA),
-	   ASN1_SIMPLE(OCSP_BASICRESP, signatureAlgorithm, X509_ALGOR),
-	   ASN1_SIMPLE(OCSP_BASICRESP, signature, ASN1_BIT_STRING),
+ASN1_SEQUENCE(OCSP_BASICRESP) 
+	   ASN1_SIMPLE(OCSP_BASICRESP, tbsResponseData, OCSP_RESPDATA)
+	   ASN1_SIMPLE(OCSP_BASICRESP, signatureAlgorithm, X509_ALGOR)
+	   ASN1_SIMPLE(OCSP_BASICRESP, signature, ASN1_BIT_STRING)
 	   ASN1_EXP_SEQUENCE_OF_OPT(OCSP_BASICRESP, certs, X509, 0)
-} ASN1_SEQUENCE_END(OCSP_BASICRESP)
+ASN1_SEQUENCE_END(OCSP_BASICRESP)
 
-IMPLEMENT_ASN1_FUNCTIONS(OCSP_BASICRESP)
+IMPLEMENT_ASN1_FUNCTIONS3(OCSP_BASICRESP)
 
-ASN1_SEQUENCE(OCSP_CRLID) = {
-	   ASN1_EXP_OPT(OCSP_CRLID, crlUrl, ASN1_IA5STRING, 0),
-	   ASN1_EXP_OPT(OCSP_CRLID, crlNum, ASN1_INTEGER, 1),
+ASN1_SEQUENCE(OCSP_CRLID) 
+	   ASN1_EXP_OPT(OCSP_CRLID, crlUrl, ASN1_IA5STRING, 0)
+	   ASN1_EXP_OPT(OCSP_CRLID, crlNum, ASN1_INTEGER, 1)
 	   ASN1_EXP_OPT(OCSP_CRLID, crlTime, ASN1_GENERALIZEDTIME, 2)
-} ASN1_SEQUENCE_END(OCSP_CRLID)
+ASN1_SEQUENCE_END(OCSP_CRLID)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(OCSP_CRLID)
+#endif
 
-ASN1_SEQUENCE(OCSP_SERVICELOC) = {
-	ASN1_SIMPLE(OCSP_SERVICELOC, issuer, X509_NAME),
+ASN1_SEQUENCE(OCSP_SERVICELOC) 
+	ASN1_SIMPLE(OCSP_SERVICELOC, issuer, X509_NAME)
 	ASN1_SEQUENCE_OF_OPT(OCSP_SERVICELOC, locator, ACCESS_DESCRIPTION)
-} ASN1_SEQUENCE_END(OCSP_SERVICELOC)
+ASN1_SEQUENCE_END(OCSP_SERVICELOC)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(OCSP_SERVICELOC)
+#endif
+
+#endif /* OPENSSL_NO_OCSP */
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/ocsp_cl.c openssl-1.0.0q/crypto/ocsp/ocsp_cl.c
--- openssl-1.0.0q.orig/crypto/ocsp/ocsp_cl.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/ocsp_cl.c	2017-04-25 16:23:40.541620789 +0200
@@ -61,15 +61,21 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
-#include <cryptlib.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+
+#ifndef OPENSSL_NO_OCSP
+
 #include <openssl/objects.h>
 #include <openssl/rand.h>
 #include <openssl/x509.h>
 #include <openssl/pem.h>
 #include <openssl/x509v3.h>
 #include <openssl/ocsp.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Utility functions related to sending OCSP requests and extracting
  * relevant information from the response.
@@ -95,6 +101,7 @@
 	return NULL;
         }
 
+#ifndef OPERA_SMALL_VERSION
 /* Set requestorName from an X509_NAME structure */
 
 int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm)
@@ -181,6 +188,7 @@
 	req->optionalSignature = NULL;
 	return 0;
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 /* Get response status */
 
@@ -209,18 +217,20 @@
 		return NULL;
 		}
 
-	return ASN1_item_unpack(rb->response, ASN1_ITEM_rptr(OCSP_BASICRESP));
+	return (OCSP_BASICRESP *) ASN1_item_unpack(rb->response, ASN1_ITEM_rptr(OCSP_BASICRESP));
 	}
 
 /* Return number of OCSP_SINGLERESP reponses present in
  * a basic response.
  */
 
+#ifndef OPERA_SMALL_VERSION
 int OCSP_resp_count(OCSP_BASICRESP *bs)
 	{
 	if (!bs) return -1;
 	return sk_OCSP_SINGLERESP_num(bs->tbsResponseData->responses);
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 /* Extract an OCSP_SINGLERESP response with a given index */
 
@@ -313,7 +323,7 @@
 	{
 	int ret = 1;
 	time_t t_now, t_tmp;
-	time(&t_now);
+	op_time(&t_now);
 	/* Check thisUpdate is valid and not more than nsec in the future */
 	if (!ASN1_GENERALIZEDTIME_check(thisupd))
 		{
@@ -369,3 +379,5 @@
 
 	return ret;
 	}
+
+#endif /* OPENSSL_NO_OCSP */
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/ocsp_err.c openssl-1.0.0q/crypto/ocsp/ocsp_err.c
--- openssl-1.0.0q.orig/crypto/ocsp/ocsp_err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/ocsp_err.c	2017-04-25 16:23:40.542620637 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/ocsp.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/ocsp_ext.c openssl-1.0.0q/crypto/ocsp/ocsp_ext.c
--- openssl-1.0.0q.orig/crypto/ocsp/ocsp_ext.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/ocsp_ext.c	2017-04-25 16:23:40.543621044 +0200
@@ -61,8 +61,13 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include <cryptlib.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+
+#ifndef OPENSSL_NO_OCSP
+
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 #include <openssl/ocsp.h>
@@ -73,16 +78,19 @@
 
 /* OCSP request extensions */
 
+#ifndef OPERA_SMALL_VERSION
 int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x)
 	{
 	return(X509v3_get_ext_count(x->tbsRequest->requestExtensions));
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos)
 	{
 	return(X509v3_get_ext_by_NID(x->tbsRequest->requestExtensions,nid,lastpos));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos)
 	{
 	return(X509v3_get_ext_by_OBJ(x->tbsRequest->requestExtensions,obj,lastpos));
@@ -92,12 +100,14 @@
 	{
 	return(X509v3_get_ext_by_critical(x->tbsRequest->requestExtensions,crit,lastpos));
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc)
 	{
 	return(X509v3_get_ext(x->tbsRequest->requestExtensions,loc));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc)
 	{
 	return(X509v3_delete_ext(x->tbsRequest->requestExtensions,loc));
@@ -173,12 +183,14 @@
 	{
 	return(X509v3_get_ext_count(x->tbsResponseData->responseExtensions));
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos)
 	{
 	return(X509v3_get_ext_by_NID(x->tbsResponseData->responseExtensions,nid,lastpos));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos)
 	{
 	return(X509v3_get_ext_by_OBJ(x->tbsResponseData->responseExtensions,obj,lastpos));
@@ -188,12 +200,14 @@
 	{
 	return(X509v3_get_ext_by_critical(x->tbsResponseData->responseExtensions,crit,lastpos));
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc)
 	{
 	return(X509v3_get_ext(x->tbsResponseData->responseExtensions,loc));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc)
 	{
 	return(X509v3_delete_ext(x->tbsResponseData->responseExtensions,loc));
@@ -306,6 +320,7 @@
 	return NULL;
 	}
 #endif
+#endif /* OPERA_SMALL_VERSION */
 
 /* Nonce handling functions */
 
@@ -315,6 +330,7 @@
  * nonce, previous versions used the raw nonce.
  */
 
+#ifdef TLS_ADD_OCSP_NONCE
 static int ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts, unsigned char *val, int len)
 	{
 	unsigned char *tmpval;
@@ -327,13 +343,13 @@
          * it relies on library internals.
 	 */
 	os.length = ASN1_object_size(0, len, V_ASN1_OCTET_STRING);
-	os.data = OPENSSL_malloc(os.length);
+	os.data = (unsigned char *) OPENSSL_malloc(os.length);
 	if (os.data == NULL)
 		goto err;
 	tmpval = os.data;
 	ASN1_put_object(&tmpval, 0, len, V_ASN1_OCTET_STRING, V_ASN1_UNIVERSAL);
 	if (val)
-		memcpy(tmpval, val, len);
+		op_memcpy(tmpval, val, len);
 	else
 		RAND_pseudo_bytes(tmpval, len);
 	if(!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce,
@@ -345,21 +361,26 @@
 		OPENSSL_free(os.data);
 	return ret;
 	}
+#endif
 
 
 /* Add nonce to an OCSP request */
 
+#ifdef TLS_ADD_OCSP_NONCE
 int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len)
 	{
 	return ocsp_add1_nonce(&req->tbsRequest->requestExtensions, val, len);
 	}
+#endif
 
 /* Same as above but for a response */
 
+#ifndef OPERA_SMALL_VERSION
 int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len)
 	{
 	return ocsp_add1_nonce(&resp->tbsResponseData->responseExtensions, val, len);
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 /* Check nonce validity in a request and response.
  * Return value reflects result:
@@ -409,6 +430,7 @@
  * a response.
  */
 
+#ifndef OPERA_SMALL_VERSION
 int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req)
 	{
 	X509_EXTENSION *req_ext;
@@ -515,4 +537,6 @@
 	if (sloc) OCSP_SERVICELOC_free(sloc);
 	return x;
 	}
+#endif /* OPERA_SMALL_VERSION */
 
+#endif /* OPENSSL_NO_OCSP */
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/ocsp_ht.c openssl-1.0.0q/crypto/ocsp/ocsp_ht.c
--- openssl-1.0.0q.orig/crypto/ocsp/ocsp_ht.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/ocsp_ht.c	2017-04-25 16:23:40.544620891 +0200
@@ -56,17 +56,21 @@
  *
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "e_os.h"
 #include <openssl/asn1.h>
 #include <openssl/ocsp.h>
 #include <openssl/err.h>
 #include <openssl/buffer.h>
 #ifdef OPENSSL_SYS_SUNOS
-#define strtoul (unsigned long)strtol
+#define op_strtoul (unsigned long)strtol
 #endif /* OPENSSL_SYS_SUNOS */
 
 /* Stateful OCSP request code, supporting non-blocking I/O */
@@ -197,7 +201,7 @@
 	char *p, *q, *r;
 	/* Skip to first white space (passed protocol info) */
 
-	for(p = line; *p && !isspace((unsigned char)*p); p++)
+	for(p = line; *p && !op_isspace((unsigned char)*p); p++)
 		continue;
 	if(!*p)
 		{
@@ -207,7 +211,7 @@
 		}
 
 	/* Skip past white space to start of response code */
-	while(*p && isspace((unsigned char)*p))
+	while(*p && op_isspace((unsigned char)*p))
 		p++;
 
 	if(!*p)
@@ -218,7 +222,7 @@
 		}
 
 	/* Find end of response code: first whitespace after start of code */
-	for(q = p; *q && !isspace((unsigned char)*q); q++)
+	for(q = p; *q && !op_isspace((unsigned char)*q); q++)
 		continue;
 
 	if(!*q)
@@ -232,13 +236,13 @@
 	*q++ = 0;
 
 	/* Attempt to parse numeric code */
-	retcode = strtoul(p, &r, 10);
+	retcode = op_strtoul(p, &r, 10);
 
 	if(*r)
 		return 0;
 
 	/* Skip over any leading white space in message */
-	while(*q && isspace((unsigned char)*q))
+	while(*q && op_isspace((unsigned char)*q))
 		q++;
 
 	if(*q)
@@ -247,7 +251,7 @@
 		 * CRLF) */
 
 		/* We know q has a non white space character so this is OK */
-		for(r = q + strlen(q) - 1; isspace((unsigned char)*r); r--)
+		for(r = q + op_strlen(q) - 1; op_isspace((unsigned char)*r); r--)
 			*r = 0;
 		}
 	if(retcode != 200)
@@ -343,7 +347,7 @@
 		 * calling BIO_gets or we'll just get a partial read.
 		 */
 		n = BIO_get_mem_data(rctx->mem, &p);
-		if ((n <= 0) || !memchr(p, '\n', n))
+		if ((n <= 0) || !op_memchr(p, '\n', n))
 			{
 			if (n >= rctx->iobuflen)
 				{
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/ocsp_lib.c openssl-1.0.0q/crypto/ocsp/ocsp_lib.c
--- openssl-1.0.0q.orig/crypto/ocsp/ocsp_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/ocsp_lib.c	2017-04-25 16:23:40.545621857 +0200
@@ -61,8 +61,13 @@
  *
  */
 
+#ifndef OPENSSL_NO_OCSP
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include <cryptlib.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/rand.h>
 #include <openssl/x509.h>
@@ -70,6 +75,8 @@
 #include <openssl/x509v3.h>
 #include <openssl/ocsp.h>
 #include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 /* Convert a certificate and its issuer to an OCSP_CERTID */
 
@@ -105,7 +112,7 @@
         unsigned int i;
 	X509_ALGOR *alg;
 	OCSP_CERTID *cid = NULL;
-	unsigned char md[EVP_MAX_MD_SIZE];
+	unsigned char md[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-05-25 yngve */
 
 	if (!(cid = OCSP_CERTID_new())) goto err;
 
@@ -164,6 +171,7 @@
  * it is SSL.
  */
 
+#ifndef OPERA_SMALL_VERSION
 int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl)
 	{
 	char *p, *buf;
@@ -179,18 +187,18 @@
 	if (!buf) goto mem_err;
 
 	/* Check for initial colon */
-	p = strchr(buf, ':');
+	p = op_strchr(buf, ':');
 
 	if (!p) goto parse_err;
 
 	*(p++) = '\0';
 
-	if (!strcmp(buf, "http"))
+	if (!op_strcmp(buf, "http"))
 		{
 		*pssl = 0;
 		port = "80";
 		}
-	else if (!strcmp(buf, "https"))
+	else if (!op_strcmp(buf, "https"))
 		{
 		*pssl = 1;
 		port = "443";
@@ -208,7 +216,7 @@
 
 	/* Check for trailing part of path */
 
-	p = strchr(p, '/');
+	p = op_strchr(p, '/');
 
 	if (!p) 
 		*ppath = BUF_strdup("/");
@@ -233,7 +241,7 @@
 		}
 
 	/* Look for optional ':' for port number */
-	if ((p = strchr(p, ':')))
+	if ((p = op_strchr(host, ':')))
 		{
 		*p = 0;
 		port = p + 1;
@@ -272,5 +280,8 @@
 	return 0;
 
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 IMPLEMENT_ASN1_DUP_FUNCTION(OCSP_CERTID)
+
+#endif /* OPENSSL_NO_OCSP */
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/ocsp_srv.c openssl-1.0.0q/crypto/ocsp/ocsp_srv.c
--- openssl-1.0.0q.orig/crypto/ocsp/ocsp_srv.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/ocsp_srv.c	2017-04-25 16:23:40.546620307 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/rand.h>
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/ocsp_vfy.c openssl-1.0.0q/crypto/ocsp/ocsp_vfy.c
--- openssl-1.0.0q.orig/crypto/ocsp/ocsp_vfy.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/ocsp_vfy.c	2017-04-25 16:23:40.547620435 +0200
@@ -56,9 +56,16 @@
  *
  */
 
+#include <openssl/cryptlib.h>
+
+#ifndef OPENSSL_NO_OCSP
+
 #include <openssl/ocsp.h>
 #include <openssl/err.h>
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
 				X509_STORE *st, unsigned long flags);
@@ -67,8 +74,11 @@
 static int ocsp_check_ids(STACK_OF(OCSP_SINGLERESP) *sresp, OCSP_CERTID **ret);
 static int ocsp_match_issuerid(X509 *cert, OCSP_CERTID *cid, STACK_OF(OCSP_SINGLERESP) *sresp);
 static int ocsp_check_delegated(X509 *x, int flags);
+
+#ifndef OPERA_SMALL_VERSION
 static int ocsp_req_find_signer(X509 **psigner, OCSP_REQUEST *req, X509_NAME *nm, STACK_OF(X509) *certs,
 				X509_STORE *st, unsigned long flags);
+#endif
 
 /* Verify a basic response message */
 
@@ -124,8 +134,13 @@
 			{
 			i = X509_STORE_CTX_get_error(&ctx);	
 			OCSPerr(OCSP_F_OCSP_BASIC_VERIFY,OCSP_R_CERTIFICATE_VERIFY_ERROR);
+#ifdef OPERA_SMALL_VERSION
+			// Suppress warning "variable set but not used".
+			(void) i;
+#else
 			ERR_add_error_data(2, "Verify error:",
 					X509_verify_cert_error_string(i));
+#endif
                         goto end;
                 	}
 		if(flags & OCSP_NOCHECKS)
@@ -206,7 +221,7 @@
 		{
 		x = sk_X509_value(certs, i);
 		X509_pubkey_digest(x, EVP_sha1(), tmphash, NULL);
-		if(!memcmp(keyhash, tmphash, SHA_DIGEST_LENGTH))
+		if(!op_memcmp(keyhash, tmphash, SHA_DIGEST_LENGTH))
 			return x;
 		}
 	return NULL;
@@ -304,7 +319,7 @@
 		const EVP_MD *dgst;
 		X509_NAME *iname;
 		int mdlen;
-		unsigned char md[EVP_MAX_MD_SIZE];
+		unsigned char md[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-05-25 yngve */
 		if (!(dgst = EVP_get_digestbyobj(cid->hashAlgorithm->algorithm)))
 			{
 			OCSPerr(OCSP_F_OCSP_MATCH_ISSUERID, OCSP_R_UNKNOWN_MESSAGE_DIGEST);
@@ -320,7 +335,7 @@
 		iname = X509_get_subject_name(cert);
 		if (!X509_NAME_digest(iname, dgst, md, NULL))
 			return -1;
-		if (memcmp(md, cid->issuerNameHash->data, mdlen))
+		if (op_memcmp(md, cid->issuerNameHash->data, mdlen))
 			return 0;
 		X509_pubkey_digest(cert, dgst, md, NULL);
 		if (memcmp(md, cid->issuerKeyHash->data, mdlen))
@@ -360,6 +375,7 @@
  * against a given trust value.
  */
 
+#ifndef OPERA_SMALL_VERSION
 int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, unsigned long flags)
         {
 	X509 *signer;
@@ -421,8 +437,10 @@
 			{
 			ret = X509_STORE_CTX_get_error(&ctx);	
 			OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY,OCSP_R_CERTIFICATE_VERIFY_ERROR);
+#ifndef OPERA_SMALL_VERSION
 			ERR_add_error_data(2, "Verify error:",
 					X509_verify_cert_error_string(ret));
+#endif
                         return 0;
                 	}
 		}
@@ -448,3 +466,6 @@
 		}
 	return 0;
 	}
+
+#endif /* OPERA_SMALL_VERSION */
+#endif /* OPENSSL_NO_OCSP */
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/opera_ocsp_asn.cpp openssl-1.0.0q/crypto/ocsp/opera_ocsp_asn.cpp
--- openssl-1.0.0q.orig/crypto/ocsp/opera_ocsp_asn.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/opera_ocsp_asn.cpp	2017-04-25 16:23:40.548620562 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_OCSP) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/ocsp/ocsp_asn.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_OCSP) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/opera_ocsp_cl.cpp openssl-1.0.0q/crypto/ocsp/opera_ocsp_cl.cpp
--- openssl-1.0.0q.orig/crypto/ocsp/opera_ocsp_cl.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/opera_ocsp_cl.cpp	2017-04-25 16:23:40.548620562 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_OCSP)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/ocsp/ocsp_cl.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_OCSP)
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/opera_ocsp_ext.cpp openssl-1.0.0q/crypto/ocsp/opera_ocsp_ext.cpp
--- openssl-1.0.0q.orig/crypto/ocsp/opera_ocsp_ext.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/opera_ocsp_ext.cpp	2017-04-25 16:23:40.549620968 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_OCSP)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/ocsp/ocsp_ext.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_OCSP)
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/opera_ocsp_lib.cpp openssl-1.0.0q/crypto/ocsp/opera_ocsp_lib.cpp
--- openssl-1.0.0q.orig/crypto/ocsp/opera_ocsp_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/opera_ocsp_lib.cpp	2017-04-25 16:23:40.549620968 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_OCSP)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/ocsp/ocsp_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_OCSP)
diff -Naur openssl-1.0.0q.orig/crypto/ocsp/opera_ocsp_vfy.cpp openssl-1.0.0q/crypto/ocsp/opera_ocsp_vfy.cpp
--- openssl-1.0.0q.orig/crypto/ocsp/opera_ocsp_vfy.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ocsp/opera_ocsp_vfy.cpp	2017-04-25 16:23:40.550620537 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_OCSP)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/ocsp/ocsp_vfy.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_OCSP)
diff -Naur openssl-1.0.0q.orig/crypto/opensslconf.h openssl-1.0.0q/crypto/opensslconf.h
--- openssl-1.0.0q.orig/crypto/opensslconf.h	2015-01-15 15:56:28.000000000 +0100
+++ openssl-1.0.0q/crypto/opensslconf.h	2017-04-25 16:23:40.551620384 +0200
@@ -111,7 +111,7 @@
 #endif
 #endif
 
-#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
+#if (defined(OPERA_SMALL_VERSION) || defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
 /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
  * %20 speed up (longs are 8 bytes, int's are 4). */
 #ifndef DES_LONG
@@ -126,9 +126,15 @@
 /* Should we define BN_DIV2W here? */
 
 /* Only one for the following should be defined */
+#if defined(THIRTY_TWO_BIT) && defined(SIXTY_FOUR_BIT)
+#error "You should not define both SIXTY_FOUR_BIT and THIRTY_TWO_BIT"
+#endif
+
+#if !defined(THIRTY_TWO_BIT) && !defined(SIXTY_FOUR_BIT)
+#error "You should really set either SIXTY_FOUR_BIT or THIRTY_TWO_BIT"
+#endif
+
 #undef SIXTY_FOUR_BIT_LONG
-#undef SIXTY_FOUR_BIT
-#define THIRTY_TWO_BIT
 #endif
 
 #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
diff -Naur openssl-1.0.0q.orig/crypto/opera_cryptlib.cpp openssl-1.0.0q/crypto/opera_cryptlib.cpp
--- openssl-1.0.0q.orig/crypto/opera_cryptlib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/opera_cryptlib.cpp	2017-04-25 16:23:40.551620384 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch_system_includes.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/cryptlib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
diff -Naur openssl-1.0.0q.orig/crypto/opera_ex_data.cpp openssl-1.0.0q/crypto/opera_ex_data.cpp
--- openssl-1.0.0q.orig/crypto/opera_ex_data.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/opera_ex_data.cpp	2017-04-25 16:23:40.552620791 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/ex_data.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/opera_mem.cpp openssl-1.0.0q/crypto/opera_mem.cpp
--- openssl-1.0.0q.orig/crypto/opera_mem.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/opera_mem.cpp	2017-04-25 16:23:40.552620791 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/mem.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
diff -Naur openssl-1.0.0q.orig/crypto/opera_mem_clr.cpp openssl-1.0.0q/crypto/opera_mem_clr.cpp
--- openssl-1.0.0q.orig/crypto/opera_mem_clr.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/opera_mem_clr.cpp	2017-04-25 16:23:40.553620359 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "mem_clr.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/opera_o_time.cpp openssl-1.0.0q/crypto/opera_o_time.cpp
--- openssl-1.0.0q.orig/crypto/opera_o_time.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/opera_o_time.cpp	2017-04-25 16:23:40.553620359 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/o_time.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/ossl_typ.h openssl-1.0.0q/crypto/ossl_typ.h
--- openssl-1.0.0q.orig/crypto/ossl_typ.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ossl_typ.h	2017-04-25 16:23:40.554620207 +0200
@@ -167,7 +167,12 @@
 typedef struct st_ERR_FNS ERR_FNS;
 
 typedef struct engine_st ENGINE;
+
+// Opera also contains a class with name "SSL".
+#ifndef _SSL_USE_OPENSSL_
 typedef struct ssl_st SSL;
+#endif
+
 typedef struct ssl_ctx_st SSL_CTX;
 
 typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
diff -Naur openssl-1.0.0q.orig/crypto/pem/.gitignore openssl-1.0.0q/crypto/pem/.gitignore
--- openssl-1.0.0q.orig/crypto/pem/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/.gitignore	2017-04-25 16:23:40.555620613 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/pem/opera_pem_all.cpp openssl-1.0.0q/crypto/pem/opera_pem_all.cpp
--- openssl-1.0.0q.orig/crypto/pem/opera_pem_all.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/opera_pem_all.cpp	2017-04-25 16:23:40.556620461 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pem/pem_all.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/pem/opera_pem_lib.cpp openssl-1.0.0q/crypto/pem/opera_pem_lib.cpp
--- openssl-1.0.0q.orig/crypto/pem/opera_pem_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/opera_pem_lib.cpp	2017-04-25 16:23:40.556620461 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pem/pem_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/pem/opera_pem_oth.cpp openssl-1.0.0q/crypto/pem/opera_pem_oth.cpp
--- openssl-1.0.0q.orig/crypto/pem/opera_pem_oth.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/opera_pem_oth.cpp	2017-04-25 16:23:40.557620309 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pem/pem_oth.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/pem/opera_pem_x509.cpp openssl-1.0.0q/crypto/pem/opera_pem_x509.cpp
--- openssl-1.0.0q.orig/crypto/pem/opera_pem_x509.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/opera_pem_x509.cpp	2017-04-25 16:23:40.557620309 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pem/pem_x509.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/pem/opera_pem_xaux.cpp openssl-1.0.0q/crypto/pem/opera_pem_xaux.cpp
--- openssl-1.0.0q.orig/crypto/pem/opera_pem_xaux.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/opera_pem_xaux.cpp	2017-04-25 16:23:40.558620157 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pem/pem_xaux.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem.h openssl-1.0.0q/crypto/pem/pem.h
--- openssl-1.0.0q.orig/crypto/pem/pem.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem.h	2017-04-25 16:23:40.558620157 +0200
@@ -159,7 +159,7 @@
 
 	int cipher;
 	int key_enc;
-	/*	char iv[8]; unused and wrong size */
+	/*	char iv[8]; unused and wrong size  // ARRAY OK 2007-11-07 yngve */
 	} PEM_USER;
 
 typedef struct pem_ctx_st
@@ -176,7 +176,7 @@
 	struct	{
 		int cipher;
 	/* unused, and wrong size
-	   unsigned char iv[8]; */
+	   unsigned char iv[8];  // ARRAY OK 2007-11-07 yngve */
 		} DEK_info;
 		
 	PEM_USER *originator;
@@ -196,7 +196,7 @@
 	int key_len;		/* key length */
 	unsigned char *key;	/* key */
 	/* unused, and wrong size
-	   unsigned char iv[8]; */
+	   unsigned char iv[8];  // ARRAY OK 2007-11-07 yngve */
 
 	
 	int  data_enc;		/* is the data encrypted */
@@ -258,7 +258,7 @@
 #define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
 type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\
 { \
-return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \
+return (type *)PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \
 }
 
 #define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
@@ -325,6 +325,7 @@
 
 #define DECLARE_PEM_read_fp(name, type) /**/
 #define DECLARE_PEM_write_fp(name, type) /**/
+#define DECLARE_PEM_write_fp_const(name, type) /**/
 #define DECLARE_PEM_write_cb_fp(name, type) /**/
 
 #else
@@ -425,6 +426,7 @@
 		unsigned char *kstr, int klen, pem_password_cb *cd, void *u);
 #endif
 
+#ifndef OPENSSL_NO_FP_API
 int	PEM_read(FILE *fp, char **name, char **header,
 		unsigned char **data,long *len);
 int	PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len);
@@ -435,6 +437,7 @@
 		       int klen,pem_password_cb *callback, void *u);
 STACK_OF(X509_INFO) *	PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
 	pem_password_cb *cb, void *u);
+#endif // !OPENSSL_NO_FP_API
 
 int	PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type,
 		EVP_MD *md_type, unsigned char **ek, int *ekl,
@@ -523,6 +526,7 @@
 				  pem_password_cb *cb, void *u);
 EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u);
 
+#ifndef OPENSSL_NO_FP_API
 int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
 				  char *kstr, int klen,
 				  pem_password_cb *cb, void *u);
@@ -537,6 +541,7 @@
 
 int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc,
 			      char *kstr,int klen, pem_password_cb *cd, void *u);
+#endif
 
 EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
 int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x);
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_all.c openssl-1.0.0q/crypto/pem/pem_all.c
--- openssl-1.0.0q.orig/crypto/pem/pem_all.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_all.c	2017-04-25 16:23:40.559620004 +0200
@@ -109,8 +109,10 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bio.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
@@ -126,6 +128,8 @@
 #include <openssl/dh.h>
 #endif
 
+#ifndef OPERA_SMALL_VERSION
+
 #ifndef OPENSSL_NO_RSA
 static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa);
 #endif
@@ -141,8 +145,12 @@
 
 IMPLEMENT_PEM_write(X509_REQ_NEW, X509_REQ, PEM_STRING_X509_REQ_OLD, X509_REQ)
 
+#endif // !OPERA_SMALL_VERSION
+
 IMPLEMENT_PEM_rw(X509_CRL, X509_CRL, PEM_STRING_X509_CRL, X509_CRL)
 
+#ifndef OPERA_SMALL_VERSION
+
 IMPLEMENT_PEM_rw(PKCS7, PKCS7, PEM_STRING_PKCS7, PKCS7)
 
 IMPLEMENT_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE,
@@ -294,3 +302,5 @@
 #endif
 
 IMPLEMENT_PEM_rw(PUBKEY, EVP_PKEY, PEM_STRING_PUBLIC, PUBKEY)
+
+#endif // !OPERA_SMALL_VERSION
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_err.c openssl-1.0.0q/crypto/pem/pem_err.c
--- openssl-1.0.0q.orig/crypto/pem/pem_err.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_err.c	2017-04-25 16:23:40.560620970 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/pem.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_info.c openssl-1.0.0q/crypto/pem/pem_info.c
--- openssl-1.0.0q.orig/crypto/pem/pem_info.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_info.c	2017-04-25 16:23:40.561620538 +0200
@@ -56,7 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/objects.h>
@@ -129,8 +134,8 @@
 			goto err;
 			}
 start:
-		if (	(strcmp(name,PEM_STRING_X509) == 0) ||
-			(strcmp(name,PEM_STRING_X509_OLD) == 0))
+		if (	(op_strcmp(name,PEM_STRING_X509) == 0) ||
+			(op_strcmp(name,PEM_STRING_X509_OLD) == 0))
 			{
 			d2i=(D2I_OF(void))d2i_X509;
 			if (xi->x509 != NULL)
@@ -141,7 +146,7 @@
 				}
 			pp=&(xi->x509);
 			}
-		else if ((strcmp(name,PEM_STRING_X509_TRUSTED) == 0))
+		else if ((op_strcmp(name,PEM_STRING_X509_TRUSTED) == 0))
 			{
 			d2i=(D2I_OF(void))d2i_X509_AUX;
 			if (xi->x509 != NULL)
@@ -152,7 +157,7 @@
 				}
 			pp=&(xi->x509);
 			}
-		else if (strcmp(name,PEM_STRING_X509_CRL) == 0)
+		else if (op_strcmp(name,PEM_STRING_X509_CRL) == 0)
 			{
 			d2i=(D2I_OF(void))d2i_X509_CRL;
 			if (xi->crl != NULL)
@@ -165,7 +170,7 @@
 			}
 		else
 #ifndef OPENSSL_NO_RSA
-			if (strcmp(name,PEM_STRING_RSA) == 0)
+			if (op_strcmp(name,PEM_STRING_RSA) == 0)
 			{
 			d2i=(D2I_OF(void))d2i_RSAPrivateKey;
 			if (xi->x_pkey != NULL) 
@@ -187,7 +192,7 @@
 		else
 #endif
 #ifndef OPENSSL_NO_DSA
-			if (strcmp(name,PEM_STRING_DSA) == 0)
+			if (op_strcmp(name,PEM_STRING_DSA) == 0)
 			{
 			d2i=(D2I_OF(void))d2i_DSAPrivateKey;
 			if (xi->x_pkey != NULL) 
@@ -365,7 +370,7 @@
 				}
 
 			/* create the right magic header stuff */
-			OPENSSL_assert(strlen(objstr)+23+2*enc->iv_len+13 <= sizeof buf);
+			OPENSSL_assert(op_strlen(objstr)+23+2*enc->iv_len+13 <= sizeof buf);
 			buf[0]='\0';
 			PEM_proc_type(buf,PEM_TYPE_ENCRYPTED);
 			PEM_dek_info(buf,objstr,enc->iv_len,(char *)iv);
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_lib.c openssl-1.0.0q/crypto/pem/pem_lib.c
--- openssl-1.0.0q.orig/crypto/pem/pem_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_lib.c	2017-04-25 16:23:40.563621072 +0200
@@ -56,9 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
@@ -66,7 +69,7 @@
 #include <openssl/x509.h>
 #include <openssl/pem.h>
 #include <openssl/pkcs12.h>
-#include "asn1_locl.h"
+#include "../asn1/asn1_locl.h"
 #ifndef OPENSSL_NO_DES
 #include <openssl/des.h>
 #endif
@@ -74,17 +77,21 @@
 #include <openssl/engine.h>
 #endif
 
-const char PEM_version[]="PEM" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char PEM_version[]="PEM" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2007-02-26 haavardm */
+#endif
 
 #define MIN_LENGTH	4
 
+#ifndef OPERA_SMALL_VERSION
 static int load_iv(char **fromp,unsigned char *to, int num);
+#endif
 static int check_pem(const char *nm, const char *name);
 int pem_check_suffix(const char *pem_str, const char *suffix);
 
 int PEM_def_callback(char *buf, int num, int w, void *key)
 	{
-#ifdef OPENSSL_NO_FP_API
+#if defined(OPENSSL_NO_FP_API) || defined(_SSL_USE_OPENSSL_)
 	/* We should not ever call the default callback routine from
 	 * windows. */
 	PEMerr(PEM_F_PEM_DEF_CALLBACK,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
@@ -93,9 +100,9 @@
 	int i,j;
 	const char *prompt;
 	if(key) {
-		i=strlen(key);
+		i=op_strlen(key);
 		i=(i > num)?num:i;
-		memcpy(buf,key,i);
+		op_memcpy(buf,key,i);
 		return(i);
 	}
 
@@ -109,10 +116,10 @@
 		if (i != 0)
 			{
 			PEMerr(PEM_F_PEM_DEF_CALLBACK,PEM_R_PROBLEMS_GETTING_PASSWORD);
-			memset(buf,0,(unsigned int)num);
+			op_memset(buf,0,(unsigned int)num);
 			return(-1);
 			}
-		j=strlen(buf);
+		j=op_strlen(buf);
 		if (j < MIN_LENGTH)
 			{
 			fprintf(stderr,"phrase is too short, needs to be at least %d chars\n",MIN_LENGTH);
@@ -144,14 +151,14 @@
 
 void PEM_dek_info(char *buf, const char *type, int len, char *str)
 	{
-	static const unsigned char map[17]="0123456789ABCDEF";
+	const char *const map="0123456789ABCDEF";
 	long i;
 	int j;
 
 	BUF_strlcat(buf,"DEK-Info: ",PEM_BUFSIZE);
 	BUF_strlcat(buf,type,PEM_BUFSIZE);
 	BUF_strlcat(buf,",",PEM_BUFSIZE);
-	j=strlen(buf);
+	j=op_strlen(buf);
 	if (j + (len * 2) + 1 > PEM_BUFSIZE)
         	return;
 	for (i=0; i<len; i++)
@@ -239,22 +246,22 @@
 
 	/* Permit older strings */
 
-	if(!strcmp(nm,PEM_STRING_X509_OLD) &&
-		!strcmp(name,PEM_STRING_X509)) return 1;
+	if(!op_strcmp(nm,PEM_STRING_X509_OLD) &&
+		!op_strcmp(name,PEM_STRING_X509)) return 1;
 
-	if(!strcmp(nm,PEM_STRING_X509_REQ_OLD) &&
-		!strcmp(name,PEM_STRING_X509_REQ)) return 1;
+	if(!op_strcmp(nm,PEM_STRING_X509_REQ_OLD) &&
+		!op_strcmp(name,PEM_STRING_X509_REQ)) return 1;
 
 	/* Allow normal certs to be read as trusted certs */
-	if(!strcmp(nm,PEM_STRING_X509) &&
-		!strcmp(name,PEM_STRING_X509_TRUSTED)) return 1;
+	if(!op_strcmp(nm,PEM_STRING_X509) &&
+		!op_strcmp(name,PEM_STRING_X509_TRUSTED)) return 1;
 
-	if(!strcmp(nm,PEM_STRING_X509_OLD) &&
-		!strcmp(name,PEM_STRING_X509_TRUSTED)) return 1;
+	if(!op_strcmp(nm,PEM_STRING_X509_OLD) &&
+		!op_strcmp(name,PEM_STRING_X509_TRUSTED)) return 1;
 
 	/* Some CAs use PKCS#7 with CERTIFICATE headers */
-	if(!strcmp(nm, PEM_STRING_X509) &&
-		!strcmp(name, PEM_STRING_PKCS7)) return 1;
+	if(!op_strcmp(nm, PEM_STRING_X509) &&
+		!op_strcmp(name, PEM_STRING_PKCS7)) return 1;
 
 	if(!strcmp(nm, PEM_STRING_PKCS7_SIGNED) &&
 		!strcmp(name, PEM_STRING_PKCS7)) return 1;
@@ -284,7 +291,9 @@
 		if (!PEM_read_bio(bp,&nm,&header,&data,&len)) {
 			if(ERR_GET_REASON(ERR_peek_error()) ==
 				PEM_R_NO_START_LINE)
+#ifndef OPERA_SMALL_VERSION
 				ERR_add_error_data(2, "Expecting: ", name);
+#endif
 			return 0;
 		}
 		if(check_pem(nm, name)) break;
@@ -335,12 +344,17 @@
 		       int klen, pem_password_cb *callback, void *u)
 	{
 	EVP_CIPHER_CTX ctx;
+#ifdef OPERA_SMALL_VERSION
+	// Fix for warning: unused variable ‘j’.
+	int dsize=0,i,  ret=0;
+#else
 	int dsize=0,i,j,ret=0;
+#endif
 	unsigned char *p,*data=NULL;
 	const char *objstr=NULL;
-	char buf[PEM_BUFSIZE];
-	unsigned char key[EVP_MAX_KEY_LENGTH];
-	unsigned char iv[EVP_MAX_IV_LENGTH];
+	char buf[PEM_BUFSIZE]; /* ARRAY OK UNUSED 2007-04-23 yngve */
+	unsigned char key[EVP_MAX_KEY_LENGTH]; /* ARRAY OK UNUSED 2007-04-23 yngve */
+	unsigned char iv[EVP_MAX_IV_LENGTH]; /* ARRAY OK UNUSED 2007-04-23 yngve */
 	
 	if (enc != NULL)
 		{
@@ -371,6 +385,10 @@
 
 	if (enc != NULL)
 		{
+#ifdef OPERA_SMALL_VERSION
+		// Encrypted PEMs are not supported in OPERA_SMALL_VERSION - error exit
+		goto err;
+#else
 		if (kstr == NULL)
 			{
 			if (callback == NULL)
@@ -398,12 +416,12 @@
 
 		if (kstr == (unsigned char *)buf) OPENSSL_cleanse(buf,PEM_BUFSIZE);
 
-		OPENSSL_assert(strlen(objstr)+23+2*enc->iv_len+13 <= sizeof buf);
+		OPENSSL_assert(op_strlen(objstr)+23+2*enc->iv_len+13 <= sizeof buf);
 
 		buf[0]='\0';
 		PEM_proc_type(buf,PEM_TYPE_ENCRYPTED);
 		PEM_dek_info(buf,objstr,enc->iv_len,(char *)iv);
-		/* k=strlen(buf); */
+		/* k=op_strlen(buf); */
 
 		EVP_CIPHER_CTX_init(&ctx);
 		EVP_EncryptInit_ex(&ctx,enc,NULL,key,iv);
@@ -412,6 +430,7 @@
 		EVP_CIPHER_CTX_cleanup(&ctx);
 		i+=j;
 		ret=1;
+#endif // OPERA_SMALL_VERSION
 		}
 	else
 		{
@@ -436,11 +455,17 @@
 int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen,
 	     pem_password_cb *callback,void *u)
 	{
+#ifdef OPERA_SMALL_VERSION
+	if (cipher->cipher == NULL) return(1);
+
+	// Encrypted PEMs are not supported in OPERA_SMALL_VERSION - error exit.
+	return 0;
+#else
 	int i,j,o,klen;
 	long len;
 	EVP_CIPHER_CTX ctx;
-	unsigned char key[EVP_MAX_KEY_LENGTH];
-	char buf[PEM_BUFSIZE];
+	unsigned char key[EVP_MAX_KEY_LENGTH]; /* ARRAY OK UNUSED 2007-04-23 yngve */
+	char buf[PEM_BUFSIZE]; /* ARRAY OK UNUSED 2007-04-23 yngve */
 
 	len= *plen;
 
@@ -478,10 +503,19 @@
 		}
 	*plen=j;
 	return(1);
+#endif // OPERA_SMALL_VERSION
 	}
 
 int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
 	{
+#ifdef OPERA_SMALL_VERSION
+	cipher->cipher=NULL;
+	if ((header == NULL) || (*header == '\0') || (*header == '\n'))
+		return(1);
+
+	// Non-empty header is not supported in OPERA_SMALL_VERSION - error exit.
+	return 0;
+#else
 	const EVP_CIPHER *enc=NULL;
 	char *p,c;
 	char **header_pp = &header;
@@ -489,19 +523,19 @@
 	cipher->cipher=NULL;
 	if ((header == NULL) || (*header == '\0') || (*header == '\n'))
 		return(1);
-	if (strncmp(header,"Proc-Type: ",11) != 0)
+	if (op_strncmp(header,"Proc-Type: ",11) != 0)
 		{ PEMerr(PEM_F_PEM_GET_EVP_CIPHER_INFO,PEM_R_NOT_PROC_TYPE); return(0); }
 	header+=11;
 	if (*header != '4') return(0); header++;
 	if (*header != ',') return(0); header++;
-	if (strncmp(header,"ENCRYPTED",9) != 0)
+	if (op_strncmp(header,"ENCRYPTED",9) != 0)
 		{ PEMerr(PEM_F_PEM_GET_EVP_CIPHER_INFO,PEM_R_NOT_ENCRYPTED); return(0); }
 	for (; (*header != '\n') && (*header != '\0'); header++)
 		;
 	if (*header == '\0')
 		{ PEMerr(PEM_F_PEM_GET_EVP_CIPHER_INFO,PEM_R_SHORT_HEADER); return(0); }
 	header++;
-	if (strncmp(header,"DEK-Info: ",10) != 0)
+	if (op_strncmp(header,"DEK-Info: ",10) != 0)
 		{ PEMerr(PEM_F_PEM_GET_EVP_CIPHER_INFO,PEM_R_NOT_DEK_INFO); return(0); }
 	header+=10;
 
@@ -514,8 +548,8 @@
 			((c >= '0') && (c <= '9'))))
 			break;
 #else
-		if (!(	isupper(c) || (c == '-') ||
-			isdigit(c)))
+		if (!(	op_isupper(c) || (c == '-') ||
+			op_isdigit(c)))
 			break;
 #endif
 		header++;
@@ -534,8 +568,10 @@
 		return(0);
 
 	return(1);
+#endif // OPERA_SMALL_VERSION
 	}
 
+#ifndef OPERA_SMALL_VERSION
 static int load_iv(char **fromp, unsigned char *to, int num)
 	{
 	int v,i;
@@ -564,6 +600,7 @@
 	*fromp=from;
 	return(1);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 #ifndef OPENSSL_NO_FP_API
 int PEM_write(FILE *fp, char *name, char *header, unsigned char *data,
@@ -593,14 +630,14 @@
 	int reason=ERR_R_BUF_LIB;
 	
 	EVP_EncodeInit(&ctx);
-	nlen=strlen(name);
+	nlen=op_strlen(name);
 
 	if (	(BIO_write(bp,"-----BEGIN ",11) != 11) ||
 		(BIO_write(bp,name,nlen) != nlen) ||
 		(BIO_write(bp,"-----\n",6) != 6))
 		goto err;
 		
-	i=strlen(header);
+	i=op_strlen(header);
 	if (i > 0)
 		{
 		if (	(BIO_write(bp,header,i) != i) ||
@@ -608,7 +645,7 @@
 			goto err;
 		}
 
-	buf = OPENSSL_malloc(PEM_BUFSIZE*8);
+	buf = (unsigned char*)OPENSSL_malloc(PEM_BUFSIZE*8);
 	if (buf == NULL)
 		{
 		reason=ERR_R_MALLOC_FAILURE;
@@ -669,7 +706,7 @@
 	{
 	EVP_ENCODE_CTX ctx;
 	int end=0,i,k,bl=0,hl=0,nohead=0;
-	char buf[256];
+	char buf[256]; /* ARRAY OK UNUSED 2007-04-23 yngve */
 	BUF_MEM *nameB;
 	BUF_MEM *headerB;
 	BUF_MEM *dataB,*tmpB;
@@ -700,18 +737,18 @@
 		while ((i >= 0) && (buf[i] <= ' ')) i--;
 		buf[++i]='\n'; buf[++i]='\0';
 
-		if (strncmp(buf,"-----BEGIN ",11) == 0)
+		if (op_strncmp(buf,"-----BEGIN ",11) == 0)
 			{
-			i=strlen(&(buf[11]));
+			i=op_strlen(&(buf[11]));
 
-			if (strncmp(&(buf[11+i-6]),"-----\n",6) != 0)
+			if (op_strncmp(&(buf[11+i-6]),"-----\n",6) != 0)
 				continue;
 			if (!BUF_MEM_grow(nameB,i+9))
 				{
 				PEMerr(PEM_F_PEM_READ_BIO,ERR_R_MALLOC_FAILURE);
 				goto err;
 				}
-			memcpy(nameB->data,&(buf[11]),i-6);
+			op_memcpy(nameB->data,&(buf[11]),i-6);
 			nameB->data[i-6]='\0';
 			break;
 			}
@@ -731,12 +768,12 @@
 		if (buf[0] == '\n') break;
 		if (!BUF_MEM_grow(headerB,hl+i+9))
 			{ PEMerr(PEM_F_PEM_READ_BIO,ERR_R_MALLOC_FAILURE); goto err; }
-		if (strncmp(buf,"-----END ",9) == 0)
+		if (op_strncmp(buf,"-----END ",9) == 0)
 			{
 			nohead=1;
 			break;
 			}
-		memcpy(&(headerB->data[hl]),buf,i);
+		op_memcpy(&(headerB->data[hl]),buf,i);
 		headerB->data[hl+i]='\0';
 		hl+=i;
 		}
@@ -756,7 +793,7 @@
 			buf[++i]='\n'; buf[++i]='\0';
 
 			if (i != 65) end=1;
-			if (strncmp(buf,"-----END ",9) == 0)
+			if (op_strncmp(buf,"-----END ",9) == 0)
 				break;
 			if (i > 65) break;
 			if (!BUF_MEM_grow_clean(dataB,i+bl+9))
@@ -764,7 +801,7 @@
 				PEMerr(PEM_F_PEM_READ_BIO,ERR_R_MALLOC_FAILURE);
 				goto err;
 				}
-			memcpy(&(dataB->data[bl]),buf,i);
+			op_memcpy(&(dataB->data[bl]),buf,i);
 			dataB->data[bl+i]='\0';
 			bl+=i;
 			if (end)
@@ -787,10 +824,10 @@
 		dataB=tmpB;
 		bl=hl;
 		}
-	i=strlen(nameB->data);
-	if (	(strncmp(buf,"-----END ",9) != 0) ||
-		(strncmp(nameB->data,&(buf[9]),i) != 0) ||
-		(strncmp(&(buf[9+i]),"-----\n",6) != 0))
+	i=op_strlen(nameB->data);
+	if (	(op_strncmp(buf,"-----END ",9) != 0) ||
+		(op_strncmp(nameB->data,&(buf[9]),i) != 0) ||
+		(op_strncmp(&(buf[9+i]),"-----\n",6) != 0))
 		{
 		PEMerr(PEM_F_PEM_READ_BIO,PEM_R_BAD_END_LINE);
 		goto err;
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_oth.c openssl-1.0.0q/crypto/pem/pem_oth.c
--- openssl-1.0.0q.orig/crypto/pem/pem_oth.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_oth.c	2017-04-25 16:23:40.563621072 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/buffer.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
@@ -78,7 +80,7 @@
 	if (!PEM_bytes_read_bio(&data, &len, NULL, name, bp, cb, u))
 		return NULL;
 	p = data;
-	ret=d2i(x,&p,len);
+	ret=(char*)d2i(x,&p,len);
 	if (ret == NULL)
 		PEMerr(PEM_F_PEM_ASN1_READ_BIO,ERR_R_ASN1_LIB);
 	OPENSSL_free(data);
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_pk8.c openssl-1.0.0q/crypto/pem/pem_pk8.c
--- openssl-1.0.0q.orig/crypto/pem/pem_pk8.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_pk8.c	2017-04-25 16:23:40.564620640 +0200
@@ -56,7 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_pkey.c openssl-1.0.0q/crypto/pem/pem_pkey.c
--- openssl-1.0.0q.orig/crypto/pem/pem_pkey.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_pkey.c	2017-04-25 16:23:40.565620488 +0200
@@ -56,7 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_seal.c openssl-1.0.0q/crypto/pem/pem_seal.c
--- openssl-1.0.0q.orig/crypto/pem/pem_seal.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_seal.c	2017-04-25 16:23:40.566620615 +0200
@@ -58,7 +58,9 @@
 
 #include <openssl/opensslconf.h>	/* for OPENSSL_NO_RSA */
 #ifndef OPENSSL_NO_RSA
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/rand.h>
@@ -108,7 +110,7 @@
 		j=EVP_EncodeBlock((unsigned char *)s,ek[i],
 			RSA_size(pubk[i]->pkey.rsa));
 		ekl[i]=j;
-		memcpy(ek[i],s,j+1);
+		op_memcpy(ek[i],s,j+1);
 		}
 
 	ret=npubk;
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_sign.c openssl-1.0.0q/crypto/pem/pem_sign.c
--- openssl-1.0.0q.orig/crypto/pem/pem_sign.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_sign.c	2017-04-25 16:23:40.567620742 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/rand.h>
 #include <openssl/evp.h>
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_x509.c openssl-1.0.0q/crypto/pem/pem_x509.c
--- openssl-1.0.0q.orig/crypto/pem/pem_x509.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_x509.c	2017-04-25 16:23:40.567620742 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/bio.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
diff -Naur openssl-1.0.0q.orig/crypto/pem/pem_xaux.c openssl-1.0.0q/crypto/pem/pem_xaux.c
--- openssl-1.0.0q.orig/crypto/pem/pem_xaux.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pem/pem_xaux.c	2017-04-25 16:23:40.568620590 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/bio.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
@@ -65,4 +68,6 @@
 #include <openssl/pem.h>
 
 IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX)
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR, PEM_STRING_X509_PAIR, X509_CERT_PAIR)
+#endif /* !OPERA_SMALL_VERSION */
diff -Naur openssl-1.0.0q.orig/crypto/perlasm/.gitignore openssl-1.0.0q/crypto/perlasm/.gitignore
--- openssl-1.0.0q.orig/crypto/perlasm/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/perlasm/.gitignore	2017-04-25 16:23:40.569621275 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/.gitignore openssl-1.0.0q/crypto/pkcs12/.gitignore
--- openssl-1.0.0q.orig/crypto/pkcs12/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/.gitignore	2017-04-25 16:23:40.569621275 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_add.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_add.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_add.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_add.cpp	2017-04-25 16:23:40.570620844 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_add.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_asn.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_asn.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_asn.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_asn.cpp	2017-04-25 16:23:40.570620844 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_asn.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_attr.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_attr.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_attr.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_attr.cpp	2017-04-25 16:23:40.571620412 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_attr.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_crpt.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_crpt.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_crpt.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_crpt.cpp	2017-04-25 16:23:40.571620412 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_crpt.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_crt.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_crt.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_crt.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_crt.cpp	2017-04-25 16:23:40.572620539 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_crt.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_decr.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_decr.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_decr.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_decr.cpp	2017-04-25 16:23:40.572620539 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_decr.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_init.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_init.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_init.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_init.cpp	2017-04-25 16:23:40.573620666 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_init.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_key.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_key.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_key.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_key.cpp	2017-04-25 16:23:40.573620666 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_key.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_kiss.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_kiss.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_kiss.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_kiss.cpp	2017-04-25 16:23:40.574620794 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_kiss.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_mutl.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_mutl.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_mutl.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_mutl.cpp	2017-04-25 16:23:40.574620794 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_mutl.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_p8d.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_p8d.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_p8d.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_p8d.cpp	2017-04-25 16:23:40.575621479 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_p8d.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_p8e.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_p8e.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_p8e.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_p8e.cpp	2017-04-25 16:23:40.575621479 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_p8e.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_utl.cpp openssl-1.0.0q/crypto/pkcs12/opera_p12_utl.cpp
--- openssl-1.0.0q.orig/crypto/pkcs12/opera_p12_utl.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/opera_p12_utl.cpp	2017-04-25 16:23:40.576620210 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs12/p12_utl.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_add.c openssl-1.0.0q/crypto/pkcs12/p12_add.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_add.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_add.c	2017-04-25 16:23:40.577621734 +0200
@@ -56,9 +56,14 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Pack an object into an OCTET STRING and turn into a safebag */
 
@@ -160,7 +165,7 @@
 		PKCS12err(PKCS12_F_PKCS12_UNPACK_P7DATA,PKCS12_R_CONTENT_TYPE_NOT_DATA);
 		return NULL;
 		}
-	return ASN1_item_unpack(p7->d.data, ASN1_ITEM_rptr(PKCS12_SAFEBAGS));
+	return (STACK_OF(PKCS12_SAFEBAG) *) ASN1_item_unpack(p7->d.data, ASN1_ITEM_rptr(PKCS12_SAFEBAGS));
 }
 
 /* Turn a stack of SAFEBAGS into a PKCS#7 encrypted data ContentInfo */
@@ -209,7 +214,7 @@
 STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen)
 {
 	if(!PKCS7_type_is_encrypted(p7)) return NULL;
-	return PKCS12_item_decrypt_d2i(p7->d.encrypted->enc_data->algorithm,
+	return (STACK_OF(PKCS12_SAFEBAG) *) PKCS12_item_decrypt_d2i(p7->d.encrypted->enc_data->algorithm,
 			           ASN1_ITEM_rptr(PKCS12_SAFEBAGS),
 				   pass, passlen,
 			           p7->d.encrypted->enc_data->enc_data, 1);
@@ -236,5 +241,7 @@
 		PKCS12err(PKCS12_F_PKCS12_UNPACK_AUTHSAFES,PKCS12_R_CONTENT_TYPE_NOT_DATA);
 		return NULL;
 		}
-	return ASN1_item_unpack(p12->authsafes->d.data, ASN1_ITEM_rptr(PKCS12_AUTHSAFES));
+	return (STACK_OF(PKCS7) *) ASN1_item_unpack(p12->authsafes->d.data, ASN1_ITEM_rptr(PKCS12_AUTHSAFES));
 }
+
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_asn.c openssl-1.0.0q/crypto/pkcs12/p12_asn.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_asn.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_asn.c	2017-04-25 16:23:40.578620464 +0200
@@ -56,70 +56,79 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/pkcs12.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* PKCS#12 ASN1 module */
 
-ASN1_SEQUENCE(PKCS12) = {
-	ASN1_SIMPLE(PKCS12, version, ASN1_INTEGER),
-	ASN1_SIMPLE(PKCS12, authsafes, PKCS7),
+ASN1_SEQUENCE(PKCS12)
+	ASN1_SIMPLE(PKCS12, version, ASN1_INTEGER)
+	ASN1_SIMPLE(PKCS12, authsafes, PKCS7)
 	ASN1_OPT(PKCS12, mac, PKCS12_MAC_DATA)
-} ASN1_SEQUENCE_END(PKCS12)
+ASN1_SEQUENCE_END(PKCS12)
 
 IMPLEMENT_ASN1_FUNCTIONS(PKCS12)
 
-ASN1_SEQUENCE(PKCS12_MAC_DATA) = {
-	ASN1_SIMPLE(PKCS12_MAC_DATA, dinfo, X509_SIG),
-	ASN1_SIMPLE(PKCS12_MAC_DATA, salt, ASN1_OCTET_STRING),
+ASN1_SEQUENCE(PKCS12_MAC_DATA)
+	ASN1_SIMPLE(PKCS12_MAC_DATA, dinfo, X509_SIG)
+	ASN1_SIMPLE(PKCS12_MAC_DATA, salt, ASN1_OCTET_STRING)
 	ASN1_OPT(PKCS12_MAC_DATA, iter, ASN1_INTEGER)
-} ASN1_SEQUENCE_END(PKCS12_MAC_DATA)
+ASN1_SEQUENCE_END(PKCS12_MAC_DATA)
 
-IMPLEMENT_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
+IMPLEMENT_ASN1_FUNCTIONS3(PKCS12_MAC_DATA)
 
-ASN1_ADB_TEMPLATE(bag_default) = ASN1_EXP(PKCS12_BAGS, value.other, ASN1_ANY, 0);
-
-ASN1_ADB(PKCS12_BAGS) = {
-	ADB_ENTRY(NID_x509Certificate, ASN1_EXP(PKCS12_BAGS, value.x509cert, ASN1_OCTET_STRING, 0)),
-	ADB_ENTRY(NID_x509Crl, ASN1_EXP(PKCS12_BAGS, value.x509crl, ASN1_OCTET_STRING, 0)),
-	ADB_ENTRY(NID_sdsiCertificate, ASN1_EXP(PKCS12_BAGS, value.sdsicert, ASN1_IA5STRING, 0)),
-} ASN1_ADB_END(PKCS12_BAGS, 0, type, 0, &bag_default_tt, NULL);
-
-ASN1_SEQUENCE(PKCS12_BAGS) = {
-	ASN1_SIMPLE(PKCS12_BAGS, type, ASN1_OBJECT),
-	ASN1_ADB_OBJECT(PKCS12_BAGS),
-} ASN1_SEQUENCE_END(PKCS12_BAGS)
-
-IMPLEMENT_ASN1_FUNCTIONS(PKCS12_BAGS)
-
-ASN1_ADB_TEMPLATE(safebag_default) = ASN1_EXP(PKCS12_SAFEBAG, value.other, ASN1_ANY, 0);
-
-ASN1_ADB(PKCS12_SAFEBAG) = {
-	ADB_ENTRY(NID_keyBag, ASN1_EXP(PKCS12_SAFEBAG, value.keybag, PKCS8_PRIV_KEY_INFO, 0)),
-	ADB_ENTRY(NID_pkcs8ShroudedKeyBag, ASN1_EXP(PKCS12_SAFEBAG, value.shkeybag, X509_SIG, 0)),
-	ADB_ENTRY(NID_safeContentsBag, ASN1_EXP_SET_OF(PKCS12_SAFEBAG, value.safes, PKCS12_SAFEBAG, 0)),
-	ADB_ENTRY(NID_certBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)),
-	ADB_ENTRY(NID_crlBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)),
-	ADB_ENTRY(NID_secretBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0))
-} ASN1_ADB_END(PKCS12_SAFEBAG, 0, type, 0, &safebag_default_tt, NULL);
-
-ASN1_SEQUENCE(PKCS12_SAFEBAG) = {
-	ASN1_SIMPLE(PKCS12_SAFEBAG, type, ASN1_OBJECT),
-	ASN1_ADB_OBJECT(PKCS12_SAFEBAG),
+ASN1_ADB_TEMPLATE(bag_default)
+	ASN1_EXP1(PKCS12_BAGS, value.other, ASN1_ANY, 0)
+ASN1_ADB_TEMPLATE_END
+
+ASN1_ADB_SEQ(PKCS12_BAGS)
+	ADB_ENTRY(NID_x509Certificate, ASN1_EXP2(PKCS12_BAGS, value.x509cert, ASN1_OCTET_STRING, 0))
+	ADB_ENTRY(NID_x509Crl, ASN1_EXP2(PKCS12_BAGS, value.x509crl, ASN1_OCTET_STRING, 0))
+	ADB_ENTRY(NID_sdsiCertificate, ASN1_EXP2(PKCS12_BAGS, value.sdsicert, ASN1_IA5STRING, 0))
+ASN1_ADB_END(PKCS12_BAGS, 0, type, 0, bag_default_tt, NULL)
+
+ASN1_SEQUENCE(PKCS12_BAGS)
+	ASN1_SIMPLE(PKCS12_BAGS, type, ASN1_OBJECT)
+	ASN1_ADB_OBJECT(PKCS12_BAGS)
+ASN1_SEQUENCE_END(PKCS12_BAGS)
+
+IMPLEMENT_ASN1_FUNCTIONS3(PKCS12_BAGS)
+
+ASN1_ADB_TEMPLATE(safebag_default)
+	ASN1_EXP1(PKCS12_SAFEBAG, value.other, ASN1_ANY, 0)
+ASN1_ADB_TEMPLATE_END
+
+ASN1_ADB_SEQ(PKCS12_SAFEBAG)
+	ADB_ENTRY(NID_keyBag, ASN1_EXP2(PKCS12_SAFEBAG, value.keybag, PKCS8_PRIV_KEY_INFO, 0))
+	ADB_ENTRY(NID_pkcs8ShroudedKeyBag, ASN1_EXP2(PKCS12_SAFEBAG, value.shkeybag, X509_SIG, 0))
+	ADB_ENTRY(NID_safeContentsBag, ASN1_EXP_SET_OF2(PKCS12_SAFEBAG, value.safes, PKCS12_SAFEBAG, 0))
+	ADB_ENTRY(NID_certBag, ASN1_EXP2(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0))
+	ADB_ENTRY(NID_crlBag, ASN1_EXP2(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0))
+	ADB_ENTRY(NID_secretBag, ASN1_EXP2(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0))
+ASN1_ADB_END(PKCS12_SAFEBAG, 0, type, 0, safebag_default_tt, NULL)
+
+ASN1_SEQUENCE(PKCS12_SAFEBAG)
+	ASN1_SIMPLE(PKCS12_SAFEBAG, type, ASN1_OBJECT)
+	ASN1_ADB_OBJECT(PKCS12_SAFEBAG)
 	ASN1_SET_OF_OPT(PKCS12_SAFEBAG, attrib, X509_ATTRIBUTE)
-} ASN1_SEQUENCE_END(PKCS12_SAFEBAG)
+ASN1_SEQUENCE_END(PKCS12_SAFEBAG)
 
-IMPLEMENT_ASN1_FUNCTIONS(PKCS12_SAFEBAG)
+IMPLEMENT_ASN1_FUNCTIONS3(PKCS12_SAFEBAG)
 
 /* SEQUENCE OF SafeBag */
-ASN1_ITEM_TEMPLATE(PKCS12_SAFEBAGS) = 
+ASN1_ITEM_TEMPLATE(PKCS12_SAFEBAGS)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, PKCS12_SAFEBAGS, PKCS12_SAFEBAG)
 ASN1_ITEM_TEMPLATE_END(PKCS12_SAFEBAGS)
 
 /* Authsafes: SEQUENCE OF PKCS7 */
-ASN1_ITEM_TEMPLATE(PKCS12_AUTHSAFES) = 
+ASN1_ITEM_TEMPLATE(PKCS12_AUTHSAFES)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, PKCS12_AUTHSAFES, PKCS7)
 ASN1_ITEM_TEMPLATE_END(PKCS12_AUTHSAFES)
 
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_attr.c openssl-1.0.0q/crypto/pkcs12/p12_attr.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_attr.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_attr.c	2017-04-25 16:23:40.578620464 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
 
 /* Add a local keyid to a safebag */
@@ -74,6 +77,7 @@
 
 /* Add key usage to PKCS#8 structure */
 
+#ifndef OPERA_SMALL_VERSION
 int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage)
 {
 	unsigned char us_val;
@@ -84,6 +88,7 @@
 	else
 		return 0;
 }
+#endif
 
 /* Add a friendlyname to a safebag */
 
@@ -98,6 +103,7 @@
 }
 
 
+#ifndef OPERA_SMALL_VERSION
 int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
 				 const unsigned char *name, int namelen)
 {
@@ -117,6 +123,7 @@
 	else
 		return 0;
 }
+#endif
 
 ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid)
 {
@@ -134,6 +141,7 @@
 	return NULL;
 }
 
+#ifndef OPERA_SMALL_VERSION
 char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag)
 {
 	ASN1_TYPE *atype;
@@ -142,4 +150,6 @@
 	return OPENSSL_uni2asc(atype->value.bmpstring->data,
 				 atype->value.bmpstring->length);
 }
+#endif
 
+#endif  // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_crpt.c openssl-1.0.0q/crypto/pkcs12/p12_crpt.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_crpt.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_crpt.c	2017-04-25 16:23:40.579620870 +0200
@@ -56,8 +56,13 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
 
 /* PKCS#12 PBE algorithms now in static table */
@@ -73,7 +78,7 @@
 	int saltlen, iter, ret;
 	unsigned char *salt;
 	const unsigned char *pbuf;
-	unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH];
+	unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH]; /* ARRAY OK 2004-02-18 yngve */
 
 	/* Extract useful info from parameter */
 	if (param == NULL || param->type != V_ASN1_SEQUENCE ||
@@ -110,3 +115,5 @@
 	OPENSSL_cleanse(iv, EVP_MAX_IV_LENGTH);
 	return ret;
 }
+
+#endif //LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_crt.c openssl-1.0.0q/crypto/pkcs12/p12_crt.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_crt.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_crt.c	2017-04-25 16:23:40.581620286 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
 
 
@@ -85,7 +88,7 @@
 	STACK_OF(PKCS12_SAFEBAG) *bags = NULL;
 	PKCS12_SAFEBAG *bag = NULL;
 	int i;
-	unsigned char keyid[EVP_MAX_MD_SIZE];
+	unsigned char keyid[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-05-25 yngve */
 	unsigned int keyidlen = 0;
 
 	/* Set defaults */
@@ -239,8 +242,10 @@
 	/* Make a PKCS#8 structure */
 	if(!(p8 = EVP_PKEY2PKCS8(key)))
 		goto err;
+#ifndef OPERA_SMALL_VERSION
 	if(key_usage && !PKCS8_add_keyusage(p8, key_usage))
 		goto err;
+#endif
 	if (nid_key != -1)
 		{
 		bag = PKCS12_MAKE_SHKEYBAG(nid_key, pass, -1, NULL, 0, iter, p8);
@@ -365,3 +370,4 @@
 	return p12;
 
 	}
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_decr.c openssl-1.0.0q/crypto/pkcs12/p12_decr.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_decr.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_decr.c	2017-04-25 16:23:40.582621531 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
 
 /* Define this to dump decrypted output to files called DERnnn */
@@ -84,7 +87,7 @@
 		return NULL;
 	}
 
-	if(!(out = OPENSSL_malloc(inlen + EVP_CIPHER_CTX_block_size(&ctx)))) {
+	if(!(out = (unsigned char *) OPENSSL_malloc(inlen + EVP_CIPHER_CTX_block_size(&ctx)))) {
 		PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,ERR_R_MALLOC_FAILURE);
 		goto err;
 	}
@@ -128,9 +131,9 @@
 	{
 		FILE *op;
 
-		char fname[30];
+		char fname[30]; /* ARRAY OK 2007-04-24 yngve DEBUG */
 		static int fnm = 1;
-		sprintf(fname, "DER%d", fnm++);
+		op_sprintf(fname, "DER%d", fnm++);
 		op = fopen(fname, "wb");
 		fwrite (p, 1, outlen, op);
 		fclose(op);
@@ -158,15 +161,17 @@
 		PKCS12err(PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT,ERR_R_MALLOC_FAILURE);
 		return NULL;
 	}
-	inlen = ASN1_item_i2d(obj, &in, it);
+	inlen = ASN1_item_i2d((ASN1_VALUE *) obj, &in, it);
 	if (!in) {
 		PKCS12err(PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT,PKCS12_R_ENCODE_ERROR);
+		M_ASN1_OCTET_STRING_free(oct);
 		return NULL;
 	}
 	if (!PKCS12_pbe_crypt(algor, pass, passlen, in, inlen, &oct->data,
 				 &oct->length, 1)) {
 		PKCS12err(PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT,PKCS12_R_ENCRYPT_ERROR);
 		OPENSSL_free(in);
+		M_ASN1_OCTET_STRING_free(oct);
 		return NULL;
 	}
 	if (zbuf) OPENSSL_cleanse(in, inlen);
@@ -175,3 +180,5 @@
 }
 
 IMPLEMENT_PKCS12_STACK_OF(PKCS7)
+
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_init.c openssl-1.0.0q/crypto/pkcs12/p12_init.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_init.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_init.c	2017-04-25 16:23:40.583621658 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
 
 /* Initialise a PKCS12 structure to take data */
@@ -90,3 +93,5 @@
 	if (pkcs12 != NULL) PKCS12_free(pkcs12);
 	return NULL;
 }
+
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_key.c openssl-1.0.0q/crypto/pkcs12/p12_key.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_key.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_key.c	2017-04-25 16:23:40.584621227 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
 #include <openssl/bn.h>
 
@@ -135,14 +138,14 @@
 	u = EVP_MD_size (md_type);
 	if (u < 0)
 	    return 0;
-	D = OPENSSL_malloc (v);
-	Ai = OPENSSL_malloc (u);
-	B = OPENSSL_malloc (v + 1);
+	D  = (unsigned char *) OPENSSL_malloc (v);
+	Ai = (unsigned char *) OPENSSL_malloc (u);
+	B  = (unsigned char *) OPENSSL_malloc (v + 1);
 	Slen = v * ((saltlen+v-1)/v);
 	if(passlen) Plen = v * ((passlen+v-1)/v);
 	else Plen = 0;
 	Ilen = Slen + Plen;
-	I = OPENSSL_malloc (Ilen);
+	I = (unsigned char *) OPENSSL_malloc (Ilen);
 	Ij = BN_new();
 	Bpl1 = BN_new();
 	if (!D || !Ai || !B || !I || !Ij || !Bpl1)
@@ -161,7 +164,7 @@
 			EVP_DigestUpdate(&ctx, Ai, u);
 			EVP_DigestFinal_ex(&ctx, Ai, NULL);
 		}
-		memcpy (out, Ai, min (n, u));
+		op_memcpy (out, Ai, min (n, u));
 		if (u >= n) {
 #ifdef DEBUG_KEYGEN
 			fprintf(stderr, "Output KEY (length %d)\n", tmpn);
@@ -184,11 +187,11 @@
 			/* If more than 2^(v*8) - 1 cut off MSB */
 			if (Ijlen > v) {
 				BN_bn2bin (Ij, B);
-				memcpy (I + j, B + 1, v);
+				op_memcpy (I + j, B + 1, v);
 #ifndef PKCS12_BROKEN_KEYGEN
 			/* If less than v bytes pad with zeroes */
 			} else if (Ijlen < v) {
-				memset(I + j, 0, v - Ijlen);
+				op_memset(I + j, 0, v - Ijlen);
 				BN_bn2bin(Ij, I + j + v - Ijlen); 
 #endif
 			} else BN_bn2bin (Ij, I + j);
@@ -215,3 +218,5 @@
 	fprintf(stderr, "\n");	
 }
 #endif
+
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_kiss.c openssl-1.0.0q/crypto/pkcs12/p12_kiss.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_kiss.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_kiss.c	2017-04-25 16:23:40.585620795 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
 
 /* Simplified PKCS#12 routines */
@@ -163,9 +166,15 @@
  err:
 
 	if (pkey && *pkey)
+	{
 		EVP_PKEY_free(*pkey);
+                *pkey = NULL;
+        }
 	if (cert && *cert)
+	{
 		X509_free(*cert);
+		*cert = NULL;
+        }
 	if (x)
 		X509_free(x);
 	if (ocerts)
@@ -300,3 +309,4 @@
 	return 1;
 }
 
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_mutl.c openssl-1.0.0q/crypto/pkcs12/p12_mutl.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_mutl.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_mutl.c	2017-04-25 16:23:40.586621201 +0200
@@ -56,9 +56,12 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
 #ifndef OPENSSL_NO_HMAC
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/hmac.h>
 #include <openssl/rand.h>
 #include <openssl/pkcs12.h>
@@ -69,7 +72,7 @@
 {
 	const EVP_MD *md_type;
 	HMAC_CTX hmac;
-	unsigned char key[EVP_MAX_MD_SIZE], *salt;
+	unsigned char key[EVP_MAX_MD_SIZE], *salt; /* ARRAY OK 2004-02-18 yngve */
 	int saltlen, iter;
 	int md_size;
 
@@ -83,8 +86,18 @@
 	saltlen = p12->mac->salt->length;
 	if (!p12->mac->iter) iter = 1;
 	else iter = ASN1_INTEGER_get (p12->mac->iter);
-    	if(!(md_type =
-		 EVP_get_digestbyobj (p12->mac->dinfo->algor->algorithm))) {
+
+#ifndef  OPENSSL_NO_SHA
+	if(
+#ifndef LIBOPEAY_DISABLE_SHA1_PARTIAL
+		g_turn_off_sha1 &&
+#endif
+		OBJ_obj2nid(p12->mac->dinfo->algor->algorithm) == NID_sha1)
+			md_type = EVP_sha1();
+	else
+#endif
+	if(!(md_type =
+		EVP_get_digestbyobj (p12->mac->dinfo->algor->algorithm))) {
 		PKCS12err(PKCS12_F_PKCS12_GEN_MAC,PKCS12_R_UNKNOWN_DIGEST_ALGORITHM);
 		return 0;
 	}
@@ -108,7 +121,7 @@
 /* Verify the mac */
 int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen)
 {
-	unsigned char mac[EVP_MAX_MD_SIZE];
+	unsigned char mac[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-05-25 yngve */
 	unsigned int maclen;
 	if(p12->mac == NULL) {
 		PKCS12err(PKCS12_F_PKCS12_VERIFY_MAC,PKCS12_R_MAC_ABSENT);
@@ -119,7 +132,7 @@
 		return 0;
 	}
 	if ((maclen != (unsigned int)p12->mac->dinfo->digest->length)
-	|| memcmp (mac, p12->mac->dinfo->digest->data, maclen)) return 0;
+	|| op_memcmp (mac, p12->mac->dinfo->digest->data, maclen)) return 0;
 	return 1;
 }
 
@@ -128,7 +141,7 @@
 int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
 	     unsigned char *salt, int saltlen, int iter, const EVP_MD *md_type)
 {
-	unsigned char mac[EVP_MAX_MD_SIZE];
+	unsigned char mac[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-05-25 yngve */
 	unsigned int maclen;
 
 	if (!md_type) md_type = EVP_sha1();
@@ -165,7 +178,7 @@
 	}
 	if (!saltlen) saltlen = PKCS12_SALT_LEN;
 	p12->mac->salt->length = saltlen;
-	if (!(p12->mac->salt->data = OPENSSL_malloc (saltlen))) {
+	if (!(p12->mac->salt->data = (unsigned char *) OPENSSL_malloc (saltlen))) {
 		PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE);
 		return 0;
 	}
@@ -173,7 +186,7 @@
 		if (RAND_pseudo_bytes (p12->mac->salt->data, saltlen) < 0)
 			return 0;
 	}
-	else memcpy (p12->mac->salt->data, salt, saltlen);
+	else op_memcpy (p12->mac->salt->data, salt, saltlen);
 	p12->mac->dinfo->algor->algorithm = OBJ_nid2obj(EVP_MD_type(md_type));
 	if (!(p12->mac->dinfo->algor->parameter = ASN1_TYPE_new())) {
 		PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE);
@@ -184,3 +197,4 @@
 	return 1;
 }
 #endif
+#endif  // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_npas.c openssl-1.0.0q/crypto/pkcs12/p12_npas.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_npas.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_npas.c	2017-04-25 16:23:40.587620490 +0200
@@ -56,9 +56,12 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
+
 #include <openssl/pem.h>
 #include <openssl/err.h>
 #include <openssl/pkcs12.h>
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_p8d.c openssl-1.0.0q/crypto/pkcs12/p12_p8d.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_p8d.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_p8d.c	2017-04-25 16:23:40.588620617 +0200
@@ -56,13 +56,19 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
+#include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, int passlen)
 {
-	return PKCS12_item_decrypt_d2i(p8->algor, ASN1_ITEM_rptr(PKCS8_PRIV_KEY_INFO), pass,
+	return (PKCS8_PRIV_KEY_INFO *) PKCS12_item_decrypt_d2i(p8->algor, ASN1_ITEM_rptr(PKCS8_PRIV_KEY_INFO), pass,
 					passlen, p8->digest, 1);
 }
+#endif // LIBOPEAY_PKCS12_SUPPORT
 
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_p8e.c openssl-1.0.0q/crypto/pkcs12/p12_p8e.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_p8e.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_p8e.c	2017-04-25 16:23:40.588620617 +0200
@@ -56,9 +56,14 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
+#include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
 			 const char *pass, int passlen,
@@ -73,7 +78,14 @@
 		goto err;
 	}
 
-	if(pbe_nid == -1) pbe = PKCS5_pbe2_set(cipher, iter, salt, saltlen);
+	if(pbe_nid == -1)
+	{
+#ifndef OPERA_SMALL_VERSION
+		pbe = PKCS5_pbe2_set(cipher, iter, salt, saltlen);
+#else
+		pbe = NULL;
+#endif
+	}
 	else pbe = PKCS5_pbe_set(pbe_nid, iter, salt, saltlen);
 	if(!pbe) {
 		PKCS12err(PKCS12_F_PKCS8_ENCRYPT, ERR_R_ASN1_LIB);
@@ -95,3 +107,4 @@
 	X509_SIG_free(p8);
 	return NULL;
 }
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/p12_utl.c openssl-1.0.0q/crypto/pkcs12/p12_utl.c
--- openssl-1.0.0q.orig/crypto/pkcs12/p12_utl.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/p12_utl.c	2017-04-25 16:23:40.589620745 +0200
@@ -56,9 +56,14 @@
  *
  */
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/pkcs12.h>
+#include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Cheap and nasty Unicode stuff */
 
@@ -66,9 +71,9 @@
 {
 	int ulen, i;
 	unsigned char *unitmp;
-	if (asclen == -1) asclen = strlen(asc);
+	if (asclen == -1) asclen = op_strlen(asc);
 	ulen = asclen*2  + 2;
-	if (!(unitmp = OPENSSL_malloc(ulen))) return NULL;
+	if (!(unitmp = (unsigned char *) OPENSSL_malloc(ulen))) return NULL;
 	for (i = 0; i < ulen - 2; i+=2) {
 		unitmp[i] = 0;
 		unitmp[i + 1] = asc[i>>1];
@@ -81,6 +86,7 @@
 	return unitmp;
 }
 
+#ifndef OPERA_SMALL_VERSION
 char *OPENSSL_uni2asc(unsigned char *uni, int unilen)
 {
 	int asclen, i;
@@ -94,11 +100,14 @@
 	asctmp[asclen - 1] = 0;
 	return asctmp;
 }
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12)
 {
 	return ASN1_item_i2d_bio(ASN1_ITEM_rptr(PKCS12), bp, p12);
 }
+#endif
 
 #ifndef OPENSSL_NO_FP_API
 int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12)
@@ -107,10 +116,13 @@
 }
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12)
 {
 	return ASN1_item_d2i_bio(ASN1_ITEM_rptr(PKCS12), bp, p12);
 }
+#endif
+
 #ifndef OPENSSL_NO_FP_API
 PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12)
 {
@@ -124,19 +136,22 @@
 			NID_x509Certificate, NID_certBag);
 }
 
+#ifndef OPERA_SMALL_VERSION
 PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl)
 {
 	return PKCS12_item_pack_safebag(crl, ASN1_ITEM_rptr(X509_CRL),
 			NID_x509Crl, NID_crlBag);
 }
+#endif
 
 X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag)
 {
 	if(M_PKCS12_bag_type(bag) != NID_certBag) return NULL;
 	if(M_PKCS12_cert_bag_type(bag) != NID_x509Certificate) return NULL;
-	return ASN1_item_unpack(bag->value.bag->value.octet, ASN1_ITEM_rptr(X509));
+	return (X509 *) ASN1_item_unpack(bag->value.bag->value.octet, ASN1_ITEM_rptr(X509));
 }
 
+#ifndef OPERA_SMALL_VERSION
 X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag)
 {
 	if(M_PKCS12_bag_type(bag) != NID_crlBag) return NULL;
@@ -144,3 +159,5 @@
 	return ASN1_item_unpack(bag->value.bag->value.octet,
 							ASN1_ITEM_rptr(X509_CRL));
 }
+#endif
+#endif // LIBOPEAY_PKCS12_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/pk12err.c openssl-1.0.0q/crypto/pkcs12/pk12err.c
--- openssl-1.0.0q.orig/crypto/pkcs12/pk12err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/pk12err.c	2017-04-25 16:23:40.590621151 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/pkcs12.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/pkcs12/pkcs12.h openssl-1.0.0q/crypto/pkcs12/pkcs12.h
--- openssl-1.0.0q.orig/crypto/pkcs12/pkcs12.h	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs12/pkcs12.h	2017-04-25 16:23:40.591620999 +0200
@@ -257,9 +257,13 @@
 PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
 
 int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12);
+#ifndef OPENSSL_NO_FP_API
 int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12);
+#endif
 PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
+#ifndef OPENSSL_NO_FP_API
 PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
+#endif
 int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
 
 /* BEGIN ERROR CODES */
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/.gitignore openssl-1.0.0q/crypto/pkcs7/.gitignore
--- openssl-1.0.0q.orig/crypto/pkcs7/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/.gitignore	2017-04-25 16:23:40.591620999 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/opera_pk7_asn1.cpp openssl-1.0.0q/crypto/pkcs7/opera_pk7_asn1.cpp
--- openssl-1.0.0q.orig/crypto/pkcs7/opera_pk7_asn1.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/opera_pk7_asn1.cpp	2017-04-25 16:23:40.592620288 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs7/pk7_asn1.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/opera_pk7_attr.cpp openssl-1.0.0q/crypto/pkcs7/opera_pk7_attr.cpp
--- openssl-1.0.0q.orig/crypto/pkcs7/opera_pk7_attr.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/opera_pk7_attr.cpp	2017-04-25 16:23:40.592620288 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs7/pk7_attr.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/opera_pk7_doit.cpp openssl-1.0.0q/crypto/pkcs7/opera_pk7_doit.cpp
--- openssl-1.0.0q.orig/crypto/pkcs7/opera_pk7_doit.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/opera_pk7_doit.cpp	2017-04-25 16:23:40.593621812 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs7/pk7_doit.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/opera_pk7_lib.cpp openssl-1.0.0q/crypto/pkcs7/opera_pk7_lib.cpp
--- openssl-1.0.0q.orig/crypto/pkcs7/opera_pk7_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/opera_pk7_lib.cpp	2017-04-25 16:23:40.593621812 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/pkcs7/pk7_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/pk7_asn1.c openssl-1.0.0q/crypto/pkcs7/pk7_asn1.c
--- openssl-1.0.0q.orig/crypto/pkcs7/pk7_asn1.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/pk7_asn1.c	2017-04-25 16:23:40.594621380 +0200
@@ -56,32 +56,37 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/pkcs7.h>
 #include <openssl/x509.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* PKCS#7 ASN1 module */
 
 /* This is the ANY DEFINED BY table for the top level PKCS#7 structure */
 
-ASN1_ADB_TEMPLATE(p7default) = ASN1_EXP_OPT(PKCS7, d.other, ASN1_ANY, 0);
-
-ASN1_ADB(PKCS7) = {
-	ADB_ENTRY(NID_pkcs7_data, ASN1_NDEF_EXP_OPT(PKCS7, d.data, ASN1_OCTET_STRING_NDEF, 0)),
-	ADB_ENTRY(NID_pkcs7_signed, ASN1_NDEF_EXP_OPT(PKCS7, d.sign, PKCS7_SIGNED, 0)),
-	ADB_ENTRY(NID_pkcs7_enveloped, ASN1_NDEF_EXP_OPT(PKCS7, d.enveloped, PKCS7_ENVELOPE, 0)),
-	ADB_ENTRY(NID_pkcs7_signedAndEnveloped, ASN1_NDEF_EXP_OPT(PKCS7, d.signed_and_enveloped, PKCS7_SIGN_ENVELOPE, 0)),
-	ADB_ENTRY(NID_pkcs7_digest, ASN1_NDEF_EXP_OPT(PKCS7, d.digest, PKCS7_DIGEST, 0)),
-	ADB_ENTRY(NID_pkcs7_encrypted, ASN1_NDEF_EXP_OPT(PKCS7, d.encrypted, PKCS7_ENCRYPT, 0))
-} ASN1_ADB_END(PKCS7, 0, type, 0, &p7default_tt, NULL);
+ASN1_ADB_TEMPLATE(p7default)
+	ASN1_EXP_OPT1(PKCS7, d.other, ASN1_ANY, 0)
+ASN1_ADB_TEMPLATE_END
+
+ASN1_ADB_SEQ(PKCS7)
+	ADB_ENTRY(NID_pkcs7_data, ASN1_NDEF_EXP_OPT2(PKCS7, d.data, ASN1_OCTET_STRING_NDEF, 0))
+	ADB_ENTRY(NID_pkcs7_signed, ASN1_NDEF_EXP_OPT2(PKCS7, d.sign, PKCS7_SIGNED, 0))
+	ADB_ENTRY(NID_pkcs7_enveloped, ASN1_NDEF_EXP_OPT2(PKCS7, d.enveloped, PKCS7_ENVELOPE, 0))
+	ADB_ENTRY(NID_pkcs7_signedAndEnveloped, ASN1_NDEF_EXP_OPT2(PKCS7, d.signed_and_enveloped, PKCS7_SIGN_ENVELOPE, 0))
+	ADB_ENTRY(NID_pkcs7_digest, ASN1_NDEF_EXP_OPT2(PKCS7, d.digest, PKCS7_DIGEST, 0))
+	ADB_ENTRY(NID_pkcs7_encrypted, ASN1_NDEF_EXP_OPT2(PKCS7, d.encrypted, PKCS7_ENCRYPT, 0))
+ASN1_ADB_END(PKCS7, 0, type, 0, p7default_tt, NULL)
 
 /* PKCS#7 streaming support */
 static int pk7_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
 							void *exarg)
 {
-	ASN1_STREAM_ARG *sarg = exarg;
+	ASN1_STREAM_ARG *sarg = (ASN1_STREAM_ARG *)exarg;
 	PKCS7 **pp7 = (PKCS7 **)pval;
 
 	switch(operation)
@@ -106,23 +111,26 @@
 	return 1;
 }
 
-ASN1_NDEF_SEQUENCE_cb(PKCS7, pk7_cb) = {
-	ASN1_SIMPLE(PKCS7, type, ASN1_OBJECT),
+ASN1_NDEF_SEQUENCE_cb(PKCS7, pk7_cb)
+	ASN1_SIMPLE(PKCS7, type, ASN1_OBJECT)
 	ASN1_ADB_OBJECT(PKCS7)
-}ASN1_NDEF_SEQUENCE_END_cb(PKCS7, PKCS7)
+ASN1_NDEF_SEQUENCE_END_cb(PKCS7, PKCS7)
 
 IMPLEMENT_ASN1_FUNCTIONS(PKCS7)
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_NDEF_FUNCTION(PKCS7)
 IMPLEMENT_ASN1_DUP_FUNCTION(PKCS7)
+#endif
+
 
-ASN1_NDEF_SEQUENCE(PKCS7_SIGNED) = {
-	ASN1_SIMPLE(PKCS7_SIGNED, version, ASN1_INTEGER),
-	ASN1_SET_OF(PKCS7_SIGNED, md_algs, X509_ALGOR),
-	ASN1_SIMPLE(PKCS7_SIGNED, contents, PKCS7),
-	ASN1_IMP_SEQUENCE_OF_OPT(PKCS7_SIGNED, cert, X509, 0),
-	ASN1_IMP_SET_OF_OPT(PKCS7_SIGNED, crl, X509_CRL, 1),
+ASN1_NDEF_SEQUENCE(PKCS7_SIGNED)
+	ASN1_SIMPLE(PKCS7_SIGNED, version, ASN1_INTEGER)
+	ASN1_SET_OF(PKCS7_SIGNED, md_algs, X509_ALGOR)
+	ASN1_SIMPLE(PKCS7_SIGNED, contents, PKCS7)
+	ASN1_IMP_SEQUENCE_OF_OPT(PKCS7_SIGNED, cert, X509, 0)
+	ASN1_IMP_SET_OF_OPT(PKCS7_SIGNED, crl, X509_CRL, 1)
 	ASN1_SET_OF(PKCS7_SIGNED, signer_info, PKCS7_SIGNER_INFO)
-} ASN1_NDEF_SEQUENCE_END(PKCS7_SIGNED)
+ASN1_NDEF_SEQUENCE_END(PKCS7_SIGNED)
 
 IMPLEMENT_ASN1_FUNCTIONS(PKCS7_SIGNED)
 
@@ -137,37 +145,41 @@
 	return 1;
 }
 
-ASN1_SEQUENCE_cb(PKCS7_SIGNER_INFO, si_cb) = {
-	ASN1_SIMPLE(PKCS7_SIGNER_INFO, version, ASN1_INTEGER),
-	ASN1_SIMPLE(PKCS7_SIGNER_INFO, issuer_and_serial, PKCS7_ISSUER_AND_SERIAL),
-	ASN1_SIMPLE(PKCS7_SIGNER_INFO, digest_alg, X509_ALGOR),
+ASN1_SEQUENCE_cb(PKCS7_SIGNER_INFO, si_cb)
+	ASN1_SIMPLE(PKCS7_SIGNER_INFO, version, ASN1_INTEGER)
+	ASN1_SIMPLE(PKCS7_SIGNER_INFO, issuer_and_serial, PKCS7_ISSUER_AND_SERIAL)
+	ASN1_SIMPLE(PKCS7_SIGNER_INFO, digest_alg, X509_ALGOR)
 	/* NB this should be a SET OF but we use a SEQUENCE OF so the
 	 * original order * is retained when the structure is reencoded.
 	 * Since the attributes are implicitly tagged this will not affect
 	 * the encoding.
 	 */
-	ASN1_IMP_SEQUENCE_OF_OPT(PKCS7_SIGNER_INFO, auth_attr, X509_ATTRIBUTE, 0),
-	ASN1_SIMPLE(PKCS7_SIGNER_INFO, digest_enc_alg, X509_ALGOR),
-	ASN1_SIMPLE(PKCS7_SIGNER_INFO, enc_digest, ASN1_OCTET_STRING),
+	ASN1_IMP_SEQUENCE_OF_OPT(PKCS7_SIGNER_INFO, auth_attr, X509_ATTRIBUTE, 0)
+	ASN1_SIMPLE(PKCS7_SIGNER_INFO, digest_enc_alg, X509_ALGOR)
+	ASN1_SIMPLE(PKCS7_SIGNER_INFO, enc_digest, ASN1_OCTET_STRING)
 	ASN1_IMP_SET_OF_OPT(PKCS7_SIGNER_INFO, unauth_attr, X509_ATTRIBUTE, 1)
-} ASN1_SEQUENCE_END_cb(PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO)
+ASN1_SEQUENCE_END_cb(PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
+#endif
 
-ASN1_SEQUENCE(PKCS7_ISSUER_AND_SERIAL) = {
-	ASN1_SIMPLE(PKCS7_ISSUER_AND_SERIAL, issuer, X509_NAME),
+ASN1_SEQUENCE(PKCS7_ISSUER_AND_SERIAL)
+	ASN1_SIMPLE(PKCS7_ISSUER_AND_SERIAL, issuer, X509_NAME)
 	ASN1_SIMPLE(PKCS7_ISSUER_AND_SERIAL, serial, ASN1_INTEGER)
-} ASN1_SEQUENCE_END(PKCS7_ISSUER_AND_SERIAL)
+ASN1_SEQUENCE_END(PKCS7_ISSUER_AND_SERIAL)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
+#endif
 
-ASN1_NDEF_SEQUENCE(PKCS7_ENVELOPE) = {
-	ASN1_SIMPLE(PKCS7_ENVELOPE, version, ASN1_INTEGER),
-	ASN1_SET_OF(PKCS7_ENVELOPE, recipientinfo, PKCS7_RECIP_INFO),
+ASN1_NDEF_SEQUENCE(PKCS7_ENVELOPE)
+	ASN1_SIMPLE(PKCS7_ENVELOPE, version, ASN1_INTEGER)
+	ASN1_SET_OF(PKCS7_ENVELOPE, recipientinfo, PKCS7_RECIP_INFO)
 	ASN1_SIMPLE(PKCS7_ENVELOPE, enc_data, PKCS7_ENC_CONTENT)
-} ASN1_NDEF_SEQUENCE_END(PKCS7_ENVELOPE)
+ASN1_NDEF_SEQUENCE_END(PKCS7_ENVELOPE)
 
-IMPLEMENT_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
+IMPLEMENT_ASN1_FUNCTIONS3(PKCS7_ENVELOPE)
 
 /* Minor tweak to operation: free up X509 */
 static int ri_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
@@ -180,50 +192,57 @@
 	return 1;
 }
 
-ASN1_SEQUENCE_cb(PKCS7_RECIP_INFO, ri_cb) = {
-	ASN1_SIMPLE(PKCS7_RECIP_INFO, version, ASN1_INTEGER),
-	ASN1_SIMPLE(PKCS7_RECIP_INFO, issuer_and_serial, PKCS7_ISSUER_AND_SERIAL),
-	ASN1_SIMPLE(PKCS7_RECIP_INFO, key_enc_algor, X509_ALGOR),
+ASN1_SEQUENCE_cb(PKCS7_RECIP_INFO, ri_cb)
+	ASN1_SIMPLE(PKCS7_RECIP_INFO, version, ASN1_INTEGER)
+	ASN1_SIMPLE(PKCS7_RECIP_INFO, issuer_and_serial, PKCS7_ISSUER_AND_SERIAL)
+	ASN1_SIMPLE(PKCS7_RECIP_INFO, key_enc_algor, X509_ALGOR)
 	ASN1_SIMPLE(PKCS7_RECIP_INFO, enc_key, ASN1_OCTET_STRING)
-} ASN1_SEQUENCE_END_cb(PKCS7_RECIP_INFO, PKCS7_RECIP_INFO)
+ASN1_SEQUENCE_END_cb(PKCS7_RECIP_INFO, PKCS7_RECIP_INFO)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
+#endif
 
-ASN1_NDEF_SEQUENCE(PKCS7_ENC_CONTENT) = {
-	ASN1_SIMPLE(PKCS7_ENC_CONTENT, content_type, ASN1_OBJECT),
-	ASN1_SIMPLE(PKCS7_ENC_CONTENT, algorithm, X509_ALGOR),
+ASN1_NDEF_SEQUENCE(PKCS7_ENC_CONTENT)
+	ASN1_SIMPLE(PKCS7_ENC_CONTENT, content_type, ASN1_OBJECT)
+	ASN1_SIMPLE(PKCS7_ENC_CONTENT, algorithm, X509_ALGOR)
 	ASN1_IMP_OPT(PKCS7_ENC_CONTENT, enc_data, ASN1_OCTET_STRING_NDEF, 0)
-} ASN1_NDEF_SEQUENCE_END(PKCS7_ENC_CONTENT)
+ASN1_NDEF_SEQUENCE_END(PKCS7_ENC_CONTENT)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
+#endif
+
 
-ASN1_NDEF_SEQUENCE(PKCS7_SIGN_ENVELOPE) = {
-	ASN1_SIMPLE(PKCS7_SIGN_ENVELOPE, version, ASN1_INTEGER),
-	ASN1_SET_OF(PKCS7_SIGN_ENVELOPE, recipientinfo, PKCS7_RECIP_INFO),
-	ASN1_SET_OF(PKCS7_SIGN_ENVELOPE, md_algs, X509_ALGOR),
-	ASN1_SIMPLE(PKCS7_SIGN_ENVELOPE, enc_data, PKCS7_ENC_CONTENT),
-	ASN1_IMP_SET_OF_OPT(PKCS7_SIGN_ENVELOPE, cert, X509, 0),
-	ASN1_IMP_SET_OF_OPT(PKCS7_SIGN_ENVELOPE, crl, X509_CRL, 1),
+ASN1_NDEF_SEQUENCE(PKCS7_SIGN_ENVELOPE)
+	ASN1_SIMPLE(PKCS7_SIGN_ENVELOPE, version, ASN1_INTEGER)
+	ASN1_SET_OF(PKCS7_SIGN_ENVELOPE, recipientinfo, PKCS7_RECIP_INFO)
+	ASN1_SET_OF(PKCS7_SIGN_ENVELOPE, md_algs, X509_ALGOR)
+	ASN1_SIMPLE(PKCS7_SIGN_ENVELOPE, enc_data, PKCS7_ENC_CONTENT)
+	ASN1_IMP_SET_OF_OPT(PKCS7_SIGN_ENVELOPE, cert, X509, 0)
+	ASN1_IMP_SET_OF_OPT(PKCS7_SIGN_ENVELOPE, crl, X509_CRL, 1)
 	ASN1_SET_OF(PKCS7_SIGN_ENVELOPE, signer_info, PKCS7_SIGNER_INFO)
-} ASN1_NDEF_SEQUENCE_END(PKCS7_SIGN_ENVELOPE)
+ASN1_NDEF_SEQUENCE_END(PKCS7_SIGN_ENVELOPE)
 
-IMPLEMENT_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
+IMPLEMENT_ASN1_FUNCTIONS3(PKCS7_SIGN_ENVELOPE)
 
-ASN1_NDEF_SEQUENCE(PKCS7_ENCRYPT) = {
-	ASN1_SIMPLE(PKCS7_ENCRYPT, version, ASN1_INTEGER),
+ASN1_NDEF_SEQUENCE(PKCS7_ENCRYPT)
+	ASN1_SIMPLE(PKCS7_ENCRYPT, version, ASN1_INTEGER)
 	ASN1_SIMPLE(PKCS7_ENCRYPT, enc_data, PKCS7_ENC_CONTENT)
-} ASN1_NDEF_SEQUENCE_END(PKCS7_ENCRYPT)
+ASN1_NDEF_SEQUENCE_END(PKCS7_ENCRYPT)
 
-IMPLEMENT_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
+IMPLEMENT_ASN1_FUNCTIONS3(PKCS7_ENCRYPT)
 
-ASN1_NDEF_SEQUENCE(PKCS7_DIGEST) = {
-	ASN1_SIMPLE(PKCS7_DIGEST, version, ASN1_INTEGER),
-	ASN1_SIMPLE(PKCS7_DIGEST, md, X509_ALGOR),
-	ASN1_SIMPLE(PKCS7_DIGEST, contents, PKCS7),
+ASN1_NDEF_SEQUENCE(PKCS7_DIGEST)
+	ASN1_SIMPLE(PKCS7_DIGEST, version, ASN1_INTEGER)
+	ASN1_SIMPLE(PKCS7_DIGEST, md, X509_ALGOR)
+	ASN1_SIMPLE(PKCS7_DIGEST, contents, PKCS7)
 	ASN1_SIMPLE(PKCS7_DIGEST, digest, ASN1_OCTET_STRING)
-} ASN1_NDEF_SEQUENCE_END(PKCS7_DIGEST)
+ASN1_NDEF_SEQUENCE_END(PKCS7_DIGEST)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(PKCS7_DIGEST)
+#endif
 
 /* Specials for authenticated attributes */
 
@@ -231,7 +250,7 @@
  * encoding.
  */
 
-ASN1_ITEM_TEMPLATE(PKCS7_ATTR_SIGN) = 
+ASN1_ITEM_TEMPLATE(PKCS7_ATTR_SIGN)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SET_ORDER, 0, PKCS7_ATTRIBUTES, X509_ATTRIBUTE)
 ASN1_ITEM_TEMPLATE_END(PKCS7_ATTR_SIGN)
 
@@ -239,9 +258,11 @@
  * we use SEQUENCE OF and tag it to SET OF
  */
 
-ASN1_ITEM_TEMPLATE(PKCS7_ATTR_VERIFY) = 
+#ifndef OPERA_SMALL_VERSION
+ASN1_ITEM_TEMPLATE(PKCS7_ATTR_VERIFY)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF | ASN1_TFLG_IMPTAG | ASN1_TFLG_UNIVERSAL,
 				V_ASN1_SET, PKCS7_ATTRIBUTES, X509_ATTRIBUTE)
 ASN1_ITEM_TEMPLATE_END(PKCS7_ATTR_VERIFY)
 
 IMPLEMENT_ASN1_PRINT_FUNCTION(PKCS7)
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/pk7_attr.c openssl-1.0.0q/crypto/pkcs7/pk7_attr.c
--- openssl-1.0.0q.orig/crypto/pkcs7/pk7_attr.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/pk7_attr.c	2017-04-25 16:23:40.595620949 +0200
@@ -56,8 +56,12 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/bio.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
@@ -65,6 +69,8 @@
 #include <openssl/pkcs7.h>
 #include <openssl/x509.h>
 #include <openssl/err.h>
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, STACK_OF(X509_ALGOR) *cap)
 {
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/pk7_dgst.c openssl-1.0.0q/crypto/pkcs7/pk7_dgst.c
--- openssl-1.0.0q.orig/crypto/pkcs7/pk7_dgst.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/pk7_dgst.c	2017-04-25 16:23:40.596621076 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/rand.h>
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/pk7_doit.c openssl-1.0.0q/crypto/pkcs7/pk7_doit.c
--- openssl-1.0.0q.orig/crypto/pkcs7/pk7_doit.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/pk7_doit.c	2017-04-25 16:23:40.597620644 +0200
@@ -56,14 +56,20 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/rand.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 #include <openssl/err.h>
 
+#include "modules/libopeay/libopeay_arrays.h"
+
+
 static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
 			 void *value);
 static ASN1_TYPE *get_attribute(STACK_OF(X509_ATTRIBUTE) *sk, int nid);
@@ -169,7 +175,7 @@
 	if (EVP_PKEY_encrypt(pctx, NULL, &eklen, key, keylen) <= 0)
 		goto err;
 
-	ek = OPENSSL_malloc(eklen);
+	ek = (unsigned char *)OPENSSL_malloc(eklen);
 
 	if (ek == NULL)
 		{
@@ -197,6 +203,7 @@
 	}
 
 
+#ifndef OPERA_SMALL_VERSION
 static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen,
 			       PKCS7_RECIP_INFO *ri, EVP_PKEY *pkey)
 	{
@@ -259,6 +266,7 @@
 
 	return ret;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
 	{
@@ -324,8 +332,8 @@
 
 	if (evp_cipher != NULL)
 		{
-		unsigned char key[EVP_MAX_KEY_LENGTH];
-		unsigned char iv[EVP_MAX_IV_LENGTH];
+		unsigned char key[EVP_MAX_KEY_LENGTH]; /* ARRAY OK 2004-02-18 yngve */
+		unsigned char iv[EVP_MAX_IV_LENGTH]; /* ARRAY OK 2004-02-18 yngve */
 		int keylen,ivlen;
 		EVP_CIPHER_CTX *ctx;
 
@@ -405,6 +413,7 @@
 	return(out);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 static int pkcs7_cmp_ri(PKCS7_RECIP_INFO *ri, X509 *pcert)
 	{
 	int ret;
@@ -507,8 +516,8 @@
 	if (evp_cipher != NULL)
 		{
 #if 0
-		unsigned char key[EVP_MAX_KEY_LENGTH];
-		unsigned char iv[EVP_MAX_IV_LENGTH];
+		unsigned char key[EVP_MAX_KEY_LENGTH];	/* ARRAY OK UNUSED 2004-02-18 yngve */
+		unsigned char iv[EVP_MAX_IV_LENGTH];	/* ARRAY OK UNUSED 2004-02-18 yngve */
 		unsigned char *p;
 		int keylen,ivlen;
 		int max;
@@ -681,6 +690,7 @@
 		}
 	return(out);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 static BIO *PKCS7_find_digest(EVP_MD_CTX **pmd, BIO *bio, int nid)
 	{
@@ -702,12 +712,21 @@
 			return bio;
 		bio=BIO_next(bio);
 		}
+
+// Suppress warning "unreachable code".
+// TODO: submit a patch to OpenSSL about removing the return.
+#ifdef OPERA_SMALL_VERSION
+# if OPENSSL_VERSION_NUMBER != 0x1000007fL
+//#  error "Revisit this local patch on upgrade. The code may suddenly become reachable."
+# endif
+#else
 	return NULL;
+#endif // OPERA_SMALL_VERSION
 	}
 
 static int do_pkcs7_signed_attrib(PKCS7_SIGNER_INFO *si, EVP_MD_CTX *mctx)
 	{
-	unsigned char md_data[EVP_MAX_MD_SIZE];
+	unsigned char md_data[EVP_MAX_MD_SIZE]; /* ARRAY OK UNUSED 2011-09-12 alexeik */
 	unsigned int md_len;
 
 	/* Add signing time if not already present */
@@ -735,8 +754,7 @@
 
 	return 1;
 	}
-	
-				
+
 int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
 	{
 	int ret=0;
@@ -846,7 +864,7 @@
 				unsigned char *abuf = NULL;
 				unsigned int abuflen;
 				abuflen = EVP_PKEY_size(si->pkey);
-				abuf = OPENSSL_malloc(abuflen);
+				abuf = (unsigned char *)OPENSSL_malloc(abuflen);
 				if (!abuf)
 					goto err;
 
@@ -930,7 +948,7 @@
 	abuf = NULL;
 	if (EVP_DigestSignFinal(&mctx, NULL, &siglen) <= 0)
 		goto err;
-	abuf = OPENSSL_malloc(siglen);
+	abuf = (unsigned char *)OPENSSL_malloc(siglen);
 	if(!abuf)
 		goto err;
 	if (EVP_DigestSignFinal(&mctx, abuf, &siglen) <= 0)
@@ -957,6 +975,7 @@
 
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, BIO *bio,
 	     PKCS7 *p7, PKCS7_SIGNER_INFO *si)
 	{
@@ -1067,7 +1086,7 @@
 	sk=si->auth_attr;
 	if ((sk != NULL) && (sk_X509_ATTRIBUTE_num(sk) != 0))
 		{
-		unsigned char md_dat[EVP_MAX_MD_SIZE], *abuf = NULL;
+		unsigned char md_dat[EVP_MAX_MD_SIZE], *abuf = NULL; /* ARRAY OK 2004-02-18 yngve */
                 unsigned int md_len;
 		int alen;
 		ASN1_OCTET_STRING *message_digest;
@@ -1081,7 +1100,7 @@
 			goto err;
 			}
 		if ((message_digest->length != (int)md_len) ||
-			(memcmp(message_digest->data,md_dat,md_len)))
+			(op_memcmp(message_digest->data,md_dat,md_len)))
 			{
 #if 0
 {
@@ -1155,6 +1174,7 @@
 	ri=sk_PKCS7_RECIP_INFO_value(rsk,idx);
 	return(ri->issuer_and_serial);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid)
 	{
@@ -1188,6 +1208,7 @@
 	return(NULL);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk)
 {
 	ASN1_TYPE *astype;
@@ -1234,6 +1255,7 @@
 		}
 	return(1);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
 	     void *value)
@@ -1292,4 +1314,3 @@
 end:
 	return(1);
 	}
-
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/pk7_enc.c openssl-1.0.0q/crypto/pkcs7/pk7_enc.c
--- openssl-1.0.0q.orig/crypto/pkcs7/pk7_enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/pk7_enc.c	2017-04-25 16:23:40.598620492 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/rand.h>
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/pk7_lib.c openssl-1.0.0q/crypto/pkcs7/pk7_lib.c
--- openssl-1.0.0q.orig/crypto/pkcs7/pk7_lib.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/pk7_lib.c	2017-04-25 16:23:40.599621178 +0200
@@ -56,11 +56,14 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
-#include "asn1_locl.h"
+#include "../asn1/asn1_locl.h"
 
 long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg)
 	{
@@ -112,6 +115,7 @@
 	return(ret);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int PKCS7_content_new(PKCS7 *p7, int type)
 	{
 	PKCS7 *ret=NULL;
@@ -155,6 +159,7 @@
 err:
 	return(0);
 	}
+#endif
 
 int PKCS7_set_type(PKCS7 *p7, int type)
 	{
@@ -210,6 +215,7 @@
 						= OBJ_nid2obj(NID_pkcs7_data);
 		break;
 
+#ifndef OPERA_SMALL_VERSION
 	case NID_pkcs7_digest:
 		p7->type=obj;
 		if ((p7->d.digest=PKCS7_DIGEST_new())
@@ -217,6 +223,7 @@
 		if (!ASN1_INTEGER_set(p7->d.digest->version,0))
 			goto err;
 		break;
+#endif
 	default:
 		PKCS7err(PKCS7_F_PKCS7_SET_TYPE,PKCS7_R_UNSUPPORTED_CONTENT_TYPE);
 		goto err;
@@ -226,13 +233,7 @@
 	return(0);
 	}
 
-int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other)
-	{
-	p7->type = OBJ_nid2obj(type);
-	p7->d.other = other;
-	return 1;
-	}
-
+#ifndef OPERA_SMALL_VERSION
 int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *psi)
 	{
 	int i,j,nid;
@@ -291,6 +292,7 @@
 		return 0;
 	return(1);
 	}
+#endif
 
 int PKCS7_add_certificate(PKCS7 *p7, X509 *x509)
 	{
@@ -327,6 +329,7 @@
 	return(1);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int PKCS7_add_crl(PKCS7 *p7, X509_CRL *crl)
 	{
 	int i;
@@ -470,6 +473,7 @@
 	else
 		return(NULL);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
 					X509_ALGOR **pdig, X509_ALGOR **psig)
@@ -488,6 +492,7 @@
 		*penc = ri->key_enc_algor;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509)
 	{
 	PKCS7_RECIP_INFO *ri;
@@ -617,6 +622,7 @@
 	ec->cipher = cipher;
 	return 1;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/pk7_mime.c openssl-1.0.0q/crypto/pkcs7/pk7_mime.c
--- openssl-1.0.0q.orig/crypto/pkcs7/pk7_mime.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/pk7_mime.c	2017-04-25 16:23:40.599621178 +0200
@@ -52,8 +52,13 @@
  *
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/rand.h>
 #include <openssl/x509.h>
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/pk7_smime.c openssl-1.0.0q/crypto/pkcs7/pk7_smime.c
--- openssl-1.0.0q.orig/crypto/pkcs7/pk7_smime.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/pk7_smime.c	2017-04-25 16:23:40.600620746 +0200
@@ -58,7 +58,12 @@
 
 /* Simple PKCS#7 processing functions */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
diff -Naur openssl-1.0.0q.orig/crypto/pkcs7/pkcs7err.c openssl-1.0.0q/crypto/pkcs7/pkcs7err.c
--- openssl-1.0.0q.orig/crypto/pkcs7/pkcs7err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/pkcs7/pkcs7err.c	2017-04-25 16:23:40.601621432 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/pkcs7.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/pqueue/.gitignore openssl-1.0.0q/crypto/pqueue/.gitignore
--- openssl-1.0.0q.orig/crypto/pqueue/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/pqueue/.gitignore	2017-04-25 16:23:40.601621432 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/rand/.gitignore openssl-1.0.0q/crypto/rand/.gitignore
--- openssl-1.0.0q.orig/crypto/rand/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/.gitignore	2017-04-25 16:23:40.602621280 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/rand/md_rand.c openssl-1.0.0q/crypto/rand/md_rand.c
--- openssl-1.0.0q.orig/crypto/rand/md_rand.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/md_rand.c	2017-04-25 16:23:40.603621127 +0200
@@ -115,11 +115,13 @@
 # endif
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
-#include "e_os.h"
+#include <openssl/e_os.h>
 
 #include <openssl/rand.h>
 #include "rand_lcl.h"
@@ -127,6 +129,9 @@
 #include <openssl/crypto.h>
 #include <openssl/err.h>
 
+#include "modules/libopeay/libopeay_arrays.h"
+#include "modules/libopeay/libopeay_implmodule.h"
+
 #ifdef BN_DEBUG
 # define PREDICT
 #endif
@@ -134,10 +139,39 @@
 /* #define PREDICT	1 */
 
 #define STATE_SIZE	1023
+
+#ifdef OPERA_SMALL_VERSION
+
+#if LIBOPEAY_RAND_STATE_SIZE != STATE_SIZE
+#error "Update modules/libopeay/libopeay_implmodule.h with the correct LIBOPEAY_RAND_STATE_SIZE"
+#endif
+
+OPENSSL_IMPLEMENT_GLOBAL(int,               md_rand__state_num);
+OPENSSL_IMPLEMENT_GLOBAL(int,               md_rand__state_index);
+OPENSSL_IMPLEMENT_GLOBAL(Libopeay_ImplementModuleData::md_rand__state_t,    md_rand__state);
+OPENSSL_IMPLEMENT_GLOBAL(Libopeay_ImplementModuleData::md_rand__md_t,       md_rand__md);
+OPENSSL_IMPLEMENT_GLOBAL(Libopeay_ImplementModuleData::md_rand__md_count_t, md_rand__md_count);
+OPENSSL_IMPLEMENT_GLOBAL(double,            md_rand__entropy);
+OPENSSL_IMPLEMENT_GLOBAL(int,               md_rand__initialized);
+OPENSSL_IMPLEMENT_GLOBAL(unsigned int,      md_rand__crypto_lock_rand);
+OPENSSL_IMPLEMENT_GLOBAL(CRYPTO_THREADID,   md_rand__locking_threadid);
+
+#define state_num        OPENSSL_GLOBAL_REF(md_rand__state_num)
+#define state_index      OPENSSL_GLOBAL_REF(md_rand__state_index)
+#define state            OPENSSL_GLOBAL_REF(md_rand__state)
+#define md               OPENSSL_GLOBAL_REF(md_rand__md)
+#define md_count         OPENSSL_GLOBAL_REF(md_rand__md_count)
+#define entropy          OPENSSL_GLOBAL_REF(md_rand__entropy)
+#define initialized      OPENSSL_GLOBAL_REF(md_rand__initialized)
+#define crypto_lock_rand OPENSSL_GLOBAL_REF(md_rand__crypto_lock_rand)
+#define locking_threadid OPENSSL_GLOBAL_REF(md_rand__locking_threadid)
+
+#else
+
 static int state_num=0,state_index=0;
-static unsigned char state[STATE_SIZE+MD_DIGEST_LENGTH];
-static unsigned char md[MD_DIGEST_LENGTH];
-static long md_count[2]={0,0};
+static unsigned char state[STATE_SIZE+MD_DIGEST_LENGTH]; /* ARRAY OK UNUSED 2009-05-25 yngve */
+static unsigned char md[MD_DIGEST_LENGTH]; /* ARRAY OK UNUSED 2009-05-25 yngve */
+static long md_count[2]={0,0}; /* ARRAY OK UNUSED 2009-05-25 yngve */
 static double entropy=0;
 static int initialized=0;
 
@@ -147,32 +181,41 @@
 /* access to lockin_thread is synchronized by CRYPTO_LOCK_RAND2 */
 static CRYPTO_THREADID locking_threadid; /* valid iff crypto_lock_rand is set */
 
+#endif
 
 #ifdef PREDICT
 int rand_predictable=0;
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 const char RAND_version[]="RAND" OPENSSL_VERSION_PTEXT;
+#endif
 
 static void ssleay_rand_cleanup(void);
 static void ssleay_rand_seed(const void *buf, int num);
 static void ssleay_rand_add(const void *buf, int num, double add_entropy);
 static int ssleay_rand_bytes(unsigned char *buf, int num);
 static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num);
+#ifndef OPERA_SMALL_VERSION
 static int ssleay_rand_status(void);
+#endif
 
-RAND_METHOD rand_ssleay_meth={
-	ssleay_rand_seed,
-	ssleay_rand_bytes,
-	ssleay_rand_cleanup,
-	ssleay_rand_add,
-	ssleay_rand_pseudo_bytes,
-	ssleay_rand_status
-	}; 
+OPENSSL_PREFIX_CONST_ITEM(static, RAND_METHOD, rand_ssleay_meth, libopeay)
+	CONST_ITEM_ENTRY_START(seed,ssleay_rand_seed)
+	CONST_ITEM_ENTRY_SINGLE(bytes,ssleay_rand_bytes)
+	CONST_ITEM_ENTRY_SINGLE(cleanup,ssleay_rand_cleanup)
+	CONST_ITEM_ENTRY_SINGLE(add,ssleay_rand_add)
+	CONST_ITEM_ENTRY_SINGLE(pseudorand,ssleay_rand_pseudo_bytes)
+#ifndef OPERA_SMALL_VERSION
+	CONST_ITEM_ENTRY_SINGLE(status,ssleay_rand_status)
+#else
+	CONST_ITEM_ENTRY_SINGLE(status,NULL)
+#endif
+CONST_ITEM_ENTRY_END;
 
-RAND_METHOD *RAND_SSLeay(void)
+const RAND_METHOD *RAND_SSLeay(void)
 	{
-	return(&rand_ssleay_meth);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(rand_ssleay_meth));
 	}
 
 static void ssleay_rand_cleanup(void)
@@ -191,12 +234,12 @@
 	{
 	int i,j,k,st_idx;
 	long md_c[2];
-	unsigned char local_md[MD_DIGEST_LENGTH];
+	unsigned char local_md[MD_DIGEST_LENGTH]; /* ARRAY OK 2009-06-05 yngve */
 	EVP_MD_CTX m;
 	int do_not_lock;
 
 	/*
-	 * (Based on the rand(3) manpage)
+	 * (Based on the op_rand(3) manpage)
 	 *
 	 * The input is chopped up into units of 20 bytes (or less for
 	 * the last block).  Each of these blocks is run through the hash
@@ -232,7 +275,7 @@
 	md_c[0] = md_count[0];
 	md_c[1] = md_count[1];
 
-	memcpy(local_md, md, sizeof md);
+	op_memcpy(local_md, md, sizeof(md));
 
 	/* state_index <= state_num <= STATE_SIZE */
 	state_index += num;
@@ -328,14 +371,21 @@
 	ssleay_rand_add(buf, num, (double)num);
 	}
 
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(volatile int, stirred_pool);
+#define stirred_pool OPENSSL_GLOBAL_REF(stirred_pool)
+#endif
+
 static int ssleay_rand_bytes(unsigned char *buf, int num)
 	{
+#ifndef OPERA_SMALL_VERSION
 	static volatile int stirred_pool = 0;
+#endif
 	int i,j,k,st_num,st_idx;
 	int num_ceil;
 	int ok;
 	long md_c[2];
-	unsigned char local_md[MD_DIGEST_LENGTH];
+	unsigned char local_md[MD_DIGEST_LENGTH]; /* ARRAY OK 2009-06-05 yngve */
 	EVP_MD_CTX m;
 #ifndef GETPID_IS_MEANINGLESS
 	pid_t curr_pid = getpid();
@@ -361,7 +411,7 @@
 	num_ceil = (1 + (num-1)/(MD_DIGEST_LENGTH/2)) * (MD_DIGEST_LENGTH/2);
 
 	/*
-	 * (Based on the rand(3) manpage:)
+	 * (Based on the op_rand(3) manpage:)
 	 *
 	 * For each group of 10 bytes (or less), we do the following:
 	 *
@@ -444,7 +494,7 @@
 	st_num=state_num;
 	md_c[0] = md_count[0];
 	md_c[1] = md_count[1];
-	memcpy(local_md, md, sizeof md);
+	op_memcpy(local_md, md, sizeof(md));
 
 	state_index+=num_ceil;
 	if (state_index > state_num)
@@ -520,8 +570,10 @@
 	else
 		{
 		RANDerr(RAND_F_SSLEAY_RAND_BYTES,RAND_R_PRNG_NOT_SEEDED);
+#ifndef OPERA_SMALL_VERSION
 		ERR_add_error_data(1, "You need to read the OpenSSL FAQ, "
 			"http://www.openssl.org/support/faq.html");
+#endif
 		return(0);
 		}
 	}
@@ -544,6 +596,7 @@
 	return (ret);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 static int ssleay_rand_status(void)
 	{
 	CRYPTO_THREADID cur;
@@ -591,3 +644,4 @@
 	
 	return ret;
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/rand/opera_md_rand.cpp openssl-1.0.0q/crypto/rand/opera_md_rand.cpp
--- openssl-1.0.0q.orig/crypto/rand/opera_md_rand.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/opera_md_rand.cpp	2017-04-25 16:23:40.603621127 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rand/md_rand.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/rand/opera_rand_egd.cpp openssl-1.0.0q/crypto/rand/opera_rand_egd.cpp
--- openssl-1.0.0q.orig/crypto/rand/opera_rand_egd.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/opera_rand_egd.cpp	2017-04-25 16:23:40.604620975 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rand/rand_egd.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/rand/opera_rand_lib.cpp openssl-1.0.0q/crypto/rand/opera_rand_lib.cpp
--- openssl-1.0.0q.orig/crypto/rand/opera_rand_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/opera_rand_lib.cpp	2017-04-25 16:23:40.604620975 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rand/rand_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/rand/opera_rand_unix.cpp openssl-1.0.0q/crypto/rand/opera_rand_unix.cpp
--- openssl-1.0.0q.orig/crypto/rand/opera_rand_unix.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/opera_rand_unix.cpp	2017-04-25 16:23:40.605620823 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rand/rand_unix.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/rand/opera_rand_win.cpp openssl-1.0.0q/crypto/rand/opera_rand_win.cpp
--- openssl-1.0.0q.orig/crypto/rand/opera_rand_win.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/opera_rand_win.cpp	2017-04-25 16:23:40.605620823 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch_system_includes.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rand/rand_win.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/rand/rand.h openssl-1.0.0q/crypto/rand/rand.h
--- openssl-1.0.0q.orig/crypto/rand/rand.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/rand.h	2017-04-25 16:23:40.606621229 +0200
@@ -59,12 +59,16 @@
 #ifndef HEADER_RAND_H
 #define HEADER_RAND_H
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/ossl_typ.h>
 #include <openssl/e_os2.h>
 
 #if defined(OPENSSL_SYS_WINDOWS)
+#ifndef OPERA_SMALL_VERSION
 #include <windows.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 
 #ifdef  __cplusplus
@@ -97,7 +101,7 @@
 #ifndef OPENSSL_NO_ENGINE
 int RAND_set_rand_engine(ENGINE *engine);
 #endif
-RAND_METHOD *RAND_SSLeay(void);
+const RAND_METHOD *RAND_SSLeay(void);
 void RAND_cleanup(void );
 int  RAND_bytes(unsigned char *buf,int num);
 int  RAND_pseudo_bytes(unsigned char *buf,int num);
diff -Naur openssl-1.0.0q.orig/crypto/rand/rand_egd.c openssl-1.0.0q/crypto/rand/rand_egd.c
--- openssl-1.0.0q.orig/crypto/rand/rand_egd.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/rand_egd.c	2017-04-25 16:23:40.607620239 +0200
@@ -54,7 +54,7 @@
  *
  */
 
-#include <openssl/e_os2.h>
+#include <openssl/cryptlib.h>
 #include <openssl/rand.h>
 #include <openssl/buffer.h>
 
@@ -95,11 +95,14 @@
  *   RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255.
  */
 
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS) || defined(OPENSSL_SYS_BEOS)
+#if defined(MSWIN)
+/* No code needed, not used on windows */
+#elif !defined(OPENSSL_SYS_UNIX) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS) || defined(OPENSSL_SYS_BEOS)
 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
 	{
 	return(-1);
 	}
+#ifndef OPERA_SMALL_VERSION
 int RAND_egd(const char *path)
 	{
 	return(-1);
@@ -109,45 +112,58 @@
 	{
 	return(-1);
 	}
+#endif
 #else
 #include <openssl/opensslconf.h>
+#ifndef OPERA_SMALL_VERSION
 #include OPENSSL_UNISTD
 #include <sys/types.h>
+#endif // !OPERA_SMALL_VERSION
+
 #include <sys/socket.h>
+
+#ifndef OPERA_SMALL_VERSION
 #ifndef NO_SYS_UN_H
 # ifdef OPENSSL_SYS_VXWORKS
 #   include <streams/un.h>
 # else
 #   include <sys/un.h>
 # endif
-#else
-struct	sockaddr_un {
+#else /*NO_SYS_UN_H*/
+#endif /* NO_SYS_UN_H */
+#endif // !OPERA_SMALL_VERSION
+
+struct	sockaddr_unn {
 	short	sun_family;		/* AF_UNIX */
-	char	sun_path[108];		/* path name (gag) */
+	char	sun_path[108];		/* path name (gag) */ /* ARRAY OK 2009-05-25 yngve */
 };
-#endif /* NO_SYS_UN_H */
+
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
 #include <errno.h>
+#endif // !OPERA_SMALL_VERSION
 
 #ifndef offsetof
-#  define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#  define op_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 #endif
 
 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
 	{
 	int ret = 0;
-	struct sockaddr_un addr;
+	struct sockaddr_unn addr;
 	int len, num, numbytes;
 	int fd = -1;
 	int success;
-	unsigned char egdbuf[2], tempbuf[255], *retrievebuf;
+	unsigned char egdbuf[2];		/* ARRAY OK 2009-05-25 yngve */
+	unsigned char tempbuf[255];		/* ARRAY OK 2009-05-25 yngve */
+	unsigned char *retrievebuf;
 
-	memset(&addr, 0, sizeof(addr));
+	op_memset(&addr, 0, sizeof(addr));
 	addr.sun_family = AF_UNIX;
-	if (strlen(path) >= sizeof(addr.sun_path))
+	if (op_strlen(path) >= sizeof(addr.sun_path))
 		return (-1);
 	BUF_strlcpy(addr.sun_path,path,sizeof addr.sun_path);
-	len = offsetof(struct sockaddr_un, sun_path) + strlen(path);
+	len = op_offsetof(struct sockaddr_unn, sun_path) + op_strlen(path);
 	fd = socket(AF_UNIX, SOCK_STREAM, 0);
 	if (fd == -1) return (-1);
 	success = 0;
@@ -281,6 +297,7 @@
 	}
 
 
+#ifndef OPERA_SMALL_VERSION
 int RAND_egd_bytes(const char *path, int bytes)
 	{
 	int num, ret = 0;
@@ -298,6 +315,7 @@
 	{
 	return (RAND_egd_bytes(path, 255));
 	}
+#endif // !OPERA_SMALL_VERSION
 
 
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/rand/rand_err.c openssl-1.0.0q/crypto/rand/rand_err.c
--- openssl-1.0.0q.orig/crypto/rand/rand_err.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/rand_err.c	2017-04-25 16:23:40.607620239 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/rand.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/rand/rand_lib.c openssl-1.0.0q/crypto/rand/rand_lib.c
--- openssl-1.0.0q.orig/crypto/rand/rand_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/rand_lib.c	2017-04-25 16:23:40.608620087 +0200
@@ -56,10 +56,14 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/rand.h>
+
 #ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
 #endif
@@ -68,8 +72,12 @@
 /* non-NULL if default_RAND_meth is ENGINE-provided */
 static ENGINE *funct_ref =NULL;
 #endif
+
+#ifndef OPERA_SMALL_VERSION
 static const RAND_METHOD *default_RAND_meth = NULL;
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 int RAND_set_rand_method(const RAND_METHOD *meth)
 	{
 #ifndef OPENSSL_NO_ENGINE
@@ -82,9 +90,16 @@
 	default_RAND_meth = meth;
 	return 1;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 const RAND_METHOD *RAND_get_rand_method(void)
 	{
+#ifdef OPERA_SMALL_VERSION
+
+	return RAND_SSLeay();
+
+#else
+
 	if (!default_RAND_meth)
 		{
 #ifndef OPENSSL_NO_ENGINE
@@ -105,9 +120,12 @@
 			default_RAND_meth = RAND_SSLeay();
 		}
 	return default_RAND_meth;
+
+#endif // OPERA_SMALL_VERSION
 	}
 
 #ifndef OPENSSL_NO_ENGINE
+#ifndef OPERA_SMALL_VERSION
 int RAND_set_rand_engine(ENGINE *engine)
 	{
 	const RAND_METHOD *tmp_meth = NULL;
@@ -127,6 +145,7 @@
 	funct_ref = engine;
 	return 1;
 	}
+#endif // !OPERA_SMALL_VERSION
 #endif
 
 void RAND_cleanup(void)
@@ -134,7 +153,9 @@
 	const RAND_METHOD *meth = RAND_get_rand_method();
 	if (meth && meth->cleanup)
 		meth->cleanup();
+#ifndef OPERA_SMALL_VERSION
 	RAND_set_rand_method(NULL);
+#endif // !OPERA_SMALL_VERSION
 	}
 
 void RAND_seed(const void *buf, int num)
@@ -167,6 +188,7 @@
 	return(-1);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int RAND_status(void)
 	{
 	const RAND_METHOD *meth = RAND_get_rand_method();
@@ -174,3 +196,4 @@
 		return meth->status();
 	return 0;
 	}
+#endif // !OPERA_SMALL_VERSION
diff -Naur openssl-1.0.0q.orig/crypto/rand/rand_os2.c openssl-1.0.0q/crypto/rand/rand_os2.c
--- openssl-1.0.0q.orig/crypto/rand/rand_os2.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/rand_os2.c	2017-04-25 16:23:40.609621331 +0200
@@ -53,6 +53,9 @@
  *
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include "cryptlib.h"
 #include <openssl/rand.h>
 #include "rand_lcl.h"
diff -Naur openssl-1.0.0q.orig/crypto/rand/rand_unix.c openssl-1.0.0q/crypto/rand/rand_unix.c
--- openssl-1.0.0q.orig/crypto/rand/rand_unix.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/rand_unix.c	2017-04-25 16:23:40.610620900 +0200
@@ -108,16 +108,19 @@
  * Hudson (tjh@cryptsoft.com).
  *
  */
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #define USE_SOCKETS
-#include "e_os.h"
-#include "cryptlib.h"
+#include <openssl/e_os.h>
+#include <openssl/cryptlib.h>
 #include <openssl/rand.h>
 #include "rand_lcl.h"
 
 #if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE))
 
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/times.h>
@@ -125,13 +128,19 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <time.h>
-#if defined(OPENSSL_SYS_LINUX) /* should actually be available virtually everywhere */
-# include <poll.h>
+#endif // !OPERA_SMALL_VERSION
+
+#if defined(OPENSSL_SYS_LINUX) && !defined(SYS_CAP_OP_POLL_IMPL) /* should actually be available virtually everywhere */
+#include <sys/poll.h>
+#define op_poll poll
 #endif
+
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
 #ifndef FD_SETSIZE
 # define FD_SETSIZE (8*sizeof(fd_set))
 #endif
+#endif /* !OPERA_SMALL_VERSION */
 
 #if defined(OPENSSL_SYS_VOS)
 
@@ -234,27 +243,30 @@
 	return 1;
 }
 #else /* !defined(__OpenBSD__) */
+
+#ifdef OPENSSL_SYS_UNIX /* Unknown UNIX */
+
 int RAND_poll(void)
 {
 	unsigned long l;
 	pid_t curr_pid = getpid();
 #if defined(DEVRANDOM) || defined(DEVRANDOM_EGD)
-	unsigned char tmpbuf[ENTROPY_NEEDED];
+	unsigned char tmpbuf[ENTROPY_NEEDED]; /* ARRAY OK 2009-05-25 yngve */
 	int n = 0;
 #endif
 #ifdef DEVRANDOM
-	static const char *randomfiles[] = { DEVRANDOM };
+	static const char * const randomfiles[] = { DEVRANDOM };
 	struct stat randomstats[sizeof(randomfiles)/sizeof(randomfiles[0])];
 	int fd;
 	unsigned int i;
 #endif
 #ifdef DEVRANDOM_EGD
-	static const char *egdsockets[] = { DEVRANDOM_EGD, NULL };
-	const char **egdsocket = NULL;
+	static const char * const egdsockets[] = { DEVRANDOM_EGD, NULL };
+	const char * const *egdsocket = NULL;
 #endif
 
 #ifdef DEVRANDOM
-	memset(randomstats,0,sizeof(randomstats));
+	op_memset(randomstats,0,sizeof(randomstats));
 	/* Use a random entropy pool device. Linux, FreeBSD and OpenBSD
 	 * have this. Use /dev/urandom if you can as /dev/random may block
 	 * if it runs out of random entries.  */
@@ -308,7 +320,7 @@
 				pset.events = POLLIN;
 				pset.revents = 0;
 
-				if (poll(&pset, 1, usec / 1000) < 0)
+				if (op_poll(&pset, 1, usec / 1000) < 0)
 					usec = 0;
 				else
 					try_read = (pset.revents & POLLIN) != 0;
@@ -401,7 +413,7 @@
 	l=getuid();
 	RAND_add(&l,sizeof(l),0.0);
 
-	l=time(NULL);
+	l=op_time(NULL);
 	RAND_add(&l,sizeof(l),0.0);
 
 #if defined(OPENSSL_SYS_BEOS)
@@ -419,6 +431,32 @@
 #endif
 }
 
+#else  /* Unknown OS, non-UNIX */
+
+int RAND_poll(void)
+	{
+	// Opera's random generator in stdlib is already initialized at this
+	// point, because stdlib is the first initialized module. Let's get
+	// some randomness from there by using op_rand(). This function is
+	// similar to the OpenSSL's function for OpenBSD.
+
+	const size_t RAND_COUNT = (ENTROPY_NEEDED + 3) / 4;
+	const size_t BUF_SIZE   = RAND_COUNT * 4;
+
+	INT32 buf[RAND_COUNT]; /* ARRAY OK 2012-02-23 alexeik */
+	OP_ASSERT(BUF_SIZE == sizeof(buf));
+	OP_ASSERT(ENTROPY_NEEDED <= BUF_SIZE);
+
+	for (size_t i = 0; i < RAND_COUNT; i++)
+		buf[i] = op_rand();
+
+	RAND_add(buf, BUF_SIZE, BUF_SIZE);
+
+	return 1;
+	}
+
+#endif /* OPENSSL_SYS_UNIX */
+
 #endif /* defined(__OpenBSD__) */
 #endif /* !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) */
 
diff -Naur openssl-1.0.0q.orig/crypto/rand/rand_win.c openssl-1.0.0q/crypto/rand/rand_win.c
--- openssl-1.0.0q.orig/crypto/rand/rand_win.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/rand_win.c	2017-04-25 16:23:40.612620595 +0200
@@ -109,14 +109,17 @@
  *
  */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/rand.h>
 #include "rand_lcl.h"
 
 #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
+#ifndef OPERA_SMALL_VERSION
 #include <windows.h>
+#endif /* !OPERA_SMALL_VERSION */
 #ifndef _WIN32_WINNT
 # define _WIN32_WINNT 0x0400
+# undef __WINCRYPT_H__
 #endif
 #include <wincrypt.h>
 #include <tlhelp32.h>
@@ -202,7 +205,7 @@
 /* Even though MSDN says _WIN32_WCE>=210, it doesn't seem to be available
  * in commonly available implementations prior 300... */
 	{
-	BYTE buf[64];
+	BYTE buf[64]; /* ARRAY OK 2009-06-05 yngve */
 	/* poll the CryptoAPI PRNG */
 	/* The CryptoAPI returns sizeof(buf) bytes of randomness */
 	if (CryptAcquireContextW(&hProvider, NULL, NULL, PROV_RSA_FULL,
@@ -239,7 +242,7 @@
 	CRYPTRELEASECONTEXT release = NULL;
 	NETSTATGET netstatget = NULL;
 	NETFREE netfree = NULL;
-	BYTE buf[64];
+	BYTE buf[64]; /* ARRAY OK 2009-06-05 yngve */
 
 	if (netapi)
 		{
@@ -487,6 +490,8 @@
 #else
 			if (heaplist_first(handle, &hlist))
 				{
+				int total_entrycnt = 1024;
+				DWORD end_of_run = GetTickCount()+300; /* Milliseconds // Will not work properly when it is about to wrap around, which happens every 49 days */
 				do
 					{
 					RAND_add(&hlist, hlist.dwSize, 3);
@@ -496,11 +501,18 @@
 						hlist.th32HeapID))
 						{
 						int entrycnt = 80;
-						do
+						do{
 							RAND_add(&hentry,
 								hentry.dwSize, 5);
-						while (heap_next(&hentry)
-							&& --entrycnt > 0);
+
+							if(total_entrycnt %6 == 0 && GetTickCount() > end_of_run)
+							{
+								total_entrycnt =0;
+								break;
+							}
+
+						}while (heap_next(&hentry)
+							&& --entrycnt > 0 && --total_entrycnt > 0);
 						}
 					} while (heaplist_next(handle, &hlist) 
 						&& (!good || (GetTickCount()-starttime)<MAXDELAY));
@@ -574,6 +586,7 @@
 	return(1);
 }
 
+#ifndef OPERA_SMALL_VERSION
 int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam)
         {
         double add_entropy=0;
@@ -593,8 +606,8 @@
                         static int lastx,lasty,lastdx,lastdy;
                         int x,y,dx,dy;
 
-                        x=LOWORD(lParam);
-                        y=HIWORD(lParam);
+                        x=(int)(short)LOWORD(lParam);
+                        y=(int)(short)HIWORD(lParam);
                         dx=lastx-x;
                         dy=lasty-y;
                         if (dx != 0 && dy != 0 && dx-lastdx != 0 && dy-lastdy != 0)
@@ -619,16 +632,29 @@
 	RAND_poll();
 	readscreen();
 }
+#endif
 
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(int, have_perfc);
+#define have_perfc OPENSSL_GLOBAL_REF(have_perfc)
+#if defined(_MSC_VER) && defined(_M_X86)
+OPENSSL_IMPLEMENT_GLOBAL(int, have_tsc);
+#define have_tsc OPENSSL_GLOBAL_REF(have_tsc)
+#endif
+#endif
 
 /* feed timing information to the PRNG */
 static void readtimer(void)
 {
 	DWORD w;
 	LARGE_INTEGER l;
+#ifndef OPERA_SMALL_VERSION
 	static int have_perfc = 1;
+#endif
 #if defined(_MSC_VER) && defined(_M_X86)
+#ifndef OPERA_SMALL_VERSION
 	static int have_tsc = 1;
+#endif
 	DWORD cyclecount;
 
 	if (have_tsc) {
@@ -660,6 +686,7 @@
 	}
 }
 
+#ifndef OPERA_SMALL_VERSION
 /* feed screen contents to PRNG */
 /*****************************************************************************
  *
@@ -719,7 +746,7 @@
     /* Now go through the whole screen, repeatedly grabbing n lines */
     for (y = 0; y < h-n; y += n)
     	{
-	unsigned char md[MD_DIGEST_LENGTH];
+	unsigned char md[MD_DIGEST_LENGTH]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 
 	/* Bitblt screen DC to memory DC */
 	BitBlt(hMemDC, 0, 0, w, n, hScrDC, 0, y, SRCCOPY);
@@ -746,5 +773,6 @@
   DeleteDC(hScrDC);
 #endif /* !OPENSSL_SYS_WINCE */
 }
+#endif // !OPERA_SMALL_VERSION
 
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/rand/randfile.c openssl-1.0.0q/crypto/rand/randfile.c
--- openssl-1.0.0q.orig/crypto/rand/randfile.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/randfile.c	2017-04-25 16:23:40.614620849 +0200
@@ -59,24 +59,32 @@
 /* We need to define this to get macros like S_IFBLK and S_IFCHR */
 #define _XOPEN_SOURCE 500
 
+#ifndef OPERA_SMALL_VERSION
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "e_os.h"
 #include <openssl/crypto.h>
 #include <openssl/rand.h>
 #include <openssl/buffer.h>
 
+#ifndef OPENSSL_NO_RAND_FILE
+
 #ifdef OPENSSL_SYS_VMS
 #include <unixio.h>
 #endif
 #ifndef NO_SYS_TYPES_H
+#ifndef OPERA_SMALL_VERSION
 # include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifndef OPENSSL_NO_POSIX_IO
+#ifndef OPERA_SMALL_VERSION
 # include <sys/stat.h>
+#endif /* !OPERA_SMALL_VERSION */
 # include <fcntl.h>
 #endif
 
@@ -109,7 +117,7 @@
 	/* If bytes >= 0, read up to 'bytes' bytes.
 	 * if bytes == -1, read complete file. */
 
-	MS_STATIC unsigned char buf[BUFSIZE];
+	MS_STATIC unsigned char buf[BUFSIZE]; /* ARRAY OK 2004-02-18 yngve */
 #ifndef OPENSSL_NO_POSIX_IO
 	struct stat sb;
 #endif
@@ -179,7 +187,7 @@
 
 int RAND_write_file(const char *file)
 	{
-	unsigned char buf[BUFSIZE];
+	unsigned char buf[BUFSIZE]; /* ARRAY OK 2004-02-18 yngve */
 	int i,ret=0,rand_err=0;
 	FILE *out = NULL;
 	int n;
@@ -276,16 +284,20 @@
 	struct stat sb;
 #endif
 
+#ifndef GROUP_USER_ID_IS_MEANINGLESS
 	if (OPENSSL_issetugid() == 0)
+#endif
 		s=getenv("RANDFILE");
-	if (s != NULL && *s && strlen(s) + 1 < size)
+	if (s != NULL && *s && op_strlen(s) + 1 < size)
 		{
 		if (BUF_strlcpy(buf,s,size) >= size)
 			return NULL;
 		}
 	else
 		{
+#ifndef GROUP_USER_ID_IS_MEANINGLESS
 		if (OPENSSL_issetugid() == 0)
+#endif
 			s=getenv("HOME");
 #ifdef DEFAULT_HOME
 		if (s == NULL)
@@ -293,7 +305,7 @@
 			s = DEFAULT_HOME;
 			}
 #endif
-		if (s && *s && strlen(s)+strlen(RFILE)+2 < size)
+		if (s && *s && op_strlen(s)+op_strlen(RFILE)+2 < size)
 			{
 			BUF_strlcpy(buf,s,size);
 #ifndef OPENSSL_SYS_VMS
@@ -325,3 +337,5 @@
 #endif
 	return(buf);
 	}
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/rand/randtest.c openssl-1.0.0q/crypto/rand/randtest.c
--- openssl-1.0.0q.orig/crypto/rand/randtest.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rand/randtest.c	2017-04-25 16:23:40.615620697 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/rand.h>
 
 #include "../e_os.h"
diff -Naur openssl-1.0.0q.orig/crypto/rc2/.gitignore openssl-1.0.0q/crypto/rc2/.gitignore
--- openssl-1.0.0q.orig/crypto/rc2/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/.gitignore	2017-04-25 16:23:40.616621383 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/rc2/opera_rc2_cbc.cpp openssl-1.0.0q/crypto/rc2/opera_rc2_cbc.cpp
--- openssl-1.0.0q.orig/crypto/rc2/opera_rc2_cbc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/opera_rc2_cbc.cpp	2017-04-25 16:23:40.616621383 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rc2/rc2_cbc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/rc2/opera_rc2_ecb.c openssl-1.0.0q/crypto/rc2/opera_rc2_ecb.c
--- openssl-1.0.0q.orig/crypto/rc2/opera_rc2_ecb.c	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/opera_rc2_ecb.c	2017-04-25 16:23:40.617621510 +0200
@@ -0,0 +1,13 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+#include "rc2_ecb.c"
+#endif /* _SSL_USE_OPENSSL_ */
diff -Naur openssl-1.0.0q.orig/crypto/rc2/opera_rc2_skey.cpp openssl-1.0.0q/crypto/rc2/opera_rc2_skey.cpp
--- openssl-1.0.0q.orig/crypto/rc2/opera_rc2_skey.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/opera_rc2_skey.cpp	2017-04-25 16:23:40.617621510 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rc2/rc2_skey.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/rc2/opera_rc2cfb64.cpp openssl-1.0.0q/crypto/rc2/opera_rc2cfb64.cpp
--- openssl-1.0.0q.orig/crypto/rc2/opera_rc2cfb64.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/opera_rc2cfb64.cpp	2017-04-25 16:23:40.618621079 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rc2/rc2cfb64.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/rc2/opera_rc2ofb64.c openssl-1.0.0q/crypto/rc2/opera_rc2ofb64.c
--- openssl-1.0.0q.orig/crypto/rc2/opera_rc2ofb64.c	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/opera_rc2ofb64.c	2017-04-25 16:23:40.618621079 +0200
@@ -0,0 +1,13 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+#include "rc2ofb64.c"
+#endif /* _SSL_USE_OPENSSL_ */
diff -Naur openssl-1.0.0q.orig/crypto/rc2/rc2_cbc.c openssl-1.0.0q/crypto/rc2/rc2_cbc.c
--- openssl-1.0.0q.orig/crypto/rc2/rc2_cbc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/rc2_cbc.c	2017-04-25 16:23:40.619620926 +0200
@@ -56,6 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
+#include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#ifndef OPENSSL_NO_RC2
 #include <openssl/rc2.h>
 #include "rc2_locl.h"
 
@@ -224,3 +229,4 @@
 	d[1]=(unsigned long)(x2&0xffff)|((unsigned long)(x3&0xffff)<<16L);
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/rc2/rc2_ecb.c openssl-1.0.0q/crypto/rc2/rc2_ecb.c
--- openssl-1.0.0q.orig/crypto/rc2/rc2_ecb.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/rc2_ecb.c	2017-04-25 16:23:40.619620926 +0200
@@ -60,7 +60,9 @@
 #include "rc2_locl.h"
 #include <openssl/opensslv.h>
 
-const char RC2_version[]="RC2" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char RC2_version[]="RC2" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-26 haavardm */
+#endif
 
 /* RC2 as implemented frm a posting from
  * Newsgroups: sci.crypt
diff -Naur openssl-1.0.0q.orig/crypto/rc2/rc2_skey.c openssl-1.0.0q/crypto/rc2/rc2_skey.c
--- openssl-1.0.0q.orig/crypto/rc2/rc2_skey.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/rc2_skey.c	2017-04-25 16:23:40.621622018 +0200
@@ -56,6 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
+#include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#ifndef OPENSSL_NO_RC2
 #include <openssl/rc2.h>
 #include "rc2_locl.h"
 
@@ -143,3 +148,4 @@
 #if defined(_MSC_VER)
 #pragma optimize("",on)
 #endif
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/rc2/rc2cfb64.c openssl-1.0.0q/crypto/rc2/rc2cfb64.c
--- openssl-1.0.0q.orig/crypto/rc2/rc2cfb64.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/rc2cfb64.c	2017-04-25 16:23:40.621622018 +0200
@@ -56,6 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
+#include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
+#ifdef OPENSSL_USE_CFB_CIPHERS
+#ifndef OPENSSL_NO_RC2
 #include <openssl/rc2.h>
 #include "rc2_locl.h"
 
@@ -120,3 +126,5 @@
 	*num=n;
 	}
 
+#endif
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/rc2/rc2ofb64.c openssl-1.0.0q/crypto/rc2/rc2ofb64.c
--- openssl-1.0.0q.orig/crypto/rc2/rc2ofb64.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/rc2ofb64.c	2017-04-25 16:23:40.622620469 +0200
@@ -108,4 +108,3 @@
 	t=v0=v1=ti[0]=ti[1]=0;
 	*num=n;
 	}
-
diff -Naur openssl-1.0.0q.orig/crypto/rc2/rc2speed.c openssl-1.0.0q/crypto/rc2/rc2speed.c
--- openssl-1.0.0q.orig/crypto/rc2/rc2speed.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/rc2speed.c	2017-04-25 16:23:40.623621435 +0200
@@ -63,7 +63,9 @@
 #define TIMES
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/e_os2.h>
 #include OPENSSL_UNISTD_IO
@@ -74,10 +76,14 @@
 #endif
 
 #ifndef _IRIX
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef TIMES
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/times.h>
 #endif
 
@@ -95,7 +101,9 @@
 
 #if defined(sun) || defined(__ultrix)
 #define _POSIX_SOURCE
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/param.h>
 #endif
 
diff -Naur openssl-1.0.0q.orig/crypto/rc2/rc2test.c openssl-1.0.0q/crypto/rc2/rc2test.c
--- openssl-1.0.0q.orig/crypto/rc2/rc2test.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/rc2test.c	2017-04-25 16:23:40.624621283 +0200
@@ -59,9 +59,11 @@
 /* This has been a quickly hacked 'ideatest.c'.  When I add tests for other
  * RC2 modes, more of the code will be uncommented. */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -150,7 +152,7 @@
 		RC2_set_key(&key,16,&(RC2key[n][0]),0 /* or 1024 */);
 
 		RC2_ecb_encrypt(&(RC2plain[n][0]),buf,&key,RC2_ENCRYPT);
-		if (memcmp(&(RC2cipher[n][0]),buf,8) != 0)
+		if (op_memcmp(&(RC2cipher[n][0]),buf,8) != 0)
 			{
 			printf("ecb rc2 error encrypting\n");
 			printf("got     :");
@@ -165,7 +167,7 @@
 			}
 
 		RC2_ecb_encrypt(buf,buf2,&key,RC2_DECRYPT);
-		if (memcmp(&(RC2plain[n][0]),buf2,8) != 0)
+		if (op_memcmp(&(RC2plain[n][0]),buf2,8) != 0)
 			{
 			printf("ecb RC2 error decrypting\n");
 			printf("got     :");
@@ -182,12 +184,12 @@
 
 	if (err == 0) printf("ecb RC2 ok\n");
 #ifdef undef
-	memcpy(iv,k,8);
+	op_memcpy(iv,k,8);
 	idea_cbc_encrypt((unsigned char *)text,out,strlen(text)+1,&key,iv,1);
-	memcpy(iv,k,8);
+	op_memcpy(iv,k,8);
 	idea_cbc_encrypt(out,out,8,&dkey,iv,0);
 	idea_cbc_encrypt(&(out[8]),&(out[8]),strlen(text)+1-8,&dkey,iv,0);
-	if (memcmp(text,out,strlen(text)+1) != 0)
+	if (op_memcmp(text,out,strlen(text)+1) != 0)
 		{
 		printf("cbc idea bad\n");
 		err=4;
@@ -220,28 +222,28 @@
 
         idea_set_encrypt_key(cfb_key,&eks);
         idea_set_decrypt_key(&eks,&dks);
-        memcpy(cfb_tmp,cfb_iv,8);
+        op_memcpy(cfb_tmp,cfb_iv,8);
         n=0;
         idea_cfb64_encrypt(plain,cfb_buf1,(long)12,&eks,
                 cfb_tmp,&n,IDEA_ENCRYPT);
         idea_cfb64_encrypt(&(plain[12]),&(cfb_buf1[12]),
                 (long)CFB_TEST_SIZE-12,&eks,
                 cfb_tmp,&n,IDEA_ENCRYPT);
-        if (memcmp(cfb_cipher,cfb_buf1,CFB_TEST_SIZE) != 0)
+        if (op_memcmp(cfb_cipher,cfb_buf1,CFB_TEST_SIZE) != 0)
                 {
                 err=1;
                 printf("idea_cfb64_encrypt encrypt error\n");
                 for (i=0; i<CFB_TEST_SIZE; i+=8)
                         printf("%s\n",pt(&(cfb_buf1[i])));
                 }
-        memcpy(cfb_tmp,cfb_iv,8);
+        op_memcpy(cfb_tmp,cfb_iv,8);
         n=0;
         idea_cfb64_encrypt(cfb_buf1,cfb_buf2,(long)17,&eks,
                 cfb_tmp,&n,IDEA_DECRYPT);
         idea_cfb64_encrypt(&(cfb_buf1[17]),&(cfb_buf2[17]),
                 (long)CFB_TEST_SIZE-17,&dks,
                 cfb_tmp,&n,IDEA_DECRYPT);
-        if (memcmp(plain,cfb_buf2,CFB_TEST_SIZE) != 0)
+        if (op_memcmp(plain,cfb_buf2,CFB_TEST_SIZE) != 0)
                 {
                 err=1;
                 printf("idea_cfb_encrypt decrypt error\n");
diff -Naur openssl-1.0.0q.orig/crypto/rc2/tab.c openssl-1.0.0q/crypto/rc2/tab.c
--- openssl-1.0.0q.orig/crypto/rc2/tab.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rc2/tab.c	2017-04-25 16:23:40.625621130 +0200
@@ -1,4 +1,6 @@
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 unsigned char ebits_to_num[256]={
 	0xbd,0x56,0xea,0xf2,0xa2,0xf1,0xac,0x2a,
diff -Naur openssl-1.0.0q.orig/crypto/rc4/.gitignore openssl-1.0.0q/crypto/rc4/.gitignore
--- openssl-1.0.0q.orig/crypto/rc4/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rc4/.gitignore	2017-04-25 16:23:40.625621130 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/rc4/opera_rc4_enc.cpp openssl-1.0.0q/crypto/rc4/opera_rc4_enc.cpp
--- openssl-1.0.0q.orig/crypto/rc4/opera_rc4_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rc4/opera_rc4_enc.cpp	2017-04-25 16:23:40.626621257 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_STREAM_ENCRYPTION_RC4_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rc4/rc4_enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_STREAM_ENCRYPTION_RC4_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/rc4/opera_rc4_skey.cpp openssl-1.0.0q/crypto/rc4/opera_rc4_skey.cpp
--- openssl-1.0.0q.orig/crypto/rc4/opera_rc4_skey.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rc4/opera_rc4_skey.cpp	2017-04-25 16:23:40.626621257 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_STREAM_ENCRYPTION_RC4_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rc4/rc4_skey.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_STREAM_ENCRYPTION_RC4_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/rc4/rc4.c openssl-1.0.0q/crypto/rc4/rc4.c
--- openssl-1.0.0q.orig/crypto/rc4/rc4.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rc4/rc4.c	2017-04-25 16:23:40.627620267 +0200
@@ -56,9 +56,14 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/rc4.h>
 #include <openssl/evp.h>
 
@@ -85,17 +90,17 @@
 	argv++;
 	while (argc >= 1)
 		{
-		if 	(strcmp(*argv,"-in") == 0)
+		if 	(op_strcmp(*argv,"-in") == 0)
 			{
 			if (--argc < 1) goto bad;
 			infile= *(++argv);
 			}
-		else if (strcmp(*argv,"-out") == 0)
+		else if (op_strcmp(*argv,"-out") == 0)
 			{
 			if (--argc < 1) goto bad;
 			outfile= *(++argv);
 			}
-		else if (strcmp(*argv,"-key") == 0)
+		else if (op_strcmp(*argv,"-key") == 0)
 			{
 			if (--argc < 1) goto bad;
 			keystr= *(++argv);
@@ -145,7 +150,9 @@
 #ifdef OPENSSL_SYS_MSDOS
 	/* This should set the file to binary mode. */
 	{
+#ifndef OPERA_SMALL_VERSION
 #include <fcntl.h>
+#endif /* !OPERA_SMALL_VERSION */
 	setmode(fileno(in),O_BINARY);
 	setmode(fileno(out),O_BINARY);
 	}
diff -Naur openssl-1.0.0q.orig/crypto/rc4/rc4_locl.h openssl-1.0.0q/crypto/rc4/rc4_locl.h
--- openssl-1.0.0q.orig/crypto/rc4/rc4_locl.h	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rc4/rc4_locl.h	2017-04-25 16:23:40.627620267 +0200
@@ -1,5 +1,5 @@
 #ifndef HEADER_RC4_LOCL_H
 #define HEADER_RC4_LOCL_H
 #include <openssl/opensslconf.h>
-#include <cryptlib.h>
+#include <openssl/cryptlib.h>
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/rc4/rc4_skey.c openssl-1.0.0q/crypto/rc4/rc4_skey.c
--- openssl-1.0.0q.orig/crypto/rc4/rc4_skey.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rc4/rc4_skey.c	2017-04-25 16:23:40.628620115 +0200
@@ -60,8 +60,11 @@
 #include "rc4_locl.h"
 #include <openssl/opensslv.h>
 
-const char RC4_version[]="RC4" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char RC4_version[]="RC4" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-27 haavardm */
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 const char *RC4_options(void)
 	{
 #ifdef RC4_INDEX
@@ -76,6 +79,7 @@
 		return("rc4(ptr,int)");
 #endif
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 /* RC4 as implemented from a posting from
  * Newsgroups: sci.crypt
diff -Naur openssl-1.0.0q.orig/crypto/rc4/rc4s.cpp openssl-1.0.0q/crypto/rc4/rc4s.cpp
--- openssl-1.0.0q.orig/crypto/rc4/rc4s.cpp	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rc4/rc4s.cpp	2017-04-25 16:23:40.629621359 +0200
@@ -30,8 +30,10 @@
 }
 #endif      
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif // !OPERA_SMALL_VERSION
 #include <openssl/rc4.h>
 
 void main(int argc,char *argv[])
@@ -46,7 +48,7 @@
 	int j=0;
 
 	if (argc >= 2)
-		num=atoi(argv[1]);
+		num=op_atoi(argv[1]);
 
 	if (num == 0) num=256;
 	if (num > 1024-16) num=1024-16;
diff -Naur openssl-1.0.0q.orig/crypto/rc4/rc4speed.c openssl-1.0.0q/crypto/rc4/rc4speed.c
--- openssl-1.0.0q.orig/crypto/rc4/rc4speed.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rc4/rc4speed.c	2017-04-25 16:23:40.629621359 +0200
@@ -63,7 +63,9 @@
 #define TIMES
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/e_os2.h>
 #include OPENSSL_UNISTD_IO
@@ -74,10 +76,14 @@
 #endif
 
 #ifndef _IRIX
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef TIMES
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/times.h>
 #endif
 
@@ -95,7 +101,9 @@
 
 #if defined(sun) || defined(__ultrix)
 #define _POSIX_SOURCE
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/param.h>
 #endif
 
diff -Naur openssl-1.0.0q.orig/crypto/rc4/rc4test.c openssl-1.0.0q/crypto/rc4/rc4test.c
--- openssl-1.0.0q.orig/crypto/rc4/rc4test.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rc4/rc4test.c	2017-04-25 16:23:40.630620928 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -123,9 +125,9 @@
 	for (i=0; i<6; i++)
 		{
 		RC4_set_key(&key,keys[i][0],&(keys[i][1]));
-		memset(obuf,0x00,sizeof(obuf));
+		op_memset(obuf,0x00,sizeof(obuf));
 		RC4(&key,data_len[i],&(data[i][0]),obuf);
-		if (memcmp(obuf,output[i],data_len[i]+1) != 0)
+		if (op_memcmp(obuf,output[i],data_len[i]+1) != 0)
 			{
 			printf("error calculating RC4\n");
 			printf("output:");
@@ -146,9 +148,9 @@
 	for (i=0; i<data_len[3]; i++)
 		{
 		RC4_set_key(&key,keys[3][0],&(keys[3][1]));
-		memset(obuf,0x00,sizeof(obuf));
+		op_memset(obuf,0x00,sizeof(obuf));
 		RC4(&key,i,&(data[3][0]),obuf);
-		if ((memcmp(obuf,output[3],i) != 0) || (obuf[i] != 0))
+		if ((op_memcmp(obuf,output[3],i) != 0) || (obuf[i] != 0))
 			{
 			printf("error in RC4 length processing\n");
 			printf("output:");
@@ -173,10 +175,10 @@
 	for (i=0; i<data_len[3]; i++)
 		{
 		RC4_set_key(&key,keys[3][0],&(keys[3][1]));
-		memset(obuf,0x00,sizeof(obuf));
+		op_memset(obuf,0x00,sizeof(obuf));
 		RC4(&key,i,&(data[3][0]),obuf);
 		RC4(&key,data_len[3]-i,&(data[3][i]),&(obuf[i]));
-		if (memcmp(obuf,output[3],data_len[3]+1) != 0)
+		if (op_memcmp(obuf,output[3],data_len[3]+1) != 0)
 			{
 			printf("error in RC4 multi-call processing\n");
 			printf("output:");
diff -Naur openssl-1.0.0q.orig/crypto/rc5/.gitignore openssl-1.0.0q/crypto/rc5/.gitignore
--- openssl-1.0.0q.orig/crypto/rc5/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rc5/.gitignore	2017-04-25 16:23:40.631621055 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/rc5/rc5_enc.c openssl-1.0.0q/crypto/rc5/rc5_enc.c
--- openssl-1.0.0q.orig/crypto/rc5/rc5_enc.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rc5/rc5_enc.c	2017-04-25 16:23:40.632621461 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/rc5.h>
 #include "rc5_locl.h"
 
diff -Naur openssl-1.0.0q.orig/crypto/rc5/rc5_locl.h openssl-1.0.0q/crypto/rc5/rc5_locl.h
--- openssl-1.0.0q.orig/crypto/rc5/rc5_locl.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rc5/rc5_locl.h	2017-04-25 16:23:40.633621309 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #undef c2l
 #define c2l(c,l)	(l =((unsigned long)(*((c)++)))    , \
diff -Naur openssl-1.0.0q.orig/crypto/rc5/rc5s.cpp openssl-1.0.0q/crypto/rc5/rc5s.cpp
--- openssl-1.0.0q.orig/crypto/rc5/rc5s.cpp	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rc5/rc5s.cpp	2017-04-25 16:23:40.633621309 +0200
@@ -30,8 +30,10 @@
 }
 #endif      
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif // !OPERA_SMALL_VERSION
 #include <openssl/rc5.h>
 
 void main(int argc,char *argv[])
diff -Naur openssl-1.0.0q.orig/crypto/rc5/rc5speed.c openssl-1.0.0q/crypto/rc5/rc5speed.c
--- openssl-1.0.0q.orig/crypto/rc5/rc5speed.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rc5/rc5speed.c	2017-04-25 16:23:40.634620598 +0200
@@ -63,7 +63,9 @@
 #define TIMES
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/e_os2.h>
 #include OPENSSL_UNISTD_IO
@@ -74,10 +76,14 @@
 #endif
 
 #ifndef _IRIX
+#ifndef OPERA_SMALL_VERSION
 #include <time.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef TIMES
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/times.h>
 #endif
 
@@ -95,7 +101,9 @@
 
 #if defined(sun) || defined(__ultrix)
 #define _POSIX_SOURCE
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <sys/param.h>
 #endif
 
diff -Naur openssl-1.0.0q.orig/crypto/rc5/rc5test.c openssl-1.0.0q/crypto/rc5/rc5test.c
--- openssl-1.0.0q.orig/crypto/rc5/rc5test.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rc5/rc5test.c	2017-04-25 16:23:40.635620725 +0200
@@ -59,9 +59,11 @@
 /* This has been a quickly hacked 'ideatest.c'.  When I add tests for other
  * RC5 modes, more of the code will be uncommented. */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -245,7 +247,7 @@
 		RC5_32_set_key(&key,16,&(RC5key[n][0]),12);
 
 		RC5_32_ecb_encrypt(&(RC5plain[n][0]),buf,&key,RC5_ENCRYPT);
-		if (memcmp(&(RC5cipher[n][0]),buf,8) != 0)
+		if (op_memcmp(&(RC5cipher[n][0]),buf,8) != 0)
 			{
 			printf("ecb RC5 error encrypting (%d)\n",n+1);
 			printf("got     :");
@@ -260,7 +262,7 @@
 			}
 
 		RC5_32_ecb_encrypt(buf,buf2,&key,RC5_DECRYPT);
-		if (memcmp(&(RC5plain[n][0]),buf2,8) != 0)
+		if (op_memcmp(&(RC5plain[n][0]),buf2,8) != 0)
 			{
 			printf("ecb RC5 error decrypting (%d)\n",n+1);
 			printf("got     :");
@@ -283,11 +285,11 @@
 
 		RC5_32_set_key(&key,rc5_cbc_key[n][0],&(rc5_cbc_key[n][1]),i);
 
-		memcpy(ivb,&(rc5_cbc_iv[n][0]),8);
+		op_memcpy(ivb,&(rc5_cbc_iv[n][0]),8);
 		RC5_32_cbc_encrypt(&(rc5_cbc_plain[n][0]),buf,8,
 			&key,&(ivb[0]),RC5_ENCRYPT);
 
-		if (memcmp(&(rc5_cbc_cipher[n][0]),buf,8) != 0)
+		if (op_memcmp(&(rc5_cbc_cipher[n][0]),buf,8) != 0)
 			{
 			printf("cbc RC5 error encrypting (%d)\n",n+1);
 			printf("got     :");
@@ -301,10 +303,10 @@
 			printf("\n");
 			}
 
-		memcpy(ivb,&(rc5_cbc_iv[n][0]),8);
+		op_memcpy(ivb,&(rc5_cbc_iv[n][0]),8);
 		RC5_32_cbc_encrypt(buf,buf2,8,
 			&key,&(ivb[0]),RC5_DECRYPT);
-		if (memcmp(&(rc5_cbc_plain[n][0]),buf2,8) != 0)
+		if (op_memcmp(&(rc5_cbc_plain[n][0]),buf2,8) != 0)
 			{
 			printf("cbc RC5 error decrypting (%d)\n",n+1);
 			printf("got     :");
@@ -332,28 +334,28 @@
 
         idea_set_encrypt_key(cfb_key,&eks);
         idea_set_decrypt_key(&eks,&dks);
-        memcpy(cfb_tmp,cfb_iv,8);
+        op_memcpy(cfb_tmp,cfb_iv,8);
         n=0;
         idea_cfb64_encrypt(plain,cfb_buf1,(long)12,&eks,
                 cfb_tmp,&n,IDEA_ENCRYPT);
         idea_cfb64_encrypt(&(plain[12]),&(cfb_buf1[12]),
                 (long)CFB_TEST_SIZE-12,&eks,
                 cfb_tmp,&n,IDEA_ENCRYPT);
-        if (memcmp(cfb_cipher,cfb_buf1,CFB_TEST_SIZE) != 0)
+        if (op_memcmp(cfb_cipher,cfb_buf1,CFB_TEST_SIZE) != 0)
                 {
                 err=1;
                 printf("idea_cfb64_encrypt encrypt error\n");
                 for (i=0; i<CFB_TEST_SIZE; i+=8)
                         printf("%s\n",pt(&(cfb_buf1[i])));
                 }
-        memcpy(cfb_tmp,cfb_iv,8);
+        op_memcpy(cfb_tmp,cfb_iv,8);
         n=0;
         idea_cfb64_encrypt(cfb_buf1,cfb_buf2,(long)17,&eks,
                 cfb_tmp,&n,IDEA_DECRYPT);
         idea_cfb64_encrypt(&(cfb_buf1[17]),&(cfb_buf2[17]),
                 (long)CFB_TEST_SIZE-17,&dks,
                 cfb_tmp,&n,IDEA_DECRYPT);
-        if (memcmp(plain,cfb_buf2,CFB_TEST_SIZE) != 0)
+        if (op_memcmp(plain,cfb_buf2,CFB_TEST_SIZE) != 0)
                 {
                 err=1;
                 printf("idea_cfb_encrypt decrypt error\n");
diff -Naur openssl-1.0.0q.orig/crypto/ripemd/.gitignore openssl-1.0.0q/crypto/ripemd/.gitignore
--- openssl-1.0.0q.orig/crypto/ripemd/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ripemd/.gitignore	2017-04-25 16:23:40.636620852 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/ripemd/asm/rips.cpp openssl-1.0.0q/crypto/ripemd/asm/rips.cpp
--- openssl-1.0.0q.orig/crypto/ripemd/asm/rips.cpp	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ripemd/asm/rips.cpp	2017-04-25 16:23:40.637620979 +0200
@@ -30,8 +30,10 @@
 }
 #endif      
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif // !OPERA_SMALL_VERSION
 #include <openssl/ripemd.h>
 
 #define ripemd160_block_x86 ripemd160_block_asm_host_order
@@ -52,7 +54,7 @@
 	int j=0;
 
 	if (argc >= 2)
-		num=atoi(argv[1]);
+		num=op_atoi(argv[1]);
 
 	if (num == 0) num=16;
 	if (num > 250) num=16;
diff -Naur openssl-1.0.0q.orig/crypto/ripemd/opera_rmd_dgst.cpp openssl-1.0.0q/crypto/ripemd/opera_rmd_dgst.cpp
--- openssl-1.0.0q.orig/crypto/ripemd/opera_rmd_dgst.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ripemd/opera_rmd_dgst.cpp	2017-04-25 16:23:40.637620979 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/ripemd/rmd_dgst.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/ripemd/rmd160.c openssl-1.0.0q/crypto/ripemd/rmd160.c
--- openssl-1.0.0q.orig/crypto/ripemd/rmd160.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/ripemd/rmd160.c	2017-04-25 16:23:40.638621386 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/ripemd.h>
 
 #define BUFSIZE	1024*16
diff -Naur openssl-1.0.0q.orig/crypto/ripemd/rmd_dgst.c openssl-1.0.0q/crypto/ripemd/rmd_dgst.c
--- openssl-1.0.0q.orig/crypto/ripemd/rmd_dgst.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ripemd/rmd_dgst.c	2017-04-25 16:23:40.639620954 +0200
@@ -56,11 +56,17 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPENSSL_NO_RIPEMD
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "rmd_locl.h"
 #include <openssl/opensslv.h>
 
-const char RMD160_version[]="RIPE-MD160" OPENSSL_VERSION_PTEXT;
+
+
+const char RMD160_version[]="RIPE-MD160" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-27 haavardm */
 
 #  ifdef RMD160_ASM
      void ripemd160_block_x86(RIPEMD160_CTX *c, unsigned long *p,size_t num);
@@ -289,3 +295,5 @@
 		}
 	}
 #endif
+
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/ripemd/rmd_locl.h openssl-1.0.0q/crypto/ripemd/rmd_locl.h
--- openssl-1.0.0q.orig/crypto/ripemd/rmd_locl.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ripemd/rmd_locl.h	2017-04-25 16:23:40.640621640 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/opensslconf.h>
 #include <openssl/ripemd.h>
 
@@ -96,7 +98,7 @@
 	} while (0)
 #define HASH_BLOCK_DATA_ORDER   ripemd160_block_data_order
 
-#include "md32_common.h"
+#include <openssl/md32_common.h>
 
 #if 0
 #define F1(x,y,z)	 ((x)^(y)^(z))
diff -Naur openssl-1.0.0q.orig/crypto/ripemd/rmd_one.c openssl-1.0.0q/crypto/ripemd/rmd_one.c
--- openssl-1.0.0q.orig/crypto/ripemd/rmd_one.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ripemd/rmd_one.c	2017-04-25 16:23:40.640621640 +0200
@@ -56,8 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPENSSL_NO_RIPEMD
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/ripemd.h>
 #include <openssl/crypto.h>
 
@@ -76,3 +80,4 @@
 	return(md);
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/ripemd/rmdtest.c openssl-1.0.0q/crypto/ripemd/rmdtest.c
--- openssl-1.0.0q.orig/crypto/ripemd/rmdtest.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/ripemd/rmdtest.c	2017-04-25 16:23:40.641621767 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -113,11 +115,11 @@
 	while (*P != NULL)
 		{
 #ifdef CHARSET_EBCDIC
-		ebcdic2ascii((char *)*P, (char *)*P, strlen((char *)*P));
+		ebcdic2ascii((char *)*P, (char *)*P, op_strlen((char *)*P));
 #endif
 		EVP_Digest(&(P[0][0]),strlen((char *)*P),md,NULL,EVP_ripemd160(), NULL);
 		p=pt(md);
-		if (strcmp(p,(char *)*R) != 0)
+		if (op_strcmp(p,(char *)*R) != 0)
 			{
 			printf("error calculating RIPEMD160 on '%s'\n",*P);
 			printf("got %s instead of %s\n",p,*R);
@@ -139,7 +141,7 @@
 	static char buf[80];
 
 	for (i=0; i<RIPEMD160_DIGEST_LENGTH; i++)
-		sprintf(&(buf[i*2]),"%02x",md[i]);
+		op_sprintf(&(buf[i*2]),"%02x",md[i]);
 	return(buf);
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/rsa/.gitignore openssl-1.0.0q/crypto/rsa/.gitignore
--- openssl-1.0.0q.orig/crypto/rsa/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/.gitignore	2017-04-25 16:23:40.642621056 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_ameth.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_ameth.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_ameth.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_ameth.cpp	2017-04-25 16:23:40.642621056 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_ameth.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_asn1.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_asn1.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_asn1.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_asn1.cpp	2017-04-25 16:23:40.643621742 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_asn1.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_eay.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_eay.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_eay.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_eay.cpp	2017-04-25 16:23:40.643621742 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_eay.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_gen.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_gen.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_gen.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_gen.cpp	2017-04-25 16:23:40.644621590 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_gen.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_lib.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_lib.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_lib.cpp	2017-04-25 16:23:40.644621590 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_oaep.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_oaep.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_oaep.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_oaep.cpp	2017-04-25 16:23:40.644621590 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_oaep.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_pk1.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_pk1.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_pk1.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_pk1.cpp	2017-04-25 16:23:40.645621158 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_pk1.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_pmeth.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_pmeth.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_pmeth.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_pmeth.cpp	2017-04-25 16:23:40.645621158 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_pmeth.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_pss.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_pss.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_pss.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_pss.cpp	2017-04-25 16:23:40.646620447 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_pss.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_sign.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_sign.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_sign.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_sign.cpp	2017-04-25 16:23:40.646620447 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_sign.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/opera_rsa_x931.cpp openssl-1.0.0q/crypto/rsa/opera_rsa_x931.cpp
--- openssl-1.0.0q.orig/crypto/rsa/opera_rsa_x931.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/opera_rsa_x931.cpp	2017-04-25 16:23:40.647621412 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/rsa/rsa_x931.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa.h openssl-1.0.0q/crypto/rsa/rsa.h
--- openssl-1.0.0q.orig/crypto/rsa/rsa.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa.h	2017-04-25 16:23:40.647621412 +0200
@@ -153,11 +153,13 @@
 	BN_MONT_CTX *_method_mod_p;
 	BN_MONT_CTX *_method_mod_q;
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 	/* all BIGNUM values are actually in the following data, if it is not
 	 * NULL */
 	char *bignum_data;
 	BN_BLINDING *blinding;
 	BN_BLINDING *mt_blinding;
+#endif
 	};
 
 #ifndef OPENSSL_RSA_MAX_MODULUS_BITS
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_ameth.c openssl-1.0.0q/crypto/rsa/rsa_ameth.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_ameth.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_ameth.c	2017-04-25 16:23:40.648621540 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/rsa.h>
@@ -65,7 +68,9 @@
 #ifndef OPENSSL_NO_CMS
 #include <openssl/cms.h>
 #endif
-#include "asn1_locl.h"
+#include "../asn1/asn1_locl.h"
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 static int rsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
 	{
@@ -182,7 +187,7 @@
 
 static int do_rsa_print(BIO *bp, const RSA *x, int off, int priv)
 	{
-	char *str;
+	const char *str;
 	const char *s;
 	unsigned char *m=NULL;
 	int ret=0, mod_len = 0;
@@ -274,12 +279,12 @@
 
 		case ASN1_PKEY_CTRL_PKCS7_SIGN:
 		if (arg1 == 0)
-			PKCS7_SIGNER_INFO_get0_algs(arg2, NULL, NULL, &alg);
+			PKCS7_SIGNER_INFO_get0_algs((PKCS7_SIGNER_INFO *)arg2, NULL, NULL, &alg);
 		break;
 
 		case ASN1_PKEY_CTRL_PKCS7_ENCRYPT:
 		if (arg1 == 0)
-			PKCS7_RECIP_INFO_get0_alg(arg2, &alg);
+			PKCS7_RECIP_INFO_get0_alg((PKCS7_RECIP_INFO *)arg2, &alg);
 		break;
 #ifndef OPENSSL_NO_CMS
 		case ASN1_PKEY_CTRL_CMS_SIGN:
@@ -311,15 +316,13 @@
 	}
 
 
-const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = 
-	{
-		{
+CONST_EVP_PKEY_ASN1_METHOD_ITEM(rsa_ameth__rsa_asn1_meth0,
 		EVP_PKEY_RSA,
 		EVP_PKEY_RSA,
 		ASN1_PKEY_SIGPARAM_NULL,
 
-		"RSA",
-		"OpenSSL RSA method",
+		(char *)"RSA",
+		(char *)"OpenSSL RSA method",
 
 		rsa_pub_decode,
 		rsa_pub_encode,
@@ -339,11 +342,14 @@
 		rsa_pkey_ctrl,
 		old_rsa_priv_decode,
 		old_rsa_priv_encode
-		},
+		);
 
-		{
+CONST_EVP_PKEY_ASN1_METHOD_ITEM(rsa_ameth__rsa_asn1_meth1,
 		EVP_PKEY_RSA2,
 		EVP_PKEY_RSA,
 		ASN1_PKEY_ALIAS
-		}
-	};
+		// 21 zeros.
+		, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+		, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+		, 0
+		);
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_asn1.c openssl-1.0.0q/crypto/rsa/rsa_asn1.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_asn1.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_asn1.c	2017-04-25 16:23:40.649621108 +0200
@@ -56,11 +56,15 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/asn1t.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Override the default free and new methods */
 static int rsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
@@ -78,23 +82,22 @@
 	return 1;
 }
 
-ASN1_SEQUENCE_cb(RSAPrivateKey, rsa_cb) = {
-	ASN1_SIMPLE(RSA, version, LONG),
-	ASN1_SIMPLE(RSA, n, BIGNUM),
-	ASN1_SIMPLE(RSA, e, BIGNUM),
-	ASN1_SIMPLE(RSA, d, BIGNUM),
-	ASN1_SIMPLE(RSA, p, BIGNUM),
-	ASN1_SIMPLE(RSA, q, BIGNUM),
-	ASN1_SIMPLE(RSA, dmp1, BIGNUM),
-	ASN1_SIMPLE(RSA, dmq1, BIGNUM),
+ASN1_SEQUENCE_cb(RSAPrivateKey, rsa_cb)
+	ASN1_SIMPLE(RSA, version, LONG)
+	ASN1_SIMPLE(RSA, n, BIGNUM)
+	ASN1_SIMPLE(RSA, e, BIGNUM)
+	ASN1_SIMPLE(RSA, d, BIGNUM)
+	ASN1_SIMPLE(RSA, p, BIGNUM)
+	ASN1_SIMPLE(RSA, q, BIGNUM)
+	ASN1_SIMPLE(RSA, dmp1, BIGNUM)
+	ASN1_SIMPLE(RSA, dmq1, BIGNUM)
 	ASN1_SIMPLE(RSA, iqmp, BIGNUM)
-} ASN1_SEQUENCE_END_cb(RSA, RSAPrivateKey)
-
+ASN1_SEQUENCE_END_cb(RSA, RSAPrivateKey)
 
-ASN1_SEQUENCE_cb(RSAPublicKey, rsa_cb) = {
-	ASN1_SIMPLE(RSA, n, BIGNUM),
-	ASN1_SIMPLE(RSA, e, BIGNUM),
-} ASN1_SEQUENCE_END_cb(RSA, RSAPublicKey)
+ASN1_SEQUENCE_cb(RSAPublicKey, rsa_cb)
+	ASN1_SIMPLE(RSA, n, BIGNUM)
+	ASN1_SIMPLE(RSA, e, BIGNUM)
+ASN1_SEQUENCE_END_cb(RSA, RSAPublicKey)
 
 IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPrivateKey, RSAPrivateKey)
 
@@ -102,10 +105,10 @@
 
 RSA *RSAPublicKey_dup(RSA *rsa)
 	{
-	return ASN1_item_dup(ASN1_ITEM_rptr(RSAPublicKey), rsa);
+	return (RSA*)ASN1_item_dup(ASN1_ITEM_rptr(RSAPublicKey), rsa);
 	}
 
 RSA *RSAPrivateKey_dup(RSA *rsa)
 	{
-	return ASN1_item_dup(ASN1_ITEM_rptr(RSAPrivateKey), rsa);
+	return (RSA*)ASN1_item_dup(ASN1_ITEM_rptr(RSAPrivateKey), rsa);
 	}
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_eay.c openssl-1.0.0q/crypto/rsa/rsa_eay.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_eay.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_eay.c	2017-04-25 16:23:40.650620676 +0200
@@ -109,47 +109,72 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 #ifndef RSA_NULL
+#if !defined USE_OPENSSL_CERTIFICATE_VERIFICATION || defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
 
 static int RSA_eay_public_encrypt(int flen, const unsigned char *from,
 		unsigned char *to, RSA *rsa,int padding);
 static int RSA_eay_private_encrypt(int flen, const unsigned char *from,
 		unsigned char *to, RSA *rsa,int padding);
+
+#endif
+
 static int RSA_eay_public_decrypt(int flen, const unsigned char *from,
 		unsigned char *to, RSA *rsa,int padding);
+
+#if !defined OPERA_SMALL_VERSION || defined SSL_PRIVATE_KEY_DECRYPT || defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
 static int RSA_eay_private_decrypt(int flen, const unsigned char *from,
 		unsigned char *to, RSA *rsa,int padding);
+#endif
+
 static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx);
 static int RSA_eay_init(RSA *rsa);
 static int RSA_eay_finish(RSA *rsa);
-static RSA_METHOD rsa_pkcs1_eay_meth={
-	"Eric Young's PKCS#1 RSA",
-	RSA_eay_public_encrypt,
-	RSA_eay_public_decrypt, /* signature verification */
-	RSA_eay_private_encrypt, /* signing */
-	RSA_eay_private_decrypt,
-	RSA_eay_mod_exp,
-	BN_mod_exp_mont, /* XXX probably we should not use Montgomery if  e == 3 */
-	RSA_eay_init,
-	RSA_eay_finish,
-	0, /* flags */
-	NULL,
-	0, /* rsa_sign */
-	0, /* rsa_verify */
-	NULL /* rsa_keygen */
-	};
+
+OPENSSL_PREFIX_CONST_ITEM(static, RSA_METHOD, rsa_pkcs1_eay_meth, libopeay)
+	CONST_ITEM_ENTRY_START(name, OPERA_OPENSSL_STRINGS("Eric Young's PKCS#1 RSA"))
+#if !defined USE_OPENSSL_CERTIFICATE_VERIFICATION || defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
+	CONST_ITEM_ENTRY_SINGLE(rsa_pub_enc, RSA_eay_public_encrypt)
+#else
+	CONST_ITEM_ENTRY_SINGLE(rsa_pub_enc, 0)
+#endif
+	CONST_ITEM_ENTRY_SINGLE(rsa_pub_dec, RSA_eay_public_decrypt) /* signature verification */
+#if !defined USE_OPENSSL_CERTIFICATE_VERIFICATION || defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
+	CONST_ITEM_ENTRY_SINGLE(rsa_priv_enc, RSA_eay_private_encrypt)
+#else
+	CONST_ITEM_ENTRY_SINGLE(rsa_priv_enc, 0) /* signing */
+#endif
+#if !defined OPERA_SMALL_VERSION || defined SSL_PRIVATE_KEY_DECRYPT || defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
+	CONST_ITEM_ENTRY_SINGLE(rsa_priv_dec, RSA_eay_private_decrypt)
+#else
+	CONST_ITEM_ENTRY_SINGLE(rsa_priv_dec, NULL)
+#endif
+	CONST_ITEM_ENTRY_SINGLE(rsa_mod_exp, RSA_eay_mod_exp)
+	CONST_ITEM_ENTRY_SINGLE(bn_mod_exp, BN_mod_exp_mont) /* XXX probably we should not use Montgomery if  e == 3 */
+	CONST_ITEM_ENTRY_SINGLE(init, RSA_eay_init)
+	CONST_ITEM_ENTRY_SINGLE(finish, RSA_eay_finish)
+	CONST_ITEM_ENTRY_SINGLE(flags, 0)
+	CONST_ITEM_ENTRY_SINGLE(app_data, NULL)
+	CONST_ITEM_ENTRY_SINGLE(rsa_sign, 0)
+	CONST_ITEM_ENTRY_SINGLE(rsa_verify, 0)
+	CONST_ITEM_ENTRY_SINGLE(rsa_keygen, NULL)
+	CONST_ITEM_ENTRY_END;
 
 const RSA_METHOD *RSA_PKCS1_SSLeay(void)
 	{
-	return(&rsa_pkcs1_eay_meth);
+	return(&OPENSSL_GLOBAL_ITEM_NAME(rsa_pkcs1_eay_meth));
 	}
 
+#if !defined USE_OPENSSL_CERTIFICATE_VERIFICATION || defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
 static int RSA_eay_public_encrypt(int flen, const unsigned char *from,
 	     unsigned char *to, RSA *rsa, int padding)
 	{
@@ -185,29 +210,39 @@
 	f = BN_CTX_get(ctx);
 	ret = BN_CTX_get(ctx);
 	num=BN_num_bytes(rsa->n);
-	buf = OPENSSL_malloc(num);
+	buf = (unsigned char *) OPENSSL_malloc(num);
 	if (!f || !ret || !buf)
 		{
 		RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,ERR_R_MALLOC_FAILURE);
 		goto err;
 		}
 
+#ifdef VALGRIND
+	op_memset(buf,0,num);
+#endif
+
 	switch (padding)
 		{
 	case RSA_PKCS1_PADDING:
 		i=RSA_padding_add_PKCS1_type_2(buf,num,from,flen);
 		break;
+#ifndef OPERA_SMALL_VERSION
 #ifndef OPENSSL_NO_SHA
 	case RSA_PKCS1_OAEP_PADDING:
 	        i=RSA_padding_add_PKCS1_OAEP(buf,num,from,flen,NULL,0);
 		break;
 #endif
+#endif
+#if !defined OPERA_SMALL_VERSION || defined SSL_2_0_SUPPORT
 	case RSA_SSLV23_PADDING:
 		i=RSA_padding_add_SSLv23(buf,num,from,flen);
 		break;
+#endif
+#ifndef OPERA_SMALL_VERSION
 	case RSA_NO_PADDING:
 		i=RSA_padding_add_none(buf,num,from,flen);
 		break;
+#endif
 	default:
 		RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,RSA_R_UNKNOWN_PADDING_TYPE);
 		goto err;
@@ -251,7 +286,9 @@
 		}
 	return(r);
 	}
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 static BN_BLINDING *rsa_get_blinding(RSA *rsa, int *local, BN_CTX *ctx)
 {
 	BN_BLINDING *ret;
@@ -345,6 +382,7 @@
 	 */
 	return BN_BLINDING_invert_ex(f, unblind, b, ctx);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 /* signing */
 static int RSA_eay_private_encrypt(int flen, const unsigned char *from,
@@ -354,19 +392,21 @@
 	int i,j,k,num=0,r= -1;
 	unsigned char *buf=NULL;
 	BN_CTX *ctx=NULL;
+#ifndef OPERA_SMALL_VERSION
 	int local_blinding = 0;
 	/* Used only if the blinding structure is shared. A non-NULL unblind
 	 * instructs rsa_blinding_convert() and rsa_blinding_invert() to store
 	 * the unblinding factor outside the blinding structure. */
 	BIGNUM *unblind = NULL;
 	BN_BLINDING *blinding = NULL;
+#endif
 
 	if ((ctx=BN_CTX_new()) == NULL) goto err;
 	BN_CTX_start(ctx);
 	f   = BN_CTX_get(ctx);
 	ret = BN_CTX_get(ctx);
 	num = BN_num_bytes(rsa->n);
-	buf = OPENSSL_malloc(num);
+	buf = (unsigned char *) OPENSSL_malloc(num);
 	if(!f || !ret || !buf)
 		{
 		RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT,ERR_R_MALLOC_FAILURE);
@@ -378,12 +418,14 @@
 	case RSA_PKCS1_PADDING:
 		i=RSA_padding_add_PKCS1_type_1(buf,num,from,flen);
 		break;
+#ifndef OPERA_SMALL_VERSION
 	case RSA_X931_PADDING:
 		i=RSA_padding_add_X931(buf,num,from,flen);
 		break;
 	case RSA_NO_PADDING:
 		i=RSA_padding_add_none(buf,num,from,flen);
 		break;
+#endif
 	case RSA_SSLV23_PADDING:
 	default:
 		RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT,RSA_R_UNKNOWN_PADDING_TYPE);
@@ -400,6 +442,7 @@
 		goto err;
 		}
 
+#ifndef OPERA_SMALL_VERSION
 	if (!(rsa->flags & RSA_FLAG_NO_BLINDING))
 		{
 		blinding = rsa_get_blinding(rsa, &local_blinding, ctx);
@@ -420,6 +463,7 @@
 		if (!rsa_blinding_convert(blinding, f, unblind, ctx))
 			goto err;
 		}
+#endif
 
 	if ( (rsa->flags & RSA_FLAG_EXT_PKEY) ||
 		((rsa->p != NULL) &&
@@ -452,10 +496,13 @@
 				rsa->_method_mod_n)) goto err;
 		}
 
+#ifndef OPERA_SMALL_VERSION
 	if (blinding)
 		if (!rsa_blinding_invert(blinding, ret, unblind, ctx))
 			goto err;
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 	if (padding == RSA_X931_PADDING)
 		{
 		BN_sub(f, rsa->n, ret);
@@ -465,6 +512,7 @@
 			res = ret;
 		}
 	else
+#endif
 		res = ret;
 
 	/* put in leading 0 bytes if the number is less than the
@@ -489,6 +537,7 @@
 	return(r);
 	}
 
+#if !defined OPERA_SMALL_VERSION || defined SSL_PRIVATE_KEY_DECRYPT || defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
 static int RSA_eay_private_decrypt(int flen, const unsigned char *from,
 	     unsigned char *to, RSA *rsa, int padding)
 	{
@@ -497,19 +546,21 @@
 	unsigned char *p;
 	unsigned char *buf=NULL;
 	BN_CTX *ctx=NULL;
+#ifndef OPERA_SMALL_VERSION
 	int local_blinding = 0;
 	/* Used only if the blinding structure is shared. A non-NULL unblind
 	 * instructs rsa_blinding_convert() and rsa_blinding_invert() to store
 	 * the unblinding factor outside the blinding structure. */
 	BIGNUM *unblind = NULL;
 	BN_BLINDING *blinding = NULL;
+#endif
 
 	if((ctx = BN_CTX_new()) == NULL) goto err;
 	BN_CTX_start(ctx);
 	f   = BN_CTX_get(ctx);
 	ret = BN_CTX_get(ctx);
 	num = BN_num_bytes(rsa->n);
-	buf = OPENSSL_malloc(num);
+	buf = (unsigned char *) OPENSSL_malloc(num);
 	if(!f || !ret || !buf)
 		{
 		RSAerr(RSA_F_RSA_EAY_PRIVATE_DECRYPT,ERR_R_MALLOC_FAILURE);
@@ -533,6 +584,7 @@
 		goto err;
 		}
 
+#ifndef OPERA_SMALL_VERSION
 	if (!(rsa->flags & RSA_FLAG_NO_BLINDING))
 		{
 		blinding = rsa_get_blinding(rsa, &local_blinding, ctx);
@@ -553,6 +605,7 @@
 		if (!rsa_blinding_convert(blinding, f, unblind, ctx))
 			goto err;
 		}
+#endif
 
 	/* do the decrypt */
 	if ( (rsa->flags & RSA_FLAG_EXT_PKEY) ||
@@ -585,9 +638,11 @@
 		  goto err;
 		}
 
+#ifndef OPERA_SMALL_VERSION
 	if (blinding)
 		if (!rsa_blinding_invert(blinding, ret, unblind, ctx))
 			goto err;
+#endif
 
 	p=buf;
 	j=BN_bn2bin(ret,p); /* j is only used with no-padding mode */
@@ -597,17 +652,21 @@
 	case RSA_PKCS1_PADDING:
 		r=RSA_padding_check_PKCS1_type_2(to,num,buf,j,num);
 		break;
+#ifndef OPERA_SMALL_VERSION
 #ifndef OPENSSL_NO_SHA
         case RSA_PKCS1_OAEP_PADDING:
 	        r=RSA_padding_check_PKCS1_OAEP(to,num,buf,j,num,NULL,0);
                 break;
 #endif
+#endif
+#ifndef OPERA_SMALL_VERSION
  	case RSA_SSLV23_PADDING:
 		r=RSA_padding_check_SSLv23(to,num,buf,j,num);
 		break;
 	case RSA_NO_PADDING:
 		r=RSA_padding_check_none(to,num,buf,j,num);
 		break;
+#endif
 	default:
 		RSAerr(RSA_F_RSA_EAY_PRIVATE_DECRYPT,RSA_R_UNKNOWN_PADDING_TYPE);
 		goto err;
@@ -628,6 +687,7 @@
 		}
 	return(r);
 	}
+#endif
 
 /* signature verification */
 static int RSA_eay_public_decrypt(int flen, const unsigned char *from,
@@ -666,7 +726,7 @@
 	f = BN_CTX_get(ctx);
 	ret = BN_CTX_get(ctx);
 	num=BN_num_bytes(rsa->n);
-	buf = OPENSSL_malloc(num);
+	buf = (unsigned char *) OPENSSL_malloc(num);
 	if(!f || !ret || !buf)
 		{
 		RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,ERR_R_MALLOC_FAILURE);
@@ -707,12 +767,14 @@
 	case RSA_PKCS1_PADDING:
 		r=RSA_padding_check_PKCS1_type_1(to,num,buf,i,num);
 		break;
+#ifndef OPERA_SMALL_VERSION
 	case RSA_X931_PADDING:
 		r=RSA_padding_check_X931(to,num,buf,i,num);
 		break;
 	case RSA_NO_PADDING:
 		r=RSA_padding_check_none(to,num,buf,i,num);
 		break;
+#endif
 	default:
 		RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,RSA_R_UNKNOWN_PADDING_TYPE);
 		goto err;
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_err.c openssl-1.0.0q/crypto/rsa/rsa_err.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_err.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_err.c	2017-04-25 16:23:40.651620245 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/rsa.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_gen.c openssl-1.0.0q/crypto/rsa/rsa_gen.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_gen.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_gen.c	2017-04-25 16:23:40.651620245 +0200
@@ -56,15 +56,17 @@
  * [including the GNU Public Licence.]
  */
 
-
 /* NB: these functions have been "upgraded", the deprecated versions (which are
  * compatibility wrappers using these functions) are in rsa_depr.c.
  * - Geoff
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 
@@ -216,4 +218,3 @@
 
 	return ok;
 	}
-
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_lib.c openssl-1.0.0q/crypto/rsa/rsa_lib.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_lib.c	2017-04-25 16:23:40.652620372 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/crypto.h>
-#include "cryptlib.h"
 #include <openssl/lhash.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
@@ -67,9 +69,13 @@
 #include <openssl/engine.h>
 #endif
 
-const char RSA_version[]="RSA" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char RSA_version[]="RSA" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-27 haavardm */
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 static const RSA_METHOD *default_RSA_meth=NULL;
+#endif
 
 RSA *RSA_new(void)
 	{
@@ -78,13 +84,16 @@
 	return r;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 void RSA_set_default_method(const RSA_METHOD *meth)
 	{
 	default_RSA_meth = meth;
 	}
+#endif
 
 const RSA_METHOD *RSA_get_default_method(void)
 	{
+#ifndef OPERA_SMALL_VERSION
 	if (default_RSA_meth == NULL)
 		{
 #ifdef RSA_NULL
@@ -99,8 +108,12 @@
 		}
 
 	return default_RSA_meth;
+#else
+	return RSA_PKCS1_SSLeay();
+#endif
 	}
 
+#ifndef OPERA_SMALL_VERSION
 const RSA_METHOD *RSA_get_method(const RSA *rsa)
 	{
 	return rsa->meth;
@@ -124,6 +137,7 @@
 	if (meth->init) meth->init(rsa);
 	return 1;
 	}
+#endif // !OPERA_SMALL_VERSION
 
 RSA *RSA_new_method(ENGINE *engine)
 	{
@@ -137,6 +151,7 @@
 		}
 
 	ret->meth = RSA_get_default_method();
+#ifndef OPERA_SMALL_VERSION
 #ifndef OPENSSL_NO_ENGINE
 	if (engine)
 		{
@@ -163,6 +178,9 @@
 			}
 		}
 #endif
+#else
+	ret->engine = NULL;
+#endif // !OPERA_SMALL_VERSION
 
 	ret->pad=0;
 	ret->version=0;
@@ -178,9 +196,11 @@
 	ret->_method_mod_n=NULL;
 	ret->_method_mod_p=NULL;
 	ret->_method_mod_q=NULL;
+#ifndef OPERA_SMALL_VERSION
 	ret->blinding=NULL;
 	ret->mt_blinding=NULL;
 	ret->bignum_data=NULL;
+#endif
 	ret->flags=ret->meth->flags;
 	if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data))
 		{
@@ -241,9 +261,11 @@
 	if (r->dmp1 != NULL) BN_clear_free(r->dmp1);
 	if (r->dmq1 != NULL) BN_clear_free(r->dmq1);
 	if (r->iqmp != NULL) BN_clear_free(r->iqmp);
+#ifndef OPERA_SMALL_VERSION
 	if (r->blinding != NULL) BN_BLINDING_free(r->blinding);
 	if (r->mt_blinding != NULL) BN_BLINDING_free(r->mt_blinding);
 	if (r->bignum_data != NULL) OPENSSL_free_locked(r->bignum_data);
+#endif
 	OPENSSL_free(r);
 	}
 
@@ -314,6 +336,7 @@
 	return((r == NULL)?0:r->meth->flags);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 void RSA_blinding_off(RSA *rsa)
 	{
 	if (rsa->blinding != NULL)
@@ -436,7 +459,9 @@
 
 	return ret;
 }
+#endif // !OPERA_SMALL_VERSION
 
+#ifndef OPERA_SMALL_VERSION
 int RSA_memory_lock(RSA *r)
 	{
 	int i,j,k,off;
@@ -456,7 +481,7 @@
 	j=1;
 	for (i=0; i<6; i++)
 		j+= (*t[i])->top;
-	if ((p=OPENSSL_malloc_locked((off+j)*sizeof(BN_ULONG))) == NULL)
+	if ((p=(char*)OPENSSL_malloc_locked((off+j)*sizeof(BN_ULONG))) == NULL)
 		{
 		RSAerr(RSA_F_RSA_MEMORY_LOCK,ERR_R_MALLOC_FAILURE);
 		return(0);
@@ -467,10 +492,10 @@
 		{
 		b= *(t[i]);
 		*(t[i])= &(bn[i]);
-		memcpy((char *)&(bn[i]),(char *)b,sizeof(BIGNUM));
+		op_memcpy((char *)&(bn[i]),(char *)b,sizeof(BIGNUM));
 		bn[i].flags=BN_FLG_STATIC_DATA;
 		bn[i].d=ul;
-		memcpy((char *)ul,b->d,sizeof(BN_ULONG)*b->top);
+		op_memcpy((char *)ul,b->d,sizeof(BN_ULONG)*b->top);
 		ul+=b->top;
 		BN_clear_free(b);
 		}
@@ -481,3 +506,4 @@
 	r->bignum_data=p;
 	return(1);
 	}
+#endif // !OPERA_SMALL_VERSION
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_none.c openssl-1.0.0q/crypto/rsa/rsa_none.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_none.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_none.c	2017-04-25 16:23:40.653620220 +0200
@@ -56,8 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
@@ -77,7 +80,7 @@
 		return(0);
 		}
 	
-	memcpy(to,from,(unsigned int)flen);
+	op_memcpy(to,from,(unsigned int)flen);
 	return(1);
 	}
 
@@ -91,8 +94,9 @@
 		return(-1);
 		}
 
-	memset(to,0,tlen-flen);
-	memcpy(to+tlen-flen,from,flen);
+	op_memset(to,0,tlen-flen);
+	op_memcpy(to+tlen-flen,from,flen);
 	return(tlen);
 	}
+#endif
 
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_null.c openssl-1.0.0q/crypto/rsa/rsa_null.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_null.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_null.c	2017-04-25 16:23:40.654621185 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_oaep.c openssl-1.0.0q/crypto/rsa/rsa_oaep.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_oaep.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_oaep.c	2017-04-25 16:23:40.654621185 +0200
@@ -21,8 +21,11 @@
 #include "constant_time_locl.h"
 
 #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/evp.h>
@@ -58,19 +61,19 @@
 	db = to + SHA_DIGEST_LENGTH + 1;
 
 	EVP_Digest((void *)param, plen, db, NULL, EVP_sha1(), NULL);
-	memset(db + SHA_DIGEST_LENGTH, 0,
+	op_memset(db + SHA_DIGEST_LENGTH, 0,
 		emlen - flen - 2 * SHA_DIGEST_LENGTH - 1);
 	db[emlen - flen - SHA_DIGEST_LENGTH - 1] = 0x01;
-	memcpy(db + emlen - flen - SHA_DIGEST_LENGTH, from, (unsigned int) flen);
+	op_memcpy(db + emlen - flen - SHA_DIGEST_LENGTH, from, (unsigned int) flen);
 	if (RAND_bytes(seed, SHA_DIGEST_LENGTH) <= 0)
 		return 0;
 #ifdef PKCS_TESTVECT
-	memcpy(seed,
+	op_memcpy(seed,
 	   "\xaa\xfd\x12\xf6\x59\xca\xe6\x34\x89\xb4\x79\xe5\x07\x6d\xde\xc2\xf0\x6c\xb5\x8f",
 	   20);
 #endif
 
-	dbmask = OPENSSL_malloc(emlen - SHA_DIGEST_LENGTH);
+	dbmask = (unsigned char *)OPENSSL_malloc(emlen - SHA_DIGEST_LENGTH);
 	if (dbmask == NULL)
 		{
 		RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE);
@@ -118,8 +121,8 @@
 		goto decoding_err;
 
 	dblen = num - SHA_DIGEST_LENGTH - 1;
-	db = OPENSSL_malloc(dblen);
-	em = OPENSSL_malloc(num);
+	db = (unsigned char *)OPENSSL_malloc(dblen);
+	em = (unsigned char *)OPENSSL_malloc(num);
 	if (db == NULL || em == NULL)
 		{
 		RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, ERR_R_MALLOC_FAILURE);
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_pk1.c openssl-1.0.0q/crypto/rsa/rsa_pk1.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_pk1.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_pk1.c	2017-04-25 16:23:40.655621871 +0200
@@ -58,8 +58,10 @@
 
 #include "constant_time_locl.h"
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
@@ -83,10 +85,10 @@
 
 	/* pad out with 0xff data */
 	j=tlen-3-flen;
-	memset(p,0xff,j);
+	op_memset(p,0xff,j);
 	p+=j;
 	*(p++)='\0';
-	memcpy(p,from,(unsigned int)flen);
+	op_memcpy(p,from,(unsigned int)flen);
 	return(1);
 	}
 
@@ -137,11 +139,12 @@
 		RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1,RSA_R_DATA_TOO_LARGE);
 		return(-1);
 		}
-	memcpy(to,p,(unsigned int)j);
+	op_memcpy(to,p,(unsigned int)j);
 
 	return(j);
 	}
 
+#if !defined USE_OPENSSL_CERTIFICATE_VERIFICATION || defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
 int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
 	     const unsigned char *from, int flen)
 	{
@@ -176,10 +179,12 @@
 
 	*(p++)='\0';
 
-	memcpy(p,from,(unsigned int)flen);
+	op_memcpy(p,from,(unsigned int)flen);
 	return(1);
 	}
+#endif
 
+#if defined(NEED_LIBOPEAY_ELGAMAL) || defined SSL_PRIVATE_KEY_DECRYPT || defined EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
 int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
 	     const unsigned char *from, int flen, int num)
 	{
@@ -216,7 +221,7 @@
 	 *
 	 * TODO(emilia): Consider porting BN_bn2bin_padded from BoringSSL.
 	 */
-	memcpy(em + num - flen, from, flen);
+	op_memcpy(em + num - flen, from, flen);
 
 	good = constant_time_is_zero(em[0]);
 	good &= constant_time_eq(em[1], 2);
@@ -258,7 +263,7 @@
 		goto err;
 		}
 
-	memcpy(to, em + msg_index, mlen);
+	op_memcpy(to, em + msg_index, mlen);
 
 err:
 	if (em != NULL)
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_pmeth.c openssl-1.0.0q/crypto/rsa/rsa_pmeth.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_pmeth.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_pmeth.c	2017-04-25 16:23:40.656620322 +0200
@@ -56,15 +56,20 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/rsa.h>
 #include <openssl/bn.h>
 #include <openssl/evp.h>
-#include "evp_locl.h"
+#include "../evp/evp_locl.h"
 #include "rsa_locl.h"
+#include "modules/libopeay/libopeay_arrays.h"
+
 
 /* RSA pkey context structure */
 
@@ -88,7 +93,7 @@
 static int pkey_rsa_init(EVP_PKEY_CTX *ctx)
 	{
 	RSA_PKEY_CTX *rctx;
-	rctx = OPENSSL_malloc(sizeof(RSA_PKEY_CTX));
+	rctx = (RSA_PKEY_CTX *)OPENSSL_malloc(sizeof(RSA_PKEY_CTX));
 	if (!rctx)
 		return 0;
 	rctx->nbits = 1024;
@@ -111,8 +116,8 @@
 	RSA_PKEY_CTX *dctx, *sctx;
 	if (!pkey_rsa_init(dst))
 		return 0;
-       	sctx = src->data;
-	dctx = dst->data;
+       	sctx = (RSA_PKEY_CTX *)src->data;
+	dctx = (RSA_PKEY_CTX *)dst->data;
 	dctx->nbits = sctx->nbits;
 	if (sctx->pub_exp)
 		{
@@ -129,7 +134,7 @@
 	{
 	if (ctx->tbuf)
 		return 1;
-	ctx->tbuf = OPENSSL_malloc(EVP_PKEY_size(pk->pkey));
+	ctx->tbuf = (unsigned char *)OPENSSL_malloc(EVP_PKEY_size(pk->pkey));
 	if (!ctx->tbuf)
 		return 0;
 	return 1;
@@ -137,7 +142,7 @@
 
 static void pkey_rsa_cleanup(EVP_PKEY_CTX *ctx)
 	{
-	RSA_PKEY_CTX *rctx = ctx->data;
+	RSA_PKEY_CTX *rctx = (RSA_PKEY_CTX *)ctx->data;
 	if (rctx)
 		{
 		if (rctx->pub_exp)
@@ -152,7 +157,7 @@
 					const unsigned char *tbs, size_t tbslen)
 	{
 	int ret;
-	RSA_PKEY_CTX *rctx = ctx->data;
+	RSA_PKEY_CTX *rctx = (RSA_PKEY_CTX *)ctx->data;
 	RSA *rsa = ctx->pkey->pkey.rsa;
 
 	if (rctx->md)
@@ -210,7 +215,7 @@
 					const unsigned char *sig, size_t siglen)
 	{
 	int ret;
-	RSA_PKEY_CTX *rctx = ctx->data;
+	RSA_PKEY_CTX *rctx = (RSA_PKEY_CTX *)ctx->data;
 
 	if (rctx->md)
 		{
@@ -266,7 +271,7 @@
 					const unsigned char *sig, size_t siglen,
 					const unsigned char *tbs, size_t tbslen)
 	{
-	RSA_PKEY_CTX *rctx = ctx->data;
+	RSA_PKEY_CTX *rctx = (RSA_PKEY_CTX *)ctx->data;
 	RSA *rsa = ctx->pkey->pkey.rsa;
 	size_t rslen;
 	if (rctx->md)
@@ -321,7 +326,7 @@
 					const unsigned char *in, size_t inlen)
 	{
 	int ret;
-	RSA_PKEY_CTX *rctx = ctx->data;
+	RSA_PKEY_CTX *rctx = (RSA_PKEY_CTX *)ctx->data;
 	ret = RSA_public_encrypt(inlen, in, out, ctx->pkey->pkey.rsa,
 							rctx->pad_mode);
 	if (ret < 0)
@@ -335,7 +340,7 @@
 					const unsigned char *in, size_t inlen)
 	{
 	int ret;
-	RSA_PKEY_CTX *rctx = ctx->data;
+	RSA_PKEY_CTX *rctx = (RSA_PKEY_CTX *)ctx->data;
 	ret = RSA_private_decrypt(inlen, in, out, ctx->pkey->pkey.rsa,
 							rctx->pad_mode);
 	if (ret < 0)
@@ -372,7 +377,7 @@
 
 static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
 	{
-	RSA_PKEY_CTX *rctx = ctx->data;
+	RSA_PKEY_CTX *rctx = (RSA_PKEY_CTX *)ctx->data;
 	switch (type)
 		{
 		case EVP_PKEY_CTRL_RSA_PADDING:
@@ -426,13 +431,13 @@
 		case EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP:
 		if (!p2)
 			return -2;
-		rctx->pub_exp = p2;
+		rctx->pub_exp = (BIGNUM *)p2;
 		return 1;
 
 		case EVP_PKEY_CTRL_MD:
-		if (!check_padding_md(p2, rctx->pad_mode))
+		if (!check_padding_md((const EVP_MD *)p2, rctx->pad_mode))
 			return 0;
-		rctx->md = p2;
+		rctx->md = (const EVP_MD *)p2;
 		return 1;
 
 		case EVP_PKEY_CTRL_DIGESTINIT:
@@ -522,7 +527,7 @@
 static int pkey_rsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
 	{
 	RSA *rsa = NULL;
-	RSA_PKEY_CTX *rctx = ctx->data;
+	RSA_PKEY_CTX *rctx = (RSA_PKEY_CTX *)ctx->data;
 	BN_GENCB *pcb, cb;
 	int ret;
 	if (!rctx->pub_exp)
@@ -549,8 +554,7 @@
 	return ret;
 	}
 
-const EVP_PKEY_METHOD rsa_pkey_meth = 
-	{
+CONST_EVP_PKEY_METHOD_ITEM(rsa_pmeth__rsa_pkey_meth,
 	EVP_PKEY_RSA,
 	EVP_PKEY_FLAG_AUTOARGLEN,
 	pkey_rsa_init,
@@ -586,4 +590,4 @@
 	pkey_rsa_ctrl_str
 
 
-	};
+	);
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_pss.c openssl-1.0.0q/crypto/rsa/rsa_pss.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_pss.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_pss.c	2017-04-25 16:23:40.658620855 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif
+
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/evp.h>
@@ -122,7 +125,7 @@
 		}
 	maskedDBLen = emLen - hLen - 1;
 	H = EM + maskedDBLen;
-	DB = OPENSSL_malloc(maskedDBLen);
+	DB = (unsigned char*)OPENSSL_malloc(maskedDBLen);
 	if (!DB)
 		{
 		RSAerr(RSA_F_RSA_VERIFY_PKCS1_PSS, ERR_R_MALLOC_FAILURE);
@@ -215,7 +218,7 @@
 		}
 	if (sLen > 0)
 		{
-		salt = OPENSSL_malloc(sLen);
+		salt = (unsigned char*)OPENSSL_malloc(sLen);
 		if (!salt)
 			{
 			RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_PSS,
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_saos.c openssl-1.0.0q/crypto/rsa/rsa_saos.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_saos.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_saos.c	2017-04-25 16:23:40.659621820 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/objects.h>
@@ -132,7 +134,7 @@
 	if (sig == NULL) goto err;
 
 	if (	((unsigned int)sig->length != m_len) ||
-		(memcmp(m,sig->data,m_len) != 0))
+		(op_memcmp(m,sig->data,m_len) != 0))
 		{
 		RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING,RSA_R_BAD_SIGNATURE);
 		}
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_sign.c openssl-1.0.0q/crypto/rsa/rsa_sign.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_sign.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_sign.c	2017-04-25 16:23:40.659621820 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_ssl.c openssl-1.0.0q/crypto/rsa/rsa_ssl.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_ssl.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_ssl.c	2017-04-25 16:23:40.660621668 +0200
@@ -56,8 +56,13 @@
  * [including the GNU Public Licence.]
  */
 
+#if !defined OPERA_SMALL_VERSION || defined SSL_2_0_SUPPORT
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
@@ -94,14 +99,15 @@
 		p++;
 		}
 
-	memset(p,3,8);
+	op_memset(p,3,8);
 	p+=8;
 	*(p++)='\0';
 
-	memcpy(p,from,(unsigned int)flen);
+	op_memcpy(p,from,(unsigned int)flen);
 	return(1);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int RSA_padding_check_SSLv23(unsigned char *to, int tlen,
 	const unsigned char *from, int flen, int num)
 	{
@@ -147,8 +153,10 @@
 		RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23,RSA_R_DATA_TOO_LARGE);
 		return(-1);
 		}
-	memcpy(to,p,(unsigned int)j);
+	op_memcpy(to,p,(unsigned int)j);
 
 	return(j);
 	}
 
+#endif // !OPERA_SMALL_VERSION
+#endif // !defined OPERA_SMALL_VERSION || defined SSL_2_0_SUPPORT
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_test.c openssl-1.0.0q/crypto/rsa/rsa_test.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_test.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_test.c	2017-04-25 16:23:40.661621516 +0200
@@ -1,7 +1,9 @@
 /* test vectors from p1ovect1.txt */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "e_os.h"
 
@@ -27,7 +29,7 @@
   key->dmp1 = BN_bin2bn(dmp1, sizeof(dmp1)-1, key->dmp1); \
   key->dmq1 = BN_bin2bn(dmq1, sizeof(dmq1)-1, key->dmq1); \
   key->iqmp = BN_bin2bn(iqmp, sizeof(iqmp)-1, key->iqmp); \
-  memcpy(c, ctext_ex, sizeof(ctext_ex) - 1); \
+  op_memcpy(c, ctext_ex, sizeof(ctext_ex) - 1); \
   return (sizeof(ctext_ex) - 1);
 
 static int key1(RSA *key, unsigned char *c)
@@ -256,7 +258,7 @@
   
 	num = RSA_private_decrypt(num, ctext, ptext, key,
 				  RSA_PKCS1_PADDING);
-	if (num != plen || memcmp(ptext, ptext_ex, num) != 0)
+	if (num != plen || op_memcmp(ptext, ptext_ex, num) != 0)
 	    {
 	    printf("PKCS#1 v1.5 decryption failed!\n");
 	    err=1;
@@ -282,12 +284,12 @@
 
 	num = RSA_private_decrypt(num, ctext, ptext, key,
 				  RSA_PKCS1_OAEP_PADDING);
-	if (num != plen || memcmp(ptext, ptext_ex, num) != 0)
+	if (num != plen || op_memcmp(ptext, ptext_ex, num) != 0)
 	    {
 	    printf("OAEP decryption (encrypted data) failed!\n");
 	    err=1;
 	    }
-	else if (memcmp(ctext, ctext_ex, num) == 0)
+	else if (op_memcmp(ctext, ctext_ex, num) == 0)
 	    printf("OAEP test vector %d passed!\n", v);
     
 	/* Different ciphertexts (rsa_oaep.c without -DPKCS_TESTVECT).
@@ -296,7 +298,7 @@
 	num = RSA_private_decrypt(clen, ctext_ex, ptext, key,
 				  RSA_PKCS1_OAEP_PADDING);
 
-	if (num != plen || memcmp(ptext, ptext_ex, num) != 0)
+	if (num != plen || op_memcmp(ptext, ptext_ex, num) != 0)
 	    {
 	    printf("OAEP decryption (test vector data) failed!\n");
 	    err=1;
diff -Naur openssl-1.0.0q.orig/crypto/rsa/rsa_x931.c openssl-1.0.0q/crypto/rsa/rsa_x931.c
--- openssl-1.0.0q.orig/crypto/rsa/rsa_x931.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/rsa/rsa_x931.c	2017-04-25 16:23:40.661621516 +0200
@@ -56,8 +56,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif
+
+#include <openssl/cryptlib.h>
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
@@ -174,4 +177,3 @@
 		}
 	return -1;
 	}
-
diff -Naur openssl-1.0.0q.orig/crypto/seed/.gitignore openssl-1.0.0q/crypto/seed/.gitignore
--- openssl-1.0.0q.orig/crypto/seed/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/seed/.gitignore	2017-04-25 16:23:40.662621363 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/sha/.gitignore openssl-1.0.0q/crypto/sha/.gitignore
--- openssl-1.0.0q.orig/crypto/sha/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/.gitignore	2017-04-25 16:23:40.663622329 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/sha/opera_sha1dgst.cpp openssl-1.0.0q/crypto/sha/opera_sha1dgst.cpp
--- openssl-1.0.0q.orig/crypto/sha/opera_sha1dgst.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/opera_sha1dgst.cpp	2017-04-25 16:23:40.663622329 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_HASH_SHA1_SUPPORT)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/sha/sha1dgst.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_HASH_SHA1_SUPPORT)
diff -Naur openssl-1.0.0q.orig/crypto/sha/opera_sha256.cpp openssl-1.0.0q/crypto/sha/opera_sha256.cpp
--- openssl-1.0.0q.orig/crypto/sha/opera_sha256.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/opera_sha256.cpp	2017-04-25 16:23:40.663622329 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_HASH_SHA256_SUPPORT)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/sha/sha256.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_HASH_SHA256_SUPPORT)
diff -Naur openssl-1.0.0q.orig/crypto/sha/opera_sha512.cpp openssl-1.0.0q/crypto/sha/opera_sha512.cpp
--- openssl-1.0.0q.orig/crypto/sha/opera_sha512.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/opera_sha512.cpp	2017-04-25 16:23:40.664620500 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_HASH_SHA512_SUPPORT)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/sha/sha512.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_HASH_SHA512_SUPPORT)
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha.c openssl-1.0.0q/crypto/sha/sha.c
--- openssl-1.0.0q.orig/crypto/sha/sha.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha.c	2017-04-25 16:23:40.664620500 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/sha.h>
 
 #define BUFSIZE	1024*16
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha.h openssl-1.0.0q/crypto/sha/sha.h
--- openssl-1.0.0q.orig/crypto/sha/sha.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha.h	2017-04-25 16:23:40.665625097 +0200
@@ -130,7 +130,7 @@
 	{
 	SHA_LONG h[8];
 	SHA_LONG Nl,Nh;
-	SHA_LONG data[SHA_LBLOCK];
+	SHA_LONG data[SHA_LBLOCK];	/* ARRAY OK 2009-05-25 yngve */
 	unsigned int num,md_len;
 	} SHA256_CTX;
 
@@ -158,7 +158,7 @@
 #define SHA512_CBLOCK	(SHA_LBLOCK*8)	/* SHA-512 treats input data as a
 					 * contiguous array of 64 bit
 					 * wide big-endian values. */
-#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
+#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) && !defined(EPOC)
 #define SHA_LONG64 unsigned __int64
 #define U64(C)     C##UI64
 #elif defined(__arch64__)
@@ -171,11 +171,11 @@
 
 typedef struct SHA512state_st
 	{
-	SHA_LONG64 h[8];
+	SHA_LONG64 h[8];						/* ARRAY OK 2009-05-25 yngve */
 	SHA_LONG64 Nl,Nh;
 	union {
-		SHA_LONG64	d[SHA_LBLOCK];
-		unsigned char	p[SHA512_CBLOCK];
+		SHA_LONG64	d[SHA_LBLOCK];			/* ARRAY OK 2009-05-25 yngve */
+		unsigned char	p[SHA512_CBLOCK];	/* ARRAY OK 2009-05-25 yngve */
 	} u;
 	unsigned int num,md_len;
 	} SHA512_CTX;
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha1.c openssl-1.0.0q/crypto/sha/sha1.c
--- openssl-1.0.0q.orig/crypto/sha/sha1.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha1.c	2017-04-25 16:23:40.666621872 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/sha.h>
 
 #define BUFSIZE	1024*16
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha1_one.c openssl-1.0.0q/crypto/sha/sha1_one.c
--- openssl-1.0.0q.orig/crypto/sha/sha1_one.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha1_one.c	2017-04-25 16:23:40.667620882 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/sha.h>
 #include <openssl/crypto.h>
 
@@ -65,7 +67,12 @@
 unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md)
 	{
 	SHA_CTX c;
+#ifdef _NO_GLOBALS_
+extern unsigned char *g_sha1_m_addr();
+#define m g_sha1_m_addr()
+#else
 	static unsigned char m[SHA_DIGEST_LENGTH];
+#endif
 
 	if (md == NULL) md=m;
 	if (!SHA1_Init(&c))
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha1dgst.c openssl-1.0.0q/crypto/sha/sha1dgst.c
--- openssl-1.0.0q.orig/crypto/sha/sha1dgst.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha1dgst.c	2017-04-25 16:23:40.668621009 +0200
@@ -64,7 +64,9 @@
 
 #include <openssl/opensslv.h>
 
-const char SHA1_version[]="SHA1" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char SHA1_version[]="SHA1" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-27 haavardm */
+#endif
 
 /* The implementation is in ../md32_common.h */
 
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha1test.c openssl-1.0.0q/crypto/sha/sha1test.c
--- openssl-1.0.0q.orig/crypto/sha/sha1test.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha1test.c	2017-04-25 16:23:40.668621009 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -113,8 +115,8 @@
 	unsigned char md[SHA_DIGEST_LENGTH];
 
 #ifdef CHARSET_EBCDIC
-	ebcdic2ascii(test[0], test[0], strlen(test[0]));
-	ebcdic2ascii(test[1], test[1], strlen(test[1]));
+	ebcdic2ascii(test[0], test[0], op_strlen(test[0]));
+	ebcdic2ascii(test[1], test[1], op_strlen(test[1]));
 #endif
 
 	EVP_MD_CTX_init(&c);
@@ -125,7 +127,7 @@
 		{
 		EVP_Digest(*P,strlen((char *)*P),md,NULL,EVP_sha1(), NULL);
 		p=pt(md);
-		if (strcmp(p,(char *)*R) != 0)
+		if (op_strcmp(p,(char *)*R) != 0)
 			{
 			printf("error calculating SHA1 on '%s'\n",*P);
 			printf("got %s instead of %s\n",p,*R);
@@ -138,7 +140,7 @@
 		P++;
 		}
 
-	memset(buf,'a',1000);
+	op_memset(buf,'a',1000);
 #ifdef CHARSET_EBCDIC
 	ebcdic2ascii(buf, buf, 1000);
 #endif /*CHARSET_EBCDIC*/
@@ -149,7 +151,7 @@
 	p=pt(md);
 
 	r=bigret;
-	if (strcmp(p,r) != 0)
+	if (op_strcmp(p,r) != 0)
 		{
 		printf("error calculating SHA1 on 'a' * 1000\n");
 		printf("got %s instead of %s\n",p,r);
@@ -172,7 +174,7 @@
 	static char buf[80];
 
 	for (i=0; i<SHA_DIGEST_LENGTH; i++)
-		sprintf(&(buf[i*2]),"%02x",md[i]);
+		op_sprintf(&(buf[i*2]),"%02x",md[i]);
 	return(buf);
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha256.c openssl-1.0.0q/crypto/sha/sha256.c
--- openssl-1.0.0q.orig/crypto/sha/sha256.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha256.c	2017-04-25 16:23:40.669621415 +0200
@@ -4,17 +4,17 @@
  * according to the OpenSSL license [found in ../../LICENSE].
  * ====================================================================
  */
+#include <openssl/cryptlib.h>
 #include <openssl/opensslconf.h>
 #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA256)
 
-#include <stdlib.h>
-#include <string.h>
-
 #include <openssl/crypto.h>
 #include <openssl/sha.h>
 #include <openssl/opensslv.h>
 
-const char SHA256_version[]="SHA-256" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char SHA256_version[]="SHA-256" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-27 haavardm */
+#endif
 
 int SHA224_Init (SHA256_CTX *c)
 	{
@@ -38,10 +38,11 @@
 	return 1;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md)
 	{
 	SHA256_CTX c;
-	static unsigned char m[SHA224_DIGEST_LENGTH];
+	static unsigned char m[SHA224_DIGEST_LENGTH]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 
 	if (md == NULL) md=m;
 	SHA224_Init(&c);
@@ -54,7 +55,7 @@
 unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md)
 	{
 	SHA256_CTX c;
-	static unsigned char m[SHA256_DIGEST_LENGTH];
+	static unsigned char m[SHA256_DIGEST_LENGTH]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 
 	if (md == NULL) md=m;
 	SHA256_Init(&c);
@@ -68,6 +69,7 @@
 {   return SHA256_Update (c,data,len);   }
 int SHA224_Final (unsigned char *md, SHA256_CTX *c)
 {   return SHA256_Final (md,c);   }
+#endif
 
 #define	DATA_ORDER_IS_BIG_ENDIAN
 
@@ -112,7 +114,7 @@
 #endif
 void sha256_block_data_order (SHA256_CTX *ctx, const void *in, size_t num);
 
-#include "md32_common.h"
+#include <openssl/md32_common.h>
 
 #ifndef SHA256_ASM
 static const SHA_LONG K256[64] = {
@@ -153,7 +155,7 @@
 	unsigned MD32_REG_T a,b,c,d,e,f,g,h,s0,s1,T1,T2;
 	SHA_LONG	X[16],l;
 	int i;
-	const unsigned char *data=in;
+	const unsigned char *data= (const unsigned char *) in;
 
 			while (num--) {
 
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha512.c openssl-1.0.0q/crypto/sha/sha512.c
--- openssl-1.0.0q.orig/crypto/sha/sha512.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha512.c	2017-04-25 16:23:40.670620983 +0200
@@ -4,6 +4,7 @@
  * according to the OpenSSL license [found in ../../LICENSE].
  * ====================================================================
  */
+#include <openssl/cryptlib.h>
 #include <openssl/opensslconf.h>
 #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA512)
 /*
@@ -41,16 +42,16 @@
  * 16-bit platforms.
  *					<appro@fy.chalmers.se>
  */
-#include <stdlib.h>
-#include <string.h>
 
 #include <openssl/crypto.h>
 #include <openssl/sha.h>
 #include <openssl/opensslv.h>
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 
-const char SHA512_version[]="SHA-512" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char SHA512_version[]="SHA-512" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-27 haavardm */
+#endif
 
 #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
     defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || \
@@ -130,10 +131,10 @@
 	p[n]=0x80;	/* There always is a room for one */
 	n++;
 	if (n > (sizeof(c->u)-16))
-		memset (p+n,0,sizeof(c->u)-n), n=0,
+		op_memset (p+n,0,sizeof(c->u)-n), n=0,
 		sha512_block_data_order (c,p,1);
 
-	memset (p+n,0,sizeof(c->u)-16-n);
+	op_memset (p+n,0,sizeof(c->u)-16-n);
 #ifdef	B_ENDIAN
 	c->u.d[SHA_LBLOCK-2] = c->Nh;
 	c->u.d[SHA_LBLOCK-1] = c->Nl;
@@ -218,8 +219,10 @@
 	return 1;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int SHA384_Final (unsigned char *md,SHA512_CTX *c)
 {   return SHA512_Final (md,c);   }
+#endif
 
 int SHA512_Update (SHA512_CTX *c, const void *_data, size_t len)
 	{
@@ -244,7 +247,7 @@
 			return 1;
 			}
 		else	{
-			memcpy (p+c->num,data,n), c->num = 0;
+			op_memcpy (p+c->num,data,n), c->num = 0;
 			len-=n, data+=n;
 			sha512_block_data_order (c,p,1);
 			}
@@ -255,7 +258,7 @@
 #ifndef SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
 		if ((size_t)data%sizeof(c->u.d[0]) != 0)
 			while (len >= sizeof(c->u))
-				memcpy (p,data,sizeof(c->u)),
+				op_memcpy (p,data,sizeof(c->u)),
 				sha512_block_data_order (c,p,1),
 				len  -= sizeof(c->u),
 				data += sizeof(c->u);
@@ -267,11 +270,12 @@
 			data -= len;
 		}
 
-	if (len != 0)	memcpy (p,data,len), c->num = (int)len;
+	if (len != 0)	op_memcpy (p,data,len), c->num = (int)len;
 
 	return 1;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int SHA384_Update (SHA512_CTX *c, const void *data, size_t len)
 {   return SHA512_Update (c,data,len);   }
 
@@ -281,7 +285,7 @@
 unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md)
 	{
 	SHA512_CTX c;
-	static unsigned char m[SHA384_DIGEST_LENGTH];
+	static unsigned char m[SHA384_DIGEST_LENGTH]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 
 	if (md == NULL) md=m;
 	SHA384_Init(&c);
@@ -294,7 +298,7 @@
 unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md)
 	{
 	SHA512_CTX c;
-	static unsigned char m[SHA512_DIGEST_LENGTH];
+	static unsigned char m[SHA512_DIGEST_LENGTH]; /* ARRAY OK UNUSED 2009-05-25 yngve */
 
 	if (md == NULL) md=m;
 	SHA512_Init(&c);
@@ -303,6 +307,7 @@
 	OPENSSL_cleanse(&c,sizeof(c));
 	return(md);
 	}
+#endif
 
 #ifndef SHA512_ASM
 static const SHA_LONG64 K512[80] = {
@@ -392,6 +397,8 @@
 #  endif
 #  if defined(_M_IX86) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #   if defined(I386_ONLY)
+#	pragma warning(push)
+#   pragma warning(disable: 4035)
     static SHA_LONG64 __fastcall __pull64be(const void *x)
     {	_asm	mov	edx, [ecx + 0]
 	_asm	mov	eax, [ecx + 4]
@@ -402,13 +409,17 @@
 	_asm	xchg	dh,dl
 	_asm	xchg	ah,al
     }
+#	pragma warning(pop)
 #   else
+#	pragma warning(push)
+#   pragma warning(disable: 4035)
     static SHA_LONG64 __fastcall __pull64be(const void *x)
     {	_asm	mov	edx, [ecx + 0]
 	_asm	mov	eax, [ecx + 4]
 	_asm	bswap	edx
 	_asm	bswap	eax
     }
+#	pragma warning(pop)
 #   endif
 #   define PULL64(x) __pull64be(&(x))
 #   if _MSC_VER<=1200
@@ -443,7 +454,7 @@
  */
 static void sha512_block_data_order (SHA512_CTX *ctx, const void *in, size_t num)
 	{
-	const SHA_LONG64 *W=in;
+	const SHA_LONG64 *W=(const SHA_LONG64 *)in;
 	SHA_LONG64	A,E,T;
 	SHA_LONG64	X[9+80],*F;
 	int i;
@@ -498,7 +509,7 @@
 
 static void sha512_block_data_order (SHA512_CTX *ctx, const void *in, size_t num)
 	{
-	const SHA_LONG64 *W=in;
+	const SHA_LONG64 *W= (const SHA_LONG64 *) in;
 	SHA_LONG64	a,b,c,d,e,f,g,h,s0,s1,T1,T2;
 	SHA_LONG64	X[16];
 	int i;
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha512t.c openssl-1.0.0q/crypto/sha/sha512t.c
--- openssl-1.0.0q.orig/crypto/sha/sha512t.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha512t.c	2017-04-25 16:23:40.671621669 +0200
@@ -81,7 +81,7 @@
 #ifdef OPENSSL_IA32_SSE2
     /* Alternative to this is to call OpenSSL_add_all_algorithms...
      * The below code is retained exclusively for debugging purposes. */
-    { char      *env;
+    { const char      *env;
 
 	if ((env=getenv("OPENSSL_ia32cap")))
 	    OPENSSL_ia32cap = strtoul (env,NULL,0);
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha_locl.h openssl-1.0.0q/crypto/sha/sha_locl.h
--- openssl-1.0.0q.orig/crypto/sha/sha_locl.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha_locl.h	2017-04-25 16:23:40.672620958 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/opensslconf.h>
 #include <openssl/sha.h>
@@ -114,7 +116,7 @@
 # error "Either SHA_0 or SHA_1 must be defined."
 #endif
 
-#include "md32_common.h"
+#include <openssl/md32_common.h>
 
 #define INIT_DATA_h0 0x67452301UL
 #define INIT_DATA_h1 0xefcdab89UL
@@ -207,7 +209,7 @@
 #if !defined(SHA_1) || !defined(SHA1_ASM)
 static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num)
 	{
-	const unsigned char *data=p;
+	const unsigned char *data=static_cast<const unsigned char*>(p);
 	register unsigned MD32_REG_T A,B,C,D,E,T,l;
 #ifndef MD32_XARRAY
 	unsigned MD32_REG_T	XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
@@ -392,7 +394,7 @@
 #if !defined(SHA_1) || !defined(SHA1_ASM)
 static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num)
 	{
-	const unsigned char *data=p;
+	const unsigned char *data= (const unsigned char *) p;
 	register unsigned MD32_REG_T A,B,C,D,E,T,l;
 	int i;
 	SHA_LONG	X[16];
diff -Naur openssl-1.0.0q.orig/crypto/sha/sha_one.c openssl-1.0.0q/crypto/sha/sha_one.c
--- openssl-1.0.0q.orig/crypto/sha/sha_one.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/sha_one.c	2017-04-25 16:23:40.673621644 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/sha.h>
 #include <openssl/crypto.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/sha/shatest.c openssl-1.0.0q/crypto/sha/shatest.c
--- openssl-1.0.0q.orig/crypto/sha/shatest.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/sha/shatest.c	2017-04-25 16:23:40.674621212 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "../e_os.h"
 
@@ -113,8 +115,8 @@
 	unsigned char md[SHA_DIGEST_LENGTH];
 
 #ifdef CHARSET_EBCDIC
-	ebcdic2ascii(test[0], test[0], strlen(test[0]));
-	ebcdic2ascii(test[1], test[1], strlen(test[1]));
+	ebcdic2ascii(test[0], test[0], op_strlen(test[0]));
+	ebcdic2ascii(test[1], test[1], op_strlen(test[1]));
 #endif
 
 	EVP_MD_CTX_init(&c);
@@ -138,7 +140,7 @@
 		P++;
 		}
 
-	memset(buf,'a',1000);
+	op_memset(buf,'a',1000);
 #ifdef CHARSET_EBCDIC
 	ebcdic2ascii(buf, buf, 1000);
 #endif /*CHARSET_EBCDIC*/
@@ -149,7 +151,7 @@
 	p=pt(md);
 
 	r=bigret;
-	if (strcmp(p,r) != 0)
+	if (op_strcmp(p,r) != 0)
 		{
 		printf("error calculating SHA on '%s'\n",p);
 		printf("got %s instead of %s\n",p,r);
@@ -172,7 +174,7 @@
 	static char buf[80];
 
 	for (i=0; i<SHA_DIGEST_LENGTH; i++)
-		sprintf(&(buf[i*2]),"%02x",md[i]);
+		op_sprintf(&(buf[i*2]),"%02x",md[i]);
 	return(buf);
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/stack/.gitignore openssl-1.0.0q/crypto/stack/.gitignore
--- openssl-1.0.0q.orig/crypto/stack/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/stack/.gitignore	2017-04-25 16:23:40.675621340 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/stack/opera_stack.cpp openssl-1.0.0q/crypto/stack/opera_stack.cpp
--- openssl-1.0.0q.orig/crypto/stack/opera_stack.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/stack/opera_stack.cpp	2017-04-25 16:23:40.675621340 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/stack/stack.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/stack/stack.c openssl-1.0.0q/crypto/stack/stack.c
--- openssl-1.0.0q.orig/crypto/stack/stack.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/stack/stack.c	2017-04-25 16:23:40.676620908 +0200
@@ -65,17 +65,23 @@
  *
  * 1.0 eay - First version 29/07/92
  */
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/stack.h>
 #include <openssl/objects.h>
 
 #undef MIN_NODES
 #define MIN_NODES	4
 
-const char STACK_version[]="Stack" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char STACK_version[]="Stack" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-27 haavardm */
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 int (*sk_set_cmp_func(_STACK *sk, int (*c)(const void *, const void *)))
 		(const void *, const void *)
@@ -101,7 +107,7 @@
 	ret->data=s;
 
 	ret->num=sk->num;
-	memcpy(ret->data,sk->data,sizeof(char *)*sk->num);
+	op_memcpy(ret->data,sk->data,sizeof(char *)*sk->num);
 	ret->sorted=sk->sorted;
 	ret->num_alloc=sk->num_alloc;
 	ret->comp=sk->comp;
@@ -122,9 +128,9 @@
 	_STACK *ret;
 	int i;
 
-	if ((ret=OPENSSL_malloc(sizeof(_STACK))) == NULL)
+	if ((ret=(_STACK *)OPENSSL_malloc(sizeof(_STACK))) == NULL)
 		goto err;
-	if ((ret->data=OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)
+	if ((ret->data=(char **)OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)
 		goto err;
 	for (i=0; i<MIN_NODES; i++)
 		ret->data[i]=NULL;
@@ -146,7 +152,7 @@
 	if(st == NULL) return 0;
 	if (st->num_alloc <= st->num+1)
 		{
-		s=OPENSSL_realloc((char *)st->data,
+		s=(char **)OPENSSL_realloc((char *)st->data,
 			(unsigned int)sizeof(char *)*st->num_alloc*2);
 		if (s == NULL)
 			return(0);
@@ -154,7 +160,7 @@
 		st->num_alloc*=2;
 		}
 	if ((loc >= (int)st->num) || (loc < 0))
-		st->data[st->num]=data;
+		st->data[st->num]=(char *)data;
 	else
 		{
 		int i;
@@ -170,7 +176,7 @@
 			&(st->data[loc]),
 			sizeof(char *)*(st->num-loc));
 #endif
-		st->data[loc]=data;
+		st->data[loc]=(char *)data;
 		}
 	st->num++;
 	st->sorted=0;
@@ -201,7 +207,7 @@
 		for (i=loc; i<j; i++)
 			st->data[i]=st->data[i+1];
 		/* In theory memcpy is not safe for this
-		 * memcpy( &(st->data[loc]),
+		 * op_memcpy( &(st->data[loc]),
 		 *	&(st->data[loc+1]),
 		 *	sizeof(char *)*(st->num-loc-1));
 		 */
@@ -212,7 +218,7 @@
 
 static int internal_find(_STACK *st, void *data, int ret_val_options)
 	{
-	const void * const *r;
+	const void *r;
 	int i;
 
 	if(st == NULL) return -1;
@@ -236,16 +242,20 @@
 	{
 	return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
 	}
+
+#ifndef OPERA_SMALL_VERSION
 int sk_find_ex(_STACK *st, void *data)
 	{
 	return internal_find(st, data, OBJ_BSEARCH_VALUE_ON_NOMATCH);
 	}
+#endif
 
 int sk_push(_STACK *st, void *data)
 	{
 	return(sk_insert(st,data,st->num));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int sk_unshift(_STACK *st, void *data)
 	{
 	return(sk_insert(st,data,0));
@@ -257,6 +267,7 @@
 	if (st->num <= 0) return(NULL);
 	return(sk_delete(st,0));
 	}
+#endif
 
 void *sk_pop(_STACK *st)
 	{
@@ -269,7 +280,7 @@
 	{
 	if (st == NULL) return;
 	if (st->num <= 0) return;
-	memset((char *)st->data,0,sizeof(st->data)*st->num);
+	op_memset((char *)st->data,0,sizeof(st->data)*st->num);
 	st->num=0;
 	}
 
@@ -306,7 +317,7 @@
 void *sk_set(_STACK *st, int i, void *value)
 {
 	if(!st || (i < 0) || (i >= st->num)) return NULL;
-	return (st->data[i] = value);
+	return (st->data[i] = (char*)value);
 }
 
 void sk_sort(_STACK *st)
@@ -321,7 +332,7 @@
 		 * type** with type**, so we leave the casting until absolutely
 		 * necessary (ie. "now"). */
 		comp_func=(int (*)(const void *,const void *))(st->comp);
-		qsort(st->data,st->num,sizeof(char *), comp_func);
+		op_qsort(st->data,st->num,sizeof(char *), comp_func);
 		st->sorted=1;
 		}
 	}
diff -Naur openssl-1.0.0q.orig/crypto/store/.gitignore openssl-1.0.0q/crypto/store/.gitignore
--- openssl-1.0.0q.orig/crypto/store/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/store/.gitignore	2017-04-25 16:23:40.676620908 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/store/store.h openssl-1.0.0q/crypto/store/store.h
--- openssl-1.0.0q.orig/crypto/store/store.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/store/store.h	2017-04-25 16:23:40.677620477 +0200
@@ -205,7 +205,7 @@
 	} STORE_CERTIFICATE_STATUS;
 
 /* Engine store functions will return a structure that contains all the necessary
- * information, including revokation status for certificates.  This is really not
+ * information, including revocation status for certificates.  This is really not
  * needed for application authors, as the ENGINE framework functions will extract
  * the OpenSSL-specific information when at all possible.  However, for engine
  * authors, it's crucial to know this structure.  */
diff -Naur openssl-1.0.0q.orig/crypto/threads/.gitignore openssl-1.0.0q/crypto/threads/.gitignore
--- openssl-1.0.0q.orig/crypto/threads/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/threads/.gitignore	2017-04-25 16:23:40.678621162 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/threads/mttest.c openssl-1.0.0q/crypto/threads/mttest.c
--- openssl-1.0.0q.orig/crypto/threads/mttest.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/threads/mttest.c	2017-04-25 16:23:40.679620451 +0200
@@ -56,15 +56,22 @@
  * [including the GNU Public Licence.]
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #ifdef LINUX
 #include <typedefs.h>
 #endif
 #ifdef OPENSSL_SYS_WIN32
+#ifndef OPERA_SMALL_VERSION
 #include <windows.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef SOLARIS
 #include <synch.h>
@@ -134,7 +141,7 @@
 BIO *bio_err=NULL;
 BIO *bio_stdout=NULL;
 
-static char *cipher=NULL;
+static const char *cipher=NULL;
 int verbose=0;
 #ifdef FIONBIO
 static int s_nbio=0;
@@ -207,50 +214,50 @@
 
 	while (argc >= 1)
 		{
-		if	(strcmp(*argv,"-server_auth") == 0)
+		if	(op_strcmp(*argv,"-server_auth") == 0)
 			server_auth=1;
-		else if	(strcmp(*argv,"-client_auth") == 0)
+		else if	(op_strcmp(*argv,"-client_auth") == 0)
 			client_auth=1;
-		else if	(strcmp(*argv,"-reconnect") == 0)
+		else if	(op_strcmp(*argv,"-reconnect") == 0)
 			reconnect=1;
-		else if	(strcmp(*argv,"-stats") == 0)
+		else if	(op_strcmp(*argv,"-stats") == 0)
 			cache_stats=1;
-		else if	(strcmp(*argv,"-ssl3") == 0)
+		else if	(op_strcmp(*argv,"-ssl3") == 0)
 			ssl_method=SSLv3_method();
-		else if	(strcmp(*argv,"-ssl2") == 0)
+		else if	(op_strcmp(*argv,"-ssl2") == 0)
 			ssl_method=SSLv2_method();
-		else if	(strcmp(*argv,"-CApath") == 0)
+		else if	(op_strcmp(*argv,"-CApath") == 0)
 			{
 			if (--argc < 1) goto bad;
 			CApath= *(++argv);
 			}
-		else if	(strcmp(*argv,"-CAfile") == 0)
+		else if	(op_strcmp(*argv,"-CAfile") == 0)
 			{
 			if (--argc < 1) goto bad;
 			CAfile= *(++argv);
 			}
-		else if	(strcmp(*argv,"-cert") == 0)
+		else if	(op_strcmp(*argv,"-cert") == 0)
 			{
 			if (--argc < 1) goto bad;
 			scert= *(++argv);
 			}
-		else if	(strcmp(*argv,"-ccert") == 0)
+		else if	(op_strcmp(*argv,"-ccert") == 0)
 			{
 			if (--argc < 1) goto bad;
 			ccert= *(++argv);
 			}
-		else if	(strcmp(*argv,"-threads") == 0)
+		else if	(op_strcmp(*argv,"-threads") == 0)
 			{
 			if (--argc < 1) goto bad;
-			thread_number= atoi(*(++argv));
+			thread_number= op_atoi(*(++argv));
 			if (thread_number == 0) thread_number=1;
 			if (thread_number > MAX_THREAD_NUMBER)
 				thread_number=MAX_THREAD_NUMBER;
 			}
-		else if	(strcmp(*argv,"-loops") == 0)
+		else if	(op_strcmp(*argv,"-loops") == 0)
 			{
 			if (--argc < 1) goto bad;
-			number_of_loops= atoi(*(++argv));
+			number_of_loops= op_atoi(*(++argv));
 			if (number_of_loops == 0) number_of_loops=1;
 			}
 		else
@@ -669,7 +676,7 @@
 #endif
 err:
 	/* We have to set the BIO's to NULL otherwise they will be
-	 * free()ed twice.  Once when th s_ssl is SSL_free()ed and
+	 * op_free()ed twice.  Once when th s_ssl is SSL_free()ed and
 	 * again when c_ssl is SSL_free()ed.
 	 * This is a hack required because s_ssl and c_ssl are sharing the same
 	 * BIO structure and SSL_set_bio() and SSL_free() automatically
@@ -937,7 +944,7 @@
 	int i;
 	char filename[20];
 
-	strcpy(filename,"/tmp/mttest.XXXXXX");
+	op_strcpy(filename,"/tmp/mttest.XXXXXX");
 	mktemp(filename);
 
 	usconfig(CONF_STHREADIOOFF);
@@ -966,7 +973,7 @@
 		{
 		char buf[10];
 
-		sprintf(buf,"%2d:",i);
+		op_sprintf(buf,"%2d:",i);
 		usdumpsema(lock_cs[i],stdout,buf);
 		usfreesema(lock_cs[i],arena);
 		}
diff -Naur openssl-1.0.0q.orig/crypto/threads/th-lock.c openssl-1.0.0q/crypto/threads/th-lock.c
--- openssl-1.0.0q.orig/crypto/threads/th-lock.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/threads/th-lock.c	2017-04-25 16:23:40.680620858 +0200
@@ -56,15 +56,22 @@
  * [including the GNU Public Licence.]
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 #ifdef LINUX
 #include <typedefs.h>
 #endif
 #ifdef OPENSSL_SYS_WIN32
+#ifndef OPERA_SMALL_VERSION
 #include <windows.h>
+#endif /* !OPERA_SMALL_VERSION */
 #endif
 #ifdef SOLARIS
 #include <synch.h>
@@ -257,7 +264,7 @@
 	int i;
 	char filename[20];
 
-	strcpy(filename,"/tmp/mttest.XXXXXX");
+	op_strcpy(filename,"/tmp/mttest.XXXXXX");
 	mktemp(filename);
 
 	usconfig(CONF_STHREADIOOFF);
@@ -286,7 +293,7 @@
 		{
 		char buf[10];
 
-		sprintf(buf,"%2d:",i);
+		op_sprintf(buf,"%2d:",i);
 		usdumpsema(lock_cs[i],stdout,buf);
 		usfreesema(lock_cs[i],arena);
 		}
diff -Naur openssl-1.0.0q.orig/crypto/txt_db/.gitignore openssl-1.0.0q/crypto/txt_db/.gitignore
--- openssl-1.0.0q.orig/crypto/txt_db/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/txt_db/.gitignore	2017-04-25 16:23:40.681620706 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/txt_db/txt_db.c openssl-1.0.0q/crypto/txt_db/txt_db.c
--- openssl-1.0.0q.orig/crypto/txt_db/txt_db.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/txt_db/txt_db.c	2017-04-25 16:23:40.681620706 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/txt_db.h>
@@ -66,7 +68,9 @@
 #undef BUFSIZE
 #define BUFSIZE	512
 
-const char TXT_DB_version[]="TXT_DB" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char TXT_DB_version[]="TXT_DB" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-27 haavardm */
+#endif
 
 TXT_DB *TXT_DB_read(BIO *in, int num)
 	{
@@ -116,7 +120,7 @@
 		ln++;
 		if (buf->data[offset] == '\0') break;
 		if ((offset == 0) && (buf->data[0] == '#')) continue;
-		i=strlen(&(buf->data[offset]));
+		i=op_strlen(&(buf->data[offset]));
 		offset+=i;
 		if (buf->data[offset-1] != '\n')
 			continue;
@@ -271,7 +275,7 @@
 		for (j=0; j<nn; j++)
 			{
 			if (pp[j] != NULL)
-				l+=strlen(pp[j]);
+				l+=op_strlen(pp[j]);
 			}
 		if (!BUF_MEM_grow_clean(buf,(int)(l*2+nn))) goto err;
 
diff -Naur openssl-1.0.0q.orig/crypto/ui/.gitignore openssl-1.0.0q/crypto/ui/.gitignore
--- openssl-1.0.0q.orig/crypto/ui/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/ui/.gitignore	2017-04-25 16:23:40.682621950 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/ui/ui_compat.c openssl-1.0.0q/crypto/ui/ui_compat.c
--- openssl-1.0.0q.orig/crypto/ui/ui_compat.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ui/ui_compat.c	2017-04-25 16:23:40.683621239 +0200
@@ -53,7 +53,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/ui_compat.h>
 
 int _ossl_old_des_read_pw_string(char *buf,int length,const char *prompt,int verify)
diff -Naur openssl-1.0.0q.orig/crypto/ui/ui_err.c openssl-1.0.0q/crypto/ui/ui_err.c
--- openssl-1.0.0q.orig/crypto/ui/ui_err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ui/ui_err.c	2017-04-25 16:23:40.683621239 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/ui.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/ui/ui_lib.c openssl-1.0.0q/crypto/ui/ui_lib.c
--- openssl-1.0.0q.orig/crypto/ui/ui_lib.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/ui/ui_lib.c	2017-04-25 16:23:40.684621925 +0200
@@ -56,8 +56,13 @@
  *
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/e_os2.h>
 #include <openssl/buffer.h>
 #include <openssl/ui.h>
@@ -209,7 +214,7 @@
 		{
 		for(p = ok_chars; *p; p++)
 			{
-			if (strchr(cancel_chars, *p))
+			if (op_strchr(cancel_chars, *p))
 				{
 				UIerr(UI_F_GENERAL_ALLOCATE_BOOLEAN,
 					UI_R_COMMON_OK_AND_CANCEL_CHARACTERS);
@@ -425,9 +430,9 @@
 
 		if (object_desc == NULL)
 			return NULL;
-		len = sizeof(prompt1) - 1 + strlen(object_desc);
+		len = sizeof(prompt1) - 1 + op_strlen(object_desc);
 		if (object_name)
-			len += sizeof(prompt2) - 1 + strlen(object_name);
+			len += sizeof(prompt2) - 1 + op_strlen(object_name);
 		len += sizeof(prompt3) - 1;
 
 		prompt = (char *)OPENSSL_malloc(len + 1);
@@ -474,7 +479,7 @@
 	{
 	UI_STRING uis;
 
-	memset(&uis, 0, sizeof(uis));
+	op_memset(&uis, 0, sizeof(uis));
 	uis.type = UIT_ERROR;
 	uis.out_string = str;
 
@@ -844,7 +849,7 @@
 
 int UI_set_result(UI *ui, UI_STRING *uis, const char *result)
 	{
-	int l = strlen(result);
+	int l = op_strlen(result);
 
 	ui->flags &= ~UI_FLAG_REDOABLE;
 
@@ -903,13 +908,13 @@
 		uis->result_buf[0] = '\0';
 		for(p = result; *p; p++)
 			{
-			if (strchr(uis->_.boolean_data.ok_chars, *p))
+			if (op_strchr(uis->_.boolean_data.ok_chars, *p))
 				{
 				uis->result_buf[0] =
 					uis->_.boolean_data.ok_chars[0];
 				break;
 				}
-			if (strchr(uis->_.boolean_data.cancel_chars, *p))
+			if (op_strchr(uis->_.boolean_data.cancel_chars, *p))
 				{
 				uis->result_buf[0] =
 					uis->_.boolean_data.cancel_chars[0];
diff -Naur openssl-1.0.0q.orig/crypto/ui/ui_openssl.c openssl-1.0.0q/crypto/ui/ui_openssl.c
--- openssl-1.0.0q.orig/crypto/ui/ui_openssl.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/ui/ui_openssl.c	2017-04-25 16:23:40.685620376 +0200
@@ -114,6 +114,9 @@
  * [including the GNU Public Licence.]
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
 
 #include <openssl/e_os2.h>
 
@@ -157,7 +160,7 @@
 
 /* 06-Apr-92 Luke Brennan    Support for VMS */
 #include "ui_locl.h"
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 
 #ifdef OPENSSL_SYS_VMS		/* prototypes for sys$whatever */
 # include <starlet.h>
@@ -167,7 +170,9 @@
 #endif
 
 #ifdef WIN_CONSOLE_BUG
+#ifndef OPERA_SMALL_VERSION
 # include <windows.h>
+#endif /* !OPERA_SMALL_VERSION */
 #ifndef OPENSSL_SYS_WINCE
 # include <wincon.h>
 #endif
@@ -375,7 +380,7 @@
 		if ((ok = read_string_inner(ui, uis,
 			UI_get_input_flags(uis) & UI_INPUT_FLAG_ECHO, 1)) <= 0)
 			return ok;
-		if (strcmp(UI_get0_result_string(uis),
+		if (op_strcmp(UI_get0_result_string(uis),
 			UI_get0_test_string(uis)) != 0)
 			{
 			fprintf(tty_out,"Verify failure\n");
@@ -525,7 +530,7 @@
 static int noecho_console(UI *ui)
 	{
 #ifdef TTY_FLAGS
-	memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig));
+	op_memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig));
 	tty_new.TTY_FLAGS &= ~ECHO;
 #endif
 
@@ -547,7 +552,7 @@
 static int echo_console(UI *ui)
 	{
 #if defined(TTY_set) && !defined(OPENSSL_SYS_VMS)
-	memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig));
+	op_memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig));
 	tty_new.TTY_FLAGS |= ECHO;
 #endif
 
@@ -589,7 +594,7 @@
 #ifdef SIGACTION
 	struct sigaction sa;
 
-	memset(&sa,0,sizeof sa);
+	op_memset(&sa,0,sizeof sa);
 	sa.sa_handler=recsig;
 #endif
 
@@ -707,6 +712,6 @@
 			FlushConsoleInputBuffer(inh);
 		}
 #endif
-	return(strlen(buf));
+	return(op_strlen(buf));
 	}
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/ui/ui_util.c openssl-1.0.0q/crypto/ui/ui_util.c
--- openssl-1.0.0q.orig/crypto/ui/ui_util.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/ui/ui_util.c	2017-04-25 16:23:40.686621900 +0200
@@ -53,7 +53,12 @@
  *
  */
 
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+#ifndef OPERA_SMALL_VERSION
 #include <string.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "ui_locl.h"
 
 int UI_UTIL_read_pw_string(char *buf,int length,const char *prompt,int verify)
diff -Naur openssl-1.0.0q.orig/crypto/uid.c openssl-1.0.0q/crypto/uid.c
--- openssl-1.0.0q.orig/crypto/uid.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/uid.c	2017-04-25 16:23:40.686621900 +0200
@@ -53,9 +53,11 @@
  *
  */
 
-#include <openssl/crypto.h>
+#include <openssl/cryptlib.h>
 #include <openssl/opensslconf.h>
 
+#include <openssl/e_os.h>
+
 #if defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD__ > 2)
 
 #include OPENSSL_UNISTD
@@ -72,10 +74,12 @@
 	return 0;
 	}
 
-#else
+#elif !defined(GROUP_USER_ID_IS_MEANINGLESS)
 
 #include OPENSSL_UNISTD
+#ifndef OPERA_SMALL_VERSION
 #include <sys/types.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 int OPENSSL_issetugid(void)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/x509/.gitignore openssl-1.0.0q/crypto/x509/.gitignore
--- openssl-1.0.0q.orig/crypto/x509/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/.gitignore	2017-04-25 16:23:40.687621748 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/x509/by_dir.c openssl-1.0.0q/crypto/x509/by_dir.c
--- openssl-1.0.0q.orig/crypto/x509/by_dir.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/by_dir.c	2017-04-25 16:23:40.688621595 +0200
@@ -56,19 +56,20 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
 #include <errno.h>
 
-#include "cryptlib.h"
-
 #ifndef NO_SYS_TYPES_H
 # include <sys/types.h>
 #endif
 #ifndef OPENSSL_NO_POSIX_IO
 # include <sys/stat.h>
 #endif
+#endif /* !OPERA_SMALL_VERSION */
 
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 #include <openssl/x509.h>
 
@@ -465,7 +466,7 @@
 			{
 			ok=1;
 			ret->type=tmp->type;
-			memcpy(&ret->data,&tmp->data,sizeof(ret->data));
+			op_memcpy(&ret->data,&tmp->data,sizeof(ret->data));
 			/* If we were going to up the reference count,
 			 * we would need to do it on a perl 'type'
 			 * basis */
diff -Naur openssl-1.0.0q.orig/crypto/x509/by_file.c openssl-1.0.0q/crypto/x509/by_file.c
--- openssl-1.0.0q.orig/crypto/x509/by_file.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/by_file.c	2017-04-25 16:23:40.689621443 +0200
@@ -56,11 +56,13 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 #include <openssl/buffer.h>
 #include <openssl/x509.h>
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509_att.cpp openssl-1.0.0q/crypto/x509/opera_x509_att.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509_att.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509_att.cpp	2017-04-25 16:23:40.689621443 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509_att.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509_cmp.cpp openssl-1.0.0q/crypto/x509/opera_x509_cmp.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509_cmp.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509_cmp.cpp	2017-04-25 16:23:40.690621570 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509_cmp.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509_ext.cpp openssl-1.0.0q/crypto/x509/opera_x509_ext.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509_ext.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509_ext.cpp	2017-04-25 16:23:40.690621570 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509_ext.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509_lu.cpp openssl-1.0.0q/crypto/x509/opera_x509_lu.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509_lu.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509_lu.cpp	2017-04-25 16:23:40.691621418 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509_lu.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509_obj.cpp openssl-1.0.0q/crypto/x509/opera_x509_obj.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509_obj.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509_obj.cpp	2017-04-25 16:23:40.691621418 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509_obj.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509_set.cpp openssl-1.0.0q/crypto/x509/opera_x509_set.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509_set.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509_set.cpp	2017-04-25 16:23:40.692621266 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "x509_set.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509_trs.cpp openssl-1.0.0q/crypto/x509/opera_x509_trs.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509_trs.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509_trs.cpp	2017-04-25 16:23:40.692621266 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509_trs.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509_v3.cpp openssl-1.0.0q/crypto/x509/opera_x509_v3.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509_v3.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509_v3.cpp	2017-04-25 16:23:40.693621113 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509_v3.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509_vfy.cpp openssl-1.0.0q/crypto/x509/opera_x509_vfy.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509_vfy.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509_vfy.cpp	2017-04-25 16:23:40.693621113 +0200
@@ -0,0 +1,21 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509_vfy.c"
+}
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509_vpm.cpp openssl-1.0.0q/crypto/x509/opera_x509_vpm.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509_vpm.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509_vpm.cpp	2017-04-25 16:23:40.694620961 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509_vpm.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509name.cpp openssl-1.0.0q/crypto/x509/opera_x509name.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509name.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509name.cpp	2017-04-25 16:23:40.694620961 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509name.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509spki.cpp openssl-1.0.0q/crypto/x509/opera_x509spki.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509spki.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509spki.cpp	2017-04-25 16:23:40.695621088 +0200
@@ -0,0 +1,15 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2005 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#include "core/pch.h"
+
+#ifdef _SSL_USE_OPENSSL_
+extern "C" {
+#include "x509spki.c"
+}
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x509type.cpp openssl-1.0.0q/crypto/x509/opera_x509type.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x509type.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x509type.cpp	2017-04-25 16:23:40.695621088 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x509type.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/crypto/x509/opera_x_all.cpp openssl-1.0.0q/crypto/x509/opera_x_all.cpp
--- openssl-1.0.0q.orig/crypto/x509/opera_x_all.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/opera_x_all.cpp	2017-04-25 16:23:40.696621215 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509/x_all.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509.h openssl-1.0.0q/crypto/x509/x509.h
--- openssl-1.0.0q.orig/crypto/x509/x509.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509.h	2017-04-25 16:23:40.697621342 +0200
@@ -303,7 +303,7 @@
 	struct ASIdentifiers_st *rfc3779_asid;
 #endif
 #ifndef OPENSSL_NO_SHA
-	unsigned char sha1_hash[SHA_DIGEST_LENGTH];
+	unsigned char sha1_hash[SHA_DIGEST_LENGTH]; /* ARRAY OK 2009-10-02 alexeik */
 #endif
 	X509_CERT_AUX *aux;
 	} /* X509 */;
@@ -316,8 +316,8 @@
 typedef struct x509_trust_st {
 	int trust;
 	int flags;
-	int (*check_trust)(struct x509_trust_st *, X509 *, int);
-	char *name;
+	int (*check_trust)(const struct x509_trust_st *, X509 *, int);
+	const char *name;
 	int arg1;
 	void *arg2;
 } X509_TRUST;
@@ -551,7 +551,7 @@
 /* Unused (and iv length is wrong)
 typedef struct CBCParameter_st
 	{
-	unsigned char iv[8];
+	unsigned char iv[8]; // ARRAY OK 2007-11-07 yngve
 	} CBC_PARAM;
 */
 
@@ -1189,7 +1189,7 @@
 
 int X509_check_trust(X509 *x, int id, int flags);
 int X509_TRUST_get_count(void);
-X509_TRUST * X509_TRUST_get0(int idx);
+const X509_TRUST * X509_TRUST_get0(int idx);
 int X509_TRUST_get_by_id(int id);
 int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
 					char *name, int arg1, void *arg2);
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_att.c openssl-1.0.0q/crypto/x509/x509_att.c
--- openssl-1.0.0q.orig/crypto/x509/x509_att.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_att.c	2017-04-25 16:23:40.698621749 +0200
@@ -56,19 +56,23 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/stack.h>
-#include "cryptlib.h"
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
+#ifndef OPERA_SMALL_VERSION
 int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x)
 {
 	return sk_X509_ATTRIBUTE_num(x);
 }
+#endif
 
 int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
 			  int lastpos)
@@ -108,6 +112,7 @@
 		return sk_X509_ATTRIBUTE_value(x,loc);
 }
 
+#ifndef OPERA_SMALL_VERSION
 X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc)
 {
 	X509_ATTRIBUTE *ret;
@@ -117,6 +122,7 @@
 	ret=sk_X509_ATTRIBUTE_delete(x,loc);
 	return(ret);
 }
+#endif /* OPERA_SMALL_VERSION */
 
 STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
 					 X509_ATTRIBUTE *attr)
@@ -285,11 +291,11 @@
 int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len)
 {
 	ASN1_TYPE *ttmp;
-	ASN1_STRING *stmp = NULL;
+	ASN1_STRING *stmp = NULL, *stmp_alloc=NULL;
 	int atype = 0;
 	if (!attr) return 0;
 	if(attrtype & MBSTRING_FLAG) {
-		stmp = ASN1_STRING_set_by_NID(NULL, data, len, attrtype,
+		stmp = ASN1_STRING_set_by_NID(NULL, (const unsigned char *) data, len, attrtype,
 						OBJ_obj2nid(attr->object));
 		if(!stmp) {
 			X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_ASN1_LIB);
@@ -297,7 +303,7 @@
 		}
 		atype = stmp->type;
 	} else if (len != -1){
-		if(!(stmp = ASN1_STRING_type_new(attrtype))) goto err;
+		if(!(stmp_alloc=stmp = ASN1_STRING_type_new(attrtype))) goto err;
 		if(!ASN1_STRING_set(stmp, data, len)) goto err;
 		atype = attrtype;
 	}
@@ -320,6 +326,8 @@
 	if(!sk_ASN1_TYPE_push(attr->value.set, ttmp)) goto err;
 	return 1;
 	err:
+	if(stmp_alloc)
+		ASN1_STRING_free(stmp_alloc);
 	X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE);
 	return 0;
 }
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_cmp.c openssl-1.0.0q/crypto/x509/x509_cmp.c
--- openssl-1.0.0q.orig/crypto/x509/x509_cmp.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_cmp.c	2017-04-25 16:23:40.700621724 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
@@ -81,12 +83,12 @@
 	{
 	unsigned long ret=0;
 	EVP_MD_CTX ctx;
-	unsigned char md[16];
+	unsigned char md[16]; /* ARRAY OK 2007-11-07 yngve UNUSED */
 	char *f;
 
 	EVP_MD_CTX_init(&ctx);
 	f=X509_NAME_oneline(a->cert_info->issuer,NULL,0);
-	ret=strlen(f);
+	ret=op_strlen(f);
 	EVP_DigestInit_ex(&ctx, EVP_md5(), NULL);
 	EVP_DigestUpdate(&ctx,(unsigned char *)f,ret);
 	OPENSSL_free(f);
@@ -111,10 +113,12 @@
 	return(X509_NAME_cmp(a->cert_info->subject,b->cert_info->subject));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b)
 	{
 	return(X509_NAME_cmp(a->crl->issuer,b->crl->issuer));
 	}
+#endif
 
 #ifndef OPENSSL_NO_SHA
 int X509_CRL_match(const X509_CRL *a, const X509_CRL *b)
@@ -128,10 +132,12 @@
 	return(a->cert_info->issuer);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 unsigned long X509_issuer_name_hash(X509 *x)
 	{
 	return(X509_NAME_hash(x->cert_info->issuer));
 	}
+#endif
 
 #ifndef OPENSSL_NO_MD5
 unsigned long X509_issuer_name_hash_old(X509 *x)
@@ -150,10 +156,12 @@
 	return(a->cert_info->serialNumber);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 unsigned long X509_subject_name_hash(X509 *x)
 	{
 	return(X509_NAME_hash(x->cert_info->subject));
 	}
+#endif
 
 #ifndef OPENSSL_NO_MD5
 unsigned long X509_subject_name_hash_old(X509 *x)
@@ -178,7 +186,7 @@
 	X509_check_purpose((X509 *)a, -1, 0);
 	X509_check_purpose((X509 *)b, -1, 0);
 
-	return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
+	return op_memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
 }
 #endif
 
@@ -298,6 +306,7 @@
 	return x->cert_info->key->public_key;
 	}
 
+#if defined(LIBOPEAY_PKCS12_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 int X509_check_private_key(X509 *x, EVP_PKEY *k)
 	{
 	EVP_PKEY *xk;
@@ -329,3 +338,4 @@
 		return 1;
 	return 0;
 	}
+#endif // defined(LIBOPEAY_PKCS12_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_d2.c openssl-1.0.0q/crypto/x509/x509_d2.c
--- openssl-1.0.0q.orig/crypto/x509/x509_d2.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_d2.c	2017-04-25 16:23:40.701621572 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/crypto.h>
 #include <openssl/x509.h>
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_def.c openssl-1.0.0q/crypto/x509/x509_def.c
--- openssl-1.0.0q.orig/crypto/x509/x509_def.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_def.c	2017-04-25 16:23:40.701621572 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/crypto.h>
 #include <openssl/x509.h>
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_err.c openssl-1.0.0q/crypto/x509/x509_err.c
--- openssl-1.0.0q.orig/crypto/x509/x509_err.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_err.c	2017-04-25 16:23:40.702621140 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/x509.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_ext.c openssl-1.0.0q/crypto/x509/x509_ext.c
--- openssl-1.0.0q.orig/crypto/x509/x509_ext.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_ext.c	2017-04-25 16:23:40.703621826 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/stack.h>
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
@@ -122,6 +124,7 @@
 	return(X509v3_get_ext_by_NID(x->cert_info->extensions,nid,lastpos));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos)
 	{
 	return(X509v3_get_ext_by_OBJ(x->cert_info->extensions,obj,lastpos));
@@ -131,12 +134,14 @@
 	{
 	return(X509v3_get_ext_by_critical(x->cert_info->extensions,crit,lastpos));
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 X509_EXTENSION *X509_get_ext(X509 *x, int loc)
 	{
 	return(X509v3_get_ext(x->cert_info->extensions,loc));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 X509_EXTENSION *X509_delete_ext(X509 *x, int loc)
 	{
 	return(X509v3_delete_ext(x->cert_info->extensions,loc));
@@ -146,12 +151,15 @@
 	{
 	return(X509v3_add_ext(&(x->cert_info->extensions),ex,loc) != NULL);
 	}
+#endif /* OPERA_SMALL_VERSION */
+
 
 void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx)
 {
 	return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx);
 }
 
+#ifndef OPERA_SMALL_VERSION
 int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
 							unsigned long flags)
 {
@@ -194,17 +202,20 @@
 	{
 	return(X509v3_add_ext(&(x->extensions),ex,loc) != NULL);
 	}
+#endif // !OPERA_SMALL_VERSION
 
 void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx)
 {
 	return X509V3_get_d2i(x->extensions, nid, crit, idx);
 }
 
+#ifndef OPERA_SMALL_VERSION
 int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
 							unsigned long flags)
 {
 	return X509V3_add1_i2d(&x->extensions, nid, value, crit, flags);
 }
+#endif // !OPERA_SMALL_VERSION
 
 IMPLEMENT_STACK_OF(X509_EXTENSION)
 IMPLEMENT_ASN1_SET_OF(X509_EXTENSION)
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_lu.c openssl-1.0.0q/crypto/x509/x509_lu.c
--- openssl-1.0.0q.orig/crypto/x509/x509_lu.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_lu.c	2017-04-25 16:23:40.704621394 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
@@ -91,6 +93,7 @@
 	OPENSSL_free(ctx);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int X509_LOOKUP_init(X509_LOOKUP *ctx)
 	{
 	if (ctx->method == NULL) return 0;
@@ -99,6 +102,7 @@
 	else
 		return 1;
 	}
+#endif
 
 int X509_LOOKUP_shutdown(X509_LOOKUP *ctx)
 	{
@@ -109,6 +113,7 @@
 		return 1;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
 	     char **ret)
 	{
@@ -118,6 +123,7 @@
 	else
 		return 1;
 	}
+#endif
 
 int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name,
 	     X509_OBJECT *ret)
@@ -128,6 +134,7 @@
 	return ctx->method->get_by_subject(ctx,type,name,ret);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name,
 	     ASN1_INTEGER *serial, X509_OBJECT *ret)
 	{
@@ -152,6 +159,7 @@
 		return X509_LU_FAIL;
 	return ctx->method->get_by_alias(ctx,type,str,len,ret);
 	}
+#endif
 
   
 static int x509_object_cmp(const X509_OBJECT * const *a, const X509_OBJECT * const *b)
@@ -165,9 +173,11 @@
  	case X509_LU_X509:
  		ret=X509_subject_name_cmp((*a)->data.x509,(*b)->data.x509);
  		break;
+#ifndef OPERA_SMALL_VERSION
  	case X509_LU_CRL:
  		ret=X509_CRL_cmp((*a)->data.crl,(*b)->data.crl);
  		break;
+#endif
 	default:
 		/* abort(); */
 		return 0;
@@ -186,9 +196,13 @@
 	ret->get_cert_methods=sk_X509_LOOKUP_new_null();
 	ret->verify=0;
 	ret->verify_cb=0;
+	ret->param = X509_VERIFY_PARAM_new();
 
-	if ((ret->param = X509_VERIFY_PARAM_new()) == NULL)
+	if (ret->objs == NULL || ret->get_cert_methods == NULL || ret->param == NULL)
+	{
+		X509_STORE_free(ret);
 		return NULL;
+	}
 
 	ret->get_issuer = 0;
 	ret->check_issued = 0;
@@ -202,8 +216,7 @@
 
 	if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE, ret, &ret->ex_data))
 		{
-		sk_X509_OBJECT_free(ret->objs);
-		OPENSSL_free(ret);
+		X509_STORE_free(ret);
 		return NULL;
 		}
 
@@ -217,10 +230,12 @@
 		{
 		X509_free(a->data.x509);
 		}
+#ifndef OPERA_SMALL_VERSION
 	else if (a->type == X509_LU_CRL)
 		{
 		X509_CRL_free(a->data.crl);
 		}
+#endif
 	else
 		{
 		/* abort(); */
@@ -364,6 +379,7 @@
 	return ret;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x)
 	{
 	X509_OBJECT *obj;
@@ -396,6 +412,7 @@
 
 	return ret;
 	}
+#endif
 
 void X509_OBJECT_up_ref_count(X509_OBJECT *a)
 	{
@@ -404,9 +421,11 @@
 	case X509_LU_X509:
 		CRYPTO_add(&a->data.x509->references,1,CRYPTO_LOCK_X509);
 		break;
+#ifndef OPERA_SMALL_VERSION
 	case X509_LU_CRL:
 		CRYPTO_add(&a->data.crl->references,1,CRYPTO_LOCK_X509_CRL);
 		break;
+#endif
 		}
 	}
 
@@ -417,9 +436,11 @@
 	case X509_LU_X509:
 		X509_free(a->data.x509);
 		break;
+#ifndef OPERA_SMALL_VERSION
 	case X509_LU_CRL:
 		X509_CRL_free(a->data.crl);
 		break;
+#endif
 		}
 	}
 
@@ -429,8 +450,10 @@
 	X509_OBJECT stmp;
 	X509 x509_s;
 	X509_CINF cinf_s;
+#ifndef OPERA_SMALL_VERSION
 	X509_CRL crl_s;
 	X509_CRL_INFO crl_info_s;
+#endif
 	int idx;
 
 	stmp.type=type;
@@ -441,11 +464,13 @@
 		x509_s.cert_info= &cinf_s;
 		cinf_s.subject=name;
 		break;
+#ifndef OPERA_SMALL_VERSION
 	case X509_LU_CRL:
 		stmp.data.crl= &crl_s;
 		crl_s.crl= &crl_info_s;
 		crl_info_s.issuer=name;
 		break;
+#endif
 	default:
 		/* abort(); */
 		return -1;
@@ -680,6 +705,7 @@
 	return ret;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags)
 	{
 	return X509_VERIFY_PARAM_set_flags(ctx->param, flags);
@@ -711,6 +737,7 @@
 	{
 	ctx->verify_cb = verify_cb;
 	}
+#endif
 
 IMPLEMENT_STACK_OF(X509_LOOKUP)
 IMPLEMENT_STACK_OF(X509_OBJECT)
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_obj.c openssl-1.0.0q/crypto/x509/x509_obj.c
--- openssl-1.0.0q.orig/crypto/x509/x509_obj.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_obj.c	2017-04-25 16:23:40.705620963 +0200
@@ -56,8 +56,10 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
@@ -72,11 +74,11 @@
 	char *p;
 	unsigned char *q;
 	BUF_MEM *b=NULL;
-	static const char hex[17]="0123456789ABCDEF";
-	int gs_doit[4];
-	char tmp_buf[80];
+	static const char hex[17]="0123456789ABCDEF"; /* ARRAY OK 2011-09-16 alexeik */
+	int gs_doit[4];			/* ARRAY OK 2009-05-25 yngve */
+	char tmp_buf[80];		/* ARRAY OK 2009-05-25 yngve */
 #ifdef CHARSET_EBCDIC
-	char ebcdic_buf[1024];
+	char ebcdic_buf[1024];	/* ARRAY OK UNUSED 2009-05-25 yngve EBCDIC only*/
 #endif
 
 	if (buf == NULL)
@@ -93,7 +95,7 @@
 		buf=b->data;
 		OPENSSL_free(b);
 		}
-	    strncpy(buf,"NO X509_NAME",len);
+	    op_strncpy(buf,"NO X509_NAME",len);
 	    buf[len-1]='\0';
 	    return buf;
 	    }
@@ -109,7 +111,7 @@
 			i2t_ASN1_OBJECT(tmp_buf,sizeof(tmp_buf),ne->object);
 			s=tmp_buf;
 			}
-		l1=strlen(s);
+		l1=op_strlen(s);
 
 		type=ne->value->type;
 		num=ne->value->length;
@@ -171,7 +173,7 @@
 		else
 			p= &(buf[lold]);
 		*(p++)='/';
-		memcpy(p,s,(unsigned int)l1); p+=l1;
+		op_memcpy(p,s,(unsigned int)l1); p+=l1;
 		*(p++)='=';
 
 #ifndef CHARSET_EBCDIC /* q was assigned above already. */
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_r2x.c openssl-1.0.0q/crypto/x509/x509_r2x.c
--- openssl-1.0.0q.orig/crypto/x509/x509_r2x.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_r2x.c	2017-04-25 16:23:40.706620810 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/bn.h>
 #include <openssl/evp.h>
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_req.c openssl-1.0.0q/crypto/x509/x509_req.c
--- openssl-1.0.0q.orig/crypto/x509/x509_req.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_req.c	2017-04-25 16:23:40.707620658 +0200
@@ -56,7 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/bn.h>
 #include <openssl/evp.h>
@@ -67,6 +69,7 @@
 #include <openssl/buffer.h>
 #include <openssl/pem.h>
 
+#ifndef OPERA_SMALL_VERSION
 X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
 	{
 	X509_REQ *ret;
@@ -159,9 +162,14 @@
  * used and there may be more: so the list is configurable.
  */
 
-static int ext_nid_list[] = { NID_ext_req, NID_ms_ext_req, NID_undef};
+static const int ext_nid_list[] = { NID_ext_req, NID_ms_ext_req, NID_undef};
 
+#ifdef _NO_GLOBALS_
+extern int* *g_ext_nids_addr();
+#define ext_nids (*g_ext_nids_addr())
+#else
 static int *ext_nids = ext_nid_list;
+#endif
 
 int X509_REQ_extension_nid(int req_nid)
 {
@@ -314,3 +322,4 @@
 				type, bytes, len)) return 1;
 	return 0;
 }
+#endif /* OPERA_SMALL_VERSION */
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_set.c openssl-1.0.0q/crypto/x509/x509_set.c
--- openssl-1.0.0q.orig/crypto/x509/x509_set.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_set.c	2017-04-25 16:23:40.708620506 +0200
@@ -56,13 +56,16 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
 
+#ifndef OPERA_SMALL_VERSION
 int X509_set_version(X509 *x, long version)
 	{
 	if (x == NULL) return(0);
@@ -145,6 +148,7 @@
 	if ((x == NULL) || (x->cert_info == NULL)) return(0);
 	return(X509_PUBKEY_set(&(x->cert_info->key),pkey));
 	}
+#endif
 
 
 
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_trs.c openssl-1.0.0q/crypto/x509/x509_trs.c
--- openssl-1.0.0q.orig/crypto/x509/x509_trs.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_trs.c	2017-04-25 16:23:40.709620633 +0200
@@ -56,50 +56,81 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 static int tr_cmp(const X509_TRUST * const *a,
 		const X509_TRUST * const *b);
 static void trtable_free(X509_TRUST *p);
+#endif
 
-static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags);
-static int trust_1oid(X509_TRUST *trust, X509 *x, int flags);
-static int trust_compat(X509_TRUST *trust, X509 *x, int flags);
+static int trust_1oidany(const X509_TRUST *trust, X509 *x, int flags);
+static int trust_1oid(const X509_TRUST *trust, X509 *x, int flags);
+static int trust_compat(const X509_TRUST *trust, X509 *x, int flags);
 
 static int obj_trust(int id, X509 *x, int flags);
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+#ifdef _NO_GLOBALS_
+#define default_trust obj_trust
+#else
 static int (*default_trust)(int id, X509 *x, int flags) = obj_trust;
+#endif
+#else
+#define default_trust obj_trust
+#endif
 
 /* WARNING: the following table should be kept in order of trust
  * and without any gaps so we can just subtract the minimum trust
  * value to get an index into the table
  */
 
-static X509_TRUST trstandard[] = {
-{X509_TRUST_COMPAT, 0, trust_compat, "compatible", 0, NULL},
-{X509_TRUST_SSL_CLIENT, 0, trust_1oidany, "SSL Client", NID_client_auth, NULL},
-{X509_TRUST_SSL_SERVER, 0, trust_1oidany, "SSL Server", NID_server_auth, NULL},
-{X509_TRUST_EMAIL, 0, trust_1oidany, "S/MIME email", NID_email_protect, NULL},
-{X509_TRUST_OBJECT_SIGN, 0, trust_1oidany, "Object Signer", NID_code_sign, NULL},
-{X509_TRUST_OCSP_SIGN, 0, trust_1oid, "OCSP responder", NID_OCSP_sign, NULL},
-{X509_TRUST_OCSP_REQUEST, 0, trust_1oid, "OCSP request", NID_ad_OCSP, NULL},
-{X509_TRUST_TSA, 0, trust_1oidany, "TSA server", NID_time_stamp, NULL}
-};
+#define X509_TRUST_ENTRY(_trust, flg, ch_trst, nam, a1, a2) \
+	CONST_ENTRY_START(trust, _trust)\
+	CONST_ENTRY_SINGLE(flags, flg)\
+	CONST_ENTRY_SINGLE(check_trust, ch_trst)\
+	CONST_ENTRY_SINGLE(name, nam)\
+	CONST_ENTRY_SINGLE(arg1, a1)\
+	CONST_ENTRY_SINGLE(arg2, a2)\
+CONST_ENTRY_END
+
+OPENSSL_PREFIX_CONST_ARRAY(static, X509_TRUST, trstandard, libopeay)
+X509_TRUST_ENTRY(X509_TRUST_COMPAT, 0, trust_compat, "compatible", 0, NULL)
+X509_TRUST_ENTRY(X509_TRUST_SSL_CLIENT, 0, trust_1oidany, "SSL Client", NID_client_auth, NULL)
+X509_TRUST_ENTRY(X509_TRUST_SSL_SERVER, 0, trust_1oidany, "SSL Server", NID_server_auth, NULL)
+X509_TRUST_ENTRY(X509_TRUST_EMAIL, 0, trust_1oidany, "S/MIME email", NID_email_protect, NULL)
+X509_TRUST_ENTRY(X509_TRUST_OBJECT_SIGN, 0, trust_1oidany, "Object Signer", NID_code_sign, NULL)
+X509_TRUST_ENTRY(X509_TRUST_OCSP_SIGN, 0, trust_1oid, "OCSP responder", NID_OCSP_sign, NULL)
+X509_TRUST_ENTRY(X509_TRUST_OCSP_REQUEST, 0, trust_1oid, "OCSP request", NID_ad_OCSP, NULL)
+X509_TRUST_ENTRY(X509_TRUST_TSA, 0, trust_1oidany,"TSA server",NID_time_stamp, NULL)
+CONST_END(trstandard)
 
-#define X509_TRUST_COUNT	(sizeof(trstandard)/sizeof(X509_TRUST))
+#define X509_TRUST_COUNT	OPENSSL_CONST_ARRAY_SIZE(trstandard)
 
 IMPLEMENT_STACK_OF(X509_TRUST)
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+#ifdef _NO_GLOBALS_
+OPENSSL_IMPLEMENT_GLOBAL(STACK_OF(X509_TRUST) *, trtable);
+#define trtable OPENSSL_GLOBAL_REF(trtable)
+#else
 static STACK_OF(X509_TRUST) *trtable = NULL;
+#endif // _NO_GLOBALS_
+#endif
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 static int tr_cmp(const X509_TRUST * const *a,
 		const X509_TRUST * const *b)
 {
 	return (*a)->trust - (*b)->trust;
 }
 
+#ifndef _NO_GLOBALS_
 int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int)
 {
 	int (*oldtrust)(int , X509 *, int);
@@ -107,11 +138,12 @@
 	default_trust = trust;
 	return oldtrust;
 }
-
+#endif
+#endif
 
 int X509_check_trust(X509 *x, int id, int flags)
 {
-	X509_TRUST *pt;
+	const X509_TRUST *pt;
 	int idx;
 	if(id == -1) return 1;
 	idx = X509_TRUST_get_by_id(id);
@@ -120,32 +152,47 @@
 	return pt->check_trust(pt, x, flags);
 }
 
+#ifndef OPERA_SMALL_VERSION
 int X509_TRUST_get_count(void)
 {
 	if(!trtable) return X509_TRUST_COUNT;
 	return sk_X509_TRUST_num(trtable) + X509_TRUST_COUNT;
 }
+#endif
 
-X509_TRUST * X509_TRUST_get0(int idx)
+const X509_TRUST* X509_TRUST_get0(int idx)
 {
 	if(idx < 0) return NULL;
-	if(idx < (int)X509_TRUST_COUNT) return trstandard + idx;
+	if(idx < (int)X509_TRUST_COUNT) return OPENSSL_GLOBAL_ARRAY_NAME(trstandard) + idx;
+#ifndef OPERA_SMALL_VERSION
 	return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);
+#else
+	return NULL;
+#endif
 }
 
 int X509_TRUST_get_by_id(int id)
 {
+#ifndef OPERA_SMALL_VERSION
 	X509_TRUST tmp;
 	int idx;
+#endif
+
 	if((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
 				 return id - X509_TRUST_MIN;
+
+#ifdef OPERA_SMALL_VERSION
+	return -1;
+#else
 	tmp.trust = id;
 	if(!trtable) return -1;
 	idx = sk_X509_TRUST_find(trtable, &tmp);
 	if(idx == -1) return -1;
 	return idx + X509_TRUST_COUNT;
+#endif
 }
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 int X509_TRUST_set(int *t, int trust)
 {
 	if(X509_TRUST_get_by_id(trust) == -1) {
@@ -169,15 +216,15 @@
 	idx = X509_TRUST_get_by_id(id);
 	/* Need a new entry */
 	if(idx == -1) {
-		if(!(trtmp = OPENSSL_malloc(sizeof(X509_TRUST)))) {
+		if(!(trtmp = (X509_TRUST*)OPENSSL_malloc(sizeof(X509_TRUST)))) {
 			X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE);
 			return 0;
 		}
 		trtmp->flags = X509_TRUST_DYNAMIC;
-	} else trtmp = X509_TRUST_get0(idx);
+	} else trtmp = (X509_TRUST*)X509_TRUST_get0(idx);
 
 	/* OPENSSL_free existing name if dynamic */
-	if(trtmp->flags & X509_TRUST_DYNAMIC_NAME) OPENSSL_free(trtmp->name);
+	if(trtmp->flags & X509_TRUST_DYNAMIC_NAME) OPENSSL_free((void*)trtmp->name);
 	/* dup supplied name */
 	if(!(trtmp->name = BUF_strdup(name))) {
 		X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE);
@@ -189,7 +236,7 @@
 	trtmp->flags |= flags;
 
 	trtmp->trust = id;
-	trtmp->check_trust = ck;
+	trtmp->check_trust = (int (*)(const x509_trust_st*, X509*, int)) ck;
 	trtmp->arg1 = arg1;
 	trtmp->arg2 = arg2;
 
@@ -213,7 +260,7 @@
 	if (p->flags & X509_TRUST_DYNAMIC) 
 		{
 		if (p->flags & X509_TRUST_DYNAMIC_NAME)
-			OPENSSL_free(p->name);
+			OPENSSL_free((void*)p->name);
 		OPENSSL_free(p);
 		}
 	}
@@ -221,7 +268,7 @@
 void X509_TRUST_cleanup(void)
 {
 	unsigned int i;
-	for(i = 0; i < X509_TRUST_COUNT; i++) trtable_free(trstandard + i);
+	for(i = 0; i < X509_TRUST_COUNT; i++) trtable_free((X509_TRUST*)(OPENSSL_GLOBAL_ARRAY_NAME(trstandard) + i));
 	sk_X509_TRUST_pop_free(trtable, trtable_free);
 	trtable = NULL;
 }
@@ -233,15 +280,16 @@
 
 char *X509_TRUST_get0_name(X509_TRUST *xp)
 {
-	return xp->name;
+	return (char*)xp->name;
 }
 
 int X509_TRUST_get_trust(X509_TRUST *xp)
 {
 	return xp->trust;
 }
+#endif
 
-static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags)
+static int trust_1oidany(const X509_TRUST *trust, X509 *x, int flags)
 {
 	if(x->aux && (x->aux->trust || x->aux->reject))
 		return obj_trust(trust->arg1, x, flags);
@@ -251,13 +299,13 @@
 	return trust_compat(trust, x, flags);
 }
 
-static int trust_1oid(X509_TRUST *trust, X509 *x, int flags)
+static int trust_1oid(const X509_TRUST *trust, X509 *x, int flags)
 {
 	if(x->aux) return obj_trust(trust->arg1, x, flags);
 	return X509_TRUST_UNTRUSTED;
 }
 
-static int trust_compat(X509_TRUST *trust, X509 *x, int flags)
+static int trust_compat(const X509_TRUST *trust, X509 *x, int flags)
 {
 	X509_check_purpose(x, -1, 0);
 	if(x->ex_flags & EXFLAG_SS) return X509_TRUST_TRUSTED;
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_txt.c openssl-1.0.0q/crypto/x509/x509_txt.c
--- openssl-1.0.0q.orig/crypto/x509/x509_txt.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_txt.c	2017-04-25 16:23:40.709620633 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include "cryptlib.h"
 #include <openssl/lhash.h>
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_v3.c openssl-1.0.0q/crypto/x509/x509_v3.c
--- openssl-1.0.0q.orig/crypto/x509/x509_v3.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_v3.c	2017-04-25 16:23:40.710621039 +0200
@@ -56,9 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/stack.h>
-#include "cryptlib.h"
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
@@ -180,6 +182,7 @@
 	return(NULL);
 	}
 
+#if !defined OPERA_SMALL_VERSION || !defined OPENSSL_NO_OCSP
 X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid,
 	     int crit, ASN1_OCTET_STRING *data)
 	{
@@ -253,6 +256,7 @@
 	if (!i) return(0);
 	return(1);
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_vfy.c openssl-1.0.0q/crypto/x509/x509_vfy.c
--- openssl-1.0.0q.orig/crypto/x509/x509_vfy.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_vfy.c	2017-04-25 16:23:40.712621573 +0200
@@ -56,11 +56,13 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <time.h>
 #include <errno.h>
+#endif /* !OPERA_SMALL_VERSION */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/crypto.h>
 #include <openssl/lhash.h>
 #include <openssl/buffer.h>
@@ -116,7 +118,9 @@
 static int check_trust(X509_STORE_CTX *ctx);
 static int check_revocation(X509_STORE_CTX *ctx);
 static int check_cert(X509_STORE_CTX *ctx);
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
 static int check_policy(X509_STORE_CTX *ctx);
+#endif
 
 static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer,
 			unsigned int *preasons,
@@ -135,7 +139,9 @@
 			STACK_OF(X509) *crl_path);
 
 static int internal_verify(X509_STORE_CTX *ctx);
-const char X509_version[]="X.509" OPENSSL_VERSION_PTEXT;
+#ifndef OPERA_SMALL_VERSION
+const char X509_version[]="X.509" OPENSSL_VERSION_PTEXT; /* ARRAY OK 2008-02-27 haavardm */
+#endif
 
 
 static int null_callback(int ok, X509_STORE_CTX *e)
@@ -155,6 +161,9 @@
 	X509 *x,*xtmp,*chain_ss=NULL;
 	int bad_chain = 0;
 	X509_VERIFY_PARAM *param = ctx->param;
+ #ifdef _DEBUG
+  	X509_NAME *xn;
+ #endif
 	int depth,i,ok=0;
 	int num;
 	int (*cb)(int xok,X509_STORE_CTX *xctx);
@@ -204,12 +213,42 @@
 		                         */
 
 		/* If we are self signed, we break */
+#ifdef _DEBUG
+		xn=X509_get_issuer_name(x);
+#endif
 		if (ctx->check_issued(ctx, x,x)) break;
 
 		/* If we were passed a cert chain, use it first */
 		if (ctx->untrusted != NULL)
 			{
-			xtmp=find_issuer(ctx, sktmp,x);
+ 			/** Opera new code: check in reporsitory first, even if we have the chain */
+ 			xtmp = NULL;
+ 
+ 			ok = ctx->get_issuer(&xtmp, ctx, x);
+ 
+ 			if (ok > 0 && xtmp != NULL)
+ 			{
+ 				if(X509_cmp_time(X509_get_notAfter(xtmp), NULL) <=0)
+ 				{
+ 					//Expired, use server provided cert or wait for the completion
+ 					X509_free(xtmp);
+ 					xtmp = NULL;
+ 					//Fall through
+ 				}
+ 				else if(ctx->check_issued(ctx, xtmp,xtmp))
+ 				{
+ 					X509_free(xtmp);
+ 					// If we find a root, terminate search for CAs; the chain will be completed further down.
+ 					break;
+ 				}
+ 			}
+ 			if(ok < 0)
+ 				goto end;
+ 
+ 			X509 *xtmp2 = NULL;
+ 			if(xtmp == NULL)
+ 				xtmp2 = xtmp = find_issuer(ctx, sktmp,x);
+ 
 			if (xtmp != NULL)
 				{
 				if (!sk_X509_push(ctx->chain,xtmp))
@@ -217,7 +256,8 @@
 					X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE);
 					goto end;
 					}
-				CRYPTO_add(&xtmp->references,1,CRYPTO_LOCK_X509);
+				if(xtmp2)
+					CRYPTO_add(&xtmp->references,1,CRYPTO_LOCK_X509);
 				(void)sk_X509_delete_ptr(sktmp,xtmp);
 				ctx->last_untrusted++;
 				x=xtmp;
@@ -240,6 +280,9 @@
 
 	i=sk_X509_num(ctx->chain);
 	x=sk_X509_value(ctx->chain,i-1);
+#ifdef _DEBUG
+	xn = X509_get_subject_name(x);
+#endif
 	if (ctx->check_issued(ctx, x, x))
 		{
 		/* we have a self signed certificate */
@@ -288,11 +331,18 @@
 		if (depth < num) break;
 
 		/* If we are self signed, we break */
+#ifdef _DEBUG
+		xn=X509_get_issuer_name(x);
+#endif
 		if (ctx->check_issued(ctx,x,x)) break;
 
 		ok = ctx->get_issuer(&xtmp, ctx, x);
 
-		if (ok < 0) return ok;
+		if (ok < 0)
+		{
+			if (sktmp != NULL) sk_X509_free(sktmp);
+			return ok;
+		}
 		if (ok == 0) break;
 
 		x = xtmp;
@@ -300,12 +350,18 @@
 			{
 			X509_free(xtmp);
 			X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE);
+			if (sktmp != NULL) sk_X509_free(sktmp);
 			return 0;
 			}
 		num++;
 		}
 
 	/* we now have our chain, lets check it... */
+#ifdef _DEBUG
+  	xn=X509_get_issuer_name(x);
+	/* Supress warning "variable set but not use" */
+	(void) xn;
+#endif
 
 	/* Is last certificate looked up self signed? */
 	if (!ctx->check_issued(ctx,x,x))
@@ -377,10 +433,17 @@
 	if (!ok) goto end;
 #endif
 
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
 	/* If we get this far evaluate policies */
 	if (!bad_chain && (ctx->param->flags & X509_V_FLAG_POLICY_CHECK))
 		ok = ctx->check_policy(ctx);
 	if(!ok) goto end;
+#else
+	// Suppress warning variable ‘bad_chain’ set but not used
+	(void)bad_chain;
+#endif
+
+
 	if (0)
 		{
 end:
@@ -394,9 +457,76 @@
 
 /* Given a STACK_OF(X509) find the issuer of cert (if any)
  */
+extern int CheckX509_EV_dataID();
 
 static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk, X509 *x)
 {
+#ifdef SSL_CHECK_EXT_VALIDATION_POLICY
+	// Opera added code that will attempt to find a preferred root linking directly to this certificate
+	int i;
+	BOOL tested= FALSE;
+	BOOL cand_have_root = FALSE;
+	BOOL cand_have_policies = FALSE;
+	X509 *issuer_cand= NULL, *issuer;
+	for (i = 0; i < sk_X509_num(sk); i++)
+	{
+		issuer = sk_X509_value(sk, i);
+		if (ctx->check_issued(ctx, x, issuer))
+		{
+			if(issuer_cand)
+			{
+				if(!tested)
+				{
+					X509 *tmp1 = NULL;
+					ctx->get_issuer(&tmp1, ctx, issuer_cand);
+					if(tmp1)
+					{
+						if(ctx->check_issued(ctx, tmp1, tmp1))
+						{
+							cand_have_root = TRUE;
+							cand_have_policies = ((STACK_OF(ASN1_OBJECT) *)X509_get_ex_data(tmp1, CheckX509_EV_dataID()) != NULL ? TRUE : FALSE);
+							if(cand_have_policies)
+							{
+								X509_free(tmp1);
+								break; // policies exist, we will use this one.
+							}
+						}
+					}
+
+					X509_free(tmp1);
+					tested = TRUE;
+				}
+				X509 *tmp2 = NULL;
+				ctx->get_issuer(&tmp2, ctx, issuer);
+				if(tmp2)
+				{
+					// Only embedded roots are considered
+					if(ctx->check_issued(ctx, tmp2, tmp2))
+					{
+						BOOL have_policies = ((STACK_OF(ASN1_OBJECT) *)X509_get_ex_data(tmp2, CheckX509_EV_dataID()) != NULL ? TRUE : FALSE);
+
+						if(!cand_have_root || (!cand_have_policies && have_policies))
+						{
+							issuer_cand = issuer;
+							cand_have_root = TRUE;
+							cand_have_policies = have_policies;
+
+							if(cand_have_policies)
+							{
+								X509_free(tmp2);
+								break; // policies exist, we will use this one.
+							}
+						}
+					}
+					X509_free(tmp2);
+				}
+			}
+			else
+				issuer_cand = issuer;
+		}
+	}
+	return issuer_cand;
+#else
 	int i;
 	X509 *issuer;
 	for (i = 0; i < sk_X509_num(sk); i++)
@@ -406,6 +536,7 @@
 			return issuer;
 		}
 	return NULL;
+#endif
 }
 
 /* Given a possible certificate and issuer check them */
@@ -424,9 +555,9 @@
 	ctx->current_cert = x;
 	ctx->current_issuer = issuer;
 	return ctx->verify_cb(0, ctx);
-	return 0;
 }
 
+#ifndef OPERA_SMALL_VERSION
 /* Alternative lookup method: look from a STACK stored in other_ctx */
 
 static int get_issuer_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
@@ -440,7 +571,8 @@
 	else
 		return 0;
 }
-	
+#endif // !OPERA_SMALL_VERSION
+
 
 /* Check a certificate chains extensions for consistency
  * with the supplied purpose
@@ -479,10 +611,12 @@
 		{
 		allow_proxy_certs =
 			!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
+#ifndef OPERA_SMALL_VERSION
 		/* A hack to keep people who don't want to modify their
 		   software happy */
 		if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
 			allow_proxy_certs = 1;
+#endif // !OPERA_SMALL_VERSION
 		purpose = ctx->param->purpose;
 		}
 
@@ -695,6 +829,10 @@
 	X509 *x;
 	int ok, cnum;
 	unsigned int last_reasons;
+
+	/* Suppress warning "potentially uninitialized local variable used". */
+	ok = 0;
+
 	cnum = ctx->error_depth;
 	x = sk_X509_value(ctx->chain, cnum);
 	ctx->current_cert = x;
@@ -1486,6 +1624,7 @@
 	return 1;
 	}
 
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
 static int check_policy(X509_STORE_CTX *ctx)
 	{
 	int ret;
@@ -1535,6 +1674,7 @@
 
 	return 1;
 	}
+#endif
 
 static int check_cert_time(X509_STORE_CTX *ctx, X509 *x)
 	{
@@ -1692,14 +1832,14 @@
 	if (ctm->type == V_ASN1_UTCTIME)
 		{
 		if ((i < 11) || (i > 17)) return 0;
-		memcpy(p,str,10);
+		op_memcpy(p,str,10);
 		p+=10;
 		str+=10;
 		}
 	else
 		{
 		if (i < 13) return 0;
-		memcpy(p,str,12);
+		op_memcpy(p,str,12);
 		p+=12;
 		str+=12;
 		}
@@ -1750,7 +1890,7 @@
 		if (i < j) return -1;
 		if (i > j) return 1;
 		}
-	i=strcmp(buff1,buff2);
+	i=op_strcmp(buff1,buff2);
 	if (i == 0) /* wait a second then return younger :-) */
 		return -1;
 	else
@@ -1773,7 +1913,7 @@
 	time_t t;
 
 	if (in_tm) t = *in_tm;
-	else time(&t);
+	else op_time(&t);
 
 	if (s && !(s->flags & ASN1_STRING_FLAG_MSTRING))
 		{
@@ -1828,6 +1968,7 @@
 	return 1;
 	}
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
 	     CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
 	{
@@ -1836,6 +1977,7 @@
 	return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, argl, argp,
 			new_func, dup_func, free_func);
 	}
+#endif
 
 int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data)
 	{
@@ -1872,6 +2014,7 @@
 	return ctx->chain;
 	}
 
+#if !defined OPERA_SMALL_VERSION || !defined OPENSSL_NO_OCSP
 STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx)
 	{
 	int i;
@@ -1885,6 +2028,7 @@
 		}
 	return chain;
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 X509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx)
 	{
@@ -1945,7 +2089,7 @@
 	/* If we have a purpose then check it is valid */
 	if (purpose)
 		{
-		X509_PURPOSE *ptmp;
+		const X509_PURPOSE *ptmp;
 		idx = X509_PURPOSE_get_by_id(purpose);
 		if (idx == -1)
 			{
@@ -1993,7 +2137,7 @@
 		X509err(X509_F_X509_STORE_CTX_NEW,ERR_R_MALLOC_FAILURE);
 		return NULL;
 		}
-	memset(ctx, 0, sizeof(X509_STORE_CTX));
+	op_memset(ctx, 0, sizeof(X509_STORE_CTX));
 	return ctx;
 }
 
@@ -2113,13 +2257,15 @@
 	else
 		ctx->lookup_crls = X509_STORE_get1_crls;
 
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
 	ctx->check_policy = check_policy;
+#endif
 
 
-	/* This memset() can't make any sense anyway, so it's removed. As
+	/* This op_memset() can't make any sense anyway, so it's removed. As
 	 * X509_STORE_CTX_cleanup does a proper "free" on the ex_data, we put a
 	 * corresponding "new" here and remove this bogus initialisation. */
-	/* memset(&(ctx->ex_data),0,sizeof(CRYPTO_EX_DATA)); */
+	/* op_memset(&(ctx->ex_data),0,sizeof(CRYPTO_EX_DATA)); */
 	if(!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE_CTX, ctx,
 				&(ctx->ex_data)))
 		{
@@ -2134,11 +2280,13 @@
  * This avoids X509_STORE nastiness where it isn't needed.
  */
 
+#ifndef OPERA_SMALL_VERSION
 void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk)
 {
 	ctx->other_ctx = sk;
 	ctx->get_issuer = get_issuer_sk;
 }
+#endif
 
 void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx)
 	{
@@ -2149,18 +2297,20 @@
 			X509_VERIFY_PARAM_free(ctx->param);
 		ctx->param=NULL;
 		}
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
 	if (ctx->tree != NULL)
 		{
 		X509_policy_tree_free(ctx->tree);
 		ctx->tree=NULL;
 		}
+#endif
 	if (ctx->chain != NULL)
 		{
 		sk_X509_pop_free(ctx->chain,X509_free);
 		ctx->chain=NULL;
 		}
 	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE_CTX, ctx, &(ctx->ex_data));
-	memset(&ctx->ex_data,0,sizeof(CRYPTO_EX_DATA));
+	op_memset(&ctx->ex_data,0,sizeof(CRYPTO_EX_DATA));
 	}
 
 void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth)
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_vfy.h openssl-1.0.0q/crypto/x509/x509_vfy.h
--- openssl-1.0.0q.orig/crypto/x509/x509_vfy.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_vfy.h	2017-04-25 16:23:40.713620303 +0200
@@ -165,7 +165,7 @@
 
 typedef struct X509_VERIFY_PARAM_st
 	{
-	char *name;
+	const char *name;
 	time_t check_time;	/* Time to use */
 	unsigned long inh_flags; /* Inheritance flags */
 	unsigned long flags;	/* Various verify flags */
@@ -225,7 +225,7 @@
 	} /* X509_LOOKUP */;
 
 /* This is a used when verifying cert chains.  Since the
- * gathering of the cert chain can take some time (and have to be
+ * gathering of the cert chain can take some op_time (and have to be
  * 'retried', this needs to be kept and passed around. */
 struct x509_store_ctx_st      /* X509_STORE_CTX */
 	{
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509_vpm.c openssl-1.0.0q/crypto/x509/x509_vpm.c
--- openssl-1.0.0q.orig/crypto/x509/x509_vpm.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509_vpm.c	2017-04-25 16:23:40.714622386 +0200
@@ -56,14 +56,17 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/crypto.h>
 #include <openssl/lhash.h>
 #include <openssl/buffer.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* X509_VERIFY_PARAM functions */
 
@@ -88,10 +91,10 @@
 X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void)
 	{
 	X509_VERIFY_PARAM *param;
-	param = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM));
+	param = (X509_VERIFY_PARAM *) OPENSSL_malloc(sizeof(X509_VERIFY_PARAM));
 	if (!param)
 		return NULL;
-	memset(param, 0, sizeof(X509_VERIFY_PARAM));
+	op_memset(param, 0, sizeof(X509_VERIFY_PARAM));
 	x509_verify_param_zero(param);
 	return param;
 	}
@@ -189,11 +192,13 @@
 
 	dest->flags |= src->flags;
 
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
 	if (test_x509_verify_param_copy(policies, NULL))
 		{
 		if (!X509_VERIFY_PARAM_set1_policies(dest, src->policies))
 			return 0;
 		}
+#endif
 
 	return 1;
 	}
@@ -212,7 +217,7 @@
 int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name)
 	{
 	if (param->name)
-		OPENSSL_free(param->name);
+		OPENSSL_free((void*)param->name);
 	param->name = BUF_strdup(name);
 	if (param->name)
 		return 1;
@@ -243,10 +248,12 @@
 	return X509_PURPOSE_set(&param->purpose, purpose);
 	}
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust)
 	{
 	return X509_TRUST_set(&param->trust, trust);
 	}
+#endif
 
 void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth)
 	{
@@ -259,6 +266,7 @@
 	param->flags |= X509_V_FLAG_USE_CHECK_TIME;
 	}
 
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_VERIFY_PARAM
 int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, ASN1_OBJECT *policy)
 	{
 	if (!param->policies)
@@ -271,7 +279,9 @@
 		return 0;
 	return 1;
 	}
+#endif /* OPERA_SMALL_VERSION */
 
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
 int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, 
 					STACK_OF(ASN1_OBJECT) *policies)
 	{
@@ -307,6 +317,7 @@
 	param->flags |= X509_V_FLAG_POLICY_CHECK;
 	return 1;
 	}
+#endif
 
 int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param)
 	{
@@ -319,8 +330,19 @@
  * will be searched using OBJ_search.
  */
 
-static const X509_VERIFY_PARAM default_table[] = {
-	{
+#define X509_VERIFY_PARAM_ENTRY(nam, ch_time, inh_flg, flg, purp, trst, dpth, pol) \
+	CONST_ENTRY_START(name,nam)\
+	CONST_ENTRY_SINGLE(check_time,ch_time)\
+	CONST_ENTRY_SINGLE(inh_flags,inh_flg)\
+	CONST_ENTRY_SINGLE(flags,flg)\
+	CONST_ENTRY_SINGLE(purpose,purp)\
+	CONST_ENTRY_SINGLE(trust,trst)\
+	CONST_ENTRY_SINGLE(depth,dpth)\
+	CONST_ENTRY_SINGLE(policies,pol)\
+	CONST_ENTRY_END
+
+OPENSSL_PREFIX_CONST_ARRAY(static, X509_VERIFY_PARAM, default_table, libopeay)
+	X509_VERIFY_PARAM_ENTRY(
 	"default",	/* X509 default parameters */
 	0,		/* Check time */
 	0,		/* internal flags */
@@ -329,8 +351,9 @@
 	0,		/* trust */
 	100,		/* depth */
 	NULL		/* policies */
-	},
-	{
+	)
+#ifdef SMIME_SUPPORT
+	X509_VERIFY_PARAM_ENTRY(
 	"pkcs7",			/* S/MIME sign parameters */
 	0,				/* Check time */
 	0,				/* internal flags */
@@ -339,8 +362,8 @@
 	X509_TRUST_EMAIL,		/* trust */
 	-1,				/* depth */
 	NULL				/* policies */
-	},
-	{
+	)
+	X509_VERIFY_PARAM_ENTRY(
 	"smime_sign",			/* S/MIME sign parameters */
 	0,				/* Check time */
 	0,				/* internal flags */
@@ -349,8 +372,9 @@
 	X509_TRUST_EMAIL,		/* trust */
 	-1,				/* depth */
 	NULL				/* policies */
-	},
-	{
+	)
+#endif
+	X509_VERIFY_PARAM_ENTRY(
 	"ssl_client",			/* SSL/TLS client parameters */
 	0,				/* Check time */
 	0,				/* internal flags */
@@ -359,8 +383,9 @@
 	X509_TRUST_SSL_CLIENT,		/* trust */
 	-1,				/* depth */
 	NULL				/* policies */
-	},
-	{
+	)
+#ifndef OPERA_SMALL_VERSION
+	X509_VERIFY_PARAM_ENTRY(
 	"ssl_server",			/* SSL/TLS server parameters */
 	0,				/* Check time */
 	0,				/* internal flags */
@@ -369,9 +394,13 @@
 	X509_TRUST_SSL_SERVER,		/* trust */
 	-1,				/* depth */
 	NULL				/* policies */
-	}};
+	)
+#endif /* OPERA_SMALL_VERSION */
+CONST_END(default_table)
 
+#ifndef OPERA_SMALL_VERSION
 static STACK_OF(X509_VERIFY_PARAM) *param_table = NULL;
+#endif /* OPERA_SMALL_VERSION */
 
 static int table_cmp(const X509_VERIFY_PARAM *a, const X509_VERIFY_PARAM *b)
 
@@ -384,6 +413,7 @@
 IMPLEMENT_OBJ_BSEARCH_CMP_FN(X509_VERIFY_PARAM, X509_VERIFY_PARAM,
 			     table);
 
+#ifndef OPERA_SMALL_VERSION
 static int param_cmp(const X509_VERIFY_PARAM * const *a,
 			const X509_VERIFY_PARAM * const *b)
 	{
@@ -414,23 +444,31 @@
 		return 0;
 	return 1;
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name)
 	{
+#ifndef OPERA_SMALL_VERSION
 	int idx;
+#endif /* OPERA_SMALL_VERSION */
+
 	X509_VERIFY_PARAM pm;
 
 	pm.name = (char *)name;
+#ifndef OPERA_SMALL_VERSION
 	if (param_table)
 		{
 		idx = sk_X509_VERIFY_PARAM_find(param_table, &pm);
 		if (idx != -1)
 			return sk_X509_VERIFY_PARAM_value(param_table, idx);
 		}
-	return OBJ_bsearch_table(&pm, default_table,
-			   sizeof(default_table)/sizeof(X509_VERIFY_PARAM));
+#endif /* OPERA_SMALL_VERSION */
+
+	return OBJ_bsearch_table(&pm, OPENSSL_GLOBAL_ARRAY_NAME(default_table),
+			OPENSSL_CONST_ARRAY_SIZE(default_table));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 void X509_VERIFY_PARAM_table_cleanup(void)
 	{
 	if (param_table)
@@ -438,3 +476,4 @@
 						X509_VERIFY_PARAM_free);
 	param_table = NULL;
 	}
+#endif /* OPERA_SMALL_VERSION */
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509cset.c openssl-1.0.0q/crypto/x509/x509cset.c
--- openssl-1.0.0q.orig/crypto/x509/x509cset.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509cset.c	2017-04-25 16:23:40.715621396 +0200
@@ -56,7 +56,9 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509name.c openssl-1.0.0q/crypto/x509/x509name.c
--- openssl-1.0.0q.orig/crypto/x509/x509name.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509name.c	2017-04-25 16:23:40.839798630 +0200
@@ -56,14 +56,17 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/stack.h>
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len)
 	{
 	ASN1_OBJECT *obj;
@@ -84,10 +87,11 @@
 	data=X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name,i));
 	i=(data->length > (len-1))?(len-1):data->length;
 	if (buf == NULL) return(data->length);
-	memcpy(buf,data->data,i);
+	op_memcpy(buf,data->data,i);
 	buf[i]='\0';
 	return(i);
 	}
+#endif
 
 int X509_NAME_entry_count(X509_NAME *name)
 	{
@@ -135,6 +139,7 @@
 		return(sk_X509_NAME_ENTRY_value(name->entries,loc));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc)
 	{
 	X509_NAME_ENTRY *ret;
@@ -194,6 +199,7 @@
 	X509_NAME_ENTRY_free(ne);
 	return ret;
 }
+#endif
 
 int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
 			const unsigned char *bytes, int len, int loc, int set)
@@ -291,6 +297,7 @@
 	return nentry;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
 	     int type, unsigned char *bytes, int len)
 	{
@@ -307,6 +314,7 @@
 	ASN1_OBJECT_free(obj);
 	return nentry;
 	}
+#endif /* OPERA_SMALL_VERSION */
 
 X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
 	     ASN1_OBJECT *obj, int type, const unsigned char *bytes, int len)
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509rset.c openssl-1.0.0q/crypto/x509/x509rset.c
--- openssl-1.0.0q.orig/crypto/x509/x509rset.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509rset.c	2017-04-25 16:23:40.840798757 +0200
@@ -56,13 +56,16 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
 
+#ifndef OPERA_SMALL_VERSION
 int X509_REQ_set_version(X509_REQ *x, long version)
 	{
 	if (x == NULL) return(0);
@@ -80,4 +83,5 @@
 	if ((x == NULL) || (x->req_info == NULL)) return(0);
 	return(X509_PUBKEY_set(&x->req_info->pubkey,pkey));
 	}
+#endif
 
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509spki.c openssl-1.0.0q/crypto/x509/x509spki.c
--- openssl-1.0.0q.orig/crypto/x509/x509spki.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509spki.c	2017-04-25 16:23:40.841799723 +0200
@@ -56,10 +56,13 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 
+#ifndef OPERA_SMALL_VERSION
 int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey)
 {
 	if ((x == NULL) || (x->spkac == NULL)) return(0);
@@ -81,7 +84,7 @@
 	const unsigned char *p;
 	int spki_len;
 	NETSCAPE_SPKI *spki;
-	if(len <= 0) len = strlen(str);
+	if(len <= 0) len = op_strlen(str);
 	if (!(spki_der = OPENSSL_malloc(len + 1))) {
 		X509err(X509_F_NETSCAPE_SPKI_B64_DECODE, ERR_R_MALLOC_FAILURE);
 		return NULL;
@@ -119,3 +122,4 @@
 	OPENSSL_free(der_spki);
 	return b64_str;
 }
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509/x509type.c openssl-1.0.0q/crypto/x509/x509type.c
--- openssl-1.0.0q.orig/crypto/x509/x509type.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x509type.c	2017-04-25 16:23:40.842798174 +0200
@@ -56,12 +56,15 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 int X509_certificate_type(X509 *x, EVP_PKEY *pkey)
 	{
 	EVP_PKEY *pk;
@@ -123,3 +126,4 @@
 	return(ret);
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509/x_all.c openssl-1.0.0q/crypto/x509/x_all.c
--- openssl-1.0.0q.orig/crypto/x509/x_all.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/x509/x_all.c	2017-04-25 16:23:40.843798859 +0200
@@ -56,9 +56,12 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/stack.h>
-#include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>
 #include <openssl/evp.h>
@@ -69,6 +72,7 @@
 #ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
 #endif
+#include "modules/libopeay/libopeay_arrays.h"
 
 int X509_verify(X509 *a, EVP_PKEY *r)
 	{
@@ -78,12 +82,15 @@
 		a->signature,a->cert_info,r));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r)
 	{
 	return( ASN1_item_verify(ASN1_ITEM_rptr(X509_REQ_INFO),
 		a->sig_alg,a->signature,a->req_info,r));
 	}
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r)
 	{
 	return(ASN1_item_verify(ASN1_ITEM_rptr(NETSCAPE_SPKAC),
@@ -96,26 +103,34 @@
 	return(ASN1_item_sign(ASN1_ITEM_rptr(X509_CINF), x->cert_info->signature,
 		x->sig_alg, x->signature, x->cert_info,pkey,md));
 	}
+#endif
 
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
 int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md)
 	{
 	return(ASN1_item_sign(ASN1_ITEM_rptr(X509_REQ_INFO),x->sig_alg, NULL,
 		x->signature, x->req_info,pkey,md));
 	}
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md)
 	{
 	x->crl->enc.modified = 1;
 	return(ASN1_item_sign(ASN1_ITEM_rptr(X509_CRL_INFO),x->crl->sig_alg,
 		x->sig_alg, x->signature, x->crl,pkey,md));
 	}
+#endif
 
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
 int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md)
 	{
 	return(ASN1_item_sign(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor,NULL,
 		x->signature, x->spkac,pkey,md));
 	}
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 #ifndef OPENSSL_NO_FP_API
 X509 *d2i_X509_fp(FILE *fp, X509 **x509)
 	{
@@ -295,6 +310,7 @@
 	return ASN1_i2d_fp_of(DSA,i2d_DSA_PUBKEY,fp,dsa);
 	}
 #endif
+#endif /* OPERA_SMALL_VERSION */
 
 DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa)
 	{
@@ -384,18 +400,23 @@
 	return(ASN1_item_digest(ASN1_ITEM_rptr(X509_CRL),type,(char *)data,md,len));
 	}
 
+#ifndef OPERA_SMALL_VERSION
 int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, unsigned char *md,
 	     unsigned int *len)
 	{
 	return(ASN1_item_digest(ASN1_ITEM_rptr(X509_REQ),type,(char *)data,md,len));
 	}
+#endif /* OPERA_SMALL_VERSION */
 
+#if !defined OPERA_SMALL_VERSION || !defined OPENSSL_NO_OCSP
 int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, unsigned char *md,
 	     unsigned int *len)
 	{
 	return(ASN1_item_digest(ASN1_ITEM_rptr(X509_NAME),type,(char *)data,md,len));
 	}
+#endif /* OPERA_SMALL_VERSION */
 
+#ifndef OPERA_SMALL_VERSION
 int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data, const EVP_MD *type,
 	     unsigned char *md, unsigned int *len)
 	{
@@ -516,3 +537,4 @@
 	{
 	return ASN1_d2i_bio_of(EVP_PKEY,EVP_PKEY_new,d2i_PUBKEY,bp,a);
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/.gitignore openssl-1.0.0q/crypto/x509v3/.gitignore
--- openssl-1.0.0q.orig/crypto/x509v3/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/.gitignore	2017-04-25 16:23:40.844798149 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/ext_dat.h openssl-1.0.0q/crypto/x509v3/ext_dat.h
--- openssl-1.0.0q.orig/crypto/x509v3/ext_dat.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/ext_dat.h	2017-04-25 16:23:40.845798276 +0200
@@ -57,76 +57,84 @@
  */
 /* This file contains a table of "standard" extensions */
 
-extern X509V3_EXT_METHOD v3_bcons, v3_nscert, v3_key_usage, v3_ext_ku;
-extern X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, v3_sinfo;
-extern X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, v3_akey_id;
-extern X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate;
-extern X509V3_EXT_METHOD v3_delta_crl, v3_cpols, v3_crld, v3_freshest_crl;
-extern X509V3_EXT_METHOD v3_ocsp_nonce, v3_ocsp_accresp, v3_ocsp_acutoff;
-extern X509V3_EXT_METHOD v3_ocsp_crlid, v3_ocsp_nocheck, v3_ocsp_serviceloc;
-extern X509V3_EXT_METHOD v3_crl_hold, v3_pci;
-extern X509V3_EXT_METHOD v3_policy_mappings, v3_policy_constraints;
-extern X509V3_EXT_METHOD v3_name_constraints, v3_inhibit_anyp, v3_idp;
-extern X509V3_EXT_METHOD v3_addr, v3_asid;
+#include "modules/libopeay/libopeay_arrays.h"
+
+#ifdef HAS_COMPLEX_GLOBALS
+extern const X509V3_EXT_METHOD g_v3_bcons, g_v3_nscert, g_v3_key_usage, g_v3_ext_ku;
+extern const X509V3_EXT_METHOD g_v3_pkey_usage_period, g_v3_sxnet, g_v3_info, g_v3_sinfo;
+extern const X509V3_EXT_METHOD g_v3_ns_ia5_list[], g_v3_alt[], g_v3_skey_id, g_v3_akey_id;
+extern const X509V3_EXT_METHOD g_v3_crl_num, g_v3_crl_reason, g_v3_crl_invdate;
+extern const X509V3_EXT_METHOD g_v3_delta_crl, g_v3_cpols, g_v3_crld;
+extern const X509V3_EXT_METHOD g_v3_ocsp_nonce, g_v3_ocsp_accresp, g_v3_ocsp_acutoff;
+extern const X509V3_EXT_METHOD g_v3_ocsp_crlid, g_v3_ocsp_nocheck, g_v3_ocsp_serviceloc;
+extern const X509V3_EXT_METHOD g_v3_crl_hold, g_v3_pci;
+extern const X509V3_EXT_METHOD g_v3_policy_mappings, g_v3_policy_constraints;
+extern const X509V3_EXT_METHOD g_v3_name_constraints, g_v3_inhibit_anyp;
+#ifndef OPENSSL_NO_RFC3779
+extern const X509V3_EXT_METHOD g_v3_addr, g_v3_asid;
+#endif
+#endif
 
 /* This table will be searched using OBJ_bsearch so it *must* kept in
  * order of the ext_nid values.
  */
 
-static const X509V3_EXT_METHOD *standard_exts[] = {
-&v3_nscert,
-&v3_ns_ia5_list[0],
-&v3_ns_ia5_list[1],
-&v3_ns_ia5_list[2],
-&v3_ns_ia5_list[3],
-&v3_ns_ia5_list[4],
-&v3_ns_ia5_list[5],
-&v3_ns_ia5_list[6],
-&v3_skey_id,
-&v3_key_usage,
-&v3_pkey_usage_period,
-&v3_alt[0],
-&v3_alt[1],
-&v3_bcons,
-&v3_crl_num,
-&v3_cpols,
-&v3_akey_id,
-&v3_crld,
-&v3_ext_ku,
-&v3_delta_crl,
-&v3_crl_reason,
+#define OPERA_V3_METHOD_ENTRY(x) CONST_ENTRY(&OPENSSL_GLOBAL_ITEM_NAME(x) )
+#define OPERA_V3_METHOD_ARRAY_ENTRY(x,i) CONST_ENTRY(&OPENSSL_GLOBAL_ARRAY_NAME(x)[i])
+
+typedef const X509V3_EXT_METHOD *X509V3_EXT_METHOD_pointer;
+
+OPENSSL_PREFIX_CONST_ARRAY(static, X509V3_EXT_METHOD_pointer , ext_dat__standard_exts, libopeay)
+OPERA_V3_METHOD_ENTRY(v3_nscert)
+OPERA_V3_METHOD_ARRAY_ENTRY(v3_ns_ia5_list,0)
+OPERA_V3_METHOD_ARRAY_ENTRY(v3_ns_ia5_list,1)
+OPERA_V3_METHOD_ARRAY_ENTRY(v3_ns_ia5_list,2)
+OPERA_V3_METHOD_ARRAY_ENTRY(v3_ns_ia5_list,3)
+OPERA_V3_METHOD_ARRAY_ENTRY(v3_ns_ia5_list,4)
+OPERA_V3_METHOD_ARRAY_ENTRY(v3_ns_ia5_list,5)
+OPERA_V3_METHOD_ARRAY_ENTRY(v3_ns_ia5_list,6)
+OPERA_V3_METHOD_ENTRY(v3_skey_id)
+OPERA_V3_METHOD_ENTRY(v3_key_usage)
+OPERA_V3_METHOD_ENTRY(v3_pkey_usage_period)
+OPERA_V3_METHOD_ARRAY_ENTRY(v3_alt,0)
+OPERA_V3_METHOD_ARRAY_ENTRY(v3_alt,1)
+OPERA_V3_METHOD_ENTRY(v3_bcons)
+OPERA_V3_METHOD_ENTRY(v3_crl_num)
+OPERA_V3_METHOD_ENTRY(v3_cpols)
+OPERA_V3_METHOD_ENTRY(v3_akey_id)
+OPERA_V3_METHOD_ENTRY(v3_crld)
+OPERA_V3_METHOD_ENTRY(v3_ext_ku)
+OPERA_V3_METHOD_ENTRY(v3_delta_crl)
+OPERA_V3_METHOD_ENTRY(v3_crl_reason)
 #ifndef OPENSSL_NO_OCSP
-&v3_crl_invdate,
+OPERA_V3_METHOD_ENTRY(v3_crl_invdate)
 #endif
-&v3_sxnet,
-&v3_info,
+OPERA_V3_METHOD_ENTRY(v3_sxnet)
+OPERA_V3_METHOD_ENTRY(v3_info)
 #ifndef OPENSSL_NO_RFC3779
-&v3_addr,
-&v3_asid,
+OPERA_V3_METHOD_ENTRY(v3_addr)
+OPERA_V3_METHOD_ENTRY(v3_asid)
 #endif
 #ifndef OPENSSL_NO_OCSP
-&v3_ocsp_nonce,
-&v3_ocsp_crlid,
-&v3_ocsp_accresp,
-&v3_ocsp_nocheck,
-&v3_ocsp_acutoff,
-&v3_ocsp_serviceloc,
+OPERA_V3_METHOD_ENTRY(v3_ocsp_nonce)
+OPERA_V3_METHOD_ENTRY(v3_ocsp_crlid)
+OPERA_V3_METHOD_ENTRY(v3_ocsp_accresp)
+OPERA_V3_METHOD_ENTRY(v3_ocsp_nocheck)
+OPERA_V3_METHOD_ENTRY(v3_ocsp_acutoff)
+OPERA_V3_METHOD_ENTRY(v3_ocsp_serviceloc)
 #endif
-&v3_sinfo,
-&v3_policy_constraints,
+OPERA_V3_METHOD_ENTRY(v3_sinfo)
+OPERA_V3_METHOD_ENTRY(v3_policy_constraints)
 #ifndef OPENSSL_NO_OCSP
-&v3_crl_hold,
+OPERA_V3_METHOD_ENTRY(v3_crl_hold)
 #endif
-&v3_pci,
-&v3_name_constraints,
-&v3_policy_mappings,
-&v3_inhibit_anyp,
-&v3_idp,
-&v3_alt[2],
-&v3_freshest_crl,
-};
+OPERA_V3_METHOD_ENTRY(v3_pci)
+OPERA_V3_METHOD_ENTRY(v3_policy_mappings)
+OPERA_V3_METHOD_ENTRY(v3_name_constraints)
+OPERA_V3_METHOD_ENTRY(v3_inhibit_anyp)
+CONST_END(ext_dat__standard_exts)
+#define standard_exts OPENSSL_GLOBAL_ARRAY_NAME(ext_dat__standard_exts)
 
 /* Number of standard extensions */
 
-#define STANDARD_EXTENSION_COUNT (sizeof(standard_exts)/sizeof(X509V3_EXT_METHOD *))
-
+#define STANDARD_EXTENSION_COUNT  OPENSSL_CONST_ARRAY_SIZE(ext_dat__standard_exts)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_cache.cpp openssl-1.0.0q/crypto/x509v3/opera_pcy_cache.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_cache.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_pcy_cache.cpp	2017-04-25 16:23:40.845798276 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/pcy_cache.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_data.cpp openssl-1.0.0q/crypto/x509v3/opera_pcy_data.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_data.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_pcy_data.cpp	2017-04-25 16:23:40.846798682 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/pcy_data.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_lib.cpp openssl-1.0.0q/crypto/x509v3/opera_pcy_lib.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_pcy_lib.cpp	2017-04-25 16:23:40.847798809 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/pcy_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_map.cpp openssl-1.0.0q/crypto/x509v3/opera_pcy_map.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_map.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_pcy_map.cpp	2017-04-25 16:23:40.847798809 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/pcy_map.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_node.cpp openssl-1.0.0q/crypto/x509v3/opera_pcy_node.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_node.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_pcy_node.cpp	2017-04-25 16:23:40.848798378 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/pcy_node.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_tree.cpp openssl-1.0.0q/crypto/x509v3/opera_pcy_tree.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_pcy_tree.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_pcy_tree.cpp	2017-04-25 16:23:40.848798378 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/pcy_tree.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_akey.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_akey.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_akey.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_akey.cpp	2017-04-25 16:23:40.849797667 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_akey.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_akeya.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_akeya.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_akeya.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_akeya.cpp	2017-04-25 16:23:40.850797794 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_akeya.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_alt.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_alt.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_alt.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_alt.cpp	2017-04-25 16:23:40.850797794 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_alt.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_bcons.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_bcons.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_bcons.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_bcons.cpp	2017-04-25 16:23:40.851797083 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_bcons.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_bitst.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_bitst.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_bitst.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_bitst.cpp	2017-04-25 16:23:40.851797083 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_bitst.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_conf.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_conf.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_conf.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_conf.cpp	2017-04-25 16:23:40.852797489 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_conf.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_cpols.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_cpols.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_cpols.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_cpols.cpp	2017-04-25 16:23:40.852797489 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_cpols.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_crld.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_crld.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_crld.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_crld.cpp	2017-04-25 16:23:40.853798454 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_crld.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_enum.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_enum.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_enum.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_enum.cpp	2017-04-25 16:23:40.853798454 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_enum.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_extku.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_extku.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_extku.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_extku.cpp	2017-04-25 16:23:40.854798023 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_extku.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_genn.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_genn.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_genn.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_genn.cpp	2017-04-25 16:23:40.854798023 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_genn.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_ia5.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_ia5.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_ia5.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_ia5.cpp	2017-04-25 16:23:40.855798429 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_ia5.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_info.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_info.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_info.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_info.cpp	2017-04-25 16:23:40.855798429 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_info.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_int.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_int.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_int.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_int.cpp	2017-04-25 16:23:40.856797998 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_int.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_lib.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_lib.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_lib.cpp	2017-04-25 16:23:40.856797998 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_ncons.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_ncons.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_ncons.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_ncons.cpp	2017-04-25 16:23:40.857798404 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_ncons.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_ocsp.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_ocsp.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_ocsp.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_ocsp.cpp	2017-04-25 16:23:40.857798404 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_ocsp.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_pci.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_pci.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_pci.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_pci.cpp	2017-04-25 16:23:40.858797973 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_pci.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_pcia.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_pcia.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_pcia.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_pcia.cpp	2017-04-25 16:23:40.858797973 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_pcia.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_pcons.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_pcons.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_pcons.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_pcons.cpp	2017-04-25 16:23:40.859798100 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_pcons.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_pku.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_pku.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_pku.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_pku.cpp	2017-04-25 16:23:40.859798100 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_pku.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_pmaps.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_pmaps.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_pmaps.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_pmaps.cpp	2017-04-25 16:23:40.860798227 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_pmaps.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_prn.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_prn.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_prn.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_prn.cpp	2017-04-25 16:23:40.860798227 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_prn.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_purp.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_purp.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_purp.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_purp.cpp	2017-04-25 16:23:40.860798227 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_purp.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_skey.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_skey.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_skey.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_skey.cpp	2017-04-25 16:23:40.861798633 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_skey.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_sxnet.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_sxnet.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_sxnet.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_sxnet.cpp	2017-04-25 16:23:40.861798633 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_sxnet.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/opera_v3_utl.cpp openssl-1.0.0q/crypto/x509v3/opera_v3_utl.cpp
--- openssl-1.0.0q.orig/crypto/x509v3/opera_v3_utl.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/opera_v3_utl.cpp	2017-04-25 16:23:40.861798633 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/crypto/x509v3/v3_utl.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/pcy_cache.c openssl-1.0.0q/crypto/x509v3/pcy_cache.c
--- openssl-1.0.0q.orig/crypto/x509v3/pcy_cache.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/pcy_cache.c	2017-04-25 16:23:40.862798481 +0200
@@ -56,7 +56,8 @@
  *
  */
 
-#include "cryptlib.h"
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
@@ -134,7 +135,7 @@
 	CERTIFICATEPOLICIES *ext_cpols = NULL;
 	POLICY_MAPPINGS *ext_pmaps = NULL;
 	int i;
-	cache = OPENSSL_malloc(sizeof(X509_POLICY_CACHE));
+	cache = (X509_POLICY_CACHE *) OPENSSL_malloc(sizeof(X509_POLICY_CACHE));
 	if (!cache)
 		return 0;
 	cache->anyPolicy = NULL;
@@ -148,7 +149,7 @@
 	/* Handle requireExplicitPolicy *first*. Need to process this
 	 * even if we don't have any policies.
 	 */
-	ext_pcons = X509_get_ext_d2i(x, NID_policy_constraints, &i, NULL);
+	ext_pcons = (POLICY_CONSTRAINTS *) X509_get_ext_d2i(x, NID_policy_constraints, &i, NULL);
 
 	if (!ext_pcons)
 		{
@@ -170,7 +171,7 @@
 
 	/* Process CertificatePolicies */
 
-	ext_cpols = X509_get_ext_d2i(x, NID_certificate_policies, &i, NULL);
+	ext_cpols = (CERTIFICATEPOLICIES *) X509_get_ext_d2i(x, NID_certificate_policies, &i, NULL);
 	/* If no CertificatePolicies extension or problem decoding then
 	 * there is no point continuing because the valid policies will be
 	 * NULL.
@@ -190,7 +191,7 @@
 	if (i <= 0)
 		return i;
 
-	ext_pmaps = X509_get_ext_d2i(x, NID_policy_mappings, &i, NULL);
+	ext_pmaps = (POLICY_MAPPINGS *) X509_get_ext_d2i(x, NID_policy_mappings, &i, NULL);
 
 	if (!ext_pmaps)
 		{
@@ -205,7 +206,7 @@
 			goto bad_cache;
 		}
 
-	ext_any = X509_get_ext_d2i(x, NID_inhibit_any_policy, &i, NULL);
+	ext_any = (ASN1_INTEGER *) X509_get_ext_d2i(x, NID_inhibit_any_policy, &i, NULL);
 
 	if (!ext_any)
 		{
@@ -284,3 +285,4 @@
 	*out = ASN1_INTEGER_get(value);
 	return 1;
 	}
+#endif // !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/pcy_data.c openssl-1.0.0q/crypto/x509v3/pcy_data.c
--- openssl-1.0.0q.orig/crypto/x509v3/pcy_data.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/pcy_data.c	2017-04-25 16:23:40.863798329 +0200
@@ -56,7 +56,8 @@
  *
  */
 
-#include "cryptlib.h"
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
@@ -97,9 +98,13 @@
 		}
 	else
 		id = NULL;
-	ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA));
+	ret = (X509_POLICY_DATA *)OPENSSL_malloc(sizeof(X509_POLICY_DATA));
 	if (!ret)
+	{
+		if (id)
+			ASN1_OBJECT_free(id);
 		return NULL;
+	}
 	ret->expected_policy_set = sk_ASN1_OBJECT_new_null();
 	if (!ret->expected_policy_set)
 		{
@@ -133,3 +138,4 @@
 	return ret;
 	}
 
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/pcy_lib.c openssl-1.0.0q/crypto/x509v3/pcy_lib.c
--- openssl-1.0.0q.orig/crypto/x509v3/pcy_lib.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/pcy_lib.c	2017-04-25 16:23:40.863798329 +0200
@@ -57,7 +57,8 @@
  */
 
 
-#include "cryptlib.h"
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
@@ -82,6 +83,7 @@
 	return tree->levels + i;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 STACK_OF(X509_POLICY_NODE) *
 		X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree)
 	{
@@ -89,6 +91,7 @@
 		return NULL;
 	return tree->auth_policies;
 	}
+#endif
 
 STACK_OF(X509_POLICY_NODE) *
 	X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree)
@@ -156,6 +159,7 @@
 	return node->data->qualifier_set;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 const X509_POLICY_NODE *
 		X509_policy_node_get0_parent(const X509_POLICY_NODE *node)
 	{
@@ -165,3 +169,5 @@
 	}
 
 
+#endif
+#endif // !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/pcy_map.c openssl-1.0.0q/crypto/x509v3/pcy_map.c
--- openssl-1.0.0q.orig/crypto/x509v3/pcy_map.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/pcy_map.c	2017-04-25 16:23:40.864798177 +0200
@@ -56,7 +56,8 @@
  *
  */
 
-#include "cryptlib.h"
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
@@ -130,3 +131,4 @@
 	return ret;
 
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/pcy_node.c openssl-1.0.0q/crypto/x509v3/pcy_node.c
--- openssl-1.0.0q.orig/crypto/x509v3/pcy_node.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/pcy_node.c	2017-04-25 16:23:40.864798177 +0200
@@ -56,6 +56,7 @@
  *
  */
 
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
 #include <openssl/asn1.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
@@ -115,7 +116,7 @@
 			X509_POLICY_TREE *tree)
 	{
 	X509_POLICY_NODE *node;
-	node = OPENSSL_malloc(sizeof(X509_POLICY_NODE));
+	node = (X509_POLICY_NODE *) OPENSSL_malloc(sizeof(X509_POLICY_NODE));
 	if (!node)
 		return NULL;
 	node->data = data;
@@ -195,3 +196,4 @@
 	return 0;
 
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/pcy_tree.c openssl-1.0.0q/crypto/x509v3/pcy_tree.c
--- openssl-1.0.0q.orig/crypto/x509v3/pcy_tree.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/pcy_tree.c	2017-04-25 16:23:40.865798304 +0200
@@ -56,12 +56,13 @@
  *
  */
 
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
 #include "pcy_int.h"
 
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
 /* Enable this to print out the complete policy tree at various point during
  * evaluation.
  */
@@ -219,13 +220,13 @@
 
 	/* If we get this far initialize the tree */
 
-	tree = OPENSSL_malloc(sizeof(X509_POLICY_TREE));
+	tree = (X509_POLICY_TREE *) OPENSSL_malloc(sizeof(X509_POLICY_TREE));
 
 	if (!tree)
 		return 0;
 
 	tree->flags = 0;
-	tree->levels = OPENSSL_malloc(sizeof(X509_POLICY_LEVEL) * n);
+	tree->levels = (X509_POLICY_LEVEL *) OPENSSL_malloc(sizeof(X509_POLICY_LEVEL) * n);
 	tree->nlevel = 0;
 	tree->extra_data = NULL;
 	tree->auth_policies = NULL;
@@ -237,7 +238,7 @@
 		return 0;
 		}
 
-	memset(tree->levels, 0, n * sizeof(X509_POLICY_LEVEL));
+	op_memset(tree->levels, 0, n * sizeof(X509_POLICY_LEVEL));
 
 	tree->nlevel = n;
 
@@ -550,9 +551,9 @@
 			return 1;
 			}
 		}
-
+#ifndef OPERA_SMALL_VERSION
 	return 1;
-
+#endif
 	}
 
 static int tree_add_auth_node(STACK_OF(X509_POLICY_NODE) **pnodes,
@@ -639,6 +640,7 @@
 
 	X509_POLICY_NODE *anyPolicy;
 	X509_POLICY_DATA *extra;
+	BOOL alloced_node = FALSE;
 
 	/* Check if anyPolicy present in authority constrained policy set:
 	 * this will happen if it is a leaf node.
@@ -663,6 +665,7 @@
 		{
 		oid = sk_ASN1_OBJECT_value(policy_oids, i);
 		node = tree_find_sk(auth_nodes, oid);
+		alloced_node = FALSE;
 		if (!node)
 			{
 			if (!anyPolicy)
@@ -679,13 +682,18 @@
 						| POLICY_DATA_FLAG_EXTRA_NODE;
 			node = level_add_node(NULL, extra, anyPolicy->parent,
 						tree);
+			alloced_node = TRUE;
 			}
 		if (!tree->user_policies)
-			{
+		{
 			tree->user_policies = sk_X509_POLICY_NODE_new_null();
 			if (!tree->user_policies)
+			{
+				if(alloced_node)
+					policy_node_free(node);
 				return 1;
 			}
+		}
 		if (!sk_X509_POLICY_NODE_push(tree->user_policies, node))
 			return 0;
 		}
@@ -772,6 +780,8 @@
 	int ret;
 	X509_POLICY_TREE *tree = NULL;
 	STACK_OF(X509_POLICY_NODE) *nodes, *auth_nodes = NULL;
+	if(*ptree != NULL)
+		X509_policy_tree_free(*ptree);
 	*ptree = NULL;
 
 	*pexplicit_policy = 0;
@@ -869,4 +879,4 @@
 	return 0;
 
 	}
-
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/tabtest.c openssl-1.0.0q/crypto/x509v3/tabtest.c
--- openssl-1.0.0q.orig/crypto/x509v3/tabtest.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/tabtest.c	2017-04-25 16:23:40.866798710 +0200
@@ -60,7 +60,9 @@
  * problems if it is not.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 
 #include <openssl/x509v3.h>
 
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_addr.c openssl-1.0.0q/crypto/x509v3/v3_addr.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_addr.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_addr.c	2017-04-25 16:23:40.867798278 +0200
@@ -75,27 +75,27 @@
  * OpenSSL ASN.1 template translation of RFC 3779 2.2.3.
  */
 
-ASN1_SEQUENCE(IPAddressRange) = {
-  ASN1_SIMPLE(IPAddressRange, min, ASN1_BIT_STRING),
+ASN1_SEQUENCE(IPAddressRange)
+  ASN1_SIMPLE(IPAddressRange, min, ASN1_BIT_STRING)
   ASN1_SIMPLE(IPAddressRange, max, ASN1_BIT_STRING)
-} ASN1_SEQUENCE_END(IPAddressRange)
+ASN1_SEQUENCE_END(IPAddressRange)
 
-ASN1_CHOICE(IPAddressOrRange) = {
-  ASN1_SIMPLE(IPAddressOrRange, u.addressPrefix, ASN1_BIT_STRING),
+ASN1_CHOICE(IPAddressOrRange)
+  ASN1_SIMPLE(IPAddressOrRange, u.addressPrefix, ASN1_BIT_STRING
   ASN1_SIMPLE(IPAddressOrRange, u.addressRange,  IPAddressRange)
-} ASN1_CHOICE_END(IPAddressOrRange)
+ASN1_CHOICE_END(IPAddressOrRange)
 
-ASN1_CHOICE(IPAddressChoice) = {
-  ASN1_SIMPLE(IPAddressChoice,      u.inherit,           ASN1_NULL),
+ASN1_CHOICE(IPAddressChoice)
+  ASN1_SIMPLE(IPAddressChoice,      u.inherit,           ASN1_NULL)
   ASN1_SEQUENCE_OF(IPAddressChoice, u.addressesOrRanges, IPAddressOrRange)
-} ASN1_CHOICE_END(IPAddressChoice)
+ASN1_CHOICE_END(IPAddressChoice)
 
-ASN1_SEQUENCE(IPAddressFamily) = {
-  ASN1_SIMPLE(IPAddressFamily, addressFamily,   ASN1_OCTET_STRING),
+ASN1_SEQUENCE(IPAddressFamily) 
+  ASN1_SIMPLE(IPAddressFamily, addressFamily,   ASN1_OCTET_STRING)
   ASN1_SIMPLE(IPAddressFamily, ipAddressChoice, IPAddressChoice)
-} ASN1_SEQUENCE_END(IPAddressFamily)
+ASN1_SEQUENCE_END(IPAddressFamily)
 
-ASN1_ITEM_TEMPLATE(IPAddrBlocks) = 
+ASN1_ITEM_TEMPLATE(IPAddrBlocks)
   ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0,
 			IPAddrBlocks, IPAddressFamily)
 ASN1_ITEM_TEMPLATE_END(IPAddrBlocks)
@@ -525,7 +525,7 @@
 					     const unsigned *safi)
 {
   IPAddressFamily *f;
-  unsigned char key[3];
+  unsigned char key[3]; /* ARRAY OK 2007-11-07 yngve */
   unsigned keylen;
   int i;
 
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_akey.c openssl-1.0.0q/crypto/x509v3/v3_akey.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_akey.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_akey.c	2017-04-25 16:23:40.868798406 +0200
@@ -56,29 +56,33 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
 			AUTHORITY_KEYID *akeyid, STACK_OF(CONF_VALUE) *extlist);
+#ifndef OPERA_SMALL_VERSION
 static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
 			X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values);
+#endif
 
-const X509V3_EXT_METHOD v3_akey_id =
-	{
+CONST_X509V3_EXT_METHOD_item(v3_akey_id,
 	NID_authority_key_identifier,
 	X509V3_EXT_MULTILINE, ASN1_ITEM_ref(AUTHORITY_KEYID),
 	0,0,0,0,
 	0,0,
 	(X509V3_EXT_I2V)i2v_AUTHORITY_KEYID,
-	(X509V3_EXT_V2I)v2i_AUTHORITY_KEYID,
+	OPERA_V2I_DECLARE((X509V3_EXT_V2I)v2i_AUTHORITY_KEYID),
 	0,0,
 	NULL
-	};
+	);
 
 static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
 	     AUTHORITY_KEYID *akeyid, STACK_OF(CONF_VALUE) *extlist)
@@ -108,6 +112,7 @@
  * this is always included.
  */
 
+#ifndef OPERA_SMALL_VERSION
 static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
 	     X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values)
 	{
@@ -206,3 +211,4 @@
 	M_ASN1_OCTET_STRING_free(ikeyid);
 	return NULL;
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_akeya.c openssl-1.0.0q/crypto/x509v3/v3_akeya.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_akeya.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_akeya.c	2017-04-25 16:23:40.868798406 +0200
@@ -56,17 +56,21 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-ASN1_SEQUENCE(AUTHORITY_KEYID) = {
-	ASN1_IMP_OPT(AUTHORITY_KEYID, keyid, ASN1_OCTET_STRING, 0),
-	ASN1_IMP_SEQUENCE_OF_OPT(AUTHORITY_KEYID, issuer, GENERAL_NAME, 1),
+ASN1_SEQUENCE(AUTHORITY_KEYID) 
+	ASN1_IMP_OPT(AUTHORITY_KEYID, keyid, ASN1_OCTET_STRING, 0)
+	ASN1_IMP_SEQUENCE_OF_OPT(AUTHORITY_KEYID, issuer, GENERAL_NAME, 1)
 	ASN1_IMP_OPT(AUTHORITY_KEYID, serial, ASN1_INTEGER, 2)
-} ASN1_SEQUENCE_END(AUTHORITY_KEYID)
+ASN1_SEQUENCE_END(AUTHORITY_KEYID)
+
+IMPLEMENT_ASN1_FUNCTIONS3(AUTHORITY_KEYID)
 
-IMPLEMENT_ASN1_FUNCTIONS(AUTHORITY_KEYID)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_alt.c openssl-1.0.0q/crypto/x509v3/v3_alt.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_alt.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_alt.c	2017-04-25 16:23:40.869798253 +0200
@@ -56,39 +56,46 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
+#ifndef OPERA_SMALL_VERSION
 static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
 static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
 static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p);
 static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens);
+#endif
 static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx);
 static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx);
 
-const X509V3_EXT_METHOD v3_alt[] = {
-{ NID_subject_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES),
+OPENSSL_PREFIX_CONST_ARRAY(OPENSSL_EXTERN,X509V3_EXT_METHOD, v3_alt, libopeay)
+
+CONST_X509V3_EXT_METHOD_ENTRY( NID_subject_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES),
 0,0,0,0,
 0,0,
 (X509V3_EXT_I2V)i2v_GENERAL_NAMES,
-(X509V3_EXT_V2I)v2i_subject_alt,
-NULL, NULL, NULL},
+OPERA_V2I_DECLARE((X509V3_EXT_V2I)v2i_subject_alt),
+NULL, NULL, NULL)
 
-{ NID_issuer_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES),
+CONST_X509V3_EXT_METHOD_ENTRY( NID_issuer_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES),
 0,0,0,0,
 0,0,
 (X509V3_EXT_I2V)i2v_GENERAL_NAMES,
-(X509V3_EXT_V2I)v2i_issuer_alt,
-NULL, NULL, NULL},
+OPERA_V2I_DECLARE((X509V3_EXT_V2I)v2i_issuer_alt),
+NULL, NULL, NULL)
 
-{ NID_certificate_issuer, 0, ASN1_ITEM_ref(GENERAL_NAMES),
+CONST_X509V3_EXT_METHOD_ENTRY( NID_certificate_issuer, 0, ASN1_ITEM_ref(GENERAL_NAMES),
 0,0,0,0,
 0,0,
 (X509V3_EXT_I2V)i2v_GENERAL_NAMES,
-NULL, NULL, NULL, NULL},
-};
+NULL, NULL, NULL, NULL)
+
+CONST_END(v3_alt)
 
 STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method,
 		GENERAL_NAMES *gens, STACK_OF(CONF_VALUE) *ret)
@@ -107,7 +114,7 @@
 				GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret)
 {
 	unsigned char *p;
-	char oline[256], htmp[5];
+	char oline[256], htmp[5];	/* ARRAY OK 2004-02-18 yngve */
 	int i;
 	switch (gen->type)
 	{
@@ -153,9 +160,9 @@
 				BIO_snprintf(htmp, sizeof htmp,
 					     "%X", p[0] << 8 | p[1]);
 				p += 2;
-				strcat(oline, htmp);
+				op_strcat(oline, htmp);
 				if (i != 7)
-					strcat(oline, ":");
+					op_strcat(oline, ":");
 				}
 			}
 		else
@@ -240,6 +247,7 @@
 	return 1;
 }
 
+#ifndef OPERA_SMALL_VERSION
 static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method,
 				 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
 {
@@ -253,7 +261,7 @@
 	for(i = 0; i < sk_CONF_VALUE_num(nval); i++) {
 		cnf = sk_CONF_VALUE_value(nval, i);
 		if(!name_cmp(cnf->name, "issuer") && cnf->value &&
-						!strcmp(cnf->value, "copy")) {
+						!op_strcmp(cnf->value, "copy")) {
 			if(!copy_issuer(ctx, gens)) goto err;
 		} else {
 			GENERAL_NAME *gen;
@@ -318,10 +326,10 @@
 	for(i = 0; i < sk_CONF_VALUE_num(nval); i++) {
 		cnf = sk_CONF_VALUE_value(nval, i);
 		if(!name_cmp(cnf->name, "email") && cnf->value &&
-						!strcmp(cnf->value, "copy")) {
+						!op_strcmp(cnf->value, "copy")) {
 			if(!copy_email(ctx, gens, 0)) goto err;
 		} else if(!name_cmp(cnf->name, "email") && cnf->value &&
-						!strcmp(cnf->value, "move")) {
+						!op_strcmp(cnf->value, "move")) {
 			if(!copy_email(ctx, gens, 1)) goto err;
 		} else {
 			GENERAL_NAME *gen;
@@ -392,6 +400,7 @@
 	return 0;
 	
 }
+#endif // !OPERA_SMALL_VERSION
 
 GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method,
 				 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
@@ -578,7 +587,7 @@
 	if (!(gen->d.otherName->value = ASN1_generate_v3(p + 1, ctx)))
 		return 0;
 	objlen = p - value;
-	objtmp = OPENSSL_malloc(objlen + 1);
+	objtmp = (char *)OPENSSL_malloc(objlen + 1);
 	strncpy(objtmp, value, objlen);
 	objtmp[objlen] = 0;
 	gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0);
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_asid.c openssl-1.0.0q/crypto/x509v3/v3_asid.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_asid.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_asid.c	2017-04-25 16:23:40.870798939 +0200
@@ -75,25 +75,25 @@
  * OpenSSL ASN.1 template translation of RFC 3779 3.2.3.
  */
 
-ASN1_SEQUENCE(ASRange) = {
-  ASN1_SIMPLE(ASRange, min, ASN1_INTEGER),
+ASN1_SEQUENCE(ASRange) 
+  ASN1_SIMPLE(ASRange, min, ASN1_INTEGER)
   ASN1_SIMPLE(ASRange, max, ASN1_INTEGER)
-} ASN1_SEQUENCE_END(ASRange)
+ASN1_SEQUENCE_END(ASRange)
 
-ASN1_CHOICE(ASIdOrRange) = {
-  ASN1_SIMPLE(ASIdOrRange, u.id,    ASN1_INTEGER),
+ASN1_CHOICE(ASIdOrRange)
+  ASN1_SIMPLE(ASIdOrRange, u.id,    ASN1_INTEGER)
   ASN1_SIMPLE(ASIdOrRange, u.range, ASRange)
-} ASN1_CHOICE_END(ASIdOrRange)
+ASN1_CHOICE_END(ASIdOrRange)
 
-ASN1_CHOICE(ASIdentifierChoice) = {
-  ASN1_SIMPLE(ASIdentifierChoice,      u.inherit,       ASN1_NULL),
+ASN1_CHOICE(ASIdentifierChoice)
+  ASN1_SIMPLE(ASIdentifierChoice,      u.inherit,       ASN1_NULL)
   ASN1_SEQUENCE_OF(ASIdentifierChoice, u.asIdsOrRanges, ASIdOrRange)
-} ASN1_CHOICE_END(ASIdentifierChoice)
+ASN1_CHOICE_END(ASIdentifierChoice)
 
-ASN1_SEQUENCE(ASIdentifiers) = {
-  ASN1_EXP_OPT(ASIdentifiers, asnum, ASIdentifierChoice, 0),
+ASN1_SEQUENCE(ASIdentifiers)
+  ASN1_EXP_OPT(ASIdentifiers, asnum, ASIdentifierChoice, 0)
   ASN1_EXP_OPT(ASIdentifiers, rdi,   ASIdentifierChoice, 1)
-} ASN1_SEQUENCE_END(ASIdentifiers)
+ASN1_SEQUENCE_END(ASIdentifiers)
 
 IMPLEMENT_ASN1_FUNCTIONS(ASRange)
 IMPLEMENT_ASN1_FUNCTIONS(ASIdOrRange)
@@ -654,7 +654,7 @@
 /*
  * OpenSSL dispatch.
  */
-const X509V3_EXT_METHOD v3_asid = {
+CONST_X509V3_EXT_METHOD_item(v3_asid,
   NID_sbgp_autonomousSysNum,	/* nid */
   0,				/* flags */
   ASN1_ITEM_ref(ASIdentifiers),	/* template */
@@ -666,7 +666,7 @@
   i2r_ASIdentifiers,		/* i2r */
   0,				/* r2i */
   NULL				/* extension-specific data */
-};
+)
 
 /*
  * Figure out whether extension uses inheritance.
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_bcons.c openssl-1.0.0q/crypto/x509v3/v3_bcons.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_bcons.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_bcons.c	2017-04-25 16:23:40.871797669 +0200
@@ -57,33 +57,38 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, BASIC_CONSTRAINTS *bcons, STACK_OF(CONF_VALUE) *extlist);
+#ifndef OPERA_SMALL_VERSION
 static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values);
+#endif
 
-const X509V3_EXT_METHOD v3_bcons = {
+CONST_X509V3_EXT_METHOD_item( v3_bcons,
 NID_basic_constraints, 0,
 ASN1_ITEM_ref(BASIC_CONSTRAINTS),
 0,0,0,0,
 0,0,
 (X509V3_EXT_I2V)i2v_BASIC_CONSTRAINTS,
-(X509V3_EXT_V2I)v2i_BASIC_CONSTRAINTS,
+OPERA_V2I_DECLARE((X509V3_EXT_V2I)v2i_BASIC_CONSTRAINTS),
 NULL,NULL,
 NULL
-};
+)
 
-ASN1_SEQUENCE(BASIC_CONSTRAINTS) = {
-	ASN1_OPT(BASIC_CONSTRAINTS, ca, ASN1_FBOOLEAN),
+ASN1_SEQUENCE(BASIC_CONSTRAINTS) 
+	ASN1_OPT(BASIC_CONSTRAINTS, ca, ASN1_FBOOLEAN)
 	ASN1_OPT(BASIC_CONSTRAINTS, pathlen, ASN1_INTEGER)
-} ASN1_SEQUENCE_END(BASIC_CONSTRAINTS)
+ASN1_SEQUENCE_END(BASIC_CONSTRAINTS)
 
-IMPLEMENT_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
+IMPLEMENT_ASN1_FUNCTIONS3(BASIC_CONSTRAINTS)
 
 
 static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
@@ -94,6 +99,7 @@
 	return extlist;
 }
 
+#ifndef OPERA_SMALL_VERSION
 static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
 	     X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values)
 {
@@ -106,9 +112,9 @@
 	}
 	for(i = 0; i < sk_CONF_VALUE_num(values); i++) {
 		val = sk_CONF_VALUE_value(values, i);
-		if(!strcmp(val->name, "CA")) {
+		if(!op_strcmp(val->name, "CA")) {
 			if(!X509V3_get_value_bool(val, &bcons->ca)) goto err;
-		} else if(!strcmp(val->name, "pathlen")) {
+		} else if(!op_strcmp(val->name, "pathlen")) {
 			if(!X509V3_get_value_int(val, &bcons->pathlen)) goto err;
 		} else {
 			X509V3err(X509V3_F_V2I_BASIC_CONSTRAINTS, X509V3_R_INVALID_NAME);
@@ -121,4 +127,5 @@
 	BASIC_CONSTRAINTS_free(bcons);
 	return NULL;
 }
+#endif
 
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_bitst.c openssl-1.0.0q/crypto/x509v3/v3_bitst.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_bitst.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_bitst.c	2017-04-25 16:23:40.872798355 +0200
@@ -56,59 +56,62 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-static BIT_STRING_BITNAME ns_cert_type_table[] = {
-{0, "SSL Client", "client"},
-{1, "SSL Server", "server"},
-{2, "S/MIME", "email"},
-{3, "Object Signing", "objsign"},
-{4, "Unused", "reserved"},
-{5, "SSL CA", "sslCA"},
-{6, "S/MIME CA", "emailCA"},
-{7, "Object Signing CA", "objCA"},
-{-1, NULL, NULL}
-};
-
-static BIT_STRING_BITNAME key_usage_type_table[] = {
-{0, "Digital Signature", "digitalSignature"},
-{1, "Non Repudiation", "nonRepudiation"},
-{2, "Key Encipherment", "keyEncipherment"},
-{3, "Data Encipherment", "dataEncipherment"},
-{4, "Key Agreement", "keyAgreement"},
-{5, "Certificate Sign", "keyCertSign"},
-{6, "CRL Sign", "cRLSign"},
-{7, "Encipher Only", "encipherOnly"},
-{8, "Decipher Only", "decipherOnly"},
-{-1, NULL, NULL}
-};
+OPENSSL_PREFIX_CONST_ARRAY(static, BIT_STRING_BITNAME, ns_cert_type_table, libopeay)
+	CONST_BIT_STRING_BITNAME_ENTRY(0, "SSL Client", "client")
+	CONST_BIT_STRING_BITNAME_ENTRY(1, "SSL Server", "server")
+	CONST_BIT_STRING_BITNAME_ENTRY(2, "S/MIME", "email")
+	CONST_BIT_STRING_BITNAME_ENTRY(3, "Object Signing", "objsign")
+	CONST_BIT_STRING_BITNAME_ENTRY(4, "Unused", "reserved")
+	CONST_BIT_STRING_BITNAME_ENTRY(5, "SSL CA", "sslCA")
+	CONST_BIT_STRING_BITNAME_ENTRY(6, "S/MIME CA", "emailCA")
+	CONST_BIT_STRING_BITNAME_ENTRY(7, "Object Signing CA", "objCA")
+	CONST_BIT_STRING_BITNAME_ENTRY(-1, NULL, NULL)
+CONST_END(ns_cert_type_table)
+
+OPENSSL_PREFIX_CONST_ARRAY(static, BIT_STRING_BITNAME, key_usage_type_table, libopeay)
+	CONST_BIT_STRING_BITNAME_ENTRY(0, "Digital Signature", "digitalSignature")
+	CONST_BIT_STRING_BITNAME_ENTRY(1, "Non Repudiation", "nonRepudiation")
+	CONST_BIT_STRING_BITNAME_ENTRY(2, "Key Encipherment", "keyEncipherment")
+	CONST_BIT_STRING_BITNAME_ENTRY(3, "Data Encipherment", "dataEncipherment")
+	CONST_BIT_STRING_BITNAME_ENTRY(4, "Key Agreement", "keyAgreement")
+	CONST_BIT_STRING_BITNAME_ENTRY(5, "Certificate Sign", "keyCertSign")
+	CONST_BIT_STRING_BITNAME_ENTRY(6, "CRL Sign", "cRLSign")
+	CONST_BIT_STRING_BITNAME_ENTRY(7, "Encipher Only", "encipherOnly")
+	CONST_BIT_STRING_BITNAME_ENTRY(8, "Decipher Only", "decipherOnly")
+	CONST_BIT_STRING_BITNAME_ENTRY(-1, NULL, NULL)
+CONST_END(key_usage_type_table)
 
 
-
-const X509V3_EXT_METHOD v3_nscert = EXT_BITSTRING(NID_netscape_cert_type, ns_cert_type_table);
-const X509V3_EXT_METHOD v3_key_usage = EXT_BITSTRING(NID_key_usage, key_usage_type_table);
+CONST_X509V3_EXT_METHOD_BITSTRING_item(v3_nscert, NID_netscape_cert_type, OPENSSL_GLOBAL_ARRAY_NAME(ns_cert_type_table));
+CONST_X509V3_EXT_METHOD_BITSTRING_item(v3_key_usage, NID_key_usage, OPENSSL_GLOBAL_ARRAY_NAME(key_usage_type_table));
 
 STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
 	     ASN1_BIT_STRING *bits, STACK_OF(CONF_VALUE) *ret)
 {
-	BIT_STRING_BITNAME *bnam;
-	for(bnam =method->usr_data; bnam->lname; bnam++) {
+	const BIT_STRING_BITNAME *bnam;
+	for(bnam = (const BIT_STRING_BITNAME *) method->usr_data; bnam->lname; bnam++) {
 		if(ASN1_BIT_STRING_get_bit(bits, bnam->bitnum)) 
 			X509V3_add_value(bnam->lname, NULL, &ret);
 	}
 	return ret;
 }
 	
+#ifndef OPERA_SMALL_VERSION
 ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
 	     X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
 {
 	CONF_VALUE *val;
 	ASN1_BIT_STRING *bs;
 	int i;
-	BIT_STRING_BITNAME *bnam;
+	const BIT_STRING_BITNAME *bnam;
 	if(!(bs = M_ASN1_BIT_STRING_new())) {
 		X509V3err(X509V3_F_V2I_ASN1_BIT_STRING,ERR_R_MALLOC_FAILURE);
 		return NULL;
@@ -116,8 +119,8 @@
 	for(i = 0; i < sk_CONF_VALUE_num(nval); i++) {
 		val = sk_CONF_VALUE_value(nval, i);
 		for(bnam = method->usr_data; bnam->lname; bnam++) {
-			if(!strcmp(bnam->sname, val->name) ||
-				!strcmp(bnam->lname, val->name) ) {
+			if(!op_strcmp(bnam->sname, val->name) ||
+				!op_strcmp(bnam->lname, val->name) ) {
 				if(!ASN1_BIT_STRING_set_bit(bs, bnam->bitnum, 1)) {
 					X509V3err(X509V3_F_V2I_ASN1_BIT_STRING,
 						ERR_R_MALLOC_FAILURE);
@@ -137,5 +140,6 @@
 	}
 	return bs;
 }
+#endif
 	
 
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_conf.c openssl-1.0.0q/crypto/x509v3/v3_conf.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_conf.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_conf.c	2017-04-25 16:23:40.873798482 +0200
@@ -59,13 +59,16 @@
 
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
+#ifndef OPERA_SMALL_VERSION
 static int v3_check_critical(char **value);
 static int v3_check_generic(char **value);
 static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, int crit, char *value);
@@ -166,11 +169,12 @@
 		}
 
 	ext  = do_ext_i2d(method, ext_nid, crit, ext_struc);
-	if(method->it) ASN1_item_free(ext_struc, ASN1_ITEM_ptr(method->it));
+	if(method->it) ASN1_item_free((ASN1_VALUE *) ext_struc, ASN1_ITEM_ptr(method->it));
 	else method->ext_free(ext_struc);
 	return ext;
 
 	}
+#endif/* OPERA_SMALL_VERSION */
 
 static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid,
 				  int crit, void *ext_struc)
@@ -183,14 +187,14 @@
 	if (method->it)
 		{
 		ext_der = NULL;
-		ext_len = ASN1_item_i2d(ext_struc, &ext_der, ASN1_ITEM_ptr(method->it));
+		ext_len = ASN1_item_i2d((ASN1_VALUE *) ext_struc, &ext_der, ASN1_ITEM_ptr(method->it));
 		if (ext_len < 0) goto merr;
 		}
 	 else
 		{
 		unsigned char *p;
 		ext_len = method->i2d(ext_struc, NULL);
-		if(!(ext_der = OPENSSL_malloc(ext_len))) goto merr;
+		if(!(ext_der = (unsigned char *) OPENSSL_malloc(ext_len))) goto merr;
 		p = ext_der;
 		method->i2d(ext_struc, &p);
 		}
@@ -199,8 +203,8 @@
 	ext_oct->length = ext_len;
 
 	ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
-	if (!ext) goto merr;
 	M_ASN1_OCTET_STRING_free(ext_oct);
+	if (!ext) goto merr;
 
 	return ext;
 
@@ -222,13 +226,14 @@
 	return do_ext_i2d(method, ext_nid, crit, ext_struc);
 }
 
+#ifndef OPERA_SMALL_VERSION
 /* Check the extension string for critical flag */
 static int v3_check_critical(char **value)
 {
 	char *p = *value;
-	if ((strlen(p) < 9) || strncmp(p, "critical,", 9)) return 0;
+	if ((op_strlen(p) < 9) || op_strncmp(p, "critical,", 9)) return 0;
 	p+=9;
-	while(isspace((unsigned char)*p)) p++;
+	while(op_isspace((unsigned char)*p)) p++;
 	*value = p;
 	return 1;
 }
@@ -238,12 +243,12 @@
 {
 	int gen_type = 0;
 	char *p = *value;
-	if ((strlen(p) >= 4) && !strncmp(p, "DER:", 4))
+	if ((op_strlen(p) >= 4) && !op_strncmp(p, "DER:", 4))
 		{
 		p+=4;
 		gen_type = 1;
 		}
-	else if ((strlen(p) >= 5) && !strncmp(p, "ASN1:", 5))
+	else if ((op_strlen(p) >= 5) && !op_strncmp(p, "ASN1:", 5))
 		{
 		p+=5;
 		gen_type = 2;
@@ -251,7 +256,7 @@
 	else
 		return 0;
 
-	while (isspace((unsigned char)*p)) p++;
+	while (op_isspace((unsigned char)*p)) p++;
 	*value = p;
 	return gen_type;
 }
@@ -379,6 +384,7 @@
 	sk_X509_EXTENSION_pop_free(extlist, X509_EXTENSION_free);
 	return i;
 	}
+#endif/* OPERA_SMALL_VERSION */
 
 /* Config database functions */
 
@@ -420,6 +426,7 @@
 			ctx->db_meth->free_section(ctx->db, section);
 	}
 
+#ifndef OPERA_SMALL_VERSION
 static char *nconf_get_string(void *db, char *section, char *value)
 	{
 	return NCONF_get_string(db, section, value);
@@ -483,7 +490,7 @@
 	return CONF_get_section(db, section);
 	}
 
-static X509V3_CONF_METHOD conf_lhash_method = {
+static const X509V3_CONF_METHOD conf_lhash_method = {
 conf_lhash_get_string,
 conf_lhash_get_section,
 NULL,
@@ -523,3 +530,4 @@
 	CONF_set_nconf(&ctmp, conf);
 	return X509V3_EXT_REQ_add_nconf(&ctmp, ctx, section, req);
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_cpols.c openssl-1.0.0q/crypto/x509v3/v3_cpols.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_cpols.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_cpols.c	2017-04-25 16:23:40.874798330 +0200
@@ -56,78 +56,98 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 #include "pcy_int.h"
 
 /* Certificate policies extension support: this one is a bit complex... */
 
 static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, BIO *out, int indent);
+#ifndef OPERA_SMALL_VERSION
 static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *value);
+#endif
 static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, int indent);
 static void print_notice(BIO *out, USERNOTICE *notice, int indent);
+#ifndef OPERA_SMALL_VERSION
 static POLICYINFO *policy_section(X509V3_CTX *ctx,
 				 STACK_OF(CONF_VALUE) *polstrs, int ia5org);
 static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
 					STACK_OF(CONF_VALUE) *unot, int ia5org);
 static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos);
+#endif
 
-const X509V3_EXT_METHOD v3_cpols = {
+CONST_X509V3_EXT_METHOD_item(v3_cpols,
 NID_certificate_policies, 0,ASN1_ITEM_ref(CERTIFICATEPOLICIES),
 0,0,0,0,
 0,0,
 0,0,
 (X509V3_EXT_I2R)i2r_certpol,
-(X509V3_EXT_R2I)r2i_certpol,
+OPERA_R2I_DECLARE((X509V3_EXT_R2I)r2i_certpol),
 NULL
-};
+)
 
-ASN1_ITEM_TEMPLATE(CERTIFICATEPOLICIES) = 
+ASN1_ITEM_TEMPLATE(CERTIFICATEPOLICIES)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CERTIFICATEPOLICIES, POLICYINFO)
 ASN1_ITEM_TEMPLATE_END(CERTIFICATEPOLICIES)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(CERTIFICATEPOLICIES)
+#endif
 
-ASN1_SEQUENCE(POLICYINFO) = {
-	ASN1_SIMPLE(POLICYINFO, policyid, ASN1_OBJECT),
+ASN1_SEQUENCE(POLICYINFO)
+	ASN1_SIMPLE(POLICYINFO, policyid, ASN1_OBJECT)
 	ASN1_SEQUENCE_OF_OPT(POLICYINFO, qualifiers, POLICYQUALINFO)
-} ASN1_SEQUENCE_END(POLICYINFO)
+ASN1_SEQUENCE_END(POLICYINFO)
 
-IMPLEMENT_ASN1_FUNCTIONS(POLICYINFO)
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
+IMPLEMENT_ASN1_FUNCTIONS1(POLICYINFO)
+#endif
+
+ASN1_ADB_TEMPLATE(policydefault) 
+	ASN1_SIMPLE1(POLICYQUALINFO, d.other, ASN1_ANY)
+ASN1_ADB_TEMPLATE_END
+
+ASN1_ADB_SEQ(POLICYQUALINFO)
+	ADB_ENTRY(NID_id_qt_cps, ASN1_SIMPLE2(POLICYQUALINFO, d.cpsuri, ASN1_IA5STRING))
+	ADB_ENTRY(NID_id_qt_unotice, ASN1_SIMPLE2(POLICYQUALINFO, d.usernotice, USERNOTICE))
+ASN1_ADB_END(POLICYQUALINFO, 0, pqualid, 0, policydefault_tt, NULL)
 
-ASN1_ADB_TEMPLATE(policydefault) = ASN1_SIMPLE(POLICYQUALINFO, d.other, ASN1_ANY);
-
-ASN1_ADB(POLICYQUALINFO) = {
-	ADB_ENTRY(NID_id_qt_cps, ASN1_SIMPLE(POLICYQUALINFO, d.cpsuri, ASN1_IA5STRING)),
-	ADB_ENTRY(NID_id_qt_unotice, ASN1_SIMPLE(POLICYQUALINFO, d.usernotice, USERNOTICE))
-} ASN1_ADB_END(POLICYQUALINFO, 0, pqualid, 0, &policydefault_tt, NULL);
-
-ASN1_SEQUENCE(POLICYQUALINFO) = {
-	ASN1_SIMPLE(POLICYQUALINFO, pqualid, ASN1_OBJECT),
+ASN1_SEQUENCE(POLICYQUALINFO) 
+	ASN1_SIMPLE(POLICYQUALINFO, pqualid, ASN1_OBJECT)
 	ASN1_ADB_OBJECT(POLICYQUALINFO)
-} ASN1_SEQUENCE_END(POLICYQUALINFO)
+ASN1_SEQUENCE_END(POLICYQUALINFO)
 
-IMPLEMENT_ASN1_FUNCTIONS(POLICYQUALINFO)
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
+IMPLEMENT_ASN1_FUNCTIONS3(POLICYQUALINFO)
+#endif
 
-ASN1_SEQUENCE(USERNOTICE) = {
-	ASN1_OPT(USERNOTICE, noticeref, NOTICEREF),
+ASN1_SEQUENCE(USERNOTICE) 
+	ASN1_OPT(USERNOTICE, noticeref, NOTICEREF)
 	ASN1_OPT(USERNOTICE, exptext, DISPLAYTEXT)
-} ASN1_SEQUENCE_END(USERNOTICE)
+ASN1_SEQUENCE_END(USERNOTICE)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(USERNOTICE)
+#endif
 
-ASN1_SEQUENCE(NOTICEREF) = {
-	ASN1_SIMPLE(NOTICEREF, organization, DISPLAYTEXT),
+ASN1_SEQUENCE(NOTICEREF) 
+	ASN1_SIMPLE(NOTICEREF, organization, DISPLAYTEXT)
 	ASN1_SEQUENCE_OF(NOTICEREF, noticenos, ASN1_INTEGER)
-} ASN1_SEQUENCE_END(NOTICEREF)
+ASN1_SEQUENCE_END(NOTICEREF)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(NOTICEREF)
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method,
 		X509V3_CTX *ctx, char *value)
 {
@@ -157,7 +177,7 @@
 			goto err;
 		}
 		pstr = cnf->name;
-		if(!strcmp(pstr,"ia5org")) {
+		if(!op_strcmp(pstr,"ia5org")) {
 			ia5org = 1;
 			continue;
 		} else if(*pstr == '@') {
@@ -205,7 +225,7 @@
 	if(!(pol = POLICYINFO_new())) goto merr;
 	for(i = 0; i < sk_CONF_VALUE_num(polstrs); i++) {
 		cnf = sk_CONF_VALUE_value(polstrs, i);
-		if(!strcmp(cnf->name, "policyIdentifier")) {
+		if(!op_strcmp(cnf->name, "policyIdentifier")) {
 			ASN1_OBJECT *pobj;
 			if(!(pobj = OBJ_txt2obj(cnf->value, 0))) {
 				X509V3err(X509V3_F_POLICY_SECTION,X509V3_R_INVALID_OBJECT_IDENTIFIER);
@@ -223,7 +243,7 @@
 			qual->pqualid = OBJ_nid2obj(NID_id_qt_cps);
 			qual->d.cpsuri = M_ASN1_IA5STRING_new();
 			if(!ASN1_STRING_set(qual->d.cpsuri, cnf->value,
-						 strlen(cnf->value))) goto merr;
+						 op_strlen(cnf->value))) goto merr;
 		} else if(!name_cmp(cnf->name, "userNotice")) {
 			STACK_OF(CONF_VALUE) *unot;
 			if(*cnf->value != '@') {
@@ -282,11 +302,11 @@
 	qual->d.usernotice = not;
 	for(i = 0; i < sk_CONF_VALUE_num(unot); i++) {
 		cnf = sk_CONF_VALUE_value(unot, i);
-		if(!strcmp(cnf->name, "explicitText")) {
+		if(!op_strcmp(cnf->name, "explicitText")) {
 			not->exptext = M_ASN1_VISIBLESTRING_new();
 			if(!ASN1_STRING_set(not->exptext, cnf->value,
-						 strlen(cnf->value))) goto merr;
-		} else if(!strcmp(cnf->name, "organization")) {
+						 op_strlen(cnf->value))) goto merr;
+		} else if(!op_strcmp(cnf->name, "organization")) {
 			NOTICEREF *nref;
 			if(!not->noticeref) {
 				if(!(nref = NOTICEREF_new())) goto merr;
@@ -295,8 +315,8 @@
 			if(ia5org) nref->organization->type = V_ASN1_IA5STRING;
 			else nref->organization->type = V_ASN1_VISIBLESTRING;
 			if(!ASN1_STRING_set(nref->organization, cnf->value,
-						 strlen(cnf->value))) goto merr;
-		} else if(!strcmp(cnf->name, "noticeNumbers")) {
+						 op_strlen(cnf->value))) goto merr;
+		} else if(!op_strcmp(cnf->name, "noticeNumbers")) {
 			NOTICEREF *nref;
 			STACK_OF(CONF_VALUE) *nos;
 			if(!not->noticeref) {
@@ -360,6 +380,7 @@
 	sk_ASN1_INTEGER_pop_free(nnums, ASN1_STRING_free);
 	return 0;
 }
+#endif
 
 
 static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol,
@@ -435,6 +456,7 @@
 							 notice->exptext->data);
 }
 
+#ifndef OPERA_SMALL_VERSION
 void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent)
 	{
 	const X509_POLICY_DATA *dat = node->data;
@@ -450,6 +472,7 @@
 	else
 		BIO_printf(out, "%*sNo Qualifiers\n", indent + 2, "");
 	}
+#endif
 
 
 IMPLEMENT_STACK_OF(X509_POLICY_NODE)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_crld.c openssl-1.0.0q/crypto/x509v3/v3_crld.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_crld.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_crld.c	2017-04-25 16:23:40.875797340 +0200
@@ -56,39 +56,44 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
+
+#ifndef OPERA_SMALL_VERSION
 static void *v2i_crld(const X509V3_EXT_METHOD *method,
 		      X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
+#endif // !OPERA_SMALL_VERSION
+
 static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out,
 		     int indent);
 
-const X509V3_EXT_METHOD v3_crld =
-	{
+CONST_X509V3_EXT_METHOD_item(v3_crld,
 	NID_crl_distribution_points, 0, ASN1_ITEM_ref(CRL_DIST_POINTS),
 	0,0,0,0,
 	0,0,
 	0,
-	v2i_crld,
+	OPERA_V2I_DECLARE((X509V3_EXT_V2I)v2i_crld),
 	i2r_crldp,0,
 	NULL
-	};
+	);
 
-const X509V3_EXT_METHOD v3_freshest_crl =
-	{
+CONST_X509V3_EXT_METHOD_item(v3_freshest_crl,
 	NID_freshest_crl, 0, ASN1_ITEM_ref(CRL_DIST_POINTS),
 	0,0,0,0,
 	0,0,
 	0,
-	v2i_crld,
+	OPERA_V2I_DECLARE((X509V3_EXT_V2I)v2i_crld),
 	i2r_crldp,0,
 	NULL
-	};
+	);
 
 static STACK_OF(GENERAL_NAME) *gnames_from_sectname(X509V3_CTX *ctx, char *sect)
 	{
@@ -190,18 +195,19 @@
 	return -1;
 	}
 
-static const BIT_STRING_BITNAME reason_flags[] = {
-{0, "Unused", "unused"},
-{1, "Key Compromise", "keyCompromise"},
-{2, "CA Compromise", "CACompromise"},
-{3, "Affiliation Changed", "affiliationChanged"},
-{4, "Superseded", "superseded"},
-{5, "Cessation Of Operation", "cessationOfOperation"},
-{6, "Certificate Hold", "certificateHold"},
-{7, "Privilege Withdrawn", "privilegeWithdrawn"},
-{8, "AA Compromise", "AACompromise"},
-{-1, NULL, NULL}
-};
+OPENSSL_PREFIX_CONST_ARRAY(static, BIT_STRING_BITNAME, v3_crld__reason_flags, libopeay)
+CONST_BIT_STRING_BITNAME_ENTRY(0, "Unused", "unused")
+CONST_BIT_STRING_BITNAME_ENTRY(1, "Key Compromise", "keyCompromise")
+CONST_BIT_STRING_BITNAME_ENTRY(2, "CA Compromise", "CACompromise")
+CONST_BIT_STRING_BITNAME_ENTRY(3, "Affiliation Changed", "affiliationChanged")
+CONST_BIT_STRING_BITNAME_ENTRY(4, "Superseded", "superseded")
+CONST_BIT_STRING_BITNAME_ENTRY(5, "Cessation Of Operation", "cessationOfOperation")
+CONST_BIT_STRING_BITNAME_ENTRY(6, "Certificate Hold", "certificateHold")
+CONST_BIT_STRING_BITNAME_ENTRY(7, "Privilege Withdrawn", "privilegeWithdrawn")
+CONST_BIT_STRING_BITNAME_ENTRY(8, "AA Compromise", "AACompromise")
+CONST_BIT_STRING_BITNAME_ENTRY(-1, NULL, NULL)
+CONST_END(v3_crld__reason_flags)
+#define reason_flags OPENSSL_GLOBAL_ARRAY_NAME(v3_crld__reason_flags)
 
 static int set_reasons(ASN1_BIT_STRING **preas, char *value)
 	{
@@ -267,6 +273,7 @@
 	return 1;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 static DIST_POINT *crldp_from_section(X509V3_CTX *ctx,
 						STACK_OF(CONF_VALUE) *nval)
 	{
@@ -307,7 +314,9 @@
 		DIST_POINT_free(point);
 	return NULL;
 	}
+#endif // !OPERA_SMALL_VERSION
 
+#ifndef OPERA_SMALL_VERSION
 static void *v2i_crld(const X509V3_EXT_METHOD *method,
 		      X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
 	{
@@ -369,6 +378,7 @@
 	sk_DIST_POINT_pop_free(crld, DIST_POINT_free);
 	return NULL;
 }
+#endif // !OPERA_SMALL_VERSION
 
 IMPLEMENT_STACK_OF(DIST_POINT)
 IMPLEMENT_ASN1_SET_OF(DIST_POINT)
@@ -393,36 +403,36 @@
 	}
 
 
-ASN1_CHOICE_cb(DIST_POINT_NAME, dpn_cb) = {
-	ASN1_IMP_SEQUENCE_OF(DIST_POINT_NAME, name.fullname, GENERAL_NAME, 0),
+ASN1_CHOICE_cb(DIST_POINT_NAME, dpn_cb)
+	ASN1_IMP_SEQUENCE_OF(DIST_POINT_NAME, name.fullname, GENERAL_NAME, 0)
 	ASN1_IMP_SET_OF(DIST_POINT_NAME, name.relativename, X509_NAME_ENTRY, 1)
-} ASN1_CHOICE_END_cb(DIST_POINT_NAME, DIST_POINT_NAME, type)
+ASN1_CHOICE_END_cb(DIST_POINT_NAME, DIST_POINT_NAME, type)
 
 
 IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT_NAME)
 
-ASN1_SEQUENCE(DIST_POINT) = {
-	ASN1_EXP_OPT(DIST_POINT, distpoint, DIST_POINT_NAME, 0),
-	ASN1_IMP_OPT(DIST_POINT, reasons, ASN1_BIT_STRING, 1),
+ASN1_SEQUENCE(DIST_POINT)
+	ASN1_EXP_OPT(DIST_POINT, distpoint, DIST_POINT_NAME, 0)
+	ASN1_IMP_OPT(DIST_POINT, reasons, ASN1_BIT_STRING, 1)
 	ASN1_IMP_SEQUENCE_OF_OPT(DIST_POINT, CRLissuer, GENERAL_NAME, 2)
-} ASN1_SEQUENCE_END(DIST_POINT)
+ASN1_SEQUENCE_END(DIST_POINT)
 
 IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT)
 
-ASN1_ITEM_TEMPLATE(CRL_DIST_POINTS) = 
+ASN1_ITEM_TEMPLATE(CRL_DIST_POINTS)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CRLDistributionPoints, DIST_POINT)
 ASN1_ITEM_TEMPLATE_END(CRL_DIST_POINTS)
 
 IMPLEMENT_ASN1_FUNCTIONS(CRL_DIST_POINTS)
 
-ASN1_SEQUENCE(ISSUING_DIST_POINT) = {
-	ASN1_EXP_OPT(ISSUING_DIST_POINT, distpoint, DIST_POINT_NAME, 0),
-	ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyuser, ASN1_FBOOLEAN, 1),
-	ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyCA, ASN1_FBOOLEAN, 2),
-	ASN1_IMP_OPT(ISSUING_DIST_POINT, onlysomereasons, ASN1_BIT_STRING, 3),
-	ASN1_IMP_OPT(ISSUING_DIST_POINT, indirectCRL, ASN1_FBOOLEAN, 4),
+ASN1_SEQUENCE(ISSUING_DIST_POINT)
+	ASN1_EXP_OPT(ISSUING_DIST_POINT, distpoint, DIST_POINT_NAME, 0)
+	ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyuser, ASN1_FBOOLEAN, 1)
+	ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyCA, ASN1_FBOOLEAN, 2)
+	ASN1_IMP_OPT(ISSUING_DIST_POINT, onlysomereasons, ASN1_BIT_STRING, 3)
+	ASN1_IMP_OPT(ISSUING_DIST_POINT, indirectCRL, ASN1_FBOOLEAN, 4)
 	ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyattr, ASN1_FBOOLEAN, 5)
-} ASN1_SEQUENCE_END(ISSUING_DIST_POINT)
+ASN1_SEQUENCE_END(ISSUING_DIST_POINT)
 
 IMPLEMENT_ASN1_FUNCTIONS(ISSUING_DIST_POINT)
 
@@ -431,8 +441,7 @@
 static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
 		     STACK_OF(CONF_VALUE) *nval);
 
-const X509V3_EXT_METHOD v3_idp =
-	{
+CONST_X509V3_EXT_METHOD_item(v3_idp,
 	NID_issuing_distribution_point, X509V3_EXT_MULTILINE,
 	ASN1_ITEM_ref(ISSUING_DIST_POINT),
 	0,0,0,0,
@@ -441,7 +450,7 @@
 	v2i_idp,
 	i2r_idp,0,
 	NULL
-	};
+	);
 
 static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
 		     STACK_OF(CONF_VALUE) *nval)
@@ -538,7 +547,7 @@
 static int i2r_idp(const X509V3_EXT_METHOD *method, void *pidp, BIO *out,
 		   int indent)
 	{
-	ISSUING_DIST_POINT *idp = pidp;
+	ISSUING_DIST_POINT *idp = (ISSUING_DIST_POINT *)pidp;
 	if (idp->distpoint)
 		print_distpoint(out, idp->distpoint, indent);
 	if (idp->onlyuser > 0)
@@ -563,7 +572,7 @@
 static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out,
 		     int indent)
 	{
-	STACK_OF(DIST_POINT) *crld = pcrldp;
+	STACK_OF(DIST_POINT) *crld = (STACK_OF(DIST_POINT) *)pcrldp;
 	DIST_POINT *point;
 	int i;
 	for(i = 0; i < sk_DIST_POINT_num(crld); i++)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_enum.c openssl-1.0.0q/crypto/x509v3/v3_enum.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_enum.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_enum.c	2017-04-25 16:23:40.875797340 +0200
@@ -56,42 +56,46 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-static ENUMERATED_NAMES crl_reasons[] = {
-{CRL_REASON_UNSPECIFIED, 	 "Unspecified", "unspecified"},
-{CRL_REASON_KEY_COMPROMISE,	 "Key Compromise", "keyCompromise"},
-{CRL_REASON_CA_COMPROMISE,	 "CA Compromise", "CACompromise"},
-{CRL_REASON_AFFILIATION_CHANGED, "Affiliation Changed", "affiliationChanged"},
-{CRL_REASON_SUPERSEDED, 	 "Superseded", "superseded"},
-{CRL_REASON_CESSATION_OF_OPERATION,
-			"Cessation Of Operation", "cessationOfOperation"},
-{CRL_REASON_CERTIFICATE_HOLD,	 "Certificate Hold", "certificateHold"},
-{CRL_REASON_REMOVE_FROM_CRL,	 "Remove From CRL", "removeFromCRL"},
-{CRL_REASON_PRIVILEGE_WITHDRAWN, "Privilege Withdrawn", "privilegeWithdrawn"},
-{CRL_REASON_AA_COMPROMISE,	 "AA Compromise", "AACompromise"},
-{-1, NULL, NULL}
-};
+OPENSSL_PREFIX_CONST_ARRAY(static, ENUMERATED_NAMES, crl_reasons, libopeay)
+	CONST_BIT_STRING_BITNAME_ENTRY(CRL_REASON_UNSPECIFIED, "Unspecified", "unspecified")
+	CONST_BIT_STRING_BITNAME_ENTRY(CRL_REASON_KEY_COMPROMISE, "Key Compromise", "keyCompromise")
+	CONST_BIT_STRING_BITNAME_ENTRY(CRL_REASON_CA_COMPROMISE, "CA Compromise", "CACompromise")
+	CONST_BIT_STRING_BITNAME_ENTRY(CRL_REASON_AFFILIATION_CHANGED, "Affiliation Changed", "affiliationChanged")
+	CONST_BIT_STRING_BITNAME_ENTRY(CRL_REASON_SUPERSEDED, "Superseded", "superseded")
+	CONST_BIT_STRING_BITNAME_ENTRY(CRL_REASON_CESSATION_OF_OPERATION, "Cessation Of Operation", "cessationOfOperation")
+	CONST_BIT_STRING_BITNAME_ENTRY(CRL_REASON_CERTIFICATE_HOLD, "Certificate Hold", "certificateHold")
+	CONST_BIT_STRING_BITNAME_ENTRY(CRL_REASON_REMOVE_FROM_CRL, "Remove From CRL", "removeFromCRL")
+	CONST_BIT_STRING_BITNAME_ENTRY(CRL_REASON_PRIVILEGE_WITHDRAWN, "Privilege Withdrawn", "privilegeWithdrawn")
+	CONST_BIT_STRING_BITNAME_ENTRY(CRL_REASON_AA_COMPROMISE,	 "AA Compromise", "AACompromise")
+	CONST_BIT_STRING_BITNAME_ENTRY(-1, NULL, NULL)
+CONST_END(crl_reasons)
 
-const X509V3_EXT_METHOD v3_crl_reason = { 
+CONST_X509V3_EXT_METHOD_item(v3_crl_reason, 
 NID_crl_reason, 0, ASN1_ITEM_ref(ASN1_ENUMERATED),
 0,0,0,0,
-(X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE,
+OPERA_I2S_DECLARE((X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE),
 0,
 0,0,0,0,
-crl_reasons};
+OPENSSL_GLOBAL_ARRAY_NAME(crl_reasons))
 
 
+#ifndef OPERA_SMALL_VERSION
 char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method,
 	     ASN1_ENUMERATED *e)
 {
-	ENUMERATED_NAMES *enam;
+	const ENUMERATED_NAMES *enam;
 	long strval;
 	strval = ASN1_ENUMERATED_get(e);
-	for(enam = method->usr_data; enam->lname; enam++) {
+	for(enam = (const ENUMERATED_NAMES *) method->usr_data; enam->lname; enam++) {
 		if(strval == enam->bitnum) return BUF_strdup(enam->lname);
 	}
 	return i2s_ASN1_ENUMERATED(method, e);
 }
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_extku.c openssl-1.0.0q/crypto/x509v3/v3_extku.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_extku.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_extku.c	2017-04-25 16:23:40.876799423 +0200
@@ -57,55 +57,62 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
+#ifndef OPERA_SMALL_VERSION
 static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method,
 				    X509V3_CTX *ctx,
 				    STACK_OF(CONF_VALUE) *nval);
+#endif
 static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method,
 		void *eku, STACK_OF(CONF_VALUE) *extlist);
 
-const X509V3_EXT_METHOD v3_ext_ku = {
+CONST_X509V3_EXT_METHOD_item(v3_ext_ku,
 	NID_ext_key_usage, 0,
 	ASN1_ITEM_ref(EXTENDED_KEY_USAGE),
 	0,0,0,0,
 	0,0,
 	i2v_EXTENDED_KEY_USAGE,
-	v2i_EXTENDED_KEY_USAGE,
+	OPERA_V2I_DECLARE(v2i_EXTENDED_KEY_USAGE),
 	0,0,
 	NULL
-};
+)
 
 /* NB OCSP acceptable responses also is a SEQUENCE OF OBJECT */
-const X509V3_EXT_METHOD v3_ocsp_accresp = {
+CONST_X509V3_EXT_METHOD_item(v3_ocsp_accresp,
 	NID_id_pkix_OCSP_acceptableResponses, 0,
 	ASN1_ITEM_ref(EXTENDED_KEY_USAGE),
 	0,0,0,0,
 	0,0,
 	i2v_EXTENDED_KEY_USAGE,
-	v2i_EXTENDED_KEY_USAGE,
+	OPERA_V2I_DECLARE(v2i_EXTENDED_KEY_USAGE),
 	0,0,
 	NULL
-};
+)
 
-ASN1_ITEM_TEMPLATE(EXTENDED_KEY_USAGE) = 
+ASN1_ITEM_TEMPLATE(EXTENDED_KEY_USAGE)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, EXTENDED_KEY_USAGE, ASN1_OBJECT)
 ASN1_ITEM_TEMPLATE_END(EXTENDED_KEY_USAGE)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)
+#endif
 
 static STACK_OF(CONF_VALUE) *
   i2v_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, void *a,
 			 STACK_OF(CONF_VALUE) *ext_list)
 {
-	EXTENDED_KEY_USAGE *eku = a;
+	EXTENDED_KEY_USAGE *eku = (EXTENDED_KEY_USAGE *) a;
 	int i;
 	ASN1_OBJECT *obj;
-	char obj_tmp[80];
+	char obj_tmp[80];			/* ARRAY OK 2009-05-25 yngve */
 	for(i = 0; i < sk_ASN1_OBJECT_num(eku); i++) {
 		obj = sk_ASN1_OBJECT_value(eku, i);
 		i2t_ASN1_OBJECT(obj_tmp, 80, obj);
@@ -114,6 +121,7 @@
 	return ext_list;
 }
 
+#ifndef OPERA_SMALL_VERSION
 static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method,
 				    X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
 {
@@ -142,3 +150,4 @@
 	}
 	return extku;
 }
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_genn.c openssl-1.0.0q/crypto/x509v3/v3_genn.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_genn.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_genn.c	2017-04-25 16:23:40.877798991 +0200
@@ -57,55 +57,62 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-ASN1_SEQUENCE(OTHERNAME) = {
-	ASN1_SIMPLE(OTHERNAME, type_id, ASN1_OBJECT),
+ASN1_SEQUENCE(OTHERNAME) 
+	ASN1_SIMPLE(OTHERNAME, type_id, ASN1_OBJECT)
 	/* Maybe have a true ANY DEFINED BY later */
 	ASN1_EXP(OTHERNAME, value, ASN1_ANY, 0)
-} ASN1_SEQUENCE_END(OTHERNAME)
+ASN1_SEQUENCE_END(OTHERNAME)
 
 IMPLEMENT_ASN1_FUNCTIONS(OTHERNAME)
 
-ASN1_SEQUENCE(EDIPARTYNAME) = {
-	ASN1_IMP_OPT(EDIPARTYNAME, nameAssigner, DIRECTORYSTRING, 0),
+ASN1_SEQUENCE(EDIPARTYNAME) 
+	ASN1_IMP_OPT(EDIPARTYNAME, nameAssigner, DIRECTORYSTRING, 0)
 	ASN1_IMP_OPT(EDIPARTYNAME, partyName, DIRECTORYSTRING, 1)
-} ASN1_SEQUENCE_END(EDIPARTYNAME)
+ASN1_SEQUENCE_END(EDIPARTYNAME)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(EDIPARTYNAME)
+#endif
 
-ASN1_CHOICE(GENERAL_NAME) = {
-	ASN1_IMP(GENERAL_NAME, d.otherName, OTHERNAME, GEN_OTHERNAME),
-	ASN1_IMP(GENERAL_NAME, d.rfc822Name, ASN1_IA5STRING, GEN_EMAIL),
-	ASN1_IMP(GENERAL_NAME, d.dNSName, ASN1_IA5STRING, GEN_DNS),
+ASN1_CHOICE(GENERAL_NAME)
+	ASN1_IMP(GENERAL_NAME, d.otherName, OTHERNAME, GEN_OTHERNAME)
+	ASN1_IMP(GENERAL_NAME, d.rfc822Name, ASN1_IA5STRING, GEN_EMAIL)
+	ASN1_IMP(GENERAL_NAME, d.dNSName, ASN1_IA5STRING, GEN_DNS)
 	/* Don't decode this */
-	ASN1_IMP(GENERAL_NAME, d.x400Address, ASN1_SEQUENCE, GEN_X400),
+	ASN1_IMP(GENERAL_NAME, d.x400Address, ASN1_SEQUENCE, GEN_X400)
 	/* X509_NAME is a CHOICE type so use EXPLICIT */
-	ASN1_EXP(GENERAL_NAME, d.directoryName, X509_NAME, GEN_DIRNAME),
-	ASN1_IMP(GENERAL_NAME, d.ediPartyName, EDIPARTYNAME, GEN_EDIPARTY),
-	ASN1_IMP(GENERAL_NAME, d.uniformResourceIdentifier, ASN1_IA5STRING, GEN_URI),
-	ASN1_IMP(GENERAL_NAME, d.iPAddress, ASN1_OCTET_STRING, GEN_IPADD),
+	ASN1_EXP(GENERAL_NAME, d.directoryName, X509_NAME, GEN_DIRNAME)
+	ASN1_IMP(GENERAL_NAME, d.ediPartyName, EDIPARTYNAME, GEN_EDIPARTY)
+	ASN1_IMP(GENERAL_NAME, d.uniformResourceIdentifier, ASN1_IA5STRING, GEN_URI)
+	ASN1_IMP(GENERAL_NAME, d.iPAddress, ASN1_OCTET_STRING, GEN_IPADD)
 	ASN1_IMP(GENERAL_NAME, d.registeredID, ASN1_OBJECT, GEN_RID)
-} ASN1_CHOICE_END(GENERAL_NAME)
+ASN1_CHOICE_END(GENERAL_NAME)
 
 IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAME)
 
-ASN1_ITEM_TEMPLATE(GENERAL_NAMES) = 
+ASN1_ITEM_TEMPLATE(GENERAL_NAMES)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, GeneralNames, GENERAL_NAME)
 ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES)
 
 IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES)
 
+#ifndef NO_OLD_ASN1
 GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a)
 	{
 	return (GENERAL_NAME *) ASN1_dup((i2d_of_void *) i2d_GENERAL_NAME,
 					 (d2i_of_void *) d2i_GENERAL_NAME,
 					 (char *) a);
 	}
+#endif
 
 /* Returns 0 if they are equal, != 0 otherwise. */
 int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b)
@@ -165,29 +172,29 @@
 		{
 	case GEN_X400:
 	case GEN_EDIPARTY:
-		a->d.other = value;
+		a->d.other = (ASN1_TYPE *)value;
 		break;
 
 	case GEN_OTHERNAME:
-		a->d.otherName = value;
+		a->d.otherName = (OTHERNAME *)value;
 		break;
 
 	case GEN_EMAIL:
 	case GEN_DNS:
 	case GEN_URI:
-		a->d.ia5 = value;
+		a->d.ia5 = (ASN1_IA5STRING *)value;
 		break;
 
 	case GEN_DIRNAME:
-		a->d.dirn = value;
+		a->d.dirn = (X509_NAME *)value;
 		break;
 
 	case GEN_IPADD:
-		a->d.ip = value;
+		a->d.ip = (ASN1_OCTET_STRING *)value;
 		break;
 	
 	case GEN_RID:
-		a->d.rid = value;
+		a->d.rid = (ASN1_OBJECT *)value;
 		break;
 		}
 	a->type = type;
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_ia5.c openssl-1.0.0q/crypto/x509v3/v3_ia5.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_ia5.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_ia5.c	2017-04-25 16:23:40.877798991 +0200
@@ -57,24 +57,30 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5);
+#ifndef OPERA_SMALL_VERSION
 static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
-const X509V3_EXT_METHOD v3_ns_ia5_list[] = { 
-EXT_IA5STRING(NID_netscape_base_url),
-EXT_IA5STRING(NID_netscape_revocation_url),
-EXT_IA5STRING(NID_netscape_ca_revocation_url),
-EXT_IA5STRING(NID_netscape_renewal_url),
-EXT_IA5STRING(NID_netscape_ca_policy_url),
-EXT_IA5STRING(NID_netscape_ssl_server_name),
-EXT_IA5STRING(NID_netscape_comment),
+#endif
+
+OPENSSL_PREFIX_CONST_ARRAY(OPENSSL_EXTERN,X509V3_EXT_METHOD, v3_ns_ia5_list, libopeay)
+EXT_IA5STRING(NID_netscape_base_url)
+EXT_IA5STRING(NID_netscape_revocation_url)
+EXT_IA5STRING(NID_netscape_ca_revocation_url)
+EXT_IA5STRING(NID_netscape_renewal_url)
+EXT_IA5STRING(NID_netscape_ca_policy_url)
+EXT_IA5STRING(NID_netscape_ssl_server_name)
+EXT_IA5STRING(NID_netscape_comment)
 EXT_END
-};
+CONST_END(v3_ns_ia5_list)
 
 
 static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
@@ -82,15 +88,16 @@
 {
 	char *tmp;
 	if(!ia5 || !ia5->length) return NULL;
-	if(!(tmp = OPENSSL_malloc(ia5->length + 1))) {
+	if(!(tmp = (char *) OPENSSL_malloc(ia5->length + 1))) {
 		X509V3err(X509V3_F_I2S_ASN1_IA5STRING,ERR_R_MALLOC_FAILURE);
 		return NULL;
 	}
-	memcpy(tmp, ia5->data, ia5->length);
+	op_memcpy(tmp, ia5->data, ia5->length);
 	tmp[ia5->length] = 0;
 	return tmp;
 }
 
+#ifndef OPERA_SMALL_VERSION
 static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
 	     X509V3_CTX *ctx, char *str)
 {
@@ -101,7 +108,7 @@
 	}
 	if(!(ia5 = M_ASN1_IA5STRING_new())) goto err;
 	if(!ASN1_STRING_set((ASN1_STRING *)ia5, (unsigned char*)str,
-			    strlen(str))) {
+			    op_strlen(str))) {
 		M_ASN1_IA5STRING_free(ia5);
 		goto err;
 	}
@@ -113,4 +120,5 @@
 	X509V3err(X509V3_F_S2I_ASN1_IA5STRING,ERR_R_MALLOC_FAILURE);
 	return NULL;
 }
+#endif
 
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_info.c openssl-1.0.0q/crypto/x509v3/v3_info.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_info.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_info.c	2017-04-25 16:23:40.878798000 +0200
@@ -56,49 +56,55 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method,
 				AUTHORITY_INFO_ACCESS *ainfo,
 						STACK_OF(CONF_VALUE) *ret);
+#ifndef OPERA_SMALL_VERSION
 static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method,
 				 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
-
-const X509V3_EXT_METHOD v3_info =
-{ NID_info_access, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS),
+#endif
+CONST_X509V3_EXT_METHOD_item(v3_info,
+NID_info_access, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS),
 0,0,0,0,
 0,0,
 (X509V3_EXT_I2V)i2v_AUTHORITY_INFO_ACCESS,
-(X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS,
+OPERA_V2I_DECLARE((X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS),
 0,0,
-NULL};
+NULL)
 
-const X509V3_EXT_METHOD v3_sinfo =
-{ NID_sinfo_access, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS),
+CONST_X509V3_EXT_METHOD_item(v3_sinfo,
+NID_sinfo_access, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS),
 0,0,0,0,
 0,0,
 (X509V3_EXT_I2V)i2v_AUTHORITY_INFO_ACCESS,
-(X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS,
+OPERA_V2I_DECLARE((X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS),
 0,0,
-NULL};
+NULL)
 
-ASN1_SEQUENCE(ACCESS_DESCRIPTION) = {
-	ASN1_SIMPLE(ACCESS_DESCRIPTION, method, ASN1_OBJECT),
+ASN1_SEQUENCE(ACCESS_DESCRIPTION)
+	ASN1_SIMPLE(ACCESS_DESCRIPTION, method, ASN1_OBJECT)
 	ASN1_SIMPLE(ACCESS_DESCRIPTION, location, GENERAL_NAME)
-} ASN1_SEQUENCE_END(ACCESS_DESCRIPTION)
+ASN1_SEQUENCE_END(ACCESS_DESCRIPTION)
 
-IMPLEMENT_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)
+IMPLEMENT_ASN1_FUNCTIONS3(ACCESS_DESCRIPTION)
 
-ASN1_ITEM_TEMPLATE(AUTHORITY_INFO_ACCESS) = 
+ASN1_ITEM_TEMPLATE(AUTHORITY_INFO_ACCESS)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, GeneralNames, ACCESS_DESCRIPTION)
 ASN1_ITEM_TEMPLATE_END(AUTHORITY_INFO_ACCESS)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)
+#endif
 
 static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method,
 				AUTHORITY_INFO_ACCESS *ainfo,
@@ -114,8 +120,8 @@
 		if(!ret) break;
 		vtmp = sk_CONF_VALUE_value(ret, i);
 		i2t_ASN1_OBJECT(objtmp, sizeof objtmp, desc->method);
-		nlen = strlen(objtmp) + strlen(vtmp->name) + 5;
-		ntmp = OPENSSL_malloc(nlen);
+		nlen = op_strlen(objtmp) + op_strlen(vtmp->name) + 5;
+		ntmp = (char *) OPENSSL_malloc(nlen);
 		if(!ntmp) {
 			X509V3err(X509V3_F_I2V_AUTHORITY_INFO_ACCESS,
 					ERR_R_MALLOC_FAILURE);
@@ -132,6 +138,7 @@
 	return ret;
 }
 
+#ifndef OPERA_SMALL_VERSION
 static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method,
 				 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
 {
@@ -151,7 +158,7 @@
 			X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS,ERR_R_MALLOC_FAILURE);
 			goto err;
 		}
-		ptmp = strchr(cnf->name, ';');
+		ptmp = op_strchr(cnf->name, ';');
 		if(!ptmp) {
 			X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS,X509V3_R_INVALID_SYNTAX);
 			goto err;
@@ -165,12 +172,14 @@
 			X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS,ERR_R_MALLOC_FAILURE);
 			goto err;
 		}
-		strncpy(objtmp, cnf->name, objlen);
+		op_strncpy(objtmp, cnf->name, objlen);
 		objtmp[objlen] = 0;
 		acc->method = OBJ_txt2obj(objtmp, 0);
 		if(!acc->method) {
 			X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS,X509V3_R_BAD_OBJECT);
+#ifndef OPERA_SMALL_VERSION
 			ERR_add_error_data(2, "value=", objtmp);
+#endif
 			OPENSSL_free(objtmp);
 			goto err;
 		}
@@ -191,3 +200,4 @@
 #endif
 	return 2;
 	}
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_int.c openssl-1.0.0q/crypto/x509v3/v3_int.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_int.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_int.c	2017-04-25 16:23:40.879798686 +0200
@@ -56,34 +56,39 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-const X509V3_EXT_METHOD v3_crl_num = { 
+CONST_X509V3_EXT_METHOD_item(v3_crl_num,
 	NID_crl_number, 0, ASN1_ITEM_ref(ASN1_INTEGER),
 	0,0,0,0,
 	(X509V3_EXT_I2S)i2s_ASN1_INTEGER,
 	0,
-	0,0,0,0, NULL};
+	0,0,0,0, NULL)
 
-const X509V3_EXT_METHOD v3_delta_crl = { 
+CONST_X509V3_EXT_METHOD_item(v3_delta_crl, 
 	NID_delta_crl, 0, ASN1_ITEM_ref(ASN1_INTEGER),
 	0,0,0,0,
 	(X509V3_EXT_I2S)i2s_ASN1_INTEGER,
 	0,
-	0,0,0,0, NULL};
+	0,0,0,0, NULL)
 
+#ifndef OPERA_SMALL_VERSION
 static void * s2i_asn1_int(X509V3_EXT_METHOD *meth, X509V3_CTX *ctx, char *value)
 	{
 	return s2i_ASN1_INTEGER(meth, value);
 	}
+#endif
 
-const X509V3_EXT_METHOD v3_inhibit_anyp = { 
+CONST_X509V3_EXT_METHOD_item(v3_inhibit_anyp,
 	NID_inhibit_any_policy, 0, ASN1_ITEM_ref(ASN1_INTEGER),
 	0,0,0,0,
 	(X509V3_EXT_I2S)i2s_ASN1_INTEGER,
-	(X509V3_EXT_S2I)s2i_asn1_int,
-	0,0,0,0, NULL};
+	OPERA_S2I_DECLARE((X509V3_EXT_S2I)s2i_asn1_int),
+	0,0,0,0, NULL)
 
 
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_lib.c openssl-1.0.0q/crypto/x509v3/v3_lib.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_lib.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_lib.c	2017-04-25 16:23:40.879798686 +0200
@@ -57,17 +57,27 @@
  */
 /* X509 v3 extension utilities */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
 
 #include "ext_dat.h"
 
+#ifndef OPERA_SMALL_VERSION
+#ifdef _NO_GLOBALS_
+extern STACK_OF(X509V3_EXT_METHOD) *g_ext_list_addr();
+#define ext_list (*g_ext_list_addr())
+#else
 static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL;
+#endif
+#endif
 
 static int ext_cmp(const X509V3_EXT_METHOD * const *a,
 		const X509V3_EXT_METHOD * const *b);
+#ifndef OPERA_SMALL_VERSION
 static void ext_list_free(X509V3_EXT_METHOD *ext);
 
 int X509V3_EXT_add(X509V3_EXT_METHOD *ext)
@@ -82,6 +92,7 @@
 	}
 	return 1;
 }
+#endif
 
 static int ext_cmp(const X509V3_EXT_METHOD * const *a,
 		   const X509V3_EXT_METHOD * const *b)
@@ -98,15 +109,22 @@
 {
 	X509V3_EXT_METHOD tmp;
 	const X509V3_EXT_METHOD *t = &tmp, * const *ret;
+#ifndef OPERA_SMALL_VERSION
 	int idx;
+#endif
 	if(nid < 0) return NULL;
 	tmp.ext_nid = nid;
 	ret = OBJ_bsearch_ext(&t, standard_exts, STANDARD_EXTENSION_COUNT);
 	if(ret) return *ret;
+#ifndef OPERA_SMALL_VERSION
 	if(!ext_list) return NULL;
 	idx = sk_X509V3_EXT_METHOD_find(ext_list, &tmp);
 	if(idx == -1) return NULL;
 	return sk_X509V3_EXT_METHOD_value(ext_list, idx);
+#else
+	return NULL;
+#endif
+
 }
 
 const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext)
@@ -117,6 +135,7 @@
 }
 
 
+#ifndef OPERA_SMALL_VERSION
 int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist)
 {
 	for(;extlist->ext_nid!=-1;extlist++) 
@@ -162,6 +181,7 @@
 {
 	return 1;
 }
+#endif
 
 /* Return an extension internal structure */
 
@@ -236,6 +256,7 @@
  * 'value' arguments (if relevant) are the extensions internal structure.
  */
 
+#if !defined OPERA_SMALL_VERSION || !defined OPENSSL_NO_OCSP
 int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value,
 					int crit, unsigned long flags)
 {
@@ -305,5 +326,6 @@
 		X509V3err(X509V3_F_X509V3_ADD1_I2D, errcode);
 	return 0;
 }
+#endif /* OPERA_SMALL_VERSION */
 
 IMPLEMENT_STACK_OF(X509V3_EXT_METHOD)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_ncons.c openssl-1.0.0q/crypto/x509v3/v3_ncons.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_ncons.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_ncons.c	2017-04-25 16:23:40.880798255 +0200
@@ -56,20 +56,21 @@
  *
  */
 
-
-#include <stdio.h>
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
+#ifndef OPERA_SMALL_VERSION
 static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method,
 				  X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
+#endif
 static int i2r_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, 
 				void *a, BIO *bp, int ind);
 static int do_i2r_name_constraints(const X509V3_EXT_METHOD *method,
 				   STACK_OF(GENERAL_SUBTREE) *trees,
-				   BIO *bp, int ind, char *name);
+				   BIO *bp, int ind, const char *name);
 static int print_nc_ipadd(BIO *bp, ASN1_OCTET_STRING *ip);
 
 static int nc_match(GENERAL_NAME *gen, NAME_CONSTRAINTS *nc);
@@ -79,33 +80,36 @@
 static int nc_email(ASN1_IA5STRING *sub, ASN1_IA5STRING *eml);
 static int nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base);
 
-const X509V3_EXT_METHOD v3_name_constraints = {
+CONST_X509V3_EXT_METHOD_item(v3_name_constraints,
 	NID_name_constraints, 0,
 	ASN1_ITEM_ref(NAME_CONSTRAINTS),
 	0,0,0,0,
 	0,0,
-	0, v2i_NAME_CONSTRAINTS,
+	0, OPERA_V2I_DECLARE(v2i_NAME_CONSTRAINTS),
 	i2r_NAME_CONSTRAINTS,0,
 	NULL
-};
+)
 
-ASN1_SEQUENCE(GENERAL_SUBTREE) = {
-	ASN1_SIMPLE(GENERAL_SUBTREE, base, GENERAL_NAME),
-	ASN1_IMP_OPT(GENERAL_SUBTREE, minimum, ASN1_INTEGER, 0),
+ASN1_SEQUENCE(GENERAL_SUBTREE) 
+	ASN1_SIMPLE(GENERAL_SUBTREE, base, GENERAL_NAME)
+	ASN1_IMP_OPT(GENERAL_SUBTREE, minimum, ASN1_INTEGER, 0)
 	ASN1_IMP_OPT(GENERAL_SUBTREE, maximum, ASN1_INTEGER, 1)
-} ASN1_SEQUENCE_END(GENERAL_SUBTREE)
+ASN1_SEQUENCE_END(GENERAL_SUBTREE)
 
-ASN1_SEQUENCE(NAME_CONSTRAINTS) = {
+ASN1_SEQUENCE(NAME_CONSTRAINTS) 
 	ASN1_IMP_SEQUENCE_OF_OPT(NAME_CONSTRAINTS, permittedSubtrees,
-							GENERAL_SUBTREE, 0),
+							GENERAL_SUBTREE, 0)
 	ASN1_IMP_SEQUENCE_OF_OPT(NAME_CONSTRAINTS, excludedSubtrees,
-							GENERAL_SUBTREE, 1),
-} ASN1_SEQUENCE_END(NAME_CONSTRAINTS)
+							GENERAL_SUBTREE, 1)
+ASN1_SEQUENCE_END(NAME_CONSTRAINTS)
 	
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE)
+#endif
 IMPLEMENT_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS)
 
+#ifndef OPERA_SMALL_VERSION
 static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method,
 				  X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
 	{
@@ -158,14 +162,13 @@
 
 	return NULL;
 	}
-			
-
+#endif
 	
 
 static int i2r_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, void *a,
 				BIO *bp, int ind)
 	{
-	NAME_CONSTRAINTS *ncons = a;
+	NAME_CONSTRAINTS *ncons = (NAME_CONSTRAINTS *) a;
 	do_i2r_name_constraints(method, ncons->permittedSubtrees,
 					bp, ind, "Permitted");
 	do_i2r_name_constraints(method, ncons->excludedSubtrees,
@@ -175,7 +178,7 @@
 
 static int do_i2r_name_constraints(const X509V3_EXT_METHOD *method,
 				   STACK_OF(GENERAL_SUBTREE) *trees,
-				   BIO *bp, int ind, char *name)
+				   BIO *bp, int ind, const char *name)
 	{
 	GENERAL_SUBTREE *tree;
 	int i;
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_ocsp.c openssl-1.0.0q/crypto/x509v3/v3_ocsp.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_ocsp.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_ocsp.c	2017-04-25 16:23:40.881798102 +0200
@@ -58,74 +58,81 @@
 
 #ifndef OPENSSL_NO_OCSP
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/asn1.h>
 #include <openssl/ocsp.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* OCSP extensions and a couple of CRL entry extensions
  */
 
+#ifndef OPERA_SMALL_VERSION
 static int i2r_ocsp_crlid(const X509V3_EXT_METHOD *method, void *nonce,
 			  BIO *out, int indent);
 static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *nonce,
 			    BIO *out, int indent);
 static int i2r_object(const X509V3_EXT_METHOD *method, void *obj, BIO *out,
 		      int indent);
+#endif // !OPERA_SMALL_VERSION
 
 static void *ocsp_nonce_new(void);
 static int i2d_ocsp_nonce(void *a, unsigned char **pp);
 static void *d2i_ocsp_nonce(void *a, const unsigned char **pp, long length);
 static void ocsp_nonce_free(void *a);
+
+#ifndef OPERA_SMALL_VERSION
 static int i2r_ocsp_nonce(const X509V3_EXT_METHOD *method, void *nonce,
 			  BIO *out, int indent);
-
 static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method,
 			    void *nocheck, BIO *out, int indent);
 static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
 			      const char *str);
 static int i2r_ocsp_serviceloc(const X509V3_EXT_METHOD *method, void *in,
 			       BIO *bp, int ind);
+#endif // !OPERA_SMALL_VERSION
 
-const X509V3_EXT_METHOD v3_ocsp_crlid = {
+CONST_X509V3_EXT_METHOD_item(v3_ocsp_crlid,
 	NID_id_pkix_OCSP_CrlID, 0, ASN1_ITEM_ref(OCSP_CRLID),
 	0,0,0,0,
 	0,0,
 	0,0,
-	i2r_ocsp_crlid,0,
+	OPERA_I2R_DECLARE(i2r_ocsp_crlid),0,
 	NULL
-};
+)
 
-const X509V3_EXT_METHOD v3_ocsp_acutoff = {
+CONST_X509V3_EXT_METHOD_item(v3_ocsp_acutoff,
 	NID_id_pkix_OCSP_archiveCutoff, 0, ASN1_ITEM_ref(ASN1_GENERALIZEDTIME),
 	0,0,0,0,
 	0,0,
 	0,0,
-	i2r_ocsp_acutoff,0,
+	OPERA_I2R_DECLARE(i2r_ocsp_acutoff),0,
 	NULL
-};
+)
 
-const X509V3_EXT_METHOD v3_crl_invdate = {
+CONST_X509V3_EXT_METHOD_item(v3_crl_invdate,
 	NID_invalidity_date, 0, ASN1_ITEM_ref(ASN1_GENERALIZEDTIME),
 	0,0,0,0,
 	0,0,
 	0,0,
-	i2r_ocsp_acutoff,0,
+	OPERA_I2R_DECLARE(i2r_ocsp_acutoff),0,
 	NULL
-};
+)
 
-const X509V3_EXT_METHOD v3_crl_hold = {
+CONST_X509V3_EXT_METHOD_item(v3_crl_hold,
 	NID_hold_instruction_code, 0, ASN1_ITEM_ref(ASN1_OBJECT),
 	0,0,0,0,
 	0,0,
 	0,0,
-	i2r_object,0,
+	OPERA_I2R_DECLARE(i2r_object),0,
 	NULL
-};
+)
 
-const X509V3_EXT_METHOD v3_ocsp_nonce = {
+CONST_X509V3_EXT_METHOD_item(v3_ocsp_nonce,
 	NID_id_pkix_OCSP_Nonce, 0, NULL,
 	ocsp_nonce_new,
 	ocsp_nonce_free,
@@ -133,32 +140,33 @@
 	i2d_ocsp_nonce,
 	0,0,
 	0,0,
-	i2r_ocsp_nonce,0,
+	OPERA_I2R_DECLARE(i2r_ocsp_nonce),0,
 	NULL
-};
+)
 
-const X509V3_EXT_METHOD v3_ocsp_nocheck = {
+CONST_X509V3_EXT_METHOD_item(v3_ocsp_nocheck ,
 	NID_id_pkix_OCSP_noCheck, 0, ASN1_ITEM_ref(ASN1_NULL),
 	0,0,0,0,
-	0,s2i_ocsp_nocheck,
+	0,OPERA_S2I_DECLARE(s2i_ocsp_nocheck),
 	0,0,
-	i2r_ocsp_nocheck,0,
+	OPERA_I2R_DECLARE(i2r_ocsp_nocheck),0,
 	NULL
-};
+)
 
-const X509V3_EXT_METHOD v3_ocsp_serviceloc = {
+CONST_X509V3_EXT_METHOD_item(v3_ocsp_serviceloc,
 	NID_id_pkix_OCSP_serviceLocator, 0, ASN1_ITEM_ref(OCSP_SERVICELOC),
 	0,0,0,0,
 	0,0,
 	0,0,
-	i2r_ocsp_serviceloc,0,
+	OPERA_I2R_DECLARE(i2r_ocsp_serviceloc),0,
 	NULL
-};
+)
 
+#ifndef OPERA_SMALL_VERSION
 static int i2r_ocsp_crlid(const X509V3_EXT_METHOD *method, void *in, BIO *bp,
 			  int ind)
 {
-	OCSP_CRLID *a = in;
+	OCSP_CRLID *a = (OCSP_CRLID *) in;
 	if (a->crlUrl)
 	        {
 		if (BIO_printf(bp, "%*scrlUrl: ", ind, "") <= 0) goto err;
@@ -198,6 +206,7 @@
 	if(i2a_ASN1_OBJECT(bp, oid) <= 0) return 0;
 	return 1;
 }
+#endif
 
 /* OCSP nonce. This is needs special treatment because it doesn't have
  * an ASN1 encoding at all: it just contains arbitrary data.
@@ -210,9 +219,9 @@
 
 static int i2d_ocsp_nonce(void *a, unsigned char **pp)
 {
-	ASN1_OCTET_STRING *os = a;
+	ASN1_OCTET_STRING *os = (ASN1_OCTET_STRING *) a;
 	if(pp) {
-		memcpy(*pp, os->data, os->length);
+		op_memcpy(*pp, os->data, os->length);
 		*pp += os->length;
 	}
 	return os->length;
@@ -221,7 +230,7 @@
 static void *d2i_ocsp_nonce(void *a, const unsigned char **pp, long length)
 {
 	ASN1_OCTET_STRING *os, **pos;
-	pos = a;
+	pos = (ASN1_OCTET_STRING **) a;
 	if(!pos || !*pos) os = ASN1_OCTET_STRING_new();
 	else os = *pos;
 	if(!ASN1_OCTET_STRING_set(os, *pp, length)) goto err;
@@ -242,11 +251,12 @@
 	M_ASN1_OCTET_STRING_free(a);
 }
 
+#ifndef OPERA_SMALL_VERSION
 static int i2r_ocsp_nonce(const X509V3_EXT_METHOD *method, void *nonce,
 			  BIO *out, int indent)
 {
 	if(BIO_printf(out, "%*s", indent, "") <= 0) return 0;
-	if(i2a_ASN1_STRING(out, nonce, V_ASN1_OCTET_STRING) <= 0) return 0;
+	if(i2a_ASN1_STRING(out, (ASN1_OCTET_STRING *) nonce, V_ASN1_OCTET_STRING) <= 0) return 0;
 	return 1;
 }
 
@@ -268,7 +278,7 @@
 			       BIO *bp, int ind)
         {
 	int i;
-	OCSP_SERVICELOC *a = in;
+	OCSP_SERVICELOC *a = (OCSP_SERVICELOC *) in;
 	ACCESS_DESCRIPTION *ad;
 
         if (BIO_printf(bp, "%*sIssuer: ", ind, "") <= 0) goto err;
@@ -286,4 +296,6 @@
 err:
 	return 0;
 	}
+#endif // OPERA_SMALL_VERSION
+
 #endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_pci.c openssl-1.0.0q/crypto/x509v3/v3_pci.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_pci.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_pci.c	2017-04-25 16:23:40.882797671 +0200
@@ -34,26 +34,29 @@
  * SUCH DAMAGE.
  */
 
-#include <stdio.h>
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
+#ifndef OPERA_SMALL_VERSION
 static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext,
 	BIO *out, int indent);
 static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method,
 	X509V3_CTX *ctx, char *str);
+#endif
 
-const X509V3_EXT_METHOD v3_pci =
-	{ NID_proxyCertInfo, 0, ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION),
+CONST_X509V3_EXT_METHOD_item(v3_pci,
+	 NID_proxyCertInfo, 0, ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION),
 	  0,0,0,0,
 	  0,0,
 	  NULL, NULL,
-	  (X509V3_EXT_I2R)i2r_pci,
-	  (X509V3_EXT_R2I)r2i_pci,
-	  NULL,
-	};
+	  OPERA_I2R_DECLARE((X509V3_EXT_I2R)i2r_pci),
+	  OPERA_R2I_DECLARE((X509V3_EXT_R2I)r2i_pci),
+	  NULL
+	  )
 
+#ifndef OPERA_SMALL_VERSION
 static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *pci,
 	BIO *out, int indent)
 	{
@@ -78,7 +81,7 @@
 	{
 	int free_policy = 0;
 
-	if (strcmp(val->name, "language") == 0)
+	if (op_strcmp(val->name, "language") == 0)
 		{
 		if (*language)
 			{
@@ -93,7 +96,7 @@
 			return 0;
 			}
 		}
-	else if (strcmp(val->name, "pathlen") == 0)
+	else if (op_strcmp(val->name, "pathlen") == 0)
 		{
 		if (*pathlen)
 			{
@@ -108,7 +111,7 @@
 			return 0;
 			}
 		}
-	else if (strcmp(val->name, "policy") == 0)
+	else if (op_strcmp(val->name, "policy") == 0)
 		{
 		unsigned char *tmp_data = NULL;
 		long val_len;
@@ -123,7 +126,7 @@
 				}
 			free_policy = 1;
 			}
-		if (strncmp(val->value, "hex:", 4) == 0)
+		if (op_strncmp(val->value, "hex:", 4) == 0)
 			{
 			unsigned char *tmp_data2 =
 				string_to_hex(val->value + 4, &val_len);
@@ -135,12 +138,12 @@
 				goto err;
 				}
 
-			tmp_data = OPENSSL_realloc((*policy)->data,
+			tmp_data = (unsigned char *) OPENSSL_realloc((*policy)->data,
 				(*policy)->length + val_len + 1);
 			if (tmp_data)
 				{
 				(*policy)->data = tmp_data;
-				memcpy(&(*policy)->data[(*policy)->length],
+				op_memcpy(&(*policy)->data[(*policy)->length],
 					tmp_data2, val_len);
 				(*policy)->length += val_len;
 				(*policy)->data[(*policy)->length] = '\0';
@@ -157,9 +160,10 @@
 				}
 			OPENSSL_free(tmp_data2);
 			}
+#ifndef OPERA_SMALL_VERSION
 		else if (strncmp(val->value, "file:", 5) == 0)
 			{
-			unsigned char buf[2048];
+			unsigned char buf[2048];  /* ARRAY OK 2007-11-07 yngve UNUSED */
 			int n;
 			BIO *b = BIO_new_file(val->value + 5, "r");
 			if (!b)
@@ -180,7 +184,7 @@
 					break;
 
 				(*policy)->data = tmp_data;
-				memcpy(&(*policy)->data[(*policy)->length],
+				op_memcpy(&(*policy)->data[(*policy)->length],
 					buf, n);
 				(*policy)->length += n;
 				(*policy)->data[(*policy)->length] = '\0';
@@ -194,15 +198,16 @@
 				goto err;
 				}
 			}
-		else if (strncmp(val->value, "text:", 5) == 0)
+#endif // !OPERA_SMALL_VERSION
+		else if (op_strncmp(val->value, "text:", 5) == 0)
 			{
-			val_len = strlen(val->value + 5);
-			tmp_data = OPENSSL_realloc((*policy)->data,
+			val_len = op_strlen(val->value + 5);
+			tmp_data = (unsigned char *) OPENSSL_realloc((*policy)->data,
 				(*policy)->length + val_len + 1);
 			if (tmp_data)
 				{
 				(*policy)->data = tmp_data;
-				memcpy(&(*policy)->data[(*policy)->length],
+				op_memcpy(&(*policy)->data[(*policy)->length],
 					val->value + 5, val_len);
 				(*policy)->length += val_len;
 				(*policy)->data[(*policy)->length] = '\0';
@@ -326,3 +331,4 @@
 	sk_CONF_VALUE_pop_free(vals, X509V3_conf_free);
 	return pci;
 	}
+#endif // !OPERA_SMALL_VERSION
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_pcia.c openssl-1.0.0q/crypto/x509v3/v3_pcia.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_pcia.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_pcia.c	2017-04-25 16:23:40.883797519 +0200
@@ -37,19 +37,20 @@
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
-ASN1_SEQUENCE(PROXY_POLICY) =
-	{
-	ASN1_SIMPLE(PROXY_POLICY,policyLanguage,ASN1_OBJECT),
+ASN1_SEQUENCE(PROXY_POLICY) 
+	ASN1_SIMPLE(PROXY_POLICY,policyLanguage,ASN1_OBJECT)
 	ASN1_OPT(PROXY_POLICY,policy,ASN1_OCTET_STRING)
-} ASN1_SEQUENCE_END(PROXY_POLICY)
+ASN1_SEQUENCE_END(PROXY_POLICY)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(PROXY_POLICY)
+#endif
 
-ASN1_SEQUENCE(PROXY_CERT_INFO_EXTENSION) =
-	{
-	ASN1_OPT(PROXY_CERT_INFO_EXTENSION,pcPathLengthConstraint,ASN1_INTEGER),
+ASN1_SEQUENCE(PROXY_CERT_INFO_EXTENSION) 
+	ASN1_OPT(PROXY_CERT_INFO_EXTENSION,pcPathLengthConstraint,ASN1_INTEGER)
 	ASN1_SIMPLE(PROXY_CERT_INFO_EXTENSION,proxyPolicy,PROXY_POLICY)
-} ASN1_SEQUENCE_END(PROXY_CERT_INFO_EXTENSION)
+ASN1_SEQUENCE_END(PROXY_CERT_INFO_EXTENSION)
 
-IMPLEMENT_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
+IMPLEMENT_ASN1_FUNCTIONS32(PROXY_CERT_INFO_EXTENSION)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_pcons.c openssl-1.0.0q/crypto/x509v3/v3_pcons.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_pcons.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_pcons.c	2017-04-25 16:23:40.883797519 +0200
@@ -56,45 +56,49 @@
  *
  */
 
-
-#include <stdio.h>
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static STACK_OF(CONF_VALUE) *
 i2v_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method, void *bcons,
 		       STACK_OF(CONF_VALUE) *extlist);
+
+#ifndef OPERA_SMALL_VERSION
 static void *v2i_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method,
 				    X509V3_CTX *ctx,
 				    STACK_OF(CONF_VALUE) *values);
+#endif // !OPERA_SMALL_VERSION
 
-const X509V3_EXT_METHOD v3_policy_constraints = {
+CONST_X509V3_EXT_METHOD_item(v3_policy_constraints ,
 NID_policy_constraints, 0,
 ASN1_ITEM_ref(POLICY_CONSTRAINTS),
 0,0,0,0,
 0,0,
 i2v_POLICY_CONSTRAINTS,
-v2i_POLICY_CONSTRAINTS,
+OPERA_V2I_DECLARE(v2i_POLICY_CONSTRAINTS),
 NULL,NULL,
 NULL
-};
+)
 
-ASN1_SEQUENCE(POLICY_CONSTRAINTS) = {
-	ASN1_IMP_OPT(POLICY_CONSTRAINTS, requireExplicitPolicy, ASN1_INTEGER,0),
+ASN1_SEQUENCE(POLICY_CONSTRAINTS) 
+	ASN1_IMP_OPT(POLICY_CONSTRAINTS, requireExplicitPolicy, ASN1_INTEGER,0)
 	ASN1_IMP_OPT(POLICY_CONSTRAINTS, inhibitPolicyMapping, ASN1_INTEGER,1)
-} ASN1_SEQUENCE_END(POLICY_CONSTRAINTS)
+ASN1_SEQUENCE_END(POLICY_CONSTRAINTS)
 
-IMPLEMENT_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS)
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
+IMPLEMENT_ASN1_ALLOC_FUNCTIONS2(POLICY_CONSTRAINTS)
+#endif
 
 
 static STACK_OF(CONF_VALUE) *
 i2v_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method, void *a,
 		       STACK_OF(CONF_VALUE) *extlist)
 {
-	POLICY_CONSTRAINTS *pcons = a;
+	POLICY_CONSTRAINTS *pcons = (POLICY_CONSTRAINTS *) a;
 	X509V3_add_value_int("Require Explicit Policy",
 			pcons->requireExplicitPolicy, &extlist);
 	X509V3_add_value_int("Inhibit Policy Mapping",
@@ -102,6 +106,7 @@
 	return extlist;
 }
 
+#ifndef OPERA_SMALL_VERSION
 static void *v2i_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method,
 				    X509V3_CTX *ctx,
 				    STACK_OF(CONF_VALUE) *values)
@@ -137,4 +142,5 @@
 	POLICY_CONSTRAINTS_free(pcons);
 	return NULL;
 }
+#endif
 
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_pku.c openssl-1.0.0q/crypto/x509v3/v3_pku.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_pku.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_pku.c	2017-04-25 16:23:40.884798763 +0200
@@ -56,30 +56,35 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, PKEY_USAGE_PERIOD *usage, BIO *out, int indent);
 /*
 static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values);
 */
-const X509V3_EXT_METHOD v3_pkey_usage_period = {
+CONST_X509V3_EXT_METHOD_item(v3_pkey_usage_period,
 NID_private_key_usage_period, 0, ASN1_ITEM_ref(PKEY_USAGE_PERIOD),
 0,0,0,0,
 0,0,0,0,
 (X509V3_EXT_I2R)i2r_PKEY_USAGE_PERIOD, NULL,
 NULL
-};
+)
 
-ASN1_SEQUENCE(PKEY_USAGE_PERIOD) = {
-	ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notBefore, ASN1_GENERALIZEDTIME, 0),
+ASN1_SEQUENCE(PKEY_USAGE_PERIOD) 
+	ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notBefore, ASN1_GENERALIZEDTIME, 0)
 	ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notAfter, ASN1_GENERALIZEDTIME, 1)
-} ASN1_SEQUENCE_END(PKEY_USAGE_PERIOD)
+ASN1_SEQUENCE_END(PKEY_USAGE_PERIOD)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)
+#endif
 
 static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
 	     PKEY_USAGE_PERIOD *usage, BIO *out, int indent)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_pmaps.c openssl-1.0.0q/crypto/x509v3/v3_pmaps.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_pmaps.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_pmaps.c	2017-04-25 16:23:40.885798611 +0200
@@ -56,52 +56,56 @@
  *
  */
 
-
-#include <stdio.h>
-#include "cryptlib.h"
+#include <openssl/cryptlib.h>
 #include <openssl/asn1t.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
+#ifndef OPERA_SMALL_VERSION
 static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method,
 				 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
+#endif // !OPERA_SMALL_VERSION
+
 static STACK_OF(CONF_VALUE) *
 i2v_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, void *pmps,
 		    STACK_OF(CONF_VALUE) *extlist);
 
-const X509V3_EXT_METHOD v3_policy_mappings = {
+CONST_X509V3_EXT_METHOD_item(v3_policy_mappings ,
 	NID_policy_mappings, 0,
 	ASN1_ITEM_ref(POLICY_MAPPINGS),
 	0,0,0,0,
 	0,0,
 	i2v_POLICY_MAPPINGS,
-	v2i_POLICY_MAPPINGS,
+	OPERA_V2I_DECLARE(v2i_POLICY_MAPPINGS),
 	0,0,
 	NULL
-};
+)
 
-ASN1_SEQUENCE(POLICY_MAPPING) = {
-	ASN1_SIMPLE(POLICY_MAPPING, issuerDomainPolicy, ASN1_OBJECT),
+ASN1_SEQUENCE(POLICY_MAPPING) 
+	ASN1_SIMPLE(POLICY_MAPPING, issuerDomainPolicy, ASN1_OBJECT)
 	ASN1_SIMPLE(POLICY_MAPPING, subjectDomainPolicy, ASN1_OBJECT)
-} ASN1_SEQUENCE_END(POLICY_MAPPING)
+ASN1_SEQUENCE_END(POLICY_MAPPING)
 
-ASN1_ITEM_TEMPLATE(POLICY_MAPPINGS) = 
+ASN1_ITEM_TEMPLATE(POLICY_MAPPINGS)
 	ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, POLICY_MAPPINGS,
 								POLICY_MAPPING)
 ASN1_ITEM_TEMPLATE_END(POLICY_MAPPINGS)
 
-IMPLEMENT_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING)
+#if !defined OPERA_SMALL_VERSION || defined OPERA_NEED_POLICY_FUN
+IMPLEMENT_ASN1_ALLOC_FUNCTIONS2(POLICY_MAPPING)
+#endif
 
 
 static STACK_OF(CONF_VALUE) *
 i2v_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, void *a,
 		    STACK_OF(CONF_VALUE) *ext_list)
 {
-	POLICY_MAPPINGS *pmaps = a;
+	POLICY_MAPPINGS *pmaps = (POLICY_MAPPINGS *) a;
 	POLICY_MAPPING *pmap;
 	int i;
-	char obj_tmp1[80];
-	char obj_tmp2[80];
+	char obj_tmp1[80]; /* ARRAY OK 2009-05-25 yngve */
+	char obj_tmp2[80]; /* ARRAY OK 2009-05-25 yngve */
 	for(i = 0; i < sk_POLICY_MAPPING_num(pmaps); i++) {
 		pmap = sk_POLICY_MAPPING_value(pmaps, i);
 		i2t_ASN1_OBJECT(obj_tmp1, 80, pmap->issuerDomainPolicy);
@@ -111,6 +115,7 @@
 	return ext_list;
 }
 
+#ifndef OPERA_SMALL_VERSION
 static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method,
 				 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
 {
@@ -153,3 +158,4 @@
 	}
 	return pmaps;
 }
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_prn.c openssl-1.0.0q/crypto/x509v3/v3_prn.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_prn.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_prn.c	2017-04-25 16:23:40.885798611 +0200
@@ -57,8 +57,10 @@
  */
 /* X509 v3 extension utilities */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
 
@@ -89,7 +91,7 @@
 		else {
 			int len;
 			char *tmp;
-			len = strlen(nval->value)+1;
+			len = op_strlen(nval->value)+1;
 			tmp = OPENSSL_malloc(len);
 			if (tmp)
 			{
@@ -133,7 +135,7 @@
 		{
 			int len;
 			char *tmp;
-			len = strlen(value)+1;
+			len = op_strlen(value)+1;
 			tmp = OPENSSL_malloc(len);
 			if (tmp)
 			{
@@ -157,11 +159,12 @@
 	err:
 		sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
 		if(value) OPENSSL_free(value);
-		if(method->it) ASN1_item_free(ext_str, ASN1_ITEM_ptr(method->it));
+		if(method->it) ASN1_item_free((ASN1_VALUE *) ext_str, ASN1_ITEM_ptr(method->it));
 		else method->ext_free(ext_str);
 		return ok;
 }
 
+#ifndef OPERA_SMALL_VERSION
 int X509V3_extensions_print(BIO *bp, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent)
 {
 	int i, j;
@@ -194,6 +197,7 @@
 		}
 	return 1;
 }
+#endif
 
 static int unknown_ext_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent, int supported)
 {
@@ -201,6 +205,7 @@
 
 		case X509V3_EXT_DEFAULT:
 		return 0;
+#ifndef OPERA_SMALL_VERSION
 
 		case X509V3_EXT_ERROR_UNKNOWN:
 		if(supported)
@@ -214,6 +219,7 @@
 				ext->value->data, ext->value->length, indent, -1);
 		case X509V3_EXT_DUMP_UNKNOWN:
 			return BIO_dump_indent(out, (char *)ext->value->data, ext->value->length, indent);
+#endif
 
 		default:
 		return 1;
@@ -221,6 +227,7 @@
 }
 	
 
+#ifndef OPERA_SMALL_VERSION
 #ifndef OPENSSL_NO_FP_API
 int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent)
 {
@@ -232,3 +239,4 @@
 	return ret;
 }
 #endif
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_purp.c openssl-1.0.0q/crypto/x509v3/v3_purp.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_purp.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_purp.c	2017-04-25 16:23:40.887798865 +0200
@@ -56,10 +56,13 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/x509v3.h>
 #include <openssl/x509_vfy.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 static void x509v3_cache_extensions(X509 *x);
 
@@ -73,29 +76,46 @@
 static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca);
 static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x, int ca);
 static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca);
+#ifndef OPENSSL_NO_OCSP
 static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca);
+#endif
 
 static int xp_cmp(const X509_PURPOSE * const *a,
 		const X509_PURPOSE * const *b);
 static void xptable_free(X509_PURPOSE *p);
 
-static X509_PURPOSE xstandard[] = {
-	{X509_PURPOSE_SSL_CLIENT, X509_TRUST_SSL_CLIENT, 0, check_purpose_ssl_client, "SSL client", "sslclient", NULL},
-	{X509_PURPOSE_SSL_SERVER, X509_TRUST_SSL_SERVER, 0, check_purpose_ssl_server, "SSL server", "sslserver", NULL},
-	{X509_PURPOSE_NS_SSL_SERVER, X509_TRUST_SSL_SERVER, 0, check_purpose_ns_ssl_server, "Netscape SSL server", "nssslserver", NULL},
-	{X509_PURPOSE_SMIME_SIGN, X509_TRUST_EMAIL, 0, check_purpose_smime_sign, "S/MIME signing", "smimesign", NULL},
-	{X509_PURPOSE_SMIME_ENCRYPT, X509_TRUST_EMAIL, 0, check_purpose_smime_encrypt, "S/MIME encryption", "smimeencrypt", NULL},
-	{X509_PURPOSE_CRL_SIGN, X509_TRUST_COMPAT, 0, check_purpose_crl_sign, "CRL signing", "crlsign", NULL},
-	{X509_PURPOSE_ANY, X509_TRUST_DEFAULT, 0, no_check, "Any Purpose", "any", NULL},
-	{X509_PURPOSE_OCSP_HELPER, X509_TRUST_COMPAT, 0, ocsp_helper, "OCSP helper", "ocsphelper", NULL},
-	{X509_PURPOSE_TIMESTAMP_SIGN, X509_TRUST_TSA, 0, check_purpose_timestamp_sign, "Time Stamp signing", "timestampsign", NULL},
-};
+#define CONST_X509_PURPOSE_ENTRY(purp, trst, _flags, ch_purp, _lname, _sname, _usr_data) \
+	CONST_ENTRY_START(purpose,purp)\
+	CONST_ENTRY_SINGLE(trust,trst)\
+	CONST_ENTRY_SINGLE(flags,_flags)\
+	CONST_ENTRY_SINGLE(check_purpose,ch_purp)\
+	CONST_ENTRY_SINGLE(name,_lname)\
+	CONST_ENTRY_SINGLE(sname,_sname)\
+	CONST_ENTRY_SINGLE(usr_data,_usr_data)\
+	CONST_ENTRY_END
+
+OPENSSL_PREFIX_CONST_ARRAY(static, X509_PURPOSE, xstandard, libopeay)
+	CONST_X509_PURPOSE_ENTRY(X509_PURPOSE_SSL_CLIENT, X509_TRUST_SSL_CLIENT, 0, check_purpose_ssl_client, "SSL client", "sslclient", NULL)
+	CONST_X509_PURPOSE_ENTRY(X509_PURPOSE_SSL_SERVER, X509_TRUST_SSL_SERVER, 0, check_purpose_ssl_server, "SSL server", "sslserver", NULL)
+	CONST_X509_PURPOSE_ENTRY(X509_PURPOSE_NS_SSL_SERVER, X509_TRUST_SSL_SERVER, 0, check_purpose_ns_ssl_server, "Netscape SSL server", "nssslserver", NULL)
+	CONST_X509_PURPOSE_ENTRY(X509_PURPOSE_SMIME_SIGN, X509_TRUST_EMAIL, 0, check_purpose_smime_sign, "S/MIME signing", "smimesign", NULL)
+	CONST_X509_PURPOSE_ENTRY(X509_PURPOSE_SMIME_ENCRYPT, X509_TRUST_EMAIL, 0, check_purpose_smime_encrypt, "S/MIME encryption", "smimeencrypt", NULL)
+	CONST_X509_PURPOSE_ENTRY(X509_PURPOSE_CRL_SIGN, X509_TRUST_COMPAT, 0, check_purpose_crl_sign, "CRL signing", "crlsign", NULL)
+	CONST_X509_PURPOSE_ENTRY(X509_PURPOSE_ANY, X509_TRUST_DEFAULT, 0, no_check, "Any Purpose", "any", NULL)
+	CONST_X509_PURPOSE_ENTRY(X509_PURPOSE_OCSP_HELPER, X509_TRUST_COMPAT, 0, ocsp_helper, "OCSP helper", "ocsphelper", NULL)
+	CONST_X509_PURPOSE_ENTRY(X509_PURPOSE_TIMESTAMP_SIGN, X509_TRUST_TSA, 0, check_purpose_timestamp_sign, "Time Stamp signing", "timestampsign", NULL)
+CONST_END(xstandard)
 
-#define X509_PURPOSE_COUNT (sizeof(xstandard)/sizeof(X509_PURPOSE))
+#define X509_PURPOSE_COUNT OPENSSL_CONST_ARRAY_SIZE(xstandard)
 
 IMPLEMENT_STACK_OF(X509_PURPOSE)
 
+#ifdef OPERA_SMALL_VERSION
+OPENSSL_IMPLEMENT_GLOBAL(STACK_OF(X509_PURPOSE) *, xptable);
+#define xptable OPENSSL_GLOBAL_REF(xptable)
+#else
 static STACK_OF(X509_PURPOSE) *xptable = NULL;
+#endif
 
 static int xp_cmp(const X509_PURPOSE * const *a,
 		const X509_PURPOSE * const *b)
@@ -132,6 +152,7 @@
 	return 1;
 }
 
+
 int X509_PURPOSE_get_count(void)
 {
 	if(!xptable) return X509_PURPOSE_COUNT;
@@ -141,17 +162,18 @@
 X509_PURPOSE * X509_PURPOSE_get0(int idx)
 {
 	if(idx < 0) return NULL;
-	if(idx < (int)X509_PURPOSE_COUNT) return xstandard + idx;
+	if(idx < (int) X509_PURPOSE_COUNT) return (X509_PURPOSE *)OPENSSL_GLOBAL_ARRAY_NAME(xstandard) + idx;
 	return sk_X509_PURPOSE_value(xptable, idx - X509_PURPOSE_COUNT);
 }
 
+
 int X509_PURPOSE_get_by_sname(char *sname)
 {
 	int i;
-	X509_PURPOSE *xptmp;
+	const X509_PURPOSE *xptmp;
 	for(i = 0; i < X509_PURPOSE_get_count(); i++) {
 		xptmp = X509_PURPOSE_get0(i);
-		if(!strcmp(xptmp->sname, sname)) return i;
+		if(!op_strcmp(xptmp->sname, sname)) return i;
 	}
 	return -1;
 }
@@ -171,10 +193,10 @@
 
 int X509_PURPOSE_add(int id, int trust, int flags,
 			int (*ck)(const X509_PURPOSE *, const X509 *, int),
-					char *name, char *sname, void *arg)
+					const char *name, const char *sname, void *arg)
 {
 	int idx;
-	X509_PURPOSE *ptmp;
+	X509_PURPOSE *ptmp, *ptmp_alloc = NULL;
 	/* This is set according to what we change: application can't set it */
 	flags &= ~X509_PURPOSE_DYNAMIC;
 	/* This will always be set for application modified trust entries */
@@ -183,23 +205,29 @@
 	idx = X509_PURPOSE_get_by_id(id);
 	/* Need a new entry */
 	if(idx == -1) {
-		if(!(ptmp = OPENSSL_malloc(sizeof(X509_PURPOSE)))) {
+		if(!(ptmp_alloc = ptmp = (X509_PURPOSE *) OPENSSL_malloc(sizeof(X509_PURPOSE)))) {
 			X509V3err(X509V3_F_X509_PURPOSE_ADD,ERR_R_MALLOC_FAILURE);
 			return 0;
 		}
 		ptmp->flags = X509_PURPOSE_DYNAMIC;
-	} else ptmp = X509_PURPOSE_get0(idx);
+	} else ptmp = (X509_PURPOSE *) X509_PURPOSE_get0(idx);
 
 	/* OPENSSL_free existing name if dynamic */
 	if(ptmp->flags & X509_PURPOSE_DYNAMIC_NAME) {
-		OPENSSL_free(ptmp->name);
-		OPENSSL_free(ptmp->sname);
+		OPENSSL_free((char *) ptmp->name); /* Conversion of pointer to allocated memory */
+		OPENSSL_free((char *) ptmp->sname); /* Conversion of pointer to allocated memory */
 	}
 	/* dup supplied name */
 	ptmp->name = BUF_strdup(name);
 	ptmp->sname = BUF_strdup(sname);
 	if(!ptmp->name || !ptmp->sname) {
 		X509V3err(X509V3_F_X509_PURPOSE_ADD,ERR_R_MALLOC_FAILURE);
+		if(ptmp_alloc)
+		{
+			OPENSSL_free((char *) ptmp->name);
+			OPENSSL_free((char *) ptmp->sname);
+			OPENSSL_free(ptmp_alloc);
+		}
 		return 0;
 	}
 	/* Keep the dynamic flag of existing entry */
@@ -216,10 +244,22 @@
 	if(idx == -1) {
 		if(!xptable && !(xptable = sk_X509_PURPOSE_new(xp_cmp))) {
 			X509V3err(X509V3_F_X509_PURPOSE_ADD,ERR_R_MALLOC_FAILURE);
+			if(ptmp_alloc)
+			{
+				OPENSSL_free((char *) ptmp->name);
+				OPENSSL_free((char *) ptmp->sname);
+				OPENSSL_free(ptmp_alloc);
+			}
 			return 0;
 		}
 		if (!sk_X509_PURPOSE_push(xptable, ptmp)) {
 			X509V3err(X509V3_F_X509_PURPOSE_ADD,ERR_R_MALLOC_FAILURE);
+			if(ptmp_alloc)
+			{
+				OPENSSL_free((char *) ptmp->name);
+				OPENSSL_free((char *) ptmp->sname);
+				OPENSSL_free(ptmp_alloc);
+			}
 			return 0;
 		}
 	}
@@ -232,8 +272,8 @@
 	if (p->flags & X509_PURPOSE_DYNAMIC) 
 		{
 		if (p->flags & X509_PURPOSE_DYNAMIC_NAME) {
-			OPENSSL_free(p->name);
-			OPENSSL_free(p->sname);
+			OPENSSL_free((char *) p->name);/* Conversion of pointer to allocated memory */
+			OPENSSL_free((char *) p->sname);/* Conversion of pointer to allocated memory */
 		}
 		OPENSSL_free(p);
 		}
@@ -243,10 +283,11 @@
 {
 	unsigned int i;
 	sk_X509_PURPOSE_pop_free(xptable, xptable_free);
-	for(i = 0; i < X509_PURPOSE_COUNT; i++) xptable_free(xstandard + i);
+	for(i = 0; i < (unsigned int) X509_PURPOSE_COUNT; i++) xptable_free((X509_PURPOSE *) OPENSSL_GLOBAL_ARRAY_NAME(xstandard) + i);
 	xptable = NULL;
 }
 
+#ifndef OPERA_SMALL_VERSION
 int X509_PURPOSE_get_id(X509_PURPOSE *xp)
 {
 	return xp->purpose;
@@ -266,6 +307,7 @@
 {
 	return xp->trust;
 }
+#endif // !OPERA_SMALL_VERSION
 
 static int nid_cmp(const int *a, const int *b)
 	{
@@ -349,7 +391,7 @@
 static void setup_crldp(X509 *x)
 	{
 	int i;
-	x->crldp = X509_get_ext_d2i(x, NID_crl_distribution_points, NULL, NULL);
+	x->crldp = (STACK_OF(DIST_POINT) *)X509_get_ext_d2i(x, NID_crl_distribution_points, NULL, NULL);
 	for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++)
 		setup_dp(x, sk_DIST_POINT_value(x->crldp, i));
 	}
@@ -374,7 +416,7 @@
 	/* V1 should mean no extensions ... */
 	if(!X509_get_version(x)) x->ex_flags |= EXFLAG_V1;
 	/* Handle basic constraints */
-	if((bs=X509_get_ext_d2i(x, NID_basic_constraints, NULL, NULL))) {
+	if((bs= (BASIC_CONSTRAINTS *) X509_get_ext_d2i(x, NID_basic_constraints, NULL, NULL))) {
 		if(bs->ca) x->ex_flags |= EXFLAG_CA;
 		if(bs->pathlen) {
 			if((bs->pathlen->type == V_ASN1_NEG_INTEGER)
@@ -387,7 +429,7 @@
 		x->ex_flags |= EXFLAG_BCONS;
 	}
 	/* Handle proxy certificates */
-	if((pci=X509_get_ext_d2i(x, NID_proxyCertInfo, NULL, NULL))) {
+	if((pci= (PROXY_CERT_INFO_EXTENSION *) X509_get_ext_d2i(x, NID_proxyCertInfo, NULL, NULL))) {
 		if (x->ex_flags & EXFLAG_CA
 		    || X509_get_ext_by_NID(x, NID_subject_alt_name, -1) >= 0
 		    || X509_get_ext_by_NID(x, NID_issuer_alt_name, -1) >= 0) {
@@ -401,7 +443,7 @@
 		x->ex_flags |= EXFLAG_PROXY;
 	}
 	/* Handle key usage */
-	if((usage=X509_get_ext_d2i(x, NID_key_usage, NULL, NULL))) {
+	if((usage=(ASN1_OCTET_STRING *) X509_get_ext_d2i(x, NID_key_usage, NULL, NULL))) {
 		if(usage->length > 0) {
 			x->ex_kusage = usage->data[0];
 			if(usage->length > 1) 
@@ -411,7 +453,7 @@
 		ASN1_BIT_STRING_free(usage);
 	}
 	x->ex_xkusage = 0;
-	if((extusage=X509_get_ext_d2i(x, NID_ext_key_usage, NULL, NULL))) {
+	if((extusage= (EXTENDED_KEY_USAGE *) X509_get_ext_d2i(x, NID_ext_key_usage, NULL, NULL))) {
 		x->ex_flags |= EXFLAG_XKUSAGE;
 		for(i = 0; i < sk_ASN1_OBJECT_num(extusage); i++) {
 			switch(OBJ_obj2nid(sk_ASN1_OBJECT_value(extusage,i))) {
@@ -452,16 +494,16 @@
 		sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free);
 	}
 
-	if((ns=X509_get_ext_d2i(x, NID_netscape_cert_type, NULL, NULL))) {
+	if((ns=(ASN1_OCTET_STRING *) X509_get_ext_d2i(x, NID_netscape_cert_type, NULL, NULL))) {
 		if(ns->length > 0) x->ex_nscert = ns->data[0];
 		else x->ex_nscert = 0;
 		x->ex_flags |= EXFLAG_NSCERT;
 		ASN1_BIT_STRING_free(ns);
 	}
-	x->skid =X509_get_ext_d2i(x, NID_subject_key_identifier, NULL, NULL);
-	x->akid =X509_get_ext_d2i(x, NID_authority_key_identifier, NULL, NULL);
-	x->altname = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);
-	x->nc = X509_get_ext_d2i(x, NID_name_constraints, &i, NULL);
+	x->skid = (ASN1_OCTET_STRING *)X509_get_ext_d2i(x, NID_subject_key_identifier, NULL, NULL);
+	x->akid = (AUTHORITY_KEYID *)X509_get_ext_d2i(x, NID_authority_key_identifier, NULL, NULL);
+	x->altname = (STACK_OF(GENERAL_NAME) *)X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);
+	x->nc = (NAME_CONSTRAINTS *)X509_get_ext_d2i(x, NID_name_constraints, &i, NULL);
 	if (!x->nc && (i != -1))
 		x->ex_flags |= EXFLAG_INVALID;
 	setup_crldp(x);
@@ -505,7 +547,7 @@
 #define ns_reject(x, usage) \
 	(((x)->ex_flags & EXFLAG_NSCERT) && !((x)->ex_nscert & (usage)))
 
-static int check_ca(const X509 *x)
+/*static*/ int check_ca(const X509 *x)
 {
 	/* keyUsage if present should allow cert signing */
 	if(ku_reject(x, KU_KEY_CERT_SIGN)) return 0;
@@ -633,6 +675,7 @@
 	return 1;
 }
 
+#ifndef OPENSSL_NO_OCSP
 /* OCSP helper: this is *not* a full OCSP check. It just checks that
  * each CA is valid. Additional checks must be made on the chain.
  */
@@ -680,6 +723,7 @@
 
 	return 1;
 }
+#endif
 
 static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca)
 {
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_skey.c openssl-1.0.0q/crypto/x509v3/v3_skey.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_skey.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_skey.c	2017-04-25 16:23:40.887798865 +0200
@@ -57,18 +57,24 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
+#ifndef OPERA_SMALL_VERSION
 static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
-const X509V3_EXT_METHOD v3_skey_id = { 
+#endif
+
+CONST_X509V3_EXT_METHOD_item(v3_skey_id,
 NID_subject_key_identifier, 0, ASN1_ITEM_ref(ASN1_OCTET_STRING),
 0,0,0,0,
 (X509V3_EXT_I2S)i2s_ASN1_OCTET_STRING,
-(X509V3_EXT_S2I)s2i_skey_id,
+OPERA_S2I_DECLARE((X509V3_EXT_S2I)s2i_skey_id),
 0,0,0,0,
-NULL};
+NULL)
 
 char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
 	     ASN1_OCTET_STRING *oct)
@@ -76,6 +82,7 @@
 	return hex_to_string(oct->data, oct->length);
 }
 
+#ifndef OPERA_SMALL_VERSION
 ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
 	     X509V3_CTX *ctx, char *str)
 {
@@ -103,10 +110,10 @@
 {
 	ASN1_OCTET_STRING *oct;
 	ASN1_BIT_STRING *pk;
-	unsigned char pkey_dig[EVP_MAX_MD_SIZE];
+	unsigned char pkey_dig[EVP_MAX_MD_SIZE];	/* ARRAY OK 2009-05-25 yngve */
 	unsigned int diglen;
 
-	if(strcmp(str, "hash")) return s2i_ASN1_OCTET_STRING(method, ctx, str);
+	if(op_strcmp(str, "hash")) return s2i_ASN1_OCTET_STRING(method, ctx, str);
 
 	if(!(oct = M_ASN1_OCTET_STRING_new())) {
 		X509V3err(X509V3_F_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE);
@@ -142,3 +149,4 @@
 	M_ASN1_OCTET_STRING_free(oct);
 	return NULL;
 }
+#endif
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_sxnet.c openssl-1.0.0q/crypto/x509v3/v3_sxnet.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_sxnet.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_sxnet.c	2017-04-25 16:23:40.888798434 +0200
@@ -56,12 +56,15 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
+#include "modules/libopeay/libopeay_arrays.h"
 
 /* Support for Thawte strong extranet extension */
 
@@ -69,37 +72,40 @@
 
 static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, int indent);
 #ifdef SXNET_TEST
+#ifndef OPERA_SMALL_VERSION
 static SXNET * sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
 						STACK_OF(CONF_VALUE) *nval);
 #endif
-const X509V3_EXT_METHOD v3_sxnet = {
+#endif
+
+CONST_X509V3_EXT_METHOD_item(v3_sxnet,
 NID_sxnet, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(SXNET),
 0,0,0,0,
 0,0,
 0, 
-#ifdef SXNET_TEST
-(X509V3_EXT_V2I)sxnet_v2i,
-#else
-0,
-#endif
+OPERA_V2I_DECLARE((X509V3_EXT_V2I)sxnet_v2i),
 (X509V3_EXT_I2R)sxnet_i2r,
 0,
 NULL
-};
+)
 
-ASN1_SEQUENCE(SXNETID) = {
-	ASN1_SIMPLE(SXNETID, zone, ASN1_INTEGER),
+ASN1_SEQUENCE(SXNETID) 
+	ASN1_SIMPLE(SXNETID, zone, ASN1_INTEGER)
 	ASN1_SIMPLE(SXNETID, user, ASN1_OCTET_STRING)
-} ASN1_SEQUENCE_END(SXNETID)
+ASN1_SEQUENCE_END(SXNETID)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(SXNETID)
+#endif
 
-ASN1_SEQUENCE(SXNET) = {
-	ASN1_SIMPLE(SXNET, version, ASN1_INTEGER),
+ASN1_SEQUENCE(SXNET) 
+	ASN1_SIMPLE(SXNET, version, ASN1_INTEGER)
 	ASN1_SEQUENCE_OF(SXNET, ids, SXNETID)
-} ASN1_SEQUENCE_END(SXNET)
+ASN1_SEQUENCE_END(SXNET)
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_ASN1_FUNCTIONS(SXNET)
+#endif
 
 static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out,
 	     int indent)
@@ -128,6 +134,7 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 static SXNET * sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
 	     STACK_OF(CONF_VALUE) *nval)
 {
@@ -141,6 +148,7 @@
 	}
 	return sx;
 }
+#endif
 		
 	
 #endif
@@ -149,6 +157,7 @@
 
 /* Add an id given the zone as an ASCII number */
 
+#ifndef OPERA_SMALL_VERSION
 int SXNET_add_id_asc(SXNET **psx, char *zone, char *user,
 	     int userlen)
 {
@@ -159,9 +168,11 @@
 	}
 	return SXNET_add_id_INTEGER(psx, izone, user, userlen);
 }
+#endif
 
 /* Add an id given the zone as an unsigned long */
 
+#ifndef OPERA_SMALL_VERSION
 int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user,
 	     int userlen)
 {
@@ -174,12 +185,14 @@
 	return SXNET_add_id_INTEGER(psx, izone, user, userlen);
 	
 }
+#endif
 
 /* Add an id given the zone as an ASN1_INTEGER.
  * Note this version uses the passed integer and doesn't make a copy so don't
  * free it up afterwards.
  */
 
+#ifndef OPERA_SMALL_VERSION
 int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, char *user,
 	     int userlen)
 {
@@ -189,7 +202,7 @@
 		X509V3err(X509V3_F_SXNET_ADD_ID_INTEGER,X509V3_R_INVALID_NULL_ARGUMENT);
 		return 0;
 	}
-	if(userlen == -1) userlen = strlen(user);
+	if(userlen == -1) userlen = op_strlen(user);
 	if(userlen > 64) {
 		X509V3err(X509V3_F_SXNET_ADD_ID_INTEGER,X509V3_R_USER_TOO_LONG);
 		return 0;
@@ -205,7 +218,7 @@
 	}
 
 	if(!(id = SXNETID_new())) goto err;
-	if(userlen == -1) userlen = strlen(user);
+	if(userlen == -1) userlen = op_strlen(user);
 		
 	if(!M_ASN1_OCTET_STRING_set(id->user, user, userlen)) goto err;
 	if(!sk_SXNETID_push(sx->ids, id)) goto err;
@@ -257,6 +270,7 @@
 	}
 	return NULL;
 }
+#endif
 
 IMPLEMENT_STACK_OF(SXNETID)
 IMPLEMENT_ASN1_SET_OF(SXNETID)
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3_utl.c openssl-1.0.0q/crypto/x509v3/v3_utl.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3_utl.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3_utl.c	2017-04-25 16:23:40.889797443 +0200
@@ -58,18 +58,22 @@
 /* X509 v3 extension utilities */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <ctype.h>
-#include "cryptlib.h"
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
 #include <openssl/bn.h>
 
 static char *strip_spaces(char *name);
+#ifndef OPERA_SMALL_VERSION
 static int sk_strcmp(const char * const *a, const char * const *b);
 static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens);
 static void str_free(OPENSSL_STRING str);
 static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email);
+#endif
 
 static int ipv4_from_asc(unsigned char *v4, const char *in);
 static int ipv6_from_asc(unsigned char *v6, const char *in);
@@ -124,6 +128,7 @@
 	return X509V3_add_value(name, "FALSE", extlist);
 }
 
+#ifndef OPERA_SMALL_VERSION
 int X509V3_add_value_bool_nf(char *name, int asn1_bool,
 						STACK_OF(CONF_VALUE) **extlist)
 {
@@ -143,6 +148,7 @@
 	BN_free(bntmp);
 	return strtmp;
 }
+#endif
 
 char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, ASN1_INTEGER *a)
 {
@@ -214,14 +220,14 @@
 {
 	char *btmp;
 	if(!(btmp = value->value)) goto err;
-	if(!strcmp(btmp, "TRUE") || !strcmp(btmp, "true")
-		 || !strcmp(btmp, "Y") || !strcmp(btmp, "y")
-		|| !strcmp(btmp, "YES") || !strcmp(btmp, "yes")) {
+	if(!op_strcmp(btmp, "TRUE") || !op_strcmp(btmp, "true")
+		 || !op_strcmp(btmp, "Y") || !op_strcmp(btmp, "y")
+		|| !op_strcmp(btmp, "YES") || !op_strcmp(btmp, "yes")) {
 		*asn1_bool = 0xff;
 		return 1;
-	} else if(!strcmp(btmp, "FALSE") || !strcmp(btmp, "false")
-		 || !strcmp(btmp, "N") || !strcmp(btmp, "n")
-		|| !strcmp(btmp, "NO") || !strcmp(btmp, "no")) {
+	} else if(!op_strcmp(btmp, "FALSE") || !op_strcmp(btmp, "false")
+		 || !op_strcmp(btmp, "N") || !op_strcmp(btmp, "n")
+		|| !op_strcmp(btmp, "NO") || !op_strcmp(btmp, "no")) {
 		*asn1_bool = 0;
 		return 1;
 	}
@@ -231,6 +237,7 @@
 	return 0;
 }
 
+#ifndef OPERA_SMALL_VERSION
 int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint)
 {
 	ASN1_INTEGER *itmp;
@@ -241,6 +248,7 @@
 	*aint = itmp;
 	return 1;
 }
+#endif // !OPERA_SMALL_VERSION
 
 #define HDR_NAME	1
 #define HDR_VALUE	2
@@ -344,10 +352,10 @@
 	char *p, *q;
 	/* Skip over leading spaces */
 	p = name;
-	while(*p && isspace((unsigned char)*p)) p++;
+	while(*p && op_isspace((unsigned char)*p)) p++;
 	if(!*p) return NULL;
-	q = p + strlen(p) - 1;
-	while((q != p) && isspace((unsigned char)*q)) q--;
+	q = p + op_strlen(p) - 1;
+	while((q != p) && op_isspace((unsigned char)*q)) q--;
 	if(p != q) q[1] = 0;
 	if(!*p) return NULL;
 	return p;
@@ -365,9 +373,9 @@
 	char *tmp, *q;
 	const unsigned char *p;
 	int i;
-	const static char hexdig[] = "0123456789ABCDEF";
+	const char * const hexdig = "0123456789ABCDEF"; /* ARRAY OK 2008-02-27 haavardm */
 	if(!buffer || !len) return NULL;
-	if(!(tmp = OPENSSL_malloc(len * 3 + 1))) {
+	if(!(tmp = (char *) OPENSSL_malloc(len * 3 + 1))) {
 		X509V3err(X509V3_F_HEX_TO_STRING,ERR_R_MALLOC_FAILURE);
 		return NULL;
 	}
@@ -388,7 +396,6 @@
 /* Give a string of hex digits convert to
  * a buffer
  */
-
 unsigned char *string_to_hex(const char *str, long *len)
 {
 	unsigned char *hexbuf, *q;
@@ -397,7 +404,7 @@
 		X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_INVALID_NULL_ARGUMENT);
 		return NULL;
 	}
-	if(!(hexbuf = OPENSSL_malloc(strlen(str) >> 1))) goto err;
+	if(!(hexbuf = (unsigned char *) OPENSSL_malloc(op_strlen(str) >> 1))) goto err;
 	for(p = (unsigned char *)str, q = hexbuf; *p;) {
 		ch = *p++;
 #ifdef CHARSET_EBCDIC
@@ -413,8 +420,8 @@
 			OPENSSL_free(hexbuf);
 			return NULL;
 		}
-		if(isupper(ch)) ch = tolower(ch);
-		if(isupper(cl)) cl = tolower(cl);
+		if(op_isupper(ch)) ch = op_tolower(ch);
+		if(op_isupper(cl)) cl = op_tolower(cl);
 
 		if((ch >= '0') && (ch <= '9')) ch -= '0';
 		else if ((ch >= 'a') && (ch <= 'f')) ch -= 'a' - 10;
@@ -451,16 +458,17 @@
 {
 	int len, ret;
 	char c;
-	len = strlen(cmp);
-	if((ret = strncmp(name, cmp, len))) return ret;
+	len = op_strlen(cmp);
+	if((ret = op_strncmp(name, cmp, len))) return ret;
 	c = name[len];
 	if(!c || (c=='.')) return 0;
 	return 1;
 }
 
+#ifndef OPERA_SMALL_VERSION
 static int sk_strcmp(const char * const *a, const char * const *b)
 {
-	return strcmp(*a, *b);
+	return op_strcmp(*a, *b);
 }
 
 STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x)
@@ -562,11 +570,14 @@
 	}
 	return 1;
 }
+#endif
 
+#ifndef OPERA_SMALL_VERSION
 void X509_email_free(STACK_OF(OPENSSL_STRING) *sk)
 {
 	sk_OPENSSL_STRING_pop_free(sk, str_free);
 }
+#endif
 
 /* Convert IP addresses both IPv4 and IPv6 into an 
  * OCTET STRING compatible with RFC3280.
@@ -574,7 +585,7 @@
 
 ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc)
 	{
-	unsigned char ipout[16];
+	unsigned char ipout[16]; /* ARRAY OK 2007-11-07 yngve UNUSED */
 	ASN1_OCTET_STRING *ret;
 	int iplen;
 
@@ -599,10 +610,10 @@
 ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc)
 	{
 	ASN1_OCTET_STRING *ret = NULL;
-	unsigned char ipout[32];
+	unsigned char ipout[32]; /* ARRAY OK 2007-11-07 yngve UNUSED*/
 	char *iptmp = NULL, *p;
 	int iplen1, iplen2;
-	p = strchr(ipasc,'/');
+	p = (char*)strchr(ipasc,'/');
 	if (!p)
 		return NULL;
 	iptmp = BUF_strdup(ipasc);
@@ -676,7 +687,7 @@
 
 typedef struct {
 		/* Temporary store for IPV6 output */
-		unsigned char tmp[16];
+		unsigned char tmp[16];  /* ARRAY OK 2007-11-07 yngve UNUSED */
 		/* Total number of bytes in tmp */
 		int total;
 		/* The position of a zero (corresponding to '::') */
@@ -759,7 +770,7 @@
 
 static int ipv6_cb(const char *elem, int len, void *usr)
 	{
-	IPV6_STAT *s = usr;
+	IPV6_STAT *s = (IPV6_STAT *)usr;
 	/* Error if 16 bytes written */
 	if (s->total == 16)
 		return 0;
@@ -826,7 +837,6 @@
 	return 1;
 	}
 
-
 int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk,
 						unsigned long chtype)
 	{
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3conf.c openssl-1.0.0q/crypto/x509v3/v3conf.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3conf.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3conf.c	2017-04-25 16:23:40.889797443 +0200
@@ -57,7 +57,9 @@
  */
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 #include <openssl/conf.h>
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3err.c openssl-1.0.0q/crypto/x509v3/v3err.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3err.c	2017-04-25 16:23:40.890797291 +0200
@@ -58,7 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/err.h>
 #include <openssl/x509v3.h>
 
@@ -68,7 +70,7 @@
 #define ERR_FUNC(func) ERR_PACK(ERR_LIB_X509V3,func,0)
 #define ERR_REASON(reason) ERR_PACK(ERR_LIB_X509V3,0,reason)
 
-static ERR_STRING_DATA X509V3_str_functs[]=
+static const ERR_STRING_DATA X509V3_str_functs[]=
 	{
 {ERR_FUNC(X509V3_F_A2I_GENERAL_NAME),	"A2I_GENERAL_NAME"},
 {ERR_FUNC(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE),	"ASIDENTIFIERCHOICE_CANONIZE"},
@@ -138,7 +140,7 @@
 {0,NULL}
 	};
 
-static ERR_STRING_DATA X509V3_str_reasons[]=
+static const ERR_STRING_DATA X509V3_str_reasons[]=
 	{
 {ERR_REASON(X509V3_R_BAD_IP_ADDRESS)     ,"bad ip address"},
 {ERR_REASON(X509V3_R_BAD_OBJECT)         ,"bad object"},
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/v3prin.c openssl-1.0.0q/crypto/x509v3/v3prin.c
--- openssl-1.0.0q.orig/crypto/x509v3/v3prin.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/v3prin.c	2017-04-25 16:23:40.891797418 +0200
@@ -58,7 +58,9 @@
 
 
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
 #include <openssl/asn1.h>
 #include <openssl/conf.h>
 #include <openssl/x509.h>
diff -Naur openssl-1.0.0q.orig/crypto/x509v3/x509v3.h openssl-1.0.0q/crypto/x509v3/x509v3.h
--- openssl-1.0.0q.orig/crypto/x509v3/x509v3.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/crypto/x509v3/x509v3.h	2017-04-25 16:23:40.892797266 +0200
@@ -66,6 +66,12 @@
 extern "C" {
 #endif
 
+#if defined OPERA_SMALL_VERSION
+#define OPERA_X509V3_EXT_METHOD_decl extern
+#else
+#define OPERA_X509V3_EXT_METHOD_decl
+#endif
+
 /* Forward reference */
 struct v3_ext_method;
 struct v3_ext_ctx;
@@ -115,9 +121,23 @@
 X509V3_EXT_I2R i2r;
 X509V3_EXT_R2I r2i;
 
-void *usr_data;	/* Any extension specific data */
+const void *usr_data;	/* Any extension specific data */
 };
 
+#ifndef OPERA_SMALL_VERSION
+#define OPERA_V2I_DECLARE(f) f
+#define OPERA_I2S_DECLARE(f) f
+#define OPERA_S2I_DECLARE(f) f
+#define OPERA_R2I_DECLARE(f) f
+#define OPERA_I2R_DECLARE(f) f
+#else
+#define OPERA_V2I_DECLARE(f) NULL
+#define OPERA_I2S_DECLARE(f) NULL
+#define OPERA_S2I_DECLARE(f) NULL
+#define OPERA_R2I_DECLARE(f) NULL
+#define OPERA_I2R_DECLARE(f) NULL
+#endif
+
 typedef struct X509V3_CONF_METHOD_st {
 char * (*get_string)(void *db, char *section, char *value);
 STACK_OF(CONF_VALUE) * (*get_section)(void *db, char *section);
@@ -142,6 +162,45 @@
 
 DECLARE_STACK_OF(X509V3_EXT_METHOD)
 
+#define CONST_X509V3_EXT_METHOD_item(name, _ext_nid, _ext_flags,_it,_ext_new,_ext_free,_d2i,_i2d,_i2s,_s2i,_i2v,_v2i,_i2r,_r2i,_usr_data) \
+	OPENSSL_PREFIX_CONST_ITEM(OPENSSL_EXTERN,X509V3_EXT_METHOD, name, libopeay) \
+	CONST_ITEM_ENTRY_START(ext_nid,_ext_nid)\
+	CONST_ITEM_ENTRY_SINGLE(ext_flags,_ext_flags)\
+	CONST_ITEM_ENTRY_SINGLE(it,_it)\
+	CONST_ITEM_ENTRY_SINGLE(ext_new,_ext_new)\
+	CONST_ITEM_ENTRY_SINGLE(ext_free,_ext_free)\
+	CONST_ITEM_ENTRY_SINGLE(d2i,_d2i)\
+	CONST_ITEM_ENTRY_SINGLE(i2d,_i2d)\
+	CONST_ITEM_ENTRY_SINGLE(i2s,_i2s)\
+	CONST_ITEM_ENTRY_SINGLE(s2i,_s2i)\
+	CONST_ITEM_ENTRY_SINGLE(i2v,_i2v)\
+	CONST_ITEM_ENTRY_SINGLE(v2i,_v2i)\
+	CONST_ITEM_ENTRY_SINGLE(i2r,_i2r)\
+	CONST_ITEM_ENTRY_SINGLE(r2i,_r2i)\
+	CONST_ITEM_ENTRY_SINGLE(usr_data,_usr_data)\
+	CONST_ITEM_ENTRY_END
+
+#define CONST_X509V3_EXT_METHOD_ENTRY(_ext_nid, _ext_flags,_it,_ext_new,_ext_free,_d2i,_i2d,_i2s,_s2i,_i2v,_v2i,_i2r,_r2i,_usr_data) \
+	CONST_ENTRY_START(ext_nid,_ext_nid)\
+	CONST_ENTRY_SINGLE(ext_flags,_ext_flags)\
+	CONST_ENTRY_SINGLE(it,_it)\
+	CONST_ENTRY_SINGLE(ext_new,_ext_new)\
+	CONST_ENTRY_SINGLE(ext_free,_ext_free)\
+	CONST_ENTRY_SINGLE(d2i,_d2i)\
+	CONST_ENTRY_SINGLE(i2d,_i2d)\
+	CONST_ENTRY_SINGLE(i2s,_i2s)\
+	CONST_ENTRY_SINGLE(s2i,_s2i)\
+	CONST_ENTRY_SINGLE(i2v,_i2v)\
+	CONST_ENTRY_SINGLE(v2i,_v2i)\
+	CONST_ENTRY_SINGLE(i2r,_i2r)\
+	CONST_ENTRY_SINGLE(r2i,_r2i)\
+	CONST_ENTRY_SINGLE(usr_data,_usr_data)\
+	CONST_ENTRY_END
+
+
+#define DECLARE_X509V3_EXT_METHOD(name)\
+	DECLARE_MODULE_CONST_ITEM(X509V3_EXT_METHOD, name)
+
 /* ext_flags values */
 #define X509V3_EXT_DYNAMIC	0x1
 #define X509V3_EXT_CTX_DEP	0x2
@@ -379,8 +438,13 @@
 /* onlysomereasons present */
 #define IDP_REASONS	0x40
 
+#ifndef OPERA_SMALL_VERSION
 #define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \
 ",name:", val->name, ",value:", val->value);
+#else
+#define X509V3_conf_err(val)
+#endif /* OPERA_SMALL_VERSION */
+
 
 #define X509V3_set_ctx_test(ctx) \
 			X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
@@ -390,18 +454,28 @@
 			0,0,0,0, \
 			0,0, \
 			(X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
-			(X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \
+			OPERA_V2I_DECLARE((X509V3_EXT_V2I)v2i_ASN1_BIT_STRING), \
 			NULL, NULL, \
 			table}
 
-#define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \
+#define CONST_X509V3_EXT_METHOD_BITSTRING_item(name, nid, table) \
+	CONST_X509V3_EXT_METHOD_item(name, nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \
+			0,0,0,0, \
+			0,0, \
+			(X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
+			OPERA_V2I_DECLARE((X509V3_EXT_V2I)v2i_ASN1_BIT_STRING), \
+			NULL, NULL, \
+			table)
+
+#define EXT_IA5STRING(nid) \
+	CONST_X509V3_EXT_METHOD_ENTRY(nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \
 			0,0,0,0, \
 			(X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \
-			(X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \
+			OPERA_S2I_DECLARE((X509V3_EXT_S2I)s2i_ASN1_IA5STRING), \
 			0,0,0,0, \
-			NULL}
+			NULL)
 
-#define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+#define EXT_END CONST_X509V3_EXT_METHOD_ENTRY(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
 
 
 /* X509_PURPOSE stuff */
@@ -461,8 +535,8 @@
 	int flags;
 	int (*check_purpose)(const struct x509_purpose_st *,
 				const X509 *, int);
-	char *name;
-	char *sname;
+	const char *name;
+	const char *sname;
 	void *usr_data;
 } X509_PURPOSE;
 
@@ -670,7 +744,9 @@
 void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
 								 int ml);
 int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent);
+#ifndef OPENSSL_NO_FP_API
 int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
+#endif
 
 int X509V3_extensions_print(BIO *out, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent);
 
@@ -686,7 +762,7 @@
 int X509_PURPOSE_get_by_id(int id);
 int X509_PURPOSE_add(int id, int trust, int flags,
 			int (*ck)(const X509_PURPOSE *, const X509 *, int),
-				char *name, char *sname, void *arg);
+				const char *name, const char *sname, void *arg);
 char *X509_PURPOSE_get0_name(X509_PURPOSE *xp);
 char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp);
 int X509_PURPOSE_get_trust(X509_PURPOSE *xp);
diff -Naur openssl-1.0.0q.orig/e_os.h openssl-1.0.0q/e_os.h
--- openssl-1.0.0q.orig/e_os.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/e_os.h	2017-04-25 16:23:40.893798231 +0200
@@ -109,12 +109,16 @@
 # endif
 #endif
 
+#ifdef EPOC
+#define GROUP_USER_ID_IS_MEANINGLESS
+#endif
+
 /********************************************************************
  The Microsoft section
  ********************************************************************/
 /* The following is used because of the small stack in some
  * Microsoft operating systems */
-#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYSNAME_WIN32)
+#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPERA_SMALL_VERSION)
 #  define MS_STATIC	static
 #else
 #  define MS_STATIC
@@ -134,6 +138,15 @@
 #  define GETPID_IS_MEANINGLESS
 #endif
 
+#if defined(BREW) && !defined(GETPID_IS_MEANINGLESS)
+#  define GETPID_IS_MEANINGLESS
+#endif
+
+
+#if defined(EPOC) && !defined(GETPID_IS_MEANINGLESS)
+#  define GETPID_IS_MEANINGLESS
+#endif
+
 #ifdef WIN32
 #define get_last_sys_error()	GetLastError()
 #define clear_sys_error()	SetLastError(0)
@@ -227,6 +240,8 @@
 
 #if (defined(WINDOWS) || defined(MSDOS))
 
+#ifndef OPERA_SMALL_VERSION
+
 #  ifdef __DJGPP__
 #    include <unistd.h>
 #    include <sys/stat.h>
@@ -350,6 +365,8 @@
 #    define _kbhit kbhit
 #  endif
 
+#endif /* !OPERA_SMALL_VERSION */
+
 #  define EXIT(n) exit(n)
 #  define LIST_SEPARATOR_CHAR ';'
 #  ifndef X_OK
@@ -365,11 +382,7 @@
 #  define SSLEAY_CONF	OPENSSL_CONF
 #  define NUL_DEV	"nul"
 #  define RFILE		".rnd"
-#  ifdef OPENSSL_SYS_WINCE
-#    define DEFAULT_HOME  ""
-#  else
-#    define DEFAULT_HOME  "C:"
-#  endif
+#  define DEFAULT_HOME  "C:"
 
 /* Avoid Visual Studio 13 GetVersion deprecated problems */
 #if defined(_MSC_VER) && _MSC_VER>=1800
@@ -386,12 +399,14 @@
 #    define VMS 1
   /* some programs don't include stdlib, so exit() and others give implicit 
      function warnings */
+#ifndef OPERA_SMALL_VERSION
 #    include <stdlib.h>
 #    if defined(__DECC)
 #      include <unistd.h>
 #    else
 #      include <unixlib.h>
 #    endif
+#endif /* !OPERA_SMALL_VERSION */
 #    define OPENSSL_CONF	"openssl.cnf"
 #    define SSLEAY_CONF		OPENSSL_CONF
 #    define RFILE		".rnd"
@@ -452,6 +467,7 @@
 #    ifdef OPENSSL_SYS_MPE
 #      define NO_SYS_PARAM_H
 #    endif
+#ifndef OPERA_SMALL_VERSION
 #    ifdef OPENSSL_UNISTD
 #      include OPENSSL_UNISTD
 #    else
@@ -460,6 +476,7 @@
 #    ifndef NO_SYS_TYPES_H
 #      include <sys/types.h>
 #    endif
+#endif /* !OPERA_SMALL_VERSION */
 #    if defined(NeXT) || defined(OPENSSL_SYS_NEWS4)
 #      define pid_t int /* pid_t is missing on NEXTSTEP/OPENSTEP
                          * (unless when compiling with -D_POSIX_SOURCE,
@@ -492,6 +509,10 @@
 
 /*************/
 
+#ifdef EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
+#define USE_SOCKETS
+#endif
+
 #ifdef USE_SOCKETS
 #  if defined(WINDOWS) || defined(MSDOS)
       /* windows world */
@@ -533,6 +554,7 @@
 #      define SSLeay_Read(a,b,c)	read_s(a,b,c)
 #      define SHUTDOWN(fd)		close_s(fd)
 #      define SHUTDOWN2(fd)		close_s(fd)
+       extern HINSTANCE _hInstance;
 #    endif
 
 #  elif defined(MAC_OS_pre_X)
@@ -566,6 +588,7 @@
 
 #  else
 
+#if !defined(OPERA_SMALL_VERSION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
 #    ifndef NO_SYS_PARAM_H
 #      include <sys/param.h>
 #    endif
@@ -623,6 +646,7 @@
 #        include <socketshr.h>
 #      endif
 #    endif
+#endif /* !OPERA_SMALL_VERSION */
 
 #    define SSLeay_Read(a,b,c)     read((a),(b),(c))
 #    define SSLeay_Write(a,b,c)    write((a),(b),(c))
@@ -686,6 +710,7 @@
 #define IRIX_CC_BUG	/* CDS++ up to V2.0Bsomething suffered from the same bug.*/
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 #if defined(OPENSSL_SYS_WINDOWS)
 #  define strcasecmp _stricmp
 #  define strncasecmp _strnicmp
@@ -705,10 +730,13 @@
 #    define strncasecmp strnicmp
 #  endif /* NETWARE_CLIB */
 #endif
+#endif /* !OPERA_SMALL_VERSION */
 
 #if defined(OPENSSL_SYS_OS2) && defined(__EMX__)
+#ifndef OPERA_SMALL_VERSION
 # include <io.h>
 # include <fcntl.h>
+#endif /* !OPERA_SMALL_VERSION */
 # define NO_SYSLOG
 #endif
 
diff -Naur openssl-1.0.0q.orig/e_os2.h openssl-1.0.0q/e_os2.h
--- openssl-1.0.0q.orig/e_os2.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/e_os2.h	2017-04-25 16:23:40.894798917 +0200
@@ -53,8 +53,6 @@
  *
  */
 
-#include <openssl/opensslconf.h>
-
 #ifndef HEADER_E_OS2_H
 #define HEADER_E_OS2_H
 
@@ -62,6 +60,8 @@
 extern "C" {
 #endif
 
+#include <openssl/opensslconf.h> /* OPENSSL_UNISTD */
+
 /******************************************************************************
  * Detect operating systems.  This probably needs completing.
  * The result is that at least one OPENSSL_SYS_os macro should be defined.
@@ -70,6 +70,12 @@
 
 #define OPENSSL_SYS_UNIX
 
+
+/* --------------------------------- Brew ---------------------------------- */
+#if defined(BREW)
+# undef OPENSSL_SYS_UNIX
+#endif
+
 /* ----------------------- Macintosh, before MacOS X ----------------------- */
 #if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC)
 # undef OPENSSL_SYS_UNIX
@@ -101,7 +107,7 @@
 #  undef OPENSSL_SYS_UNIX
 #  define OPENSSL_SYS_WIN32_CYGWIN
 # else
-#  if defined(_WIN32) || defined(OPENSSL_SYSNAME_WIN32)
+#  if (defined(_WIN32) && !defined(EPOC) && !defined(BREW)) || defined(OPENSSL_SYSNAME_WIN32)
 #   undef OPENSSL_SYS_UNIX
 #   define OPENSSL_SYS_WIN32
 #  endif
@@ -132,7 +138,14 @@
 # ifndef OPENSSL_OPT_WINDLL
 #  if defined(_WINDLL) /* This is used when building OpenSSL to indicate that
                           DLL linkage should be used */
+#   if !defined(_WINDLL_HIDE_OPENSSL) /* _WINDLL is defiend by VS for SDK dlls
+						                 as well. OpenSSL leaks to export table
+										 and is not needed there. If you have
+										 DLL release and don't want OPENSSL_OPT_WINDLL,
+										 your probably want _WINDLL_HIDE_OPENSSL
+										 define in the VCProject */
 #   define OPENSSL_OPT_WINDLL
+#   endif //!_WINDLL_HIDE_OPENSSL
 #  endif
 # endif
 #endif
@@ -157,6 +170,11 @@
 # define OPENSSL_SYS_OS2
 #endif
 
+/* --------------------------------- Symbian ---------------------------------- */
+#if defined(EPOC)
+# undef OPENSSL_SYS_UNIX
+#endif
+
 /* --------------------------------- Unix ---------------------------------- */
 #ifdef OPENSSL_SYS_UNIX
 # if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX)
@@ -256,14 +274,14 @@
 # define OPENSSL_EXPORT globalref
 # define OPENSSL_IMPORT globalref
 # define OPENSSL_GLOBAL globaldef
-#elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL)
+#elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL) && !defined OPERA_SMALL_VERSION
 # define OPENSSL_EXPORT extern __declspec(dllexport)
 # define OPENSSL_IMPORT extern __declspec(dllimport)
 # define OPENSSL_GLOBAL
 #else
 # define OPENSSL_EXPORT extern
 # define OPENSSL_IMPORT extern
-# define OPENSSL_GLOBAL
+# define OPENSSL_GLOBAL extern
 #endif
 #define OPENSSL_EXTERN OPENSSL_IMPORT
 
@@ -277,7 +295,17 @@
 	OPENSSL_DECLARE_GLOBAL(int,foobar);
 	#define foobar OPENSSL_GLOBAL_REF(foobar)
 */
-#ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION
+#ifdef OPERA_SMALL_VERSION
+# define OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(type,name)			     \
+	type *_shadow_##name(void) { return & g_opera->libopeay_module.m_data->_hide_##name; }
+# define OPENSSL_IMPLEMENT_GLOBAL_OPERA(type,name)			     \
+	type _hide_##name
+# define OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(name) _hide_##name
+# define OPENSSL_IMPLEMENT_GLOBAL(type,name)			     \
+	extern type *_shadow_##name(void);
+# define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
+# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
+#elif defined OPENSSL_EXPORT_VAR_AS_FUNCTION
 # define OPENSSL_IMPLEMENT_GLOBAL(type,name,value)			\
 	type *_shadow_##name(void)					\
 	{ static type _hide_##name=value; return &_hide_##name; }
diff -Naur openssl-1.0.0q.orig/engines/.gitignore openssl-1.0.0q/engines/.gitignore
--- openssl-1.0.0q.orig/engines/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/engines/.gitignore	2017-04-25 16:23:40.894798917 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/engines/e_chil_err.c openssl-1.0.0q/engines/e_chil_err.c
--- openssl-1.0.0q.orig/engines/e_chil_err.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/engines/e_chil_err.c	2017-04-25 16:23:40.895798206 +0200
@@ -58,6 +58,9 @@
  * only reason strings will be preserved.
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
 #include <stdio.h>
 #include <openssl/err.h>
 #include "e_chil_err.h"
diff -Naur openssl-1.0.0q.orig/engines/e_cswift.c openssl-1.0.0q/engines/e_cswift.c
--- openssl-1.0.0q.orig/engines/e_cswift.c	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/engines/e_cswift.c	2017-04-25 16:23:40.896798892 +0200
@@ -56,6 +56,9 @@
  *
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
+
 #include <stdio.h>
 #include <string.h>
 #include <openssl/crypto.h>
diff -Naur openssl-1.0.0q.orig/engines/vendor_defns/hw_ubsec.h openssl-1.0.0q/engines/vendor_defns/hw_ubsec.h
--- openssl-1.0.0q.orig/engines/vendor_defns/hw_ubsec.h	2015-01-15 15:43:14.000000000 +0100
+++ openssl-1.0.0q/engines/vendor_defns/hw_ubsec.h	2017-04-25 16:23:40.896798892 +0200
@@ -40,8 +40,8 @@
 
 typedef struct ubsec_crypto_context_s {
 	unsigned int	flags;
-	unsigned char	crypto[MAX_CRYPTO_KEY_LENGTH];
-	unsigned char 	auth[MAX_MAC_KEY_LENGTH];
+	unsigned char	crypto[MAX_CRYPTO_KEY_LENGTH]; /* ARRAY OK 20092005 yngve Unused file */
+	unsigned char 	auth[MAX_MAC_KEY_LENGTH];	 /* ARRAY OK 20092005 yngve Unused file */
 } ubsec_crypto_context_t, *ubsec_crypto_context_p;
 
 /* 
diff -Naur openssl-1.0.0q.orig/engines/vendor_defns/hwcryptohook.h openssl-1.0.0q/engines/vendor_defns/hwcryptohook.h
--- openssl-1.0.0q.orig/engines/vendor_defns/hwcryptohook.h	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/engines/vendor_defns/hwcryptohook.h	2017-04-25 16:23:40.897798739 +0200
@@ -65,7 +65,7 @@
  * please contact nCipher.
  *
  *
- * $Id: hwcryptohook.h,v 1.1 2002/10/11 17:10:59 levitte Exp $
+ * $Id$
  */
 
 #ifndef HWCRYPTOHOOK_H
diff -Naur openssl-1.0.0q.orig/libopeay_arrays.h openssl-1.0.0q/libopeay_arrays.h
--- openssl-1.0.0q.orig/libopeay_arrays.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/libopeay_arrays.h	2017-04-25 16:23:40.898798308 +0200
@@ -0,0 +1,44 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#ifndef MODULES_LIBOPEAY_ARRAYS_H
+#define MODULES_LIBOPEAY_ARRAYS_H
+
+#ifdef GLOBAL_CONST_WRAPPER_BASE
+#undef GLOBAL_CONST_WRAPPER_BASE
+#endif
+#define GLOBAL_CONST_WRAPPER_BASE : public LibopeayModule::Libopeay_ConstBase
+
+#include "modules/url/tools/arrays.h"
+#include "modules/libopeay/libopeay_constants.h"
+
+#ifdef HAS_COMPLEX_GLOBALS
+#define OPENSSL_GLOBAL_ARRAY_NAME(name) g_##name
+#define OPENSSL_GLOBAL_ITEM_NAME(name) g_##name
+#define OPENSSL_CONST_ARRAY_SIZE(name) CONST_ARRAY_SIZE(libopeay, name)
+#else
+#define OPENSSL_GLOBAL_ARRAY_NAME(name) g_opera->libopeay_module.m_consts->m_cda_##name .m_array
+#define OPENSSL_GLOBAL_ITEM_NAME(name)  g_opera->libopeay_module.m_consts->m_cdi_##name .m_item
+#define OPENSSL_CONST_ARRAY_SIZE(name)  (g_opera->libopeay_module.m_consts->m_cda_##name .m_size)
+// Add namedefines above
+#endif // Complex globals
+
+#define OPENSSL_GLOBAL_NAME_it(name)		OPENSSL_GLOBAL_ITEM_NAME(name##_it) 
+#define OPENSSL_GLOBAL_NAME_item_tt(name)	OPENSSL_GLOBAL_ITEM_NAME(name##_item_tt)
+#define OPENSSL_GLOBAL_NAME_tt(name)		OPENSSL_GLOBAL_ITEM_NAME(name##_tt)
+#define OPENSSL_GLOBAL_NAME_ch_tt(name)		OPENSSL_GLOBAL_ARRAY_NAME(name##_ch_tt)
+#define OPENSSL_GLOBAL_NAME_seq_tt(name)	OPENSSL_GLOBAL_ARRAY_NAME(name##_seq_tt)
+#define OPENSSL_GLOBAL_NAME_adbtbl(name)	OPENSSL_GLOBAL_ARRAY_NAME(name##_adbtbl)
+#define OPENSSL_GLOBAL_NAME_adb(name)		OPENSSL_GLOBAL_ITEM_NAME(name##_adb)
+#define OPENSSL_GLOBAL_NAME_aux(name)		OPENSSL_GLOBAL_ITEM_NAME(name##_aux)
+
+#define OPENSSL_PREFIX_CONST_ARRAY(prefix, structname, name, modulename)	PREFIX_CONST_ARRAY(prefix, structname, name, modulename##_CONST)
+#define OPENSSL_CONST_ARRAY(prefix, structname, name, modulename)			CONST_ARRAY(prefix, structname, name, modulename##_CONST)
+#define OPENSSL_PREFIX_CONST_ITEM(prefix, structname, name, modulename)		PREFIX_CONST_ITEM(prefix, structname, name, modulename##_CONST)
+
+#endif /* MODULES_LIBOPEAY_ARRAYS_H */
diff -Naur openssl-1.0.0q.orig/libopeay_capabilities.h openssl-1.0.0q/libopeay_capabilities.h
--- openssl-1.0.0q.orig/libopeay_capabilities.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/libopeay_capabilities.h	2017-04-25 16:23:40.898798308 +0200
@@ -0,0 +1,16 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+**
+*/
+
+#ifndef LIBOPEAY_CAPABILITIES_H
+#define LIBOPEAY_CAPABILITIES_H
+
+// This module has the fixed intermediate certificate search
+#define LIBOPEAY_CAP_FIXED_INTERMEDIATE_SEARCH
+
+#endif /* LIBOPEAY_CAPABILITIES_H */
diff -Naur openssl-1.0.0q.orig/libopeay_constants.cpp openssl-1.0.0q/libopeay_constants.cpp
--- openssl-1.0.0q.orig/libopeay_constants.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/libopeay_constants.cpp	2017-04-25 16:23:40.898798308 +0200
@@ -0,0 +1,73 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Inside wrapper. No need for default include files
+
+#ifndef HAS_COMPLEX_GLOBALS
+
+#include "modules/libopeay/libopeay_arrays.h"
+
+void LibopeayModule::AddComplexConstGlobal(Libopeay_ConstBase *item)
+{
+	if(item)
+		item->Into(&global_const_list);
+}
+
+void LibopeayModule::InitGlobalsL()
+{
+	m_consts = new (ELeave) Libopeay_GlobalConst_Data;
+
+	if(global_const_list.Empty())
+		return; // If nothing to do, don't bother
+
+	// Alloc, if necessary
+	InitGlobalsPhaseL(1);
+	// Init members
+	InitGlobalsPhaseL(2);
+}
+
+void LibopeayModule::InitGlobalsPhaseL(int phase)
+{
+	Libopeay_ConstBase *item = (Libopeay_ConstBase *) global_const_list.First();
+
+	while(item)
+	{
+		item->InitL(phase);
+
+		item = (Libopeay_ConstBase *) item->Suc();
+	}
+}
+
+void LibopeayModule::DestroyGlobals()
+{
+	Libopeay_ConstBase *item = (Libopeay_ConstBase *) global_const_list.First();
+
+	while(item)
+	{
+		item->Destroy();
+
+		item = (Libopeay_ConstBase *) item->Suc();
+	}
+
+	delete m_consts;
+	m_consts = NULL;
+}
+
+LibopeayModule::Libopeay_ConstBase::Libopeay_ConstBase()
+{
+	g_opera->libopeay_module.AddComplexConstGlobal(this);
+}
+
+LibopeayModule::Libopeay_ConstBase::~Libopeay_ConstBase()
+{
+	if(InList())
+		Out();
+}
+
+
+#endif // HAS_COMPLEX_GLOBALS
diff -Naur openssl-1.0.0q.orig/libopeay_constants.h openssl-1.0.0q/libopeay_constants.h
--- openssl-1.0.0q.orig/libopeay_constants.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/libopeay_constants.h	2017-04-25 16:23:40.899798155 +0200
@@ -0,0 +1,361 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#ifndef MODULES_LIBOPEAY_LIBOPEAY_CONSTANTS_H
+#define MODULES_LIBOPEAY_LIBOPEAY_CONSTANTS_H
+
+#if !defined HAS_COMPLEX_GLOBALS
+
+#ifdef OPENSSL_SYS_WIN32
+/* Under Win32 thes are defined in wincrypt.h */
+#undef PKCS7_ISSUER_AND_SERIAL
+#undef PKCS7_SIGNER_INFO
+#undef X509_NAME
+#undef X509_CERT_PAIR
+#undef OCSP_REQUEST
+#undef OCSP_RESPONSE
+#endif
+
+#include <openssl/cryptlib.h>
+#include <openssl/asn1t.h>
+#include <openssl/bn.h>
+#ifndef OPENSSL_NO_DH
+#include <openssl/dh.h>
+#endif
+#ifndef OPENSSL_NO_DSA
+#include <openssl/dsa.h>
+#endif
+#include <openssl/err.h>
+#include <openssl/evp.h>
+#include <openssl/rand.h>
+#ifndef OPENSSL_NO_RSA
+#include <openssl/rsa.h>
+#endif
+#include <openssl/x509v3.h>
+
+#include "modules/libopeay/crypto/asn1/asn1_locl.h"
+#include "modules/libopeay/crypto/evp/evp_locl.h"
+
+
+class Libopeay_GlobalConst_Data
+{
+public:
+	ASN1_ADB_SEQ_DECLARE(PKCS7);
+	ASN1_ADB_SEQ_DECLARE(POLICYQUALINFO);
+
+	ASN1_ADB_TEMPLATE_DECLARE(p7default);
+	ASN1_ADB_TEMPLATE_DECLARE(policydefault);
+
+	ASN1_CHOICE_cb_DECLARE(DIST_POINT_NAME);
+
+	ASN1_CHOICE_DECLARE(GENERAL_NAME);
+
+	ASN1_ITEM_TEMPLATE_DECLARE(ASN1_SEQUENCE_ANY);
+	ASN1_ITEM_TEMPLATE_DECLARE(ASN1_SET_ANY);
+	ASN1_ITEM_TEMPLATE_DECLARE(AUTHORITY_INFO_ACCESS);
+	ASN1_ITEM_TEMPLATE_DECLARE(CERTIFICATEPOLICIES);
+	ASN1_ITEM_TEMPLATE_DECLARE(CRL_DIST_POINTS);
+	ASN1_ITEM_TEMPLATE_DECLARE(GENERAL_NAMES);
+	ASN1_ITEM_TEMPLATE_DECLARE(EXTENDED_KEY_USAGE);
+	ASN1_ITEM_TEMPLATE_DECLARE(PKCS7_ATTR_SIGN);
+	ASN1_ITEM_TEMPLATE_DECLARE(POLICY_MAPPINGS);
+	ASN1_ITEM_TEMPLATE_DECLARE(X509_ALGORS);
+	ASN1_ITEM_TEMPLATE_DECLARE(X509_NAME_ENTRIES);
+	ASN1_ITEM_TEMPLATE_DECLARE(X509_NAME_INTERNAL);
+	ASN1_ITEM_TEMPLATE_DECLARE(X509_EXTENSIONS);
+
+#if defined(_SSL_USE_OPENSSL_) && !defined(_USE_SYSTEM_LIBCRYPTO_)
+	ASN1_SEQ_AUX_DECLARE(DHparams);
+#endif
+	ASN1_SEQ_AUX_DECLARE(PKCS7);
+	ASN1_SEQ_AUX_DECLARE(PKCS7_RECIP_INFO);
+	ASN1_SEQ_AUX_DECLARE(PKCS7_SIGNER_INFO);
+	ASN1_SEQ_AUX_DECLARE(RSAPrivateKey);
+	ASN1_SEQ_AUX_DECLARE(RSAPublicKey);
+	ASN1_SEQ_AUX_DECLARE(X509);
+	ASN1_SEQ_AUX_DECLARE(X509_CINF);
+	ASN1_SEQ_AUX_DECLARE(X509_PUBKEY);
+
+	ASN1_SEQUENCE_DECLARE(ACCESS_DESCRIPTION);
+	ASN1_SEQUENCE_DECLARE(AUTHORITY_KEYID);
+	ASN1_SEQUENCE_DECLARE(BASIC_CONSTRAINTS);
+	ASN1_SEQUENCE_DECLARE(DIST_POINT);
+	ASN1_SEQUENCE_DECLARE(EDIPARTYNAME);
+	ASN1_SEQUENCE_DECLARE(GENERAL_SUBTREE);
+	ASN1_SEQUENCE_DECLARE(ISSUING_DIST_POINT);
+	ASN1_SEQUENCE_DECLARE(NAME_CONSTRAINTS);
+	ASN1_SEQUENCE_DECLARE(NOTICEREF);
+	ASN1_SEQUENCE_DECLARE(OTHERNAME);
+#if defined(_SSL_USE_OPENSSL_) && !defined(_USE_SYSTEM_LIBCRYPTO_)
+	ASN1_SEQUENCE_DECLARE(PBE2PARAM);
+	ASN1_SEQUENCE_DECLARE(PBKDF2PARAM);
+#endif
+	ASN1_SEQUENCE_DECLARE(PKCS7_DIGEST);
+	ASN1_SEQUENCE_DECLARE(PKCS7_ENC_CONTENT);
+	ASN1_SEQUENCE_DECLARE(PKCS7_ENCRYPT);
+	ASN1_SEQUENCE_DECLARE(PKCS7_ENVELOPE);
+	ASN1_SEQUENCE_DECLARE(PKCS7_ISSUER_AND_SERIAL);
+	ASN1_SEQUENCE_DECLARE(PKCS7_SIGN_ENVELOPE);
+	ASN1_SEQUENCE_DECLARE(PKCS7_SIGNED);
+	ASN1_SEQUENCE_DECLARE(PKEY_USAGE_PERIOD);
+	ASN1_SEQUENCE_DECLARE(POLICY_CONSTRAINTS);
+	ASN1_SEQUENCE_DECLARE(POLICY_MAPPING);
+	ASN1_SEQUENCE_DECLARE(POLICYINFO);
+	ASN1_SEQUENCE_DECLARE(POLICYQUALINFO);
+	ASN1_SEQUENCE_DECLARE(PROXY_CERT_INFO_EXTENSION);
+	ASN1_SEQUENCE_DECLARE(PROXY_POLICY);
+	ASN1_SEQUENCE_DECLARE(SXNET);
+	ASN1_SEQUENCE_DECLARE(SXNETID);
+	ASN1_SEQUENCE_DECLARE(USERNOTICE) ;
+	ASN1_SEQUENCE_DECLARE(X509_ALGOR);
+	ASN1_SEQUENCE_DECLARE(X509_CERT_AUX);
+	ASN1_SEQUENCE_DECLARE(X509_EXTENSION);
+	ASN1_SEQUENCE_DECLARE(X509_NAME_ENTRY);
+	ASN1_SEQUENCE_DECLARE(X509_SIG);
+	ASN1_SEQUENCE_DECLARE(X509_VAL);
+
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_ANY);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_BIT_STRING);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_BOOLEAN);
+	//ASN1_TYPE_TEMPLATE_DECLARE(ASN1_BMPSTRING);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_ENUMERATED);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_FBOOLEAN);
+	//ASN1_TYPE_TEMPLATE_DECLARE(ASN1_GENERALSTRING);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_GENERALIZEDTIME);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_IA5STRING);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_INTEGER);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_NULL);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_OBJECT);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_OCTET_STRING);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_OCTET_STRING_NDEF);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_PRINTABLE);
+	//ASN1_TYPE_TEMPLATE_DECLARE(ASN1_PRINTABLESTRING);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_SEQUENCE);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_T61STRING);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_TIME);
+	ASN1_TYPE_TEMPLATE_DECLARE(ASN1_UTF8STRING);
+	ASN1_TYPE_TEMPLATE_DECLARE(BIGNUM);
+	ASN1_TYPE_TEMPLATE_DECLARE(CBIGNUM);
+	ASN1_TYPE_TEMPLATE_DECLARE(DIRECTORYSTRING);
+	ASN1_TYPE_TEMPLATE_DECLARE(DISPLAYTEXT);
+	ASN1_TYPE_TEMPLATE_DECLARE(LONG);
+	ASN1_TYPE_TEMPLATE_DECLARE(X509_NAME);
+	ASN1_TYPE_TEMPLATE_DECLARE(ZLONG);
+
+#ifndef OPENSSL_NO_DSA
+	ASN1_SEQ_AUX_DECLARE(DSA_SIG);
+	ASN1_SEQ_AUX_DECLARE(DSAPrivateKey);
+	ASN1_SEQ_AUX_DECLARE(DSAparams);
+	ASN1_SEQUENCE_DECLARE(dsa_pub_internal);
+	ASN1_CHOICE_cb_DECLARE(DSAPublicKey);
+	DECLARE_EVP_MD_ITEM(dss1_md);
+	DECLARE_MODULE_CONST_ITEM(DSA_METHOD, openssl_dsa_meth);
+#endif
+
+#ifndef OPENSSL_NO_OCSP
+	ASN1_SEQUENCE_DECLARE(OCSP_SIGNATURE);
+	ASN1_SEQUENCE_DECLARE(OCSP_CERTID);
+	ASN1_SEQUENCE_DECLARE(OCSP_ONEREQ);
+	ASN1_SEQUENCE_DECLARE(OCSP_REQINFO);
+	ASN1_SEQUENCE_DECLARE(OCSP_REQUEST);
+	ASN1_SEQUENCE_DECLARE(OCSP_RESPBYTES);
+	ASN1_SEQUENCE_DECLARE(OCSP_RESPONSE);
+	ASN1_CHOICE_DECLARE(OCSP_RESPID);
+	ASN1_SEQUENCE_DECLARE(OCSP_REVOKEDINFO);
+	ASN1_CHOICE_DECLARE(OCSP_CERTSTATUS);
+	ASN1_SEQUENCE_DECLARE(OCSP_SINGLERESP);
+	ASN1_SEQUENCE_DECLARE(OCSP_RESPDATA);
+	ASN1_SEQUENCE_DECLARE(OCSP_BASICRESP);
+	ASN1_SEQUENCE_DECLARE(OCSP_CRLID);
+	ASN1_SEQUENCE_DECLARE(OCSP_SERVICELOC);
+#endif
+
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+	ASN1_SEQUENCE_DECLARE(PKCS12);
+	ASN1_SEQUENCE_DECLARE(PKCS12_MAC_DATA);
+	ASN1_ADB_TEMPLATE_DECLARE(bag_default);
+	ASN1_ADB_SEQ_DECLARE(PKCS12_BAGS);
+	ASN1_SEQUENCE_DECLARE(PKCS12_BAGS);
+	ASN1_ADB_TEMPLATE_DECLARE(safebag_default);
+	ASN1_ADB_SEQ_DECLARE(PKCS12_SAFEBAG);
+	ASN1_SEQUENCE_DECLARE(PKCS12_SAFEBAG);
+	ASN1_ITEM_TEMPLATE_DECLARE(PKCS12_SAFEBAGS);
+	ASN1_ITEM_TEMPLATE_DECLARE(PKCS12_AUTHSAFES);
+	ASN1_SEQUENCE_DECLARE(PBEPARAM);
+#endif
+
+#ifdef LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
+	ASN1_SEQ_AUX_DECLARE(X509_REQ_INFO);
+	ASN1_SEQUENCE_DECLARE(NETSCAPE_SPKAC);
+	ASN1_SEQ_AUX_DECLARE(X509_REQ);
+	ASN1_SEQUENCE_DECLARE(NETSCAPE_SPKI);
+#endif
+
+#if defined LIBOPEAY_PKCS12_SUPPORT || defined LIBOPEAY_ASYNCHRONOUS_KEYGENERATION || defined USE_OPENSSL_CERTIFICATE_VERIFICATION
+	ASN1_SEQ_AUX_DECLARE(PKCS8_PRIV_KEY_INFO);
+#endif
+
+#if defined _SSL_USE_OPENSSL_ || defined USE_OPENSSL_CERTIFICATE_VERIFICATION
+	ASN1_SEQUENCE_DECLARE(X509_REVOKED);
+	ASN1_SEQ_AUX_DECLARE(X509_CRL);
+	ASN1_SEQ_AUX_DECLARE(X509_CRL_INFO);
+#if defined(_SSL_USE_OPENSSL_) && !defined(_USE_SYSTEM_LIBCRYPTO_)
+	ASN1_SEQ_AUX_DECLARE(NETSCAPE_CERT_SEQUENCE);
+#endif
+#endif // _SSL_USE_OPENSSL_ || USE_OPENSSL_CERTIFICATE_VERIFICATION
+
+#if defined _SSL_USE_OPENSSL_ || defined USE_OPENSSL_CERTIFICATE_VERIFICATION
+	ASN1_CHOICE_DECLARE(X509_ATTRIBUTE_SET);
+	ASN1_SEQUENCE_DECLARE(X509_ATTRIBUTE);
+#endif // _SSL_USE_OPENSSL_ || USE_OPENSSL_CERTIFICATE_VERIFICATION
+
+	DECLARE_X509V3_EXT_METHOD(v3_akey_id);
+	DECLARE_X509V3_EXT_METHOD(v3_bcons);
+	DECLARE_X509V3_EXT_METHOD(v3_cpols);
+	DECLARE_X509V3_EXT_METHOD(v3_crl_invdate);
+	DECLARE_X509V3_EXT_METHOD(v3_crl_hold);
+	DECLARE_X509V3_EXT_METHOD(v3_crl_num);
+	DECLARE_X509V3_EXT_METHOD(v3_crl_reason);
+	DECLARE_X509V3_EXT_METHOD(v3_crld);
+	DECLARE_X509V3_EXT_METHOD(v3_delta_crl);
+	DECLARE_X509V3_EXT_METHOD(v3_ext_ku);
+	DECLARE_X509V3_EXT_METHOD(v3_freshest_crl);
+	DECLARE_X509V3_EXT_METHOD(v3_idp);
+	DECLARE_X509V3_EXT_METHOD(v3_info);
+	DECLARE_X509V3_EXT_METHOD(v3_inhibit_anyp);
+	DECLARE_X509V3_EXT_METHOD(v3_key_usage);
+	DECLARE_X509V3_EXT_METHOD(v3_name_constraints);
+	DECLARE_X509V3_EXT_METHOD(v3_nscert);
+	DECLARE_X509V3_EXT_METHOD(v3_ocsp_accresp);
+	DECLARE_X509V3_EXT_METHOD(v3_ocsp_acutoff);
+	DECLARE_X509V3_EXT_METHOD(v3_ocsp_crlid);
+	DECLARE_X509V3_EXT_METHOD(v3_ocsp_nocheck);
+	DECLARE_X509V3_EXT_METHOD(v3_ocsp_nonce);
+	DECLARE_X509V3_EXT_METHOD(v3_ocsp_serviceloc);
+	DECLARE_X509V3_EXT_METHOD(v3_pci);
+	DECLARE_X509V3_EXT_METHOD(v3_pkey_usage_period);
+	DECLARE_X509V3_EXT_METHOD(v3_policy_constraints);
+	DECLARE_X509V3_EXT_METHOD(v3_policy_mappings);
+	DECLARE_X509V3_EXT_METHOD(v3_sinfo);
+	DECLARE_X509V3_EXT_METHOD(v3_skey_id);
+	DECLARE_X509V3_EXT_METHOD(v3_sxnet);
+
+#ifndef OPENSSL_NO_RFC3779
+	DECLARE_X509V3_EXT_METHOD(v3_addr);
+	DECLARE_X509V3_EXT_METHOD(v3_asid);
+#endif
+
+	DECLARE_BIO_METHOD_ITEM(bio_enc__methods_enc);
+	DECLARE_BIO_METHOD_ITEM(bio_md__methods_md);
+	DECLARE_BIO_METHOD_ITEM(bss_mem__mem_method);
+	DECLARE_BIO_METHOD_ITEM(bss_null__null_method);
+
+#ifdef _SSL_USE_OPENSSL_
+	DECLARE_BLOCK_CIPHER(aes_128);
+	DECLARE_BLOCK_CIPHER(aes_256);
+	DECLARE_BLOCK_CIPHER(des_ede3);
+	DECLARE_EVP_CIPHER_ITEM(r4_cipher);
+#endif // _SSL_USE_OPENSSL_
+#ifdef LIBOPEAY_USE_RC4_256
+	DECLARE_EVP_CIPHER_ITEM(r4_256_cipher);
+#endif
+#if defined SSL_USE_WEAK_CIPHERS
+	DECLARE_BLOCK_CIPHER(des_ede);
+	DECLARE_EVP_CIPHER_ITEM(r4_40_cipher);
+#endif
+#if defined LIBOPEAY_PKCS12_SUPPORT || defined SSL_USE_WEAK_CIPHERS
+	DECLARE_EVP_CIPHER_ITEM(rc2_cbc);
+	DECLARE_EVP_CIPHER_ITEM(r2_40_cbc_cipher);
+#endif
+
+#ifndef OPENSSL_NO_MD2
+	DECLARE_EVP_MD_ITEM(md2_md);
+#endif
+	DECLARE_EVP_MD_ITEM(md5_md);
+	DECLARE_EVP_MD_ITEM(sha1_md);
+	DECLARE_EVP_MD_ITEM(sha224_md);
+	DECLARE_EVP_MD_ITEM(sha256_md);
+	DECLARE_EVP_MD_ITEM(sha384_md);
+	DECLARE_EVP_MD_ITEM(sha512_md);
+#ifndef OPENSSL_NO_RIPEMD
+	DECLARE_EVP_MD_ITEM(ripemd160_md);
+#endif
+
+	// Const items. Sorted alphabetically by name.
+	DECLARE_MODULE_CONST_ITEM(ASN1_PRIMITIVE_FUNCS,         bignum_pf);
+	DECLARE_MODULE_CONST_ITEM(BIGNUM,                       const_one);
+#ifndef OPENSSL_NO_DH
+	DECLARE_MODULE_CONST_ITEM(DH_METHOD,                    dh_ossl);
+#endif
+#if (defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)) && !defined(_USE_SYSTEM_LIBCRYPTO_) && !defined(OPENSSL_NO_DH)
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_ASN1_METHOD,         dh_ameth__dh_asn1_meth);
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_METHOD,              dh_pmeth__dh_pkey_meth);
+#endif
+#if (defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)) && !defined(_USE_SYSTEM_LIBCRYPTO_) && !defined(OPENSSL_NO_DSA)
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_ASN1_METHOD,         dsa_ameth__dsa_asn1_meth0);
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_ASN1_METHOD,         dsa_ameth__dsa_asn1_meth1);
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_ASN1_METHOD,         dsa_ameth__dsa_asn1_meth2);
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_ASN1_METHOD,         dsa_ameth__dsa_asn1_meth3);
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_ASN1_METHOD,         dsa_ameth__dsa_asn1_meth4);
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_METHOD,              dsa_pmeth__dsa_pkey_meth);
+#endif
+
+	DECLARE_MODULE_CONST_ITEM(ERR_FNS,                      err__err_defaults);
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_ASN1_METHOD,         hm_ameth__hmac_asn1_meth);
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_METHOD,              hm_pmeth__hmac_pkey_meth);
+	DECLARE_MODULE_CONST_ITEM(ASN1_PRIMITIVE_FUNCS,         long_pf);
+#if (defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)) && !defined(_USE_SYSTEM_LIBCRYPTO_)
+	DECLARE_MODULE_CONST_ITEM(RAND_METHOD,                  rand_ssleay_meth);
+#endif
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_ASN1_METHOD,         rsa_ameth__rsa_asn1_meth0);
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_ASN1_METHOD,         rsa_ameth__rsa_asn1_meth1);
+	DECLARE_MODULE_CONST_ITEM(RSA_METHOD,                   rsa_pkcs1_eay_meth);
+	DECLARE_MODULE_CONST_ITEM(EVP_PKEY_METHOD,              rsa_pmeth__rsa_pkey_meth);
+	DECLARE_MODULE_CONST_ITEM(X509_CRL_METHOD,              x_crl__int_crl_meth);
+	DECLARE_MODULE_CONST_ITEM(ASN1_EXTERN_FUNCS,            x509_name_ff);
+
+	// Const arrays. Sorted alphabetically by name.
+	DECLARE_MODULE_CONST_ARRAY(const EVP_PKEY_ASN1_METHOD*, ameth_lib__standard_methods);
+	DECLARE_MODULE_CONST_ARRAY(struct tag_name_st,          asn1_gen__tnst);
+	DECLARE_MODULE_CONST_ARRAY(const char*,                 asn1_mon);
+	DECLARE_MODULE_CONST_ARRAY(ENUMERATED_NAMES,            crl_reasons);
+	DECLARE_MODULE_CONST_ARRAY(X509_VERIFY_PARAM,           default_table);
+#if defined(_SSL_USE_OPENSSL_) && !defined(_USE_SYSTEM_LIBCRYPTO_) && defined(LIBOPEAY_PKCS12_SUPPORT)
+	DECLARE_MODULE_CONST_ARRAY(struct evp_pbe_ctl_st,       evp_pbe__builtin_pbe);
+#endif
+	DECLARE_MODULE_CONST_ARRAY(const X509V3_EXT_METHOD*,    ext_dat__standard_exts);
+	DECLARE_MODULE_CONST_ARRAY(BIT_STRING_BITNAME,          key_usage_type_table);
+#ifndef OPERA_SMALL_VERSION
+	DECLARE_MODULE_CONST_ARRAY(unsigned int,                ln_objs);
+#endif
+#ifdef ADS12
+	DECLARE_MODULE_CONST_ARRAY(unsigned char,               lvalues);
+#endif
+	DECLARE_MODULE_CONST_ARRAY(ASN1_OBJECT,                 nid_objs);
+	DECLARE_MODULE_CONST_ARRAY(BIT_STRING_BITNAME,          ns_cert_type_table);
+	DECLARE_MODULE_CONST_ARRAY(unsigned int,                obj_objs);
+	DECLARE_MODULE_CONST_ARRAY(struct nid_triple_st,        obj_xref__sigoid_srt);
+	// It's important that obj_xref__sigoid_srt_xref is initialized
+	// after obj_xref__sigoid_srt.
+	DECLARE_MODULE_CONST_ARRAY(const struct nid_triple_st*, obj_xref__sigoid_srt_xref);
+	DECLARE_MODULE_CONST_ARRAY(const EVP_PKEY_METHOD*,      pmeth_lib__standard_methods);
+	DECLARE_MODULE_CONST_ARRAY(BIT_STRING_BITNAME,          v3_crld__reason_flags);
+#ifndef OPERA_SMALL_VERSION
+	DECLARE_MODULE_CONST_ARRAY(unsigned int,                sn_objs);
+#endif
+	DECLARE_MODULE_CONST_ARRAY(X509_TRUST,                  trstandard);
+	DECLARE_MODULE_CONST_ARRAY(X509V3_EXT_METHOD,           v3_ns_ia5_list);
+	DECLARE_MODULE_CONST_ARRAY(X509V3_EXT_METHOD,           v3_alt);
+	DECLARE_MODULE_CONST_ARRAY(X509_PURPOSE,                xstandard);
+};
+
+#define libopeay_CONST_MODULE_CLASS_NAME Libopeay_GlobalConst_Data
+
+#endif /* HAS_COMPLEX_GLOBALS */
+
+#endif /* MODULES_LIBOPEAY_LIBOPEAY_CONSTANTS_H*/
diff -Naur openssl-1.0.0q.orig/libopeay_implmodule.h openssl-1.0.0q/libopeay_implmodule.h
--- openssl-1.0.0q.orig/libopeay_implmodule.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/libopeay_implmodule.h	2017-04-25 16:23:40.899798155 +0200
@@ -0,0 +1,127 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#ifndef MODULES_LIBOPEAY_LIBOPEAY_IMPLMODULE_H
+#define MODULES_LIBOPEAY_LIBOPEAY_IMPLMODULE_H
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
+
+#ifdef OPENSSL_SYS_WIN32
+/* Under Win32 thes are defined in wincrypt.h */
+#undef PKCS7_ISSUER_AND_SERIAL
+#undef PKCS7_SIGNER_INFO
+#undef X509_NAME
+#undef X509_CERT_PAIR
+#endif
+
+#include <openssl/ossl_typ.h>
+#include <openssl/safestack.h>
+#include <openssl/lhash.h>
+#include <openssl/err.h>
+#include "modules/libopeay/crypto/rand/rand_lcl.h"
+
+/* MUST match corresponding defintion STATE_SIZE in crypto/rand/md_rand.c */
+#define LIBOPEAY_RAND_STATE_SIZE	1023
+
+#ifdef OPERA_SMALL_VERSION
+
+class Libopeay_ImplementModuleData
+{
+public:
+	/** @name Types of some variables below.
+	  *
+	  * This list is sorted by type name.
+	  *
+	  * Name format should be the same as for variables below.
+	  *
+	  * @{
+	  */
+	typedef unsigned char hmac__m_t[EVP_MAX_MD_SIZE];
+	typedef long          md_rand__md_count_t[2];
+	typedef unsigned char md_rand__md_t[MD_DIGEST_LENGTH];
+	typedef unsigned char md_rand__state_t[LIBOPEAY_RAND_STATE_SIZE+MD_DIGEST_LENGTH];
+	/** @} */
+
+	/** @name List of OpenSSL global and static variables.
+	  *
+	  * This list is sorted by variable name.
+	  *
+	  * Name format should be: FILENAME__VARNAME, where:
+	  *     FILENAME - filename wher the variable is originally defined, without extension.
+	  *                Example: obj_dat for obj_dat.c file.
+	  *     VARNAME  - variable name as it is originally defined.
+	  *                Example: new_nid.
+	  * Example of the result: obj_dat__new_nid.
+	  *
+	  * NB: old variables do not follow this naming rule.
+	  * Nevertheless, new variables should follow the rule.
+	  *
+	  * @{
+	  */
+#ifndef OPENSSL_NO_ENGINE
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(STACK_OF(ENGINE_CLEANUP_ITEM) *, cleanup_stack);
+#endif // OPENSSL_NO_ENGINE
+#if defined SSL_USE_WEAK_CIPHERS
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     DES_check_key);
+#endif
+#ifndef OPENSSL_NO_ENGINE
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(ENGINE *,                engine_list_head);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(ENGINE *,                engine_list_tail);
+#endif // OPENSSL_NO_ENGINE
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(ERR_STATE,               err__fallback);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(const ERR_FNS *,         err__err_fns);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(LHASH_OF(ERR_STRING_DATA) *, err__int_error_hash);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(LHASH_OF(ERR_STATE) *,   err__int_thread_hash);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     err__int_thread_hash_references);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     err__int_err_library_number);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(_LHASH *,                ex_data);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     free_type);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     have_perfc);
+#if defined(_MSC_VER) && defined(_M_X86)
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     have_tsc);
+#endif
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(hmac__m_t,               hmac__m);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(_LHASH *,                int_thread_hash);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     int_thread_hash_references);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(unsigned int,            md_rand__crypto_lock_rand);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(double,                  md_rand__entropy);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     md_rand__initialized);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(CRYPTO_THREADID,         md_rand__locking_threadid);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(md_rand__md_t,           md_rand__md);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(md_rand__md_count_t,     md_rand__md_count);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(md_rand__state_t,        md_rand__state);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     md_rand__state_index);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     md_rand__state_num);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(STACK_OF(NAME_FUNCS) *,  name_funcs_stack);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(_LHASH *,                names_lh);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(LHASH_OF(ADDED_OBJ) *,   obj_dat__added);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(int,                     obj_dat__new_nid);
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(_STACK *,                pbe_algs);
+#endif // LIBOPEAY_PKCS12_SUPPORT
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(volatile int,            stirred_pool);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(STACK_OF(X509_TRUST) *,  trtable);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(const X509_CRL_METHOD *, x_crl__default_crl_method);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA(STACK_OF(X509_PURPOSE)*, xptable);
+	/** @} */
+
+#ifdef LIBOPEAY_X509_EX_DATA
+	int ev_oid_x509_list_index; // Actually used by libssl, but fits better here
+#	define g_ev_oid_x509_list_index			g_opera->libopeay_module.m_data->ev_oid_x509_list_index
+#endif
+
+public:
+	Libopeay_ImplementModuleData();
+	~Libopeay_ImplementModuleData(); 	// Variables are destroyed by internal cleanup calls
+};
+
+#endif /* OPERA_SMALL_VERSION */
+
+#endif /* _SSL_USE_OPENSSL_ */
+
+#endif /* !MODULES_LIBOPEAY_LIBOPEAY_MODULE_H */
diff -Naur openssl-1.0.0q.orig/libopeay_module.cpp openssl-1.0.0q/libopeay_module.cpp
--- openssl-1.0.0q.orig/libopeay_module.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/libopeay_module.cpp	2017-04-25 16:23:40.900798283 +0200
@@ -0,0 +1,281 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+ *
+ * Copyright (C) 1995-2011 Opera Software AS.  All rights reserved.
+ *
+ * This file is part of the Opera web browser.
+ * It may not be distributed under any circumstances.
+ */
+#include "modules/libopeay/libopeay_module.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/openssl/err.h"
+#include "modules/libopeay/openssl/rand.h"
+#include "modules/libopeay/openssl/x509v3.h"
+#include "modules/libopeay/openssl/pkcs12.h"
+
+#include "modules/libopeay/libopeay_implmodule.h"
+#include "modules/libopeay/libopeay_arrays.h"
+
+#include "modules/prefs/prefsmanager/collections/pc_network.h"
+#include "modules/libssl/method_disable.h"
+
+#ifndef OPENSSL_NO_ENGINE
+# include "modules/libopeay/openssl/engine.h"
+#endif
+
+#ifdef OPERA_SMALL_VERSION
+
+extern "C"{
+
+#ifdef HAS_COMPLEX_GLOBALS
+extern X509_CRL_METHOD const OPENSSL_GLOBAL_ITEM_NAME(x_crl__int_crl_meth);
+#endif
+
+// This list is sorted by variable name.
+#ifndef OPENSSL_NO_ENGINE
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(STACK_OF(ENGINE_CLEANUP_ITEM) *, cleanup_stack);
+#endif
+#if defined SSL_USE_WEAK_CIPHERS
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     DES_check_key);
+#endif
+#ifndef OPENSSL_NO_ENGINE
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(ENGINE *,                engine_list_head);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(ENGINE *,                engine_list_tail);
+#endif
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(ERR_STATE,               err__fallback);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(const ERR_FNS *,         err__err_fns);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(LHASH_OF(ERR_STRING_DATA) *, err__int_error_hash);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(LHASH_OF(ERR_STATE) *,   err__int_thread_hash);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     err__int_thread_hash_references);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     err__int_err_library_number);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(_LHASH *,                ex_data);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     free_type);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     have_perfc);
+#if defined(_MSC_VER) && defined(_M_X86)
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     have_tsc);
+#endif
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(Libopeay_ImplementModuleData::hmac__m_t, hmac__m);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(_LHASH *,                int_thread_hash);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     int_thread_hash_references);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(unsigned int,            md_rand__crypto_lock_rand);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(double,                  md_rand__entropy);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     md_rand__initialized);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(CRYPTO_THREADID,         md_rand__locking_threadid);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(Libopeay_ImplementModuleData::md_rand__md_t,       md_rand__md);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(Libopeay_ImplementModuleData::md_rand__md_count_t, md_rand__md_count);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(Libopeay_ImplementModuleData::md_rand__state_t,    md_rand__state);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     md_rand__state_index);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     md_rand__state_num);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(STACK_OF(NAME_FUNCS) *,  name_funcs_stack);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(_LHASH *,                names_lh);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(LHASH_OF(ADDED_OBJ) *,   obj_dat__added);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(int,                     obj_dat__new_nid);
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(_STACK *,                pbe_algs);
+#endif
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(volatile int,            stirred_pool);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(STACK_OF(X509_TRUST) *,  trtable);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(const X509_CRL_METHOD *, x_crl__default_crl_method);
+OPENSSL_IMPLEMENT_GLOBAL_OPERA_FUN(STACK_OF(X509_PURPOSE) *, xptable);
+
+// Implementation resides in modules/libopeay/addon/purposes.h.
+int AddOperaSpecificPurposes();
+
+} // extern "C"
+
+Libopeay_ImplementModuleData::Libopeay_ImplementModuleData()
+{
+	// This list is sorted by variable name.
+#ifndef OPENSSL_NO_ENGINE
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(cleanup_stack)              = NULL;
+#endif
+#if defined SSL_USE_WEAK_CIPHERS
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(DES_check_key)              = 0;
+#endif
+#ifndef OPENSSL_NO_ENGINE
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(engine_list_head) = NULL;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(engine_list_tail) = NULL;
+#endif
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(err__err_fns                = NULL);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(err__int_error_hash         = NULL);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(err__int_thread_hash        = NULL);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(err__int_thread_hash_references = 0);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(err__int_err_library_number = ERR_LIB_USER);
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(ex_data)                    = NULL;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(free_type)                  = 0;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(have_perfc)                 = 1;
+#if defined(_MSC_VER) && defined(_M_X86)
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(have_tsc)                   = 1;
+#endif
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(int_thread_hash)            = NULL;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(int_thread_hash_references) = 0;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(md_rand__crypto_lock_rand)  = 0;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(md_rand__entropy)           = 0;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(md_rand__initialized)       = 0;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(md_rand__state_index)       = 0;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(md_rand__state_num)         = 0;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(name_funcs_stack)           = NULL;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(names_lh)                   = NULL;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(obj_dat__added)             = NULL;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(obj_dat__new_nid)           = 0;
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(pbe_algs)                   = NULL;
+#endif
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(stirred_pool)               = 0;
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(trtable)                    = NULL;
+#if defined(_SSL_USE_OPENSSL_) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(x_crl__default_crl_method)  = &OPENSSL_GLOBAL_ITEM_NAME(x_crl__int_crl_meth);
+#endif
+	OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(xptable)                    = NULL;
+
+#ifdef LIBOPEAY_X509_EX_DATA
+	ev_oid_x509_list_index = -1;
+#endif
+
+# define MEMSET0(a) op_memset(&OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(a), 0, sizeof(OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(a)));
+
+	// Init arrays and structures by binary nulls.
+	MEMSET0(err__fallback);
+	MEMSET0(hmac__m);
+	MEMSET0(md_rand__locking_threadid);
+	MEMSET0(md_rand__md);
+	MEMSET0(md_rand__md_count);
+	MEMSET0(md_rand__state);
+
+# undef MEMSET0
+}
+
+// Copied from err.c
+#define err_clear_data(p,i) \
+	do { \
+	if (((p)->err_data[i] != NULL) && \
+		(p)->err_data_flags[i] & ERR_TXT_MALLOCED) \
+		{  \
+		OPENSSL_free((p)->err_data[i]); \
+		(p)->err_data[i]=NULL; \
+		} \
+	(p)->err_data_flags[i]=0; \
+	} while(0)
+
+#define err_clear(p,i) \
+	do { \
+	(p)->err_flags[i]=0; \
+	(p)->err_buffer[i]=0; \
+	err_clear_data(p,i); \
+	} while(0)
+
+Libopeay_ImplementModuleData::~Libopeay_ImplementModuleData()
+{
+	if (g_opera->libopeay_module.m_data)
+	{
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+		EVP_PBE_cleanup();
+#endif
+#ifndef OPENSSL_NO_ENGINE 
+		ENGINE_cleanup();
+#endif
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+		CRYPTO_cleanup_all_ex_data();
+#endif
+
+		ERR_remove_thread_state(NULL);
+	}	
+
+	ERR_STATE *err_fallback = &OPENSSL_IMPLEMENT_GLOBAL_OPERA_NAME(err__fallback);
+	for (int i=0; i<ERR_NUM_ERRORS; i++)
+	{
+		err_clear(err_fallback, i);
+	}
+	err_fallback->top=err_fallback->bottom=0;
+}
+
+LibopeayModule::LibopeayModule() : 
+#ifndef HAS_COMPLEX_GLOBALS
+	m_consts(NULL),
+#endif
+	m_data(NULL)
+#if !defined LIBOPEAY_DISABLE_MD5_PARTIAL
+	, turn_off_md5(FALSE)
+#endif
+#if !defined LIBOPEAY_DISABLE_SHA1_PARTIAL
+	, turn_off_sha1(FALSE)
+#endif
+{
+}
+
+void LibopeayModule::InitL(const OperaInitInfo& info)
+{
+#ifndef HAS_COMPLEX_GLOBALS
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+	InitGlobalsL();
+#endif
+#endif
+
+	m_data = OP_NEW_L(Libopeay_ImplementModuleData, ());
+
+#ifndef LIBOPEAY_DISABLE_MD5_PARTIAL
+	turn_off_md5  = ((g_pcnet->GetIntegerPref(PrefsCollectionNetwork::CryptoMethodOverride) & CRYPTO_METHOD_DISABLE_MD5) != 0 ? TRUE : FALSE);
+#endif
+#ifndef LIBOPEAY_DISABLE_SHA1_PARTIAL
+	turn_off_sha1 = ((g_pcnet->GetIntegerPref(PrefsCollectionNetwork::CryptoMethodOverride) & CRYPTO_METHOD_DISABLE_SHA1) != 0 ? TRUE : FALSE);
+#endif
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+
+#ifndef OPENSSL_NO_ENGINE
+	ENGINE_load_openssl();
+#endif
+
+	OpenSSL_add_all_ciphers();
+	OpenSSL_add_all_digests();
+
+	int purposes_err = AddOperaSpecificPurposes();
+	int other_err    = ERR_peek_error();
+	ERR_clear_error();
+
+	if(purposes_err != 1 || other_err != 0)
+		LEAVE(OpStatus::ERR);
+
+#endif // defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+}
+
+void LibopeayModule::Destroy()
+{
+}
+
+LibopeayModule::~LibopeayModule()
+{
+	// if cleaning up due to startup failure, libopeay might not have been initialised
+	if (m_data)
+	{
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+
+#ifdef LIBOPEAY_PKCS12_SUPPORT
+		EVP_PBE_cleanup();
+#endif
+		EVP_cleanup();
+		X509_PURPOSE_cleanup();
+		//X509_TRUST_cleanup();
+#ifndef OPENSSL_NO_ENGINE
+		ENGINE_cleanup();
+#endif
+		CRYPTO_cleanup_all_ex_data();
+
+		ERR_remove_thread_state(NULL);
+#endif // _SSL_USE_OPENSSL_
+
+		OP_DELETE(m_data);
+		m_data = NULL;
+
+#endif // defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+	}
+
+#ifndef HAS_COMPLEX_GLOBALS
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+	DestroyGlobals();
+#endif
+#endif
+}
+
+#endif // OPERA_SMALL_VERSION
diff -Naur openssl-1.0.0q.orig/libopeay_module.h openssl-1.0.0q/libopeay_module.h
--- openssl-1.0.0q.orig/libopeay_module.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/libopeay_module.h	2017-04-25 16:23:40.900798283 +0200
@@ -0,0 +1,79 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+#ifndef MODULES_LIBOPEAY_LIBOPEAY_MODULE_H
+#define MODULES_LIBOPEAY_LIBOPEAY_MODULE_H
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
+
+#ifndef CLEAR_PASSWD_FROM_MEMORY
+#error "For security reasons FEATURE_CLEAR_PASSWORDS *MUST* be YES when libssl with libopeay is used"
+#endif
+
+#include "modules/hardcore/opera/module.h"
+#include "modules/util/simset.h"
+
+class Libopeay_ImplementModuleData;
+class Libopeay_GlobalConst_Data;
+
+class LibopeayModule : public OperaModule
+{
+#ifndef HAS_COMPLEX_GLOBALS
+private:
+	Head global_const_list;
+
+public:
+	Libopeay_GlobalConst_Data *m_consts;
+#endif
+
+public:
+	Libopeay_ImplementModuleData *m_data;
+
+public:
+	LibopeayModule();
+	virtual void InitL(const OperaInitInfo& info);
+
+	virtual void Destroy();
+	virtual ~LibopeayModule();
+
+#ifndef HAS_COMPLEX_GLOBALS
+	class Libopeay_ConstBase : public Link
+	{
+	public:
+		Libopeay_ConstBase();
+		virtual ~Libopeay_ConstBase();
+		virtual void InitL(int phase)=0;
+		virtual void Destroy()=0;
+	};
+
+	void AddComplexConstGlobal(Libopeay_ConstBase *item);
+
+private:
+	void InitGlobalsL();
+	void InitGlobalsPhaseL(int phase);
+	void DestroyGlobals();
+
+#endif
+public:
+#if !defined LIBOPEAY_DISABLE_MD5_PARTIAL
+	BOOL turn_off_md5;
+#endif
+#if !defined LIBOPEAY_DISABLE_SHA1_PARTIAL
+	BOOL turn_off_sha1;
+#endif
+};
+
+#define LIBOPEAY_MODULE_REQUIRED
+
+#define g_libopeay_module			g_opera->libopeay_module
+#define g_turn_off_md5				g_libopeay_module.turn_off_md5
+#define g_turn_off_sha1				g_libopeay_module.turn_off_sha1
+
+#endif /* _SSL_USE_OPENSSL_ */
+
+#endif /* !MODULES_LIBOPEAY_LIBOPEAY_MODULE_H */
diff -Naur openssl-1.0.0q.orig/module.about openssl-1.0.0q/module.about
--- openssl-1.0.0q.orig/module.about	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/module.about	2017-04-25 16:23:40.901798130 +0200
@@ -0,0 +1,7 @@
+module:             libopeay
+core group:         network
+owner:              alexeik
+co-owners:          haavardm
+others:
+core qa:            sadrabinski
+description:        OpenSSL crypto library version 0.9.8k. Must ONLY be used by the libssl, externalssl or libcrypto module.
diff -Naur openssl-1.0.0q.orig/module.export openssl-1.0.0q/module.export
--- openssl-1.0.0q.orig/module.export	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/module.export	2017-04-25 16:23:40.901798130 +0200
@@ -0,0 +1,124 @@
+
+API_LIBOPEAY_OPENSSL_SUPPORT			yngve
+
+	Activates the use of OpenSSL crypto export
+
+	Defines		: OPERA_SMALL_VERSION, OPENSSL_NO_RAND_FILE
+	Depends on	: _SSL_USE_OPENSSL_, FEATURE_NATIVE_SSL
+
+API_LIBOPEAY_ELGAMAL_SUPPORT			yngve
+
+	This API activates the ElGamal public key encryption support
+
+	Defines		: NEED_LIBOPEAY_ELGAMAL
+
+API_LIBOPEAY_CFB_SUPPORT			yngve
+
+	This API activates the CFB encryption support
+
+	Defines		: NEED_LIBOPEAY_CFB_SUPPORT
+
+API_LIBOPEAY_CAST_RIPE_SUPPORT			yngve
+
+	This API activates the CAST and RIPEMD support
+
+	Defines		: NEED_LIBOPEAY_CAST_RIPE_SUPPORT
+
+API_LIBOPEAY_VERIFY_PARAM						yngve
+
+	Activates code needed by extended validation code
+
+	Defines		:  OPERA_NEED_TXT2OBJ, OPERA_NEED_POLICY_FUN, OPERA_NEED_VERIFY_PARAM
+
+API_LIBOPEAY_ASYNCHRONOUS_KEYGENERATION	haavardm		
+
+	This enables asynchronous generation of rsa key pairs 
+
+	Defines		: LIBOPEAY_ASYNCHRONOUS_KEYGENERATION
+	Depends on	: _SSL_USE_OPENSSL_
+	
+API_LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT	haavardm
+	In case libcrypto want to "rip-out" a few algorithms without using all of libopeay.
+	This ensures that some important defines are set. Only libcrypto should import this.
+
+	Defines		: LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT, OPERA_SMALL_VERSION
+	Depends on	: API_CRYPTO_API
+
+API_LIBOPEAY_X509_EX_DATA		yngve
+
+	This enables the external data API in the X509 objects
+	
+	Defines		:	LIBOPEAY_X509_EX_DATA
+	Depends on	: FEATURE_SSL, FEATURE_NATIVE_SSL, FEATURE_3P_OPENSSL
+
+API_LIBOPEAY_PKCS12     yngve
+
+	This enables the PKCS #12 code in libopeay, allowing export and import of
+	certificates with their private keys.
+
+	Defines		:	LIBOPEAY_PKCS12_SUPPORT
+	Depends on	: FEATURE_SSL, FEATURE_NATIVE_SSL, FEATURE_3P_OPENSSL
+
+API_LIBOPEAY_RC4_256		yngve
+
+	This activates support for the 256 bit version of RC4
+	
+	Defines		: LIBOPEAY_USE_RC4_256
+	Depends on	: FEATURE_SSL, FEATURE_NATIVE_SSL, FEATURE_3P_OPENSSL
+
+API_USE_OPENSSL_CERTIFICATE_VERIFICATION haavardm
+	This gives the option to use certificate verification without turning on the  whole libopeay module.
+	Footprint of this option is not known (but probably quite big).  Only libcrypto can import this API. Use this
+	functionality from libcrypto instead.
+
+	Defines		: USE_OPENSSL_CERTIFICATE_VERIFICATION
+	Depends on 	: !FEATURE_NATIVE_SSL and CRYPTO_API_SUPPORT
+
+API_USE_OPENSSL_OCSP                                        alexeik
+	Enables OCSP code.
+
+	Defines		: USE_OPENSSL_OCSP
+	Depends on 	: USE_OPENSSL_CERTIFICATE_VERIFICATION
+
+API_LIBOPEAY_HASH_SHA512	haavardm
+	Rips out SHA512. Only libcrypto can import this API. Use this
+	functionality from libcrypto instead.
+
+	Defines		: LIBOPEAY_HASH_SHA512_SUPPORT
+	Depends on 	: !FEATURE_NATIVE_SSL and CRYPTO_API_SUPPORT
+
+API_LIBOPEAY_HASH_SHA256	haavardm
+	Rips out SHA256. Only libcrypto can import this API. Use this
+	functionality from libcrypto instead.
+
+	Defines		: LIBOPEAY_HASH_SHA256_SUPPORT
+	Depends on 	: !FEATURE_NATIVE_SSL and CRYPTO_API_SUPPORT
+
+API_LIBOPEAY_HASH_SHA1	haavardm
+	Rips out SHA1. Only libcrypto can import this API. Use this
+	functionality from libcrypto instead. 
+
+	Defines		: LIBOPEAY_HASH_SHA1_SUPPORT
+	Depends on 	: !FEATURE_NATIVE_SSL and CRYPTO_API_SUPPORT
+
+API_LIBOPEAY_HASH_MD5	haavardm
+	Rips out MD5. Only libcrypto can import this API. Use this
+	functionality from libcrypto instead.
+
+	Defines		: LIBOPEAY_HASH_MD5_SUPPORT
+	Depends on 	: !FEATURE_NATIVE_SSL and CRYPTO_API_SUPPORT
+
+API_LIBOPEAY_ENCRYPTION_AES	haavardm
+	Rips out AES. Only libcrypto can import this API. Use this
+	functionality from libcrypto instead .
+
+	Defines		: LIBOPEAY_ENCRYPTION_AES_SUPPORT
+	Depends on 	: !FEATURE_NATIVE_SSL and CRYPTO_API_SUPPORT
+
+API_LIBOPEAY_STREAM_ENCRYPTION_RC4	haavardm
+	Rips out RC4. Only libcrypto can import this API. Use this
+	functionality from libcrypto instead .
+
+	Defines		: LIBOPEAY_STREAM_ENCRYPTION_RC4_SUPPORT
+	Depends on 	: !FEATURE_NATIVE_SSL and CRYPTO_API_SUPPORT
+	
\ No newline at end of file
diff -Naur openssl-1.0.0q.orig/module.ignore openssl-1.0.0q/module.ignore
--- openssl-1.0.0q.orig/module.ignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/module.ignore	2017-04-25 16:23:40.901798130 +0200
@@ -0,0 +1,189 @@
+crypto/LPdir_unix.c
+crypto/LPdir_vms.c
+crypto/LPdir_win.c
+crypto/aes/aes_ige.c
+crypto/asn1/asn1_gen.c
+crypto/asn1/asn1_par.c
+crypto/asn1/asn_mime.c
+crypto/asn1/evp_asn1.c
+crypto/asn1/f_enum.c
+crypto/asn1/f_int.c
+crypto/asn1/f_string.c
+crypto/asn1/n_pkey.c
+crypto/asn1/p5_pbev2.c
+crypto/asn1/t_pkey.c
+crypto/bf/bf_ofb64.c
+crypto/bf/bf_opts.c
+crypto/bf/bfspeed.c
+crypto/bf/bftest.c
+crypto/bio/b_sock.c
+crypto/bio/bio_cb.c
+crypto/bio/bss_conn.c
+crypto/bio/bss_file.c
+crypto/bio/bss_log.c
+crypto/bio/bss_rtcp.c
+crypto/bn/bn_opt.c
+crypto/bn/divtest.c
+crypto/camellia/cmll_cfb.c
+crypto/cast/c_ofb64.c
+crypto/cast/cast_spd.c
+crypto/cast/castopts.c
+crypto/cast/casttest.c
+crypto/cms/cms_dd.c
+crypto/cms/cms_ess.c
+crypto/cms/cms_sd.c
+crypto/cms/cms_smime.c
+crypto/conf/conf_def.c
+crypto/conf/conf_mod.c
+crypto/cversion.c
+crypto/des/des.c
+crypto/des/des.h
+crypto/des/des_lib.c
+crypto/des/des_old.h
+crypto/des/des_opts.c
+crypto/des/destest.c
+crypto/des/ecb_enc.c
+crypto/des/enc_writ.c
+crypto/des/fcrypt.c
+crypto/des/read_pwd.c
+crypto/des/rpc_des.h
+crypto/des/speed.c
+crypto/dh/dhtest.c
+crypto/dsa/dsa_gen.c
+crypto/dsa/dsagen.c
+crypto/dsa/dsatest.c
+crypto/dso/dso_vms.c
+crypto/ebcdic.h
+crypto/ebcdic.h
+crypto/ec/ectest.c
+crypto/ecdh/ecdhtest.c
+crypto/ecdsa/ecdsatest.c
+crypto/engine/eng_cryptodev.c
+crypto/engine/eng_openssl.c
+crypto/engine/eng_padlock.c
+crypto/engine/enginetest.c
+crypto/err/err_prn.c
+crypto/evp/bio_b64.c
+crypto/evp/bio_enc.c
+crypto/evp/bio_ok.c
+crypto/evp/evp.h
+crypto/evp/evp_test.c
+crypto/evp/openbsd_hw.c
+crypto/evp/p5_crpt.c
+crypto/evp/p5_crpt2.c
+crypto/evp/p_seal.c
+crypto/hmac/hmac.c
+crypto/hmac/hmac.h
+crypto/hmac/hmactest.c
+crypto/idea/i_ofb64.c
+crypto/idea/idea_spd.c
+crypto/idea/ideatest.c
+crypto/jpake/jpake.c
+crypto/jpake/jpake.h
+crypto/lhash/lh_test.c
+crypto/md2/md2.c
+crypto/md2/md2.h
+crypto/md2/md2_one.c
+crypto/md2/md2test.c
+crypto/md4/md4.c
+crypto/md4/md4_one.c
+crypto/md4/md4s.cpp
+crypto/md4/md4test.c
+crypto/md5/md5.c
+crypto/md5/md5_one.c
+crypto/md5/md5s.cpp
+crypto/md5/md5test.c
+crypto/mdc2/mdc2.h
+crypto/mdc2/mdc2_one.c
+crypto/mdc2/mdc2dgst.c
+crypto/mdc2/mdc2test.c
+crypto/mem_dbg.c
+crypto/ocsp/ocsp_ht.c
+crypto/ocsp/ocsp_srv.c
+crypto/pem/pem.h
+crypto/pem/pem_info.c
+crypto/pem/pem_lib.c
+crypto/pem/pem_pk8.c
+crypto/pem/pem_pkey.c
+crypto/pem/pem_seal.c
+crypto/pkcs12/p12_decr.c
+crypto/pkcs12/p12_npas.c
+crypto/pkcs7/bio_ber.c
+crypto/pkcs7/dec.c
+crypto/pkcs7/enc.c
+crypto/pkcs7/pk7_doit.c
+crypto/pkcs7/pk7_mime.c
+crypto/pkcs7/pk7_smime.c
+crypto/pkcs7/sign.c
+crypto/pkcs7/verify.c
+crypto/rand/rand_os2.c
+crypto/rand/rand_vms.c
+crypto/rand/randfile.c
+crypto/rand/randtest.c
+crypto/rc2/rc2ofb64.c
+crypto/rc2/rc2speed.c
+crypto/rc2/rc2test.c
+crypto/rc4/rc4.c
+crypto/rc4/rc4s.cpp
+crypto/rc4/rc4speed.c
+crypto/rc4/rc4test.c
+crypto/rc5/rc5ofb64.c
+crypto/rc5/rc5speed.c
+crypto/ripemd/asm/rips.cpp
+crypto/ripemd/rmd160.c
+crypto/ripemd/rmd_one.c
+crypto/ripemd/rmdtest.c
+crypto/rsa/rsa_oaep.c
+crypto/rsa/rsa_pss.c
+crypto/rsa/rsa_test.c
+crypto/seed/seed_cbc.c
+crypto/sha/sha.c
+crypto/sha/sha.h
+crypto/sha/sha1.c
+crypto/sha/sha1_one.c
+crypto/sha/sha1s.cpp
+crypto/sha/sha1test.c
+crypto/sha/sha256t.c
+crypto/sha/sha512t.c
+crypto/sha/sha_one.c
+crypto/sha/shatest.c
+crypto/threads/mttest.c
+crypto/threads/th-lock.c
+crypto/ui/ui_openssl.c
+crypto/ui/ui_util.c
+crypto/x509/x509.h
+crypto/x509/x509_txt.c
+crypto/x509v3/v3_addr.c
+engines/e_4758cca.c
+engines/e_capi.c
+engines/e_chil.c
+engines/e_cswift.c
+engines/vendor_defns/hw_ubsec.h
+engines/vendor_defns/hw_ubsec.h
+fips/aes/fips_aes_selftest.c
+fips/aes/fips_aesavs.c
+fips/des/fips_des_selftest.c
+fips/des/fips_desmovs.c
+fips/dsa/fips_dsa_gen.c
+fips/dsa/fips_dsa_selftest.c
+fips/dsa/fips_dsa_sign.c
+fips/dsa/fips_dsatest.c
+fips/dsa/fips_dssvs.c
+fips/fips.c
+fips/fips_premain.c
+fips/fips_test_suite.c
+fips/fips_utl.h
+fips/hmac/fips_hmac.c
+fips/hmac/fips_hmac_selftest.c
+fips/hmac/fips_hmactest.c
+fips/rand/fips_rand.c
+fips/rand/fips_rand_selftest.c
+fips/rand/fips_randtest.c
+fips/rand/fips_rngvs.c
+fips/rsa/fips_rsa_sign.c
+fips/sha/fips_sha1_selftest.c
+fips/sha/fips_shatest.c
+fips/sha/fips_standalone_sha1.c
+openssl/ebcdic.h
+openssl/mdc2.h
+openssl/des_old.h
diff -Naur openssl-1.0.0q.orig/module.import openssl-1.0.0q/module.import
--- openssl-1.0.0q.orig/module.import	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/module.import	2017-04-25 16:23:40.902797419 +0200
@@ -0,0 +1,3 @@
+API_UTIL_CHECKED_STRFTIME	haavardm
+
+	A wrapper function that checks that the time is sane
diff -Naur openssl-1.0.0q.orig/module.sources openssl-1.0.0q/module.sources
--- openssl-1.0.0q.orig/module.sources	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/module.sources	2017-04-25 16:23:40.902797419 +0200
@@ -0,0 +1,288 @@
+# [no-jumbo]
+# Note: don't use jumbo-compile for libopeay, because this code
+# contains a lot of wrappers around external C-sources which
+# contain a lot of #define macros and static local functions which
+# generate a lot of conflicting declarations...
+# Note: this file is automatically generated by create_wrappers.py
+# source-files and options are preserved, but comments are not ...
+
+opera_libopeay_constants.cpp       # [cpp;include-with-system-lib;forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+opera_libopeay_module.cpp          # [cpp;include-with-system-lib;forcecompileif=defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)]
+addon/opera_asynch_rsa_gen.cpp     # [include-with-system-lib]
+addon/opera_cert_ex_data.cpp       # [include-with-system-lib;forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+addon/opera_digestex.cpp           # [include-with-system-lib]
+addon/opera_elgamal.cpp            # [include-with-system-lib]
+addon/opera_libopeay_util.cpp      # [cpp;include-with-system-lib;forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+addon/opera_purposes.cpp           # [include-with-system-lib;forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+addon/opera_utcprint.cpp           # [include-with-system-lib]
+crypto/aes/opera_aes_cbc.cpp       # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/aes/opera_aes_cfb.cpp       # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/aes/opera_aes_core.cpp      # [winnopch;no-pch;system_includes;forcecompileif=defined(LIBOPEAY_ENCRYPTION_AES_SUPPORT)]
+crypto/asn1/opera_a_bitstr.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_a_bytes.cpp      # [external-ssl-only]
+crypto/asn1/opera_a_digest.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_a_dup.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_a_enum.cpp       # [forcecompileif=defined(USE_OPENSSL_OCSP) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_a_gentm.cpp      # [forcecompileif=defined(USE_OPENSSL_OCSP) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_a_int.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_a_mbstr.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_a_object.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_a_octet.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_a_print.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_a_set.cpp        # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_a_sign.cpp
+crypto/asn1/opera_a_strex.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_a_strnid.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_a_time.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_a_type.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_a_utctm.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_a_utf8.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_a_verify.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_ameth_lib.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_asn1_gen.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_asn1_lib.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_asn_pack.cpp     # [forcecompileif=defined(USE_OPENSSL_OCSP)]
+crypto/asn1/opera_d2i_pr.cpp       # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_d2i_pu.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_evp_asn1.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_i2d_pr.cpp
+crypto/asn1/opera_i2d_pu.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_nsseq.cpp
+crypto/asn1/opera_p5_pbe.cpp
+crypto/asn1/opera_p5_pbev2.cpp
+crypto/asn1/opera_p8_pkey.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_t_pkey.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_t_x509.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_tasn_dec.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_tasn_enc.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_tasn_fre.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_tasn_new.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_tasn_typ.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_tasn_utl.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_x_algor.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_x_attrib.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_x_bignum.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_x_crl.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/asn1/opera_x_exten.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_x_long.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_x_name.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_x_pubkey.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_x_req.cpp
+crypto/asn1/opera_x_sig.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_x_spki.cpp
+crypto/asn1/opera_x_val.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_x_x509.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/asn1/opera_x_x509a.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bf/opera_bf_cfb64.cpp
+crypto/bf/opera_bf_enc.cpp
+crypto/bf/opera_bf_skey.cpp
+crypto/bio/opera_b_print.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bio/opera_bf_buff.cpp       # [external-ssl-only]
+crypto/bio/opera_bio_lib.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/bio/opera_bss_mem.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bio/opera_bss_null.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/bio/opera_bss_sock.cpp      # [external-ssl-only]
+crypto/bn/opera_bn_add.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_asm.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_ctx.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_div.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_exp.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_exp2.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_gcd.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/bn/opera_bn_lib.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_mod.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_mont.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_mul.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_prime.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/bn/opera_bn_print.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_rand.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/bn/opera_bn_recp.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_shift.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_sqr.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/bn/opera_bn_word.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/buffer/opera_buffer.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/cast/opera_c_cfb64.cpp
+crypto/cast/opera_c_enc.cpp
+crypto/cast/opera_c_skey.cpp
+crypto/conf/opera_conf_mod.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/des/opera_cfb64ede.cpp
+crypto/des/opera_cfb64enc.cpp
+crypto/des/opera_cfb_enc.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/des/opera_des_enc.cpp       # [winnopch;no-pch;system_includes;forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/des/opera_set_key.cpp       # [winnopch;no-pch;system_includes;forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/dh/opera_dh_ameth.cpp
+crypto/dh/opera_dh_asn1.cpp
+crypto/dh/opera_dh_check.cpp
+crypto/dh/opera_dh_gen.cpp
+crypto/dh/opera_dh_key.cpp
+crypto/dh/opera_dh_lib.cpp
+crypto/dh/opera_dh_pmeth.cpp
+crypto/dsa/opera_dsa_ameth.cpp
+crypto/dsa/opera_dsa_asn1.cpp
+crypto/dsa/opera_dsa_gen.cpp
+crypto/dsa/opera_dsa_key.cpp
+crypto/dsa/opera_dsa_lib.cpp
+crypto/dsa/opera_dsa_ossl.cpp
+crypto/dsa/opera_dsa_pmeth.cpp
+crypto/dsa/opera_dsa_sign.cpp
+crypto/dsa/opera_dsa_vrf.cpp
+crypto/err/opera_err.cpp           # [forcecompileif=defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)]
+crypto/evp/opera_bio_enc.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_bio_md.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_c_allc.cpp        # [include-with-system-lib;forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/evp/opera_c_alld.cpp        # [include-with-system-lib;forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/evp/opera_digest.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/evp/opera_e_aes.cpp         # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_e_bf.cpp
+crypto/evp/opera_e_cast.cpp
+crypto/evp/opera_e_des.cpp
+crypto/evp/opera_e_des3.cpp        # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_e_rc2.cpp
+crypto/evp/opera_e_rc4.cpp         # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_encode.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/evp/opera_evp_enc.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_evp_key.cpp
+crypto/evp/opera_evp_lib.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/evp/opera_evp_pbe.cpp
+crypto/evp/opera_evp_pkey.cpp      # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_m_dss1.cpp
+crypto/evp/opera_m_md5.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/evp/opera_m_ripemd.cpp
+crypto/evp/opera_m_sigver.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_m_sha1.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/evp/opera_names.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/evp/opera_p_lib.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_p_sign.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_p_verify.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/evp/opera_p5_crpt.cpp
+crypto/evp/opera_pmeth_fn.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/evp/opera_pmeth_gn.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/evp/opera_pmeth_lib.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/hmac/opera_hm_ameth.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/hmac/opera_hm_pmeth.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/hmac/opera_hmac.cpp         # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/lhash/opera_lhash.cpp       # [forcecompileif=defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/md5/opera_md5_dgst.cpp      # [forcecompileif=defined(LIBOPEAY_HASH_MD5_SUPPORT)]
+crypto/modes/opera_cbc128.cpp      # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/objects/opera_o_names.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/objects/opera_obj_dat.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/objects/opera_obj_lib.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/objects/opera_obj_xref.cpp  # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/ocsp/opera_ocsp_asn.cpp     # [forcecompileif=defined(USE_OPENSSL_OCSP) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/ocsp/opera_ocsp_cl.cpp      # [forcecompileif=defined(USE_OPENSSL_OCSP)]
+crypto/ocsp/opera_ocsp_ext.cpp     # [forcecompileif=defined(USE_OPENSSL_OCSP)]
+crypto/ocsp/opera_ocsp_lib.cpp     # [forcecompileif=defined(USE_OPENSSL_OCSP)]
+crypto/ocsp/opera_ocsp_vfy.cpp     # [forcecompileif=defined(USE_OPENSSL_OCSP)]
+crypto/opera_cryptlib.cpp          # [winnopch;no-pch;system_includes;forcecompileif=defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)]
+crypto/opera_ex_data.cpp           # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/opera_mem.cpp               # [forcecompileif=defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)]
+crypto/opera_o_time.cpp            # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/pem/opera_pem_all.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/pem/opera_pem_lib.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/pem/opera_pem_oth.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/pem/opera_pem_x509.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/pem/opera_pem_xaux.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/pkcs12/opera_p12_add.cpp
+crypto/pkcs12/opera_p12_asn.cpp
+crypto/pkcs12/opera_p12_attr.cpp
+crypto/pkcs12/opera_p12_crpt.cpp
+crypto/pkcs12/opera_p12_crt.cpp
+crypto/pkcs12/opera_p12_decr.cpp
+crypto/pkcs12/opera_p12_init.cpp
+crypto/pkcs12/opera_p12_key.cpp
+crypto/pkcs12/opera_p12_kiss.cpp
+crypto/pkcs12/opera_p12_mutl.cpp
+crypto/pkcs12/opera_p12_p8d.cpp
+crypto/pkcs12/opera_p12_p8e.cpp
+crypto/pkcs12/opera_p12_utl.cpp
+crypto/pkcs7/opera_pk7_asn1.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/pkcs7/opera_pk7_attr.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/pkcs7/opera_pk7_doit.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/pkcs7/opera_pk7_lib.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/rand/opera_md_rand.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/rand/opera_rand_egd.cpp     # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/rand/opera_rand_lib.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/rand/opera_rand_unix.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/rand/opera_rand_win.cpp     # [winnopch;no-pch;system_includes;forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/rc2/opera_rc2_cbc.cpp
+crypto/rc2/opera_rc2_skey.cpp
+crypto/rc2/opera_rc2cfb64.cpp
+crypto/rc4/opera_rc4_enc.cpp       # [forcecompileif=defined(LIBOPEAY_STREAM_ENCRYPTION_RC4_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/rc4/opera_rc4_skey.cpp      # [forcecompileif=defined(LIBOPEAY_STREAM_ENCRYPTION_RC4_SUPPORT) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/ripemd/opera_rmd_dgst.cpp
+crypto/rsa/opera_rsa_ameth.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/rsa/opera_rsa_asn1.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/rsa/opera_rsa_eay.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/rsa/opera_rsa_gen.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/rsa/opera_rsa_lib.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/rsa/opera_rsa_oaep.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/rsa/opera_rsa_pk1.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/rsa/opera_rsa_pmeth.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/rsa/opera_rsa_pss.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/rsa/opera_rsa_sign.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/rsa/opera_rsa_x931.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/sha/opera_sha1dgst.cpp      # [forcecompileif=defined(LIBOPEAY_HASH_SHA1_SUPPORT)]
+crypto/sha/opera_sha256.cpp        # [forcecompileif=defined(LIBOPEAY_HASH_SHA256_SUPPORT)]
+crypto/sha/opera_sha512.cpp        # [forcecompileif=defined(LIBOPEAY_HASH_SHA512_SUPPORT)]
+crypto/stack/opera_stack.cpp       # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION) || defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/x509/opera_x509_att.cpp     # [forcecompileif=defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)]
+crypto/x509/opera_x509_cmp.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509/opera_x509_ext.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509/opera_x509_lu.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509/opera_x509_obj.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509/opera_x509_trs.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509/opera_x509_v3.cpp      # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509/opera_x509_vfy.cpp     # [include-with-system-lib;forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509/opera_x509_vpm.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509/opera_x509name.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509/opera_x509type.cpp     # [external-ssl-only]
+crypto/x509/opera_x_all.cpp        # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_pcy_cache.cpp
+crypto/x509v3/opera_pcy_data.cpp
+crypto/x509v3/opera_pcy_lib.cpp
+crypto/x509v3/opera_pcy_map.cpp
+crypto/x509v3/opera_pcy_node.cpp
+crypto/x509v3/opera_pcy_tree.cpp
+crypto/x509v3/opera_v3_akey.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_akeya.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_alt.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_bcons.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_bitst.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_conf.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_cpols.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_crld.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_enum.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_extku.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_genn.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_ia5.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_info.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_int.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_lib.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_ncons.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_ocsp.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_pci.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_pcia.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_pcons.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_pku.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_pmaps.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_prn.cpp
+crypto/x509v3/opera_v3_purp.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_skey.cpp    # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_sxnet.cpp   # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+crypto/x509v3/opera_v3_utl.cpp     # [forcecompileif=defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)]
+ssl/opera_s3_both.cpp              # [external-ssl-only]
+ssl/opera_s3_clnt.cpp              # [external-ssl-only]
+ssl/opera_s3_enc.cpp               # [external-ssl-only]
+ssl/opera_s3_lib.cpp               # [external-ssl-only]
+ssl/opera_s3_pkt.cpp               # [external-ssl-only]
+ssl/opera_ssl_algs.cpp             # [external-ssl-only]
+ssl/opera_ssl_asn1.cpp             # [external-ssl-only]
+ssl/opera_ssl_ciph.cpp             # [external-ssl-only]
+ssl/opera_ssl_cert.cpp             # [external-ssl-only]
+ssl/opera_ssl_lib.cpp              # [external-ssl-only]
+ssl/opera_ssl_rsa.cpp              # [external-ssl-only]
+ssl/opera_ssl_sess.cpp             # [external-ssl-only]
+ssl/opera_t1_clnt.cpp              # [external-ssl-only]
+ssl/opera_t1_enc.cpp               # [external-ssl-only]
+ssl/opera_t1_lib.cpp               # [external-ssl-only]
+ssl/opera_t1_reneg.cpp             # [external-ssl-only]
diff -Naur openssl-1.0.0q.orig/module.tweaks openssl-1.0.0q/module.tweaks
--- openssl-1.0.0q.orig/module.tweaks	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/module.tweaks	2017-04-25 16:23:40.903797546 +0200
@@ -0,0 +1,68 @@
+TWEAK_LIBOPEAY_BN_ASM                   markus
+
+        Turn on this tweak to let the product compile
+        crypto/bn/bn_asm.cpp on its own. There are
+        assembler versions available, but since that
+        depends on the target platform and the build
+        environment, the product is on its own.
+
+        Category   : performance
+        Define     : PRODUCT_COMPILES_BN_ASM
+        Depends on : FEATURE_NATIVE_SSL
+		Enabled for : none
+		Disabled for: desktop, tv, minimal, smartphone, mini
+
+TWEAK_LIBOPEAY_PARTIALLY_DISABLE_MD5			yngve
+
+	When enabled this will disable the MD2 andMD5 method for use in certificates.
+	
+	This does not affect MD5 use in SSL/TLS.
+	
+	MD5 is getting steadily weaker, and this will be the second step towards disabling the method completely.
+	
+	A flag on the remote controlled bitmap preference, PrefsCollectionNetwork::CryptoMethodOverride, 
+	can also disable SHA-1 for certificates when this tweak is _disabled_.
+	
+	If TWEAK_LIBOPEAY_DISABLE_MD5_COMPLETELY is enabled this tweak is not needed.
+	
+	This tweak should not be enabled except as directed by the security group. This may be done sometime during or after 2010.
+	
+	Category: setting
+	Define		: LIBOPEAY_DISABLE_MD5_PARTIAL
+	Enabled for	: none
+	Disabled for	: desktop, smartphone, tv, minimal, mini
+
+TWEAK_LIBOPEAY_PARTIALLY_DISABLE_SHA1			yngve
+
+	When enabled this will disable the SHA1 method for use in certificates.
+	
+	This does not affect SHA-1 use in SSL/TLS or PKCS #12.
+	
+	SHA1 is getting steadily weaker, and this will be the second step towards disabling the metho completely.
+	
+	A flag on the remote controlled bitmap preference, PrefsCollectionNetwork::CryptoMethodOverride, 
+	can also disable SHA-1 for certificates when this tweak is _disabled_.
+	
+	If TWEAK_LIBOPEAY_DISABLE_SHA1_COMPLETELY is enabled this tweak is not needed.
+	
+	This tweak should not be enabled except as directed by the security group. This may be done sometime after 2011.
+	
+	Category: setting
+	Define		: LIBOPEAY_DISABLE_SHA1_PARTIAL
+	Enabled for	: none
+	Disabled for	: desktop, smartphone, tv, minimal, mini
+
+TWEAK_LIBOPEAY_USE_SYSTEM_OPENSSL_LIBRARY		yngve
+
+	When enabled almost all libopeay code is disabled, and the functions are expected to be 
+	linked from OpenSSL 0.9.8 libcrypto. This linking must be configured in the product.
+	
+	The files in addon/, plus the evp/c_alld.c and x509/x509_vfy.c files are still included 
+	because they have special modifications needed to maintain security and/or functionality
+	(such as Extended Validation and disabling MD2 support in certificates).
+	These files are indicated in module.sources with the directive "[include-with-system-lib]"
+	
+	Category	: setting
+	Define		: _USE_SYSTEM_LIBCRYPTO_
+	Enabled for : none
+	Disabled for: desktop, smartphone, tv, minimal, mini
diff -Naur openssl-1.0.0q.orig/openssl/aes.h openssl-1.0.0q/openssl/aes.h
--- openssl-1.0.0q.orig/openssl/aes.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/aes.h	2017-04-25 16:23:40.903797546 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/aes/aes.h"
diff -Naur openssl-1.0.0q.orig/openssl/asn1.h openssl-1.0.0q/openssl/asn1.h
--- openssl-1.0.0q.orig/openssl/asn1.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/asn1.h	2017-04-25 16:23:40.903797546 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/asn1/asn1.h"
diff -Naur openssl-1.0.0q.orig/openssl/asn1_mac.h openssl-1.0.0q/openssl/asn1_mac.h
--- openssl-1.0.0q.orig/openssl/asn1_mac.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/asn1_mac.h	2017-04-25 16:23:40.904797394 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/asn1/asn1_mac.h"
diff -Naur openssl-1.0.0q.orig/openssl/asn1t.h openssl-1.0.0q/openssl/asn1t.h
--- openssl-1.0.0q.orig/openssl/asn1t.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/asn1t.h	2017-04-25 16:23:40.904797394 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/asn1/asn1t.h"
diff -Naur openssl-1.0.0q.orig/openssl/bio.h openssl-1.0.0q/openssl/bio.h
--- openssl-1.0.0q.orig/openssl/bio.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/bio.h	2017-04-25 16:23:40.904797394 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/bio/bio.h"
diff -Naur openssl-1.0.0q.orig/openssl/blowfish.h openssl-1.0.0q/openssl/blowfish.h
--- openssl-1.0.0q.orig/openssl/blowfish.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/blowfish.h	2017-04-25 16:23:40.904797394 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/bf/blowfish.h"
diff -Naur openssl-1.0.0q.orig/openssl/bn.h openssl-1.0.0q/openssl/bn.h
--- openssl-1.0.0q.orig/openssl/bn.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/bn.h	2017-04-25 16:23:40.905797242 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/bn/bn.h"
diff -Naur openssl-1.0.0q.orig/openssl/buffer.h openssl-1.0.0q/openssl/buffer.h
--- openssl-1.0.0q.orig/openssl/buffer.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/buffer.h	2017-04-25 16:23:40.905797242 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/buffer/buffer.h"
diff -Naur openssl-1.0.0q.orig/openssl/camellia.h openssl-1.0.0q/openssl/camellia.h
--- openssl-1.0.0q.orig/openssl/camellia.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/camellia.h	2017-04-25 16:23:40.905797242 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/camellia/camellia.h"
diff -Naur openssl-1.0.0q.orig/openssl/cast.h openssl-1.0.0q/openssl/cast.h
--- openssl-1.0.0q.orig/openssl/cast.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/cast.h	2017-04-25 16:23:40.906797369 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/cast/cast.h"
diff -Naur openssl-1.0.0q.orig/openssl/cms.h openssl-1.0.0q/openssl/cms.h
--- openssl-1.0.0q.orig/openssl/cms.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/cms.h	2017-04-25 16:23:40.906797369 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/cms/cms.h"
diff -Naur openssl-1.0.0q.orig/openssl/comp.h openssl-1.0.0q/openssl/comp.h
--- openssl-1.0.0q.orig/openssl/comp.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/comp.h	2017-04-25 16:23:40.906797369 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/comp/comp.h"
diff -Naur openssl-1.0.0q.orig/openssl/conf.h openssl-1.0.0q/openssl/conf.h
--- openssl-1.0.0q.orig/openssl/conf.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/conf.h	2017-04-25 16:23:40.907798055 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/conf/conf.h"
diff -Naur openssl-1.0.0q.orig/openssl/conf_api.h openssl-1.0.0q/openssl/conf_api.h
--- openssl-1.0.0q.orig/openssl/conf_api.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/conf_api.h	2017-04-25 16:23:40.907798055 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/conf/conf_api.h"
diff -Naur openssl-1.0.0q.orig/openssl/cryptlib.h openssl-1.0.0q/openssl/cryptlib.h
--- openssl-1.0.0q.orig/openssl/cryptlib.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/cryptlib.h	2017-04-25 16:23:40.907798055 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/cryptlib.h"
diff -Naur openssl-1.0.0q.orig/openssl/crypto.h openssl-1.0.0q/openssl/crypto.h
--- openssl-1.0.0q.orig/openssl/crypto.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/crypto.h	2017-04-25 16:23:40.907798055 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/crypto.h"
diff -Naur openssl-1.0.0q.orig/openssl/des.h openssl-1.0.0q/openssl/des.h
--- openssl-1.0.0q.orig/openssl/des.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/des.h	2017-04-25 16:23:40.908798741 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/des/des.h"
diff -Naur openssl-1.0.0q.orig/openssl/des_old.h openssl-1.0.0q/openssl/des_old.h
--- openssl-1.0.0q.orig/openssl/des_old.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/des_old.h	2017-04-25 16:23:40.908798741 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/des/des_old.h"
diff -Naur openssl-1.0.0q.orig/openssl/dh.h openssl-1.0.0q/openssl/dh.h
--- openssl-1.0.0q.orig/openssl/dh.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/dh.h	2017-04-25 16:23:40.908798741 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/dh/dh.h"
diff -Naur openssl-1.0.0q.orig/openssl/dsa.h openssl-1.0.0q/openssl/dsa.h
--- openssl-1.0.0q.orig/openssl/dsa.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/dsa.h	2017-04-25 16:23:40.909798309 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/dsa/dsa.h"
diff -Naur openssl-1.0.0q.orig/openssl/dso.h openssl-1.0.0q/openssl/dso.h
--- openssl-1.0.0q.orig/openssl/dso.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/dso.h	2017-04-25 16:23:40.909798309 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/dso/dso.h"
diff -Naur openssl-1.0.0q.orig/openssl/dtls1.h openssl-1.0.0q/openssl/dtls1.h
--- openssl-1.0.0q.orig/openssl/dtls1.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/dtls1.h	2017-04-25 16:23:40.909798309 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/ssl/dtls1.h"
diff -Naur openssl-1.0.0q.orig/openssl/e_os.h openssl-1.0.0q/openssl/e_os.h
--- openssl-1.0.0q.orig/openssl/e_os.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/e_os.h	2017-04-25 16:23:40.910798716 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/e_os.h"
diff -Naur openssl-1.0.0q.orig/openssl/e_os2.h openssl-1.0.0q/openssl/e_os2.h
--- openssl-1.0.0q.orig/openssl/e_os2.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/e_os2.h	2017-04-25 16:23:40.910798716 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/e_os2.h"
diff -Naur openssl-1.0.0q.orig/openssl/ebcdic.h openssl-1.0.0q/openssl/ebcdic.h
--- openssl-1.0.0q.orig/openssl/ebcdic.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ebcdic.h	2017-04-25 16:23:40.910798716 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/ebcdic.h"
diff -Naur openssl-1.0.0q.orig/openssl/ec.h openssl-1.0.0q/openssl/ec.h
--- openssl-1.0.0q.orig/openssl/ec.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ec.h	2017-04-25 16:23:40.910798716 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/ec/ec.h"
diff -Naur openssl-1.0.0q.orig/openssl/ecdh.h openssl-1.0.0q/openssl/ecdh.h
--- openssl-1.0.0q.orig/openssl/ecdh.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ecdh.h	2017-04-25 16:23:40.911798284 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/ecdh/ecdh.h"
diff -Naur openssl-1.0.0q.orig/openssl/ecdsa.h openssl-1.0.0q/openssl/ecdsa.h
--- openssl-1.0.0q.orig/openssl/ecdsa.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ecdsa.h	2017-04-25 16:23:40.911798284 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/ecdsa/ecdsa.h"
diff -Naur openssl-1.0.0q.orig/openssl/engine.h openssl-1.0.0q/openssl/engine.h
--- openssl-1.0.0q.orig/openssl/engine.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/engine.h	2017-04-25 16:23:40.911798284 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/engine/engine.h"
diff -Naur openssl-1.0.0q.orig/openssl/err.h openssl-1.0.0q/openssl/err.h
--- openssl-1.0.0q.orig/openssl/err.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/err.h	2017-04-25 16:23:40.912798411 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/err/err.h"
diff -Naur openssl-1.0.0q.orig/openssl/evp.h openssl-1.0.0q/openssl/evp.h
--- openssl-1.0.0q.orig/openssl/evp.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/evp.h	2017-04-25 16:23:40.912798411 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/evp/evp.h"
diff -Naur openssl-1.0.0q.orig/openssl/ext_dat.h openssl-1.0.0q/openssl/ext_dat.h
--- openssl-1.0.0q.orig/openssl/ext_dat.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ext_dat.h	2017-04-25 16:23:41.247030276 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/x509v3/ext_dat.h"
diff -Naur openssl-1.0.0q.orig/openssl/hmac.h openssl-1.0.0q/openssl/hmac.h
--- openssl-1.0.0q.orig/openssl/hmac.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/hmac.h	2017-04-25 16:23:41.278030305 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/hmac/hmac.h"
diff -Naur openssl-1.0.0q.orig/openssl/idea.h openssl-1.0.0q/openssl/idea.h
--- openssl-1.0.0q.orig/openssl/idea.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/idea.h	2017-04-25 16:23:41.278030305 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/idea/idea.h"
diff -Naur openssl-1.0.0q.orig/openssl/krb5_asn.h openssl-1.0.0q/openssl/krb5_asn.h
--- openssl-1.0.0q.orig/openssl/krb5_asn.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/krb5_asn.h	2017-04-25 16:23:41.279030153 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/krb5/krb5_asn.h"
diff -Naur openssl-1.0.0q.orig/openssl/kssl.h openssl-1.0.0q/openssl/kssl.h
--- openssl-1.0.0q.orig/openssl/kssl.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/kssl.h	2017-04-25 16:23:41.279030153 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/ssl/kssl.h"
diff -Naur openssl-1.0.0q.orig/openssl/lhash.h openssl-1.0.0q/openssl/lhash.h
--- openssl-1.0.0q.orig/openssl/lhash.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/lhash.h	2017-04-25 16:23:41.280031118 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/lhash/lhash.h"
diff -Naur openssl-1.0.0q.orig/openssl/md32_common.h openssl-1.0.0q/openssl/md32_common.h
--- openssl-1.0.0q.orig/openssl/md32_common.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/md32_common.h	2017-04-25 16:23:41.300029470 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/md32_common.h"
diff -Naur openssl-1.0.0q.orig/openssl/md4.h openssl-1.0.0q/openssl/md4.h
--- openssl-1.0.0q.orig/openssl/md4.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/md4.h	2017-04-25 16:23:41.301030714 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/md4/md4.h"
diff -Naur openssl-1.0.0q.orig/openssl/md5.h openssl-1.0.0q/openssl/md5.h
--- openssl-1.0.0q.orig/openssl/md5.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/md5.h	2017-04-25 16:23:41.301030714 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/md5/md5.h"
diff -Naur openssl-1.0.0q.orig/openssl/mdc2.h openssl-1.0.0q/openssl/mdc2.h
--- openssl-1.0.0q.orig/openssl/mdc2.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/mdc2.h	2017-04-25 16:23:41.302030283 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/mdc2/mdc2.h"
diff -Naur openssl-1.0.0q.orig/openssl/modes.h openssl-1.0.0q/openssl/modes.h
--- openssl-1.0.0q.orig/openssl/modes.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/modes.h	2017-04-25 16:23:41.306030232 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/modes/modes.h"
diff -Naur openssl-1.0.0q.orig/openssl/o_time.h openssl-1.0.0q/openssl/o_time.h
--- openssl-1.0.0q.orig/openssl/o_time.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/o_time.h	2017-04-25 16:23:41.307032874 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/o_time.h"
diff -Naur openssl-1.0.0q.orig/openssl/obj_mac.h openssl-1.0.0q/openssl/obj_mac.h
--- openssl-1.0.0q.orig/openssl/obj_mac.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/obj_mac.h	2017-04-25 16:23:41.308030766 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/objects/obj_mac.h"
diff -Naur openssl-1.0.0q.orig/openssl/objects.h openssl-1.0.0q/openssl/objects.h
--- openssl-1.0.0q.orig/openssl/objects.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/objects.h	2017-04-25 16:23:41.309030893 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/objects/objects.h"
diff -Naur openssl-1.0.0q.orig/openssl/ocsp.h openssl-1.0.0q/openssl/ocsp.h
--- openssl-1.0.0q.orig/openssl/ocsp.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ocsp.h	2017-04-25 16:23:41.309030893 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/ocsp/ocsp.h"
diff -Naur openssl-1.0.0q.orig/openssl/opensslconf.h openssl-1.0.0q/openssl/opensslconf.h
--- openssl-1.0.0q.orig/openssl/opensslconf.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/opensslconf.h	2017-04-25 16:23:41.341030491 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/opensslconf.h"
diff -Naur openssl-1.0.0q.orig/openssl/opensslv.h openssl-1.0.0q/openssl/opensslv.h
--- openssl-1.0.0q.orig/openssl/opensslv.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/opensslv.h	2017-04-25 16:23:41.352031051 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/opensslv.h"
diff -Naur openssl-1.0.0q.orig/openssl/ossl_typ.h openssl-1.0.0q/openssl/ossl_typ.h
--- openssl-1.0.0q.orig/openssl/ossl_typ.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ossl_typ.h	2017-04-25 16:23:41.352031051 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/ossl_typ.h"
diff -Naur openssl-1.0.0q.orig/openssl/pem.h openssl-1.0.0q/openssl/pem.h
--- openssl-1.0.0q.orig/openssl/pem.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/pem.h	2017-04-25 16:23:41.353030899 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/pem/pem.h"
diff -Naur openssl-1.0.0q.orig/openssl/pem2.h openssl-1.0.0q/openssl/pem2.h
--- openssl-1.0.0q.orig/openssl/pem2.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/pem2.h	2017-04-25 16:23:41.354031585 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/pem/pem2.h"
diff -Naur openssl-1.0.0q.orig/openssl/pkcs12.h openssl-1.0.0q/openssl/pkcs12.h
--- openssl-1.0.0q.orig/openssl/pkcs12.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/pkcs12.h	2017-04-25 16:23:41.359030544 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/pkcs12/pkcs12.h"
diff -Naur openssl-1.0.0q.orig/openssl/pkcs7.h openssl-1.0.0q/openssl/pkcs7.h
--- openssl-1.0.0q.orig/openssl/pkcs7.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/pkcs7.h	2017-04-25 16:23:41.359030544 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/pkcs7/pkcs7.h"
diff -Naur openssl-1.0.0q.orig/openssl/pqueue.h openssl-1.0.0q/openssl/pqueue.h
--- openssl-1.0.0q.orig/openssl/pqueue.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/pqueue.h	2017-04-25 16:23:41.360030671 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/pqueue/pqueue.h"
diff -Naur openssl-1.0.0q.orig/openssl/rand.h openssl-1.0.0q/openssl/rand.h
--- openssl-1.0.0q.orig/openssl/rand.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/rand.h	2017-04-25 16:23:41.360030671 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/rand/rand.h"
diff -Naur openssl-1.0.0q.orig/openssl/rc2.h openssl-1.0.0q/openssl/rc2.h
--- openssl-1.0.0q.orig/openssl/rc2.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/rc2.h	2017-04-25 16:23:41.361031078 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/rc2/rc2.h"
diff -Naur openssl-1.0.0q.orig/openssl/rc4.h openssl-1.0.0q/openssl/rc4.h
--- openssl-1.0.0q.orig/openssl/rc4.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/rc4.h	2017-04-25 16:23:41.361031078 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/rc4/rc4.h"
diff -Naur openssl-1.0.0q.orig/openssl/rc5.h openssl-1.0.0q/openssl/rc5.h
--- openssl-1.0.0q.orig/openssl/rc5.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/rc5.h	2017-04-25 16:23:41.362030646 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/rc5/rc5.h"
diff -Naur openssl-1.0.0q.orig/openssl/ripemd.h openssl-1.0.0q/openssl/ripemd.h
--- openssl-1.0.0q.orig/openssl/ripemd.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ripemd.h	2017-04-25 16:23:41.362030646 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/ripemd/ripemd.h"
diff -Naur openssl-1.0.0q.orig/openssl/rsa.h openssl-1.0.0q/openssl/rsa.h
--- openssl-1.0.0q.orig/openssl/rsa.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/rsa.h	2017-04-25 16:23:41.362030646 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/rsa/rsa.h"
diff -Naur openssl-1.0.0q.orig/openssl/safestack.h openssl-1.0.0q/openssl/safestack.h
--- openssl-1.0.0q.orig/openssl/safestack.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/safestack.h	2017-04-25 16:23:41.363030494 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/stack/safestack.h"
diff -Naur openssl-1.0.0q.orig/openssl/seed.h openssl-1.0.0q/openssl/seed.h
--- openssl-1.0.0q.orig/openssl/seed.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/seed.h	2017-04-25 16:23:41.363030494 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/seed/seed.h"
diff -Naur openssl-1.0.0q.orig/openssl/sha.h openssl-1.0.0q/openssl/sha.h
--- openssl-1.0.0q.orig/openssl/sha.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/sha.h	2017-04-25 16:23:41.364030341 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/sha/sha.h"
diff -Naur openssl-1.0.0q.orig/openssl/ssl.h openssl-1.0.0q/openssl/ssl.h
--- openssl-1.0.0q.orig/openssl/ssl.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ssl.h	2017-04-25 16:23:41.364030341 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/ssl/ssl.h"
diff -Naur openssl-1.0.0q.orig/openssl/ssl2.h openssl-1.0.0q/openssl/ssl2.h
--- openssl-1.0.0q.orig/openssl/ssl2.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ssl2.h	2017-04-25 16:23:41.364030341 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/ssl/ssl2.h"
diff -Naur openssl-1.0.0q.orig/openssl/ssl23.h openssl-1.0.0q/openssl/ssl23.h
--- openssl-1.0.0q.orig/openssl/ssl23.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ssl23.h	2017-04-25 16:23:41.365030748 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/ssl/ssl23.h"
diff -Naur openssl-1.0.0q.orig/openssl/ssl3.h openssl-1.0.0q/openssl/ssl3.h
--- openssl-1.0.0q.orig/openssl/ssl3.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ssl3.h	2017-04-25 16:23:41.365030748 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/ssl/ssl3.h"
diff -Naur openssl-1.0.0q.orig/openssl/stack.h openssl-1.0.0q/openssl/stack.h
--- openssl-1.0.0q.orig/openssl/stack.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/stack.h	2017-04-25 16:23:41.365030748 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/stack/stack.h"
diff -Naur openssl-1.0.0q.orig/openssl/symhacks.h openssl-1.0.0q/openssl/symhacks.h
--- openssl-1.0.0q.orig/openssl/symhacks.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/symhacks.h	2017-04-25 16:23:41.366030596 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/symhacks.h"
diff -Naur openssl-1.0.0q.orig/openssl/tls1.h openssl-1.0.0q/openssl/tls1.h
--- openssl-1.0.0q.orig/openssl/tls1.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/tls1.h	2017-04-25 16:23:41.366030596 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/ssl/tls1.h"
diff -Naur openssl-1.0.0q.orig/openssl/ts.h openssl-1.0.0q/openssl/ts.h
--- openssl-1.0.0q.orig/openssl/ts.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ts.h	2017-04-25 16:23:41.366030596 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/ts/ts.h"
diff -Naur openssl-1.0.0q.orig/openssl/txt_db.h openssl-1.0.0q/openssl/txt_db.h
--- openssl-1.0.0q.orig/openssl/txt_db.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/txt_db.h	2017-04-25 16:23:41.366030596 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/txt_db/txt_db.h"
diff -Naur openssl-1.0.0q.orig/openssl/ui.h openssl-1.0.0q/openssl/ui.h
--- openssl-1.0.0q.orig/openssl/ui.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ui.h	2017-04-25 16:23:41.367030164 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/ui/ui.h"
diff -Naur openssl-1.0.0q.orig/openssl/ui_compat.h openssl-1.0.0q/openssl/ui_compat.h
--- openssl-1.0.0q.orig/openssl/ui_compat.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/ui_compat.h	2017-04-25 16:23:41.367030164 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/ui/ui_compat.h"
diff -Naur openssl-1.0.0q.orig/openssl/whrlpool.h openssl-1.0.0q/openssl/whrlpool.h
--- openssl-1.0.0q.orig/openssl/whrlpool.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/whrlpool.h	2017-04-25 16:23:41.367030164 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/whrlpool/whrlpool.h"
diff -Naur openssl-1.0.0q.orig/openssl/x509.h openssl-1.0.0q/openssl/x509.h
--- openssl-1.0.0q.orig/openssl/x509.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/x509.h	2017-04-25 16:23:41.368030012 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/x509/x509.h"
diff -Naur openssl-1.0.0q.orig/openssl/x509_vfy.h openssl-1.0.0q/openssl/x509_vfy.h
--- openssl-1.0.0q.orig/openssl/x509_vfy.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/x509_vfy.h	2017-04-25 16:23:41.368030012 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/x509/x509_vfy.h"
diff -Naur openssl-1.0.0q.orig/openssl/x509v3.h openssl-1.0.0q/openssl/x509v3.h
--- openssl-1.0.0q.orig/openssl/x509v3.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/openssl/x509v3.h	2017-04-25 16:23:41.368030012 +0200
@@ -0,0 +1 @@
+#include "modules/libopeay/crypto/x509v3/x509v3.h"
diff -Naur openssl-1.0.0q.orig/opera_libopeay_constants.cpp openssl-1.0.0q/opera_libopeay_constants.cpp
--- openssl-1.0.0q.orig/opera_libopeay_constants.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/opera_libopeay_constants.cpp	2017-04-25 16:23:41.369029860 +0200
@@ -0,0 +1,18 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/libopeay_constants.cpp"
+#endif // _SSL_USE_OPENSSL_ || defined(USE_OPENSSL_CERTIFICATE_VERIFICATION)
diff -Naur openssl-1.0.0q.orig/opera_libopeay_module.cpp openssl-1.0.0q/opera_libopeay_module.cpp
--- openssl-1.0.0q.orig/opera_libopeay_module.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/opera_libopeay_module.cpp	2017-04-25 16:23:41.369029860 +0200
@@ -0,0 +1,18 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+
+#if defined(_SSL_USE_OPENSSL_) || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/libopeay_module.cpp"
+#endif // _SSL_USE_OPENSSL_ || defined(LIBOPEAY_ENABLE_PARTLY_OPENSSL_SUPPORT)
diff -Naur openssl-1.0.0q.orig/selftest/BIGNUM.ot openssl-1.0.0q/selftest/BIGNUM.ot
--- openssl-1.0.0q.orig/selftest/BIGNUM.ot	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/BIGNUM.ot	2017-04-25 16:23:41.369029860 +0200
@@ -0,0 +1,63 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 2012-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+/**
+ * @file BIGNUM.ot
+ *
+ * Selftests for OpenSSL BIGNUM functionality.
+ *
+ * @author Alexei Khlebnikov <alexeik@opera.com>
+ *
+ */
+
+group "libopeay.bignum";
+require CRYPTO_CERTIFICATE_VERIFICATION_USE_CORE_IMPLEMENTATION;
+
+language c++;
+
+include "modules/libopeay/openssl/cryptlib.h";
+include "modules/libopeay/openssl/bn.h";
+
+global
+{
+}
+
+test("BN_new, BN_free")
+{
+	verify(!ERR_peek_error());
+
+	BIGNUM* bn = BN_new();
+	verify(bn);
+	BN_free(bn);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+test("BN_num_bytes(new BIGNUM)")
+{
+	verify(!ERR_peek_error());
+
+	BIGNUM* bn = BN_new();
+	verify(bn);
+
+	int num_bytes = BN_num_bytes(bn);
+	BN_free(bn);
+
+	output("BN_num_bytes() == %i ... ", num_bytes);
+	verify(num_bytes == 0);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
diff -Naur openssl-1.0.0q.orig/selftest/EVP_PKEY.ot openssl-1.0.0q/selftest/EVP_PKEY.ot
--- openssl-1.0.0q.orig/selftest/EVP_PKEY.ot	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/EVP_PKEY.ot	2017-04-25 16:23:41.370029987 +0200
@@ -0,0 +1,282 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 2011-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+/**
+ * @file EVP_PKEY.ot
+ *
+ * Selftests for OpenSSL EVP_PKEY functionality.
+ *
+ * @author Alexei Khlebnikov <alexeik@opera.com>
+ *
+ */
+
+group "libopeay.evp_pkey";
+require CRYPTO_CERTIFICATE_VERIFICATION_USE_CORE_IMPLEMENTATION;
+
+language c++;
+
+include "modules/libopeay/openssl/cryptlib.h";
+
+include "modules/libopeay/addon/libopeay_util.h";
+include "modules/libopeay/openssl/bn.h";
+include "modules/libopeay/openssl/dh.h";
+include "modules/libopeay/openssl/dsa.h";
+include "modules/libopeay/openssl/evp.h";
+include "modules/libopeay/openssl/rsa.h";
+
+
+global
+{
+}
+
+test("EVP_PKEY_new, EVP_PKEY_free")
+{
+	verify(!ERR_peek_error());
+
+	EVP_PKEY* pkey = EVP_PKEY_new();
+	verify(pkey);
+	EVP_PKEY_free(pkey);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+test("EVP_PKEY_CTX_new_id, EVP_PKEY_CTX_free")
+{
+	verify(!ERR_peek_error());
+
+	EVP_PKEY_CTX* ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL);
+	verify(ctx);
+	EVP_PKEY_CTX_free(ctx);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+test("EVP_PKEY_type(new EVP_PKEY)")
+{
+	verify(!ERR_peek_error());
+
+	EVP_PKEY* pkey = EVP_PKEY_new();
+	verify(pkey);
+
+	int pkey_type = pkey->type;
+	int pkey_type_complicated = EVP_PKEY_type(pkey->type);
+	int pkey_type_id = EVP_PKEY_id(pkey);
+	EVP_PKEY_free(pkey);
+
+	output("EVP_PKEY_type() == %s ... ", EVP_PKEY_type_name(pkey_type));
+	verify(pkey_type == EVP_PKEY_NONE);
+	verify(pkey_type == pkey_type_complicated);
+	verify(pkey_type == pkey_type_id);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+
+table evp_pkey_types(const char* pkey_type_name, int pkey_type)
+{
+	// This list is taken from modules/libopeay/crypto/evp/evp.h.
+	{ "EVP_PKEY_RSA",  EVP_PKEY_RSA  },
+	{ "EVP_PKEY_RSA2", EVP_PKEY_RSA2 },
+	{ "EVP_PKEY_DSA",  EVP_PKEY_DSA  },
+	{ "EVP_PKEY_DSA1", EVP_PKEY_DSA1 },
+	{ "EVP_PKEY_DSA2", EVP_PKEY_DSA2 },
+	{ "EVP_PKEY_DSA3", EVP_PKEY_DSA3 },
+	{ "EVP_PKEY_DSA4", EVP_PKEY_DSA4 },
+	{ "EVP_PKEY_DH",   EVP_PKEY_DH   },
+	// Elliptic curves are not supported so far.
+	// { "EVP_PKEY_EC",   EVP_PKEY_EC   },
+	{ "EVP_PKEY_HMAC", EVP_PKEY_HMAC }
+}
+
+subtest find_pkey_type(int pkey_type)
+{
+	verify(!ERR_peek_error());
+	const EVP_PKEY_ASN1_METHOD* ameth = EVP_PKEY_asn1_find(NULL, pkey_type);
+	verify(ameth);
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+foreach (pkey_type_name, pkey_type) from evp_pkey_types
+{
+	test("EVP_PKEY_asn1_find, " pkey_type_name)
+	{
+		find_pkey_type(pkey_type);
+	}
+}
+
+test("EVP_PKEY_asn1_find, EVP_PKEY_EC is not supported")
+{
+	verify(!ERR_peek_error());
+	const EVP_PKEY_ASN1_METHOD* ameth = EVP_PKEY_asn1_find(NULL, EVP_PKEY_EC);
+	verify(!ameth);
+	verify(!ERR_peek_error());
+}
+
+
+// This test shouldn't cause memleaks.
+test("EVP_PKEY_free deallocates assigned RSA key")
+{
+	// Variables that are accessed in finally {} block,
+	// must be declared in the first lines of the test().
+	RSA*      rsa  = NULL;
+	EVP_PKEY* pkey = NULL;
+
+	verify(!ERR_peek_error());
+
+	rsa = RSA_new();
+	verify(rsa);
+
+	rsa->n    = BN_new();
+	rsa->e    = BN_new();
+	rsa->d    = BN_new();
+	rsa->p    = BN_new();
+	rsa->q    = BN_new();
+	rsa->dmp1 = BN_new();
+	rsa->iqmp = BN_new();
+
+	pkey = EVP_PKEY_new();
+	verify(pkey);
+
+	int err = EVP_PKEY_assign_RSA(pkey, rsa);
+	verify(err == 1);
+	// Now pkey owns rsa and must deallocate it.
+	rsa = NULL;
+
+	verify(pkey->type == EVP_PKEY_RSA);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	EVP_PKEY_free(pkey);
+	RSA_free(rsa);
+	ERR_clear_error();
+}
+
+// This test shouldn't cause memleaks.
+test("EVP_PKEY_free deallocates assigned DSA key")
+{
+	// Variables that are accessed in finally {} block,
+	// must be declared in the first lines of the test().
+	DSA*      dsa  = NULL;
+	EVP_PKEY* pkey = NULL;
+
+	verify(!ERR_peek_error());
+
+	dsa = DSA_new();
+	verify(dsa);
+
+	dsa->p        = BN_new();
+	dsa->q        = BN_new();
+	dsa->g        = BN_new();
+	dsa->pub_key  = BN_new();
+	dsa->priv_key = BN_new();
+
+	pkey = EVP_PKEY_new();
+	verify(pkey);
+
+	int err = EVP_PKEY_assign_DSA(pkey, dsa);
+	verify(err == 1);
+	// Now pkey owns dsa and must deallocate it.
+	dsa = NULL;
+
+	verify(pkey->type == EVP_PKEY_DSA);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	EVP_PKEY_free(pkey);
+	DSA_free(dsa);
+	ERR_clear_error();
+}
+
+// This test shouldn't cause memleaks.
+test("EVP_PKEY_free deallocates assigned DH  key")
+{
+	// Variables that are accessed in finally {} block,
+	// must be declared in the first lines of the test().
+	DH*       dh   = NULL;
+	EVP_PKEY* pkey = NULL;
+
+	verify(!ERR_peek_error());
+
+	dh = DH_new();
+	verify(dh);
+
+	dh->p        = BN_new();
+	dh->q        = BN_new();
+	dh->pub_key  = BN_new();
+	dh->priv_key = BN_new();
+
+	pkey = EVP_PKEY_new();
+	verify(pkey);
+
+	int err = EVP_PKEY_assign_DH(pkey, dh);
+	verify(err == 1);
+	// Now pkey owns dh and must deallocate it.
+	dh = NULL;
+
+	verify(pkey->type == EVP_PKEY_DH);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	EVP_PKEY_free(pkey);
+	DH_free(dh);
+	ERR_clear_error();
+}
+
+
+test("EVP_PKEY_keygen, EVP_PKEY_RSA")
+{
+	EVP_PKEY_CTX* ctx = NULL;
+	EVP_PKEY*    pkey = NULL;
+	verify(!ERR_peek_error());
+
+	ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL);
+	verify(ctx);
+
+	int err = EVP_PKEY_keygen_init(ctx);
+	verify(err > 0);
+
+	// 512 bit key length is chosen for speed.
+	err = EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, 512);
+	verify(err > 0);
+
+	// Generate the key.
+	err = EVP_PKEY_keygen(ctx, &pkey);
+	verify(err > 0);
+	verify(pkey);
+	verify(pkey->ameth);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	EVP_PKEY_free(pkey);
+	EVP_PKEY_CTX_free(ctx);
+	ERR_clear_error();
+}
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/01-gen-ca.sh openssl-1.0.0q/selftest/TestCA/01-gen-ca.sh
--- openssl-1.0.0q.orig/selftest/TestCA/01-gen-ca.sh	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/01-gen-ca.sh	2017-04-25 16:23:41.370029987 +0200
@@ -0,0 +1,12 @@
+#!/bin/sh -v
+
+rm -rf ca-data keys reqs certs crls
+mkdir  ca-data keys reqs certs crls
+mkdir  ca-data/certs
+
+echo -n   >ca-data/index.txt
+echo "01" >ca-data/serial
+echo "01" >ca-data/crlnumber
+
+openssl genrsa -out ca-data/cakey.pem 2048
+openssl req -new -x509 -subj "/CN=Libopeay test CA/O=Opera/ST=Oslo/C=NO" -days 3650 -key ca-data/cakey.pem -sha1 -out ca-data/cacert.pem -text
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/02-gen-cert1.sh openssl-1.0.0q/selftest/TestCA/02-gen-cert1.sh
--- openssl-1.0.0q.orig/selftest/TestCA/02-gen-cert1.sh	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/02-gen-cert1.sh	2017-04-25 16:23:41.371029834 +0200
@@ -0,0 +1,6 @@
+#!/bin/sh -v
+
+openssl genrsa -out keys/key1.pem 2048
+openssl req -new -subj "/CN=Libopeay test cert 1/O=Opera/ST=Oslo/C=NO" -key keys/key1.pem -sha1 -out reqs/req1.pem -text
+
+openssl ca -batch -config openssl.cnf -in reqs/req1.pem -out certs/cert1.pem -days 3650
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/03-gen-cert2.sh openssl-1.0.0q/selftest/TestCA/03-gen-cert2.sh
--- openssl-1.0.0q.orig/selftest/TestCA/03-gen-cert2.sh	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/03-gen-cert2.sh	2017-04-25 16:23:41.371029834 +0200
@@ -0,0 +1,6 @@
+#!/bin/sh -v
+
+openssl genrsa -out keys/key2.pem 2048
+openssl req -new -subj "/CN=Libopeay test cert 2/O=Opera/ST=Oslo/C=NO" -key keys/key2.pem -sha1 -out reqs/req2.pem -text
+
+openssl ca -batch -config openssl.cnf -in reqs/req2.pem -out certs/cert2.pem -days 3650
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/04-gen-crl1.sh openssl-1.0.0q/selftest/TestCA/04-gen-crl1.sh
--- openssl-1.0.0q.orig/selftest/TestCA/04-gen-crl1.sh	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/04-gen-crl1.sh	2017-04-25 16:23:41.371029834 +0200
@@ -0,0 +1,4 @@
+#!/bin/sh -v
+
+openssl ca -batch -config openssl.cnf -gencrl -crldays 3650 | \
+	openssl crl -out crls/crl1.pem -text
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/05-gen-crl2.sh openssl-1.0.0q/selftest/TestCA/05-gen-crl2.sh
--- openssl-1.0.0q.orig/selftest/TestCA/05-gen-crl2.sh	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/05-gen-crl2.sh	2017-04-25 16:23:41.372029962 +0200
@@ -0,0 +1,6 @@
+#!/bin/sh -v
+
+openssl ca -batch -config openssl.cnf -revoke certs/cert2.pem
+
+openssl ca -batch -config openssl.cnf -gencrl -crldays 3650 | \
+	openssl crl -out crls/crl2.pem -text
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/99-gen-all.sh openssl-1.0.0q/selftest/TestCA/99-gen-all.sh
--- openssl-1.0.0q.orig/selftest/TestCA/99-gen-all.sh	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/99-gen-all.sh	2017-04-25 16:23:41.372029962 +0200
@@ -0,0 +1,7 @@
+#!/bin/sh -v
+
+./01-gen-ca.sh
+./02-gen-cert1.sh
+./03-gen-cert2.sh
+./04-gen-crl1.sh
+./05-gen-crl2.sh
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/cacert.pem openssl-1.0.0q/selftest/TestCA/ca-data/cacert.pem
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/cacert.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/cacert.pem	2017-04-25 16:23:41.372029962 +0200
@@ -0,0 +1,79 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            9e:ec:e9:ad:80:d1:26:a4
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: CN=Libopeay test CA, O=Opera, ST=Oslo, C=NO
+        Validity
+            Not Before: Mar 22 09:06:53 2012 GMT
+            Not After : Mar 20 09:06:53 2022 GMT
+        Subject: CN=Libopeay test CA, O=Opera, ST=Oslo, C=NO
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:e0:50:a9:ca:3e:87:3e:5e:08:b9:e6:75:f1:ba:
+                    d3:53:5e:84:0a:93:8e:5c:04:07:51:28:b8:96:de:
+                    fa:09:0c:1d:df:8d:ff:5b:3b:eb:2b:6e:c6:ad:54:
+                    e4:0c:24:49:2a:d7:59:8f:ac:63:8f:c8:d3:b0:2b:
+                    63:a7:f5:1f:1c:c6:de:f7:f1:b9:44:ba:45:9a:1a:
+                    6c:76:16:6d:59:81:1a:31:1c:34:4e:d7:3d:60:9d:
+                    91:f3:b0:79:e7:df:eb:a7:6d:94:b9:36:28:03:eb:
+                    34:8b:6e:8f:f7:4f:35:de:20:71:cc:f6:c5:09:b4:
+                    21:4e:4f:57:d6:ef:b4:60:c6:fa:77:ee:b6:98:44:
+                    0c:0b:bd:05:b2:56:2e:98:6b:0f:b1:70:32:00:8f:
+                    34:eb:78:0b:0f:4c:07:c2:20:23:7d:32:2a:8f:0b:
+                    09:f4:45:8c:0a:28:f3:a3:6b:93:4a:dc:36:56:8b:
+                    77:ed:83:37:71:2a:fb:55:a4:4b:3f:47:2d:bc:03:
+                    60:7d:59:11:59:9a:70:13:a8:7e:a2:8f:6c:66:45:
+                    b1:8b:2d:d5:6b:ff:12:38:f3:b2:9e:24:a3:97:65:
+                    b5:f3:3c:20:8a:3d:41:36:03:e1:b8:b8:da:03:40:
+                    bc:5c:44:43:08:3f:96:2c:29:79:5d:0b:45:3d:7f:
+                    22:6b
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Subject Key Identifier: 
+                AB:4C:42:A3:27:B1:5C:DE:C2:A3:F1:6C:D9:1C:BD:A0:CE:9D:B9:0D
+            X509v3 Authority Key Identifier: 
+                keyid:AB:4C:42:A3:27:B1:5C:DE:C2:A3:F1:6C:D9:1C:BD:A0:CE:9D:B9:0D
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+        d3:81:e3:dd:93:2a:78:6c:80:cf:1b:61:7e:71:58:b3:1e:b3:
+        9e:33:84:a9:dc:b3:60:3f:16:af:a6:3d:6c:be:de:33:2a:5d:
+        12:57:6e:1f:1d:5d:56:e3:2a:68:99:34:ff:52:93:95:88:ea:
+        f1:22:55:e6:de:fb:74:f0:37:94:73:95:1a:07:8d:7f:c8:d0:
+        41:a6:1d:9d:7e:e6:92:f6:bd:3e:84:6c:c0:68:aa:22:a3:d9:
+        47:20:c5:31:4b:98:9e:f6:7c:35:98:d4:5b:a0:37:5b:e4:9d:
+        c3:d5:ab:a1:2b:91:e5:df:f7:ae:27:2c:68:73:83:cc:6f:2f:
+        21:ab:88:3b:91:dc:9b:1f:19:be:65:38:e2:f5:80:25:6f:95:
+        d6:e2:9d:3f:26:5d:d2:eb:97:7a:8e:74:6c:63:a7:99:2f:5f:
+        34:4a:ae:85:c5:7b:70:98:ac:c1:c0:95:10:b0:bf:fb:3b:79:
+        96:bb:f5:10:09:28:32:32:2e:47:76:ff:48:f5:78:be:b9:57:
+        c4:cf:ec:9e:9f:3c:8b:cc:d4:53:4a:75:03:0f:f0:1e:22:af:
+        29:d7:8c:79:4b:5e:e0:f6:10:b6:15:d7:4a:c7:72:9f:a8:77:
+        89:89:15:3b:77:00:6c:c9:89:e5:06:b2:a0:ef:48:f6:62:cb:
+        74:2c:16:2c
+-----BEGIN CERTIFICATE-----
+MIIDYTCCAkmgAwIBAgIJAJ7s6a2A0SakMA0GCSqGSIb3DQEBBQUAMEcxGTAXBgNV
+BAMMEExpYm9wZWF5IHRlc3QgQ0ExDjAMBgNVBAoMBU9wZXJhMQ0wCwYDVQQIDARP
+c2xvMQswCQYDVQQGEwJOTzAeFw0xMjAzMjIwOTA2NTNaFw0yMjAzMjAwOTA2NTNa
+MEcxGTAXBgNVBAMMEExpYm9wZWF5IHRlc3QgQ0ExDjAMBgNVBAoMBU9wZXJhMQ0w
+CwYDVQQIDARPc2xvMQswCQYDVQQGEwJOTzCCASIwDQYJKoZIhvcNAQEBBQADggEP
+ADCCAQoCggEBAOBQqco+hz5eCLnmdfG601NehAqTjlwEB1EouJbe+gkMHd+N/1s7
+6ytuxq1U5AwkSSrXWY+sY4/I07ArY6f1HxzG3vfxuUS6RZoabHYWbVmBGjEcNE7X
+PWCdkfOweeff66dtlLk2KAPrNItuj/dPNd4gccz2xQm0IU5PV9bvtGDG+nfutphE
+DAu9BbJWLphrD7FwMgCPNOt4Cw9MB8IgI30yKo8LCfRFjAoo86Nrk0rcNlaLd+2D
+N3Eq+1WkSz9HLbwDYH1ZEVmacBOofqKPbGZFsYst1Wv/Ejjzsp4ko5dltfM8IIo9
+QTYD4bi42gNAvFxEQwg/liwpeV0LRT1/ImsCAwEAAaNQME4wHQYDVR0OBBYEFKtM
+QqMnsVzewqPxbNkcvaDOnbkNMB8GA1UdIwQYMBaAFKtMQqMnsVzewqPxbNkcvaDO
+nbkNMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBANOB492TKnhsgM8b
+YX5xWLMes54zhKncs2A/Fq+mPWy+3jMqXRJXbh8dXVbjKmiZNP9Sk5WI6vEiVebe
++3TwN5RzlRoHjX/I0EGmHZ1+5pL2vT6EbMBoqiKj2UcgxTFLmJ72fDWY1FugN1vk
+ncPVq6ErkeXf964nLGhzg8xvLyGriDuR3JsfGb5lOOL1gCVvldbinT8mXdLrl3qO
+dGxjp5kvXzRKroXFe3CYrMHAlRCwv/s7eZa79RAJKDIyLkd2/0j1eL65V8TP7J6f
+PIvM1FNKdQMP8B4irynXjHlLXuD2ELYV10rHcp+od4mJFTt3AGzJieUGsqDvSPZi
+y3QsFiw=
+-----END CERTIFICATE-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/cakey.pem openssl-1.0.0q/selftest/TestCA/ca-data/cakey.pem
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/cakey.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/cakey.pem	2017-04-25 16:23:41.373031206 +0200
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEA4FCpyj6HPl4IueZ18brTU16ECpOOXAQHUSi4lt76CQwd343/
+WzvrK27GrVTkDCRJKtdZj6xjj8jTsCtjp/UfHMbe9/G5RLpFmhpsdhZtWYEaMRw0
+Ttc9YJ2R87B559/rp22UuTYoA+s0i26P90813iBxzPbFCbQhTk9X1u+0YMb6d+62
+mEQMC70FslYumGsPsXAyAI8063gLD0wHwiAjfTIqjwsJ9EWMCijzo2uTStw2Vot3
+7YM3cSr7VaRLP0ctvANgfVkRWZpwE6h+oo9sZkWxiy3Va/8SOPOyniSjl2W18zwg
+ij1BNgPhuLjaA0C8XERDCD+WLCl5XQtFPX8iawIDAQABAoIBAQCPuF7xK9rvRMSG
+h3huJuubcOVc+Wmu3w3pHBQY5kiBX3gMcih4Rg3JSDKXf9qVRPJ0NoI1oZgw2dV3
+/HTfehgzEeBuMDwqIsbRk7iGeJwbSrKDYLTLBvFWY97NqfaRcFDGd1lgyagdyqdh
+5rbrF59F8Le5QSrBqt3kFMYM+owxrFgvQFnoeyzFbv5Q74ftXAhoFOO8zNEGq8gT
+985PoSqyjWcWsZvEh2lj89byxjmkhol3ZMqcfn3dlymieW2z9bGVv2oYyIqTcM+J
+Di8bYNRIvluI2Lr8+2ISUIu3vXP+nNgAnucsraPmOrq5ahO6cHzn2FvVvzioQ4MA
+xpsHrA8hAoGBAPgi2yIhRXkJ2FjczZUyqCGgfKClKzEnuGMO0ibD5l1wcp7/socI
+ZverOtuGCHSNVNwQ88WFPyGj6deHIjYx90V6AveAieuVFkV6iXB6NyFiEsiaOYTD
+sxt1rREeDCZEMwyqMLotVyBW6Vhdy4cDPOEIbUy3R3obryBIhQRt+GAjAoGBAOds
+i6QdtTkzDvN7pRohOQMWP2ZHmPJ9YDCRuW3XnMgpNPtWCFltLEz4Y3AS94Xtp6cm
+yl9f7mAuTrdAUI04syoFJootPMUZQHZ6dOhr+EKRqZxcBdaEoPtfrTasJKkAU5qh
+1Ml2BkdhBTE7lc4sp1l9iIlLbUw4GvnPwZM8d7UZAoGBAMhOGucqRJK4x9S0KaDP
+C7pZe0GTE5LSpZ4RUMPKUCQNqfmAH/Wxaq1zpEehoyGzFVWwuZgxQA0/7Hz3sT5e
+h2WmYM67DJsH9rqPeHM7tVVVfiRBmzz5XZRFIjg3MUeStkL6/+rKvxJ0FlonHS0Y
+CAUAcHsFWMXRo0VERVyWCXJRAoGAJoSuiVZYf3i8GFKQHFVDQ/xD+SYZkuLDS9I1
+Zs7oTXhuVRbwtNGy+eytwE2n3Sa9LNkL/evdpSyP9XhC7/5r86Z/z6fP4Y5eaFnh
+c33lCE9uR5QZdKcGlFBMaDkmsOpY//fHjvCSAvdnAdbFDFfqUr7OJuvi+TitZL7r
+nTIHSqECgYAargw7s6YPxxJyNpOX4WEJHWEtm+IAo2y2n5ban67umzLCpRflvzx7
+mDt6iNFuawPIZLFa22CRojDHbJZ9Hq6ztLpMJLRQCv7oSj55LlgjxkvsqB1q8EA2
+MeEC+Si/lP4AoWqrKswOmxvnTA7MvbxKPIjW2cJ2LjKCQ4lgYpie+w==
+-----END RSA PRIVATE KEY-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/certs/01.pem openssl-1.0.0q/selftest/TestCA/ca-data/certs/01.pem
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/certs/01.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/certs/01.pem	2017-04-25 16:23:41.373031206 +0200
@@ -0,0 +1,80 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number: 1 (0x1)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: CN=Libopeay test CA, O=Opera, ST=Oslo, C=NO
+        Validity
+            Not Before: Mar 22 09:06:53 2012 GMT
+            Not After : Mar 20 09:06:53 2022 GMT
+        Subject: C=NO, ST=Oslo, O=Opera, CN=Libopeay test cert 1
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:bf:01:ea:4f:45:41:1e:96:83:5d:42:4a:a2:2b:
+                    70:16:f8:db:79:ec:66:07:45:4a:8a:85:d0:2b:c1:
+                    f0:6e:87:d9:e1:ad:1f:ea:9c:8b:0d:5c:3f:6f:9c:
+                    cb:8c:b3:88:1a:c1:10:0d:5f:53:0d:92:fc:72:30:
+                    2b:46:3e:05:8f:d1:7a:d9:5e:f6:d4:a8:3a:20:ca:
+                    c8:2c:ec:b4:8d:c5:91:0e:b3:b4:99:ad:0e:5c:43:
+                    75:c2:00:8d:b8:e9:11:54:71:60:e4:71:19:56:6d:
+                    cb:73:ca:a4:3d:3c:ef:de:08:0e:90:1b:2f:a4:8a:
+                    81:81:fd:ca:50:17:a0:a6:5c:a8:83:6c:36:54:a9:
+                    0f:f3:f1:ba:b1:fd:aa:92:07:2e:66:4e:51:4a:bb:
+                    fe:5c:cf:92:0d:ef:28:e0:95:12:fe:af:5f:fc:9a:
+                    3d:24:43:52:0f:41:15:99:9e:84:fc:fd:77:6f:2b:
+                    97:54:7e:cd:ba:e7:21:0f:52:2e:89:5b:83:9d:0d:
+                    36:2b:c2:62:32:ae:de:02:f2:ff:9e:d5:35:ad:b8:
+                    77:8d:06:cf:1e:ee:cd:c0:54:7a:3d:aa:ed:82:d1:
+                    64:df:7d:87:df:8f:cf:9d:cc:fd:d7:58:b6:af:87:
+                    03:19:0b:c5:21:f1:c8:83:72:bc:a3:fd:83:b8:ab:
+                    a5:d7
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Basic Constraints: 
+                CA:FALSE
+            Netscape Comment: 
+                OpenSSL Generated Certificate
+            X509v3 Subject Key Identifier: 
+                26:7B:CE:04:C3:30:2D:07:98:D4:15:A8:D8:BF:4C:A2:31:88:FD:1A
+            X509v3 Authority Key Identifier: 
+                keyid:AB:4C:42:A3:27:B1:5C:DE:C2:A3:F1:6C:D9:1C:BD:A0:CE:9D:B9:0D
+
+    Signature Algorithm: sha1WithRSAEncryption
+        69:33:1a:e5:12:5e:d4:02:f8:33:3a:b0:b9:67:c1:7c:1d:f6:
+        1f:85:0e:b7:25:e2:d9:b9:11:c5:38:88:b2:8d:e7:f8:1a:b4:
+        3d:2e:74:ed:42:fb:6c:b7:ca:88:65:69:4a:d3:fe:41:79:c1:
+        63:06:be:77:12:ae:20:c9:db:00:11:39:1b:0e:bd:85:e2:c4:
+        f0:9b:ca:f8:8b:93:76:7c:4d:98:89:38:4f:5d:e4:f0:87:c8:
+        8d:a8:f9:8a:99:d2:30:92:ad:75:0a:df:9a:81:6d:c3:1f:b6:
+        ec:56:ac:f4:12:1c:ad:7c:08:b8:dc:83:0a:94:4e:f2:a7:60:
+        10:d7:52:e7:87:d2:bd:a0:21:36:fd:dc:41:d2:f3:8c:c5:35:
+        9e:60:6e:53:97:8e:d1:18:20:2c:26:83:b4:02:6f:76:20:11:
+        47:f0:3c:58:94:b0:99:e5:44:50:6a:bd:c3:e4:e2:25:51:79:
+        72:fb:ea:a5:4f:23:b3:f2:61:18:97:0c:e4:82:ca:19:67:02:
+        b5:af:36:a0:36:59:11:6c:c2:ed:28:12:a6:77:b6:79:ac:97:
+        06:d2:4c:af:46:d8:86:17:ae:31:ac:cf:6d:00:75:aa:29:65:
+        90:94:fa:bf:42:3b:ba:ea:09:4f:36:78:4f:d0:ea:85:02:c8:
+        d0:0c:ae:d4
+-----BEGIN CERTIFICATE-----
+MIIDiDCCAnCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMRkwFwYDVQQDDBBMaWJv
+cGVheSB0ZXN0IENBMQ4wDAYDVQQKDAVPcGVyYTENMAsGA1UECAwET3NsbzELMAkG
+A1UEBhMCTk8wHhcNMTIwMzIyMDkwNjUzWhcNMjIwMzIwMDkwNjUzWjBLMQswCQYD
+VQQGEwJOTzENMAsGA1UECAwET3NsbzEOMAwGA1UECgwFT3BlcmExHTAbBgNVBAMM
+FExpYm9wZWF5IHRlc3QgY2VydCAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAvwHqT0VBHpaDXUJKoitwFvjbeexmB0VKioXQK8HwbofZ4a0f6pyLDVw/
+b5zLjLOIGsEQDV9TDZL8cjArRj4Fj9F62V721Kg6IMrILOy0jcWRDrO0ma0OXEN1
+wgCNuOkRVHFg5HEZVm3Lc8qkPTzv3ggOkBsvpIqBgf3KUBegplyog2w2VKkP8/G6
+sf2qkgcuZk5RSrv+XM+SDe8o4JUS/q9f/Jo9JENSD0EVmZ6E/P13byuXVH7Nuuch
+D1IuiVuDnQ02K8JiMq7eAvL/ntU1rbh3jQbPHu7NwFR6PartgtFk332H34/Pncz9
+11i2r4cDGQvFIfHIg3K8o/2DuKul1wIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCG
+SAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4E
+FgQUJnvOBMMwLQeY1BWo2L9MojGI/RowHwYDVR0jBBgwFoAUq0xCoyexXN7Co/Fs
+2Ry9oM6duQ0wDQYJKoZIhvcNAQEFBQADggEBAGkzGuUSXtQC+DM6sLlnwXwd9h+F
+Drcl4tm5EcU4iLKN5/gatD0udO1C+2y3yohlaUrT/kF5wWMGvncSriDJ2wARORsO
+vYXixPCbyviLk3Z8TZiJOE9d5PCHyI2o+YqZ0jCSrXUK35qBbcMftuxWrPQSHK18
+CLjcgwqUTvKnYBDXUueH0r2gITb93EHS84zFNZ5gblOXjtEYICwmg7QCb3YgEUfw
+PFiUsJnlRFBqvcPk4iVReXL76qVPI7PyYRiXDOSCyhlnArWvNqA2WRFswu0oEqZ3
+tnmslwbSTK9G2IYXrjGsz20AdaopZZCU+r9CO7rqCU82eE/Q6oUCyNAMrtQ=
+-----END CERTIFICATE-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/certs/02.pem openssl-1.0.0q/selftest/TestCA/ca-data/certs/02.pem
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/certs/02.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/certs/02.pem	2017-04-25 16:23:41.374030495 +0200
@@ -0,0 +1,80 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number: 2 (0x2)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: CN=Libopeay test CA, O=Opera, ST=Oslo, C=NO
+        Validity
+            Not Before: Mar 22 09:06:53 2012 GMT
+            Not After : Mar 20 09:06:53 2022 GMT
+        Subject: C=NO, ST=Oslo, O=Opera, CN=Libopeay test cert 2
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:c6:fd:2b:d8:5c:d6:a2:e5:7a:0e:91:ba:71:18:
+                    a0:79:f9:d2:ad:25:ea:95:16:62:dc:97:f4:13:2f:
+                    80:0a:71:9b:69:6e:86:3c:11:4d:6a:ed:5b:0d:74:
+                    a7:e0:22:36:e0:f7:1c:aa:8c:e6:d2:dd:85:84:7f:
+                    98:17:bf:0c:0a:6c:69:80:f9:72:61:fa:56:60:7c:
+                    3c:42:98:29:1a:87:7d:9e:11:32:1d:f8:60:57:c9:
+                    73:4c:2a:69:bb:9e:0f:f6:a4:b0:c9:40:bf:4d:f3:
+                    e1:cf:f9:2d:79:ed:4a:64:75:a8:f7:82:a9:7b:86:
+                    fa:2c:eb:49:f8:1d:a7:1c:eb:69:6c:cd:ed:e0:1e:
+                    69:7c:1b:fc:dc:42:2f:68:46:9b:ab:66:45:83:35:
+                    f2:c3:8d:d6:cf:b0:66:a5:81:02:05:c5:db:c7:c7:
+                    33:b2:80:af:9d:8e:b5:d1:71:97:46:f8:2c:55:23:
+                    e2:33:80:a0:0e:37:c6:a5:26:1e:28:44:a7:53:5a:
+                    c7:91:67:30:40:d8:9a:98:75:c1:1d:4b:c5:ed:16:
+                    9a:40:c2:a1:03:33:99:05:d4:c2:3c:41:8f:79:75:
+                    ae:79:ab:eb:d2:ef:8e:0f:ef:93:6b:a5:18:c3:13:
+                    ba:e4:c3:e9:84:cc:31:5c:ae:08:1e:bc:de:4a:20:
+                    3d:49
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Basic Constraints: 
+                CA:FALSE
+            Netscape Comment: 
+                OpenSSL Generated Certificate
+            X509v3 Subject Key Identifier: 
+                67:A3:13:41:E1:D1:81:9F:8B:00:AB:EF:F5:B8:80:E0:D4:60:9A:49
+            X509v3 Authority Key Identifier: 
+                keyid:AB:4C:42:A3:27:B1:5C:DE:C2:A3:F1:6C:D9:1C:BD:A0:CE:9D:B9:0D
+
+    Signature Algorithm: sha1WithRSAEncryption
+        4e:78:80:8e:b6:a7:f3:cf:da:7b:66:20:74:ac:93:3f:36:ad:
+        fa:e3:21:3a:36:fb:a4:49:0f:b9:5e:fa:10:ae:8e:34:ab:89:
+        fb:99:3e:df:57:95:aa:59:27:6c:c7:6a:63:f8:29:dc:af:f7:
+        70:3a:71:fc:3b:7b:2e:ae:5b:a1:8d:cc:b4:1a:d5:64:4a:09:
+        d4:b4:0c:25:e1:f1:70:13:01:a7:69:b1:50:6e:a7:92:b3:66:
+        0a:4d:7c:30:bd:5e:ba:2c:6d:45:48:e3:55:a6:fc:7d:c5:67:
+        7c:a3:6c:b8:df:4e:fa:7f:eb:27:4c:60:df:4e:cd:5b:10:b2:
+        3b:70:02:f2:48:1a:95:23:49:7b:eb:38:99:9a:16:f7:6b:3b:
+        85:9a:76:a2:3e:e8:cc:db:5b:f7:90:f8:1d:b2:2e:b0:ad:01:
+        4b:35:d0:bb:63:c7:7b:df:68:8d:41:26:3a:eb:56:01:b1:29:
+        bf:b3:3c:a6:69:b8:11:af:6a:f5:35:fa:dd:62:c8:44:e9:8b:
+        7d:c4:80:eb:37:ab:4e:97:4b:d8:08:e3:ad:68:a8:cb:4d:b3:
+        98:02:be:47:8d:78:3c:2b:75:94:51:f5:02:e4:71:a0:42:6d:
+        c0:d2:54:30:0d:24:80:23:8e:53:14:12:e0:ae:91:e3:41:5b:
+        2e:cd:3a:55
+-----BEGIN CERTIFICATE-----
+MIIDiDCCAnCgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBHMRkwFwYDVQQDDBBMaWJv
+cGVheSB0ZXN0IENBMQ4wDAYDVQQKDAVPcGVyYTENMAsGA1UECAwET3NsbzELMAkG
+A1UEBhMCTk8wHhcNMTIwMzIyMDkwNjUzWhcNMjIwMzIwMDkwNjUzWjBLMQswCQYD
+VQQGEwJOTzENMAsGA1UECAwET3NsbzEOMAwGA1UECgwFT3BlcmExHTAbBgNVBAMM
+FExpYm9wZWF5IHRlc3QgY2VydCAyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAxv0r2FzWouV6DpG6cRigefnSrSXqlRZi3Jf0Ey+ACnGbaW6GPBFNau1b
+DXSn4CI24Pccqozm0t2FhH+YF78MCmxpgPlyYfpWYHw8QpgpGod9nhEyHfhgV8lz
+TCppu54P9qSwyUC/TfPhz/ktee1KZHWo94Kpe4b6LOtJ+B2nHOtpbM3t4B5pfBv8
+3EIvaEabq2ZFgzXyw43Wz7BmpYECBcXbx8czsoCvnY610XGXRvgsVSPiM4CgDjfG
+pSYeKESnU1rHkWcwQNiamHXBHUvF7RaaQMKhAzOZBdTCPEGPeXWueavr0u+OD++T
+a6UYwxO65MPphMwxXK4IHrzeSiA9SQIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCG
+SAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4E
+FgQUZ6MTQeHRgZ+LAKvv9biA4NRgmkkwHwYDVR0jBBgwFoAUq0xCoyexXN7Co/Fs
+2Ry9oM6duQ0wDQYJKoZIhvcNAQEFBQADggEBAE54gI62p/PP2ntmIHSskz82rfrj
+ITo2+6RJD7le+hCujjSrifuZPt9XlapZJ2zHamP4Kdyv93A6cfw7ey6uW6GNzLQa
+1WRKCdS0DCXh8XATAadpsVBup5KzZgpNfDC9XrosbUVI41Wm/H3FZ3yjbLjfTvp/
+6ydMYN9OzVsQsjtwAvJIGpUjSXvrOJmaFvdrO4WadqI+6MzbW/eQ+B2yLrCtAUs1
+0Ltjx3vfaI1BJjrrVgGxKb+zPKZpuBGvavU1+t1iyETpi33EgOs3q06XS9gI461o
+qMtNs5gCvkeNeDwrdZRR9QLkcaBCbcDSVDANJIAjjlMUEuCukeNBWy7NOlU=
+-----END CERTIFICATE-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/crlnumber openssl-1.0.0q/selftest/TestCA/ca-data/crlnumber
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/crlnumber	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/crlnumber	2017-04-25 16:23:41.374030495 +0200
@@ -0,0 +1 @@
+03
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/crlnumber.old openssl-1.0.0q/selftest/TestCA/ca-data/crlnumber.old
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/crlnumber.old	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/crlnumber.old	2017-04-25 16:23:41.375031181 +0200
@@ -0,0 +1 @@
+02
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/index.txt openssl-1.0.0q/selftest/TestCA/ca-data/index.txt
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/index.txt	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/index.txt	2017-04-25 16:23:41.375031181 +0200
@@ -0,0 +1,2 @@
+V	220320090653Z		01	unknown	/C=NO/ST=Oslo/O=Opera/CN=Libopeay test cert 1
+R	220320090653Z	120322090653Z	02	unknown	/C=NO/ST=Oslo/O=Opera/CN=Libopeay test cert 2
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/index.txt.attr openssl-1.0.0q/selftest/TestCA/ca-data/index.txt.attr
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/index.txt.attr	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/index.txt.attr	2017-04-25 16:23:41.375031181 +0200
@@ -0,0 +1 @@
+unique_subject = yes
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/index.txt.attr.old openssl-1.0.0q/selftest/TestCA/ca-data/index.txt.attr.old
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/index.txt.attr.old	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/index.txt.attr.old	2017-04-25 16:23:41.376030191 +0200
@@ -0,0 +1 @@
+unique_subject = yes
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/index.txt.old openssl-1.0.0q/selftest/TestCA/ca-data/index.txt.old
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/index.txt.old	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/index.txt.old	2017-04-25 16:23:41.376030191 +0200
@@ -0,0 +1,2 @@
+V	220320090653Z		01	unknown	/C=NO/ST=Oslo/O=Opera/CN=Libopeay test cert 1
+V	220320090653Z		02	unknown	/C=NO/ST=Oslo/O=Opera/CN=Libopeay test cert 2
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/serial openssl-1.0.0q/selftest/TestCA/ca-data/serial
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/serial	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/serial	2017-04-25 16:23:41.376030191 +0200
@@ -0,0 +1 @@
+03
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/ca-data/serial.old openssl-1.0.0q/selftest/TestCA/ca-data/serial.old
--- openssl-1.0.0q.orig/selftest/TestCA/ca-data/serial.old	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/ca-data/serial.old	2017-04-25 16:23:41.377030038 +0200
@@ -0,0 +1 @@
+02
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/certs/cert1.pem openssl-1.0.0q/selftest/TestCA/certs/cert1.pem
--- openssl-1.0.0q.orig/selftest/TestCA/certs/cert1.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/certs/cert1.pem	2017-04-25 16:23:41.378032400 +0200
@@ -0,0 +1,80 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number: 1 (0x1)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: CN=Libopeay test CA, O=Opera, ST=Oslo, C=NO
+        Validity
+            Not Before: Mar 22 09:06:53 2012 GMT
+            Not After : Mar 20 09:06:53 2022 GMT
+        Subject: C=NO, ST=Oslo, O=Opera, CN=Libopeay test cert 1
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:bf:01:ea:4f:45:41:1e:96:83:5d:42:4a:a2:2b:
+                    70:16:f8:db:79:ec:66:07:45:4a:8a:85:d0:2b:c1:
+                    f0:6e:87:d9:e1:ad:1f:ea:9c:8b:0d:5c:3f:6f:9c:
+                    cb:8c:b3:88:1a:c1:10:0d:5f:53:0d:92:fc:72:30:
+                    2b:46:3e:05:8f:d1:7a:d9:5e:f6:d4:a8:3a:20:ca:
+                    c8:2c:ec:b4:8d:c5:91:0e:b3:b4:99:ad:0e:5c:43:
+                    75:c2:00:8d:b8:e9:11:54:71:60:e4:71:19:56:6d:
+                    cb:73:ca:a4:3d:3c:ef:de:08:0e:90:1b:2f:a4:8a:
+                    81:81:fd:ca:50:17:a0:a6:5c:a8:83:6c:36:54:a9:
+                    0f:f3:f1:ba:b1:fd:aa:92:07:2e:66:4e:51:4a:bb:
+                    fe:5c:cf:92:0d:ef:28:e0:95:12:fe:af:5f:fc:9a:
+                    3d:24:43:52:0f:41:15:99:9e:84:fc:fd:77:6f:2b:
+                    97:54:7e:cd:ba:e7:21:0f:52:2e:89:5b:83:9d:0d:
+                    36:2b:c2:62:32:ae:de:02:f2:ff:9e:d5:35:ad:b8:
+                    77:8d:06:cf:1e:ee:cd:c0:54:7a:3d:aa:ed:82:d1:
+                    64:df:7d:87:df:8f:cf:9d:cc:fd:d7:58:b6:af:87:
+                    03:19:0b:c5:21:f1:c8:83:72:bc:a3:fd:83:b8:ab:
+                    a5:d7
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Basic Constraints: 
+                CA:FALSE
+            Netscape Comment: 
+                OpenSSL Generated Certificate
+            X509v3 Subject Key Identifier: 
+                26:7B:CE:04:C3:30:2D:07:98:D4:15:A8:D8:BF:4C:A2:31:88:FD:1A
+            X509v3 Authority Key Identifier: 
+                keyid:AB:4C:42:A3:27:B1:5C:DE:C2:A3:F1:6C:D9:1C:BD:A0:CE:9D:B9:0D
+
+    Signature Algorithm: sha1WithRSAEncryption
+        69:33:1a:e5:12:5e:d4:02:f8:33:3a:b0:b9:67:c1:7c:1d:f6:
+        1f:85:0e:b7:25:e2:d9:b9:11:c5:38:88:b2:8d:e7:f8:1a:b4:
+        3d:2e:74:ed:42:fb:6c:b7:ca:88:65:69:4a:d3:fe:41:79:c1:
+        63:06:be:77:12:ae:20:c9:db:00:11:39:1b:0e:bd:85:e2:c4:
+        f0:9b:ca:f8:8b:93:76:7c:4d:98:89:38:4f:5d:e4:f0:87:c8:
+        8d:a8:f9:8a:99:d2:30:92:ad:75:0a:df:9a:81:6d:c3:1f:b6:
+        ec:56:ac:f4:12:1c:ad:7c:08:b8:dc:83:0a:94:4e:f2:a7:60:
+        10:d7:52:e7:87:d2:bd:a0:21:36:fd:dc:41:d2:f3:8c:c5:35:
+        9e:60:6e:53:97:8e:d1:18:20:2c:26:83:b4:02:6f:76:20:11:
+        47:f0:3c:58:94:b0:99:e5:44:50:6a:bd:c3:e4:e2:25:51:79:
+        72:fb:ea:a5:4f:23:b3:f2:61:18:97:0c:e4:82:ca:19:67:02:
+        b5:af:36:a0:36:59:11:6c:c2:ed:28:12:a6:77:b6:79:ac:97:
+        06:d2:4c:af:46:d8:86:17:ae:31:ac:cf:6d:00:75:aa:29:65:
+        90:94:fa:bf:42:3b:ba:ea:09:4f:36:78:4f:d0:ea:85:02:c8:
+        d0:0c:ae:d4
+-----BEGIN CERTIFICATE-----
+MIIDiDCCAnCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMRkwFwYDVQQDDBBMaWJv
+cGVheSB0ZXN0IENBMQ4wDAYDVQQKDAVPcGVyYTENMAsGA1UECAwET3NsbzELMAkG
+A1UEBhMCTk8wHhcNMTIwMzIyMDkwNjUzWhcNMjIwMzIwMDkwNjUzWjBLMQswCQYD
+VQQGEwJOTzENMAsGA1UECAwET3NsbzEOMAwGA1UECgwFT3BlcmExHTAbBgNVBAMM
+FExpYm9wZWF5IHRlc3QgY2VydCAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAvwHqT0VBHpaDXUJKoitwFvjbeexmB0VKioXQK8HwbofZ4a0f6pyLDVw/
+b5zLjLOIGsEQDV9TDZL8cjArRj4Fj9F62V721Kg6IMrILOy0jcWRDrO0ma0OXEN1
+wgCNuOkRVHFg5HEZVm3Lc8qkPTzv3ggOkBsvpIqBgf3KUBegplyog2w2VKkP8/G6
+sf2qkgcuZk5RSrv+XM+SDe8o4JUS/q9f/Jo9JENSD0EVmZ6E/P13byuXVH7Nuuch
+D1IuiVuDnQ02K8JiMq7eAvL/ntU1rbh3jQbPHu7NwFR6PartgtFk332H34/Pncz9
+11i2r4cDGQvFIfHIg3K8o/2DuKul1wIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCG
+SAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4E
+FgQUJnvOBMMwLQeY1BWo2L9MojGI/RowHwYDVR0jBBgwFoAUq0xCoyexXN7Co/Fs
+2Ry9oM6duQ0wDQYJKoZIhvcNAQEFBQADggEBAGkzGuUSXtQC+DM6sLlnwXwd9h+F
+Drcl4tm5EcU4iLKN5/gatD0udO1C+2y3yohlaUrT/kF5wWMGvncSriDJ2wARORsO
+vYXixPCbyviLk3Z8TZiJOE9d5PCHyI2o+YqZ0jCSrXUK35qBbcMftuxWrPQSHK18
+CLjcgwqUTvKnYBDXUueH0r2gITb93EHS84zFNZ5gblOXjtEYICwmg7QCb3YgEUfw
+PFiUsJnlRFBqvcPk4iVReXL76qVPI7PyYRiXDOSCyhlnArWvNqA2WRFswu0oEqZ3
+tnmslwbSTK9G2IYXrjGsz20AdaopZZCU+r9CO7rqCU82eE/Q6oUCyNAMrtQ=
+-----END CERTIFICATE-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/certs/cert2.pem openssl-1.0.0q/selftest/TestCA/certs/cert2.pem
--- openssl-1.0.0q.orig/selftest/TestCA/certs/cert2.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/certs/cert2.pem	2017-04-25 16:23:41.379031410 +0200
@@ -0,0 +1,80 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number: 2 (0x2)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: CN=Libopeay test CA, O=Opera, ST=Oslo, C=NO
+        Validity
+            Not Before: Mar 22 09:06:53 2012 GMT
+            Not After : Mar 20 09:06:53 2022 GMT
+        Subject: C=NO, ST=Oslo, O=Opera, CN=Libopeay test cert 2
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:c6:fd:2b:d8:5c:d6:a2:e5:7a:0e:91:ba:71:18:
+                    a0:79:f9:d2:ad:25:ea:95:16:62:dc:97:f4:13:2f:
+                    80:0a:71:9b:69:6e:86:3c:11:4d:6a:ed:5b:0d:74:
+                    a7:e0:22:36:e0:f7:1c:aa:8c:e6:d2:dd:85:84:7f:
+                    98:17:bf:0c:0a:6c:69:80:f9:72:61:fa:56:60:7c:
+                    3c:42:98:29:1a:87:7d:9e:11:32:1d:f8:60:57:c9:
+                    73:4c:2a:69:bb:9e:0f:f6:a4:b0:c9:40:bf:4d:f3:
+                    e1:cf:f9:2d:79:ed:4a:64:75:a8:f7:82:a9:7b:86:
+                    fa:2c:eb:49:f8:1d:a7:1c:eb:69:6c:cd:ed:e0:1e:
+                    69:7c:1b:fc:dc:42:2f:68:46:9b:ab:66:45:83:35:
+                    f2:c3:8d:d6:cf:b0:66:a5:81:02:05:c5:db:c7:c7:
+                    33:b2:80:af:9d:8e:b5:d1:71:97:46:f8:2c:55:23:
+                    e2:33:80:a0:0e:37:c6:a5:26:1e:28:44:a7:53:5a:
+                    c7:91:67:30:40:d8:9a:98:75:c1:1d:4b:c5:ed:16:
+                    9a:40:c2:a1:03:33:99:05:d4:c2:3c:41:8f:79:75:
+                    ae:79:ab:eb:d2:ef:8e:0f:ef:93:6b:a5:18:c3:13:
+                    ba:e4:c3:e9:84:cc:31:5c:ae:08:1e:bc:de:4a:20:
+                    3d:49
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Basic Constraints: 
+                CA:FALSE
+            Netscape Comment: 
+                OpenSSL Generated Certificate
+            X509v3 Subject Key Identifier: 
+                67:A3:13:41:E1:D1:81:9F:8B:00:AB:EF:F5:B8:80:E0:D4:60:9A:49
+            X509v3 Authority Key Identifier: 
+                keyid:AB:4C:42:A3:27:B1:5C:DE:C2:A3:F1:6C:D9:1C:BD:A0:CE:9D:B9:0D
+
+    Signature Algorithm: sha1WithRSAEncryption
+        4e:78:80:8e:b6:a7:f3:cf:da:7b:66:20:74:ac:93:3f:36:ad:
+        fa:e3:21:3a:36:fb:a4:49:0f:b9:5e:fa:10:ae:8e:34:ab:89:
+        fb:99:3e:df:57:95:aa:59:27:6c:c7:6a:63:f8:29:dc:af:f7:
+        70:3a:71:fc:3b:7b:2e:ae:5b:a1:8d:cc:b4:1a:d5:64:4a:09:
+        d4:b4:0c:25:e1:f1:70:13:01:a7:69:b1:50:6e:a7:92:b3:66:
+        0a:4d:7c:30:bd:5e:ba:2c:6d:45:48:e3:55:a6:fc:7d:c5:67:
+        7c:a3:6c:b8:df:4e:fa:7f:eb:27:4c:60:df:4e:cd:5b:10:b2:
+        3b:70:02:f2:48:1a:95:23:49:7b:eb:38:99:9a:16:f7:6b:3b:
+        85:9a:76:a2:3e:e8:cc:db:5b:f7:90:f8:1d:b2:2e:b0:ad:01:
+        4b:35:d0:bb:63:c7:7b:df:68:8d:41:26:3a:eb:56:01:b1:29:
+        bf:b3:3c:a6:69:b8:11:af:6a:f5:35:fa:dd:62:c8:44:e9:8b:
+        7d:c4:80:eb:37:ab:4e:97:4b:d8:08:e3:ad:68:a8:cb:4d:b3:
+        98:02:be:47:8d:78:3c:2b:75:94:51:f5:02:e4:71:a0:42:6d:
+        c0:d2:54:30:0d:24:80:23:8e:53:14:12:e0:ae:91:e3:41:5b:
+        2e:cd:3a:55
+-----BEGIN CERTIFICATE-----
+MIIDiDCCAnCgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBHMRkwFwYDVQQDDBBMaWJv
+cGVheSB0ZXN0IENBMQ4wDAYDVQQKDAVPcGVyYTENMAsGA1UECAwET3NsbzELMAkG
+A1UEBhMCTk8wHhcNMTIwMzIyMDkwNjUzWhcNMjIwMzIwMDkwNjUzWjBLMQswCQYD
+VQQGEwJOTzENMAsGA1UECAwET3NsbzEOMAwGA1UECgwFT3BlcmExHTAbBgNVBAMM
+FExpYm9wZWF5IHRlc3QgY2VydCAyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAxv0r2FzWouV6DpG6cRigefnSrSXqlRZi3Jf0Ey+ACnGbaW6GPBFNau1b
+DXSn4CI24Pccqozm0t2FhH+YF78MCmxpgPlyYfpWYHw8QpgpGod9nhEyHfhgV8lz
+TCppu54P9qSwyUC/TfPhz/ktee1KZHWo94Kpe4b6LOtJ+B2nHOtpbM3t4B5pfBv8
+3EIvaEabq2ZFgzXyw43Wz7BmpYECBcXbx8czsoCvnY610XGXRvgsVSPiM4CgDjfG
+pSYeKESnU1rHkWcwQNiamHXBHUvF7RaaQMKhAzOZBdTCPEGPeXWueavr0u+OD++T
+a6UYwxO65MPphMwxXK4IHrzeSiA9SQIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCG
+SAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4E
+FgQUZ6MTQeHRgZ+LAKvv9biA4NRgmkkwHwYDVR0jBBgwFoAUq0xCoyexXN7Co/Fs
+2Ry9oM6duQ0wDQYJKoZIhvcNAQEFBQADggEBAE54gI62p/PP2ntmIHSskz82rfrj
+ITo2+6RJD7le+hCujjSrifuZPt9XlapZJ2zHamP4Kdyv93A6cfw7ey6uW6GNzLQa
+1WRKCdS0DCXh8XATAadpsVBup5KzZgpNfDC9XrosbUVI41Wm/H3FZ3yjbLjfTvp/
+6ydMYN9OzVsQsjtwAvJIGpUjSXvrOJmaFvdrO4WadqI+6MzbW/eQ+B2yLrCtAUs1
+0Ltjx3vfaI1BJjrrVgGxKb+zPKZpuBGvavU1+t1iyETpi33EgOs3q06XS9gI461o
+qMtNs5gCvkeNeDwrdZRR9QLkcaBCbcDSVDANJIAjjlMUEuCukeNBWy7NOlU=
+-----END CERTIFICATE-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/crls/crl1.pem openssl-1.0.0q/selftest/TestCA/crls/crl1.pem
--- openssl-1.0.0q.orig/selftest/TestCA/crls/crl1.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/crls/crl1.pem	2017-04-25 16:23:41.379031410 +0200
@@ -0,0 +1,37 @@
+Certificate Revocation List (CRL):
+        Version 2 (0x1)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: /CN=Libopeay test CA/O=Opera/ST=Oslo/C=NO
+        Last Update: Mar 22 09:06:53 2012 GMT
+        Next Update: Mar 20 09:06:53 2022 GMT
+        CRL extensions:
+            X509v3 CRL Number: 
+                1
+No Revoked Certificates.
+    Signature Algorithm: sha1WithRSAEncryption
+        21:aa:98:74:d6:1f:52:2b:d0:ef:ac:35:fa:1c:d4:e2:40:e8:
+        38:95:5f:40:ab:00:64:43:1b:8a:47:c4:c2:b7:83:63:97:42:
+        05:05:7f:72:12:0f:4b:01:f7:0e:7e:a5:56:b4:64:4f:2d:c8:
+        d7:c3:aa:ef:40:8d:06:0c:f8:e7:44:19:a8:49:b6:b4:dd:58:
+        70:db:cc:6a:c2:06:96:43:55:ee:0d:93:f2:cc:77:fc:cf:08:
+        cb:b0:f0:2c:63:24:7b:b1:7a:2d:46:0c:46:54:b8:ef:8e:82:
+        93:f1:fe:b1:d3:2d:16:69:55:4c:4d:0e:63:54:5f:17:20:38:
+        a1:eb:56:b4:f5:c4:79:06:87:e5:c7:67:d7:71:09:1c:f7:93:
+        38:5f:e5:95:2e:17:6a:78:1c:b2:94:10:18:e4:b2:40:b8:54:
+        80:38:93:8d:71:9e:fb:9a:2f:be:48:95:c1:f6:86:13:20:7d:
+        74:c7:99:2c:cd:3e:f8:40:f8:b6:96:85:0c:d3:8d:e8:93:1b:
+        aa:3d:0b:ad:92:13:b5:34:66:56:36:c9:2b:96:57:fd:50:40:
+        6c:3b:dd:d1:a8:f0:32:73:d5:79:cd:fc:e8:88:47:96:e2:c1:
+        0a:3e:44:eb:30:bf:9c:c5:10:01:59:a4:55:7d:92:0d:fe:f2:
+        ab:2d:a3:fd
+-----BEGIN X509 CRL-----
+MIIBoDCBiQIBATANBgkqhkiG9w0BAQUFADBHMRkwFwYDVQQDDBBMaWJvcGVheSB0
+ZXN0IENBMQ4wDAYDVQQKDAVPcGVyYTENMAsGA1UECAwET3NsbzELMAkGA1UEBhMC
+Tk8XDTEyMDMyMjA5MDY1M1oXDTIyMDMyMDA5MDY1M1qgDjAMMAoGA1UdFAQDAgEB
+MA0GCSqGSIb3DQEBBQUAA4IBAQAhqph01h9SK9DvrDX6HNTiQOg4lV9AqwBkQxuK
+R8TCt4Njl0IFBX9yEg9LAfcOfqVWtGRPLcjXw6rvQI0GDPjnRBmoSba03Vhw28xq
+wgaWQ1XuDZPyzHf8zwjLsPAsYyR7sXotRgxGVLjvjoKT8f6x0y0WaVVMTQ5jVF8X
+IDih61a09cR5Boflx2fXcQkc95M4X+WVLhdqeByylBAY5LJAuFSAOJONcZ77mi++
+SJXB9oYTIH10x5kszT74QPi2loUM043okxuqPQutkhO1NGZWNskrllf9UEBsO93R
+qPAyc9V5zfzoiEeW4sEKPkTrML+cxRABWaRVfZIN/vKrLaP9
+-----END X509 CRL-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/crls/crl2.pem openssl-1.0.0q/selftest/TestCA/crls/crl2.pem
--- openssl-1.0.0q.orig/selftest/TestCA/crls/crl2.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/crls/crl2.pem	2017-04-25 16:23:41.379031410 +0200
@@ -0,0 +1,40 @@
+Certificate Revocation List (CRL):
+        Version 2 (0x1)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: /CN=Libopeay test CA/O=Opera/ST=Oslo/C=NO
+        Last Update: Mar 22 09:06:53 2012 GMT
+        Next Update: Mar 20 09:06:53 2022 GMT
+        CRL extensions:
+            X509v3 CRL Number: 
+                2
+Revoked Certificates:
+    Serial Number: 02
+        Revocation Date: Mar 22 09:06:53 2012 GMT
+    Signature Algorithm: sha1WithRSAEncryption
+        50:92:f8:bf:87:4f:94:2f:56:a8:e5:36:ee:04:e3:e5:bd:e3:
+        25:27:bd:95:ea:85:25:fd:ec:22:2f:f8:ed:aa:c4:45:2a:1c:
+        e1:c1:97:7a:32:84:93:83:14:f3:6d:da:25:5a:f2:47:fa:17:
+        47:44:20:3d:78:a0:f0:9c:29:28:5c:db:06:51:ad:9b:f3:9f:
+        fb:e1:e9:6b:4d:db:7b:29:97:6b:41:5e:52:94:27:9a:52:57:
+        a5:06:e6:ae:fe:7c:69:0c:4a:86:53:04:29:9c:24:c9:3b:22:
+        27:3f:42:da:aa:f1:5e:29:5a:54:a5:54:34:b9:c8:9d:c1:fc:
+        e9:08:37:e3:9a:ae:66:ce:33:0f:8d:64:3c:f0:8a:f3:44:7e:
+        f0:5d:5a:05:ff:9c:36:0a:fd:12:4f:e0:78:38:58:73:2c:fa:
+        07:d1:42:ae:7a:36:00:e4:03:49:cb:ba:07:29:85:37:f3:70:
+        2e:21:f6:8e:8a:a6:ce:6a:18:0c:ee:71:c2:f3:fb:fb:86:6a:
+        65:2e:ad:e3:04:25:c0:b0:c7:87:7e:c0:a3:1d:c4:4e:cd:c7:
+        24:1c:79:32:4c:57:21:30:c7:1c:78:66:98:ea:1e:b8:d3:0a:
+        bc:1b:1f:0a:e8:a3:74:b7:69:d1:32:f7:16:14:73:5b:34:29:
+        f2:bc:a2:ba
+-----BEGIN X509 CRL-----
+MIIBtjCBnwIBATANBgkqhkiG9w0BAQUFADBHMRkwFwYDVQQDDBBMaWJvcGVheSB0
+ZXN0IENBMQ4wDAYDVQQKDAVPcGVyYTENMAsGA1UECAwET3NsbzELMAkGA1UEBhMC
+Tk8XDTEyMDMyMjA5MDY1M1oXDTIyMDMyMDA5MDY1M1owFDASAgECFw0xMjAzMjIw
+OTA2NTNaoA4wDDAKBgNVHRQEAwIBAjANBgkqhkiG9w0BAQUFAAOCAQEAUJL4v4dP
+lC9WqOU27gTj5b3jJSe9leqFJf3sIi/47arERSoc4cGXejKEk4MU823aJVryR/oX
+R0QgPXig8JwpKFzbBlGtm/Of++Hpa03beymXa0FeUpQnmlJXpQbmrv58aQxKhlME
+KZwkyTsiJz9C2qrxXilaVKVUNLnIncH86Qg345quZs4zD41kPPCK80R+8F1aBf+c
+Ngr9Ek/geDhYcyz6B9FCrno2AOQDScu6BymFN/NwLiH2joqmzmoYDO5xwvP7+4Zq
+ZS6t4wQlwLDHh37Aox3ETs3HJBx5MkxXITDHHHhmmOoeuNMKvBsfCuijdLdp0TL3
+FhRzWzQp8ryiug==
+-----END X509 CRL-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/keys/key1.pem openssl-1.0.0q/selftest/TestCA/keys/key1.pem
--- openssl-1.0.0q.orig/selftest/TestCA/keys/key1.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/keys/key1.pem	2017-04-25 16:23:41.380031258 +0200
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAvwHqT0VBHpaDXUJKoitwFvjbeexmB0VKioXQK8HwbofZ4a0f
+6pyLDVw/b5zLjLOIGsEQDV9TDZL8cjArRj4Fj9F62V721Kg6IMrILOy0jcWRDrO0
+ma0OXEN1wgCNuOkRVHFg5HEZVm3Lc8qkPTzv3ggOkBsvpIqBgf3KUBegplyog2w2
+VKkP8/G6sf2qkgcuZk5RSrv+XM+SDe8o4JUS/q9f/Jo9JENSD0EVmZ6E/P13byuX
+VH7NuuchD1IuiVuDnQ02K8JiMq7eAvL/ntU1rbh3jQbPHu7NwFR6PartgtFk332H
+34/Pncz911i2r4cDGQvFIfHIg3K8o/2DuKul1wIDAQABAoIBAQCz0lbICFgVNvg3
+XUisQh7F0cW2lEM9xxM1NGNWPsBfHtCWMQniMzyJ+HXUWxYawY56OZYmML8dAWtf
+CVBEUfGkgz+X01qnvDT1WFN6T+JvsjctUyvMneruG6iKW0ERe4KQMClbB8sl3jnz
+KizTZkIgkw86xg1lZ+wi+E52drgMxX8FI45hfk7ODZyjkuY+Mvhb7G9710jOznJT
+seqtynipHoCUAPWjcLuGJI9XU1kQo1SO3DGxwzUr3K+OD2o6p3R03EBEZb9//5DH
+GzzFfnEVNPis1LHs19+8i/4mdIo2VpezMLqRCqsFki1JGIm26zvl1VpiQUz/nWD9
+KIctaorhAoGBAPEueAsQbD/BUpj8F2O1v8EWPTQ38BR8jeQrE5A7FdDNcEMuRaB+
+ReNUu94e2xBHOja+tA8euHe9RnP6FQoS16nWr2h2DN+j1KBLLuJscmGs24PNg6k6
+VzLq6pGNmSdOmyTnSy1okwqTRXCwd45FH9Tu0Z1qExERfTgdrDw1ZyvxAoGBAMq+
+Qvnuwe0HY73dL5KfvuzTX12GjAv5OrmEBfIDPBK/jNYNWJFLaoO3NHBFEO+c4OKi
+kGZhyzQCObu7CS9svrsugw74MPLKRcfFRHYE86HJkAoTXIhb4+BwP+docHjlori8
+gC9DuBzuoB6GgZ2XMqCscrDgAZsfi+ssTZoOg9ZHAoGARaF95Ovb5NhCqYp2kkIB
+15Q9HVtdA/0l1g8dudFlLgBx/eNZFMoAEW8AQlO0OVHnG7EZORhMd718nrU/58Wi
+4BTsVYNnmhWpqJGsOpDGwS5vvfDSp0QBsuCh0l4ILpICNrhUOwrrEO2N6cf47GlG
+lGpSuFjMomvjNBVVCZj9bXECgYBWAE845eatPS06JNFBSTIcE62oZqKRka8vcqly
+95xL96UuR4sCVxNfvB8qYKHGgq2CdaL7SxB/h1ImKDjFPUPK8vf1KaLZ2qOvEibw
+STlvr6jCHWRrE0+erP7ukobjQcW8x3k4k2lOHIsfZ78jsjdvoLcmAF+uBbu8jpZ8
+exvBkQKBgQCw4+8fypZAtoFe6KymwJ5JCbwnAuU58y9Nlz+KHUd4utXh4N5HNtyV
+FuQfhY/1QcENIR2NiijFsgrA3cb6DBls0V1yRUS5LlYALFrQ0yIEv8Zb5s61tYrE
+LiV+H65Tl5zqOKV0bQwufqYipjzSkoS7PH5mkJMKYX3fiS8GUYrvVQ==
+-----END RSA PRIVATE KEY-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/keys/key2.pem openssl-1.0.0q/selftest/TestCA/keys/key2.pem
--- openssl-1.0.0q.orig/selftest/TestCA/keys/key2.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/keys/key2.pem	2017-04-25 16:23:41.380031258 +0200
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAxv0r2FzWouV6DpG6cRigefnSrSXqlRZi3Jf0Ey+ACnGbaW6G
+PBFNau1bDXSn4CI24Pccqozm0t2FhH+YF78MCmxpgPlyYfpWYHw8QpgpGod9nhEy
+HfhgV8lzTCppu54P9qSwyUC/TfPhz/ktee1KZHWo94Kpe4b6LOtJ+B2nHOtpbM3t
+4B5pfBv83EIvaEabq2ZFgzXyw43Wz7BmpYECBcXbx8czsoCvnY610XGXRvgsVSPi
+M4CgDjfGpSYeKESnU1rHkWcwQNiamHXBHUvF7RaaQMKhAzOZBdTCPEGPeXWueavr
+0u+OD++Ta6UYwxO65MPphMwxXK4IHrzeSiA9SQIDAQABAoIBAQCNC2SpntyQaCHE
+8+x4P6F38+kty8Nj25NFkvtxIeka/f3PlITXTNhYI1e3yOk5SGcnvGB4TxlJe7Uo
+/pvasRMizEdYIPe/lQbmqwi3l00DPeh/QucIMUZw0xzDbwi08MuV4pRggmFXKrfz
+h0aBtv1VCcUzc00YfssTTc+Ha9VI/B67tHauNFh8iq+o8ztv0B9hsc03rMXEkIDo
+GM6yuNKrMD5IwDJ+DonQ/epEpBORwS0b55CFgcgEhfBWXW1Q9LEoYptpVjPYoVwj
+zaaztsMB4bKHNArtKk6yUVYNPC0bTZSKMhTQNPa0Eb2qtjg5K3WmLdsM325mLVJd
+K4HALZ9VAoGBAPg7Frjrzk2UNd4pMinRK6HnXHRzMJgIr3jYf7oExg6YM0ZnyrYK
+TPgMTw7pXN9cDelNT1ngPXiedYrGm4RCADrnV4+FJdtCI7EPCizgfLYBEm3Uqw8U
+ztJYJ3URjXbAqe13GM8J7by/iA4tJscIS6ZevEVOEOTdhLLNo3FMk5WDAoGBAM03
+iiWw29oOYYJHXN1FnKcUnk9BT5Wc0OERVINdTnXSjNam8raM930Wei1CqC3ejjDy
+37Y992L8dX07o537IbWeLhWOH27kTXew1e6ZOCbnkKltdg30NNe2/uwJ6ul9iz/K
+Ze2auM24g8VjmAAo8ndCeVCCcDjAzzRK4M/uILRDAoGAaGI4qOSIKXlkuZprPMh3
+56pp55I04gns+A1akLfHLYX1MesdhDWKrlhGuoeJhWepde0LrEiusNU5qnTgGtrC
+TALSgEjGZZBHgAJKDhsMdmC3BjaDBGGEo1Fsrj8GVOSp0HDfntiW/2MvbH6yKsoj
+Pb/iveYZFpTMY4Az9cX03c8CgYBywnFNvIZlfY9H1HJ5BtmgkaYp+gLwTp58jj1t
+rLsYpmK+EuQ987zexbgTIWh9Jizr8JXsCuESCM4G91f7G5nxP4DT6wNm9uLfYRNx
+d1twXiSGqsDO8tauHxaVlsI4Sk2Zoay4X8KiwGFn+9bfmAZnbNP8ksUA58m3m3v2
+q1q8kwKBgC2SlV6do7bkU71avD33LhSncb/qng9T2usaWeIcjwEbqXxBOl92YvNj
+qQlHWqf1rYi+lGWtoUqyBTXFoHbtvrHz1EZxAItCUAwQeXBHnbiHQnhzQ+nIha1p
+AAqSONUOjRvuUlH081hMaRdcCU7c12uuiVLrsIdgh4IfByzGwBdt
+-----END RSA PRIVATE KEY-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/openssl.cnf openssl-1.0.0q/selftest/TestCA/openssl.cnf
--- openssl-1.0.0q.orig/selftest/TestCA/openssl.cnf	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/openssl.cnf	2017-04-25 16:23:41.381030826 +0200
@@ -0,0 +1,350 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME			= .
+RANDFILE		= $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file		= $ENV::HOME/.oid
+oid_section		= new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions		= 
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+# Policies used by the TSA examples.
+tsa_policy1 = 1.2.3.4.1
+tsa_policy2 = 1.2.3.4.5.6
+tsa_policy3 = 1.2.3.4.5.7
+
+####################################################################
+[ ca ]
+default_ca	= CA_default		# The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir		= .		# Where everything is kept
+certs		= $dir/certs		# Where the issued certs are kept
+crl_dir		= $dir/crls		# Where the issued crl are kept
+database	= $dir/ca-data/index.txt	# database index file.
+#unique_subject	= no			# Set to 'no' to allow creation of
+					# several ctificates with same subject.
+new_certs_dir	= $dir/ca-data/certs		# default place for new certs.
+
+certificate	= $dir/ca-data/cacert.pem 	# The CA certificate
+serial		= $dir/ca-data/serial 		# The current serial number
+crlnumber	= $dir/ca-data/crlnumber	# the current crl number
+					# must be commented out to leave a V1 CRL
+crl		= $dir/ca-data/crl.pem 		# The current CRL
+private_key	= $dir/ca-data/cakey.pem # The private key
+RANDFILE	= $dir/ca-data/.rand	# private random number file
+
+x509_extensions	= usr_cert		# The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt 	= ca_default		# Subject Name options
+cert_opt 	= ca_default		# Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions	= crl_ext
+
+default_days	= 365		# how long to certify for
+default_crl_days= 30			# how long before next CRL
+default_md	= default		# use public key default MD
+preserve	= no			# keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy		= policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName		= match
+stateOrProvinceName	= match
+organizationName	= match
+organizationalUnitName	= optional
+commonName		= supplied
+emailAddress		= optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName		= optional
+stateOrProvinceName	= optional
+localityName		= optional
+organizationName	= optional
+organizationalUnitName	= optional
+commonName		= supplied
+emailAddress		= optional
+
+####################################################################
+[ req ]
+default_bits		= 1024
+default_keyfile 	= privkey.pem
+distinguished_name	= req_distinguished_name
+attributes		= req_attributes
+x509_extensions	= v3_ca	# The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options. 
+# default: PrintableString, T61String, BMPString.
+# pkix	 : PrintableString, BMPString (PKIX recommendation before 2004)
+# utf8only: only UTF8Strings (PKIX recommendation after 2004).
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
+string_mask = utf8only
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName			= Country Name (2 letter code)
+countryName_default		= AU
+countryName_min			= 2
+countryName_max			= 2
+
+stateOrProvinceName		= State or Province Name (full name)
+stateOrProvinceName_default	= Some-State
+
+localityName			= Locality Name (eg, city)
+
+0.organizationName		= Organization Name (eg, company)
+0.organizationName_default	= Internet Widgits Pty Ltd
+
+# we can do this but it is not needed normally :-)
+#1.organizationName		= Second Organization Name (eg, company)
+#1.organizationName_default	= World Wide Web Pty Ltd
+
+organizationalUnitName		= Organizational Unit Name (eg, section)
+#organizationalUnitName_default	=
+
+commonName			= Common Name (e.g. server FQDN or YOUR name)
+commonName_max			= 64
+
+emailAddress			= Email Address
+emailAddress_max		= 64
+
+# SET-ex3			= SET extension number 3
+
+[ req_attributes ]
+challengePassword		= A challenge password
+challengePassword_min		= 4
+challengePassword_max		= 20
+
+unstructuredName		= An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType			= server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment			= "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl		= http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This is required for TSA certificates.
+# extendedKeyUsage = critical,timeStamping
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer
+
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType			= server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment			= "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl		= http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
+
+####################################################################
+[ tsa ]
+
+default_tsa = tsa_config1	# the default TSA section
+
+[ tsa_config1 ]
+
+# These are used by the TSA reply generation only.
+dir		= ./demoCA		# TSA root directory
+serial		= $dir/tsaserial	# The current serial number (mandatory)
+crypto_device	= builtin		# OpenSSL engine to use for signing
+signer_cert	= $dir/tsacert.pem 	# The TSA signing certificate
+					# (optional)
+certs		= $dir/cacert.pem	# Certificate chain to include in reply
+					# (optional)
+signer_key	= $dir/private/tsakey.pem # The TSA private key (optional)
+
+default_policy	= tsa_policy1		# Policy if request did not specify it
+					# (optional)
+other_policies	= tsa_policy2, tsa_policy3	# acceptable policies (optional)
+digests		= md5, sha1		# Acceptable message digests (mandatory)
+accuracy	= secs:1, millisecs:500, microsecs:100	# (optional)
+clock_precision_digits  = 0	# number of digits after dot. (optional)
+ordering		= yes	# Is ordering defined for timestamps?
+				# (optional, default: no)
+tsa_name		= yes	# Must the TSA name be included in the reply?
+				# (optional, default: no)
+ess_cert_id_chain	= no	# Must the ESS cert id chain be included?
+				# (optional, default: no)
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/reqs/req1.pem openssl-1.0.0q/selftest/TestCA/reqs/req1.pem
--- openssl-1.0.0q.orig/selftest/TestCA/reqs/req1.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/reqs/req1.pem	2017-04-25 16:23:41.381030826 +0200
@@ -0,0 +1,61 @@
+Certificate Request:
+    Data:
+        Version: 0 (0x0)
+        Subject: CN=Libopeay test cert 1, O=Opera, ST=Oslo, C=NO
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:bf:01:ea:4f:45:41:1e:96:83:5d:42:4a:a2:2b:
+                    70:16:f8:db:79:ec:66:07:45:4a:8a:85:d0:2b:c1:
+                    f0:6e:87:d9:e1:ad:1f:ea:9c:8b:0d:5c:3f:6f:9c:
+                    cb:8c:b3:88:1a:c1:10:0d:5f:53:0d:92:fc:72:30:
+                    2b:46:3e:05:8f:d1:7a:d9:5e:f6:d4:a8:3a:20:ca:
+                    c8:2c:ec:b4:8d:c5:91:0e:b3:b4:99:ad:0e:5c:43:
+                    75:c2:00:8d:b8:e9:11:54:71:60:e4:71:19:56:6d:
+                    cb:73:ca:a4:3d:3c:ef:de:08:0e:90:1b:2f:a4:8a:
+                    81:81:fd:ca:50:17:a0:a6:5c:a8:83:6c:36:54:a9:
+                    0f:f3:f1:ba:b1:fd:aa:92:07:2e:66:4e:51:4a:bb:
+                    fe:5c:cf:92:0d:ef:28:e0:95:12:fe:af:5f:fc:9a:
+                    3d:24:43:52:0f:41:15:99:9e:84:fc:fd:77:6f:2b:
+                    97:54:7e:cd:ba:e7:21:0f:52:2e:89:5b:83:9d:0d:
+                    36:2b:c2:62:32:ae:de:02:f2:ff:9e:d5:35:ad:b8:
+                    77:8d:06:cf:1e:ee:cd:c0:54:7a:3d:aa:ed:82:d1:
+                    64:df:7d:87:df:8f:cf:9d:cc:fd:d7:58:b6:af:87:
+                    03:19:0b:c5:21:f1:c8:83:72:bc:a3:fd:83:b8:ab:
+                    a5:d7
+                Exponent: 65537 (0x10001)
+        Attributes:
+            a0:00
+    Signature Algorithm: sha1WithRSAEncryption
+        a6:85:15:08:62:c8:c5:90:86:d9:95:40:5e:91:c5:13:15:b6:
+        2a:27:b2:07:17:d3:a9:56:57:b8:9f:19:f4:3b:8b:7b:66:c5:
+        a2:99:b6:27:54:cf:f6:89:67:a6:e0:e9:b5:d2:94:b3:47:ae:
+        e2:35:39:22:f2:d2:e0:1f:98:02:e0:79:5c:4a:3a:9d:94:c6:
+        b0:32:5a:36:05:44:c5:f5:22:f8:1f:af:ba:70:be:58:80:78:
+        a0:52:b5:de:f0:cd:38:13:d5:6a:e9:84:9f:5e:36:95:3a:33:
+        1d:b1:06:e9:6d:cc:2d:a2:a8:ff:ba:c5:a2:ca:81:83:a2:e2:
+        cd:ff:22:04:bb:5b:4f:78:0f:a4:c3:3b:6e:cc:6a:fd:bf:a1:
+        66:fc:e5:55:e3:df:e6:63:8e:8a:bb:fe:b3:64:43:7e:d2:80:
+        ab:a1:09:4f:ae:50:ea:61:ca:8b:15:e6:c9:5f:b6:28:ee:d9:
+        4a:6d:fb:2b:1d:65:1e:84:26:02:7e:5d:ec:32:b6:b7:cd:82:
+        97:76:cc:d5:4d:ad:c7:81:79:a3:e6:6a:da:ea:95:89:2c:b1:
+        f1:6a:0b:c3:27:b3:5a:90:60:ed:03:bc:75:cf:95:21:81:2a:
+        1d:1b:5e:d1:14:8d:a6:01:90:fc:74:fc:87:2e:fe:d0:ef:ba:
+        81:34:cd:8f
+-----BEGIN CERTIFICATE REQUEST-----
+MIICkDCCAXgCAQAwSzEdMBsGA1UEAwwUTGlib3BlYXkgdGVzdCBjZXJ0IDExDjAM
+BgNVBAoMBU9wZXJhMQ0wCwYDVQQIDARPc2xvMQswCQYDVQQGEwJOTzCCASIwDQYJ
+KoZIhvcNAQEBBQADggEPADCCAQoCggEBAL8B6k9FQR6Wg11CSqIrcBb423nsZgdF
+SoqF0CvB8G6H2eGtH+qciw1cP2+cy4yziBrBEA1fUw2S/HIwK0Y+BY/Retle9tSo
+OiDKyCzstI3FkQ6ztJmtDlxDdcIAjbjpEVRxYORxGVZty3PKpD08794IDpAbL6SK
+gYH9ylAXoKZcqINsNlSpD/PxurH9qpIHLmZOUUq7/lzPkg3vKOCVEv6vX/yaPSRD
+Ug9BFZmehPz9d28rl1R+zbrnIQ9SLolbg50NNivCYjKu3gLy/57VNa24d40Gzx7u
+zcBUej2q7YLRZN99h9+Pz53M/ddYtq+HAxkLxSHxyINyvKP9g7irpdcCAwEAAaAA
+MA0GCSqGSIb3DQEBBQUAA4IBAQCmhRUIYsjFkIbZlUBekcUTFbYqJ7IHF9OpVle4
+nxn0O4t7ZsWimbYnVM/2iWem4Om10pSzR67iNTki8tLgH5gC4HlcSjqdlMawMlo2
+BUTF9SL4H6+6cL5YgHigUrXe8M04E9Vq6YSfXjaVOjMdsQbpbcwtoqj/usWiyoGD
+ouLN/yIEu1tPeA+kwztuzGr9v6Fm/OVV49/mY46Ku/6zZEN+0oCroQlPrlDqYcqL
+FebJX7Yo7tlKbfsrHWUehCYCfl3sMra3zYKXdszVTa3HgXmj5mra6pWJLLHxagvD
+J7NakGDtA7x1z5UhgSodG17RFI2mAZD8dPyHLv7Q77qBNM2P
+-----END CERTIFICATE REQUEST-----
diff -Naur openssl-1.0.0q.orig/selftest/TestCA/reqs/req2.pem openssl-1.0.0q/selftest/TestCA/reqs/req2.pem
--- openssl-1.0.0q.orig/selftest/TestCA/reqs/req2.pem	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/TestCA/reqs/req2.pem	2017-04-25 16:23:41.382030953 +0200
@@ -0,0 +1,61 @@
+Certificate Request:
+    Data:
+        Version: 0 (0x0)
+        Subject: CN=Libopeay test cert 2, O=Opera, ST=Oslo, C=NO
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:c6:fd:2b:d8:5c:d6:a2:e5:7a:0e:91:ba:71:18:
+                    a0:79:f9:d2:ad:25:ea:95:16:62:dc:97:f4:13:2f:
+                    80:0a:71:9b:69:6e:86:3c:11:4d:6a:ed:5b:0d:74:
+                    a7:e0:22:36:e0:f7:1c:aa:8c:e6:d2:dd:85:84:7f:
+                    98:17:bf:0c:0a:6c:69:80:f9:72:61:fa:56:60:7c:
+                    3c:42:98:29:1a:87:7d:9e:11:32:1d:f8:60:57:c9:
+                    73:4c:2a:69:bb:9e:0f:f6:a4:b0:c9:40:bf:4d:f3:
+                    e1:cf:f9:2d:79:ed:4a:64:75:a8:f7:82:a9:7b:86:
+                    fa:2c:eb:49:f8:1d:a7:1c:eb:69:6c:cd:ed:e0:1e:
+                    69:7c:1b:fc:dc:42:2f:68:46:9b:ab:66:45:83:35:
+                    f2:c3:8d:d6:cf:b0:66:a5:81:02:05:c5:db:c7:c7:
+                    33:b2:80:af:9d:8e:b5:d1:71:97:46:f8:2c:55:23:
+                    e2:33:80:a0:0e:37:c6:a5:26:1e:28:44:a7:53:5a:
+                    c7:91:67:30:40:d8:9a:98:75:c1:1d:4b:c5:ed:16:
+                    9a:40:c2:a1:03:33:99:05:d4:c2:3c:41:8f:79:75:
+                    ae:79:ab:eb:d2:ef:8e:0f:ef:93:6b:a5:18:c3:13:
+                    ba:e4:c3:e9:84:cc:31:5c:ae:08:1e:bc:de:4a:20:
+                    3d:49
+                Exponent: 65537 (0x10001)
+        Attributes:
+            a0:00
+    Signature Algorithm: sha1WithRSAEncryption
+        21:d8:e4:5c:70:af:0f:aa:cb:79:4c:1c:67:42:ca:9e:a7:f1:
+        7d:fe:b5:0e:70:56:04:de:2c:44:6b:d7:cc:be:27:92:60:7f:
+        af:fb:43:aa:bd:81:8f:ab:a1:92:fb:5b:57:e6:d8:54:6f:2d:
+        72:0e:08:77:55:13:71:8b:44:cb:37:a7:3d:55:cc:74:74:f5:
+        9f:f8:75:a6:39:5d:47:4f:3c:a2:70:db:43:5c:81:e3:49:35:
+        e3:8f:b2:67:c3:44:bf:f6:80:ac:d7:90:68:b9:41:bd:c3:9f:
+        f5:54:30:f8:32:b8:9a:8e:f2:3a:34:e5:3f:00:ec:2e:bb:95:
+        23:53:04:1e:4c:19:68:18:8c:2d:36:8f:66:66:fc:e7:d2:85:
+        d5:f6:cc:e8:cb:63:df:1d:0a:25:bb:78:a4:2a:f1:59:1e:55:
+        ef:64:0e:53:c7:97:69:9a:b6:74:0e:a5:12:c6:7a:b0:20:f0:
+        d7:2a:1a:0f:9f:18:a1:be:c8:43:55:29:a1:50:30:18:97:c7:
+        f4:ff:74:bd:7c:db:39:3e:21:3b:38:3f:9f:7e:0f:b3:7f:54:
+        d2:a9:1b:72:13:5b:f0:4b:eb:3e:99:4a:80:80:f6:4b:ec:24:
+        61:7b:ef:8b:a1:7b:92:2e:3f:cb:09:4b:02:0a:72:8b:26:bb:
+        b8:18:1e:5b
+-----BEGIN CERTIFICATE REQUEST-----
+MIICkDCCAXgCAQAwSzEdMBsGA1UEAwwUTGlib3BlYXkgdGVzdCBjZXJ0IDIxDjAM
+BgNVBAoMBU9wZXJhMQ0wCwYDVQQIDARPc2xvMQswCQYDVQQGEwJOTzCCASIwDQYJ
+KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMb9K9hc1qLleg6RunEYoHn50q0l6pUW
+YtyX9BMvgApxm2luhjwRTWrtWw10p+AiNuD3HKqM5tLdhYR/mBe/DApsaYD5cmH6
+VmB8PEKYKRqHfZ4RMh34YFfJc0wqabueD/aksMlAv03z4c/5LXntSmR1qPeCqXuG
++izrSfgdpxzraWzN7eAeaXwb/NxCL2hGm6tmRYM18sON1s+wZqWBAgXF28fHM7KA
+r52OtdFxl0b4LFUj4jOAoA43xqUmHihEp1Nax5FnMEDYmph1wR1Lxe0WmkDCoQMz
+mQXUwjxBj3l1rnmr69Lvjg/vk2ulGMMTuuTD6YTMMVyuCB683kogPUkCAwEAAaAA
+MA0GCSqGSIb3DQEBBQUAA4IBAQAh2ORccK8Pqst5TBxnQsqep/F9/rUOcFYE3ixE
+a9fMvieSYH+v+0OqvYGPq6GS+1tX5thUby1yDgh3VRNxi0TLN6c9Vcx0dPWf+HWm
+OV1HTzyicNtDXIHjSTXjj7Jnw0S/9oCs15BouUG9w5/1VDD4MriajvI6NOU/AOwu
+u5UjUwQeTBloGIwtNo9mZvzn0oXV9szoy2PfHQolu3ikKvFZHlXvZA5Tx5dpmrZ0
+DqUSxnqwIPDXKhoPnxihvshDVSmhUDAYl8f0/3S9fNs5PiE7OD+ffg+zf1TSqRty
+E1vwS+s+mUqAgPZL7CRhe++LoXuSLj/LCUsCCnKLJru4GB5b
+-----END CERTIFICATE REQUEST-----
diff -Naur openssl-1.0.0q.orig/selftest/ciphers.h openssl-1.0.0q/selftest/ciphers.h
--- openssl-1.0.0q.orig/selftest/ciphers.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/ciphers.h	2017-04-25 16:23:41.382030953 +0200
@@ -0,0 +1,9 @@
+
+#ifndef _LIBOPEY_SELFTEST_CIPHERS_H_
+#define _LIBOPEY_SELFTEST_CIPHERS_H_
+
+#include "modules/util/cleanse.h"
+
+typedef const EVP_CIPHER* (*EVP_CIPHER_CB)();
+
+#endif /* _LIBOPEY_SELFTEST_CIPHERS_H_ */
diff -Naur openssl-1.0.0q.orig/selftest/ciphers.ot openssl-1.0.0q/selftest/ciphers.ot
--- openssl-1.0.0q.orig/selftest/ciphers.ot	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/ciphers.ot	2017-04-25 16:23:41.382030953 +0200
@@ -0,0 +1,415 @@
+group "libopeay.ciphers";
+require _SSL_SUPPORT_;
+
+language c++;
+
+include "modules/libopeay/openssl/cryptlib.h";
+include "modules/libopeay/openssl/evp.h";
+include "modules/libopeay/selftest/ciphers.h";
+
+global {
+/* Test vectors from openssl*/
+
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ * 
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ * 
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (eay@cryptsoft.com)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from 
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+
+// RC4 tests
+
+unsigned char rc4_keys[6][16]={
+	{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef},
+	{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef},
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	{0xef, 0x01, 0x23, 0x45, 0xef, 0x01, 0x23, 0x45, 0xef, 0x01, 0x23, 0x45, 0xef, 0x01, 0x23, 0x45},
+	{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef},
+	{0xef, 0x01, 0x23, 0x45, 0xef, 0x01, 0x23, 0x45, 0xef, 0x01, 0x23, 0x45, 0xef, 0x01, 0x23, 0x45}
+	};
+
+static unsigned char rc4_data_len[6]={8,8,8,20, 28, 10};
+static unsigned char rc4_data[6][28]={
+	{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef},
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	{0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, 0x12, 0x34, 0x56, 0x78},
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	};
+
+static unsigned char rc4_output[6][30]={
+	{0x75, 0xb7, 0x87, 0x80, 0x99, 0xe0, 0xc5, 0x96},
+	{0x74, 0x94, 0xc2, 0xe7, 0x10, 0x4b, 0x08, 0x79},
+	{0xde, 0x18, 0x89, 0x41, 0xa3, 0x37, 0x5d, 0x3a},
+	{0xd6, 0xa1, 0x41, 0xa7, 0xec, 0x3c, 0x38, 0xdf, 0xbd, 0x61, 0x5a, 0x11, 0x62, 0xe1, 0xc7, 0xba, 0x36, 0xb6, 0x78, 0x58},
+	{0x66, 0xa0, 0x94, 0x9f, 0x8a, 0xf7, 0xd6, 0x89, 0x1f, 0x7f, 0x83, 0x2b, 0xa8, 0x33, 0xc0, 0x0c, 0x89, 0x2e, 0xbe, 0x30, 0x14, 0x3c, 0xe2, 0x87, 0x40, 0x01, 0x1e, 0xcf},
+	{0xd6, 0xa1, 0x41, 0xa7, 0xec, 0x3c, 0x38, 0xdf, 0xbd, 0x61}
+	};
+
+/*
+// RC2 tests
+static const unsigned char RC2key[4][16]={
+	{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+	{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01},
+	{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+	{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
+	 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F},
+	};
+
+static const unsigned char rc2_iv  [8]={0,0,0,0,0,0,0,0};
+
+static const unsigned char rc2_data_len[4]={8,8,8,8};
+static const unsigned char RC2plain[4][8]={
+	{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+	{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+	{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},
+	{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+	};
+
+static const unsigned char RC2cipher[4][8]={
+	{0x1C,0x19,0x8A,0x83,0x8D,0xF0,0x28,0xB7},
+	{0x21,0x82,0x9C,0x78,0xA9,0xF9,0xC0,0x74},
+	{0x13,0xDB,0x35,0x17,0xD3,0x21,0x86,0x9E},
+	{0x50,0xDC,0x01,0x62,0xBD,0x75,0x7F,0x31},
+	};
+*/
+
+// DES test
+
+static const unsigned char cbc_key []={	0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef};
+static const unsigned char cbc3_key[]={	0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,
+										0xf1,0xe0,0xd3,0xc2,0xb5,0xa4,0x97,0x86, 
+										0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10};
+
+static const unsigned char cbc_iv  [8]={0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10};
+
+static const unsigned char cbc_data[]={
+	0x37,0x36,0x35,0x34,0x33,0x32,0x31,0x20,
+	0x4E,0x6F,0x77,0x20,0x69,0x73,0x20,0x74,
+	0x68,0x65,0x20,0x74,0x69,0x6D,0x65,0x20,
+	0x66,0x6F,0x72,0x20,0x00,0x31,0x00,0x00
+};
+
+static const unsigned char cbc_ok[32]={
+	0xcc,0xd1,0x73,0xff,0xab,0x20,0x39,0xf4,
+	0xac,0xd8,0xae,0xfd,0xdf,0xd8,0xa1,0xeb,
+	0x46,0x8e,0x91,0x15,0x78,0x88,0xba,0x68,
+	0x1d,0x26,0x93,0x97,0xf7,0xfe,0x62,0xb4};
+
+static const unsigned char cbc3_ok[32]={
+	0x3F,0xE3,0x01,0xC9,0x62,0xAC,0x01,0xD0,
+	0x22,0x13,0x76,0x3C,0x1C,0xBD,0x4C,0xDC,
+	0x79,0x96,0x57,0xC0,0x64,0xEC,0xF5,0xD4,
+	0x1C,0x67,0x38,0x12,0xCF,0xDE,0x96,0x75};
+
+static const unsigned char des_cbc_size[] = {29, 32, 32};
+
+// 3DES test
+
+
+static const unsigned char des_ede_cbc3_data_len[1] = {32};
+
+static const unsigned char des_ede_cbc3_key[24] = {
+	0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 
+	0xf1, 0xe0, 0xd3, 0xc2, 0xb5, 0xa4, 0x97, 0x86,
+	0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
+};
+
+static const unsigned char des_ede_cbc3_iv[8] = {
+	0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
+};
+
+static const unsigned char des_ede_cbc3_input[32] = {
+	0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20,
+	0x4E, 0x6F, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74,
+	0x68, 0x65, 0x20, 0x74, 0x69, 0x6D, 0x65, 0x20,
+	0x66, 0x6F, 0x72, 0x20, 0x00, 0x00, 0x00, 0x00
+};
+
+static const unsigned char des_ede_cbc3_output[32] = {
+    0x3F, 0xE3, 0x01, 0xC9, 0x62, 0xAC, 0x01, 0xD0,
+	0x22, 0x13, 0x76, 0x3C, 0x1C, 0xBD, 0x4C, 0xDC,
+	0x79, 0x96, 0x57, 0xC0, 0x64, 0xEC, 0xF5, 0xD4,
+	0x1C, 0x67, 0x38, 0x12, 0xCF, 0xDE, 0x96, 0x75
+};
+
+// AES test
+
+static const unsigned char aes_data_len[1] = {16};
+
+// AES-128-CBC
+
+
+static const unsigned char aes_128_cbc_key[5][16] = {
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	{0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C},
+	{0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C},
+	{0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C},
+	{0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C},
+};
+
+static const unsigned char aes_128_cbc_iv[5][16] = {
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
+	{0x76, 0x49, 0xAB, 0xAC, 0x81, 0x19, 0xB2, 0x46, 0xCE, 0xE9, 0x8E, 0x9B, 0x12, 0xE9, 0x19, 0x7D},
+	{0x50, 0x86, 0xCB, 0x9B, 0x50, 0x72, 0x19, 0xEE, 0x95, 0xDB, 0x11, 0x3A, 0x91, 0x76, 0x78, 0xB2},
+	{0x73, 0xBE, 0xD6, 0xB8, 0xE3, 0xC1, 0x74, 0x3B, 0x71, 0x16, 0xE6, 0x9E, 0x22, 0x22, 0x95, 0x16},
+};
+
+static const unsigned char aes_128_cbc_input[5][16] = {
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	{0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96, 0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A},
+	{0xAE, 0x2D, 0x8A, 0x57, 0x1E, 0x03, 0xAC, 0x9C, 0x9E, 0xB7, 0x6F, 0xAC, 0x45, 0xAF, 0x8E, 0x51},
+	{0x30, 0xC8, 0x1C, 0x46, 0xA3, 0x5C, 0xE4, 0x11, 0xE5, 0xFB, 0xC1, 0x19, 0x1A, 0x0A, 0x52, 0xEF},
+	{0xF6, 0x9F, 0x24, 0x45, 0xDF, 0x4F, 0x9B, 0x17, 0xAD, 0x2B, 0x41, 0x7B, 0xE6, 0x6C, 0x37, 0x10},
+};
+
+static const unsigned char aes_128_cbc_output[5][16] = {
+	{0x8A, 0x05, 0xFC, 0x5E, 0x09, 0x5A, 0xF4, 0x84, 0x8A, 0x08, 0xD3, 0x28, 0xD3, 0x68, 0x8E, 0x3D},
+	{0x76, 0x49, 0xAB, 0xAC, 0x81, 0x19, 0xB2, 0x46, 0xCE, 0xE9, 0x8E, 0x9B, 0x12, 0xE9, 0x19, 0x7D},
+	{0x50, 0x86, 0xCB, 0x9B, 0x50, 0x72, 0x19, 0xEE, 0x95, 0xDB, 0x11, 0x3A, 0x91, 0x76, 0x78, 0xB2},
+	{0x73, 0xBE, 0xD6, 0xB8, 0xE3, 0xC1, 0x74, 0x3B, 0x71, 0x16, 0xE6, 0x9E, 0x22, 0x22, 0x95, 0x16},
+	{0x3F, 0xF1, 0xCA, 0xA1, 0x68, 0x1F, 0xAC, 0x09, 0x12, 0x0E, 0xCA, 0x30, 0x75, 0x86, 0xE1, 0xA7},
+};
+
+
+
+// AES-256-CBC
+
+
+static const unsigned char aes_256_cbc_key[5][32] = {
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	{0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81, 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7, 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4},
+	{0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81, 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7, 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4},
+	{0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81, 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7, 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4},
+	{0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81, 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7, 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4},
+};
+
+static const unsigned char aes_256_cbc_iv[5][16] = {
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
+	{0xF5, 0x8C, 0x4C, 0x04, 0xD6, 0xE5, 0xF1, 0xBA, 0x77, 0x9E, 0xAB, 0xFB, 0x5F, 0x7B, 0xFB, 0xD6},
+	{0x9C, 0xFC, 0x4E, 0x96, 0x7E, 0xDB, 0x80, 0x8D, 0x67, 0x9F, 0x77, 0x7B, 0xC6, 0x70, 0x2C, 0x7D},
+	{0x39, 0xF2, 0x33, 0x69, 0xA9, 0xD9, 0xBA, 0xCF, 0xA5, 0x30, 0xE2, 0x63, 0x04, 0x23, 0x14, 0x61},
+};
+
+static const unsigned char aes_256_cbc_input[5][16] = {
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	{0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96, 0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A},
+	{0xAE, 0x2D, 0x8A, 0x57, 0x1E, 0x03, 0xAC, 0x9C, 0x9E, 0xB7, 0x6F, 0xAC, 0x45, 0xAF, 0x8E, 0x51},
+	{0x30, 0xC8, 0x1C, 0x46, 0xA3, 0x5C, 0xE4, 0x11, 0xE5, 0xFB, 0xC1, 0x19, 0x1A, 0x0A, 0x52, 0xEF},
+	{0xF6, 0x9F, 0x24, 0x45, 0xDF, 0x4F, 0x9B, 0x17, 0xAD, 0x2B, 0x41, 0x7B, 0xE6, 0x6C, 0x37, 0x10},
+};
+
+static const unsigned char aes_256_cbc_output[5][16] = {
+	{0xFE, 0x3C, 0x53, 0x65, 0x3E, 0x2F, 0x45, 0xB5, 0x6F, 0xCD, 0x88, 0xB2, 0xCC, 0x89, 0x8F, 0xF0},
+	{0xF5, 0x8C, 0x4C, 0x04, 0xD6, 0xE5, 0xF1, 0xBA, 0x77, 0x9E, 0xAB, 0xFB, 0x5F, 0x7B, 0xFB, 0xD6},
+	{0x9C, 0xFC, 0x4E, 0x96, 0x7E, 0xDB, 0x80, 0x8D, 0x67, 0x9F, 0x77, 0x7B, 0xC6, 0x70, 0x2C, 0x7D},
+	{0x39, 0xF2, 0x33, 0x69, 0xA9, 0xD9, 0xBA, 0xCF, 0xA5, 0x30, 0xE2, 0x63, 0x04, 0x23, 0x14, 0x61},
+	{0xB2, 0xEB, 0x05, 0xE2, 0xC3, 0x9B, 0xE9, 0xFC, 0xDA, 0x6C, 0x19, 0x07, 0x8C, 0x6A, 0x9D, 0x1B},
+};
+
+
+int TestEncrypt(EVP_CIPHER_CB func, const unsigned char *key, const unsigned char *iv, 
+			const unsigned char *plain, unsigned int plain_len, 
+			const unsigned char *encrypted, unsigned int encrypted_len)
+{
+	EVP_CIPHER_CTX ctx;
+	const EVP_CIPHER *cipher;
+	unsigned char output_data[512]; // ARRAY OK 2009-05-25 yngve 
+	int count=0, count1=0;
+
+	EVP_CIPHER_CTX_init(&ctx);
+
+	cipher = func();
+	if(cipher == NULL)
+	  return -2;
+
+	if(sizeof(output_data) < encrypted_len)
+		return -3;
+
+	if(sizeof(output_data) <= (plain_len + ((cipher->flags & EVP_CIPH_MODE)!= EVP_CIPH_CFB_MODE ? cipher->block_size : 1)*2))
+		return -4;
+
+	EVP_CipherInit(&ctx, cipher, key, iv, 1);
+	EVP_CIPHER_CTX_set_padding(&ctx, 0);
+	OPERA_cleanse(output_data, sizeof(output_data));
+
+	EVP_CipherUpdate(&ctx, output_data, &count, plain, plain_len);
+	EVP_EncryptFinal_ex(&ctx, output_data + count, &count1);
+
+	count += count1;
+
+	EVP_CIPHER_CTX_cleanup(&ctx);
+
+	if((unsigned int) count == encrypted_len)
+	{
+		if(op_memcmp(output_data, encrypted, count) == 0)
+			return 0;
+		else
+			return -5;
+	}
+	return -1;
+}
+
+int TestDecrypt(EVP_CIPHER_CB func, const unsigned char *key, const unsigned char *iv, 
+			const unsigned char *plain, unsigned int plain_len, 
+			const unsigned char *encrypted, unsigned int encrypted_len)
+{
+	EVP_CIPHER_CTX ctx;
+	const EVP_CIPHER *cipher;
+	unsigned char output_data[512]; // ARRAY OK 2009-05-25 yngve 
+	int count=0, count1=0;
+
+	EVP_CIPHER_CTX_init(&ctx);
+
+	cipher = func();
+	if(cipher == NULL)
+	  return -2;
+
+	if(sizeof(output_data) < encrypted_len)
+		return -3;
+
+	if(sizeof(output_data) <= plain_len + ((cipher->flags & EVP_CIPH_MODE)!= EVP_CIPH_CFB_MODE ? cipher->block_size : 1)*2)
+		return -4;
+
+	EVP_CipherInit(&ctx, cipher, key, iv, 0);
+	EVP_CIPHER_CTX_set_padding(&ctx, 0);
+	OPERA_cleanse(output_data, sizeof(output_data));
+
+	EVP_CipherUpdate(&ctx, output_data, &count, encrypted, encrypted_len);
+	EVP_DecryptFinal_ex(&ctx, output_data + count, &count1);
+
+	count += count1;
+
+	EVP_CIPHER_CTX_cleanup(&ctx);
+
+	if((cipher->flags & EVP_CIPH_MODE) != EVP_CIPH_CFB_MODE  && cipher->block_size != 1)
+	{
+		if(count % cipher->block_size != 0)
+			return -6;
+		if((unsigned int) count < plain_len)
+			return -7;
+		else if((unsigned int) count != plain_len && ((unsigned int) count) - plain_len >= (unsigned int)cipher->block_size)
+			return -8;
+
+		return (op_memcmp(output_data, plain, plain_len) == 0 ? 0 : -9);
+	}
+
+	if((unsigned int) count == plain_len)
+	{
+		if(op_memcmp(output_data, plain, count) == 0)
+			return 0;
+		else
+			return -5;
+	}
+	return -1;
+}
+
+
+}
+
+table testlist(const char *, int ,
+			EVP_CIPHER_CB, const unsigned char *, const unsigned char *, 
+			const unsigned char *, const unsigned char *, 
+			const unsigned char *, const unsigned char *) {
+	{"RC4",		0,	EVP_rc4,	rc4_keys[0],	NULL,	rc4_data[0],	&rc4_data_len[0],	rc4_output[0],	&rc4_data_len[0]},
+	{"RC4",		1,	EVP_rc4,	rc4_keys[1],	NULL,	rc4_data[1],	&rc4_data_len[1],	rc4_output[1],	&rc4_data_len[1]},
+	{"RC4",		2,	EVP_rc4,	rc4_keys[2],	NULL,	rc4_data[2],	&rc4_data_len[2],	rc4_output[2],	&rc4_data_len[2]},
+	{"RC4",		3,	EVP_rc4,	rc4_keys[3],	NULL,	rc4_data[3],	&rc4_data_len[3],	rc4_output[3],	&rc4_data_len[3]},
+	{"RC4",		4,	EVP_rc4,	rc4_keys[4],	NULL,	rc4_data[4],	&rc4_data_len[4],	rc4_output[4],	&rc4_data_len[4]},
+	{"RC4",		5,	EVP_rc4,	rc4_keys[5],	NULL,	rc4_data[5],	&rc4_data_len[5],	rc4_output[5],	&rc4_data_len[5]},
+	//{"DES",		0,	EVP_des_cbc,	cbc_key,	cbc_iv,	cbc_data,		&des_cbc_size[0],	cbc_ok,			&des_cbc_size[1]},
+	//{"3DES",	0,	EVP_des_ede3_cbc, cbc3_key,	cbc_iv,	cbc_data,		&des_cbc_size[0],	cbc3_ok,		&des_cbc_size[2]},
+	{"3DES",	1,	EVP_des_ede3_cbc, des_ede_cbc3_key,	  des_ede_cbc3_iv,   des_ede_cbc3_input,   &des_ede_cbc3_data_len[0],	des_ede_cbc3_output, &des_ede_cbc3_data_len[0]},
+	//{"AES-128",	0,	EVP_aes_128_cbc,  aes_128_cbc_key[0], aes_128_cbc_iv[0], aes_128_cbc_input[0], &aes_data_len[0], aes_128_cbc_output[0], &aes_data_len[0]},
+	{"AES-128",	1,	EVP_aes_128_cbc,  aes_128_cbc_key[1], aes_128_cbc_iv[1], aes_128_cbc_input[1], &aes_data_len[0], aes_128_cbc_output[1], &aes_data_len[0]},
+	{"AES-128",	2,	EVP_aes_128_cbc,  aes_128_cbc_key[2], aes_128_cbc_iv[2], aes_128_cbc_input[2], &aes_data_len[0], aes_128_cbc_output[2], &aes_data_len[0]},
+	{"AES-128",	3,	EVP_aes_128_cbc,  aes_128_cbc_key[3], aes_128_cbc_iv[3], aes_128_cbc_input[3], &aes_data_len[0], aes_128_cbc_output[3], &aes_data_len[0]},
+	{"AES-128",	4,	EVP_aes_128_cbc,  aes_128_cbc_key[4], aes_128_cbc_iv[4], aes_128_cbc_input[4], &aes_data_len[0], aes_128_cbc_output[4], &aes_data_len[0]},
+	//{"AES-256",	0,	EVP_aes_256_cbc,  aes_256_cbc_key[0], aes_256_cbc_iv[0], aes_256_cbc_input[0], &aes_data_len[0], aes_256_cbc_output[0], &aes_data_len[0]},
+	{"AES-256",	1,	EVP_aes_256_cbc,  aes_256_cbc_key[1], aes_256_cbc_iv[1], aes_256_cbc_input[1], &aes_data_len[0], aes_256_cbc_output[1], &aes_data_len[0]},
+	{"AES-256",	2,	EVP_aes_256_cbc,  aes_256_cbc_key[2], aes_256_cbc_iv[2], aes_256_cbc_input[2], &aes_data_len[0], aes_256_cbc_output[2], &aes_data_len[0]},
+	{"AES-256",	3,	EVP_aes_256_cbc,  aes_256_cbc_key[3], aes_256_cbc_iv[3], aes_256_cbc_input[3], &aes_data_len[0], aes_256_cbc_output[3], &aes_data_len[0]},
+	{"AES-256",	4,	EVP_aes_256_cbc,  aes_256_cbc_key[4], aes_256_cbc_iv[4], aes_256_cbc_input[4], &aes_data_len[0], aes_256_cbc_output[4], &aes_data_len[0]},
+};
+
+test("Test Symmetric Encryption")
+{
+	iterate (name, test_num, func,key, iv, plain, plain_len, encrypted, encrypted_len) from testlist
+	{
+		output("\ntesting %s set %d ", name, test_num); 
+		verify(plain_len != NULL);
+		verify(encrypted_len != NULL);
+		verify(TestEncrypt(func,key, iv, plain, (unsigned int) (*plain_len), encrypted, (unsigned int) (*encrypted_len)) == 0);
+	}
+}
+
+test("Test Symmetric Decryption")
+{
+	iterate (name, test_num, func,key, iv, plain, plain_len, encrypted, encrypted_len) from testlist
+	{
+		output("\ntesting %s set %d ", name, test_num); 
+		verify(plain_len != NULL);
+		verify(encrypted_len != NULL);
+		verify(TestDecrypt(func,key, iv, plain, (unsigned int) (*plain_len), encrypted, (unsigned int) (*encrypted_len)) == 0);
+	}
+}
+
+
+
diff -Naur openssl-1.0.0q.orig/selftest/digest.h openssl-1.0.0q/selftest/digest.h
--- openssl-1.0.0q.orig/selftest/digest.h	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/digest.h	2017-04-25 16:23:41.383030522 +0200
@@ -0,0 +1,19 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2008 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+**
+*/
+
+
+#ifndef _LIBOPEY_SELFTEST_DIGEST_H_
+#define _LIBOPEY_SELFTEST_DIGEST_H_
+
+#include "modules/util/cleanse.h"
+
+typedef const EVP_MD* (*EVP_MD_CB)();
+
+
+#endif /* _LIBOPEY_SELFTEST_DIGEST_H_ */
diff -Naur openssl-1.0.0q.orig/selftest/digest.ot openssl-1.0.0q/selftest/digest.ot
--- openssl-1.0.0q.orig/selftest/digest.ot	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/digest.ot	2017-04-25 16:23:41.383030522 +0200
@@ -0,0 +1,362 @@
+group "libopeay.digest";
+require _SSL_SUPPORT_;
+language c++;
+
+include "modules/libopeay/openssl/cryptlib.h";
+include "modules/libopeay/openssl/evp.h";
+include "modules/libopeay/openssl/sha.h";
+include "modules/libopeay/openssl/md5.h";
+include "modules/libopeay/selftest/digest.h";
+
+global {
+/* Test vectors from openssl*/
+
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ * 
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ * 
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (eay@cryptsoft.com)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from 
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+
+const static unsigned int sha1_input_sizes[1] = {3};
+const static unsigned char sha1_input[] = {0x61, 0x62, 0x63};
+
+const static unsigned char sha1_output[20] = 
+	{0xa9, 0x99, 0x3e, 0x36, 0x47, 0x06, 0x81, 0x6a,
+	 0xba, 0x3e, 0x25, 0x71, 0x78, 0x50, 0xc2, 0x6c, 
+	 0x9c, 0xd0, 0xd8, 0x9d};
+
+
+const static unsigned int md5_input_sizes[] = {0, 1,3, 14, 26, 62, 80};
+
+const static unsigned char md5_input[][80] = {
+	{0},
+
+	{0x61},
+
+	{0x61, 0x62, 0x63},
+
+	{0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 
+	 0x64, 0x69, 0x67, 0x65, 0x73, 0x74},
+
+	{0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 
+	 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 
+	 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 
+	 0x79, 0x7a},
+
+	{0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 
+	 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
+	 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 
+	 0x59, 0x5a, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
+	 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 
+	 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
+	 0x77, 0x78, 0x79, 0x7a, 0x30, 0x31, 0x32, 0x33, 
+	 0x34, 0x35, 0x36, 0x37, 0x38, 0x39},
+
+	{0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 
+	 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
+	 0x37, 0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 
+	 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x31, 0x32,
+	 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 
+	 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
+	 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 
+	 0x37, 0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34,
+	 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x31, 0x32, 
+	 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30}
+};
+
+const static unsigned char md5_output[][16] = {
+	{0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e},
+	{0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8, 0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61},
+	{0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0, 0xd6, 0x96, 0x3f, 0x7d, 0x28, 0xe1, 0x7f, 0x72},
+	{0xf9, 0x6b, 0x69, 0x7d, 0x7c, 0xb7, 0x93, 0x8d, 0x52, 0x5a, 0x2f, 0x31, 0xaa, 0xf1, 0x61, 0xd0},
+	{0xc3, 0xfc, 0xd3, 0xd7, 0x61, 0x92, 0xe4, 0x00, 0x7d, 0xfb, 0x49, 0x6c, 0xca, 0x67, 0xe1, 0x3b},
+	{0xd1, 0x74, 0xab, 0x98, 0xd2, 0x77, 0xd9, 0xf5, 0xa5, 0x61, 0x1c, 0x2c, 0x9f, 0x41, 0x9d, 0x9f},
+	{0x57, 0xed, 0xf4, 0xa2, 0x2b, 0xe3, 0xc9, 0x55, 0xac, 0x49, 0xda, 0x2e, 0x21, 0x07, 0xb6, 0x7a},
+
+};
+
+
+const static unsigned int sha256_input_sizes[][2] = {{3,3}, {56, 56}, {160, 1000000}};
+
+const static unsigned char *sha256_input[] = 
+{
+	(const unsigned char *) "abc", // app_b1
+	(const unsigned char *) "abcdbcde""cdefdefg""efghfghi""ghijhijk"
+		"ijkljklm""klmnlmno""mnopnopq", // app_b2
+	(const unsigned char *) "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" // app_b3
+};
+
+const static unsigned char sha256_output[][SHA256_DIGEST_LENGTH] = {
+			// app_b1
+{	0xba,0x78,0x16,0xbf,0x8f,0x01,0xcf,0xea,
+	0x41,0x41,0x40,0xde,0x5d,0xae,0x22,0x23,
+	0xb0,0x03,0x61,0xa3,0x96,0x17,0x7a,0x9c,
+	0xb4,0x10,0xff,0x61,0xf2,0x00,0x15,0xad	},
+
+			// app_b2
+{	0x24,0x8d,0x6a,0x61,0xd2,0x06,0x38,0xb8,
+	0xe5,0xc0,0x26,0x93,0x0c,0x3e,0x60,0x39,
+	0xa3,0x3c,0xe4,0x59,0x64,0xff,0x21,0x67,
+	0xf6,0xec,0xed,0xd4,0x19,0xdb,0x06,0xc1	},
+
+			// app_b3
+{	0xcd,0xc7,0x6e,0x5c,0x99,0x14,0xfb,0x92,
+	0x81,0xa1,0xc7,0xe2,0x84,0xd7,0x3e,0x67,
+	0xf1,0x80,0x9a,0x48,0xa4,0x97,0x20,0x0e,
+	0x04,0x6d,0x39,0xcc,0xc7,0x11,0x2c,0xd0	}
+};
+
+const static unsigned int sha224_input_sizes[][2] = {{3,3}, {56, 56}, {64, 1000000}};
+
+const static unsigned char *sha224_input[] = 
+{
+	(const unsigned char *) "abc", // app_b1
+	(const unsigned char *) "abcdbcde""cdefdefg""efghfghi""ghijhijk"
+		"ijkljklm""klmnlmno""mnopnopq", // app_b2
+	(const unsigned char *) "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" // app_b3
+};
+
+const static unsigned char sha224_output[][SHA224_DIGEST_LENGTH] = {
+			// addenum_1
+{	0x23,0x09,0x7d,0x22,0x34,0x05,0xd8,0x22,
+	0x86,0x42,0xa4,0x77,0xbd,0xa2,0x55,0xb3,
+	0x2a,0xad,0xbc,0xe4,0xbd,0xa0,0xb3,0xf7,
+	0xe3,0x6c,0x9d,0xa7 },
+
+			// addenum_2
+{	0x75,0x38,0x8b,0x16,0x51,0x27,0x76,0xcc,
+	0x5d,0xba,0x5d,0xa1,0xfd,0x89,0x01,0x50,
+	0xb0,0xc6,0x45,0x5c,0xb4,0xf5,0x8b,0x19,
+	0x52,0x52,0x25,0x25 },
+
+			// addenum_3
+{	0x20,0x79,0x46,0x55,0x98,0x0c,0x91,0xd8,
+	0xbb,0xb4,0xc1,0xea,0x97,0x61,0x8a,0x4b,
+	0xf0,0x3f,0x42,0x58,0x19,0x48,0xb2,0xee,
+	0x4e,0xe7,0xad,0x67 }
+};
+
+
+
+const static unsigned int sha512_input_sizes[][2] = {{3,3}, {112, 112}, {288, 1000000}};
+const static unsigned char *sha512_input[] = 
+{
+	(const unsigned char *) "abc", // app_c1
+	(const unsigned char *) "abcdefgh""bcdefghi""cdefghij""defghijk"
+		"efghijkl""fghijklm""ghijklmn""hijklmno"
+		"ijklmnop""jklmnopq""klmnopqr""lmnopqrs"
+		"mnopqrst""nopqrstu", // app_c2
+	(const unsigned char *) "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" // app_c3
+};
+
+const static unsigned char sha512_output[][SHA512_DIGEST_LENGTH] = {
+		// app_c1
+{	0xdd,0xaf,0x35,0xa1,0x93,0x61,0x7a,0xba,
+	0xcc,0x41,0x73,0x49,0xae,0x20,0x41,0x31,
+	0x12,0xe6,0xfa,0x4e,0x89,0xa9,0x7e,0xa2,
+	0x0a,0x9e,0xee,0xe6,0x4b,0x55,0xd3,0x9a,
+	0x21,0x92,0x99,0x2a,0x27,0x4f,0xc1,0xa8,
+	0x36,0xba,0x3c,0x23,0xa3,0xfe,0xeb,0xbd,
+	0x45,0x4d,0x44,0x23,0x64,0x3c,0xe8,0x0e,
+	0x2a,0x9a,0xc9,0x4f,0xa5,0x4c,0xa4,0x9f },
+		// app_c2
+{	0x8e,0x95,0x9b,0x75,0xda,0xe3,0x13,0xda,
+	0x8c,0xf4,0xf7,0x28,0x14,0xfc,0x14,0x3f,
+	0x8f,0x77,0x79,0xc6,0xeb,0x9f,0x7f,0xa1,
+	0x72,0x99,0xae,0xad,0xb6,0x88,0x90,0x18,
+	0x50,0x1d,0x28,0x9e,0x49,0x00,0xf7,0xe4,
+	0x33,0x1b,0x99,0xde,0xc4,0xb5,0x43,0x3a,
+	0xc7,0xd3,0x29,0xee,0xb6,0xdd,0x26,0x54,
+	0x5e,0x96,0xe5,0x5b,0x87,0x4b,0xe9,0x09 },
+
+		// app_c3
+{	0xe7,0x18,0x48,0x3d,0x0c,0xe7,0x69,0x64,
+	0x4e,0x2e,0x42,0xc7,0xbc,0x15,0xb4,0x63,
+	0x8e,0x1f,0x98,0xb1,0x3b,0x20,0x44,0x28,
+	0x56,0x32,0xa8,0x03,0xaf,0xa9,0x73,0xeb,
+	0xde,0x0f,0xf2,0x44,0x87,0x7e,0xa6,0x0a,
+	0x4c,0xb0,0x43,0x2c,0xe5,0x77,0xc3,0x1b,
+	0xeb,0x00,0x9c,0x5c,0x2c,0x49,0xaa,0x2e,
+	0x4e,0xad,0xb2,0x17,0xad,0x8c,0xc0,0x9b }
+};
+
+const static unsigned int sha384_input_sizes[][2] = {{3,3}, {112, 112}, {64, 1000000}};
+
+const static unsigned char *sha384_input[] = 
+{
+	(const unsigned char *) "abc", // app_d1
+	(const unsigned char *) "abcdefgh""bcdefghi""cdefghij""defghijk"
+		"efghijkl""fghijklm""ghijklmn""hijklmno"
+		"ijklmnop""jklmnopq""klmnopqr""lmnopqrs"
+		"mnopqrst""nopqrstu", // app_d2
+	(const unsigned char *) "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa"
+				"aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa", // app_d3
+};
+
+const static unsigned char sha384_output[][SHA384_DIGEST_LENGTH] = {
+		// app_d1 
+{	0xcb,0x00,0x75,0x3f,0x45,0xa3,0x5e,0x8b,
+	0xb5,0xa0,0x3d,0x69,0x9a,0xc6,0x50,0x07,
+	0x27,0x2c,0x32,0xab,0x0e,0xde,0xd1,0x63,
+	0x1a,0x8b,0x60,0x5a,0x43,0xff,0x5b,0xed,
+	0x80,0x86,0x07,0x2b,0xa1,0xe7,0xcc,0x23,
+	0x58,0xba,0xec,0xa1,0x34,0xc8,0x25,0xa7 },
+
+		// app_d2
+{	0x09,0x33,0x0c,0x33,0xf7,0x11,0x47,0xe8,
+	0x3d,0x19,0x2f,0xc7,0x82,0xcd,0x1b,0x47,
+	0x53,0x11,0x1b,0x17,0x3b,0x3b,0x05,0xd2,
+	0x2f,0xa0,0x80,0x86,0xe3,0xb0,0xf7,0x12,
+	0xfc,0xc7,0xc7,0x1a,0x55,0x7e,0x2d,0xb9,
+	0x66,0xc3,0xe9,0xfa,0x91,0x74,0x60,0x39 },
+
+		// app_d3
+{	0x9d,0x0e,0x18,0x09,0x71,0x64,0x74,0xcb,
+	0x08,0x6e,0x83,0x4e,0x31,0x0a,0x4a,0x1c,
+	0xed,0x14,0x9e,0x9c,0x00,0xf2,0x48,0x52,
+	0x79,0x72,0xce,0xc5,0x70,0x4c,0x2a,0x5b,
+	0x07,0xb8,0xb3,0xdc,0x38,0xec,0xc4,0xeb,
+	0xae,0x97,0xdd,0xd8,0x7f,0x3d,0x89,0x85 }
+
+};
+
+int TestDigest(EVP_MD_CB func, 
+			const unsigned char *plain, unsigned int plain_len,  unsigned int plain_repeat_until,
+			const unsigned char *digest, unsigned int digest_len)
+{
+	EVP_MD_CTX ctx;
+	const EVP_MD *digester;
+	unsigned char output_data[512]; // ARRAY OK 2009-05-25 yngve 
+	unsigned int count=0;
+	unsigned int data_count;
+
+	EVP_MD_CTX_init(&ctx);
+
+	digester= func();
+	if(digester == NULL)
+	  return -2;
+
+	if(sizeof(output_data) < digest_len)
+		return -3;
+
+	if(sizeof(output_data) <= (size_t) EVP_MD_size(digester))
+		return -4;
+
+	EVP_DigestInit(&ctx, digester);
+	OPERA_cleanse(output_data, sizeof(output_data));
+
+	
+	for(data_count = 0; data_count< plain_repeat_until;data_count += plain_len)
+	{
+		EVP_DigestUpdate(&ctx, plain, (data_count + plain_len < plain_repeat_until ? plain_len: plain_repeat_until- data_count));
+	}
+	EVP_DigestFinal(&ctx, output_data, &count);
+
+	EVP_MD_CTX_cleanup(&ctx);
+
+	return (count == digest_len ? op_memcmp(output_data, digest, count) : -1);
+}
+
+
+}
+
+table testlist(const char *, int ,	EVP_MD_CB,
+			const unsigned char *, const unsigned int *, const unsigned int *,
+			const unsigned char *, unsigned int) {
+	{"SHA1",	0,	EVP_sha1,	sha1_input,		&sha1_input_sizes[0],	NULL,			sha1_output,	sizeof(sha1_output)},
+	{"MD5",		0,	EVP_md5,	md5_input[0],	&md5_input_sizes[0],	NULL,			md5_output[0],	sizeof(md5_output[0])},
+	{"MD5",		1,	EVP_md5,	md5_input[1],	&md5_input_sizes[1],	NULL,			md5_output[1],	sizeof(md5_output[0])},
+	{"MD5",		2,	EVP_md5,	md5_input[2],	&md5_input_sizes[2],	NULL,			md5_output[2],	sizeof(md5_output[0])},
+	{"MD5",		3,	EVP_md5,	md5_input[3],	&md5_input_sizes[3],	NULL,			md5_output[3],	sizeof(md5_output[0])},
+	{"MD5",		4,	EVP_md5,	md5_input[4],	&md5_input_sizes[4],	NULL,			md5_output[4],	sizeof(md5_output[0])},
+	{"MD5",		5,	EVP_md5,	md5_input[5],	&md5_input_sizes[5],	NULL,			md5_output[5],	sizeof(md5_output[0])},
+	{"MD5",		6,	EVP_md5,	md5_input[6],	&md5_input_sizes[6],	NULL,			md5_output[6],	sizeof(md5_output[0])},
+	{"SHA256",	0,	EVP_sha256,	sha256_input[0],	&sha256_input_sizes[0][0],	&sha256_input_sizes[0][1],	sha256_output[0],	sizeof(sha256_output[0])},
+	{"SHA256",	1,	EVP_sha256,	sha256_input[1],	&sha256_input_sizes[1][0],	&sha256_input_sizes[1][1],	sha256_output[1],	sizeof(sha256_output[1])},
+	{"SHA256",	2,	EVP_sha256,	sha256_input[2],	&sha256_input_sizes[2][0],	&sha256_input_sizes[2][1],	sha256_output[2],	sizeof(sha256_output[2])},
+	{"SHA224",	0,	EVP_sha224,	sha224_input[0],	&sha224_input_sizes[0][0],	&sha224_input_sizes[0][1],	sha224_output[0],	sizeof(sha224_output[0])},
+	{"SHA224",	1,	EVP_sha224,	sha224_input[1],	&sha224_input_sizes[1][0],	&sha224_input_sizes[1][1],	sha224_output[1],	sizeof(sha224_output[1])},
+	{"SHA224",	2,	EVP_sha224,	sha224_input[2],	&sha224_input_sizes[2][0],	&sha224_input_sizes[2][1],	sha224_output[2],	sizeof(sha224_output[2])},
+	{"SHA512",	0,	EVP_sha512,	sha512_input[0],	&sha512_input_sizes[0][0],	&sha512_input_sizes[0][1],	sha512_output[0],	sizeof(sha512_output[0])},
+	{"SHA512",	1,	EVP_sha512,	sha512_input[1],	&sha512_input_sizes[1][0],	&sha512_input_sizes[1][1],	sha512_output[1],	sizeof(sha512_output[1])},
+	{"SHA512",	2,	EVP_sha512,	sha512_input[2],	&sha512_input_sizes[2][0],	&sha512_input_sizes[2][1],	sha512_output[2],	sizeof(sha512_output[2])},
+	{"SHA384",	0,	EVP_sha384,	sha384_input[0],	&sha384_input_sizes[0][0],	&sha384_input_sizes[0][1],	sha384_output[0],	sizeof(sha384_output[0])},
+	{"SHA384",	1,	EVP_sha384,	sha384_input[1],	&sha384_input_sizes[1][0],	&sha384_input_sizes[1][1],	sha384_output[1],	sizeof(sha384_output[1])},
+	{"SHA384",	2,	EVP_sha384,	sha384_input[2],	&sha384_input_sizes[2][0],	&sha384_input_sizes[2][1],	sha384_output[2],	sizeof(sha384_output[2])},
+};
+
+test("Test Digest")
+{
+	iterate (name, test_num, func,plain, plain_len, plain_repeat_until, digest, digest_len) from testlist
+	{
+		output("\ntesting %s set %d ", name, test_num); 
+		verify(plain_len != NULL);
+		verify(TestDigest(func, plain, *plain_len, (plain_repeat_until ? *plain_repeat_until : *plain_len) , digest, digest_len) == 0);
+	}
+}
+
diff -Naur openssl-1.0.0q.orig/selftest/evp_test.ot openssl-1.0.0q/selftest/evp_test.ot
--- openssl-1.0.0q.orig/selftest/evp_test.ot	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/evp_test.ot	2017-04-25 16:23:41.384031207 +0200
@@ -0,0 +1,421 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 2011-2011 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+/**
+ * @file evp_test.ot
+ *
+ * Tests from OpenSSL's crypto/evp/evp_test.c.
+ *
+ * @author Alexei Khlebnikov <alexeik@opera.com>
+ *
+ */
+
+group "libopeay.evp_test";
+require _SSL_SUPPORT_;
+language c++;
+
+include "modules/libopeay/openssl/cryptlib.h";
+include "modules/libopeay/openssl/evp.h";
+include "modules/util/opfile/opfile.h";
+
+global
+{
+
+/* Written by Ben Laurie, 2001 */
+/*
+ * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ *    software must display the following acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For written permission, please contact
+ *    openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ *    nor may "OpenSSL" appear in their names without prior written
+ *    permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+static void hexdump(const char *title,const unsigned char *s,int l)
+    {
+    int n=0;
+
+    output("%s",title);
+    for( ; n < l ; ++n)
+	{
+	if((n%16) == 0)
+	    output("\n%04x",n);
+	output(" %02x",s[n]);
+	}
+    output("\n");
+    }
+
+static int convert(unsigned char *s)
+    {
+    unsigned char *d;
+
+    for(d=s ; *s ; s+=2,++d)
+	{
+	unsigned int n;
+
+	if(!s[1])
+	    {
+	    output("Odd number of hex digits!");
+	    return 0;
+	    }
+	op_sscanf((char *)s,"%2x",&n);
+	*d=(unsigned char)n;
+	}
+    return s-d;
+    }
+
+static char *sstrsep(char **string, const char *delim)
+    {
+    char isdelim[256]; /* ARRAY OK 2011-12-14 alexeik */
+    char *token = *string;
+
+    if (**string == 0)
+        return NULL;
+
+    op_memset(isdelim, 0, 256);
+    isdelim[0] = 1;
+
+    while (*delim)
+        {
+        isdelim[(unsigned char)(*delim)] = 1;
+        delim++;
+        }
+
+    while ((**string) && !isdelim[(unsigned char)(**string)])
+        {
+        (*string)++;
+        }
+
+    if (**string)
+        {
+        **string = 0;
+        (*string)++;
+        }
+
+    return token;
+    }
+
+static unsigned char *ustrsep(char **p,const char *sep)
+    { return (unsigned char *)sstrsep(p,sep); }
+
+static int test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
+		  const unsigned char *iv,int in,
+		  const unsigned char *plaintext,int pn,
+		  const unsigned char *ciphertext,int cn,
+		  int encdec)
+    {
+    EVP_CIPHER_CTX ctx;
+    unsigned char out[4096]; /* ARRAY OK 2011-12-14 alexeik */
+    int outl,outl2;
+
+    if ((size_t)pn + EVP_MAX_BLOCK_LENGTH - 1 >= sizeof(out))
+        return 0;
+
+    output("Testing cipher %s%s\n",EVP_CIPHER_name(c),
+	   (encdec == 1 ? "(encrypt)" : (encdec == 0 ? "(decrypt)" : "(encrypt/decrypt)")));
+    hexdump("Key",key,kn);
+    if(in)
+	hexdump("IV",iv,in);
+    hexdump("Plaintext",plaintext,pn);
+    hexdump("Ciphertext",ciphertext,cn);
+    
+    if(kn != c->key_len)
+	{
+	output("Key length doesn't match, got %d expected %lu\n",kn,
+		(unsigned long)c->key_len);
+	return 0;
+	}
+    EVP_CIPHER_CTX_init(&ctx);
+    if (encdec != 0)
+        {
+	if(!EVP_EncryptInit_ex(&ctx,c,NULL,key,iv))
+	    {
+	    output("EncryptInit failed\n");
+	    return 0;
+	    }
+	EVP_CIPHER_CTX_set_padding(&ctx,0);
+
+	if(!EVP_EncryptUpdate(&ctx,out,&outl,plaintext,pn))
+	    {
+	    output("Encrypt failed\n");
+	    return 0;
+	    }
+	if(!EVP_EncryptFinal_ex(&ctx,out+outl,&outl2))
+	    {
+	    output("EncryptFinal failed\n");
+	    return 0;
+	    }
+
+	if(outl+outl2 != cn)
+	    {
+	    output("Ciphertext length mismatch got %d expected %d\n",
+		    outl+outl2,cn);
+	    return 0;
+	    }
+
+	if(op_memcmp(out,ciphertext,cn))
+	    {
+	    output("Ciphertext mismatch\n");
+	    hexdump("Got",out,cn);
+	    hexdump("Expected",ciphertext,cn);
+	    return 0;
+	    }
+	}
+
+    if (encdec <= 0)
+        {
+	if(!EVP_DecryptInit_ex(&ctx,c,NULL,key,iv))
+	    {
+	    output("DecryptInit failed\n");
+	    return 0;
+	    }
+	EVP_CIPHER_CTX_set_padding(&ctx,0);
+
+	if(!EVP_DecryptUpdate(&ctx,out,&outl,ciphertext,cn))
+	    {
+	    output("Decrypt failed\n");
+	    return 0;
+	    }
+	if(!EVP_DecryptFinal_ex(&ctx,out+outl,&outl2))
+	    {
+	    output("DecryptFinal failed\n");
+	    return 0;
+	    }
+
+	if(outl+outl2 != pn)
+	    {
+	    output("Plaintext length mismatch got %d expected %d\n",
+		    outl+outl2,pn);
+	    return 0;
+	    }
+
+	if(op_memcmp(out,plaintext,pn))
+	    {
+	    output("Plaintext mismatch\n");
+	    hexdump("Got",out,pn);
+	    hexdump("Expected",plaintext,pn);
+	    return 0;
+	    }
+	}
+
+    EVP_CIPHER_CTX_cleanup(&ctx);
+
+    output("\n");
+    
+    return 1;
+    }
+
+static int test_cipher(const char *cipher,const unsigned char *key,int kn,
+		       const unsigned char *iv,int in,
+		       const unsigned char *plaintext,int pn,
+		       const unsigned char *ciphertext,int cn,
+		       int encdec)
+    {
+    const EVP_CIPHER *c;
+
+    c=EVP_get_cipherbyname(cipher);
+    if(!c)
+	return 1; // If cipher is not found - skip it.
+
+    return test1(c,key,kn,iv,in,plaintext,pn,ciphertext,cn,encdec);
+    }
+
+static int test_digest(const char *digest,
+		       const unsigned char *plaintext,int pn,
+		       const unsigned char *ciphertext, unsigned int cn)
+    {
+    const EVP_MD *d;
+    EVP_MD_CTX ctx;
+    unsigned char md[EVP_MAX_MD_SIZE]; /* ARRAY OK 2011-12-14 alexeik */
+    unsigned int mdn;
+
+    d=EVP_get_digestbyname(digest);
+    if(!d)
+	return 0;
+
+    output("Testing digest %s\n",EVP_MD_name(d));
+    hexdump("Plaintext",plaintext,pn);
+    hexdump("Digest",ciphertext,cn);
+
+    EVP_MD_CTX_init(&ctx);
+    if(!EVP_DigestInit_ex(&ctx,d, NULL))
+	{
+	output("DigestInit failed\n");
+	return 0;
+	}
+    if(!EVP_DigestUpdate(&ctx,plaintext,pn))
+	{
+	output("DigestUpdate failed\n");
+	return 0;
+	}
+    if(!EVP_DigestFinal_ex(&ctx,md,&mdn))
+	{
+	output("DigestFinal failed\n");
+	return 0;
+	}
+    EVP_MD_CTX_cleanup(&ctx);
+
+    if(mdn != cn)
+	{
+	output("Digest length mismatch, got %d expected %d\n",mdn,cn);
+	return 0;
+	}
+
+    if(op_memcmp(md,ciphertext,cn))
+	{
+	output("Digest mismatch\n");
+	hexdump("Got",md,cn);
+	hexdump("Expected",ciphertext,cn);
+	return 0;
+	}
+
+    output("\n");
+
+    EVP_MD_CTX_cleanup(&ctx);
+
+    return 1;
+    }
+
+} // global
+
+
+test("Modified evp_test.c from OpenSSL")
+	file evptests_txt "evptests.txt";
+{
+	BOOL test_result = true;
+
+	do
+	{
+		OpString filename;
+		OP_STATUS status = filename.SetFromUTF8(evptests_txt);
+		if (OpStatus::IsError(status))
+		{
+			test_result = false;
+			break;
+		}
+
+		OpFile test_file;
+		status = test_file.Construct(filename, OPFILE_ABSOLUTE_FOLDER);
+		if (OpStatus::IsError(status))
+		{
+			test_result = false;
+			break;
+		}
+
+		status = test_file.Open(OPFILE_READ);
+		if (OpStatus::IsError(status))
+		{
+			test_result = false;
+			break;
+		}
+
+		output("\n"); 
+
+		OpString8 line_str8;
+
+		while (!test_file.Eof())
+		{
+			char line[4096]; /* ARRAY OK 2011-12-14 alexeik */
+			char *p;
+			char *cipher;
+			unsigned char *iv,*key,*plaintext,*ciphertext;
+			int encdec;
+			int kn,in,pn,cn;
+
+			status = test_file.ReadLine(line_str8);
+			if (OpStatus::IsError(status))
+			{
+				test_result = false;
+				break;
+			}
+
+			status = line_str8.Append("\n");
+			if (OpStatus::IsError(status))
+			{
+				test_result = false;
+				break;
+			}
+
+			op_strncpy(line, line_str8.CStr(), sizeof(line) - 1);
+			line[sizeof(line) - 1] = '\0';
+
+			if(line[0] == '#' || line[0] == '\n')
+			    continue;
+
+			p=line;
+			cipher=sstrsep(&p,":");
+			key=ustrsep(&p,":");
+			iv=ustrsep(&p,":");
+			plaintext=ustrsep(&p,":");
+			ciphertext=ustrsep(&p,":");
+			if (p[-1] == '\n') {
+			    p[-1] = '\0';
+			    encdec = -1;
+			} else {
+			    encdec = op_atoi(sstrsep(&p,"\n"));
+			}
+
+			kn=convert(key);
+			in=convert(iv);
+			pn=convert(plaintext);
+			cn=convert(ciphertext);
+
+			int cipher_ok = test_cipher(cipher,key,kn,iv,in,plaintext,pn,ciphertext,cn,encdec);
+			int digest_ok = test_digest(cipher,plaintext,pn,ciphertext,cn);
+
+			if(!cipher_ok && !digest_ok)
+			{
+				output("Problem with: %s\n",cipher);
+				test_result = false;
+				break;
+			}
+		} // while (!test_file.Eof())
+	}
+	while (false);
+
+    verify(test_result);
+}
diff -Naur openssl-1.0.0q.orig/selftest/evptests.txt openssl-1.0.0q/selftest/evptests.txt
--- openssl-1.0.0q.orig/selftest/evptests.txt	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/evptests.txt	2017-04-25 16:23:41.385030776 +0200
@@ -0,0 +1,321 @@
+#cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt)
+#digest:::input:output
+
+# SHA(1) tests (from shatest.c)
+SHA1:::616263:a9993e364706816aba3e25717850c26c9cd0d89d
+
+# MD5 tests (from md5test.c)
+MD5::::d41d8cd98f00b204e9800998ecf8427e
+MD5:::61:0cc175b9c0f1b6a831c399e269772661
+MD5:::616263:900150983cd24fb0d6963f7d28e17f72
+MD5:::6d65737361676520646967657374:f96b697d7cb7938d525a2f31aaf161d0
+MD5:::6162636465666768696a6b6c6d6e6f707172737475767778797a:c3fcd3d76192e4007dfb496cca67e13b
+MD5:::4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a30313233343536373839:d174ab98d277d9f5a5611c2c9f419d9f
+MD5:::3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930:57edf4a22be3c955ac49da2e2107b67a
+
+# AES 128 ECB tests (from FIPS-197 test vectors, encrypt)
+
+AES-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:69C4E0D86A7B0430D8CDB78070B4C55A:1
+
+# AES 192 ECB tests (from FIPS-197 test vectors, encrypt)
+
+AES-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:DDA97CA4864CDFE06EAF70A0EC0D7191:1
+
+# AES 256 ECB tests (from FIPS-197 test vectors, encrypt)
+
+AES-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:8EA2B7CA516745BFEAFC49904B496089:1
+
+# AES 128 ECB tests (from NIST test vectors, encrypt)
+
+#AES-128-ECB:00000000000000000000000000000000::00000000000000000000000000000000:C34C052CC0DA8D73451AFE5F03BE297F:1
+
+# AES 128 ECB tests (from NIST test vectors, decrypt)
+
+#AES-128-ECB:00000000000000000000000000000000::44416AC2D1F53C583303917E6BE9EBE0:00000000000000000000000000000000:0
+
+# AES 192 ECB tests (from NIST test vectors, decrypt)
+
+#AES-192-ECB:000000000000000000000000000000000000000000000000::48E31E9E256718F29229319C19F15BA4:00000000000000000000000000000000:0
+
+# AES 256 ECB tests (from NIST test vectors, decrypt)
+
+#AES-256-ECB:0000000000000000000000000000000000000000000000000000000000000000::058CCFFDBBCB382D1F6F56585D8A4ADE:00000000000000000000000000000000:0
+
+# AES 128 CBC tests (from NIST test vectors, encrypt)
+
+#AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:8A05FC5E095AF4848A08D328D3688E3D:1
+
+# AES 192 CBC tests (from NIST test vectors, encrypt)
+
+#AES-192-CBC:000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:7BD966D53AD8C1BB85D2ADFAE87BB104:1
+
+# AES 256 CBC tests (from NIST test vectors, encrypt)
+
+#AES-256-CBC:0000000000000000000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:FE3C53653E2F45B56FCD88B2CC898FF0:1
+
+# AES 128 CBC tests (from NIST test vectors, decrypt)
+
+#AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:FACA37E0B0C85373DF706E73F7C9AF86:00000000000000000000000000000000:0
+
+# AES tests from NIST document SP800-38A
+# For all ECB encrypts and decrypts, the transformed sequence is
+#   AES-bits-ECB:key::plaintext:ciphertext:encdec
+# ECB-AES128.Encrypt and ECB-AES128.Decrypt
+AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:3AD77BB40D7A3660A89ECAF32466EF97
+AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:F5D3D58503B9699DE785895A96FDBAAF
+AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:43B1CD7F598ECE23881B00E3ED030688
+AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:7B0C785E27E8AD3F8223207104725DD4
+# ECB-AES192.Encrypt and ECB-AES192.Decrypt 
+AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:BD334F1D6E45F25FF712A214571FA5CC
+AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:974104846D0AD3AD7734ECB3ECEE4EEF
+AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:EF7AFD2270E2E60ADCE0BA2FACE6444E
+AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:9A4B41BA738D6C72FB16691603C18E0E
+# ECB-AES256.Encrypt and ECB-AES256.Decrypt 
+AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:F3EED1BDB5D2A03C064B5A7E3DB181F8
+AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:591CCB10D410ED26DC5BA74A31362870
+AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:B6ED21B99CA6F4F9F153E7B1BEAFED1D
+AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:23304B7A39F9F3FF067D8D8F9E24ECC7
+# For all CBC encrypts and decrypts, the transformed sequence is
+#   AES-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec
+# CBC-AES128.Encrypt and CBC-AES128.Decrypt 
+AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:7649ABAC8119B246CEE98E9B12E9197D
+AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:7649ABAC8119B246CEE98E9B12E9197D:AE2D8A571E03AC9C9EB76FAC45AF8E51:5086CB9B507219EE95DB113A917678B2
+AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:5086CB9B507219EE95DB113A917678B2:30C81C46A35CE411E5FBC1191A0A52EF:73BED6B8E3C1743B7116E69E22229516
+AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:73BED6B8E3C1743B7116E69E22229516:F69F2445DF4F9B17AD2B417BE66C3710:3FF1CAA1681FAC09120ECA307586E1A7
+# CBC-AES192.Encrypt and CBC-AES192.Decrypt 
+AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:4F021DB243BC633D7178183A9FA071E8
+AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:4F021DB243BC633D7178183A9FA071E8:AE2D8A571E03AC9C9EB76FAC45AF8E51:B4D9ADA9AD7DEDF4E5E738763F69145A
+AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:B4D9ADA9AD7DEDF4E5E738763F69145A:30C81C46A35CE411E5FBC1191A0A52EF:571B242012FB7AE07FA9BAAC3DF102E0
+AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:571B242012FB7AE07FA9BAAC3DF102E0:F69F2445DF4F9B17AD2B417BE66C3710:08B0E27988598881D920A9E64F5615CD
+# CBC-AES256.Encrypt and CBC-AES256.Decrypt 
+AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:F58C4C04D6E5F1BA779EABFB5F7BFBD6
+AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:F58C4C04D6E5F1BA779EABFB5F7BFBD6:AE2D8A571E03AC9C9EB76FAC45AF8E51:9CFC4E967EDB808D679F777BC6702C7D
+AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:9CFC4E967EDB808D679F777BC6702C7D:30C81C46A35CE411E5FBC1191A0A52EF:39F23369A9D9BACFA530E26304231461
+AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39F23369A9D9BACFA530E26304231461:F69F2445DF4F9B17AD2B417BE66C3710:B2EB05E2C39BE9FCDA6C19078C6A9D1B
+# We don't support CFB{1,8}-AESxxx.{En,De}crypt
+# For all CFB128 encrypts and decrypts, the transformed sequence is
+#   AES-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec
+# CFB128-AES128.Encrypt 
+AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1
+AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:1
+AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:1
+AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:1
+# CFB128-AES128.Decrypt 
+AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0
+AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:0
+AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:0
+AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:0
+# CFB128-AES192.Encrypt
+AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1
+AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:1
+AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:1
+AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:1
+# CFB128-AES192.Decrypt
+AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0
+AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:0
+AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:0
+AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:0
+# CFB128-AES256.Encrypt 
+AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1
+AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:1
+AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:1
+AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:1
+# CFB128-AES256.Decrypt 
+AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0
+AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:0
+AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:0
+AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:0
+# For all OFB encrypts and decrypts, the transformed sequence is
+#   AES-bits-CFB:key:IV/output':plaintext:ciphertext:encdec
+# OFB-AES128.Encrypt 
+AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 
+AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1 
+AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1 
+AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1 
+# OFB-AES128.Decrypt 
+AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0
+AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:0
+AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:0
+AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:0
+# OFB-AES192.Encrypt 
+AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 
+AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1 
+AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1 
+AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1 
+# OFB-AES192.Decrypt 
+AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 
+AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0 
+AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0 
+AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0 
+# OFB-AES256.Encrypt 
+AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1
+AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:1
+AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:1
+AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:1
+# OFB-AES256.Decrypt 
+AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0
+AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:0
+AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0
+AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0
+
+# DES ECB tests (from destest)
+
+DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7
+DES-ECB:FFFFFFFFFFFFFFFF::FFFFFFFFFFFFFFFF:7359B2163E4EDC58
+DES-ECB:3000000000000000::1000000000000001:958E6E627A05557B
+DES-ECB:1111111111111111::1111111111111111:F40379AB9E0EC533
+DES-ECB:0123456789ABCDEF::1111111111111111:17668DFC7292532D
+DES-ECB:1111111111111111::0123456789ABCDEF:8A5AE1F81AB8F2DD
+DES-ECB:FEDCBA9876543210::0123456789ABCDEF:ED39D950FA74BCC4
+
+# DESX-CBC tests (from destest)
+DESX-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:846B2914851E9A2954732F8AA0A611C115CDC2D7951B1053A63C5E03B21AA3C4
+
+# DES EDE3 CBC tests (from destest)
+DES-EDE3-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:3FE301C962AC01D02213763C1CBD4CDC799657C064ECF5D41C673812CFDE9675
+
+# RC4 tests (from rc4test)
+RC4:0123456789abcdef0123456789abcdef::0123456789abcdef:75b7878099e0c596
+RC4:0123456789abcdef0123456789abcdef::0000000000000000:7494c2e7104b0879
+RC4:00000000000000000000000000000000::0000000000000000:de188941a3375d3a
+RC4:ef012345ef012345ef012345ef012345::0000000000000000000000000000000000000000:d6a141a7ec3c38dfbd615a1162e1c7ba36b67858
+RC4:0123456789abcdef0123456789abcdef::123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345678:66a0949f8af7d6891f7f832ba833c00c892ebe30143ce28740011ecf
+RC4:ef012345ef012345ef012345ef012345::00000000000000000000:d6a141a7ec3c38dfbd61
+
+
+# Camellia tests from RFC3713
+# For all ECB encrypts and decrypts, the transformed sequence is
+#   CAMELLIA-bits-ECB:key::plaintext:ciphertext:encdec
+CAMELLIA-128-ECB:0123456789abcdeffedcba9876543210::0123456789abcdeffedcba9876543210:67673138549669730857065648eabe43
+CAMELLIA-192-ECB:0123456789abcdeffedcba98765432100011223344556677::0123456789abcdeffedcba9876543210:b4993401b3e996f84ee5cee7d79b09b9
+CAMELLIA-256-ECB:0123456789abcdeffedcba987654321000112233445566778899aabbccddeeff::0123456789abcdeffedcba9876543210:9acc237dff16d76c20ef7c919e3a7509
+
+# ECB-CAMELLIA128.Encrypt
+CAMELLIA-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:77CF412067AF8270613529149919546F:1
+CAMELLIA-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:B22F3C36B72D31329EEE8ADDC2906C68:1
+CAMELLIA-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:2EDF1F3418D53B88841FC8985FB1ECF2:1
+
+# ECB-CAMELLIA128.Encrypt and ECB-CAMELLIA128.Decrypt 
+CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:432FC5DCD628115B7C388D770B270C96
+CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:0BE1F14023782A22E8384C5ABB7FAB2B
+CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:A0A1ABCD1893AB6FE0FE5B65DF5F8636
+CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:E61925E0D5DFAA9BB29F815B3076E51A
+
+# ECB-CAMELLIA192.Encrypt and ECB-CAMELLIA192.Decrypt 
+CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:CCCC6C4E138B45848514D48D0D3439D3
+CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:5713C62C14B2EC0F8393B6AFD6F5785A
+CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:B40ED2B60EB54D09D030CF511FEEF366
+CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:909DBD95799096748CB27357E73E1D26
+
+# ECB-CAMELLIA256.Encrypt and ECB-CAMELLIA256.Decrypt 
+CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:BEFD219B112FA00098919CD101C9CCFA
+CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:C91D3A8F1AEA08A9386CF4B66C0169EA
+CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:A623D711DC5F25A51BB8A80D56397D28
+CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:7960109FB6DC42947FCFE59EA3C5EB6B
+
+# For all CBC encrypts and decrypts, the transformed sequence is
+#   CAMELLIA-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec
+# CBC-CAMELLIA128.Encrypt and CBC-CAMELLIA128.Decrypt 
+CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:1607CF494B36BBF00DAEB0B503C831AB
+CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:1607CF494B36BBF00DAEB0B503C831AB:AE2D8A571E03AC9C9EB76FAC45AF8E51:A2F2CF671629EF7840C5A5DFB5074887
+CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:A2F2CF671629EF7840C5A5DFB5074887:30C81C46A35CE411E5FBC1191A0A52EF:0F06165008CF8B8B5A63586362543E54
+CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:36A84CDAFD5F9A85ADA0F0A993D6D577:F69F2445DF4F9B17AD2B417BE66C3710:74C64268CDB8B8FAF5B34E8AF3732980
+
+# CBC-CAMELLIA192.Encrypt and CBC-CAMELLIA192.Decrypt 
+CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:2A4830AB5AC4A1A2405955FD2195CF93
+CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2A4830AB5AC4A1A2405955FD2195CF93:AE2D8A571E03AC9C9EB76FAC45AF8E51:5D5A869BD14CE54264F892A6DD2EC3D5
+CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:5D5A869BD14CE54264F892A6DD2EC3D5:30C81C46A35CE411E5FBC1191A0A52EF:37D359C3349836D884E310ADDF68C449
+CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:37D359C3349836D884E310ADDF68C449:F69F2445DF4F9B17AD2B417BE66C3710:01FAAA930B4AB9916E9668E1428C6B08
+
+# CBC-CAMELLIA256.Encrypt and CBC-CAMELLIA256.Decrypt 
+CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:E6CFA35FC02B134A4D2C0B6737AC3EDA
+CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E6CFA35FC02B134A4D2C0B6737AC3EDA:AE2D8A571E03AC9C9EB76FAC45AF8E51:36CBEB73BD504B4070B1B7DE2B21EB50
+CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:36CBEB73BD504B4070B1B7DE2B21EB50:30C81C46A35CE411E5FBC1191A0A52EF:E31A6055297D96CA3330CDF1B1860A83
+CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E31A6055297D96CA3330CDF1B1860A83:F69F2445DF4F9B17AD2B417BE66C3710:5D563F6D1CCCF236051C0C5C1C58F28F
+
+# We don't support CFB{1,8}-CAMELLIAxxx.{En,De}crypt
+# For all CFB128 encrypts and decrypts, the transformed sequence is
+#   CAMELLIA-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec
+# CFB128-CAMELLIA128.Encrypt 
+CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1
+CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:1
+CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:1
+CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:1
+
+# CFB128-CAMELLIA128.Decrypt 
+CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0
+CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:0
+CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:0
+CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:0
+
+# CFB128-CAMELLIA192.Encrypt
+CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1
+CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:C832BB9780677DAA82D9B6860DCD565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:86F8491627906D780C7A6D46EA331F98:1
+CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:1
+CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:1
+
+# CFB128-CAMELLIA192.Decrypt
+CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0
+CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:C832BB9780677DAA82D9B6860DCD565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:86F8491627906D780C7A6D46EA331F98:0
+CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:0
+CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:0
+
+# CFB128-CAMELLIA256.Encrypt 
+CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1
+CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:1
+CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:1
+CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:1
+
+# CFB128-CAMELLIA256.Decrypt 
+CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0
+CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:0
+CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:0
+CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:0
+
+# For all OFB encrypts and decrypts, the transformed sequence is
+#   CAMELLIA-bits-OFB:key:IV/output':plaintext:ciphertext:encdec
+# OFB-CAMELLIA128.Encrypt 
+CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1
+CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:1
+CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:1
+CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:1
+
+# OFB-CAMELLIA128.Decrypt 
+CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0
+CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:0
+CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:0
+CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:0
+
+# OFB-CAMELLIA192.Encrypt 
+CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1
+CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:1
+CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:1
+CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:1
+
+# OFB-CAMELLIA192.Decrypt 
+CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0
+CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:0
+CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:0
+CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:0
+
+# OFB-CAMELLIA256.Encrypt 
+CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1
+CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:1
+CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:1
+CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:1
+
+# OFB-CAMELLIA256.Decrypt 
+CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0
+CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:0
+CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:0
+CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:0
+
+# SEED test vectors from RFC4269
+SEED-ECB:00000000000000000000000000000000::000102030405060708090A0B0C0D0E0F:5EBAC6E0054E166819AFF1CC6D346CDB:0
+SEED-ECB:000102030405060708090A0B0C0D0E0F::00000000000000000000000000000000:C11F22F20140505084483597E4370F43:0
+SEED-ECB:4706480851E61BE85D74BFB3FD956185::83A2F8A288641FB9A4E9A5CC2F131C7D:EE54D13EBCAE706D226BC3142CD40D4A:0
+SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:0
+SEED-ECB:00000000000000000000000000000000::000102030405060708090A0B0C0D0E0F:5EBAC6E0054E166819AFF1CC6D346CDB:1
+SEED-ECB:000102030405060708090A0B0C0D0E0F::00000000000000000000000000000000:C11F22F20140505084483597E4370F43:1
+SEED-ECB:4706480851E61BE85D74BFB3FD956185::83A2F8A288641FB9A4E9A5CC2F131C7D:EE54D13EBCAE706D226BC3142CD40D4A:1
+SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:1
diff -Naur openssl-1.0.0q.orig/selftest/names.ot openssl-1.0.0q/selftest/names.ot
--- openssl-1.0.0q.orig/selftest/names.ot	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/names.ot	2017-04-25 16:23:41.385030776 +0200
@@ -0,0 +1,77 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 2012-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+/**
+ * @file names.ot
+ *
+ * Selftests for OpenSSL object database name lookup functionality.
+ *
+ * @author Alexei Khlebnikov <alexeik@opera.com>
+ *
+ */
+
+group "libopeay.names";
+require _SSL_SUPPORT_;
+
+language c++;
+
+include "modules/libopeay/openssl/cryptlib.h";
+include "modules/libopeay/openssl/evp.h";
+
+setup
+{
+	OP_ASSERT(!ERR_peek_error());
+}
+
+
+exit
+{
+	OP_ASSERT(!ERR_peek_error());
+}
+
+
+table ciphers(const char* cipher_name)
+{
+	// These names are taken from modules/libopeay/crypto/objects/obj_mac.h.
+	{ "DES-EDE3-CBC" },
+	{ "des-ede3-cbc" },
+	{ "DES3"         },
+	{ "des3"         },
+	{ "RC4"          },
+	{ "rc4"          },
+	{ "AES-128-CBC"  },
+	{ "aes-128-cbc"  },
+	{ "AES128"       },
+	{ "aes128"       },
+	{ "AES-256-CBC"  },
+	{ "aes-256-cbc"  },
+	{ "AES256"       },
+	{ "aes256"       }
+}
+
+subtest find_cipher(const char* cipher_name)
+{
+	verify(!ERR_peek_error());
+
+	const EVP_CIPHER* cipher = EVP_get_cipherbyname(cipher_name);
+	verify(cipher);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+foreach (cipher_name) from ciphers
+{
+	test("EVP_get_cipherbyname, " cipher_name)
+	{
+		find_cipher(cipher_name);
+	}
+}
diff -Naur openssl-1.0.0q.orig/selftest/teststrings.txt openssl-1.0.0q/selftest/teststrings.txt
--- openssl-1.0.0q.orig/selftest/teststrings.txt	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/teststrings.txt	2017-04-25 16:23:41.387031310 +0200
@@ -0,0 +1,61 @@
+#from crypto/evp/evptest.txt
+#cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt)
+#digest:::input:output
+
+# SHA(1) tests (from shatest.c)
+SHA1:::616263:a9993e364706816aba3e25717850c26c9cd0d89d
+
+# MD5 tests (from md5test.c)
+MD5::::d41d8cd98f00b204e9800998ecf8427e
+MD5:::61:0cc175b9c0f1b6a831c399e269772661
+MD5:::616263:900150983cd24fb0d6963f7d28e17f72
+MD5:::6d65737361676520646967657374:f96b697d7cb7938d525a2f31aaf161d0
+MD5:::6162636465666768696a6b6c6d6e6f707172737475767778797a:c3fcd3d76192e4007dfb496cca67e13b
+MD5:::4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a30313233343536373839:d174ab98d277d9f5a5611c2c9f419d9f
+MD5:::3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930:57edf4a22be3c955ac49da2e2107b67a
+
+# AES 128 CBC tests (from NIST test vectors, encrypt)
+
+#AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:8A05FC5E095AF4848A08D328D3688E3D:1
+
+# AES 192 CBC tests (from NIST test vectors, encrypt)
+
+#AES-192-CBC:000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:7BD966D53AD8C1BB85D2ADFAE87BB104:1
+
+# AES 256 CBC tests (from NIST test vectors, encrypt)
+
+#AES-256-CBC:0000000000000000000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:FE3C53653E2F45B56FCD88B2CC898FF0:1
+
+# AES 128 CBC tests (from NIST test vectors, decrypt)
+
+#AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:FACA37E0B0C85373DF706E73F7C9AF86:00000000000000000000000000000000:0
+
+# AES tests from NIST document SP800-38A
+# For all CBC encrypts and decrypts, the transformed sequence is
+#   AES-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec
+# CBC-AES128.Encrypt and CBC-AES128.Decrypt 
+AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:7649ABAC8119B246CEE98E9B12E9197D
+AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:7649ABAC8119B246CEE98E9B12E9197D:AE2D8A571E03AC9C9EB76FAC45AF8E51:5086CB9B507219EE95DB113A917678B2
+AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:5086CB9B507219EE95DB113A917678B2:30C81C46A35CE411E5FBC1191A0A52EF:73BED6B8E3C1743B7116E69E22229516
+AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:73BED6B8E3C1743B7116E69E22229516:F69F2445DF4F9B17AD2B417BE66C3710:3FF1CAA1681FAC09120ECA307586E1A7
+# CBC-AES192.Encrypt and CBC-AES192.Decrypt 
+AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:4F021DB243BC633D7178183A9FA071E8
+AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:4F021DB243BC633D7178183A9FA071E8:AE2D8A571E03AC9C9EB76FAC45AF8E51:B4D9ADA9AD7DEDF4E5E738763F69145A
+AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:B4D9ADA9AD7DEDF4E5E738763F69145A:30C81C46A35CE411E5FBC1191A0A52EF:571B242012FB7AE07FA9BAAC3DF102E0
+AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:571B242012FB7AE07FA9BAAC3DF102E0:F69F2445DF4F9B17AD2B417BE66C3710:08B0E27988598881D920A9E64F5615CD
+# CBC-AES256.Encrypt and CBC-AES256.Decrypt 
+AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:F58C4C04D6E5F1BA779EABFB5F7BFBD6
+AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:F58C4C04D6E5F1BA779EABFB5F7BFBD6:AE2D8A571E03AC9C9EB76FAC45AF8E51:9CFC4E967EDB808D679F777BC6702C7D
+AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:9CFC4E967EDB808D679F777BC6702C7D:30C81C46A35CE411E5FBC1191A0A52EF:39F23369A9D9BACFA530E26304231461
+AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39F23369A9D9BACFA530E26304231461:F69F2445DF4F9B17AD2B417BE66C3710:B2EB05E2C39BE9FCDA6C19078C6A9D1B
+
+# DES EDE3 CBC tests (from destest)
+DES-EDE3-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:3FE301C962AC01D02213763C1CBD4CDC799657C064ECF5D41C673812CFDE9675
+
+# RC4 tests (from rc4test)
+RC4:0123456789abcdef0123456789abcdef::0123456789abcdef:75b7878099e0c596
+RC4:0123456789abcdef0123456789abcdef::0000000000000000:7494c2e7104b0879
+RC4:00000000000000000000000000000000::0000000000000000:de188941a3375d3a
+RC4:ef012345ef012345ef012345ef012345::0000000000000000000000000000000000000000:d6a141a7ec3c38dfbd615a1162e1c7ba36b67858
+RC4:0123456789abcdef0123456789abcdef::123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345678:66a0949f8af7d6891f7f832ba833c00c892ebe30143ce28740011ecf
+RC4:ef012345ef012345ef012345ef012345::00000000000000000000:d6a141a7ec3c38dfbd61
diff -Naur openssl-1.0.0q.orig/selftest/x509_vfy.ot openssl-1.0.0q/selftest/x509_vfy.ot
--- openssl-1.0.0q.orig/selftest/x509_vfy.ot	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/selftest/x509_vfy.ot	2017-04-25 16:23:41.388030878 +0200
@@ -0,0 +1,453 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 2012-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+/**
+ * @file x509_vfy.ot
+ *
+ * Selftests for OpenSSL cert verification functionality.
+ *
+ * @author Alexei Khlebnikov <alexeik@opera.com>
+ *
+ */
+
+group "libopeay.x509_vfy";
+require CRYPTO_CERTIFICATE_VERIFICATION_USE_CORE_IMPLEMENTATION;
+
+language c++;
+
+include "modules/libopeay/openssl/cryptlib.h";
+
+include "modules/libopeay/addon/libopeay_util.h";
+include "modules/libopeay/openssl/pem.h";
+include "modules/libopeay/openssl/x509.h";
+include "modules/util/opfile/opfile.h";
+
+global
+{
+	/** Load the whole file into memory.
+	 *
+	 *  Caller is responsible to deallocate 'data' by OP_DELETEA,
+	 *  if and only if OpStatus::OK was returned.
+	 *
+	 *  @param       filename     Name of the file to load.
+	 *  @param[out]  data         Pointer to the data will be written here.
+	 *  @param[out]  data_length  Data length will be written here.
+	 *  @param       max_length   File length limit. The function will fail
+	 *                            if the file is bigger than this limit.
+	 */
+	OP_STATUS file2mem(
+		const char* filename,
+		char*& data,
+		OpFileLength& data_length,
+		// 640K should be enough for everyone.
+		OpFileLength max_length = 640 * 1024)
+	{
+		OpString filename16;
+		OP_STATUS status = filename16.SetFromUTF8(filename);
+		RETURN_IF_ERROR(status);
+
+		OpFile file;
+		status = file.Construct(filename16);
+		RETURN_IF_ERROR(status);
+
+		BOOL exists = FALSE;
+		status = file.Exists(exists);
+		RETURN_IF_ERROR(status);
+		if (!exists)
+			return OpStatus::ERR;
+
+		status = file.GetFileLength(data_length);
+		RETURN_IF_ERROR(status);
+		if (data_length < 0 || data_length > max_length || data_length > INT_MAX)
+			return OpStatus::ERR;
+
+		status = file.Open(OPFILE_READ);
+		RETURN_IF_ERROR(status);
+
+		if (data_length == 0)
+		{
+			data = NULL;
+			return OpStatus::OK;
+		}
+
+		data = OP_NEWA(char, static_cast<size_t>(data_length));
+		RETURN_OOM_IF_NULL(data);
+
+		OpFileLength bytes_read = 0;
+		status = file.Read(data, data_length, &bytes_read);
+		if (OpStatus::IsError(status) || !data || bytes_read != data_length)
+		{
+			OP_DELETEA(data);
+			return OpStatus::ERR;
+		}
+
+		return OpStatus::OK;
+	}
+
+	void free_bio_and_data(BIO* bio)
+	{
+		OP_ASSERT(bio);
+		int ret = BIO_reset(bio);
+		OP_ASSERT(ret == 1);
+		(void)ret;
+
+		char* data = NULL;
+		long data_length = BIO_get_mem_data(bio, &data);
+		BIO_free(bio);
+
+		if (data_length > 0)
+			OP_DELETEA(data);
+	}
+
+	BIO* file2membio(const char* filename)
+	{
+		char* data = NULL;
+		OpFileLength data_length = 0;
+
+		OP_STATUS status = file2mem(filename, data, data_length);
+		RETURN_VALUE_IF_ERROR(status, NULL);
+		OP_ASSERT(data_length < INT_MAX);
+
+		BIO* bio = BIO_new_mem_buf(data, static_cast<int>(data_length));
+		if (!bio)
+		{
+			OP_DELETEA(data);
+			ERR_clear_error();
+			return NULL;
+		}
+
+		return bio;
+	}
+
+	X509* load_X509_from_file(const char* filename)
+	{
+		BIO* bio = file2membio(filename);
+		if (!bio)
+			return NULL;
+
+		X509* x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
+		free_bio_and_data(bio);
+		if (!x509)
+			ERR_clear_error();
+
+		return x509;
+	}
+
+	X509* load_X509_AUX_from_file(const char* filename)
+	{
+		BIO* bio = file2membio(filename);
+		if (!bio)
+			return NULL;
+
+		X509* x509 = PEM_read_bio_X509_AUX(bio, NULL, NULL, NULL);
+		free_bio_and_data(bio);
+		if (!x509)
+			ERR_clear_error();
+
+		return x509;
+	}
+
+	X509_CRL* load_X509_CRL_from_file(const char* filename)
+	{
+		BIO* bio = file2membio(filename);
+		if (!bio)
+			return NULL;
+
+		X509_CRL* crl = PEM_read_bio_X509_CRL(bio, NULL, NULL, NULL);
+		free_bio_and_data(bio);
+		if (!crl)
+			ERR_clear_error();
+
+		return crl;
+	}
+
+	X509* m_cacert = NULL;
+	X509* m_cert1  = NULL;
+	X509* m_cert2  = NULL;
+	X509_CRL* m_crl1 = NULL;
+	X509_CRL* m_crl2 = NULL;
+	STACK_OF(X509_CRL)* m_stack_of_crl1 = NULL;
+	STACK_OF(X509_CRL)* m_stack_of_crl2 = NULL;
+	X509_STORE*     m_store = NULL;
+	X509_STORE_CTX* m_store_ctx = NULL;
+
+	STACK_OF(X509)* NO_UNTRUSTED = NULL;
+	STACK_OF(X509_CRL)* NO_CRL = NULL;
+	unsigned long NO_FLAGS = 0;
+	unsigned long REQUIRE_CRL = X509_V_FLAG_CRL_CHECK_ALL | X509_V_FLAG_CRL_CHECK;
+
+} // global
+
+
+setup
+{
+	OP_ASSERT(!ERR_peek_error());
+}
+
+
+exit
+{
+	X509_STORE_CTX_free(m_store_ctx);
+	X509_STORE_free(m_store);
+	sk_X509_CRL_free(m_stack_of_crl2);
+	sk_X509_CRL_free(m_stack_of_crl1);
+	X509_CRL_free(m_crl2);
+	X509_CRL_free(m_crl1);
+	X509_free(m_cert2);
+	X509_free(m_cert1);
+	X509_free(m_cacert);
+	OP_ASSERT(!ERR_peek_error());
+}
+
+
+test("Load cacert.pem as X509_AUX")
+	file filename "TestCA/ca-data/cacert.pem";
+{
+	verify(!ERR_peek_error());
+
+	m_cacert = load_X509_AUX_from_file(filename);
+	verify(m_cacert);
+
+	verify(!ERR_peek_error());
+}
+
+
+test("Load cert1.pem  as X509")
+	file filename "TestCA/certs/cert1.pem";
+{
+	verify(!ERR_peek_error());
+
+	m_cert1 = load_X509_from_file(filename);
+	verify(m_cert1);
+
+	verify(!ERR_peek_error());
+}
+
+
+test("Load cert2.pem  as X509")
+	file filename "TestCA/certs/cert2.pem";
+{
+	verify(!ERR_peek_error());
+
+	m_cert2 = load_X509_from_file(filename);
+	verify(m_cert2);
+
+	verify(!ERR_peek_error());
+}
+
+
+test("Load crl1.pem   as X509_CRL")
+	file filename "TestCA/crls/crl1.pem";
+{
+	verify(!ERR_peek_error());
+
+	m_crl1 = load_X509_CRL_from_file(filename);
+	verify(m_crl1);
+
+	verify(!ERR_peek_error());
+}
+
+
+test("Load crl2.pem   as X509_CRL")
+	file filename "TestCA/crls/crl2.pem";
+{
+	verify(!ERR_peek_error());
+
+	m_crl2 = load_X509_CRL_from_file(filename);
+	verify(m_crl2);
+
+	verify(!ERR_peek_error());
+}
+
+
+test("Create X509_STORE")
+{
+	verify(!ERR_peek_error());
+
+	m_store = X509_STORE_new();
+	verify(m_store);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+
+test("Add cacert.pem to X509_STORE")
+{
+	verify(!ERR_peek_error());
+
+	int ret = X509_STORE_add_cert(m_store, m_cacert);
+	verify(ret == 1);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+
+test("Create the 1st STACK_OF(X509_CRL)")
+{
+	verify(!ERR_peek_error());
+
+	m_stack_of_crl1 = sk_X509_CRL_new_null();
+	verify(m_stack_of_crl1);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+
+test("Add crl1.pem to m_stack_of_crl1")
+{
+	verify(!ERR_peek_error());
+	verify(m_stack_of_crl1);
+	verify(m_crl1);
+
+	int idx = sk_X509_CRL_push(m_stack_of_crl1, m_crl1);
+	verify(idx > 0);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+
+test("Create the 2nd STACK_OF(X509_CRL) and add crl2.pem to it")
+{
+	verify(!ERR_peek_error());
+
+	verify(m_crl2);
+
+	m_stack_of_crl2 = sk_X509_CRL_new_null();
+	verify(m_stack_of_crl2);
+	verify(!ERR_peek_error());
+
+	int idx = sk_X509_CRL_push(m_stack_of_crl2, m_crl2);
+	verify(idx > 0);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+
+test("Create X509_STORE_CTX")
+{
+	verify(!ERR_peek_error());
+
+	m_store_ctx = X509_STORE_CTX_new();
+	verify(m_store_ctx);
+
+	verify(!ERR_peek_error());
+}
+finally
+{
+	ERR_clear_error();
+}
+
+
+test("Data for cert verification is ready")
+{
+	verify(m_cacert);
+	verify(m_cert1);
+	verify(m_cert2);
+	verify(m_crl1);
+	verify(m_crl2);
+	verify(m_stack_of_crl1);
+	verify(m_stack_of_crl2);
+	verify(m_store);
+	verify(m_store_ctx);
+	verify(!ERR_peek_error());
+}
+
+
+subtest verify_cert(
+	X509*               cert,
+	STACK_OF(X509)*     untrusted_stack,
+	STACK_OF(X509_CRL)* crl_stack,
+	unsigned long       flags,
+	int                 expected_error)
+{
+	verify(!ERR_peek_error());
+	verify(m_store_ctx);
+	verify(m_store);
+
+	int ret = X509_STORE_CTX_init(m_store_ctx, m_store, cert, untrusted_stack);
+	verify(ret == 1);
+	verify(!ERR_peek_error());
+
+	X509_STORE_CTX_set0_crls(m_store_ctx, crl_stack);
+	X509_STORE_CTX_set_flags(m_store_ctx, flags);
+
+	ret = X509_verify_cert(m_store_ctx);
+	int error = X509_STORE_CTX_get_error(m_store_ctx);
+	verify((ret == 1) ^ (error != X509_V_OK));
+
+	if (error != expected_error)
+	{
+		output("vvvvvv\n");
+		output("  |X509_verify_cert() returned: %s\n", X509_V_ERR_name(error));
+		output("  |                   expected: %s\n", X509_V_ERR_name(expected_error));
+		output("  |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ");
+	}
+
+	verify (error == expected_error);
+}
+finally
+{
+	if(m_store_ctx)
+		X509_STORE_CTX_cleanup(m_store_ctx);
+	ERR_clear_error();
+}
+
+table cert_verification_tests(
+	const char*         test_name,
+	X509*               cert,
+	STACK_OF(X509)*     untrusted_stack,
+	STACK_OF(X509_CRL)* crl_stack,
+	unsigned long       flags,
+	int                 expected_error)
+{
+	{ "Verify   valid cert1.pem, without CRL check",
+		m_cert1, NO_UNTRUSTED, NO_CRL, NO_FLAGS, X509_V_OK }
+	{ "Verify revoked cert2.pem, without CRL check",
+		m_cert2, NO_UNTRUSTED, NO_CRL, NO_FLAGS, X509_V_OK }
+	{ "Verify   valid cert1.pem, missing CRL",
+		m_cert1, NO_UNTRUSTED, NO_CRL, REQUIRE_CRL, X509_V_ERR_UNABLE_TO_GET_CRL }
+	{ "Verify revoked cert2.pem, missing CRL",
+		m_cert2, NO_UNTRUSTED, NO_CRL, REQUIRE_CRL, X509_V_ERR_UNABLE_TO_GET_CRL }
+	{ "Verify   valid cert1.pem, with crl1.pem",
+		m_cert1, NO_UNTRUSTED, m_stack_of_crl1, REQUIRE_CRL, X509_V_OK }
+	{ "Verify revoked cert2.pem, with crl1.pem",
+		m_cert2, NO_UNTRUSTED, m_stack_of_crl1, REQUIRE_CRL, X509_V_OK }
+	{ "Verify   valid cert1.pem, with crl2.pem",
+		m_cert1, NO_UNTRUSTED, m_stack_of_crl2, REQUIRE_CRL, X509_V_OK }
+	{ "Verify revoked cert2.pem, with crl2.pem",
+		m_cert2, NO_UNTRUSTED, m_stack_of_crl2, REQUIRE_CRL, X509_V_ERR_CERT_REVOKED }
+}
+
+foreach (test_name, cert, untrusted_stack, crl_stack, flags, expected_error) from cert_verification_tests
+{
+	test(test_name)
+		require success("Data for cert verification is ready");
+	{
+		verify_cert(cert, untrusted_stack, crl_stack, flags, expected_error);
+	}
+}
diff -Naur openssl-1.0.0q.orig/ssl/.gitignore openssl-1.0.0q/ssl/.gitignore
--- openssl-1.0.0q.orig/ssl/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/.gitignore	2017-04-25 16:23:41.389032122 +0200
@@ -0,0 +1,2 @@
+/.depend
+/*.d
diff -Naur openssl-1.0.0q.orig/ssl/d1_both.c openssl-1.0.0q/ssl/d1_both.c
--- openssl-1.0.0q.orig/ssl/d1_both.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/d1_both.c	2017-04-25 16:23:41.398030752 +0200
@@ -113,6 +113,8 @@
  * [including the GNU Public Licence.]
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include <limits.h>
 #include <string.h>
 #include <stdio.h>
diff -Naur openssl-1.0.0q.orig/ssl/d1_clnt.c openssl-1.0.0q/ssl/d1_clnt.c
--- openssl-1.0.0q.orig/ssl/d1_clnt.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/d1_clnt.c	2017-04-25 16:23:41.400030448 +0200
@@ -113,6 +113,8 @@
  * [including the GNU Public Licence.]
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include <stdio.h>
 #include "ssl_locl.h"
 #ifndef OPENSSL_NO_KRB5
diff -Naur openssl-1.0.0q.orig/ssl/d1_pkt.c openssl-1.0.0q/ssl/d1_pkt.c
--- openssl-1.0.0q.orig/ssl/d1_pkt.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/d1_pkt.c	2017-04-25 16:23:41.401030854 +0200
@@ -113,6 +113,8 @@
  * [including the GNU Public Licence.]
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include <stdio.h>
 #include <errno.h>
 #define USE_SOCKETS
diff -Naur openssl-1.0.0q.orig/ssl/d1_srvr.c openssl-1.0.0q/ssl/d1_srvr.c
--- openssl-1.0.0q.orig/ssl/d1_srvr.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/d1_srvr.c	2017-04-25 16:23:41.402030423 +0200
@@ -113,6 +113,8 @@
  * [including the GNU Public Licence.]
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include <stdio.h>
 #include "ssl_locl.h"
 #include <openssl/buffer.h>
diff -Naur openssl-1.0.0q.orig/ssl/install.com openssl-1.0.0q/ssl/install.com
--- openssl-1.0.0q.orig/ssl/install.com	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/install.com	2017-04-25 16:23:41.403029991 +0200
@@ -0,0 +1,90 @@
+$! INSTALL.COM -- Installs the files in a given directory tree
+$!
+$! Author: Richard Levitte <richard@levitte.org>
+$! Time of creation: 22-MAY-1998 10:13
+$!
+$! P1	root of the directory tree
+$!
+$	IF P1 .EQS. ""
+$	THEN
+$	    WRITE SYS$OUTPUT "First argument missing."
+$	    WRITE SYS$OUTPUT -
+		  "It should be the directory where you want things installed."
+$	    EXIT
+$	ENDIF
+$
+$	IF (F$GETSYI("CPU").LT.128)
+$	THEN
+$	    ARCH := VAX
+$	ELSE
+$	    ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
+$	    IF (ARCH .EQS. "") THEN ARCH = "UNK"
+$	ENDIF
+$
+$	ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0"
+$	ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY")
+$	ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
+		   - "[000000." - "][" - "[" - "]"
+$	ROOT = ROOT_DEV + "[" + ROOT_DIR
+$
+$	DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC
+$	DEFINE/NOLOG WRK_SSLXLIB WRK_SSLROOT:['ARCH'_LIB]
+$	DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE]
+$	DEFINE/NOLOG WRK_SSLXEXE WRK_SSLROOT:['ARCH'_EXE]
+$
+$	IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN -
+	   CREATE/DIR/LOG WRK_SSLROOT:[000000]
+$	IF F$PARSE("WRK_SSLXLIB:") .EQS. "" THEN -
+	   CREATE/DIR/LOG WRK_SSLXLIB:
+$	IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN -
+	   CREATE/DIR/LOG WRK_SSLINCLUDE:
+$	IF F$PARSE("WRK_SSLXEXE:") .EQS. "" THEN -
+	   CREATE/DIR/LOG WRK_SSLXEXE:
+$
+$	EXHEADER := ssl.h,ssl2.h,ssl3.h,ssl23.h,tls1.h,dtls1.h,kssl.h
+$	E_EXE := ssl_task
+$	LIBS := LIBSSL,LIBSSL32
+$
+$	XEXE_DIR := [-.'ARCH'.EXE.SSL]
+$
+$	COPY 'EXHEADER' WRK_SSLINCLUDE:/LOG
+$	SET FILE/PROT=WORLD:RE WRK_SSLINCLUDE:'EXHEADER'
+$
+$	I = 0
+$ LOOP_EXE: 
+$	E = F$EDIT(F$ELEMENT(I, ",", E_EXE),"TRIM")
+$	I = I + 1
+$	IF E .EQS. "," THEN GOTO LOOP_EXE_END
+$	SET NOON
+$	IF F$SEARCH(XEXE_DIR+E+".EXE") .NES. ""
+$	THEN
+$	  COPY 'XEXE_DIR''E'.EXE WRK_SSLXEXE:'E'.EXE/log
+$	  SET FILE/PROT=W:RE WRK_SSLXEXE:'E'.EXE
+$	ENDIF
+$	SET ON
+$	GOTO LOOP_EXE
+$ LOOP_EXE_END:
+$
+$	I = 0
+$ LOOP_LIB: 
+$	E = F$EDIT(F$ELEMENT(I, ",", LIBS),"TRIM")
+$	I = I + 1
+$	IF E .EQS. "," THEN GOTO LOOP_LIB_END
+$	SET NOON
+$! Object library.
+$	IF F$SEARCH(XEXE_DIR+E+".OLB") .NES. ""
+$	THEN
+$	  COPY 'XEXE_DIR''E'.OLB WRK_SSLXLIB:'E'.OLB/log
+$	  SET FILE/PROT=W:RE WRK_SSLXLIB:'E'.OLB
+$	ENDIF
+$! Shareable image.
+$	IF F$SEARCH(XEXE_DIR+E+".EXE") .NES. ""
+$	THEN
+$	  COPY 'XEXE_DIR''E'.EXE WRK_SSLXLIB:'E'.EXE/log
+$	  SET FILE/PROT=W:RE WRK_SSLXLIB:'E'.EXE
+$	ENDIF
+$	SET ON
+$	GOTO LOOP_LIB
+$ LOOP_LIB_END:
+$
+$	EXIT
diff -Naur openssl-1.0.0q.orig/ssl/kssl.c openssl-1.0.0q/ssl/kssl.c
--- openssl-1.0.0q.orig/ssl/kssl.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/kssl.c	2017-04-25 16:23:41.404030118 +0200
@@ -66,6 +66,8 @@
 **          		Real RFC2712 KerberosWrapper replaces AP_REQ.
 */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include <openssl/opensslconf.h>
 
 #include <string.h>
diff -Naur openssl-1.0.0q.orig/ssl/opera_s3_both.cpp openssl-1.0.0q/ssl/opera_s3_both.cpp
--- openssl-1.0.0q.orig/ssl/opera_s3_both.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_s3_both.cpp	2017-04-25 16:23:41.405031083 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/s3_both.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_s3_clnt.cpp openssl-1.0.0q/ssl/opera_s3_clnt.cpp
--- openssl-1.0.0q.orig/ssl/opera_s3_clnt.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_s3_clnt.cpp	2017-04-25 16:23:41.405031083 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/s3_clnt.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_s3_enc.cpp openssl-1.0.0q/ssl/opera_s3_enc.cpp
--- openssl-1.0.0q.orig/ssl/opera_s3_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_s3_enc.cpp	2017-04-25 16:23:41.406031769 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/s3_enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_s3_lib.cpp openssl-1.0.0q/ssl/opera_s3_lib.cpp
--- openssl-1.0.0q.orig/ssl/opera_s3_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_s3_lib.cpp	2017-04-25 16:23:41.406031769 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/s3_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_s3_pkt.cpp openssl-1.0.0q/ssl/opera_s3_pkt.cpp
--- openssl-1.0.0q.orig/ssl/opera_s3_pkt.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_s3_pkt.cpp	2017-04-25 16:23:41.407031337 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/s3_pkt.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_ssl_algs.cpp openssl-1.0.0q/ssl/opera_ssl_algs.cpp
--- openssl-1.0.0q.orig/ssl/opera_ssl_algs.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_ssl_algs.cpp	2017-04-25 16:23:41.407031337 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/ssl_algs.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_ssl_asn1.cpp openssl-1.0.0q/ssl/opera_ssl_asn1.cpp
--- openssl-1.0.0q.orig/ssl/opera_ssl_asn1.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_ssl_asn1.cpp	2017-04-25 16:23:41.408030626 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/ssl_asn1.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_ssl_cert.cpp openssl-1.0.0q/ssl/opera_ssl_cert.cpp
--- openssl-1.0.0q.orig/ssl/opera_ssl_cert.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_ssl_cert.cpp	2017-04-25 16:23:41.408030626 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/ssl_cert.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_ssl_ciph.cpp openssl-1.0.0q/ssl/opera_ssl_ciph.cpp
--- openssl-1.0.0q.orig/ssl/opera_ssl_ciph.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_ssl_ciph.cpp	2017-04-25 16:23:41.408030626 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/ssl_ciph.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_ssl_lib.cpp openssl-1.0.0q/ssl/opera_ssl_lib.cpp
--- openssl-1.0.0q.orig/ssl/opera_ssl_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_ssl_lib.cpp	2017-04-25 16:23:41.409031033 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/ssl_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_ssl_rsa.cpp openssl-1.0.0q/ssl/opera_ssl_rsa.cpp
--- openssl-1.0.0q.orig/ssl/opera_ssl_rsa.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_ssl_rsa.cpp	2017-04-25 16:23:41.409031033 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/ssl_rsa.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_ssl_sess.cpp openssl-1.0.0q/ssl/opera_ssl_sess.cpp
--- openssl-1.0.0q.orig/ssl/opera_ssl_sess.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_ssl_sess.cpp	2017-04-25 16:23:41.410030601 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/ssl_sess.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_t1_clnt.cpp openssl-1.0.0q/ssl/opera_t1_clnt.cpp
--- openssl-1.0.0q.orig/ssl/opera_t1_clnt.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_t1_clnt.cpp	2017-04-25 16:23:41.410030601 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/t1_clnt.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_t1_enc.cpp openssl-1.0.0q/ssl/opera_t1_enc.cpp
--- openssl-1.0.0q.orig/ssl/opera_t1_enc.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_t1_enc.cpp	2017-04-25 16:23:41.411030728 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/t1_enc.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_t1_lib.cpp openssl-1.0.0q/ssl/opera_t1_lib.cpp
--- openssl-1.0.0q.orig/ssl/opera_t1_lib.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_t1_lib.cpp	2017-04-25 16:23:41.411030728 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/t1_lib.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/opera_t1_reneg.cpp openssl-1.0.0q/ssl/opera_t1_reneg.cpp
--- openssl-1.0.0q.orig/ssl/opera_t1_reneg.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/ssl/opera_t1_reneg.cpp	2017-04-25 16:23:41.411030728 +0200
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
+**
+** Copyright (C) 1995-2012 Opera Software AS.  All rights reserved.
+**
+** This file is part of the Opera web browser.  It may not be distributed
+** under any circumstances.
+*/
+
+// Please don't modify this file.
+
+// This file is automatically generated by modules/libopeay/create_wrappers.py
+
+#include "core/pch.h"
+#include "modules/libopeay/core_includes.h"
+
+#if defined(EXTERNAL_SSL_OPENSSL_IMPLEMENTATION)
+# if !defined(_USE_SYSTEM_LIBCRYPTO_)
+extern "C" {
+#include "modules/libopeay/openssl/cryptlib.h"
+#include "modules/libopeay/ssl/t1_reneg.c"
+}
+# endif // !_USE_SYSTEM_LIBCRYPTO_
+#endif // EXTERNAL_SSL_OPENSSL_IMPLEMENTATION
diff -Naur openssl-1.0.0q.orig/ssl/s23_clnt.c openssl-1.0.0q/ssl/s23_clnt.c
--- openssl-1.0.0q.orig/ssl/s23_clnt.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/s23_clnt.c	2017-04-25 16:23:41.412031414 +0200
@@ -109,6 +109,8 @@
  *
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include <stdio.h>
 #include "ssl_locl.h"
 #include <openssl/buffer.h>
diff -Naur openssl-1.0.0q.orig/ssl/s23_srvr.c openssl-1.0.0q/ssl/s23_srvr.c
--- openssl-1.0.0q.orig/ssl/s23_srvr.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/s23_srvr.c	2017-04-25 16:23:41.413031262 +0200
@@ -109,6 +109,8 @@
  *
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include <stdio.h>
 #include "ssl_locl.h"
 #include <openssl/buffer.h>
diff -Naur openssl-1.0.0q.orig/ssl/s2_clnt.c openssl-1.0.0q/ssl/s2_clnt.c
--- openssl-1.0.0q.orig/ssl/s2_clnt.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/ssl/s2_clnt.c	2017-04-25 16:23:41.414031110 +0200
@@ -422,7 +422,6 @@
 		memset(s->session->session_id,0,
 			SSL_MAX_SSL_SESSION_ID_LENGTH_IN_BYTES);
 		s->session->session_id_length=0;
-		*/
 #endif
 
 		/* we need to do this in case we were trying to reuse a 
diff -Naur openssl-1.0.0q.orig/ssl/s2_lib.c openssl-1.0.0q/ssl/s2_lib.c
--- openssl-1.0.0q.orig/ssl/s2_lib.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/ssl/s2_lib.c	2017-04-25 16:23:41.415030957 +0200
@@ -109,6 +109,8 @@
  *
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include "ssl_locl.h"
 #ifndef OPENSSL_NO_SSL2
 #include <stdio.h>
diff -Naur openssl-1.0.0q.orig/ssl/s2_pkt.c openssl-1.0.0q/ssl/s2_pkt.c
--- openssl-1.0.0q.orig/ssl/s2_pkt.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/ssl/s2_pkt.c	2017-04-25 16:23:41.416030805 +0200
@@ -109,6 +109,8 @@
  *
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include "ssl_locl.h"
 #ifndef OPENSSL_NO_SSL2
 #include <stdio.h>
diff -Naur openssl-1.0.0q.orig/ssl/s3_both.c openssl-1.0.0q/ssl/s3_both.c
--- openssl-1.0.0q.orig/ssl/s3_both.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/s3_both.c	2017-04-25 16:23:41.417031491 +0200
@@ -114,9 +114,13 @@
  * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <limits.h>
 #include <string.h>
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include "ssl_locl.h"
 #include <openssl/buffer.h>
 #include <openssl/rand.h>
@@ -162,7 +166,7 @@
 		i=s->method->ssl3_enc->final_finish_mac(s,
 			sender,slen,s->s3->tmp.finish_md);
 		s->s3->tmp.finish_md_len = i;
-		memcpy(p, s->s3->tmp.finish_md, i);
+		op_memcpy(p, s->s3->tmp.finish_md, i);
 		p+=i;
 		l=i;
 
@@ -240,7 +244,7 @@
 		goto f_err;
 		}
 
-	if (CRYPTO_memcmp(p, s->s3->tmp.peer_finish_md, i) != 0)
+	if (op_memcmp(p, s->s3->tmp.peer_finish_md, i) != 0)
 		{
 		al=SSL_AD_DECRYPT_ERROR;
 		SSLerr(SSL_F_SSL3_GET_FINISHED,SSL_R_DIGEST_CHECK_FAILED);
@@ -501,7 +505,7 @@
 		}
 
 	/* next state (stn) */
-	p = s->init_msg;
+	p = (unsigned char*) s->init_msg;
 	n = s->s3->tmp.message_size - s->init_num;
 	while (n > 0)
 		{
@@ -684,7 +688,7 @@
 	    sz >= sizeof(*ent))
 		{
 		list->chunklen = sz;
-		ent = mem;
+		ent = (SSL3_BUF_FREELIST_ENTRY *)mem;
 		ent->next = list->head;
 		list->head = ent;
 		++list->len;
@@ -728,7 +732,7 @@
 		if (!(s->options & SSL_OP_NO_COMPRESSION))
 			len += SSL3_RT_MAX_COMPRESSED_OVERHEAD;
 #endif
-		if ((p=freelist_extract(s->ctx, 1, len)) == NULL)
+		if ((p=(unsigned char *)freelist_extract(s->ctx, 1, len)) == NULL)
 			goto err;
 		s->s3->rbuf.buf = p;
 		s->s3->rbuf.len = len;
@@ -769,7 +773,7 @@
 			len += headerlen + align
 				+ SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD;
 
-		if ((p=freelist_extract(s->ctx, 0, len)) == NULL)
+		if ((p=(unsigned char *)freelist_extract(s->ctx, 0, len)) == NULL)
 			goto err;
 		s->s3->wbuf.buf = p;
 		s->s3->wbuf.len = len;
diff -Naur openssl-1.0.0q.orig/ssl/s3_clnt.c openssl-1.0.0q/ssl/s3_clnt.c
--- openssl-1.0.0q.orig/ssl/s3_clnt.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/s3_clnt.c	2017-04-25 16:23:41.419030907 +0200
@@ -148,7 +148,11 @@
  * OTHERWISE.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include "ssl_locl.h"
 #include "kssl_lcl.h"
 #include <openssl/buffer.h>
@@ -651,7 +655,7 @@
 		s->client_version=s->version;
 
 		/* Random stuff */
-		memcpy(p,s->s3->client_random,SSL3_RANDOM_SIZE);
+		op_memcpy(p,s->s3->client_random,SSL3_RANDOM_SIZE);
 		p+=SSL3_RANDOM_SIZE;
 
 		/* Session ID */
@@ -667,7 +671,7 @@
 				SSLerr(SSL_F_SSL3_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);
 				goto err;
 				}
-			memcpy(p,s->session->session_id,i);
+			op_memcpy(p,s->session->session_id,i);
 			p+=i;
 			}
 		
@@ -790,7 +794,7 @@
 
 	/* load the server hello data */
 	/* load the server random */
-	memcpy(s->s3->server_random,p,SSL3_RANDOM_SIZE);
+	op_memcpy(s->s3->server_random,p,SSL3_RANDOM_SIZE);
 	p+=SSL3_RANDOM_SIZE;
 
 	/* get the session-id */
@@ -822,10 +826,10 @@
 #endif /* OPENSSL_NO_TLSEXT */
 
 	if (j != 0 && j == s->session->session_id_length
-	    && memcmp(p,s->session->session_id,j) == 0)
+	    && op_memcmp(p,s->session->session_id,j) == 0)
 	    {
 	    if(s->sid_ctx_length != s->session->sid_ctx_length
-	       || memcmp(s->session->sid_ctx,s->sid_ctx,s->sid_ctx_length))
+	       || op_memcmp(s->session->sid_ctx,s->sid_ctx,s->sid_ctx_length))
 		{
 		/* actually a client application bug */
 		al=SSL_AD_ILLEGAL_PARAMETER;
@@ -849,7 +853,7 @@
 				}
 			}
 		s->session->session_id_length=j;
-		memcpy(s->session->session_id,p,j); /* j could be 0 */
+		op_memcpy(s->session->session_id,p,j); /* j could be 0 */
 		}
 	p+=j;
 	c=ssl_get_cipher_by_char(s,p);
@@ -1959,13 +1963,13 @@
 		OPENSSL_free(s->session->tlsext_tick);
 		s->session->tlsext_ticklen = 0;
 		}
-	s->session->tlsext_tick = OPENSSL_malloc(ticklen);
+	s->session->tlsext_tick = (unsigned char*)OPENSSL_malloc(ticklen);
 	if (!s->session->tlsext_tick)
 		{
 		SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET,ERR_R_MALLOC_FAILURE);
 		goto err;
 		}
-	memcpy(s->session->tlsext_tick, p, ticklen);
+	op_memcpy(s->session->tlsext_tick, p, ticklen);
 	s->session->tlsext_ticklen = ticklen;
 	/* There are two ways to detect a resumed ticket sesion.
 	 * One is to set an appropriate session ID and then the server
@@ -2034,7 +2038,7 @@
 		}
 	if (s->tlsext_ocsp_resp)
 		OPENSSL_free(s->tlsext_ocsp_resp);
-	s->tlsext_ocsp_resp = BUF_memdup(p, resplen);
+	s->tlsext_ocsp_resp = (unsigned char*)BUF_memdup(p, resplen);
 	if (!s->tlsext_ocsp_resp)
 		{
 		al = SSL_AD_INTERNAL_ERROR;
@@ -2125,7 +2129,7 @@
 		else if (alg_k & SSL_kRSA)
 			{
 			RSA *rsa;
-			unsigned char tmp_buf[SSL_MAX_MASTER_KEY_LENGTH];
+			unsigned char tmp_buf[SSL_MAX_MASTER_KEY_LENGTH]; /* ARRAY OK 2009-09-08 alexeik */
 
 			if (s->session->sess_cert == NULL)
 				{
@@ -2188,6 +2192,7 @@
 			}
 #endif
 #ifndef OPENSSL_NO_KRB5
+#error("/* ARRAY FILE PART UNUSED. RECHECK ARRAYS BEFORE USING */")
 		else if (alg_k & SSL_kKRB5)
 			{
 			krb5_error_code	krb5rc;
@@ -2197,10 +2202,10 @@
 			krb5_data	authenticator, *authp = NULL;
 			EVP_CIPHER_CTX	ciph_ctx;
 			const EVP_CIPHER *enc = NULL;
-			unsigned char	iv[EVP_MAX_IV_LENGTH];
-			unsigned char	tmp_buf[SSL_MAX_MASTER_KEY_LENGTH];
+			unsigned char	iv[EVP_MAX_IV_LENGTH];              /* ARRAY OK UNUSED 2009-09-08 alexeik */
+			unsigned char	tmp_buf[SSL_MAX_MASTER_KEY_LENGTH]; /* ARRAY OK UNUSED 2009-09-08 alexeik */
 			unsigned char	epms[SSL_MAX_MASTER_KEY_LENGTH 
-						+ EVP_MAX_IV_LENGTH];
+						+ EVP_MAX_IV_LENGTH]; /* ARRAY OK UNUSED 2009-09-08 alexeik */
 			int 		padl, outl = sizeof(epms);
 
 			EVP_CIPHER_CTX_init(&ciph_ctx);
@@ -2258,7 +2263,7 @@
 
 			/*  KerberosWrapper.Ticket		*/
 			s2n(enc_ticket->length,p);
-			memcpy(p, enc_ticket->data, enc_ticket->length);
+			op_memcpy(p, enc_ticket->data, enc_ticket->length);
 			p+= enc_ticket->length;
 			n = enc_ticket->length + 2;
 
@@ -2266,7 +2271,7 @@
 			if (authp  &&  authp->length)  
 				{
 				s2n(authp->length,p);
-				memcpy(p, authp->data, authp->length);
+				op_memcpy(p, authp->data, authp->length);
 				p+= authp->length;
 				n+= authp->length + 2;
 				
@@ -2308,7 +2313,7 @@
 
 			/*  KerberosWrapper.EncryptedPreMasterSecret	*/
 			s2n(outl,p);
-			memcpy(p, epms, outl);
+			op_memcpy(p, epms, outl);
 			p+=outl;
 			n+=outl + 2;
 
@@ -2566,7 +2571,7 @@
 				/* Encoded point will be copied here */
 				p += 1; 
 				/* copy the point */
-				memcpy((unsigned char *)p, encodedPoint, n);
+				op_memcpy((unsigned char *)p, encodedPoint, n);
 				/* increment n to account for length field */
 				n += 1; 
 				}
@@ -2796,7 +2801,7 @@
 int ssl3_send_client_verify(SSL *s)
 	{
 	unsigned char *p,*d;
-	unsigned char data[MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH];
+	unsigned char data[MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH]; /* ARRAY OK 2009-09-08 alexeik */
 	EVP_PKEY *pkey;
 	EVP_PKEY_CTX *pctx=NULL;
 #ifndef OPENSSL_NO_RSA
diff -Naur openssl-1.0.0q.orig/ssl/s3_enc.c openssl-1.0.0q/ssl/s3_enc.c
--- openssl-1.0.0q.orig/ssl/s3_enc.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/s3_enc.c	2017-04-25 16:23:41.420031314 +0200
@@ -135,7 +135,11 @@
  * OTHERWISE.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include "ssl_locl.h"
 #include <openssl/evp.h>
 #include <openssl/md5.h>
@@ -199,7 +203,7 @@
 		if ((int)(i+MD5_DIGEST_LENGTH) > num)
 			{
 			EVP_DigestFinal_ex(&m5,smd,NULL);
-			memcpy(km,smd,(num-i));
+			op_memcpy(km,smd,(num-i));
 			}
 		else
 			EVP_DigestFinal_ex(&m5,km,NULL);
@@ -215,8 +219,8 @@
 int ssl3_change_cipher_state(SSL *s, int which)
 	{
 	unsigned char *p,*mac_secret;
-	unsigned char exp_key[EVP_MAX_KEY_LENGTH];
-	unsigned char exp_iv[EVP_MAX_IV_LENGTH];
+	unsigned char exp_key[EVP_MAX_KEY_LENGTH]; /* ARRAY OK 2009-09-08 alexeik */
+	unsigned char exp_iv[EVP_MAX_IV_LENGTH];   /* ARRAY OK 2009-09-08 alexeik */
 	unsigned char *ms,*key,*iv,*er1,*er2;
 	EVP_CIPHER_CTX *dd;
 	const EVP_CIPHER *c;
@@ -244,7 +248,7 @@
 		{
 		if (s->enc_read_ctx != NULL)
 			reuse_dd = 1;
-		else if ((s->enc_read_ctx=OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL)
+		else if ((s->enc_read_ctx=(EVP_CIPHER_CTX*)OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL)
 			goto err;
 		else
 			/* make sure it's intialized in case we exit later with an error */
@@ -274,14 +278,14 @@
 				goto err;
 			}
 #endif
-		memset(&(s->s3->read_sequence[0]),0,8);
+		op_memset(&(s->s3->read_sequence[0]),0,8);
 		mac_secret= &(s->s3->read_mac_secret[0]);
 		}
 	else
 		{
 		if (s->enc_write_ctx != NULL)
 			reuse_dd = 1;
-		else if ((s->enc_write_ctx=OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL)
+		else if ((s->enc_write_ctx=(EVP_CIPHER_CTX*)OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL)
 			goto err;
 		else
 			/* make sure it's intialized in case we exit later with an error */
@@ -305,7 +309,7 @@
 				}
 			}
 #endif
-		memset(&(s->s3->write_sequence[0]),0,8);
+		op_memset(&(s->s3->write_sequence[0]),0,8);
 		mac_secret= &(s->s3->write_mac_secret[0]);
 		}
 
@@ -347,7 +351,7 @@
 		}
 
 	EVP_MD_CTX_init(&md);
-	memcpy(mac_secret,ms,i);
+	op_memcpy(mac_secret,ms,i);
 	if (is_exp)
 		{
 		/* In here I set both the read and write key/iv to the
@@ -419,7 +423,7 @@
 
 	ssl3_cleanup_key_block(s);
 
-	if ((p=OPENSSL_malloc(num)) == NULL)
+	if ((p=(unsigned char*)OPENSSL_malloc(num)) == NULL)
 		goto err;
 
 	s->s3->tmp.key_block_length=num;
@@ -504,7 +508,7 @@
 	if ((s->session == NULL) || (ds == NULL) ||
 		(enc == NULL))
 		{
-		memmove(rec->data,rec->input,rec->length);
+		op_memmove(rec->data,rec->input,rec->length);
 		rec->input=rec->data;
 		}
 	else
@@ -595,7 +599,7 @@
 
 	/* Allocate handshake_dgst array */
 	ssl3_free_digest_list(s);
-	s->s3->handshake_dgst = OPENSSL_malloc(SSL_MAX_DIGEST * sizeof(EVP_MD_CTX *));
+	s->s3->handshake_dgst = (EVP_MD_CTX**)OPENSSL_malloc(SSL_MAX_DIGEST * sizeof(EVP_MD_CTX *));
 	memset(s->s3->handshake_dgst,0,SSL_MAX_DIGEST *sizeof(EVP_MD_CTX *));
 	hdatalen = BIO_get_mem_data(s->s3->handshake_buffer,&hdata);
 	if (hdatalen <= 0)
@@ -652,7 +656,7 @@
 	unsigned int ret;
 	int npad,n;
 	unsigned int i;
-	unsigned char md_buf[EVP_MAX_MD_SIZE];
+	unsigned char md_buf[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-09-08 alexeik */
 	EVP_MD_CTX ctx,*d=NULL;
 
 	if (s->s3->handshake_buffer) 
@@ -816,7 +820,7 @@
 int ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
 	     int len)
 	{
-	static const unsigned char *salt[3]={
+	static const unsigned char *salt[3]={  /* ARRAY OK 2009-09-08 alexeik */
 #ifndef CHARSET_EBCDIC
 		(const unsigned char *)"A",
 		(const unsigned char *)"BB",
@@ -827,7 +831,7 @@
 		(const unsigned char *)"\x43\x43\x43",
 #endif
 		};
-	unsigned char buf[EVP_MAX_MD_SIZE];
+	unsigned char buf[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-09-08 alexeik */
 	EVP_MD_CTX ctx;
 	int i,ret=0;
 	unsigned int n;
@@ -836,7 +840,7 @@
 	for (i=0; i<3; i++)
 		{
 		EVP_DigestInit_ex(&ctx,s->ctx->sha1, NULL);
-		EVP_DigestUpdate(&ctx,salt[i],strlen((const char *)salt[i]));
+		EVP_DigestUpdate(&ctx,salt[i],op_strlen((const char *)salt[i]));
 		EVP_DigestUpdate(&ctx,p,len);
 		EVP_DigestUpdate(&ctx,&(s->s3->client_random[0]),
 			SSL3_RANDOM_SIZE);
diff -Naur openssl-1.0.0q.orig/ssl/s3_lib.c openssl-1.0.0q/ssl/s3_lib.c
--- openssl-1.0.0q.orig/ssl/s3_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/s3_lib.c	2017-04-25 16:23:41.422030171 +0200
@@ -148,7 +148,11 @@
  * OTHERWISE.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include "ssl_locl.h"
 #include "kssl_lcl.h"
@@ -167,7 +171,7 @@
 #define SSL3_NUM_CIPHERS	(sizeof(ssl3_ciphers)/sizeof(SSL_CIPHER))
 
 /* list of available SSLv3 ciphers (sorted by id) */
-OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={
+SSL_CIPHER ssl3_ciphers[]={
 
 /* The RSA ciphers */
 /* Cipher 01 */
@@ -2121,7 +2125,7 @@
 	{
 	SSL3_STATE *s3;
 
-	if ((s3=OPENSSL_malloc(sizeof *s3)) == NULL) goto err;
+	if ((s3=(SSL3_STATE *)OPENSSL_malloc(sizeof *s3)) == NULL) goto err;
 	memset(s3,0,sizeof *s3);
 	memset(s3->rrec.seq_num,0,sizeof(s3->rrec.seq_num));
 	memset(s3->wrec.seq_num,0,sizeof(s3->wrec.seq_num));
@@ -2465,7 +2469,7 @@
 		break;
 
 	case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
-		s->tlsext_ocsp_exts = parg;
+		s->tlsext_ocsp_exts = (X509_EXTENSIONS*)parg;
 		ret = 1;
 		break;
 
@@ -2475,7 +2479,7 @@
 		break;
 
 	case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
-		s->tlsext_ocsp_ids = parg;
+		s->tlsext_ocsp_ids = (STACK_OF(OCSP_RESPID) *)parg;
 		ret = 1;
 		break;
 
@@ -2486,7 +2490,7 @@
 	case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
 		if (s->tlsext_ocsp_resp)
 			OPENSSL_free(s->tlsext_ocsp_resp);
-		s->tlsext_ocsp_resp = parg;
+		s->tlsext_ocsp_resp = (unsigned char*)parg;
 		s->tlsext_ocsp_resplen = larg;
 		ret = 1;
 		break;
@@ -2634,26 +2638,26 @@
 #ifndef OPENSSL_NO_DH
 	case SSL_CTRL_SET_TMP_DH:
 		{
-		DH *new=NULL,*dh;
+		DH *new_dh=NULL,*dh;
 
 		dh=(DH *)parg;
-		if ((new=DHparams_dup(dh)) == NULL)
+		if ((new_dh=DHparams_dup(dh)) == NULL)
 			{
 			SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_DH_LIB);
 			return 0;
 			}
 		if (!(ctx->options & SSL_OP_SINGLE_DH_USE))
 			{
-			if (!DH_generate_key(new))
+			if (!DH_generate_key(new_dh))
 				{
 				SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_DH_LIB);
-				DH_free(new);
+				DH_free(new_dh);
 				return 0;
 				}
 			}
 		if (cert->dh_tmp != NULL)
 			DH_free(cert->dh_tmp);
-		cert->dh_tmp=new;
+		cert->dh_tmp=new_dh;
 		return 1;
 		}
 		/*break; */
@@ -2712,7 +2716,7 @@
 	case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
 	case SSL_CTRL_GET_TLSEXT_TICKET_KEYS:
 		{
-		unsigned char *keys = parg;
+		unsigned char *keys = (unsigned char*)parg;
 		if (!keys)
 			return 48;
 		if (larg != 48)
@@ -3309,7 +3313,7 @@
 	clear_sys_error();
 	if (s->s3->renegotiate) ssl3_renegotiate_check(s);
 	s->s3->in_read_app_data=1;
-	ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,buf,len,peek);
+	ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,(unsigned char*)buf,len,peek);
 	if ((ret == -1) && (s->s3->in_read_app_data == 2))
 		{
 		/* ssl3_read_bytes decided to call s->handshake_func, which
@@ -3318,7 +3322,7 @@
 		 * and thinks that application data makes sense here; so disable
 		 * handshake processing and try to read application data again. */
 		s->in_handshake++;
-		ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,buf,len,peek);
+		ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,(unsigned char*)buf,len,peek);
 		s->in_handshake--;
 		}
 	else
diff -Naur openssl-1.0.0q.orig/ssl/s3_pkt.c openssl-1.0.0q/ssl/s3_pkt.c
--- openssl-1.0.0q.orig/ssl/s3_pkt.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/s3_pkt.c	2017-04-25 16:23:41.423031136 +0200
@@ -109,10 +109,13 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <limits.h>
 #include <errno.h>
 #define USE_SOCKETS
+#endif /* !OPERA_SMALL_VERSION */
+#include <openssl/cryptlib.h>
 #include "ssl_locl.h"
 #include <openssl/evp.h>
 #include <openssl/buffer.h>
@@ -296,7 +299,7 @@
 	SSL3_RECORD *rr;
 	SSL_SESSION *sess;
 	unsigned char *p;
-	unsigned char md[EVP_MAX_MD_SIZE];
+	unsigned char md[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-09-09 alexeik */
 	short version;
 	unsigned mac_size, orig_len;
 	size_t extra;
@@ -598,7 +601,7 @@
  */
 int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
 	{
-	const unsigned char *buf=buf_;
+	const unsigned char *buf=(const unsigned char*)buf_;
 	unsigned int n,nw;
 	int i,tot;
 
@@ -801,7 +804,7 @@
 		}
 	else
 		{
-		memcpy(wr->data,wr->input,wr->length);
+		op_memcpy(wr->data,wr->input,wr->length);
 		wr->input=wr->data;
 		}
 
@@ -1043,7 +1046,7 @@
 		else
 			n = (unsigned int)len;
 
-		memcpy(buf,&(rr->data[rr->off]),n);
+		op_memcpy(buf,&(rr->data[rr->off]),n);
 		if (!peek)
 			{
 			rr->length-=n;
@@ -1229,7 +1232,7 @@
 			}
 		else if (alert_level == 2) /* fatal */
 			{
-			char tmp[16];
+			char tmp[16]; /* ARRAY OK 2009-09-09 alexeik */
 
 			s->rwstate=SSL_NOTHING;
 			s->s3->fatal_alert = alert_descr;
diff -Naur openssl-1.0.0q.orig/ssl/s3_srvr.c openssl-1.0.0q/ssl/s3_srvr.c
--- openssl-1.0.0q.orig/ssl/s3_srvr.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/s3_srvr.c	2017-04-25 16:23:41.425029994 +0200
@@ -1434,7 +1434,7 @@
 	unsigned char *q;
 	int j,num;
 	RSA *rsa;
-	unsigned char md_buf[MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH];
+	unsigned char md_buf[MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH]; /* ARRAY OK 2009-09-09 alexeik */
 	unsigned int u;
 #endif
 #ifndef OPENSSL_NO_DH
@@ -2202,6 +2202,7 @@
 	else
 #endif
 #ifndef OPENSSL_NO_KRB5
+#error("/* ARRAY FILE PART UNUSED. RECHECK ARRAYS BEFORE USING */")
 	if (alg_k & SSL_kKRB5)
 		{
 		krb5_error_code		krb5rc;
@@ -2211,9 +2212,9 @@
 		KSSL_CTX		*kssl_ctx = s->kssl_ctx;
 		EVP_CIPHER_CTX		ciph_ctx;
 		const EVP_CIPHER	*enc = NULL;
-		unsigned char		iv[EVP_MAX_IV_LENGTH];
+		unsigned char		iv[EVP_MAX_IV_LENGTH]; /* ARRAY OK UNUSED 2009-09-09 alexeik */
 		unsigned char		pms[SSL_MAX_MASTER_KEY_LENGTH
-					       + EVP_MAX_BLOCK_LENGTH];
+					       + EVP_MAX_BLOCK_LENGTH]; /* ARRAY OK UNUSED 2009-09-09 alexeik */
 		int		     padl, outl;
 		krb5_timestamp		authtime = 0;
 		krb5_ticket_times	ttimes;
@@ -3109,6 +3110,7 @@
 	return(ssl3_do_write(s,SSL3_RT_HANDSHAKE));
 	}
 #ifndef OPENSSL_NO_TLSEXT
+#error("/* ARRAY FILE PART UNUSED. RECHECK ARRAYS BEFORE USING */")
 int ssl3_send_newsession_ticket(SSL *s)
 	{
 	if (s->state == SSL3_ST_SW_SESSION_TICKET_A)
@@ -3119,8 +3121,8 @@
 		EVP_CIPHER_CTX ctx;
 		HMAC_CTX hctx;
 		SSL_CTX *tctx = s->initial_ctx;
-		unsigned char iv[EVP_MAX_IV_LENGTH];
-		unsigned char key_name[16];
+		unsigned char iv[EVP_MAX_IV_LENGTH]; /* ARRAY OK UNUSED 2009-09-09 alexeik */
+		unsigned char key_name[16];          /* ARRAY OK UNUSED 2009-09-09 alexeik */
 
 		/* get session encoding length */
 		slen = i2d_SSL_SESSION(s->session, NULL);
diff -Naur openssl-1.0.0q.orig/ssl/ssl.h openssl-1.0.0q/ssl/ssl.h
--- openssl-1.0.0q.orig/ssl/ssl.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl.h	2017-04-25 16:23:41.427031645 +0200
@@ -447,21 +447,21 @@
 
 	/* only really used in SSLv2 */
 	unsigned int key_arg_length;
-	unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH];
+	unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH]; /* ARRAY OK 2009-08-07 alexeik */
 	int master_key_length;
-	unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH];
+	unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH]; /* ARRAY OK 2009-08-10 alexeik */
 	/* session_id - valid? */
 	unsigned int session_id_length;
-	unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH];
+	unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH]; /* ARRAY OK 2009-08-10 alexeik */
 	/* this is used to determine whether the session is being reused in
 	 * the appropriate context. It is up to the application to set this,
 	 * via SSL_new */
 	unsigned int sid_ctx_length;
-	unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+	unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; /* ARRAY OK 2009-08-10 alexeik */
 
 #ifndef OPENSSL_NO_KRB5
         unsigned int krb5_client_princ_len;
-        unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH];
+        unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH]; /* ARRAY OK UNUSED 2009-08-10 alexeik */
 #endif /* OPENSSL_NO_KRB5 */
 #ifndef OPENSSL_NO_PSK
 	char *psk_identity_hint;
@@ -816,7 +816,7 @@
 
 	int verify_mode;
 	unsigned int sid_ctx_length;
-	unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+	unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; /* ARRAY OK 2009-08-10 alexeik */
 	int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx); /* called 'verify_callback' in the SSL */
 
 	/* Default generate session ID callback. */
@@ -848,9 +848,9 @@
 	int (*tlsext_servername_callback)(SSL*, int *, void *);
 	void *tlsext_servername_arg;
 	/* RFC 4507 session ticket keys */
-	unsigned char tlsext_tick_key_name[16];
-	unsigned char tlsext_tick_hmac_key[16];
-	unsigned char tlsext_tick_aes_key[16];
+	unsigned char tlsext_tick_key_name[16]; /* ARRAY OK 2009-08-10 alexeik */
+	unsigned char tlsext_tick_hmac_key[16]; /* ARRAY OK 2009-08-10 alexeik */
+	unsigned char tlsext_tick_aes_key[16];  /* ARRAY OK 2009-08-10 alexeik */
 	/* Callback to support customisation of ticket key setting */
 	int (*tlsext_ticket_key_cb)(SSL *ssl,
 					unsigned char *name, unsigned char *iv,
@@ -1093,7 +1093,7 @@
 	/* the session_id_context is used to ensure sessions are only reused
 	 * in the appropriate context */
 	unsigned int sid_ctx_length;
-	unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+	unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; /* ARRAY OK 2009-08-10 alexeik */
 
 	/* This can also be in the session once a session is established */
 	SSL_SESSION *session;
diff -Naur openssl-1.0.0q.orig/ssl/ssl3.h openssl-1.0.0q/ssl/ssl3.h
--- openssl-1.0.0q.orig/ssl/ssl3.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl3.h	2017-04-25 16:23:41.428030934 +0200
@@ -402,15 +402,15 @@
 	long flags;
 	int delay_buf_pop_ret;
 
-	unsigned char read_sequence[8];
+	unsigned char read_sequence[8];                  /* ARRAY OK 2009-09-17 alexeik */
 	int read_mac_secret_size;
-	unsigned char read_mac_secret[EVP_MAX_MD_SIZE];
-	unsigned char write_sequence[8];
+	unsigned char read_mac_secret[EVP_MAX_MD_SIZE];  /* ARRAY OK 2009-09-17 alexeik */
+	unsigned char write_sequence[8];                 /* ARRAY OK 2009-09-17 alexeik */
 	int write_mac_secret_size;
-	unsigned char write_mac_secret[EVP_MAX_MD_SIZE];
+	unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-09-17 alexeik */
 
-	unsigned char server_random[SSL3_RANDOM_SIZE];
-	unsigned char client_random[SSL3_RANDOM_SIZE];
+	unsigned char server_random[SSL3_RANDOM_SIZE];   /* ARRAY OK 2009-09-17 alexeik */
+	unsigned char client_random[SSL3_RANDOM_SIZE];   /* ARRAY OK 2009-09-17 alexeik */
 
 	/* flags for countermeasure against known-IV weakness */
 	int need_empty_fragments;
@@ -427,9 +427,9 @@
 
 	/* storage for Alert/Handshake protocol data received but not
 	 * yet processed by ssl3_read_bytes: */
-	unsigned char alert_fragment[2];
+	unsigned char alert_fragment[2];     /* ARRAY OK 2009-09-17 alexeik */
 	unsigned int alert_fragment_len;
-	unsigned char handshake_fragment[4];
+	unsigned char handshake_fragment[4]; /* ARRAY OK 2009-09-17 alexeik */
 	unsigned int handshake_fragment_len;
 
 	/* partial write - check the numbers match */
@@ -454,7 +454,7 @@
 	/* we allow one fatal and one warning alert to be outstanding,
 	 * send close alert via the warning alert */
 	int alert_dispatch;
-	unsigned char send_alert[2];
+	unsigned char send_alert[2]; /* ARRAY OK 2009-09-17 alexeik */
 
 	/* This flag is set when we should renegotiate ASAP, basically when
 	 * there is no more data in the read or write buffers */
@@ -474,12 +474,12 @@
 
 	struct	{
 		/* actually only needs to be 16+20 */
-		unsigned char cert_verify_md[EVP_MAX_MD_SIZE*2];
+		unsigned char cert_verify_md[EVP_MAX_MD_SIZE*2]; /* ARRAY OK 2009-09-17 alexeik */
 
 		/* actually only need to be 16+20 for SSLv3 and 12 for TLS */
-		unsigned char finish_md[EVP_MAX_MD_SIZE*2];
+		unsigned char finish_md[EVP_MAX_MD_SIZE*2];      /* ARRAY OK 2009-09-17 alexeik */
 		int finish_md_len;
-		unsigned char peer_finish_md[EVP_MAX_MD_SIZE*2];
+		unsigned char peer_finish_md[EVP_MAX_MD_SIZE*2]; /* ARRAY OK 2009-09-17 alexeik */
 		int peer_finish_md_len;
 		
 		unsigned long message_size;
@@ -503,7 +503,7 @@
 		/* used for certificate requests */
 		int cert_req;
 		int ctype_num;
-		char ctype[SSL3_CT_NUMBER];
+		char ctype[SSL3_CT_NUMBER]; /* ARRAY OK 2009-09-17 alexeik */
 		STACK_OF(X509_NAME) *ca_names;
 
 		int use_rsa_tmp;
diff -Naur openssl-1.0.0q.orig/ssl/ssl_algs.c openssl-1.0.0q/ssl/ssl_algs.c
--- openssl-1.0.0q.orig/ssl/ssl_algs.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl_algs.c	2017-04-25 16:23:41.428030934 +0200
@@ -56,7 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/lhash.h>
 #include "ssl_locl.h"
@@ -65,7 +69,9 @@
 	{
 
 #ifndef OPENSSL_NO_DES
+#ifndef NO_SINGLE_DES
 	EVP_add_cipher(EVP_des_cbc());
+#endif
 	EVP_add_cipher(EVP_des_ede3_cbc());
 #endif
 #ifndef OPENSSL_NO_IDEA
diff -Naur openssl-1.0.0q.orig/ssl/ssl_asn1.c openssl-1.0.0q/ssl/ssl_asn1.c
--- openssl-1.0.0q.orig/ssl/ssl_asn1.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl_asn1.c	2017-04-25 16:23:41.433031010 +0200
@@ -82,8 +82,12 @@
  * OTHERWISE.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 #include <stdlib.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include "ssl_locl.h"
 #include <openssl/asn1_mac.h>
 #include <openssl/objects.h>
@@ -120,11 +124,11 @@
 	{
 #define LSIZE2 (sizeof(long)*2)
 	int v1=0,v2=0,v3=0,v4=0,v5=0,v7=0,v8=0;
-	unsigned char buf[4],ibuf1[LSIZE2],ibuf2[LSIZE2];
-	unsigned char ibuf3[LSIZE2],ibuf4[LSIZE2],ibuf5[LSIZE2];
+	unsigned char buf[4],ibuf1[LSIZE2],ibuf2[LSIZE2];        /* ARRAY OK 2009-09-14 */
+	unsigned char ibuf3[LSIZE2],ibuf4[LSIZE2],ibuf5[LSIZE2]; /* ARRAY OK 2009-09-14 */
 #ifndef OPENSSL_NO_TLSEXT
 	int v6=0,v9=0,v10=0;
-	unsigned char ibuf6[LSIZE2];
+	unsigned char ibuf6[LSIZE2];                             /* ARRAY OK 2009-09-14 */
 #endif
 #ifndef OPENSSL_NO_COMP
 	unsigned char cbuf;
diff -Naur openssl-1.0.0q.orig/ssl/ssl_cert.c openssl-1.0.0q/ssl/ssl_cert.c
--- openssl-1.0.0q.orig/ssl/ssl_cert.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl_cert.c	2017-04-25 16:23:41.443030885 +0200
@@ -114,14 +114,17 @@
  * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
 
-#include "e_os.h"
+#include <openssl/e_os.h>
 #ifndef NO_SYS_TYPES_H
 # include <sys/types.h>
 #endif
+#endif /* !OPERA_SMALL_VERSION */
 
-#include "o_dir.h"
+#include <openssl/cryptlib.h>
+/* #include "o_dir.h" */
 #include <openssl/objects.h>
 #include <openssl/bio.h>
 #include <openssl/pem.h>
@@ -148,7 +151,7 @@
 		if (ssl_x509_store_ctx_idx < 0)
 			{
 			ssl_x509_store_ctx_idx=X509_STORE_CTX_get_ex_new_index(
-				0,"SSL for verify callback",NULL,NULL,NULL);
+				0,(void*)"SSL for verify callback",NULL,NULL,NULL);
 			}
 		}
 
@@ -170,7 +173,7 @@
 		SSLerr(SSL_F_SSL_CERT_NEW,ERR_R_MALLOC_FAILURE);
 		return(NULL);
 		}
-	memset(ret,0,sizeof(CERT));
+	op_memset(ret,0,sizeof(CERT));
 
 	ret->key= &(ret->pkeys[SSL_PKEY_RSA_ENC]);
 	ret->references=1;
@@ -190,7 +193,7 @@
 		return(NULL);
 		}
 
-	memset(ret, 0, sizeof(CERT));
+	op_memset(ret, 0, sizeof(CERT));
 
 	ret->key = &ret->pkeys[cert->key - &cert->pkeys[0]];
 	/* or ret->key = ret->pkeys + (cert->key - cert->pkeys),
@@ -386,14 +389,14 @@
 	{
 	SESS_CERT *ret;
 
-	ret = OPENSSL_malloc(sizeof *ret);
+	ret = (SESS_CERT*)OPENSSL_malloc(sizeof *ret);
 	if (ret == NULL)
 		{
 		SSLerr(SSL_F_SSL_SESS_CERT_NEW, ERR_R_MALLOC_FAILURE);
 		return NULL;
 		}
 
-	memset(ret, 0 ,sizeof *ret);
+	op_memset(ret, 0 ,sizeof *ret);
 	ret->peer_key = &(ret->peer_pkeys[SSL_PKEY_RSA_ENC]);
 	ret->references = 1;
 
@@ -682,6 +685,7 @@
 	}
 #endif
 
+#ifndef OPERA_SMALL_VERSION
 /*!
  * Add a file of certs to a stack.
  * \param stack the stack to add to.
@@ -767,7 +771,7 @@
 
 	while((filename = OPENSSL_DIR_read(&d, dir)))
 		{
-		char buf[1024];
+		char buf[1024]; /* ARRAY OK 2009-09-14 */
 		int r;
 
 		if(strlen(dir)+strlen(filename)+2 > sizeof buf)
@@ -802,4 +806,5 @@
 	CRYPTO_w_unlock(CRYPTO_LOCK_READDIR);
 	return ret;
 	}
+#endif /* OPERA_SMALL_VERSION */
 
diff -Naur openssl-1.0.0q.orig/ssl/ssl_ciph.c openssl-1.0.0q/ssl/ssl_ciph.c
--- openssl-1.0.0q.orig/ssl/ssl_ciph.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl_ciph.c	2017-04-25 16:23:41.444031571 +0200
@@ -140,7 +140,11 @@
  * OTHERWISE.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #ifndef OPENSSL_NO_COMP
 #include <openssl/comp.h>
@@ -536,7 +540,11 @@
 	else
 		{
 		if (i == SSL_ENC_NULL_IDX)
+#ifdef OPERA_SMALL_VERSION
+			*enc=NULL;
+#else
 			*enc=EVP_enc_null();
+#endif
 		else
 			*enc=ssl_cipher_methods[i];
 		}
@@ -997,7 +1005,7 @@
 		curr = curr->next;
 		}
 
-	number_uses = OPENSSL_malloc((max_strength_bits + 1) * sizeof(int));
+	number_uses = (int*)OPENSSL_malloc((max_strength_bits + 1) * sizeof(int));
 	if (!number_uses)
 		{
 		SSLerr(SSL_F_SSL_CIPHER_STRENGTH_SORT,ERR_R_MALLOC_FAILURE);
@@ -1131,7 +1139,7 @@
 			cipher_id = 0;
 			while (ca_list[j])
 				{
-				if (!strncmp(buf, ca_list[j]->name, buflen) &&
+				if (!op_strncmp(buf, ca_list[j]->name, buflen) &&
 				    (ca_list[j]->name[buflen] == '\0'))
 					{
 					found = 1;
@@ -1374,7 +1382,7 @@
 	 */
 	num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER);
 	num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
-	ca_list = OPENSSL_malloc(sizeof(SSL_CIPHER *) * num_of_alias_max);
+	ca_list = (const SSL_CIPHER **)OPENSSL_malloc(sizeof(SSL_CIPHER *) * num_of_alias_max);
 	if (ca_list == NULL)
 		{
 		OPENSSL_free(co_list);
@@ -1391,7 +1399,7 @@
 	 */
 	ok = 1;
 	rule_p = rule_str;
-	if (strncmp(rule_str,"DEFAULT",7) == 0)
+	if (op_strncmp(rule_str,"DEFAULT",7) == 0)
 		{
 		ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
 			&head, &tail, ca_list);
@@ -1626,7 +1634,7 @@
 	if (buf == NULL)
 		{
 		len=128;
-		buf=OPENSSL_malloc(len);
+		buf=(char*)OPENSSL_malloc(len);
 		if (buf == NULL) return("OPENSSL_malloc Error");
 		}
 	else if (len < 128)
diff -Naur openssl-1.0.0q.orig/ssl/ssl_lib.c openssl-1.0.0q/ssl/ssl_lib.c
--- openssl-1.0.0q.orig/ssl/ssl_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl_lib.c	2017-04-25 16:23:41.446030149 +0200
@@ -142,10 +142,14 @@
  * OTHERWISE.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #ifdef REF_CHECK
 #  include <assert.h>
 #endif
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include "ssl_locl.h"
 #include "kssl_lcl.h"
 #include <openssl/objects.h>
@@ -286,7 +290,7 @@
 
 	s=(SSL *)OPENSSL_malloc(sizeof(SSL));
 	if (s == NULL) goto err;
-	memset(s,0,sizeof(SSL));
+	op_memset(s,0,sizeof(SSL));
 
 #ifndef	OPENSSL_NO_KRB5
 	s->kssl_ctx = kssl_ctx_new();
@@ -324,7 +328,7 @@
 #endif
 	s->sid_ctx_length=ctx->sid_ctx_length;
 	OPENSSL_assert(s->sid_ctx_length <= sizeof s->sid_ctx);
-	memcpy(&s->sid_ctx,&ctx->sid_ctx,sizeof(s->sid_ctx));
+	op_memcpy(&s->sid_ctx,&ctx->sid_ctx,sizeof(s->sid_ctx));
 	s->verify_callback=ctx->default_verify_callback;
 	s->generate_session_id=ctx->generate_session_id;
 
@@ -391,7 +395,7 @@
 	return 0;
 	}
     ctx->sid_ctx_length=sid_ctx_len;
-    memcpy(ctx->sid_ctx,sid_ctx,sid_ctx_len);
+    op_memcpy(ctx->sid_ctx,sid_ctx,sid_ctx_len);
 
     return 1;
     }
@@ -405,7 +409,7 @@
 	return 0;
 	}
     ssl->sid_ctx_length=sid_ctx_len;
-    memcpy(ssl->sid_ctx,sid_ctx,sid_ctx_len);
+    op_memcpy(ssl->sid_ctx,sid_ctx,sid_ctx_len);
 
     return 1;
     }
@@ -441,7 +445,7 @@
 
 	r.ssl_version = ssl->version;
 	r.session_id_length = id_len;
-	memcpy(r.session_id, id, id_len);
+	op_memcpy(r.session_id, id, id_len);
 	/* NB: SSLv2 always uses a fixed 16-byte session ID, so even if a
 	 * callback is calling us to check the uniqueness of a shorter ID, it
 	 * must be compared as a padded-out ID because that is what it will be
@@ -449,7 +453,7 @@
 	if((r.ssl_version == SSL2_VERSION) &&
 			(id_len < SSL2_SSL_SESSION_ID_LENGTH))
 		{
-		memset(r.session_id + id_len, 0,
+		op_memset(r.session_id + id_len, 0,
 			SSL2_SSL_SESSION_ID_LENGTH - id_len);
 		r.session_id_length = SSL2_SSL_SESSION_ID_LENGTH;
 		}
@@ -717,7 +721,7 @@
 		ret = s->s3->tmp.finish_md_len;
 		if (count > ret)
 			count = ret;
-		memcpy(buf, s->s3->tmp.finish_md, count);
+		op_memcpy(buf, s->s3->tmp.finish_md, count);
 		}
 	return ret;
 	}
@@ -732,7 +736,7 @@
 		ret = s->s3->tmp.peer_finish_md_len;
 		if (count > ret)
 			count = ret;
-		memcpy(buf, s->s3->tmp.peer_finish_md, count);
+		op_memcpy(buf, s->s3->tmp.peer_finish_md, count);
 		}
 	return ret;
 	}
@@ -864,6 +868,7 @@
 	SSL_set_session_id_context(t,f->sid_ctx,f->sid_ctx_length);
 	}
 
+#ifdef LIBOPEAY_PKCS12_SUPPORT
 /* Fix this so it checks all the valid key/cert options */
 int SSL_CTX_check_private_key(const SSL_CTX *ctx)
 	{
@@ -908,6 +913,7 @@
 	return(X509_check_private_key(ssl->cert->key->x509,
 		ssl->cert->key->privatekey));
 	}
+#endif /* LIBOPEAY_PKCS12_SUPPORT */
 
 int SSL_accept(SSL *s)
 	{
@@ -1312,7 +1318,7 @@
 		int n;
 
 		c=sk_SSL_CIPHER_value(sk,i);
-		n=strlen(c->name);
+		n=op_strlen(c->name);
 		if (n+1 > len)
 			{
 			if (p != buf)
@@ -1320,7 +1326,7 @@
 			*p='\0';
 			return buf;
 			}
-		strcpy(p,c->name);
+		op_strcpy(p,c->name);
 		p+=n;
 		*(p++)=':';
 		len-=n+1;
@@ -1524,7 +1530,7 @@
 		return(1);
 	if (a->session_id_length != b->session_id_length)
 		return(1);
-	return(memcmp(a->session_id,b->session_id,a->session_id_length));
+	return(op_memcmp(a->session_id,b->session_id,a->session_id_length));
 	}
 
 /* These wrapper functions should remain rather than redeclaring
@@ -1553,7 +1559,7 @@
 	if (ret == NULL)
 		goto err;
 
-	memset(ret,0,sizeof(SSL_CTX));
+	op_memset(ret,0,sizeof(SSL_CTX));
 
 	ret->method=meth;
 
@@ -1571,7 +1577,7 @@
 	ret->get_session_cb=0;
 	ret->generate_session_id=0;
 
-	memset((char *)&ret->stats,0,sizeof(ret->stats));
+	op_memset((char *)&ret->stats,0,sizeof(ret->stats));
 
 	ret->references=1;
 	ret->quiet_shutdown=0;
@@ -1649,8 +1655,8 @@
 	ret->extra_certs=NULL;
 	/* No compression for DTLS */
 	if (meth->version != DTLS1_VERSION)
-		ret->comp_methods=SSL_COMP_get_compression_methods();
-
+		ret->comp_methods=(STACK_OF(SSL_COMP) *)SSL_COMP_get_compression_methods();
+ 
 	ret->max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH;
 
 #ifndef OPENSSL_NO_TLSEXT
@@ -1673,13 +1679,13 @@
 #endif
 #ifndef OPENSSL_NO_BUF_FREELISTS
 	ret->freelist_max_len = SSL_MAX_BUF_FREELIST_LEN_DEFAULT;
-	ret->rbuf_freelist = OPENSSL_malloc(sizeof(SSL3_BUF_FREELIST));
+	ret->rbuf_freelist = (struct ssl3_buf_freelist_st *)OPENSSL_malloc(sizeof(SSL3_BUF_FREELIST));
 	if (!ret->rbuf_freelist)
 		goto err;
 	ret->rbuf_freelist->chunklen = 0;
 	ret->rbuf_freelist->len = 0;
 	ret->rbuf_freelist->head = NULL;
-	ret->wbuf_freelist = OPENSSL_malloc(sizeof(SSL3_BUF_FREELIST));
+	ret->wbuf_freelist = (struct ssl3_buf_freelist_st *)OPENSSL_malloc(sizeof(SSL3_BUF_FREELIST));
 	if (!ret->wbuf_freelist)
 		{
 		OPENSSL_free(ret->rbuf_freelist);
diff -Naur openssl-1.0.0q.orig/ssl/ssl_locl.h openssl-1.0.0q/ssl/ssl_locl.h
--- openssl-1.0.0q.orig/ssl/ssl_locl.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl_locl.h	2017-04-25 16:23:41.447031673 +0200
@@ -147,7 +147,7 @@
 #include <string.h>
 #include <errno.h>
 
-#include "e_os.h"
+#include <openssl/e_os.h>
 
 #include <openssl/buffer.h>
 #ifndef OPENSSL_NO_COMP
diff -Naur openssl-1.0.0q.orig/ssl/ssl_rsa.c openssl-1.0.0q/ssl/ssl_rsa.c
--- openssl-1.0.0q.orig/ssl/ssl_rsa.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl_rsa.c	2017-04-25 16:23:41.448031241 +0200
@@ -56,7 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include "ssl_locl.h"
 #include <openssl/bio.h>
 #include <openssl/objects.h>
diff -Naur openssl-1.0.0q.orig/ssl/ssl_sess.c openssl-1.0.0q/ssl/ssl_sess.c
--- openssl-1.0.0q.orig/ssl/ssl_sess.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl_sess.c	2017-04-25 16:23:41.449030530 +0200
@@ -135,7 +135,11 @@
  * OTHERWISE.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/lhash.h>
 #include <openssl/rand.h>
 #ifndef OPENSSL_NO_ENGINE
@@ -195,7 +199,7 @@
 		SSLerr(SSL_F_SSL_SESSION_NEW,ERR_R_MALLOC_FAILURE);
 		return(0);
 		}
-	memset(ss,0,sizeof(SSL_SESSION));
+	op_memset(ss,0,sizeof(SSL_SESSION));
 
 	ss->verify_result = 1; /* avoid 0 (= X509_V_OK) just in case */
 	ss->references=1;
@@ -353,7 +357,7 @@
 			}
 		/* If the session length was shrunk and we're SSLv2, pad it */
 		if((tmp < ss->session_id_length) && (s->version == SSL2_VERSION))
-			memset(ss->session_id + tmp, 0, ss->session_id_length - tmp);
+			op_memset(ss->session_id + tmp, 0, ss->session_id_length - tmp);
 		else
 			ss->session_id_length = tmp;
 		/* Finally, check for a conflict */
@@ -414,7 +418,7 @@
 		SSL_SESSION_free(ss);
 		return 0;
 		}
-	memcpy(ss->sid_ctx,s->sid_ctx,s->sid_ctx_length);
+	op_memcpy(ss->sid_ctx,s->sid_ctx,s->sid_ctx_length);
 	ss->sid_ctx_length=s->sid_ctx_length;
 	s->session=ss;
 	ss->ssl_version=s->version;
@@ -500,7 +504,7 @@
 	/* Now ret is non-NULL, and we own one of its reference counts. */
 
 	if (ret->sid_ctx_length != s->sid_ctx_length
-	    || memcmp(ret->sid_ctx,s->sid_ctx,ret->sid_ctx_length))
+	    || op_memcmp(ret->sid_ctx,s->sid_ctx,ret->sid_ctx_length))
 		{
 		/* We've found the session named by the client, but we don't
 		 * want to use it in this context. */
@@ -764,7 +768,7 @@
                     session->krb5_client_princ_len > 0)
                 {
                     s->kssl_ctx->client_princ = (char *)OPENSSL_malloc(session->krb5_client_princ_len + 1);
-                    memcpy(s->kssl_ctx->client_princ,session->krb5_client_princ,
+                    op_memcpy(s->kssl_ctx->client_princ,session->krb5_client_princ,
                             session->krb5_client_princ_len);
                     s->kssl_ctx->client_princ[session->krb5_client_princ_len] = '\0';
                 }
@@ -868,7 +872,7 @@
 			s->tlsext_session_ticket = NULL;
 			}
 
-		s->tlsext_session_ticket = OPENSSL_malloc(sizeof(TLS_SESSION_TICKET_EXT) + ext_len);
+		s->tlsext_session_ticket = (TLS_SESSION_TICKET_EXT*)OPENSSL_malloc(sizeof(TLS_SESSION_TICKET_EXT) + ext_len);
 		if (!s->tlsext_session_ticket)
 			{
 			SSLerr(SSL_F_SSL_SET_SESSION_TICKET_EXT, ERR_R_MALLOC_FAILURE);
@@ -1092,4 +1096,6 @@
 	ctx->app_verify_cookie_cb=cb;
 	}
 
+#ifndef OPERA_SMALL_VERSION
 IMPLEMENT_PEM_rw(SSL_SESSION, SSL_SESSION, PEM_STRING_SSL_SESSION, SSL_SESSION)
+#endif // !OPERA_SMALL_VERSION
diff -Naur openssl-1.0.0q.orig/ssl/ssl_task.c openssl-1.0.0q/ssl/ssl_task.c
--- openssl-1.0.0q.orig/ssl/ssl_task.c	2015-01-15 15:43:49.000000000 +0100
+++ openssl-1.0.0q/ssl/ssl_task.c	2017-04-25 16:23:41.450030098 +0200
@@ -114,6 +114,9 @@
  * Author: Dave Jones
  * Date:   22-JUL-1996
  */
+
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <iodef.h>		/* VMS IO$_ definitions */
diff -Naur openssl-1.0.0q.orig/ssl/ssltest.c openssl-1.0.0q/ssl/ssltest.c
--- openssl-1.0.0q.orig/ssl/ssltest.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/ssltest.c	2017-04-25 16:23:41.451030225 +0200
@@ -140,6 +140,8 @@
  * OTHERWISE.
  */
 
+#error("/* ARRAY FILE UNUSED. CHECK ARRAYS BEFORE USING */")
+
 #define _BSD_SOURCE 1		/* Or gethostname won't be declared properly
 				   on Linux and GNU platforms. */
 
diff -Naur openssl-1.0.0q.orig/ssl/t1_clnt.c openssl-1.0.0q/ssl/t1_clnt.c
--- openssl-1.0.0q.orig/ssl/t1_clnt.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/t1_clnt.c	2017-04-25 16:23:41.452030353 +0200
@@ -56,7 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include "ssl_locl.h"
 #include <openssl/buffer.h>
 #include <openssl/rand.h>
diff -Naur openssl-1.0.0q.orig/ssl/t1_enc.c openssl-1.0.0q/ssl/t1_enc.c
--- openssl-1.0.0q.orig/ssl/t1_enc.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/t1_enc.c	2017-04-25 16:23:41.453030200 +0200
@@ -135,7 +135,11 @@
  * OTHERWISE.
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include "ssl_locl.h"
 #ifndef OPENSSL_NO_COMP
 #include <openssl/comp.h>
@@ -161,7 +165,7 @@
 	unsigned int j;
 	HMAC_CTX ctx;
 	HMAC_CTX ctx_tmp;
-	unsigned char A1[EVP_MAX_MD_SIZE];
+	unsigned char A1[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-09-14 alexeik */
 	unsigned int A1_len;
 	int ret = 0;
 	
@@ -174,15 +178,15 @@
 		goto err;
 	if (!HMAC_Init_ex(&ctx_tmp,sec,sec_len,md, NULL))
 		goto err;
-	if (seed1 != NULL && !HMAC_Update(&ctx,seed1,seed1_len))
+	if (seed1 != NULL && !HMAC_Update(&ctx,(const unsigned char *)seed1,seed1_len))
 		goto err;
-	if (seed2 != NULL && !HMAC_Update(&ctx,seed2,seed2_len))
+	if (seed2 != NULL && !HMAC_Update(&ctx,(const unsigned char *)seed2,seed2_len))
 		goto err;
-	if (seed3 != NULL && !HMAC_Update(&ctx,seed3,seed3_len))
+	if (seed3 != NULL && !HMAC_Update(&ctx,(const unsigned char *)seed3,seed3_len))
 		goto err;
-	if (seed4 != NULL && !HMAC_Update(&ctx,seed4,seed4_len))
+	if (seed4 != NULL && !HMAC_Update(&ctx,(const unsigned char *)seed4,seed4_len))
 		goto err;
-	if (seed5 != NULL && !HMAC_Update(&ctx,seed5,seed5_len))
+	if (seed5 != NULL && !HMAC_Update(&ctx,(const unsigned char *)seed5,seed5_len))
 		goto err;
 	if (!HMAC_Final(&ctx,A1,&A1_len))
 		goto err;
@@ -197,15 +201,15 @@
 			goto err;
 		if (!HMAC_Update(&ctx_tmp,A1,A1_len))
 			goto err;
-		if (seed1 != NULL && !HMAC_Update(&ctx,seed1,seed1_len))
+		if (seed1 != NULL && !HMAC_Update(&ctx,(const unsigned char *)seed1,seed1_len))
 			goto err;
-		if (seed2 != NULL && !HMAC_Update(&ctx,seed2,seed2_len))
+		if (seed2 != NULL && !HMAC_Update(&ctx,(const unsigned char *)seed2,seed2_len))
 			goto err;
-		if (seed3 != NULL && !HMAC_Update(&ctx,seed3,seed3_len))
+		if (seed3 != NULL && !HMAC_Update(&ctx,(const unsigned char *)seed3,seed3_len))
 			goto err;
-		if (seed4 != NULL && !HMAC_Update(&ctx,seed4,seed4_len))
+		if (seed4 != NULL && !HMAC_Update(&ctx,(const unsigned char *)seed4,seed4_len))
 			goto err;
-		if (seed5 != NULL && !HMAC_Update(&ctx,seed5,seed5_len))
+		if (seed5 != NULL && !HMAC_Update(&ctx,(const unsigned char *)seed5,seed5_len))
 			goto err;
 
 		if (olen > chunk)
@@ -363,7 +367,7 @@
 
 		if (s->enc_read_ctx != NULL)
 			reuse_dd = 1;
-		else if ((s->enc_read_ctx=OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL)
+		else if ((s->enc_read_ctx=(EVP_CIPHER_CTX *)OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL)
 			goto err;
 		else
 			/* make sure it's intialized in case we exit later with an error */
@@ -693,7 +697,7 @@
 
 	if ((s->session == NULL) || (ds == NULL) || (enc == NULL))
 		{
-		memmove(rec->data,rec->input,rec->length);
+		op_memmove(rec->data,rec->input,rec->length);
 		rec->input=rec->data;
 		ret = 1;
 		}
@@ -897,7 +901,7 @@
 		unsigned char dtlsseq[8],*p=dtlsseq;
 
 		s2n(send?ssl->d1->w_epoch:ssl->d1->r_epoch, p);
-		memcpy (p,&seq[2],6);
+		op_memcpy (p,&seq[2],6);
 
 		memcpy(header, dtlsseq, 8);
 		}
@@ -966,7 +970,7 @@
 int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
 	     int len)
 	{
-	unsigned char buff[SSL_MAX_MASTER_KEY_LENGTH];
+	unsigned char buff[SSL_MAX_MASTER_KEY_LENGTH]; /* ARRAY OK 2009-09-14 alexeik */
 	const void *co = NULL, *so = NULL;
 	int col = 0, sol = 0;
 
diff -Naur openssl-1.0.0q.orig/ssl/t1_lib.c openssl-1.0.0q/ssl/t1_lib.c
--- openssl-1.0.0q.orig/ssl/t1_lib.c	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/t1_lib.c	2017-04-25 16:23:41.454030048 +0200
@@ -109,7 +109,11 @@
  *
  */
 
+#ifndef OPERA_SMALL_VERSION
 #include <stdio.h>
+#endif /* !OPERA_SMALL_VERSION */
+
+#include <openssl/cryptlib.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/hmac.h>
@@ -312,7 +316,7 @@
 		/* hostname type, length and hostname */
 		*(ret++) = (unsigned char) TLSEXT_NAMETYPE_host_name;
 		s2n(size_str,ret);
-		memcpy(ret, s->tlsext_hostname, size_str);
+		op_memcpy(ret, s->tlsext_hostname, size_str);
 		ret+=size_str;
 		}
 
@@ -397,7 +401,7 @@
 			 s->tlsext_session_ticket->data)
 			{
 			ticklen = s->tlsext_session_ticket->length;
-			s->session->tlsext_tick = OPENSSL_malloc(ticklen);
+			s->session->tlsext_tick = (unsigned char*)OPENSSL_malloc(ticklen);
 			if (!s->session->tlsext_tick)
 				return NULL;
 			memcpy(s->session->tlsext_tick,
@@ -418,7 +422,7 @@
 		s2n(ticklen,ret);
 		if (ticklen)
 			{
-			memcpy(ret, s->session->tlsext_tick, ticklen);
+			op_memcpy(ret, s->session->tlsext_tick, ticklen);
 			ret += ticklen;
 			}
 		}
@@ -811,14 +815,14 @@
 							*al = TLS1_AD_UNRECOGNIZED_NAME;
 							return 0;
 							}
-						if ((s->session->tlsext_hostname = OPENSSL_malloc(len+1)) == NULL)
+						if ((s->session->tlsext_hostname = (char *)OPENSSL_malloc(len+1)) == NULL)
 							{
 							*al = TLS1_AD_INTERNAL_ERROR;
 							return 0;
 							}
-						memcpy(s->session->tlsext_hostname, sdata, len);
+						op_memcpy(s->session->tlsext_hostname, sdata, len);
 						s->session->tlsext_hostname[len]='\0';
-						if (strlen(s->session->tlsext_hostname) != len) {
+						if (op_strlen(s->session->tlsext_hostname) != len) {
 							OPENSSL_free(s->session->tlsext_hostname);
 							s->session->tlsext_hostname = NULL;
 							*al = TLS1_AD_UNRECOGNIZED_NAME;
@@ -1783,7 +1787,7 @@
 	unsigned char *sdec;
 	const unsigned char *p;
 	int slen, mlen, renew_ticket = 0;
-	unsigned char tick_hmac[EVP_MAX_MD_SIZE];
+	unsigned char tick_hmac[EVP_MAX_MD_SIZE]; /* ARRAY OK 2009-09-15 alexeik */
 	HMAC_CTX hctx;
 	EVP_CIPHER_CTX ctx;
 	SSL_CTX *tctx = s->initial_ctx;
@@ -1829,7 +1833,7 @@
 	HMAC_Update(&hctx, etick, eticklen);
 	HMAC_Final(&hctx, tick_hmac, NULL);
 	HMAC_CTX_cleanup(&hctx);
-	if (CRYPTO_memcmp(tick_hmac, etick + eticklen, mlen))
+	if (op_memcmp(tick_hmac, etick + eticklen, mlen))
 		{
 		EVP_CIPHER_CTX_cleanup(&ctx);
 		goto tickerr;
@@ -1838,7 +1842,7 @@
 	/* Move p after IV to start of encrypted ticket, update length */
 	p = etick + 16 + EVP_CIPHER_CTX_iv_length(&ctx);
 	eticklen -= 16 + EVP_CIPHER_CTX_iv_length(&ctx);
-	sdec = OPENSSL_malloc(eticklen);
+	sdec = (unsigned char*)OPENSSL_malloc(eticklen);
 	if (!sdec)
 		{
 		EVP_CIPHER_CTX_cleanup(&ctx);
@@ -1865,7 +1869,7 @@
  		 * as required by standard.
  		 */
 		if (sesslen)
-			memcpy(sess->session_id, sess_id, sesslen);
+			op_memcpy(sess->session_id, sess_id, sesslen);
 		sess->session_id_length = sesslen;
 		*psess = sess;
 		s->tlsext_ticket_expected = renew_ticket;
diff -Naur openssl-1.0.0q.orig/ssl/tls1.h openssl-1.0.0q/ssl/tls1.h
--- openssl-1.0.0q.orig/ssl/tls1.h	2015-01-15 15:54:59.000000000 +0100
+++ openssl-1.0.0q/ssl/tls1.h	2017-04-25 16:23:41.455030175 +0200
@@ -220,7 +220,7 @@
 #if 0 /* will have to be provided externally for now ,
        * i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183
        * using whatever extension number you'd like to try */
-# define TLSEXT_TYPE_opaque_prf_input		?? */
+# define TLSEXT_TYPE_opaque_prf_input		??
 #endif
 
 /* Temporary extension type */
diff -Naur openssl-1.0.0q.orig/wrapper_template.cpp openssl-1.0.0q/wrapper_template.cpp
--- openssl-1.0.0q.orig/wrapper_template.cpp	1970-01-01 01:00:00.000000000 +0100
+++ openssl-1.0.0q/wrapper_template.cpp	2017-04-25 16:23:41.455030175 +0200
@@ -0,0 +1,12 @@
+// <copyright header>
+
+// <autogenerated modules/libopeay/create_wrappers.py>
+
+// <header>
+
+// <compileif start>
+// <extern C start>
+#include "modules/libopeay/openssl/cryptlib.h"
+// <original filename>
+// <extern C end>
+// <compileif end>
