case SILC_PKCS_FILE_BASE64:
data = silc_base64_decode(filedata, filedata_len, &filedata_len);
- if (!data) {
- SILC_LOG_ERROR(("Malformed SILC public key encoding"));
+ if (!data)
return FALSE;
- }
filedata = data;
break;
}
silc_free(silc_pubkey);
if (asn1)
silc_asn1_free(asn1);
- SILC_LOG_ERROR(("Malformed SILC public key"));
return 0;
}
/* Export PKCS algorithm public key */
if (pkcs->export_public_key)
pk = pkcs->export_public_key(silc_pubkey->public_key, &pk_len);
- if (!pk)
+ if (!pk) {
+ SILC_LOG_ERROR(("Error exporting PKCS algorithm key"));
return NULL;
+ }
silc_buffer_set(&alg_key, pk, pk_len);
/* Encode identifier */
silc_pubkey->identifier.org,
silc_pubkey->identifier.country,
silc_pubkey->identifier.version);
- if (!identifier)
+ if (!identifier) {
+ SILC_LOG_ERROR(("Error encoding SILC public key identifier"));
goto err;
+ }
asn1 = silc_asn1_alloc();
if (!asn1)
goto err;
} else {
- SILC_LOG_DEBUG(("Unsupported PKCS algorithm"));
+ SILC_LOG_ERROR(("Unsupported PKCS algorithm: %s", pkcs->name));
goto err;
}
case SILC_PKCS_FILE_BASE64:
data = silc_base64_decode(filedata, filedata_len, &len);
- if (!data) {
- SILC_LOG_ERROR(("Malformed SILC private key encoding"));
+ if (!data)
return FALSE;
- }
filedata = data;
break;
}