pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/security/libtcpa
Module Name: pkgsrc
Committed By: joerg
Date: Fri Mar 27 20:57:12 UTC 2020
Modified Files:
pkgsrc/security/libtcpa: distinfo
Added Files:
pkgsrc/security/libtcpa/patches: patch-examples_createkey.c
patch-examples_takeown.c patch-libtcpa_hmac.c patch-libtcpa_keys.c
Log Message:
Fix build with OpenSSL 1.1
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 pkgsrc/security/libtcpa/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/security/libtcpa/patches/patch-examples_createkey.c \
pkgsrc/security/libtcpa/patches/patch-examples_takeown.c \
pkgsrc/security/libtcpa/patches/patch-libtcpa_hmac.c \
pkgsrc/security/libtcpa/patches/patch-libtcpa_keys.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/security/libtcpa/distinfo
diff -u pkgsrc/security/libtcpa/distinfo:1.6 pkgsrc/security/libtcpa/distinfo:1.7
--- pkgsrc/security/libtcpa/distinfo:1.6 Wed Nov 4 01:17:50 2015
+++ pkgsrc/security/libtcpa/distinfo Fri Mar 27 20:57:11 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2015/11/04 01:17:50 agc Exp $
+$NetBSD: distinfo,v 1.7 2020/03/27 20:57:11 joerg Exp $
SHA1 (tpm-1.1b.tar.gz) = be59de89ae7ab633e23d4a03c855e3063aaf4c20
RMD160 (tpm-1.1b.tar.gz) = 82fa9e9a9f60cb588319c2d73ca94e948fbc9b26
@@ -11,3 +11,7 @@ Size (tcpa_man_20031210.tgz) = 7794 byte
SHA1 (patch-aa) = 6da066464bd105fda446da801e2d4ca9f11b9394
SHA1 (patch-ab) = 978df91511c61a1067781e54994bad028a047d6a
SHA1 (patch-ac) = 3793ca470d634974aabc32c698db4cfcfce4ca75
+SHA1 (patch-examples_createkey.c) = 1d26a6de2875cbb3921e08dadf7924415b707dbd
+SHA1 (patch-examples_takeown.c) = 05ff728a73b488d9540292cbed5d16bf553e6eff
+SHA1 (patch-libtcpa_hmac.c) = 88862b22b8f357181ec0bfea709ce205070f833d
+SHA1 (patch-libtcpa_keys.c) = c91d1d48e584542ad2635ad054a04f96d4316b19
Added files:
Index: pkgsrc/security/libtcpa/patches/patch-examples_createkey.c
diff -u /dev/null pkgsrc/security/libtcpa/patches/patch-examples_createkey.c:1.1
--- /dev/null Fri Mar 27 20:57:12 2020
+++ pkgsrc/security/libtcpa/patches/patch-examples_createkey.c Fri Mar 27 20:57:12 2020
@@ -0,0 +1,36 @@
+$NetBSD: patch-examples_createkey.c,v 1.1 2020/03/27 20:57:12 joerg Exp $
+
+--- examples/createkey.c.orig 2020-03-27 18:50:53.384965280 +0000
++++ examples/createkey.c
+@@ -21,7 +21,7 @@ int main(int argc, char *argv[])
+ keydata q; /* keydata structure for resulting key */
+ RSA *rsa; /* OpenSSL format Public Key */
+ FILE *keyfile; /* output file for public key */
+- EVP_PKEY pkey; /* OpenSSL public key */
++ EVP_PKEY *pkey; /* OpenSSL public key */
+ unsigned char pkeyname[256]; /* file name string of public key file */
+
+ if (argc < 5) {
+@@ -77,18 +77,20 @@ int main(int argc, char *argv[])
+ }
+ OpenSSL_add_all_algorithms();
+ snprintf(pkeyname,sizeof(pkeyname),"%s.pem", argv[3]);
+- EVP_PKEY_assign_RSA(&pkey, rsa);
++ pkey = EVP_PKEY_new();
++ EVP_PKEY_assign_RSA(pkey, rsa);
+ keyfile = fopen(pkeyname, "w");
+ if (keyfile == NULL) {
+ fprintf(stderr, "Unable to create public key file\n");
+ exit(-1);
+ }
+- ret = PEM_write_PUBKEY(keyfile, &pkey);
++ ret = PEM_write_PUBKEY(keyfile, pkey);
+ if (ret == 0) {
+ fprintf(stderr, "Unable to write public key file\n");
+ exit(-1);
+ }
+ fclose(keyfile);
+ RSA_free(rsa);
++ EVP_PKEY_free(pkey);
+ exit(0);
+ }
Index: pkgsrc/security/libtcpa/patches/patch-examples_takeown.c
diff -u /dev/null pkgsrc/security/libtcpa/patches/patch-examples_takeown.c:1.1
--- /dev/null Fri Mar 27 20:57:12 2020
+++ pkgsrc/security/libtcpa/patches/patch-examples_takeown.c Fri Mar 27 20:57:12 2020
@@ -0,0 +1,36 @@
+$NetBSD: patch-examples_takeown.c,v 1.1 2020/03/27 20:57:12 joerg Exp $
+
+--- examples/takeown.c.orig 2020-03-27 18:49:41.521284560 +0000
++++ examples/takeown.c
+@@ -19,7 +19,7 @@ int main(int argc, char *argv[])
+ keydata srk;
+ RSA *rsa; /* OpenSSL format Public Key */
+ FILE *keyfile; /* output file for public key */
+- EVP_PKEY pkey; /* OpenSSL public key */
++ EVP_PKEY *pkey; /* OpenSSL public key */
+
+ if (argc < 3) {
+ fprintf(stderr, "Usage: takeown <ownerpass> <SRK password>\n");
+@@ -42,18 +42,20 @@ int main(int argc, char *argv[])
+ exit(3);
+ }
+ OpenSSL_add_all_algorithms();
+- EVP_PKEY_assign_RSA(&pkey, rsa);
++ pkey = EVP_PKEY_new();
++ EVP_PKEY_assign_RSA(pkey, rsa);
+ keyfile = fopen("srootkey.pem", "w");
+ if (keyfile == NULL) {
+ fprintf(stderr, "Unable to create public key file\n");
+ exit(4);
+ }
+- ret = PEM_write_PUBKEY(keyfile, &pkey);
++ ret = PEM_write_PUBKEY(keyfile, pkey);
+ if (ret == 0) {
+ fprintf(stderr, "Unable to write public key file\n");
+ exit(5);
+ }
+ fclose(keyfile);
+ RSA_free(rsa);
++ EVP_PKEY_free(pkey);
+ exit(0);
+ }
Index: pkgsrc/security/libtcpa/patches/patch-libtcpa_hmac.c
diff -u /dev/null pkgsrc/security/libtcpa/patches/patch-libtcpa_hmac.c:1.1
--- /dev/null Fri Mar 27 20:57:12 2020
+++ pkgsrc/security/libtcpa/patches/patch-libtcpa_hmac.c Fri Mar 27 20:57:12 2020
@@ -0,0 +1,41 @@
+$NetBSD: patch-libtcpa_hmac.c,v 1.1 2020/03/27 20:57:12 joerg Exp $
+
+--- libtcpa/hmac.c.orig 2020-03-27 18:46:13.942881974 +0000
++++ libtcpa/hmac.c
+@@ -167,25 +167,30 @@ int authhmac(unsigned char *digest, unsi
+ int rawhmac(unsigned char *digest, unsigned char *key,
+ unsigned int keylen, ...)
+ {
+- HMAC_CTX hmac;
++ HMAC_CTX *hmac;
+ unsigned int dlen;
+ unsigned char *data;
+ va_list argp;
+
+- HMAC_Init(&hmac, key, keylen, EVP_sha1());
++ hmac = HMAC_CTX_new();
++ if (!hmac)
++ return -1;
++ HMAC_Init_ex(hmac, key, keylen, EVP_sha1(), NULL);
+ va_start(argp, keylen);
+ for (;;) {
+ dlen = (unsigned int) va_arg(argp, unsigned int);
+ if (dlen == 0)
+ break;
+ data = (unsigned char *) va_arg(argp, int);
+- if (data == NULL)
++ if (data == NULL) {
++ HMAC_CTX_free(hmac);
+ return -1;
+- HMAC_Update(&hmac, data, dlen);
++ }
++ HMAC_Update(hmac, data, dlen);
+ }
+- HMAC_Final(&hmac, digest, &dlen);
+- HMAC_cleanup(&hmac);
++ HMAC_Final(hmac, digest, &dlen);
+ va_end(argp);
++ HMAC_CTX_free(hmac);
+ return 0;
+ }
+
Index: pkgsrc/security/libtcpa/patches/patch-libtcpa_keys.c
diff -u /dev/null pkgsrc/security/libtcpa/patches/patch-libtcpa_keys.c:1.1
--- /dev/null Fri Mar 27 20:57:12 2020
+++ pkgsrc/security/libtcpa/patches/patch-libtcpa_keys.c Fri Mar 27 20:57:12 2020
@@ -0,0 +1,13 @@
+$NetBSD: patch-libtcpa_keys.c,v 1.1 2020/03/27 20:57:12 joerg Exp $
+
+--- libtcpa/keys.c.orig 2020-03-27 18:48:00.249254812 +0000
++++ libtcpa/keys.c
+@@ -452,7 +452,6 @@ RSA *convpubkey(pubkeydata * k)
+ BN_bin2bn(k->modulus, k->keylength, mod);
+ BN_bin2bn(k->exponent, k->expsize, exp);
+ /* set up the RSA public key structure */
+- rsa->n = mod;
+- rsa->e = exp;
++ RSA_set0_key(rsa, mod, exp, NULL);
+ return rsa;
+ }
Home |
Main Index |
Thread Index |
Old Index