Skip to content

Commit

Permalink
remove MD5SHA1 OpenSSL 1.0.2 backport
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Dec 20, 2024
1 parent 6e4e578 commit 4dd54b7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 134 deletions.
3 changes: 2 additions & 1 deletion evp.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ func loadHash(ch crypto.Hash) *hashAlgorithm {
hash.marshalledSize = md5MarshaledSize
case crypto.MD5SHA1:
if vMajor == 1 && vMinor == 0 {
hash.md = C.go_openssl_EVP_md5_sha1_backport()
// OpenSSL 1.0.2 does not support MD5SHA1.
hash.md = nil
} else {
hash.md = C.go_openssl_EVP_md5_sha1()
}
Expand Down
1 change: 0 additions & 1 deletion goopenssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ int go_openssl_version_minor(void* handle);
int go_openssl_version_patch(void* handle);
int go_openssl_thread_setup(void);
void go_openssl_load_functions(void* handle, unsigned int major, unsigned int minor, unsigned int patch);
const GO_EVP_MD_PTR go_openssl_EVP_md5_sha1_backport(void);
void go_openssl_DSA_get0_pqg_backport(const GO_DSA_PTR d, GO_BIGNUM_PTR *p, GO_BIGNUM_PTR *q, GO_BIGNUM_PTR *g);
int go_openssl_DSA_set0_pqg_backport(GO_DSA_PTR d, GO_BIGNUM_PTR p, GO_BIGNUM_PTR q, GO_BIGNUM_PTR g);
void go_openssl_DSA_get0_key_backport(const GO_DSA_PTR d, GO_BIGNUM_PTR *pub_key, GO_BIGNUM_PTR *priv_key);
Expand Down
126 changes: 0 additions & 126 deletions port_evp_md5_sha1.c

This file was deleted.

6 changes: 0 additions & 6 deletions shims.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,6 @@ DEFINEFUNC(int, EVP_DigestSignFinal, (GO_EVP_MD_CTX_PTR ctx, unsigned char *sig,
DEFINEFUNC(int, EVP_DigestVerifyInit, (GO_EVP_MD_CTX_PTR ctx, GO_EVP_PKEY_CTX_PTR *pctx, const GO_EVP_MD_PTR type, GO_ENGINE_PTR e, GO_EVP_PKEY_PTR pkey), (ctx, pctx, type, e, pkey)) \
DEFINEFUNC(int, EVP_DigestVerifyFinal, (GO_EVP_MD_CTX_PTR ctx, const unsigned char *sig, size_t siglen), (ctx, sig, siglen)) \
DEFINEFUNC_1_1_1(int, EVP_DigestVerify, (GO_EVP_MD_CTX_PTR ctx, const unsigned char *sigret, size_t siglen, const unsigned char *tbs, size_t tbslen), (ctx, sigret, siglen, tbs, tbslen)) \
DEFINEFUNC_LEGACY_1_0(int, MD5_Init, (GO_MD5_CTX_PTR c), (c)) \
DEFINEFUNC_LEGACY_1_0(int, MD5_Update, (GO_MD5_CTX_PTR c, const void *data, size_t len), (c, data, len)) \
DEFINEFUNC_LEGACY_1_0(int, MD5_Final, (unsigned char *md, GO_MD5_CTX_PTR c), (md, c)) \
DEFINEFUNC_LEGACY_1_0(int, SHA1_Init, (GO_SHA_CTX_PTR c), (c)) \
DEFINEFUNC_LEGACY_1_0(int, SHA1_Update, (GO_SHA_CTX_PTR c, const void *data, size_t len), (c, data, len)) \
DEFINEFUNC_LEGACY_1_0(int, SHA1_Final, (unsigned char *md, GO_SHA_CTX_PTR c), (md, c)) \
DEFINEFUNC_1_1(const GO_EVP_MD_PTR, EVP_md5_sha1, (void), ()) \
DEFINEFUNC(const GO_EVP_MD_PTR, EVP_ripemd160, (void), ()) \
DEFINEFUNC(const GO_EVP_MD_PTR, EVP_md4, (void), ()) \
Expand Down

0 comments on commit 4dd54b7

Please sign in to comment.