forked from enlightenment/efl
Better error handling with eet identity.
SVN revision: 37937
This commit is contained in:
parent
0b63514546
commit
9c381ceb1f
|
@ -248,6 +248,11 @@ do_eet_sign(const char *file, const char *private_key, const char *public_key)
|
|||
}
|
||||
|
||||
key = eet_identity_open(public_key, private_key, NULL);
|
||||
if (!key)
|
||||
{
|
||||
fprintf(stdout, "cannot open key '%s:%s'.\n", public_key, private_key);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
fprintf(stdout, "Using the following key to sign `%s`.\n", file);
|
||||
eet_identity_print(key, stdout);
|
||||
|
|
|
@ -171,7 +171,7 @@ eet_identity_open(const char *certificate_file, const char *private_key_file, Ee
|
|||
if (!fp) return NULL;
|
||||
cert = PEM_read_X509(fp, NULL, NULL, NULL);
|
||||
fclose(fp);
|
||||
if (!cert) return NULL;
|
||||
if (!cert) goto on_error;
|
||||
|
||||
/* Check the presence of the public key. Just in case. */
|
||||
pkey = X509_get_pubkey(cert);
|
||||
|
|
Loading…
Reference in New Issue