Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
duo_unix openssl 1.1.0 update
# Update hmac related code for changes in openssl 1.1.0
# Author: Evan Anderson <evananderson@thelinuxman.us>
--- a/lib/https.c 2016-08-08 13:55:29.000000000 -0400
+++ b/lib/https.c 2017-04-24 15:31:51.980702951 -0400
@@ -623,7 +623,7 @@
int argc, char *argv[])
{
BIO *b64;
- HMAC_CTX hmac;
+ HMAC_CTX *hmac;
unsigned char MD[SHA_DIGEST_LENGTH];
char *qs, *p;
int i, n, is_get;
@@ -655,11 +655,11 @@
/* Add signature */
BIO_puts(req->cbio, "Authorization: Basic ");
- HMAC_CTX_init(&hmac);
- HMAC_Init(&hmac, ctx->skey, strlen(ctx->skey), EVP_sha1());
- HMAC_Update(&hmac, (unsigned char *)p, strlen(p));
- HMAC_Final(&hmac, MD, NULL);
- HMAC_CTX_cleanup(&hmac);
+ hmac = HMAC_CTX_new();
+ HMAC_Init(hmac, ctx->skey, strlen(ctx->skey), EVP_sha1());
+ HMAC_Update(hmac, (unsigned char *)p, strlen(p));
+ HMAC_Final(hmac, MD, NULL);
+ HMAC_CTX_free(hmac);
free(p);
b64 = _BIO_new_base64();
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
patch -p1 -i ../../hmac_fixup.patch
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.