openslp-2.0.0-openssl-1.1-fix.patch 964 B

1234567891011121314151617181920212223242526
  1. diff -up openslp-2.0.0/common/slp_crypto.c.orig openslp-2.0.0/common/slp_crypto.c
  2. --- openslp-2.0.0/common/slp_crypto.c.orig 2012-12-07 21:13:28.000000000 +0100
  3. +++ openslp-2.0.0/common/slp_crypto.c 2017-02-22 11:16:11.620835724 +0100
  4. @@ -88,11 +88,16 @@ SLPCryptoDSAKey * SLPCryptoDSAKeyDup(SLP
  5. result = DSA_new();
  6. if (result)
  7. {
  8. - result->p = BN_dup(dsa->p);
  9. - result->q = BN_dup(dsa->q);
  10. - result->g = BN_dup(dsa->g);
  11. - result->priv_key = BN_dup(dsa->priv_key);
  12. - result->pub_key = BN_dup(dsa->pub_key);
  13. + const BIGNUM *p, *q, *g;
  14. + const BIGNUM *priv_key, *pub_key;
  15. +
  16. + DSA_get0_pqg(dsa, &p, &q, &g);
  17. + DSA_get0_key(dsa, &pub_key, &priv_key);
  18. +
  19. + /* would be nice to check return values,
  20. + * but original code didn't do that either... */
  21. + DSA_set0_pqg(result, BN_dup(p), BN_dup(q), BN_dup(g));
  22. + DSA_set0_key(result, BN_dup(pub_key), BN_dup(priv_key));
  23. }
  24. return result;
  25. }