Ver código fonte

Tag a number of globals as const.

Change-Id: I6f334911f153395a2e5e26adfd08912a1d8c558b
Reviewed-on: https://boringssl-review.googlesource.com/2847
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 9 anos atrás
committed by Adam Langley
pai
commit
aa3f6daa86
21 arquivos alterados com 35 adições e 34 exclusões
  1. +2
    -2
      crypto/asn1/bio_asn1.c
  2. +1
    -1
      crypto/asn1/charmap.pl
  3. +1
    -1
      crypto/asn1/x_bignum.c
  4. +1
    -1
      crypto/asn1/x_long.c
  5. +1
    -1
      crypto/bio/buffer.c
  6. +1
    -1
      crypto/conf/conf_def.h
  7. +1
    -1
      crypto/err/err.c
  8. +1
    -1
      crypto/evp/evp_ctx.c
  9. +1
    -1
      crypto/x509/t_x509.c
  10. +6
    -5
      crypto/x509/x509_req.c
  11. +1
    -1
      crypto/x509/x509_vpm.c
  12. +1
    -1
      crypto/x509/x_crl.c
  13. +1
    -1
      crypto/x509v3/ext_dat.h
  14. +1
    -1
      crypto/x509v3/tabtest.c
  15. +4
    -4
      crypto/x509v3/v3_bitst.c
  16. +2
    -2
      crypto/x509v3/v3_conf.c
  17. +3
    -3
      crypto/x509v3/v3_enum.c
  18. +1
    -1
      include/openssl/asn1.h
  19. +2
    -2
      include/openssl/x509.h
  20. +2
    -2
      include/openssl/x509v3.h
  21. +1
    -1
      ssl/ssl_sess.c

+ 2
- 2
crypto/asn1/bio_asn1.c Ver arquivo

@@ -124,7 +124,7 @@ static int asn1_bio_setup_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
asn1_bio_state_t ex_state,
asn1_bio_state_t other_state);

static BIO_METHOD methods_asn1=
static const BIO_METHOD methods_asn1=
{
BIO_TYPE_ASN1,
"asn1",
@@ -138,7 +138,7 @@ static BIO_METHOD methods_asn1=
asn1_bio_callback_ctrl,
};

BIO_METHOD *BIO_f_asn1(void)
const BIO_METHOD *BIO_f_asn1(void)
{
return(&methods_asn1);
}


+ 1
- 1
crypto/asn1/charmap.pl Ver arquivo

@@ -123,7 +123,7 @@ print <<EOF;
* Mask of various character properties
*/

static unsigned char char_type[] = {
static const unsigned char char_type[] = {
EOF

for($i = 0; $i < 128; $i++) {


+ 1
- 1
crypto/asn1/x_bignum.c Ver arquivo

@@ -74,7 +74,7 @@ static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
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 = {
static const ASN1_PRIMITIVE_FUNCS bignum_pf = {
NULL, 0,
bn_new,
bn_free,


+ 1
- 1
crypto/asn1/x_long.c Ver arquivo

@@ -74,7 +74,7 @@ static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const A
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 = {
static const ASN1_PRIMITIVE_FUNCS long_pf = {
NULL, 0,
long_new,
long_free,


+ 1
- 1
crypto/bio/buffer.c Ver arquivo

@@ -480,7 +480,7 @@ static int buffer_puts(BIO *b, const char *str) {
return buffer_write(b, str, strlen(str));
}

static BIO_METHOD methods_buffer = {
static const BIO_METHOD methods_buffer = {
BIO_TYPE_BUFFER, "buffer", buffer_write, buffer_read,
buffer_puts, buffer_gets, buffer_ctrl, buffer_new,
buffer_free, buffer_callback_ctrl,


+ 1
- 1
crypto/conf/conf_def.h Ver arquivo

@@ -91,7 +91,7 @@
#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
#define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)

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,


+ 1
- 1
crypto/err/err.c Ver arquivo

@@ -688,7 +688,7 @@ static const char *const kLibraryNames[ERR_NUM_LIBS] = {
* allocated on the heap. */
static ERR_STRING_DATA kStaticErrors[ERR_NUM_LIBS * 2 + NUM_SYS_ERRNOS];

static ERR_STRING_DATA kGlobalErrors[] = {
static const ERR_STRING_DATA kGlobalErrors[] = {
{ERR_R_MALLOC_FAILURE, "malloc failure"},
{ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED, "function should not be called"},
{ERR_R_PASSED_NULL_PARAMETER, "passed a null parameter"},


+ 1
- 1
crypto/evp/evp_ctx.c Ver arquivo

@@ -69,7 +69,7 @@ extern const EVP_PKEY_METHOD rsa_pkey_meth;
extern const EVP_PKEY_METHOD hmac_pkey_meth;
extern const EVP_PKEY_METHOD ec_pkey_meth;

static const EVP_PKEY_METHOD *evp_methods[] = {
static const EVP_PKEY_METHOD *const evp_methods[] = {
&rsa_pkey_meth,
&hmac_pkey_meth,
&ec_pkey_meth,


+ 1
- 1
crypto/x509/t_x509.c Ver arquivo

@@ -365,7 +365,7 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
return(0);
}

static const char *mon[12]=
static const char *const mon[12]=
{
"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec"


+ 6
- 5
crypto/x509/x509_req.c Ver arquivo

@@ -155,9 +155,9 @@ int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
* 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};

static int *ext_nids = ext_nid_list;
static const int *ext_nids = ext_nid_list;

int X509_REQ_extension_nid(int req_nid)
{
@@ -169,12 +169,12 @@ int X509_REQ_extension_nid(int req_nid)
}
}

int *X509_REQ_get_extension_nids(void)
const int *X509_REQ_get_extension_nids(void)
{
return ext_nids;
}
void X509_REQ_set_extension_nids(int *nids)
void X509_REQ_set_extension_nids(const int *nids)
{
ext_nids = nids;
}
@@ -183,7 +183,8 @@ STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req)
{
X509_ATTRIBUTE *attr;
ASN1_TYPE *ext = NULL;
int idx, *pnid;
int idx;
const int *pnid;
const unsigned char *p;

if ((req == NULL) || (req->req_info == NULL) || !ext_nids)


+ 1
- 1
crypto/x509/x509_vpm.c Ver arquivo

@@ -438,7 +438,7 @@ const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param)
return param->name;
}

static X509_VERIFY_PARAM_ID _empty_id = {NULL, 0, 0U, NULL, 0, NULL, 0};
static const X509_VERIFY_PARAM_ID _empty_id = {NULL, 0, 0U, NULL, 0, NULL, 0};

#define vpm_empty_id (X509_VERIFY_PARAM_ID *)&_empty_id



+ 1
- 1
crypto/x509/x_crl.c Ver arquivo

@@ -97,7 +97,7 @@ 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 =
static const X509_CRL_METHOD int_crl_meth =
{
0,
0,0,


+ 1
- 1
crypto/x509v3/ext_dat.h Ver arquivo

@@ -74,7 +74,7 @@ extern X509V3_EXT_METHOD v3_addr, v3_asid;
/* TODO(fork): OCSP support */
#define OPENSSL_NO_OCSP

static const X509V3_EXT_METHOD *standard_exts[] = {
static const X509V3_EXT_METHOD *const standard_exts[] = {
&v3_nscert,
&v3_ns_ia5_list[0],
&v3_ns_ia5_list[1],


+ 1
- 1
crypto/x509v3/tabtest.c Ver arquivo

@@ -70,7 +70,7 @@
int main(void)
{
int i, prev = -1, bad = 0;
const X509V3_EXT_METHOD **tmp;
const X509V3_EXT_METHOD *const *tmp;
CRYPTO_library_init();
i = sizeof(standard_exts) / sizeof(X509V3_EXT_METHOD *);
if(i != STANDARD_EXTENSION_COUNT)


+ 4
- 4
crypto/x509v3/v3_bitst.c Ver arquivo

@@ -62,7 +62,7 @@
#include <openssl/x509v3.h>


static BIT_STRING_BITNAME ns_cert_type_table[] = {
static const BIT_STRING_BITNAME ns_cert_type_table[] = {
{0, "SSL Client", "client"},
{1, "SSL Server", "server"},
{2, "S/MIME", "email"},
@@ -74,7 +74,7 @@ static BIT_STRING_BITNAME ns_cert_type_table[] = {
{-1, NULL, NULL}
};

static BIT_STRING_BITNAME key_usage_type_table[] = {
static const BIT_STRING_BITNAME key_usage_type_table[] = {
{0, "Digital Signature", "digitalSignature"},
{1, "Non Repudiation", "nonRepudiation"},
{2, "Key Encipherment", "keyEncipherment"},
@@ -95,7 +95,7 @@ const X509V3_EXT_METHOD v3_key_usage = EXT_BITSTRING(NID_key_usage, key_usage_ty
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;
const BIT_STRING_BITNAME *bnam;
for(bnam =method->usr_data; bnam->lname; bnam++) {
if(ASN1_BIT_STRING_get_bit(bits, bnam->bitnum))
X509V3_add_value(bnam->lname, NULL, &ret);
@@ -109,7 +109,7 @@ ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
CONF_VALUE *val;
ASN1_BIT_STRING *bs;
size_t i;
BIT_STRING_BITNAME *bnam;
const BIT_STRING_BITNAME *bnam;
if(!(bs = M_ASN1_BIT_STRING_new())) {
OPENSSL_PUT_ERROR(X509V3, v2i_ASN1_BIT_STRING, ERR_R_MALLOC_FAILURE);
return NULL;


+ 2
- 2
crypto/x509v3/v3_conf.c Ver arquivo

@@ -430,7 +430,7 @@ static STACK_OF(CONF_VALUE) *nconf_get_section(void *db, char *section)
return NCONF_get_section(db, section);
}

static X509V3_CONF_METHOD nconf_method = {
static const X509V3_CONF_METHOD nconf_method = {
nconf_get_string,
nconf_get_section,
NULL,
@@ -485,7 +485,7 @@ static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, char *section)
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,


+ 3
- 3
crypto/x509v3/v3_enum.c Ver arquivo

@@ -61,7 +61,7 @@
#include <openssl/x509v3.h>


static ENUMERATED_NAMES crl_reasons[] = {
static const ENUMERATED_NAMES crl_reasons[] = {
{CRL_REASON_UNSPECIFIED, "Unspecified", "unspecified"},
{CRL_REASON_KEY_COMPROMISE, "Key Compromise", "keyCompromise"},
{CRL_REASON_CA_COMPROMISE, "CA Compromise", "CACompromise"},
@@ -82,13 +82,13 @@ NID_crl_reason, 0, ASN1_ITEM_ref(ASN1_ENUMERATED),
(X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE,
0,
0,0,0,0,
crl_reasons};
(void *)crl_reasons};


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++) {


+ 1
- 1
include/openssl/asn1.h Ver arquivo

@@ -1052,7 +1052,7 @@ OPENSSL_EXPORT void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags);
OPENSSL_EXPORT unsigned long ASN1_PCTX_get_str_flags(ASN1_PCTX *p);
OPENSSL_EXPORT void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags);

OPENSSL_EXPORT BIO_METHOD *BIO_f_asn1(void);
OPENSSL_EXPORT const BIO_METHOD *BIO_f_asn1(void);

OPENSSL_EXPORT BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);



+ 2
- 2
include/openssl/x509.h Ver arquivo

@@ -871,8 +871,8 @@ OPENSSL_EXPORT int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name);
OPENSSL_EXPORT int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
OPENSSL_EXPORT EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req);
OPENSSL_EXPORT int X509_REQ_extension_nid(int nid);
OPENSSL_EXPORT int * X509_REQ_get_extension_nids(void);
OPENSSL_EXPORT void X509_REQ_set_extension_nids(int *nids);
OPENSSL_EXPORT const int * X509_REQ_get_extension_nids(void);
OPENSSL_EXPORT void X509_REQ_set_extension_nids(const int *nids);
OPENSSL_EXPORT STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
OPENSSL_EXPORT int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
int nid);


+ 2
- 2
include/openssl/x509v3.h Ver arquivo

@@ -130,7 +130,7 @@ X509 *issuer_cert;
X509 *subject_cert;
X509_REQ *subject_req;
X509_CRL *crl;
X509V3_CONF_METHOD *db_meth;
const X509V3_CONF_METHOD *db_meth;
void *db;
/* Maybe more here */
};
@@ -389,7 +389,7 @@ struct ISSUING_DIST_POINT_st
(X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
(X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \
NULL, NULL, \
table}
(void *)table}

#define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \
0,0,0,0, \


+ 1
- 1
ssl/ssl_sess.c Ver arquivo

@@ -146,7 +146,7 @@
/* The address of this is a magic value, a pointer to which is returned by
* SSL_magic_pending_session_ptr(). It allows a session callback to indicate
* that it needs to asynchronously fetch session information. */
static char g_pending_session_magic;
static const char g_pending_session_magic;

static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s);
static void SSL_SESSION_list_add(SSL_CTX *ctx,SSL_SESSION *s);


Carregando…
Cancelar
Salvar