Hello community, here is the log from the commit of package openslp for openSUSE:Factory checked in at 2017-06-18 13:49:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openslp (Old) and /work/SRC/openSUSE:Factory/.openslp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openslp" Sun Jun 18 13:49:19 2017 rev:47 rq:503531 version:2.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/openslp/openslp.changes 2017-01-15 10:56:37.516712950 +0100 +++ /work/SRC/openSUSE:Factory/.openslp.new/openslp.changes 2017-06-18 13:49:54.910831371 +0200 @@ -1,0 +2,6 @@ +Tue Jun 13 08:28:35 UTC 2017 - daniel.molken...@suse.com + +- Add support for OpenSSL 1.1. Commit from upstream [bsc#1042665] + new patch: openslp.openssl-1.1.diff + +------------------------------------------------------------------- New: ---- openslp.openssl-1.1.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openslp.spec ++++++ --- /var/tmp/diff_new_pack.F3oJcK/_old 2017-06-18 13:49:56.266640585 +0200 +++ /var/tmp/diff_new_pack.F3oJcK/_new 2017-06-18 13:49:56.270640023 +0200 @@ -62,6 +62,7 @@ Patch15: openslp.noconvenience.diff Patch16: openslp.xrealloc.diff Patch17: openslp.foldws.diff +Patch18: openslp.openssl-1.1.diff %description Service Location Protocol is an IETF standards track protocol that @@ -131,6 +132,7 @@ %patch15 %patch16 %patch17 +%patch18 -p2 %build autoreconf -fiv ++++++ openslp.openssl-1.1.diff ++++++ --- a/openslp/common/slp_crypto.c +++ b/openslp/common/slp_crypto.c @@ -53,6 +53,80 @@ #include "slp_crypto.h" #include "slp_message.h" +/* 1.1.0 -> 1.0.x compatibility layer + * See https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes#Compatibility_Layer + * for details and additiona compatibility routines if needed in the future. + */ +#if OPENSSL_VERSION_NUMBER < 0x10100000L +static void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) +{ + if (p != NULL) + *p = d->p; + if (q != NULL) + *q = d->q; + if (g != NULL) + *g = d->g; +} + +static int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) +{ + /* If the fields p, q and g in d are NULL, the corresponding input + * parameters MUST be non-NULL. + */ + if ((d->p == NULL && p == NULL) + || (d->q == NULL && q == NULL) + || (d->g == NULL && g == NULL)) + return 0; + + if (p != NULL) + { + BN_free(d->p); + d->p = p; + } + if (q != NULL) + { + BN_free(d->q); + d->q = q; + } + if (g != NULL) + { + BN_free(d->g); + d->g = g; + } + return 1; +} + +static void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) +{ + if (pub_key != NULL) + *pub_key = d->pub_key; + if (priv_key != NULL) + *priv_key = d->priv_key; +} + +static int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) +{ + /* If the field pub_key in d is NULL, the corresponding input + * parameters MUST be non-NULL. The priv_key field may + * be left NULL. + */ + if (d->pub_key == NULL && pub_key == NULL) + return 0; + + if (pub_key != NULL) + { + BN_free(d->pub_key); + d->pub_key = pub_key; + } + if (priv_key != NULL) + { + BN_free(d->priv_key); + d->priv_key = priv_key; + } + return 1; +} +#endif + /** Generate a SHA1 digest for the specified block data. * * @param[in] data - The data block to be hashed. @@ -88,11 +162,17 @@ result = DSA_new(); if (result) { - result->p = BN_dup(dsa->p); - result->q = BN_dup(dsa->q); - result->g = BN_dup(dsa->g); - result->priv_key = BN_dup(dsa->priv_key); - result->pub_key = BN_dup(dsa->pub_key); + const BIGNUM *p, *q, *g; + const BIGNUM *priv_key, *pub_key; + + DSA_get0_pqg(dsa, &p, &q, &g); + DSA_get0_key(dsa, &pub_key, &priv_key); + + /* would be nice to check return values, + * but original code didn't do that either... + */ + DSA_set0_pqg(result, BN_dup(p), BN_dup(q), BN_dup(g)); + DSA_set0_key(result, BN_dup(pub_key), BN_dup(priv_key)); } return result; }