Can you move this into some function that can be shared with the OpenSSL backend?