Skip to content

Commit

Permalink
Openssl 3.4.0 (#377)
Browse files Browse the repository at this point in the history
* update to openssl 3.4.0
* use sha256 as checksum instead of sha1
  • Loading branch information
chcg authored Oct 24, 2024
1 parent 9cdbc20 commit d0b9dba
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions build_3rdparty.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
DEPENDENT_LIBS = {
'openssl': {
'order' : 1,
'url' : 'https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz',
'sha1' : 'b7ca08f2d49c10d772c5ec6cf2de6e08e69002b3',
'url' : 'https://github.com/openssl/openssl/releases/download/openssl-3.4.0/openssl-3.4.0.tar.gz',
'sha256' : 'e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf',
'target': {
'mingw-w64': {
'result': ['include/openssl/ssl.h', 'lib/libssl.a', 'lib/libcrypto.a'],
Expand Down Expand Up @@ -44,7 +44,7 @@
'zlib': {
'order' : 2,
'url' : 'https://zlib.net/fossils/zlib-1.3.1.tar.gz',
'sha1' : 'f535367b1a11e2f9ac3bec723fb007fbc0d189e5',
'sha256' : '9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23',
'target': {
'mingw-w64': {
'result': ['include/zlib.h', 'include/zconf.h', 'lib/libz.a'],
Expand Down Expand Up @@ -89,7 +89,7 @@
'order' : 3,
'shadow': True,
'url' : 'https://www.libssh.org/files/0.11/libssh-0.11.1.tar.xz',
'sha1' : '1ddc90daacc4aedd3ab1c5407adc44925e0ba28e',
'sha256' : '14b7dcc72e91e08151c58b981a7b570ab2663f630e7d2837645d5a9c612c1b79',
'target': {
'mingw-w64': {
'result': ['include/libssh/libssh.h', 'lib/libssh.a'],
Expand Down Expand Up @@ -172,12 +172,12 @@ def mkdir_p(*paths):
if not os.path.exists(path):
os.makedirs(path)

def download_file(url, sha1, dir):
def download_file(url, sha256, dir):
name = url.split('/')[-1]
loc = join_path(dir, name)
if os.path.exists(loc):
hash = hashlib.sha1(open(loc, 'rb').read()).hexdigest()
if hash == sha1:
hash = hashlib.sha256(open(loc, 'rb').read()).hexdigest()
if hash == sha256:
return loc
os.remove(loc)
message('Checksum mismatch for %s, re-downloading.\n' % name)
Expand All @@ -186,15 +186,15 @@ def hook(cnt, bs, total):
message("\rDownloading: %s [%d%%]" % (name, pct))
urllib.request.urlretrieve(url, loc, reporthook=hook)
message("\r")
hash = hashlib.sha1(open(loc, 'rb').read()).hexdigest()
if hash != sha1:
hash = hashlib.sha256(open(loc, 'rb').read()).hexdigest()
if hash != sha256:
os.remove(loc)
error('Checksum mismatch for %s, aborting.' % name)
message("\rDownloaded: %s [checksum OK]\n" % name)
return loc

def download_tarball(url, sha1, dir, name):
loc = download_file(url, sha1, dir)
def download_tarball(url, sha256, dir, name):
loc = download_file(url, sha256, dir)
tar = tarfile.open(loc)
sub = tar.getnames()[0]
if '/' in sub:
Expand Down Expand Up @@ -236,7 +236,7 @@ def main(outdir, prefix):
continue
print('-' * 60, library)
download_tarball(DEPENDENT_LIBS[library]['url'],
DEPENDENT_LIBS[library]['sha1'], build, library)
DEPENDENT_LIBS[library]['sha256'], build, library)

if DEPENDENT_LIBS[library].get('shadow'):
rmdir(join_path(build, library+'-build'))
Expand Down

0 comments on commit d0b9dba

Please sign in to comment.