Restore check of |*xn| against |name| in X509_NAME_set
authorRichard Levitte <levitte@openssl.org>
Thu, 17 May 2018 07:53:14 +0000 (09:53 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 20 May 2018 07:49:57 +0000 (09:49 +0200)
commit6fc92032e02bb17cb7486e71aafdc1905497693a
treeb5d39b6d69856166111c0c86784320e79abf955d
parent2392eb77d237684a32b1290fc9e3d0e2f3b08554
Restore check of |*xn| against |name| in X509_NAME_set

A previous change of this function introduced a fragility when the
destination happens to be the same as the source.  Such alias isn't
recommended, but could still happen, for example in this kind of code:

    X509_NAME *subject = X509_get_issuer_name(x);

    /* ... some code passes ... */

    X509_set_issuer_name(x, subject);

Fixes #4710

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6280)

(cherry picked from commit c1c1783d45a5e91951e6328a820939d0256c841c)
crypto/x509/x_name.c