Several "wrapper" functions have been marked deprecated with 2.11.0.
return NULL;
}
- if (botan_privkey_create_ecdh(&this->key, rng, this->curve_name))
+ if (botan_privkey_create(&this->key, "ECDH", this->curve_name, rng))
{
DBG1(DBG_LIB, "ECDH private key generation failed");
botan_rng_destroy(rng);
this = create_empty(oid);
- if (botan_privkey_create_ecdsa(&this->key, rng, curve))
+ if (botan_privkey_create(&this->key, "ECDSA", curve, rng))
{
DBG1(DBG_LIB, "EC private key generation failed");
botan_rng_destroy(rng);
return 0;
}
- if (botan_privkey_rsa_get_n(n, this->key) ||
+ if (botan_privkey_get_field(n, this->key, "n") ||
botan_mp_num_bits(n, &bits))
{
botan_mp_destroy(n);
{
private_botan_rsa_private_key_t *this;
botan_rng_t rng;
+ char buf[BUF_LEN];
u_int key_size = 0;
while (TRUE)
this = create_empty();
- if (botan_privkey_create_rsa(&this->key, rng, key_size))
+ snprintf(buf, sizeof(buf), "%u", key_size);
+
+ if (botan_privkey_create(&this->key, "RSA", buf, rng))
{
botan_rng_destroy(rng);
free(this);
}
/* k must be even */
- if (!botan_mp_is_even(k))
+ if (botan_mp_get_bit(k, 0) != 0)
{
goto error;
}
goto error;
}
- for (t = 0; !botan_mp_is_odd(r); t++)
+ for (t = 0; botan_mp_get_bit(r, 0) != 1; t++)
{
if (botan_mp_rshift(r, r, 1))
{
return 0;
}
- if (botan_pubkey_rsa_get_n(n, this->key) ||
+ if (botan_pubkey_get_field(n, this->key, "n") ||
botan_mp_num_bits(n, &bits))
{
botan_mp_destroy(n);
return NULL;
}
- if (botan_privkey_create_ecdh(&this->key, rng, "curve25519"))
+ if (botan_privkey_create(&this->key, "Curve25519", "", rng))
{
DBG1(DBG_LIB, "x25519 private key generation failed");
botan_rng_destroy(rng);
privkey = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,
BUILD_KEY_SIZE, key_sizes[_i], BUILD_END);
ck_assert(privkey != NULL);
+ ck_assert_int_eq(key_sizes[_i], privkey->get_keysize(privkey));
pubkey = privkey->get_public_key(privkey);
ck_assert(pubkey != NULL);
+ ck_assert_int_eq(key_sizes[_i], pubkey->get_keysize(pubkey));
test_good_sig(privkey, pubkey);
"TNC_IMV_NotifyConnectionChange",
/* Botan */
"botan_public_key_load",
- "botan_privkey_create_ecdsa",
- "botan_privkey_create_ecdh",
+ "botan_privkey_create",
"botan_privkey_load_ecdh",
"botan_privkey_load",
};