commit libcaes for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libcaes for openSUSE:Factory checked in at 2022-05-30 12:44:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libcaes (Old) and /work/SRC/openSUSE:Factory/.libcaes.new.2254 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libcaes" Mon May 30 12:44:11 2022 rev:15 rq:979758 version:20220529 Changes: -------- --- /work/SRC/openSUSE:Factory/libcaes/libcaes.changes 2022-04-25 23:35:39.410427342 +0200 +++ /work/SRC/openSUSE:Factory/.libcaes.new.2254/libcaes.changes 2022-05-30 12:45:09.556487063 +0200 @@ -1,0 +2,6 @@ +Sun May 29 19:37:45 UTC 2022 - Jan Engelhardt <jengelh@inai.de> + +- Update to release 20220529 + * OpenSSL 3 support + +------------------------------------------------------------------- Old: ---- libcaes-alpha-20220424.tar.gz libcaes-alpha-20220424.tar.gz.asc New: ---- libcaes-alpha-20220529.tar.gz libcaes-alpha-20220529.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libcaes.spec ++++++ --- /var/tmp/diff_new_pack.F9tCGh/_old 2022-05-30 12:45:10.244487979 +0200 +++ /var/tmp/diff_new_pack.F9tCGh/_new 2022-05-30 12:45:10.248487984 +0200 @@ -18,7 +18,7 @@ Name: libcaes %define lname libcaes1 -Version: 20220424 +Version: 20220529 Release: 0 Summary: Library for AES encryption License: LGPL-3.0-or-later ++++++ libcaes-alpha-20220424.tar.gz -> libcaes-alpha-20220529.tar.gz ++++++ ++++ 26060 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/INSTALL new/libcaes-20220529/INSTALL --- old/libcaes-20220424/INSTALL 2022-04-25 07:43:07.000000000 +0200 +++ new/libcaes-20220529/INSTALL 2022-05-29 21:07:10.000000000 +0200 @@ -1,8 +1,8 @@ Installation Instructions ************************* - Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software -Foundation, Inc. + Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free +Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -225,7 +225,7 @@ and if that doesn't work, install pre-built binaries of GCC for HP-UX. - HP-UX 'make' updates targets which have the same time stamps as their + HP-UX 'make' updates targets which have the same timestamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/common/config.h new/libcaes-20220529/common/config.h --- old/libcaes-20220424/common/config.h 2022-04-25 07:43:17.000000000 +0200 +++ new/libcaes-20220529/common/config.h 2022-05-29 21:00:42.000000000 +0200 @@ -37,6 +37,9 @@ /* Define to 1 to enable the DllMain function. */ /* #undef HAVE_DLLMAIN */ +/* Define to 1 if you have the `EVP_CipherInit_ex2' function". */ +#define HAVE_EVP_CIPHERINIT_EX2 1 + /* Define to 1 if you have the `EVP_CIPHER_CTX_cleanup' function". */ /* #undef HAVE_EVP_CIPHER_CTX_CLEANUP */ @@ -136,9 +139,6 @@ /* Define to 1 if you have the `memcpy' function. */ #define HAVE_MEMCPY 1 -/* Define to 1 if you have the <memory.h> header file. */ -#define HAVE_MEMORY_H 1 - /* Define to 1 if you have the `memrchr' function. */ #define HAVE_MEMRCHR 1 @@ -184,6 +184,9 @@ /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 @@ -196,7 +199,7 @@ /* Define to 1 if you have the `strerror' function. */ /* #undef HAVE_STRERROR */ -/* Define to 1 if you have the `strerror_r' function. */ +/* Define if you have `strerror_r'. */ #define HAVE_STRERROR_R 1 /* Define to 1 if you have the <strings.h> header file. */ @@ -323,7 +326,7 @@ #define PACKAGE_NAME "libcaes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libcaes 20220424" +#define PACKAGE_STRING "libcaes 20220529" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libcaes" @@ -332,7 +335,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "20220424" +#define PACKAGE_VERSION "20220529" /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 @@ -349,19 +352,16 @@ /* The size of `wchar_t', as computed by sizeof. */ #define SIZEOF_WCHAR_T 4 -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #define STDC_HEADERS 1 /* Define to 1 if strerror_r returns char *. */ /* #undef STRERROR_R_CHAR_P */ /* Version number of package */ -#define VERSION "20220424" - -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif +#define VERSION "20220529" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/common/config.h.in new/libcaes-20220529/common/config.h.in --- old/libcaes-20220424/common/config.h.in 2022-04-25 07:43:06.000000000 +0200 +++ new/libcaes-20220529/common/config.h.in 2022-05-29 21:07:10.000000000 +0200 @@ -36,6 +36,9 @@ /* Define to 1 to enable the DllMain function. */ #undef HAVE_DLLMAIN +/* Define to 1 if you have the `EVP_CipherInit_ex2' function". */ +#undef HAVE_EVP_CIPHERINIT_EX2 + /* Define to 1 if you have the `EVP_CIPHER_CTX_cleanup' function". */ #undef HAVE_EVP_CIPHER_CTX_CLEANUP @@ -135,9 +138,6 @@ /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - /* Define to 1 if you have the `memrchr' function. */ #undef HAVE_MEMRCHR @@ -183,6 +183,9 @@ /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H @@ -195,7 +198,7 @@ /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR -/* Define to 1 if you have the `strerror_r' function. */ +/* Define if you have `strerror_r'. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the <strings.h> header file. */ @@ -348,7 +351,9 @@ /* The size of `wchar_t', as computed by sizeof. */ #undef SIZEOF_WCHAR_T -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ @@ -357,11 +362,6 @@ /* Version number of package */ #undef VERSION -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif - /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/compile new/libcaes-20220529/compile --- old/libcaes-20220424/compile 2022-04-25 07:43:07.000000000 +0200 +++ new/libcaes-20220529/compile 2022-05-29 21:07:10.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/configure.ac new/libcaes-20220529/configure.ac --- old/libcaes-20220424/configure.ac 2022-04-25 07:39:58.000000000 +0200 +++ new/libcaes-20220529/configure.ac 2022-05-29 18:34:08.000000000 +0200 @@ -2,7 +2,7 @@ AC_INIT( [libcaes], - [20220424], + [20220529], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/dpkg/changelog new/libcaes-20220529/dpkg/changelog --- old/libcaes-20220424/dpkg/changelog 2022-04-25 07:43:17.000000000 +0200 +++ new/libcaes-20220529/dpkg/changelog 2022-05-29 21:07:20.000000000 +0200 @@ -1,5 +1,5 @@ -libcaes (20220424-1) unstable; urgency=low +libcaes (20220529-1) unstable; urgency=low * Auto-generated - -- Joachim Metz <joachim.metz@gmail.com> Mon, 25 Apr 2022 07:43:16 +0200 + -- Joachim Metz <joachim.metz@gmail.com> Sun, 29 May 2022 21:07:19 +0200 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/include/libcaes/definitions.h new/libcaes-20220529/include/libcaes/definitions.h --- old/libcaes-20220424/include/libcaes/definitions.h 2022-04-25 07:43:17.000000000 +0200 +++ new/libcaes-20220529/include/libcaes/definitions.h 2022-05-29 21:07:20.000000000 +0200 @@ -24,11 +24,11 @@ #include <libcaes/types.h> -#define LIBCAES_VERSION 20220424 +#define LIBCAES_VERSION 20220529 /* The version string */ -#define LIBCAES_VERSION_STRING "20220424" +#define LIBCAES_VERSION_STRING "20220529" /* The crypt modes */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/libcaes/libcaes.rc new/libcaes-20220529/libcaes/libcaes.rc --- old/libcaes-20220424/libcaes/libcaes.rc 2022-04-25 07:43:17.000000000 +0200 +++ new/libcaes-20220529/libcaes/libcaes.rc 2022-05-29 21:07:20.000000000 +0200 @@ -22,12 +22,12 @@ BLOCK "040904E4" BEGIN VALUE "FileDescription", "Library to support cross-platform AES encryption\0" - VALUE "FileVersion", "20220424" "\0" + VALUE "FileVersion", "20220529" "\0" VALUE "InternalName", "libcaes.dll\0" VALUE "LegalCopyright", "(C) 2011-2022, Joachim Metz <joachim.metz@gmail.com>\0" VALUE "OriginalFilename", "libcaes.dll\0" VALUE "ProductName", "libcaes\0" - VALUE "ProductVersion", "20220424" "\0" + VALUE "ProductVersion", "20220529" "\0" VALUE "Comments", "For more information visit https://github.com/libyal/libcaes/\0" END END diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/libcaes/libcaes_context.c new/libcaes-20220529/libcaes/libcaes_context.c --- old/libcaes-20220424/libcaes/libcaes_context.c 2022-04-25 07:39:17.000000000 +0200 +++ new/libcaes-20220529/libcaes/libcaes_context.c 2022-05-29 20:55:04.000000000 +0200 @@ -32,6 +32,10 @@ #include <openssl/evp.h> #endif +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) +#include <openssl/core_names.h> +#endif + #include "libcaes_context.h" #include "libcaes_definitions.h" #include "libcaes_libcerror.h" @@ -1366,7 +1370,16 @@ uint8_t block_data[ EVP_MAX_BLOCK_LENGTH ]; char error_string[ 256 ]; +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + OSSL_PARAM parameters[2]; + + EVP_CIPHER *cipher = NULL; + const char *cipher_string = NULL; + unsigned int padding = 0; +#else const EVP_CIPHER *cipher = NULL; +#endif + libcaes_internal_context_t *internal_context = NULL; static char *function = "libcaes_crypt_cbc"; unsigned long error_code = 0; @@ -1502,10 +1515,91 @@ "%s: unable to clear input block data.", function ); - return( -1 ); + goto on_error; + } +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( EVP_CIPHER_CTX_reset( + internal_context->evp_cipher_context ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to reset cipher context with error: %s.", + function, + error_string ); + + goto on_error; } if( internal_context->key_bit_size == 128 ) { + cipher_string = "AES-128-CBC"; + } + else if( internal_context->key_bit_size == 192 ) + { + cipher_string = "AES-192-CBC"; + } + else if( internal_context->key_bit_size == 256 ) + { + cipher_string = "AES-256-CBC"; + } + cipher = EVP_CIPHER_fetch( + NULL, + cipher_string, + NULL ); + + if( cipher == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing cipher.", + function ); + + goto on_error; + } + parameters[0] = OSSL_PARAM_construct_uint( + OSSL_CIPHER_PARAM_PADDING, + &padding ); + + parameters[1] = OSSL_PARAM_construct_end(); + + if( EVP_CipherInit_ex2( + internal_context->evp_cipher_context, + cipher, + (unsigned char *) internal_context->key, + (unsigned char *) initialization_vector, + mode, + parameters ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize cipher with error: %s.", + function, + error_string ); + + goto on_error; + } +#else + if( internal_context->key_bit_size == 128 ) + { cipher = EVP_aes_128_cbc(); } else if( internal_context->key_bit_size == 192 ) @@ -1539,7 +1633,7 @@ function, error_string ); - return( -1 ); + goto on_error; } if( EVP_CIPHER_CTX_set_padding( internal_context->evp_cipher_context, @@ -1560,8 +1654,10 @@ function, error_string ); - return( -1 ); + goto on_error; } +#endif /* defined( HAVE_EVP_CIPHERINIT_EX2 ) */ + if( EVP_CipherUpdate( internal_context->evp_cipher_context, (unsigned char *) output_data, @@ -1584,7 +1680,7 @@ function, error_string ); - return( -1 ); + goto on_error; } /* Just ignore the output of this function */ @@ -1593,7 +1689,21 @@ (unsigned char *) block_data, &safe_output_data_size ); +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + EVP_CIPHER_free( + cipher ); +#endif return( 1 ); + +on_error: +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( cipher != NULL ) + { + EVP_CIPHER_free( + cipher ); + } +#endif + return( -1 ); } #else @@ -2516,11 +2626,19 @@ uint8_t block_data[ EVP_MAX_BLOCK_LENGTH ]; char error_string[ 256 ]; +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + OSSL_PARAM parameters[2]; + + EVP_CIPHER *cipher = NULL; + const char *cipher_string = NULL; + unsigned int padding = 0; +#else const EVP_CIPHER *cipher = NULL; +#endif + libcaes_internal_context_t *internal_context = NULL; static char *function = "libcaes_crypt_ecb"; unsigned long error_code = 0; - int result = 1; int safe_output_data_size = 0; if( context == NULL ) @@ -2619,8 +2737,89 @@ "%s: unable to clear block data.", function ); - return( -1 ); + goto on_error; + } +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( EVP_CIPHER_CTX_reset( + internal_context->evp_cipher_context ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to reset cipher context with error: %s.", + function, + error_string ); + + goto on_error; + } + if( internal_context->key_bit_size == 128 ) + { + cipher_string = "AES-128-ECB"; + } + else if( internal_context->key_bit_size == 192 ) + { + cipher_string = "AES-192-ECB"; + } + else if( internal_context->key_bit_size == 256 ) + { + cipher_string = "AES-256-ECB"; + } + cipher = EVP_CIPHER_fetch( + NULL, + cipher_string, + NULL ); + + if( cipher == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing cipher.", + function ); + + goto on_error; } + parameters[0] = OSSL_PARAM_construct_uint( + OSSL_CIPHER_PARAM_PADDING, + &padding ); + + parameters[1] = OSSL_PARAM_construct_end(); + + if( EVP_CipherInit_ex2( + internal_context->evp_cipher_context, + cipher, + (unsigned char *) internal_context->key, + NULL, + mode, + parameters ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize cipher with error: %s.", + function, + error_string ); + + goto on_error; + } +#else if( internal_context->key_bit_size == 128 ) { cipher = EVP_aes_128_ecb(); @@ -2656,7 +2855,7 @@ function, error_string ); - return( -1 ); + goto on_error; } if( EVP_CIPHER_CTX_set_padding( internal_context->evp_cipher_context, @@ -2677,8 +2876,10 @@ function, error_string ); - return( -1 ); + goto on_error; } +#endif /* defined( HAVE_EVP_CIPHERINIT_EX2 ) */ + if( EVP_CipherUpdate( internal_context->evp_cipher_context, (unsigned char *) output_data, @@ -2701,7 +2902,7 @@ function, error_string ); - return( -1 ); + goto on_error; } /* Just ignore the output of this function */ @@ -2710,7 +2911,21 @@ (unsigned char *) block_data, &safe_output_data_size ); - return( result ); +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + EVP_CIPHER_free( + cipher ); +#endif + return( 1 ); + +on_error: +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( cipher != NULL ) + { + EVP_CIPHER_free( + cipher ); + } +#endif + return( -1 ); } #else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/libcaes/libcaes_definitions.h new/libcaes-20220529/libcaes/libcaes_definitions.h --- old/libcaes-20220424/libcaes/libcaes_definitions.h 2022-04-25 07:43:17.000000000 +0200 +++ new/libcaes-20220529/libcaes/libcaes_definitions.h 2022-05-29 21:07:20.000000000 +0200 @@ -34,11 +34,11 @@ * for local use of libcaes */ #else -#define LIBCAES_VERSION 20220424 +#define LIBCAES_VERSION 20220529 /* The libcaes version string */ -#define LIBCAES_VERSION_STRING "20220424" +#define LIBCAES_VERSION_STRING "20220529" /* The crypt modes */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/libcaes/libcaes_tweaked_context.c new/libcaes-20220529/libcaes/libcaes_tweaked_context.c --- old/libcaes-20220424/libcaes/libcaes_tweaked_context.c 2022-04-25 07:39:17.000000000 +0200 +++ new/libcaes-20220529/libcaes/libcaes_tweaked_context.c 2022-05-29 20:55:34.000000000 +0200 @@ -29,6 +29,10 @@ #include <openssl/evp.h> #endif +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) +#include <openssl/core_names.h> +#endif + #include "libcaes_context.h" #include "libcaes_definitions.h" #include "libcaes_libcerror.h" @@ -469,7 +473,16 @@ uint8_t block_data[ EVP_MAX_BLOCK_LENGTH ]; char error_string[ 256 ]; +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + OSSL_PARAM parameters[2]; + + EVP_CIPHER *cipher = NULL; + const char *cipher_string = NULL; + unsigned int padding = 0; +#else const EVP_CIPHER *cipher = NULL; +#endif + libcaes_internal_tweaked_context_t *internal_tweaked_context = NULL; static char *function = "libcaes_crypt_xts"; unsigned long error_code = 0; @@ -600,8 +613,85 @@ "%s: unable to clear input block data.", function ); - return( -1 ); + goto on_error; + } +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( EVP_CIPHER_CTX_reset( + internal_context->evp_cipher_context ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to reset cipher context with error: %s.", + function, + error_string ); + + goto on_error; + } + if( internal_tweaked_context->key_bit_size == 128 ) + { + cipher_string = "AES-128-XTS"; + } + else if( internal_tweaked_context->key_bit_size == 256 ) + { + cipher_string = "AES-256-XTS"; + } + cipher = EVP_CIPHER_fetch( + NULL, + cipher_string, + NULL ); + + if( cipher == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing cipher.", + function ); + + goto on_error; } + parameters[0] = OSSL_PARAM_construct_uint( + OSSL_CIPHER_PARAM_PADDING, + &padding ); + + parameters[1] = OSSL_PARAM_construct_end(); + + if( EVP_CipherInit_ex2( + internal_tweaked_context->evp_cipher_context, + cipher, + (unsigned char *) internal_tweaked_context->key, + (unsigned char *) tweak_value, + mode, + parameters ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize cipher with error: %s.", + function, + error_string ); + + goto on_error; + } +#else if( internal_tweaked_context->key_bit_size == 128 ) { cipher = EVP_aes_128_xts(); @@ -633,7 +723,7 @@ function, error_string ); - return( -1 ); + goto on_error; } if( EVP_CIPHER_CTX_set_padding( internal_tweaked_context->evp_cipher_context, @@ -654,8 +744,10 @@ function, error_string ); - return( -1 ); + goto on_error; } +#endif /* defined( HAVE_EVP_CIPHERINIT_EX2 ) */ + if( EVP_CipherUpdate( internal_tweaked_context->evp_cipher_context, (unsigned char *) output_data, @@ -678,7 +770,7 @@ function, error_string ); - return( -1 ); + goto on_error; } /* Just ignore the output of this function */ @@ -687,7 +779,21 @@ (unsigned char *) block_data, &safe_output_data_size ); +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + EVP_CIPHER_free( + cipher ); +#endif return( 1 ); + +on_error: +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( cipher != NULL ) + { + EVP_CIPHER_free( + cipher ); + } +#endif + return( -1 ); } #else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/libcaes.spec new/libcaes-20220529/libcaes.spec --- old/libcaes-20220424/libcaes.spec 2022-04-25 07:43:17.000000000 +0200 +++ new/libcaes-20220529/libcaes.spec 2022-05-29 21:07:20.000000000 +0200 @@ -1,5 +1,5 @@ Name: libcaes -Version: 20220424 +Version: 20220529 Release: 1 Summary: Library to support cross-platform AES encryption Group: System Environment/Libraries @@ -87,6 +87,6 @@ %{_libdir}/python3*/site-packages/*.so %changelog -* Mon Apr 25 2022 Joachim Metz <joachim.metz@gmail.com> 20220424-1 +* Sun May 29 2022 Joachim Metz <joachim.metz@gmail.com> 20220529-1 - Auto-generated diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/m4/libcrypto.m4 new/libcaes-20220529/m4/libcrypto.m4 --- old/libcaes-20220424/m4/libcrypto.m4 2021-06-26 06:29:08.000000000 +0200 +++ new/libcaes-20220529/m4/libcrypto.m4 2022-05-29 19:57:16.000000000 +0200 @@ -1,6 +1,6 @@ dnl Checks for libcrypto required headers and functions dnl -dnl Version: 20210623 +dnl Version: 20220529 dnl Function to detect whether openssl/evp.h can be used in combination with zlib.h AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP_ZLIB_COMPATIBILE], @@ -434,15 +434,41 @@ AC_CHECK_LIB( crypto, - EVP_CIPHER_CTX_set_padding, + EVP_CipherInit_ex2, [ac_cv_libcrypto_dummy=yes], - [ac_cv_libcrypto_evp_cipher=no]) + [ac_cv_libcrypto_dummy=no]) + + AS_IF( + [test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes], + [dnl Check for OpenSSL 3 API functions + AC_CHECK_LIB( + crypto, + EVP_CIPHER_CTX_reset, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_cipher=no]) + AC_CHECK_LIB( + crypto, + EVP_CIPHER_fetch, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_cipher=no]) + AC_CHECK_LIB( + crypto, + EVP_CIPHER_free, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_cipher=no]) + ], + [AC_CHECK_LIB( + crypto, + EVP_CipherInit_ex, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_cipher=no]) + AC_CHECK_LIB( + crypto, + EVP_CIPHER_CTX_set_padding, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_cipher=no]) + ]) - AC_CHECK_LIB( - crypto, - EVP_CipherInit_ex, - [ac_cv_libcrypto_dummy=yes], - [ac_cv_libcrypto_evp_cipher=no]) AC_CHECK_LIB( crypto, EVP_CipherUpdate, @@ -476,6 +502,14 @@ [1], [Define to 1 if you have the `EVP_CIPHER_CTX_cleanup' function".]) ]) + + AS_IF( + [test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes], + [AC_DEFINE( + [HAVE_EVP_CIPHERINIT_EX2], + [1], + [Define to 1 if you have the `EVP_CipherInit_ex2' function".]) + ]) ]) dnl Function to detect if openssl AES-CBC and AES-ECB functions are available diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/missing new/libcaes-20220529/missing --- old/libcaes-20220424/missing 2022-04-25 07:43:07.000000000 +0200 +++ new/libcaes-20220529/missing 2022-05-29 21:07:10.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcaes-20220424/test-driver new/libcaes-20220529/test-driver --- old/libcaes-20220424/test-driver 2022-04-25 07:43:07.000000000 +0200 +++ new/libcaes-20220529/test-driver 2022-05-29 21:07:11.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # 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 @@ -42,11 +42,13 @@ { cat <<END Usage: - test-driver --test-name=NAME --log-file=PATH --trs-file=PATH - [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] + test-driver --test-name NAME --log-file PATH --trs-file PATH + [--expect-failure {yes|no}] [--color-tests {yes|no}] + [--enable-hard-errors {yes|no}] [--] TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] + The '--test-name', '--log-file' and '--trs-file' options are mandatory. +See the GNU Automake documentation for information. END } @@ -103,8 +105,11 @@ trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 -# Test script is run here. -"$@" >$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -126,7 +131,7 @@ # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name"
participants (1)
-
Source-Sync