[SCM] The rsync repository. - branch master updated
The branch, master has been updated via 1c9bb168 Unify the checksum context memory, since we only use one at a time. from 799de21a Fixed the use of openssl MD4 for transfer checksums. https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log - commit 1c9bb168bb0d40fd47f1fc7fbb0a278db3da7c0d Author: Wayne Davison Date: Sat May 23 18:25:11 2020 -0700 Unify the checksum context memory, since we only use one at a time. --- Summary of changes: checksum.c | 70 +- 1 file changed, 37 insertions(+), 33 deletions(-) Changeset truncated at 500 lines: diff --git a/checksum.c b/checksum.c index 3a6959b2..4176b099 100644 --- a/checksum.c +++ b/checksum.c @@ -315,14 +315,9 @@ uint32 get_checksum1(char *buf1, int32 len) void get_checksum2(char *buf, int32 len, char *sum) { - md_context m; -#ifdef USE_OPENSSL - MD4_CTX m4; -#endif - MD5_CTX m5; - switch (xfersum_type) { case CSUM_MD5: { + MD5_CTX m5; uchar seedbuf[4]; MD5_Init(); if (proper_seed_order) { @@ -344,6 +339,7 @@ void get_checksum2(char *buf, int32 len, char *sum) case CSUM_MD4: #ifdef USE_OPENSSL { + MD4_CTX m4; MD4_Init(); MD4_Update(, (uchar *)buf, len); if (checksum_seed) { @@ -358,6 +354,7 @@ void get_checksum2(char *buf, int32 len, char *sum) case CSUM_MD4_OLD: case CSUM_MD4_BUSTED: case CSUM_MD4_ARCHAIC: { + md_context m; int32 i; static char *buf1; static int32 len1; @@ -408,11 +405,6 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) { struct map_struct *buf; OFF_T i, len = st_p->st_size; - md_context m; -#ifdef USE_OPENSSL - MD4_CTX m4; -#endif - MD5_CTX m5; int32 remainder; int fd; @@ -425,7 +417,9 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) buf = map_file(fd, len, MAX_MAP_SIZE, CSUM_CHUNK); switch (checksum_type) { - case CSUM_MD5: + case CSUM_MD5: { + MD5_CTX m5; + MD5_Init(); for (i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) @@ -437,8 +431,12 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) MD5_Final((uchar *)sum, ); break; + } case CSUM_MD4: #ifdef USE_OPENSSL + { + MD4_CTX m4; + MD4_Init(); for (i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) @@ -450,10 +448,13 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) MD4_Final((uchar *)sum, ); break; + } #endif case CSUM_MD4_OLD: case CSUM_MD4_BUSTED: - case CSUM_MD4_ARCHAIC: + case CSUM_MD4_ARCHAIC: { + md_context m; + mdfour_begin(); for (i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) @@ -469,6 +470,7 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) mdfour_result(, (uchar *)sum); break; + } #ifdef SUPPORT_XXHASH case CSUM_XXHASH: { XXH64_state_t* state = XXH64_createState(); @@ -507,11 +509,13 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) } static int32 sumresidue; -static md_context md; +static union { + md_context md; #ifdef USE_OPENSSL -static MD4_CTX m4; + MD4_CTX m4; #endif -static MD5_CTX m5; + MD5_CTX m5; +} ctx; static int cursum_type; #ifdef SUPPORT_XXHASH XXH64_state_t* xxh64_state = NULL; @@ -527,20 +531,20 @@ void sum_init(int csum_type, int seed) switch (csum_type) { case CSUM_MD5: - MD5_Init(); + MD5_Init(); break; case CSUM_MD4: #ifdef USE_OPENSSL - MD4_Init(); + MD4_Init(); #else - mdfour_begin(); + mdfour_begin(); sumresidue = 0; #endif break; case CSUM_MD4_OLD: case CSUM_MD4_BUSTED: case CSUM_MD4_ARCHAIC: - mdfour_begin(); + mdfour_begin(); sumresidue = 0; SIVAL(s, 0, seed); sum_update(s, 4); @@ -577,39 +581,39 @@ void sum_update(const char *p, int32 len) { switch (cursum_type) { case CSUM_MD5: - MD5_Update(, (uchar *)p, len); + MD5_Update(, (uchar *)p, len); break; case CSUM_MD4: #ifdef USE_OPENSSL -
[SCM] The rsync repository. - branch master updated
The branch, master has been updated via 799de21a Fixed the use of openssl MD4 for transfer checksums. from 1cb1edeb Optional openssl support for MD4 pre-transfer checksums (but, sadly, not transfer checksums). https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log - commit 799de21af61ad7b3018749e8a3f0f0319af54521 Author: Wayne Davison Date: Sat May 23 16:22:36 2020 -0700 Fixed the use of openssl MD4 for transfer checksums. --- Summary of changes: checksum.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/checksum.c b/checksum.c index 596a31ad..3a6959b2 100644 --- a/checksum.c +++ b/checksum.c @@ -316,7 +316,7 @@ uint32 get_checksum1(char *buf1, int32 len) void get_checksum2(char *buf, int32 len, char *sum) { md_context m; -#if 0 /* #ifdef USE_OPENSSL */ +#ifdef USE_OPENSSL MD4_CTX m4; #endif MD5_CTX m5; @@ -342,15 +342,15 @@ void get_checksum2(char *buf, int32 len, char *sum) break; } case CSUM_MD4: -#if 0 /* #ifdef USE_OPENSSL -- this doesn't match the old checksums. */ +#ifdef USE_OPENSSL { MD4_Init(); + MD4_Update(, (uchar *)buf, len); if (checksum_seed) { uchar seedbuf[4]; SIVALu(seedbuf, 0, checksum_seed); MD4_Update(, seedbuf, 4); } - MD4_Update(, (uchar *)buf, len); MD4_Final((uchar *)sum, ); break; } -- The rsync repository. ___ rsync-cvs mailing list rsync-cvs@lists.samba.org https://lists.samba.org/mailman/listinfo/rsync-cvs
[SCM] The rsync repository. - branch master updated
The branch, master has been updated via 1cb1edeb Optional openssl support for MD4 pre-transfer checksums (but, sadly, not transfer checksums). from 15c1162b Add optional use of the openssl crypto lib for MD5. https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log - commit 1cb1edeb6853abe89e66fa10f8d3a532a909c2f8 Author: Wayne Davison Date: Sat May 23 12:26:06 2020 -0700 Optional openssl support for MD4 pre-transfer checksums (but, sadly, not transfer checksums). --- Summary of changes: NEWS | 10 +- checksum.c | 59 --- configure.ac | 4 ++-- 3 files changed, 59 insertions(+), 14 deletions(-) Changeset truncated at 500 lines: diff --git a/NEWS b/NEWS index 5509..ecd469ff 100644 --- a/NEWS +++ b/NEWS @@ -39,11 +39,11 @@ Changes since 3.1.3: ENHANCEMENTS: - Various checksum enhancements, including the optional use of openssl's - MD5 checksum algorithms, x86_64 optimizations for the rolling checksum, - x86_64 optimizations for the (non-openssl) MD5 checksum, the addition of - xxhash checksum support, and a simple checksum negotation heuristic that - will ensure that it is easier to add new checksum algorithms in the - future. Currently the x86_64 optimizations require the use of the + MD4 & MD5 checksum algorithms, some x86_64 optimizations for the rolling + checksum, some x86_64 optimizations for the (non-openssl) MD5 checksum, + the addition of xxhash checksum support, and a simple checksum negotation + heuristic that ensures that it is easier to add new checksum algorithms + in the future. Currently the x86_64 optimizations require the use of the --enable-simd flag to configure, but they will probably be enabled by default in the near future. diff --git a/checksum.c b/checksum.c index 7c4c855c..596a31ad 100644 --- a/checksum.c +++ b/checksum.c @@ -31,6 +31,7 @@ #include "xxhash.h" #endif #ifdef USE_OPENSSL +#include "openssl/md4.h" #include "openssl/md5.h" #endif @@ -121,7 +122,7 @@ static const char *checksum_name(int num) if (num < CSUM_MD4) return "MD4"; - return "UNKNOWN"; + return "UNKNOWN"; /* IMPOSSIBLE */ } void parse_checksum_choice(int final_call) @@ -315,6 +316,9 @@ uint32 get_checksum1(char *buf1, int32 len) void get_checksum2(char *buf, int32 len, char *sum) { md_context m; +#if 0 /* #ifdef USE_OPENSSL */ + MD4_CTX m4; +#endif MD5_CTX m5; switch (xfersum_type) { @@ -338,6 +342,19 @@ void get_checksum2(char *buf, int32 len, char *sum) break; } case CSUM_MD4: +#if 0 /* #ifdef USE_OPENSSL -- this doesn't match the old checksums. */ + { + MD4_Init(); + if (checksum_seed) { + uchar seedbuf[4]; + SIVALu(seedbuf, 0, checksum_seed); + MD4_Update(, seedbuf, 4); + } + MD4_Update(, (uchar *)buf, len); + MD4_Final((uchar *)sum, ); + break; + } +#endif case CSUM_MD4_OLD: case CSUM_MD4_BUSTED: case CSUM_MD4_ARCHAIC: { @@ -392,6 +409,9 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) struct map_struct *buf; OFF_T i, len = st_p->st_size; md_context m; +#ifdef USE_OPENSSL + MD4_CTX m4; +#endif MD5_CTX m5; int32 remainder; int fd; @@ -408,10 +428,8 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) case CSUM_MD5: MD5_Init(); - for (i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) { - MD5_Update(, (uchar *)map_ptr(buf, i, CSUM_CHUNK), - CSUM_CHUNK); - } + for (i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) + MD5_Update(, (uchar *)map_ptr(buf, i, CSUM_CHUNK), CSUM_CHUNK); remainder = (int32)(len - i); if (remainder > 0) @@ -420,14 +438,26 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) MD5_Final((uchar *)sum, ); break; case CSUM_MD4: +#ifdef USE_OPENSSL + MD4_Init(); + + for (i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) + MD4_Update(, (uchar *)map_ptr(buf, i, CSUM_CHUNK), CSUM_CHUNK); + + remainder = (int32)(len - i); + if (remainder > 0) + MD4_Update(, (uchar *)map_ptr(buf, i, remainder), remainder); + + MD4_Final((uchar *)sum, ); + break; +#endif case CSUM_MD4_OLD: case
[SCM] The rsync repository. - branch master updated
The branch, master has been updated via 15c1162b Add optional use of the openssl crypto lib for MD5. from a7175ee0 Mention a few more news items. https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log - commit 15c1162b24f51b29cbd534b2e8f732e06995ef89 Author: Wayne Davison Date: Sat May 23 09:23:01 2020 -0700 Add optional use of the openssl crypto lib for MD5. --- Summary of changes: NEWS | 9 + checksum.c| 46 +- configure.ac | 28 +--- lib/md5.c | 6 -- lib/mdfour.c | 3 ++- lib/mdigest.h | 6 ++ 6 files changed, 67 insertions(+), 31 deletions(-) Changeset truncated at 500 lines: diff --git a/NEWS b/NEWS index edf59452..5509 100644 --- a/NEWS +++ b/NEWS @@ -38,10 +38,11 @@ Changes since 3.1.3: ENHANCEMENTS: -- Various checksum enhancements, including x86_64 optimizations for the - rolling checksum, optimizations for the MD5 checksums, the addition of - xxhash checksums, and a simple checksum negotation heuristic that will - ensure that it is easier to add improved checksum algorithms in the +- Various checksum enhancements, including the optional use of openssl's + MD5 checksum algorithms, x86_64 optimizations for the rolling checksum, + x86_64 optimizations for the (non-openssl) MD5 checksum, the addition of + xxhash checksum support, and a simple checksum negotation heuristic that + will ensure that it is easier to add new checksum algorithms in the future. Currently the x86_64 optimizations require the use of the --enable-simd flag to configure, but they will probably be enabled by default in the near future. diff --git a/checksum.c b/checksum.c index a21222d4..7c4c855c 100644 --- a/checksum.c +++ b/checksum.c @@ -10,6 +10,13 @@ * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * + * In addition, as a special exception, the copyright holders give + * permission to dynamically link rsync with the OpenSSL and xxhash + * libraries when those libraries are being distributed in compliance + * with their license terms, and to distribute a dynamically linked + * combination of rsync and these libraries. This is also considered + * to be covered under the GPL's System Libraries exception. + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -23,6 +30,9 @@ #ifdef SUPPORT_XXHASH #include "xxhash.h" #endif +#ifdef USE_OPENSSL +#include "openssl/md5.h" +#endif extern int am_server; extern int local_server; @@ -58,6 +68,13 @@ struct csum_struct { #define MAX_CHECKSUM_LIST 1024 +#ifndef USE_OPENSSL +#define MD5_CTX md_context +#define MD5_Init md5_begin +#define MD5_Update md5_update +#define MD5_Final(digest, cptr) md5_result(cptr, digest) +#endif + int xfersum_type = 0; /* used for the file transfer checksums */ int checksum_type = 0; /* used for the pre-transfer (--checksum) checksums */ const char *negotiated_csum_name = NULL; @@ -298,25 +315,26 @@ uint32 get_checksum1(char *buf1, int32 len) void get_checksum2(char *buf, int32 len, char *sum) { md_context m; + MD5_CTX m5; switch (xfersum_type) { case CSUM_MD5: { uchar seedbuf[4]; - md5_begin(); + MD5_Init(); if (proper_seed_order) { if (checksum_seed) { SIVALu(seedbuf, 0, checksum_seed); - md5_update(, seedbuf, 4); + MD5_Update(, seedbuf, 4); } - md5_update(, (uchar *)buf, len); + MD5_Update(, (uchar *)buf, len); } else { - md5_update(, (uchar *)buf, len); + MD5_Update(, (uchar *)buf, len); if (checksum_seed) { SIVALu(seedbuf, 0, checksum_seed); - md5_update(, seedbuf, 4); + MD5_Update(, seedbuf, 4); } } - md5_result(, (uchar *)sum); + MD5_Final((uchar *)sum, ); break; } case CSUM_MD4: @@ -374,6 +392,7 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) struct map_struct *buf; OFF_T i, len = st_p->st_size; md_context m; + MD5_CTX m5; int32 remainder; int fd; @@ -387,18 +406,18 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
[SCM] The rsync repository. - branch master updated
The branch, master has been updated via a7175ee0 Mention a few more news items. from 68516f91 Add "input" handling for cmd_txt_*() pkglib.py. https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log - commit a7175ee0297dc4f8c8680626c3d3f0d4bc6b108f Author: Wayne Davison Date: Fri May 22 23:26:25 2020 -0700 Mention a few more news items. --- Summary of changes: NEWS | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/NEWS b/NEWS index d29ea3c4..edf59452 100644 --- a/NEWS +++ b/NEWS @@ -33,8 +33,19 @@ Changes since 3.1.3: - Fixed a crash in the --iconv code. +- Fixed a bug in the writing of the batch.sh file (w/--write-batch) when + the source & destination args were not last on the command-line. + ENHANCEMENTS: +- Various checksum enhancements, including x86_64 optimizations for the + rolling checksum, optimizations for the MD5 checksums, the addition of + xxhash checksums, and a simple checksum negotation heuristic that will + ensure that it is easier to add improved checksum algorithms in the + future. Currently the x86_64 optimizations require the use of the + --enable-simd flag to configure, but they will probably be enabled by + default in the near future. + - Improved the --atimes patch and promoted it to be in the release. - Added --open-noatime option to open files using O_NOATIME. @@ -42,7 +53,7 @@ Changes since 3.1.3: - Improved the --write-devices patch and promoted it to be in the release. - Added openssl support to the rsync-ssl script via its renamed helper - script, rsync-ssl-rsh. Install both bash scripts by default now + script, rsync-ssl-rsh. Both bash scripts are now installed by default (removing the install-ssl-client make target). Rsync was also enhanced to set the RSYNC_PORT environment variable when running a daemon-over-rsh script. Its value is the user-specified port number (set via --port or an -- The rsync repository. ___ rsync-cvs mailing list rsync-cvs@lists.samba.org https://lists.samba.org/mailman/listinfo/rsync-cvs