8ac718f8496a6fbfbf00248a68e740a10c0bcf81 galt Tue Nov 26 00:42:19 2024 -0800 This change accomodates upgrade to openssl3.3 and mariadb10 using custom-compiled libmariadb.a. These files are in /cluster/software/maridb and /cluster/software/openssl. refs #34014,#27440. It also handles the new mariadb 10 and 11 that have configuration with ssl turned on by default. diff --git src/utils/twoBitDup/twoBitDup.c src/utils/twoBitDup/twoBitDup.c index 5cf49d3..f203025 100644 --- src/utils/twoBitDup/twoBitDup.c +++ src/utils/twoBitDup/twoBitDup.c @@ -1,28 +1,31 @@ /* twoBitDup - check to see if a twobit file has any identical sequences in it. */ /* Copyright (C) 2013 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ +#include <openssl/md5.h> +#include <openssl/macros.h> +#include <openssl/evp.h> + #include "common.h" #include "linefile.h" #include "hash.h" #include "options.h" #include "twoBit.h" #include "dnaseq.h" #include "math.h" #include "udc.h" -#include <openssl/md5.h> // static char const rcsid[] = "$Id: newProg.c,v 1.30 2010/03/24 21:18:33 hiram Exp $"; void usage() /* Explain usage and exit. */ { errAbort( "twoBitDup - check to see if a twobit file has any identical sequences in it\n" "usage:\n" " twoBitDup file.2bit\n" "options:\n" " -keyList=file - file to write a key list, two columns: md5sum and sequenceName\n" " -udcDir=/dir/to/cache - place to put cache for remote bigBed/bigWigs\n" "\nexample: twoBitDup -keyList=stdout db.2bit \\\n" " | grep -v 'are identical' | sort > db.idKeys.txt" @@ -65,31 +68,37 @@ struct hashEl *hel; if ((hel = hashLookup(seqHash, seq->dna)) != NULL) printf("%s and %s are identical\n", index->name, (char *)hel->val); else hel = hashAdd(seqHash, seq->dna, index->name); if (keyListFile) { /* This used to be extremely slow: #include "md5.h" char *md5Sum = md5HexForString(seq->dna); fprintf(keyListFile, "%s\t%s\n", md5Sum, index->name); freeMem(md5Sum); * changed to use MD5() in openssl 2020-12-04: */ unsigned char md5Result[MD5_DIGEST_LENGTH]; + +#if OPENSSL_VERSION_NUMBER < 0x10100000L // # 1.1 MD5((unsigned char *)seq->dna, strlen(seq->dna), md5Result); +#else + EVP_Q_digest(NULL, "MD5", NULL, seq->dna, strlen(seq->dna), md5Result, NULL); +#endif + int i; struct dyString *ds = dyStringNew(MD5_DIGEST_LENGTH); for(i = 0; i < MD5_DIGEST_LENGTH; i++) { dyStringPrintf(ds, "%02x", md5Result[i]); } fprintf(keyListFile, "%s\t%s\n", ds->string, index->name); dyStringFree(&ds); } freeDnaSeq(&seq); } } int main(int argc, char *argv[]) /* Process command line. */