[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Tue Feb 10 14:33:24 UTC 2015


The branch master has been updated
       via  efb4597345a0ae31ac81f9dfb783f3eef420122b (commit)
       via  00a5a74bbc854972c4484a0b204bc9437d2757d9 (commit)
       via  a8b4e057b3c8b9563802105cfcc6210f70ce1fc8 (commit)
      from  79ee5afa26da1f2e3d16376d20b273cc759b0c1b (commit)


- Log -----------------------------------------------------------------
commit efb4597345a0ae31ac81f9dfb783f3eef420122b
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Feb 10 10:12:19 2015 +0000

    Remove some functions that are no longer used and break the build with:
    ./config --strict-warnings enable-deprecated
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>

commit 00a5a74bbc854972c4484a0b204bc9437d2757d9
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Feb 10 09:45:18 2015 +0000

    HMAC_cleanup, and HMAC_Init are stated as deprecated in the docs and source.
    Mark them as such with OPENSSL_USE_DEPRECATED
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>

commit a8b4e057b3c8b9563802105cfcc6210f70ce1fc8
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Feb 10 10:07:07 2015 +0000

    Remove -DOPENSSL_NO_DEPRECATED from --strict-warnings flags.
    
    In master OPENSSL_NO_DEPRECATED is the default anyway. By including it in
    --strict-warnings as well this means you cannot combine enable-deprecated
    with --strict-warnings.
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 Configure          |    2 +-
 crypto/bn/bn_ctx.c |   50 --------------------------------------------------
 crypto/hmac/hmac.c |    4 +++-
 crypto/hmac/hmac.h |    7 +++++--
 4 files changed, 9 insertions(+), 54 deletions(-)

diff --git a/Configure b/Configure
index f6dd38e..9f2539b 100755
--- a/Configure
+++ b/Configure
@@ -105,7 +105,7 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
 # Minimum warning options... any contributions to OpenSSL should at least get
 # past these.
 
-my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED";
+my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK";
 
 my $clang_disabled_warnings = "-Wno-language-extension-token -Wno-extended-offsetof -Wno-padded -Wno-shorten-64-to-32 -Wno-format-nonliteral -Wno-missing-noreturn -Wno-unused-parameter -Wno-sign-conversion -Wno-unreachable-code -Wno-conversion -Wno-documentation -Wno-missing-variable-declarations -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-missing-variable-declarations -Wno-missing-field-initializers -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-conditional-uninitialized -Wno-switch-enum";
 
diff --git a/crypto/bn/bn_ctx.c b/crypto/bn/bn_ctx.c
index 4bc0445..d2dd1e6 100644
--- a/crypto/bn/bn_ctx.c
+++ b/crypto/bn/bn_ctx.c
@@ -103,9 +103,6 @@ typedef struct bignum_pool {
 } BN_POOL;
 static void BN_POOL_init(BN_POOL *);
 static void BN_POOL_finish(BN_POOL *);
-#ifndef OPENSSL_NO_DEPRECATED
-static void BN_POOL_reset(BN_POOL *);
-#endif
 static BIGNUM *BN_POOL_get(BN_POOL *);
 static void BN_POOL_release(BN_POOL *, unsigned int);
 
@@ -122,9 +119,6 @@ typedef struct bignum_ctx_stack {
 } BN_STACK;
 static void BN_STACK_init(BN_STACK *);
 static void BN_STACK_finish(BN_STACK *);
-#ifndef OPENSSL_NO_DEPRECATED
-static void BN_STACK_reset(BN_STACK *);
-#endif
 static int BN_STACK_push(BN_STACK *, unsigned int);
 static unsigned int BN_STACK_pop(BN_STACK *);
 
@@ -189,26 +183,6 @@ static void ctxdbg(BN_CTX *ctx)
 # define CTXDBG_RET(ctx,ret)
 #endif
 
-/*
- * This function is an evil legacy and should not be used. This
- * implementation is WYSIWYG, though I've done my best.
- */
-#ifndef OPENSSL_NO_DEPRECATED
-void BN_CTX_init(BN_CTX *ctx)
-{
-    /*
-     * Assume the caller obtained the context via BN_CTX_new() and so is
-     * trying to reset it for use. Nothing else makes sense, least of all
-     * binary compatibility from a time when they could declare a static
-     * variable.
-     */
-    BN_POOL_reset(&ctx->pool);
-    BN_STACK_reset(&ctx->stack);
-    ctx->used = 0;
-    ctx->err_stack = 0;
-    ctx->too_many = 0;
-}
-#endif
 
 BN_CTX *BN_CTX_new(void)
 {
@@ -319,12 +293,6 @@ static void BN_STACK_finish(BN_STACK *st)
         OPENSSL_free(st->indexes);
 }
 
-#ifndef OPENSSL_NO_DEPRECATED
-static void BN_STACK_reset(BN_STACK *st)
-{
-    st->depth = 0;
-}
-#endif
 
 static int BN_STACK_push(BN_STACK *st, unsigned int idx)
 {
@@ -379,24 +347,6 @@ static void BN_POOL_finish(BN_POOL *p)
     }
 }
 
-#ifndef OPENSSL_NO_DEPRECATED
-static void BN_POOL_reset(BN_POOL *p)
-{
-    BN_POOL_ITEM *item = p->head;
-    while (item) {
-        unsigned int loop = 0;
-        BIGNUM *bn = item->vals;
-        while (loop++ < BN_CTX_POOL_SIZE) {
-            if (bn->d)
-                BN_clear(bn);
-            bn++;
-        }
-        item = item->next;
-    }
-    p->current = p->head;
-    p->used = 0;
-}
-#endif
 
 static BIGNUM *BN_POOL_get(BN_POOL *p)
 {
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c
index 1d871f0..3a4dfa4 100644
--- a/crypto/hmac/hmac.c
+++ b/crypto/hmac/hmac.c
@@ -118,12 +118,14 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
     return 0;
 }
 
+#ifndef OPENSSL_NO_DEPRECATED
 int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md)
 {
     if (key && md)
         HMAC_CTX_init(ctx);
     return HMAC_Init_ex(ctx, key, len, md, NULL);
 }
+#endif
 
 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len)
 {
@@ -190,7 +192,7 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
     if (md == NULL)
         md = m;
     HMAC_CTX_init(&c);
-    if (!HMAC_Init(&c, key, key_len, evp_md))
+    if (!HMAC_Init_ex(&c, key, key_len, evp_md, NULL))
         goto err;
     if (!HMAC_Update(&c, d, n))
         goto err;
diff --git a/crypto/hmac/hmac.h b/crypto/hmac/hmac.h
index 2404e53..81aa49d 100644
--- a/crypto/hmac/hmac.h
+++ b/crypto/hmac/hmac.h
@@ -82,12 +82,15 @@ typedef struct hmac_ctx_st {
 void HMAC_CTX_init(HMAC_CTX *ctx);
 void HMAC_CTX_cleanup(HMAC_CTX *ctx);
 
+#ifdef OPENSSL_USE_DEPRECATED
 /* deprecated */
 # define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx)
 
 /* deprecated */
-__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
-                     const EVP_MD *md);
+DECLARE_DEPRECATED(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
+                     const EVP_MD *md));
+
+#endif
 /*__owur*/ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
                             const EVP_MD *md, ENGINE *impl);
 /*__owur*/ int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,


More information about the openssl-commits mailing list