Revert "also test binary import"
This reverts commit 8b6f8c8cce325fa1ce3b61805aa80cdabc1826b4.
This commit is contained in:
parent
4afc024f6a
commit
083e8af78b
@ -48,8 +48,7 @@ typedef struct {
|
|||||||
} ltc_pk_part;
|
} ltc_pk_part;
|
||||||
|
|
||||||
#define PK_PART_HEX(s) &((ltc_pk_part){s, 0, 16})
|
#define PK_PART_HEX(s) &((ltc_pk_part){s, 0, 16})
|
||||||
#define PK_PART_DEC(d) &((ltc_pk_part){d, 0, 10})
|
#define PK_PART_DEC(s) &((ltc_pk_part){s, 0, 10})
|
||||||
#define PK_PART_BIN(b, l) &((ltc_pk_part){b, l, 256})
|
|
||||||
|
|
||||||
/* ---- RSA ---- */
|
/* ---- RSA ---- */
|
||||||
#ifdef LTC_MRSA
|
#ifdef LTC_MRSA
|
||||||
|
@ -181,7 +181,6 @@ static int rsa_compat_test(void)
|
|||||||
{
|
{
|
||||||
rsa_key key, pubkey;
|
rsa_key key, pubkey;
|
||||||
int stat;
|
int stat;
|
||||||
void* mpi;
|
|
||||||
unsigned char buf[1024];
|
unsigned char buf[1024];
|
||||||
unsigned long len;
|
unsigned long len;
|
||||||
|
|
||||||
@ -281,20 +280,6 @@ static int rsa_compat_test(void)
|
|||||||
}
|
}
|
||||||
rsa_free(&key);
|
rsa_free(&key);
|
||||||
|
|
||||||
/* try import public key from mixed numbers */
|
|
||||||
DO(mp_init(&mpi));
|
|
||||||
DO(mp_read_radix(mpi, dec_N, 10));
|
|
||||||
DO(mp_to_unsigned_bin(mpi, buf));
|
|
||||||
len = mp_unsigned_bin_size(mpi);
|
|
||||||
DO(rsa_import_radix(PK_PART_BIN(buf, len), PK_PART_DEC(dec_e), NULL, NULL, NULL, NULL, NULL, NULL, &key));
|
|
||||||
mp_clear(mpi);
|
|
||||||
len = sizeof(buf);
|
|
||||||
DO(rsa_export(buf, &len, PK_PUBLIC, &key));
|
|
||||||
if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from mixed)", 0)) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
rsa_free(&key);
|
|
||||||
|
|
||||||
/* try export in SubjectPublicKeyInfo format of the public key */
|
/* try export in SubjectPublicKeyInfo format of the public key */
|
||||||
DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &key));
|
DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &key));
|
||||||
len = sizeof(buf);
|
len = sizeof(buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user