boringssl/crypto/rsa_extra/print.c
David Benjamin 2f5100e629 More compatibility stuff.
cryptography.io wants things exposed out of EVP_get_cipherby* including,
sadly, ECB mode.

Change-Id: I9bac46f8ffad1a79d190cee3b0c0686bf540298e
Reviewed-on: https://boringssl-review.googlesource.com/28464
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2018-05-15 23:57:53 +00:00

23 lines
655 B
C

/*
* Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <openssl/rsa.h>
#include <openssl/evp.h>
int RSA_print(BIO *bio, const RSA *rsa, int indent) {
EVP_PKEY *pkey = EVP_PKEY_new();
int ret = pkey != NULL &&
EVP_PKEY_set1_RSA(pkey, (RSA *)rsa) &&
EVP_PKEY_print_private(bio, pkey, indent, NULL);
EVP_PKEY_free(pkey);
return ret;
}