diff --git a/crypto/asn1/asn1_test.cc b/crypto/asn1/asn1_test.cc index d2adbba1..8b024427 100644 --- a/crypto/asn1/asn1_test.cc +++ b/crypto/asn1/asn1_test.cc @@ -40,7 +40,7 @@ static const uint8_t kTagOverflow[] = { 0x1f, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01, 0x00, }; -bool TestLargeTags() { +static bool TestLargeTags() { const uint8_t *p = kTag258; ScopedASN1_TYPE obj(d2i_ASN1_TYPE(NULL, &p, sizeof(kTag258))); if (obj) { diff --git a/crypto/bio/pair.c b/crypto/bio/pair.c index fba4be2c..2da2d203 100644 --- a/crypto/bio/pair.c +++ b/crypto/bio/pair.c @@ -742,7 +742,7 @@ static const BIO_METHOD methods_biop = { bio_free, NULL /* no bio_callback_ctrl */ }; -const BIO_METHOD *bio_s_bio(void) { return &methods_biop; } +static const BIO_METHOD *bio_s_bio(void) { return &methods_biop; } int BIO_new_bio_pair(BIO** bio1_p, size_t writebuf1, BIO** bio2_p, size_t writebuf2) { diff --git a/crypto/bn/mul.c b/crypto/bn/mul.c index d2d8fd8c..06e53ee0 100644 --- a/crypto/bn/mul.c +++ b/crypto/bn/mul.c @@ -66,7 +66,8 @@ #define BN_SQR_RECURSIVE_SIZE_NORMAL BN_MUL_RECURSIVE_SIZE_NORMAL -void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) { +static void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, + int nb) { BN_ULONG *rr; if (na < nb) { diff --git a/crypto/conf/conf.c b/crypto/conf/conf.c index 6bdcc4dc..eed07e6d 100644 --- a/crypto/conf/conf.c +++ b/crypto/conf/conf.c @@ -152,7 +152,7 @@ void NCONF_free(CONF *conf) { OPENSSL_free(conf); } -CONF_VALUE *NCONF_new_section(const CONF *conf, const char *section) { +static CONF_VALUE *NCONF_new_section(const CONF *conf, const char *section) { STACK_OF(CONF_VALUE) *sk = NULL; int ok = 0; CONF_VALUE *v = NULL, *old_value; diff --git a/crypto/ec/ec_test.cc b/crypto/ec/ec_test.cc index 3d80d5f4..ce9d99f3 100644 --- a/crypto/ec/ec_test.cc +++ b/crypto/ec/ec_test.cc @@ -122,7 +122,7 @@ static bool EncodeECPrivateKey(std::vector *out, const EC_KEY *key) { return true; } -bool Testd2i_ECPrivateKey() { +static bool Testd2i_ECPrivateKey() { ScopedEC_KEY key = DecodeECPrivateKey(kECKeyWithoutPublic, sizeof(kECKeyWithoutPublic)); if (!key) { @@ -438,7 +438,7 @@ static bool TestArbitraryCurve() { return true; } -bool TestAddingEqualPoints(int nid) { +static bool TestAddingEqualPoints(int nid) { ScopedEC_KEY key(EC_KEY_new_by_curve_name(nid)); if (!key) { return false; diff --git a/crypto/ec/example_mul.c b/crypto/ec/example_mul.c index ebb724fa..9db97d68 100644 --- a/crypto/ec/example_mul.c +++ b/crypto/ec/example_mul.c @@ -73,7 +73,7 @@ #include -int example_EC_POINT_mul(void) { +static int example_EC_POINT_mul(void) { /* This example ensures that 10×∞ + G = G, in P-256. */ EC_GROUP *group = NULL; EC_POINT *p = NULL, *result = NULL; diff --git a/crypto/ec/p224-64.c b/crypto/ec/p224-64.c index b433a75b..40f1c157 100644 --- a/crypto/ec/p224-64.c +++ b/crypto/ec/p224-64.c @@ -982,10 +982,10 @@ static void batch_mul(felem x_out, felem y_out, felem z_out, /* Takes the Jacobian coordinates (X, Y, Z) of a point and returns * (X', Y') = (X/Z^2, Y/Z^3) */ -int ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group, - const EC_POINT *point, - BIGNUM *x, BIGNUM *y, - BN_CTX *ctx) { +static int ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group, + const EC_POINT *point, + BIGNUM *x, BIGNUM *y, + BN_CTX *ctx) { felem z1, z2, x_in, y_in, x_out, y_out; widefelem tmp; @@ -1024,9 +1024,12 @@ int ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group, return 1; } -int ec_GFp_nistp224_points_mul(const EC_GROUP *group, EC_POINT *r, - const BIGNUM *g_scalar, const EC_POINT *p_, - const BIGNUM *p_scalar_, BN_CTX *ctx) { +static int ec_GFp_nistp224_points_mul(const EC_GROUP *group, + EC_POINT *r, + const BIGNUM *g_scalar, + const EC_POINT *p_, + const BIGNUM *p_scalar_, + BN_CTX *ctx) { /* TODO: This function used to take |points| and |scalars| as arrays of * |num| elements. The code below should be simplified to work in terms of * |p_| and |p_scalar_|. */ diff --git a/crypto/ec/p256-64.c b/crypto/ec/p256-64.c index 5be9a060..24778c46 100644 --- a/crypto/ec/p256-64.c +++ b/crypto/ec/p256-64.c @@ -1536,10 +1536,10 @@ static void batch_mul(felem x_out, felem y_out, felem z_out, /* Takes the Jacobian coordinates (X, Y, Z) of a point and returns (X', Y') = * (X/Z^2, Y/Z^3). */ -int ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group, - const EC_POINT *point, - BIGNUM *x, BIGNUM *y, - BN_CTX *ctx) { +static int ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group, + const EC_POINT *point, + BIGNUM *x, BIGNUM *y, + BN_CTX *ctx) { felem z1, z2, x_in, y_in; smallfelem x_out, y_out; longfelem tmp; @@ -1575,9 +1575,12 @@ int ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group, return 1; } -int ec_GFp_nistp256_points_mul(const EC_GROUP *group, EC_POINT *r, - const BIGNUM *g_scalar, const EC_POINT *p_, - const BIGNUM *p_scalar_, BN_CTX *ctx) { +static int ec_GFp_nistp256_points_mul(const EC_GROUP *group, + EC_POINT *r, + const BIGNUM *g_scalar, + const EC_POINT *p_, + const BIGNUM *p_scalar_, + BN_CTX *ctx) { /* TODO: This function used to take |points| and |scalars| as arrays of * |num| elements. The code below should be simplified to work in terms of |p| * and |p_scalar|. */ diff --git a/crypto/rsa/padding.c b/crypto/rsa/padding.c index 4d668706..12147ea4 100644 --- a/crypto/rsa/padding.c +++ b/crypto/rsa/padding.c @@ -274,8 +274,8 @@ int RSA_padding_add_none(uint8_t *to, unsigned to_len, const uint8_t *from, return 1; } -int PKCS1_MGF1(uint8_t *mask, unsigned len, const uint8_t *seed, - unsigned seedlen, const EVP_MD *dgst) { +static int PKCS1_MGF1(uint8_t *mask, unsigned len, const uint8_t *seed, + unsigned seedlen, const EVP_MD *dgst) { unsigned outlen = 0; uint32_t i; uint8_t cnt[4]; diff --git a/ssl/ssl_ecdh.c b/ssl/ssl_ecdh.c index 0ed9705d..6abd0ba2 100644 --- a/ssl/ssl_ecdh.c +++ b/ssl/ssl_ecdh.c @@ -84,9 +84,12 @@ err: return ret; } -int ssl_ec_point_compute_secret(SSL_ECDH_CTX *ctx, uint8_t **out_secret, - size_t *out_secret_len, uint8_t *out_alert, - const uint8_t *peer_key, size_t peer_key_len) { +static int ssl_ec_point_compute_secret(SSL_ECDH_CTX *ctx, + uint8_t **out_secret, + size_t *out_secret_len, + uint8_t *out_alert, + const uint8_t *peer_key, + size_t peer_key_len) { BIGNUM *private_key = (BIGNUM *)ctx->data; assert(private_key != NULL); *out_alert = SSL_AD_INTERNAL_ERROR; diff --git a/tool/tool.cc b/tool/tool.cc index b8250089..84f5598b 100644 --- a/tool/tool.cc +++ b/tool/tool.cc @@ -83,7 +83,7 @@ static void usage(const char *name) { } } -tool_func_t FindTool(const std::string &name) { +static tool_func_t FindTool(const std::string &name) { for (size_t i = 0;; i++) { const Tool &tool = kTools[i]; if (tool.func == nullptr || name == tool.name) {