Remove duplicated code

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>