Use AES256 and SHA256 by default for the legacy protocol.
[tinc] / src / openssl / digest.c
index 135e7e6..58ca167 100644 (file)
@@ -1,6 +1,6 @@
 /*
     digest.c -- Digest handling
-    Copyright (C) 2007-2013 Guus Sliepen <guus@tinc-vpn.org>
+    Copyright (C) 2007-2016 Guus Sliepen <guus@tinc-vpn.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -64,10 +64,6 @@ digest_t *digest_open_by_nid(int nid, int maclength) {
        return digest_open(evp_md, maclength);
 }
 
-digest_t *digest_open_sha1(int maclength) {
-       return digest_open(EVP_sha1(), maclength);
-}
-
 bool digest_set_key(digest_t *digest, const void *key, size_t len) {
        digest->key = xrealloc(digest->key, len);
        memcpy(digest->key, key, len);
@@ -101,11 +97,11 @@ bool digest_create(digest_t *digest, const void *indata, size_t inlen, void *out
                                || !EVP_DigestUpdate(ctx, indata, inlen)
                                || !EVP_DigestFinal(ctx, tmpdata, NULL)) {
                        logger(DEBUG_ALWAYS, LOG_DEBUG, "Error creating digest: %s", ERR_error_string(ERR_get_error(), NULL));
-                       EVP_MD_CTX_free(ctx);
+                       EVP_MD_CTX_destroy(ctx);
                        return false;
                }
 
-               EVP_MD_CTX_free(ctx);
+               EVP_MD_CTX_destroy(ctx);
        }
 
        memcpy(outdata, tmpdata, digest->maclength);