Skip to content

Instantly share code, notes, and snippets.

@evan-a-a
Created April 24, 2017 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evan-a-a/80ee1f566251b110eb6f329790ebcf1e to your computer and use it in GitHub Desktop.
Save evan-a-a/80ee1f566251b110eb6f329790ebcf1e to your computer and use it in GitHub Desktop.
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