Renamed key_encod{ing,der}_t and constants, prepare for generic credential encoding
This commit is contained in:
@@ -58,7 +58,7 @@ struct private_openssl_rsa_private_key_t {
|
||||
};
|
||||
|
||||
/* implemented in rsa public key */
|
||||
bool openssl_rsa_fingerprint(RSA *rsa, key_encoding_type_t type, chunk_t *fp);
|
||||
bool openssl_rsa_fingerprint(RSA *rsa, cred_encoding_type_t type, chunk_t *fp);
|
||||
|
||||
/**
|
||||
* Build an EMPSA PKCS1 signature described in PKCS#1
|
||||
@@ -208,7 +208,7 @@ static public_key_t* get_public_key(private_openssl_rsa_private_key_t *this)
|
||||
* Implementation of public_key_t.get_fingerprint.
|
||||
*/
|
||||
static bool get_fingerprint(private_openssl_rsa_private_key_t *this,
|
||||
key_encoding_type_t type, chunk_t *fingerprint)
|
||||
cred_encoding_type_t type, chunk_t *fingerprint)
|
||||
{
|
||||
return openssl_rsa_fingerprint(this->rsa, type, fingerprint);
|
||||
}
|
||||
@@ -217,7 +217,7 @@ static bool get_fingerprint(private_openssl_rsa_private_key_t *this,
|
||||
* Implementation of public_key_t.get_encoding.
|
||||
*/
|
||||
static bool get_encoding(private_openssl_rsa_private_key_t *this,
|
||||
key_encoding_type_t type, chunk_t *encoding)
|
||||
cred_encoding_type_t type, chunk_t *encoding)
|
||||
{
|
||||
u_char *p;
|
||||
|
||||
@@ -227,8 +227,8 @@ static bool get_encoding(private_openssl_rsa_private_key_t *this,
|
||||
}
|
||||
switch (type)
|
||||
{
|
||||
case KEY_PRIV_ASN1_DER:
|
||||
case KEY_PRIV_PEM:
|
||||
case PRIVKEY_ASN1_DER:
|
||||
case PRIVKEY_PEM:
|
||||
{
|
||||
bool success = TRUE;
|
||||
|
||||
@@ -236,13 +236,13 @@ static bool get_encoding(private_openssl_rsa_private_key_t *this,
|
||||
p = encoding->ptr;
|
||||
i2d_RSAPrivateKey(this->rsa, &p);
|
||||
|
||||
if (type == KEY_PRIV_PEM)
|
||||
if (type == PRIVKEY_PEM)
|
||||
{
|
||||
chunk_t asn1_encoding = *encoding;
|
||||
|
||||
success = lib->encoding->encode(lib->encoding, KEY_PRIV_PEM,
|
||||
NULL, encoding, KEY_PART_RSA_PRIV_ASN1_DER,
|
||||
asn1_encoding, KEY_PART_END);
|
||||
success = lib->encoding->encode(lib->encoding, PRIVKEY_PEM,
|
||||
NULL, encoding, CRED_PART_RSA_PRIV_ASN1_DER,
|
||||
asn1_encoding, CRED_PART_END);
|
||||
chunk_clear(&asn1_encoding);
|
||||
}
|
||||
return success;
|
||||
@@ -291,9 +291,9 @@ static private_openssl_rsa_private_key_t *create_empty(void)
|
||||
this->public.interface.get_public_key = (public_key_t* (*) (private_key_t*))get_public_key;
|
||||
this->public.interface.equals = private_key_equals;
|
||||
this->public.interface.belongs_to = private_key_belongs_to;
|
||||
this->public.interface.get_fingerprint = (bool(*)(private_key_t*, key_encoding_type_t type, chunk_t *fp))get_fingerprint;
|
||||
this->public.interface.get_fingerprint = (bool(*)(private_key_t*, cred_encoding_type_t type, chunk_t *fp))get_fingerprint;
|
||||
this->public.interface.has_fingerprint = (bool(*)(private_key_t*, chunk_t fp))private_key_has_fingerprint;
|
||||
this->public.interface.get_encoding = (bool(*)(private_key_t*, key_encoding_type_t type, chunk_t *encoding))get_encoding;
|
||||
this->public.interface.get_encoding = (bool(*)(private_key_t*, cred_encoding_type_t type, chunk_t *encoding))get_encoding;
|
||||
this->public.interface.get_ref = (private_key_t* (*) (private_key_t*))get_ref;
|
||||
this->public.interface.destroy = (void (*) (private_key_t*))destroy;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user