/** AES block size in bytes. */
#define AES_CRT128_BLOCK_SIZE 16
-int decode_ssh_key(const char *filename, unsigned char **blob,
+int decode_public_key(const char *filename, unsigned char **blob,
size_t *decoded_size);
int check_private_key_file(const char *file);
*
* \sa \ref uudecode().
*/
-int decode_ssh_key(const char *filename, unsigned char **blob,
+int decode_public_key(const char *filename, unsigned char **blob,
size_t *decoded_size)
{
int ret, ret2;
/** Private keys end with this footer. */
#define PRIVATE_KEY_FOOTER "-----END RSA PRIVATE KEY-----"
-static int decode_key(const char *key_file, unsigned char **result,
+static int decode_private_key(const char *key_file, unsigned char **result,
size_t *blob_size)
{
int ret, ret2, i, j;
struct asymmetric_key *key;
*result = NULL;
- ret = decode_key(key_file, &blob, &blob_size);
+ ret = decode_private_key(key_file, &blob, &blob_size);
if (ret < 0)
return ret;
end = blob + blob_size;
struct asymmetric_key *key;
unsigned bits;
- ret = decode_ssh_key(key_file, &blob, &decoded_size);
+ ret = decode_public_key(key_file, &blob, &decoded_size);
if (ret < 0)
return ret;
p = blob + ret;
int ret;
struct asymmetric_key *key = para_malloc(sizeof(*key));
- ret = decode_ssh_key(key_file, &blob, &decoded_size);
+ ret = decode_public_key(key_file, &blob, &decoded_size);
if (ret < 0)
goto out;
ret = read_rsa_bignums(blob + ret, decoded_size - ret, &key->rsa);