Duplicate code refactored
Duplicate code refactored

add_attribute_object and add_DN_object have similar code, so move
it into a common function build_data.

Reviewed-by: Paul Dale <bc4a6b4cd7a8395c734c8eb5aef04a9c30188c85@oracle.com>
Reviewed-by: Ben Kaduk <b34e9dc3dd24827b45bb22e8b76cde1bcb413b0e@mit.edu>
Reviewed-by: Rich Salz <c04971a99e5a9ee80eaab4b1deb37e845b0bd697@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4566)

openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl