summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuki Yamaguchi <[email protected]>2024-10-30 04:03:05 +0900
committergit <[email protected]>2024-12-07 07:55:47 +0000
commit1df63d9451459209c00f5e8db033f18d145cc741 (patch)
treece5974853c7e43ed0d3b47042368fcc0fd267dc8
parentcbe7bfd9a81273c04a40f1ff19f516f8db31ac53 (diff)
[ruby/openssl] Mark variables and functions as static whenever possible
https://github.com/ruby/openssl/commit/85d6b7f192
-rw-r--r--ext/openssl/ossl.c2
-rw-r--r--ext/openssl/ossl_asn1.c34
-rw-r--r--ext/openssl/ossl_asn1.h18
-rw-r--r--ext/openssl/ossl_bn.c8
-rw-r--r--ext/openssl/ossl_bn.h1
-rw-r--r--ext/openssl/ossl_cipher.c4
-rw-r--r--ext/openssl/ossl_cipher.h3
-rw-r--r--ext/openssl/ossl_digest.c8
-rw-r--r--ext/openssl/ossl_digest.h3
-rw-r--r--ext/openssl/ossl_engine.c4
-rw-r--r--ext/openssl/ossl_engine.h3
-rw-r--r--ext/openssl/ossl_hmac.c4
-rw-r--r--ext/openssl/ossl_hmac.h3
-rw-r--r--ext/openssl/ossl_ns_spki.c6
-rw-r--r--ext/openssl/ossl_ns_spki.h4
-rw-r--r--ext/openssl/ossl_ocsp.c14
-rw-r--r--ext/openssl/ossl_ocsp.h7
-rw-r--r--ext/openssl/ossl_pkcs12.c4
-rw-r--r--ext/openssl/ossl_pkcs12.h3
-rw-r--r--ext/openssl/ossl_pkey.h15
-rw-r--r--ext/openssl/ossl_pkey_dh.c2
-rw-r--r--ext/openssl/ossl_pkey_dsa.c2
-rw-r--r--ext/openssl/ossl_pkey_ec.c10
-rw-r--r--ext/openssl/ossl_pkey_rsa.c2
-rw-r--r--ext/openssl/ossl_rand.c4
-rw-r--r--ext/openssl/ossl_rand.h3
-rw-r--r--ext/openssl/ossl_ssl.c2
-rw-r--r--ext/openssl/ossl_x509.h19
-rw-r--r--ext/openssl/ossl_x509attr.c2
-rw-r--r--ext/openssl/ossl_x509cert.c2
-rw-r--r--ext/openssl/ossl_x509crl.c4
-rw-r--r--ext/openssl/ossl_x509ext.c4
-rw-r--r--ext/openssl/ossl_x509name.c4
-rw-r--r--ext/openssl/ossl_x509req.c4
-rw-r--r--ext/openssl/ossl_x509revoked.c2
-rw-r--r--ext/openssl/ossl_x509store.c6
36 files changed, 71 insertions, 149 deletions
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index 59ad7d19a4..24272bff08 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -355,7 +355,7 @@ ossl_clear_error(void)
* Any errors you see here are probably due to a bug in Ruby's OpenSSL
* implementation.
*/
-VALUE
+static VALUE
ossl_get_errors(VALUE _)
{
VALUE ary;
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index f57657c802..ea3ec2f210 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -163,23 +163,23 @@ VALUE mASN1;
VALUE eASN1Error;
VALUE cASN1Data;
-VALUE cASN1Primitive;
-VALUE cASN1Constructive;
-
-VALUE cASN1EndOfContent;
-VALUE cASN1Boolean; /* BOOLEAN */
-VALUE cASN1Integer, cASN1Enumerated; /* INTEGER */
-VALUE cASN1BitString; /* BIT STRING */
-VALUE cASN1OctetString, cASN1UTF8String; /* STRINGs */
-VALUE cASN1NumericString, cASN1PrintableString;
-VALUE cASN1T61String, cASN1VideotexString;
-VALUE cASN1IA5String, cASN1GraphicString;
-VALUE cASN1ISO64String, cASN1GeneralString;
-VALUE cASN1UniversalString, cASN1BMPString;
-VALUE cASN1Null; /* NULL */
-VALUE cASN1ObjectId; /* OBJECT IDENTIFIER */
-VALUE cASN1UTCTime, cASN1GeneralizedTime; /* TIME */
-VALUE cASN1Sequence, cASN1Set; /* CONSTRUCTIVE */
+static VALUE cASN1Primitive;
+static VALUE cASN1Constructive;
+
+static VALUE cASN1EndOfContent;
+static VALUE cASN1Boolean; /* BOOLEAN */
+static VALUE cASN1Integer, cASN1Enumerated; /* INTEGER */
+static VALUE cASN1BitString; /* BIT STRING */
+static VALUE cASN1OctetString, cASN1UTF8String; /* STRINGs */
+static VALUE cASN1NumericString, cASN1PrintableString;
+static VALUE cASN1T61String, cASN1VideotexString;
+static VALUE cASN1IA5String, cASN1GraphicString;
+static VALUE cASN1ISO64String, cASN1GeneralString;
+static VALUE cASN1UniversalString, cASN1BMPString;
+static VALUE cASN1Null; /* NULL */
+static VALUE cASN1ObjectId; /* OBJECT IDENTIFIER */
+static VALUE cASN1UTCTime, cASN1GeneralizedTime; /* TIME */
+static VALUE cASN1Sequence, cASN1Set; /* CONSTRUCTIVE */
static VALUE sym_IMPLICIT, sym_EXPLICIT;
static VALUE sym_UNIVERSAL, sym_APPLICATION, sym_CONTEXT_SPECIFIC, sym_PRIVATE;
diff --git a/ext/openssl/ossl_asn1.h b/ext/openssl/ossl_asn1.h
index 3a99400e18..3b689c0ee7 100644
--- a/ext/openssl/ossl_asn1.h
+++ b/ext/openssl/ossl_asn1.h
@@ -38,24 +38,6 @@ extern VALUE mASN1;
extern VALUE eASN1Error;
extern VALUE cASN1Data;
-extern VALUE cASN1Primitive;
-extern VALUE cASN1Constructive;
-
-extern VALUE cASN1Boolean; /* BOOLEAN */
-extern VALUE cASN1Integer, cASN1Enumerated; /* INTEGER */
-extern VALUE cASN1BitString; /* BIT STRING */
-extern VALUE cASN1OctetString, cASN1UTF8String; /* STRINGs */
-extern VALUE cASN1NumericString, cASN1PrintableString;
-extern VALUE cASN1T61String, cASN1VideotexString;
-extern VALUE cASN1IA5String, cASN1GraphicString;
-extern VALUE cASN1ISO64String, cASN1GeneralString;
-extern VALUE cASN1UniversalString, cASN1BMPString;
-extern VALUE cASN1Null; /* NULL */
-extern VALUE cASN1ObjectId; /* OBJECT IDENTIFIER */
-extern VALUE cASN1UTCTime, cASN1GeneralizedTime; /* TIME */
-extern VALUE cASN1Sequence, cASN1Set; /* CONSTRUCTIVE */
-
-extern VALUE cASN1EndOfContent; /* END OF CONTENT */
void Init_ossl_asn1(void);
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c
index fe234a97aa..58ad83dd71 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -49,7 +49,7 @@ VALUE cBN;
*
* Generic Error for all of OpenSSL::BN (big num)
*/
-VALUE eBNError;
+static VALUE eBNError;
/*
* Public
@@ -152,19 +152,19 @@ ossl_bn_value_ptr(volatile VALUE *ptr)
*/
#ifdef HAVE_RB_EXT_RACTOR_SAFE
-void
+static void
ossl_bn_ctx_free(void *ptr)
{
BN_CTX *ctx = (BN_CTX *)ptr;
BN_CTX_free(ctx);
}
-struct rb_ractor_local_storage_type ossl_bn_ctx_key_type = {
+static struct rb_ractor_local_storage_type ossl_bn_ctx_key_type = {
NULL, // mark
ossl_bn_ctx_free,
};
-rb_ractor_local_key_t ossl_bn_ctx_key;
+static rb_ractor_local_key_t ossl_bn_ctx_key;
BN_CTX *
ossl_bn_ctx_get(void)
diff --git a/ext/openssl/ossl_bn.h b/ext/openssl/ossl_bn.h
index 800f84cb1e..0c186bd1c5 100644
--- a/ext/openssl/ossl_bn.h
+++ b/ext/openssl/ossl_bn.h
@@ -11,7 +11,6 @@
#define _OSSL_BN_H_
extern VALUE cBN;
-extern VALUE eBNError;
BN_CTX *ossl_bn_ctx_get(void);
#define ossl_bn_ctx ossl_bn_ctx_get()
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c
index cc0114f579..5a491d89ed 100644
--- a/ext/openssl/ossl_cipher.c
+++ b/ext/openssl/ossl_cipher.c
@@ -30,8 +30,8 @@
/*
* Classes
*/
-VALUE cCipher;
-VALUE eCipherError;
+static VALUE cCipher;
+static VALUE eCipherError;
static ID id_auth_tag_len, id_key_set;
static VALUE ossl_cipher_alloc(VALUE klass);
diff --git a/ext/openssl/ossl_cipher.h b/ext/openssl/ossl_cipher.h
index 07b50c3bd5..12da68ca3e 100644
--- a/ext/openssl/ossl_cipher.h
+++ b/ext/openssl/ossl_cipher.h
@@ -10,9 +10,6 @@
#if !defined(_OSSL_CIPHER_H_)
#define _OSSL_CIPHER_H_
-extern VALUE cCipher;
-extern VALUE eCipherError;
-
const EVP_CIPHER *ossl_evp_get_cipherbyname(VALUE);
VALUE ossl_cipher_new(const EVP_CIPHER *);
void Init_ossl_cipher(void);
diff --git a/ext/openssl/ossl_digest.c b/ext/openssl/ossl_digest.c
index 00ec8931ab..029d9d7f36 100644
--- a/ext/openssl/ossl_digest.c
+++ b/ext/openssl/ossl_digest.c
@@ -19,8 +19,8 @@
/*
* Classes
*/
-VALUE cDigest;
-VALUE eDigestError;
+static VALUE cDigest;
+static VALUE eDigestError;
static VALUE ossl_digest_alloc(VALUE klass);
@@ -96,7 +96,7 @@ ossl_digest_alloc(VALUE klass)
return TypedData_Wrap_Struct(klass, &ossl_digest_type, 0);
}
-VALUE ossl_digest_update(VALUE, VALUE);
+static VALUE ossl_digest_update(VALUE, VALUE);
/*
* call-seq:
@@ -225,7 +225,7 @@ ossl_digest_reset(VALUE self)
* result = digest.digest
*
*/
-VALUE
+static VALUE
ossl_digest_update(VALUE self, VALUE data)
{
EVP_MD_CTX *ctx;
diff --git a/ext/openssl/ossl_digest.h b/ext/openssl/ossl_digest.h
index 99771b8ae1..588a0c6f57 100644
--- a/ext/openssl/ossl_digest.h
+++ b/ext/openssl/ossl_digest.h
@@ -10,9 +10,6 @@
#if !defined(_OSSL_DIGEST_H_)
#define _OSSL_DIGEST_H_
-extern VALUE cDigest;
-extern VALUE eDigestError;
-
const EVP_MD *ossl_evp_get_digestbyname(VALUE);
VALUE ossl_digest_new(const EVP_MD *);
void Init_ossl_digest(void);
diff --git a/ext/openssl/ossl_engine.c b/ext/openssl/ossl_engine.c
index 294d58adef..f19be7f495 100644
--- a/ext/openssl/ossl_engine.c
+++ b/ext/openssl/ossl_engine.c
@@ -37,12 +37,12 @@
*
* See also, https://www.openssl.org/docs/crypto/engine.html
*/
-VALUE cEngine;
+static VALUE cEngine;
/* Document-class: OpenSSL::Engine::EngineError
*
* This is the generic exception for OpenSSL::Engine related errors
*/
-VALUE eEngineError;
+static VALUE eEngineError;
/*
* Private
diff --git a/ext/openssl/ossl_engine.h b/ext/openssl/ossl_engine.h
index f6f4ff4c1f..cedcebb772 100644
--- a/ext/openssl/ossl_engine.h
+++ b/ext/openssl/ossl_engine.h
@@ -11,9 +11,6 @@
#if !defined(OSSL_ENGINE_H)
#define OSSL_ENGINE_H
-extern VALUE cEngine;
-extern VALUE eEngineError;
-
void Init_ossl_engine(void);
#endif /* OSSL_ENGINE_H */
diff --git a/ext/openssl/ossl_hmac.c b/ext/openssl/ossl_hmac.c
index b1163f6127..c1875005c3 100644
--- a/ext/openssl/ossl_hmac.c
+++ b/ext/openssl/ossl_hmac.c
@@ -21,8 +21,8 @@
/*
* Classes
*/
-VALUE cHMAC;
-VALUE eHMACError;
+static VALUE cHMAC;
+static VALUE eHMACError;
/*
* Public
diff --git a/ext/openssl/ossl_hmac.h b/ext/openssl/ossl_hmac.h
index 17427587b2..e5bed37c9f 100644
--- a/ext/openssl/ossl_hmac.h
+++ b/ext/openssl/ossl_hmac.h
@@ -10,9 +10,6 @@
#if !defined(_OSSL_HMAC_H_)
#define _OSSL_HMAC_H_
-extern VALUE cHMAC;
-extern VALUE eHMACError;
-
void Init_ossl_hmac(void);
#endif /* _OSSL_HMAC_H_ */
diff --git a/ext/openssl/ossl_ns_spki.c b/ext/openssl/ossl_ns_spki.c
index cc0b4252d2..445aeeba15 100644
--- a/ext/openssl/ossl_ns_spki.c
+++ b/ext/openssl/ossl_ns_spki.c
@@ -27,9 +27,9 @@
/*
* Classes
*/
-VALUE mNetscape;
-VALUE cSPKI;
-VALUE eSPKIError;
+static VALUE mNetscape;
+static VALUE cSPKI;
+static VALUE eSPKIError;
/*
* Public functions
diff --git a/ext/openssl/ossl_ns_spki.h b/ext/openssl/ossl_ns_spki.h
index 20d6857682..043b6cdb66 100644
--- a/ext/openssl/ossl_ns_spki.h
+++ b/ext/openssl/ossl_ns_spki.h
@@ -10,10 +10,6 @@
#if !defined(_OSSL_NS_SPKI_H_)
#define _OSSL_NS_SPKI_H_
-extern VALUE mNetscape;
-extern VALUE cSPKI;
-extern VALUE eSPKIError;
-
void Init_ossl_ns_spki(void);
#endif /* _OSSL_NS_SPKI_H_ */
diff --git a/ext/openssl/ossl_ocsp.c b/ext/openssl/ossl_ocsp.c
index 9796d44a26..156cc2cbce 100644
--- a/ext/openssl/ossl_ocsp.c
+++ b/ext/openssl/ossl_ocsp.c
@@ -67,13 +67,13 @@
if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
} while (0)
-VALUE mOCSP;
-VALUE eOCSPError;
-VALUE cOCSPReq;
-VALUE cOCSPRes;
-VALUE cOCSPBasicRes;
-VALUE cOCSPSingleRes;
-VALUE cOCSPCertId;
+static VALUE mOCSP;
+static VALUE eOCSPError;
+static VALUE cOCSPReq;
+static VALUE cOCSPRes;
+static VALUE cOCSPBasicRes;
+static VALUE cOCSPSingleRes;
+static VALUE cOCSPCertId;
static void
ossl_ocsp_request_free(void *ptr)
diff --git a/ext/openssl/ossl_ocsp.h b/ext/openssl/ossl_ocsp.h
index 07da7d1684..becd70ffed 100644
--- a/ext/openssl/ossl_ocsp.h
+++ b/ext/openssl/ossl_ocsp.h
@@ -11,13 +11,6 @@
#if !defined(_OSSL_OCSP_H_)
#define _OSSL_OCSP_H_
-#if !defined(OPENSSL_NO_OCSP)
-extern VALUE mOCSP;
-extern VALUE cOCSPReq;
-extern VALUE cOCSPRes;
-extern VALUE cOCSPBasicRes;
-#endif
-
void Init_ossl_ocsp(void);
#endif /* _OSSL_OCSP_H_ */
diff --git a/ext/openssl/ossl_pkcs12.c b/ext/openssl/ossl_pkcs12.c
index 1fcb1a88d3..ea7d14e782 100644
--- a/ext/openssl/ossl_pkcs12.c
+++ b/ext/openssl/ossl_pkcs12.c
@@ -27,8 +27,8 @@
/*
* Classes
*/
-VALUE cPKCS12;
-VALUE ePKCS12Error;
+static VALUE cPKCS12;
+static VALUE ePKCS12Error;
/*
* Private
diff --git a/ext/openssl/ossl_pkcs12.h b/ext/openssl/ossl_pkcs12.h
index d4003e81c9..6d2cd901cb 100644
--- a/ext/openssl/ossl_pkcs12.h
+++ b/ext/openssl/ossl_pkcs12.h
@@ -5,9 +5,6 @@
#if !defined(_OSSL_PKCS12_H_)
#define _OSSL_PKCS12_H_
-extern VALUE cPKCS12;
-extern VALUE ePKCS12Error;
-
void Init_ossl_pkcs12(void);
#endif /* _OSSL_PKCS12_H_ */
diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h
index 37d828e048..fdc5e94aed 100644
--- a/ext/openssl/ossl_pkey.h
+++ b/ext/openssl/ossl_pkey.h
@@ -53,35 +53,24 @@ void Init_ossl_pkey(void);
* RSA
*/
extern VALUE cRSA;
-extern VALUE eRSAError;
-
void Init_ossl_rsa(void);
/*
* DSA
*/
extern VALUE cDSA;
-extern VALUE eDSAError;
-
void Init_ossl_dsa(void);
/*
* DH
*/
extern VALUE cDH;
-extern VALUE eDHError;
-
void Init_ossl_dh(void);
/*
* EC
*/
extern VALUE cEC;
-extern VALUE eECError;
-extern VALUE cEC_GROUP;
-extern VALUE eEC_GROUP;
-extern VALUE cEC_POINT;
-extern VALUE eEC_POINT;
VALUE ossl_ec_new(EVP_PKEY *);
void Init_ossl_ec(void);
@@ -136,7 +125,7 @@ static VALUE ossl_##_keytype##_set_##_group(VALUE self, VALUE v1, VALUE v2, VALU
BN_clear_free(bn1); \
BN_clear_free(bn2); \
BN_clear_free(bn3); \
- ossl_raise(eBNError, NULL); \
+ ossl_raise(ePKeyError, "BN_dup"); \
} \
\
if (!_type##_set0_##_group(obj, bn1, bn2, bn3)) { \
@@ -164,7 +153,7 @@ static VALUE ossl_##_keytype##_set_##_group(VALUE self, VALUE v1, VALUE v2) \
(orig_bn2 && !(bn2 = BN_dup(orig_bn2)))) { \
BN_clear_free(bn1); \
BN_clear_free(bn2); \
- ossl_raise(eBNError, NULL); \
+ ossl_raise(ePKeyError, "BN_dup"); \
} \
\
if (!_type##_set0_##_group(obj, bn1, bn2)) { \
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c
index 00699b9b07..a73dd7d4ff 100644
--- a/ext/openssl/ossl_pkey_dh.c
+++ b/ext/openssl/ossl_pkey_dh.c
@@ -27,7 +27,7 @@
* Classes
*/
VALUE cDH;
-VALUE eDHError;
+static VALUE eDHError;
/*
* Private
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index a7598d1e80..c648cc6426 100644
--- a/ext/openssl/ossl_pkey_dsa.c
+++ b/ext/openssl/ossl_pkey_dsa.c
@@ -41,7 +41,7 @@ DSA_PRIVATE(VALUE obj, OSSL_3_const DSA *dsa)
* Classes
*/
VALUE cDSA;
-VALUE eDSAError;
+static VALUE eDSAError;
/*
* Private
diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c
index 10f44edf1f..9852be6d31 100644
--- a/ext/openssl/ossl_pkey_ec.c
+++ b/ext/openssl/ossl_pkey_ec.c
@@ -41,11 +41,11 @@ static const rb_data_type_t ossl_ec_point_type;
} while (0)
VALUE cEC;
-VALUE eECError;
-VALUE cEC_GROUP;
-VALUE eEC_GROUP;
-VALUE cEC_POINT;
-VALUE eEC_POINT;
+static VALUE eECError;
+static VALUE cEC_GROUP;
+static VALUE eEC_GROUP;
+static VALUE cEC_POINT;
+static VALUE eEC_POINT;
static ID s_GFp, s_GF2m;
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 7d986989e5..4e2dd4371d 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -42,7 +42,7 @@ RSA_PRIVATE(VALUE obj, OSSL_3_const RSA *rsa)
* Classes
*/
VALUE cRSA;
-VALUE eRSAError;
+static VALUE eRSAError;
/*
* Private
diff --git a/ext/openssl/ossl_rand.c b/ext/openssl/ossl_rand.c
index 774e7836dc..843c9f8019 100644
--- a/ext/openssl/ossl_rand.c
+++ b/ext/openssl/ossl_rand.c
@@ -9,8 +9,8 @@
*/
#include "ossl.h"
-VALUE mRandom;
-VALUE eRandomError;
+static VALUE mRandom;
+static VALUE eRandomError;
/*
* call-seq:
diff --git a/ext/openssl/ossl_rand.h b/ext/openssl/ossl_rand.h
index 874ab539b8..294986d017 100644
--- a/ext/openssl/ossl_rand.h
+++ b/ext/openssl/ossl_rand.h
@@ -10,9 +10,6 @@
#if !defined(_OSSL_RAND_H_)
#define _OSSL_RAND_H_
-extern VALUE mRandom;
-extern VALUE eRandomError;
-
void Init_ossl_rand(void);
#endif /* _OSSL_RAND_H_ */
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 1c93d99a26..7bd395b760 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -35,7 +35,7 @@
VALUE mSSL;
static VALUE eSSLError;
-VALUE cSSLContext;
+static VALUE cSSLContext;
VALUE cSSLSocket;
static VALUE eSSLErrorWaitReadable;
diff --git a/ext/openssl/ossl_x509.h b/ext/openssl/ossl_x509.h
index 88e3f16a1a..d25167ee7b 100644
--- a/ext/openssl/ossl_x509.h
+++ b/ext/openssl/ossl_x509.h
@@ -28,7 +28,6 @@ void Init_ossl_x509(void);
* X509Attr
*/
extern VALUE cX509Attr;
-extern VALUE eX509AttrError;
VALUE ossl_x509attr_new(X509_ATTRIBUTE *);
X509_ATTRIBUTE *GetX509AttrPtr(VALUE);
@@ -38,7 +37,6 @@ void Init_ossl_x509attr(void);
* X509Cert
*/
extern VALUE cX509Cert;
-extern VALUE eX509CertError;
VALUE ossl_x509_new(X509 *);
X509 *GetX509CertPtr(VALUE);
@@ -48,9 +46,6 @@ void Init_ossl_x509cert(void);
/*
* X509CRL
*/
-extern VALUE cX509CRL;
-extern VALUE eX509CRLError;
-
VALUE ossl_x509crl_new(X509_CRL *);
X509_CRL *GetX509CRLPtr(VALUE);
void Init_ossl_x509crl(void);
@@ -59,8 +54,6 @@ void Init_ossl_x509crl(void);
* X509Extension
*/
extern VALUE cX509Ext;
-extern VALUE cX509ExtFactory;
-extern VALUE eX509ExtError;
VALUE ossl_x509ext_new(X509_EXTENSION *);
X509_EXTENSION *GetX509ExtPtr(VALUE);
@@ -69,9 +62,6 @@ void Init_ossl_x509ext(void);
/*
* X509Name
*/
-extern VALUE cX509Name;
-extern VALUE eX509NameError;
-
VALUE ossl_x509name_new(X509_NAME *);
X509_NAME *GetX509NamePtr(VALUE);
void Init_ossl_x509name(void);
@@ -79,9 +69,6 @@ void Init_ossl_x509name(void);
/*
* X509Request
*/
-extern VALUE cX509Req;
-extern VALUE eX509ReqError;
-
X509_REQ *GetX509ReqPtr(VALUE);
void Init_ossl_x509req(void);
@@ -89,7 +76,6 @@ void Init_ossl_x509req(void);
* X509Revoked
*/
extern VALUE cX509Rev;
-extern VALUE eX509RevError;
VALUE ossl_x509revoked_new(X509_REVOKED *);
X509_REVOKED *DupX509RevokedPtr(VALUE);
@@ -98,12 +84,7 @@ void Init_ossl_x509revoked(void);
/*
* X509Store and X509StoreContext
*/
-extern VALUE cX509Store;
-extern VALUE cX509StoreContext;
-extern VALUE eX509StoreError;
-
X509_STORE *GetX509StorePtr(VALUE);
-
void Init_ossl_x509store(void);
/*
diff --git a/ext/openssl/ossl_x509attr.c b/ext/openssl/ossl_x509attr.c
index 967fe89f01..433b2d09a0 100644
--- a/ext/openssl/ossl_x509attr.c
+++ b/ext/openssl/ossl_x509attr.c
@@ -28,7 +28,7 @@
* Classes
*/
VALUE cX509Attr;
-VALUE eX509AttrError;
+static VALUE eX509AttrError;
static void
ossl_x509attr_free(void *ptr)
diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c
index 846dd0701c..4c357f4247 100644
--- a/ext/openssl/ossl_x509cert.c
+++ b/ext/openssl/ossl_x509cert.c
@@ -28,7 +28,7 @@
* Classes
*/
VALUE cX509Cert;
-VALUE eX509CertError;
+static VALUE eX509CertError;
static void
ossl_x509_free(void *ptr)
diff --git a/ext/openssl/ossl_x509crl.c b/ext/openssl/ossl_x509crl.c
index 4f3177bfb4..9471311a02 100644
--- a/ext/openssl/ossl_x509crl.c
+++ b/ext/openssl/ossl_x509crl.c
@@ -27,8 +27,8 @@
/*
* Classes
*/
-VALUE cX509CRL;
-VALUE eX509CRLError;
+static VALUE cX509CRL;
+static VALUE eX509CRLError;
static void
ossl_x509crl_free(void *ptr)
diff --git a/ext/openssl/ossl_x509ext.c b/ext/openssl/ossl_x509ext.c
index 7f47cd7cce..bb1808fc15 100644
--- a/ext/openssl/ossl_x509ext.c
+++ b/ext/openssl/ossl_x509ext.c
@@ -41,8 +41,8 @@
* Classes
*/
VALUE cX509Ext;
-VALUE cX509ExtFactory;
-VALUE eX509ExtError;
+static VALUE cX509ExtFactory;
+static VALUE eX509ExtError;
static void
ossl_x509ext_free(void *ptr)
diff --git a/ext/openssl/ossl_x509name.c b/ext/openssl/ossl_x509name.c
index 5060be92cc..82ee0546a7 100644
--- a/ext/openssl/ossl_x509name.c
+++ b/ext/openssl/ossl_x509name.c
@@ -32,8 +32,8 @@
/*
* Classes
*/
-VALUE cX509Name;
-VALUE eX509NameError;
+static VALUE cX509Name;
+static VALUE eX509NameError;
static void
ossl_x509name_free(void *ptr)
diff --git a/ext/openssl/ossl_x509req.c b/ext/openssl/ossl_x509req.c
index 4a4d3f2867..264c0368f4 100644
--- a/ext/openssl/ossl_x509req.c
+++ b/ext/openssl/ossl_x509req.c
@@ -27,8 +27,8 @@
/*
* Classes
*/
-VALUE cX509Req;
-VALUE eX509ReqError;
+static VALUE cX509Req;
+static VALUE eX509ReqError;
static void
ossl_x509req_free(void *ptr)
diff --git a/ext/openssl/ossl_x509revoked.c b/ext/openssl/ossl_x509revoked.c
index 5b82470c83..7b9636449e 100644
--- a/ext/openssl/ossl_x509revoked.c
+++ b/ext/openssl/ossl_x509revoked.c
@@ -28,7 +28,7 @@
* Classes
*/
VALUE cX509Rev;
-VALUE eX509RevError;
+static VALUE eX509RevError;
static void
ossl_x509rev_free(void *ptr)
diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c
index f1357fcefb..214a3057de 100644
--- a/ext/openssl/ossl_x509store.c
+++ b/ext/openssl/ossl_x509store.c
@@ -108,9 +108,9 @@ ossl_verify_cb_call(VALUE proc, int ok, X509_STORE_CTX *ctx)
/*
* Classes
*/
-VALUE cX509Store;
-VALUE cX509StoreContext;
-VALUE eX509StoreError;
+static VALUE cX509Store;
+static VALUE cX509StoreContext;
+static VALUE eX509StoreError;
static void
ossl_x509store_mark(void *ptr)