[Fawkes Git] branch/thofmann/openssl110: interfaces: add support for OpenSSL 1.1.0

Till Hofmann hofmann at kbsg.rwth-aachen.de
Tue Dec 20 13:39:59 CET 2016


Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, thofmann/openssl110 has been updated
  discards  d2332aeff8d26dbc26c35251e75e145d5237c18a (commit)
        to  05ed774ea40e6b1db7630a5959f429851858c085 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (d2332aeff8d26dbc26c35251e75e145d5237c18a)
            \
             N -- N -- N (05ed774ea40e6b1db7630a5959f429851858c085)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

http://git.fawkesrobotics.org/fawkes.git/thofmann/openssl110

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit 05ed774ea40e6b1db7630a5959f429851858c085
Author:     Till Hofmann <hofmann at kbsg.rwth-aachen.de>
AuthorDate: Sun Nov 6 12:24:05 2016 +0100
Commit:     Till Hofmann <hofmann at kbsg.rwth-aachen.de>
CommitDate: Tue Dec 20 13:39:32 2016 +0100

    interfaces: add support for OpenSSL 1.1.0
    
    EVP_MD_CTX was made opaque in OpenSSL 1.1.0. Use EVP_MD_CTX_create
    EVP_MD_CTX_destroy to create EVP_MD_CTX objects instead.
    
    This change is backwards compatible as EVP_MD_CTX_create and
    EVP_MD_CTX_destroy are available in older OpenSSL version, too.

http://git.fawkesrobotics.org/fawkes.git/commit/05ed774
http://trac.fawkesrobotics.org/changeset/05ed774

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


- *Summary* -----------------------------------------------------------


- *Diffs* -------------------------------------------------------------

- *commit* 05ed774ea40e6b1db7630a5959f429851858c085 - - - - - - - - - -
Author:  Till Hofmann <hofmann at kbsg.rwth-aachen.de>
Date:    Sun Nov 6 12:24:05 2016 +0100
Subject: interfaces: add support for OpenSSL 1.1.0

 src/libs/interfaces/generator/digest.cpp |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/interfaces/generator/digest.cpp b/src/libs/interfaces/generator/digest.cpp
index f37f2ab..8139d55 100644
--- a/src/libs/interfaces/generator/digest.cpp
+++ b/src/libs/interfaces/generator/digest.cpp
@@ -44,8 +44,9 @@ InterfaceDigest::InterfaceDigest(std::string config_filename)
 {
   digest = NULL;
 
-  EVP_MD_CTX ctx;
-  if ( ! EVP_DigestInit(&ctx, EVP_md5())) {
+  EVP_MD_CTX *ctx = EVP_MD_CTX_create();
+  if ( ! EVP_DigestInit(ctx, EVP_md5())) {
+    EVP_MD_CTX_destroy(ctx);
     throw Exception("Could not initialize digest context");
   }
 
@@ -54,26 +55,30 @@ InterfaceDigest::InterfaceDigest(std::string config_filename)
   while ( ! feof(f) && ! ferror(f) ) {
     size_t rb;
     if ((rb = fread(buf, 1, FILE_STEP, f)) > 0) {
-      if ( ! EVP_DigestUpdate(&ctx, buf, rb) ) {
+      if ( ! EVP_DigestUpdate(ctx, buf, rb) ) {
 	fclose(f);
+	EVP_MD_CTX_destroy(ctx);
 	throw Exception("Failed to update digest");
       }
     }
   }
   if ( ferror(f) ) {
     fclose(f);
+    EVP_MD_CTX_destroy(ctx);
     throw Exception("Failure while reading the file");
   }
   fclose(f);
 
-  digest_size=EVP_MD_CTX_size(&ctx);
+  digest_size=EVP_MD_CTX_size(ctx);
   digest = new unsigned char[digest_size];
 
-  if ( ! EVP_DigestFinal(&ctx, digest, NULL) ) {
+  if ( ! EVP_DigestFinal(ctx, digest, NULL) ) {
     delete digest;
     digest = NULL;
+    EVP_MD_CTX_destroy(ctx);
     throw Exception("Could not finalize digest");
   }
+  EVP_MD_CTX_destroy(ctx);
 }
 
 




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list