cert_tool: update for compatibility with OpenSSL v1.1

This patch fixes incompatibility issues that prevent building the cert_tool
with OpenSSL >= v1.1.0. The changes introduced are still backwards
compatible with OpenSSL v1.0.2.

Fixes arm-software/trusted-fw#521

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
diff --git a/tools/cert_create/src/ext.c b/tools/cert_create/src/ext.c
index 8ae6640..055ddbf 100644
--- a/tools/cert_create/src/ext.c
+++ b/tools/cert_create/src/ext.c
@@ -166,7 +166,7 @@
 	int sz;
 
 	/* OBJECT_IDENTIFIER with hash algorithm */
-	algorithm = OBJ_nid2obj(md->type);
+	algorithm = OBJ_nid2obj(EVP_MD_type(md));
 	if (algorithm == NULL) {
 		return NULL;
 	}