Merge pull request #2090 from cgwalters/sign-default-type
signing: Add #define OSTREE_SIGN_NAME_ED25519
This commit is contained in:
commit
ba874c525f
|
|
@ -62,7 +62,7 @@ typedef struct
|
||||||
_sign_type sign_types[] =
|
_sign_type sign_types[] =
|
||||||
{
|
{
|
||||||
#if defined(HAVE_LIBSODIUM)
|
#if defined(HAVE_LIBSODIUM)
|
||||||
{"ed25519", 0},
|
{OSTREE_SIGN_NAME_ED25519, 0},
|
||||||
#endif
|
#endif
|
||||||
{"dummy", 0}
|
{"dummy", 0}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,12 @@ static inline gboolean OSTREE_IS_SIGN (gpointer ptr) { return G_TYPE_CHECK_INSTA
|
||||||
static inline OstreeSignInterface *OSTREE_SIGN_GET_IFACE (gpointer ptr) { return G_TYPE_INSTANCE_GET_INTERFACE (ptr, ostree_sign_get_type (), OstreeSignInterface); }
|
static inline OstreeSignInterface *OSTREE_SIGN_GET_IFACE (gpointer ptr) { return G_TYPE_INSTANCE_GET_INTERFACE (ptr, ostree_sign_get_type (), OstreeSignInterface); }
|
||||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OSTREE_SIGN_NAME_ED25519:
|
||||||
|
* The name of the default ed25519 signing type.
|
||||||
|
*/
|
||||||
|
#define OSTREE_SIGN_NAME_ED25519 "ed25519"
|
||||||
|
|
||||||
/* Have to use glib-2.44 for this
|
/* Have to use glib-2.44 for this
|
||||||
_OSTREE_PUBLIC
|
_OSTREE_PUBLIC
|
||||||
G_DECLARE_INTERFACE (OstreeSign, ostree_sign, OSTREE, SIGN, GObject)
|
G_DECLARE_INTERFACE (OstreeSign, ostree_sign, OSTREE, SIGN, GObject)
|
||||||
|
|
|
||||||
|
|
@ -868,8 +868,7 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio
|
||||||
if (opt_key_ids)
|
if (opt_key_ids)
|
||||||
{
|
{
|
||||||
/* Initialize crypto system */
|
/* Initialize crypto system */
|
||||||
if (!opt_sign_name)
|
opt_sign_name = opt_sign_name ?: OSTREE_SIGN_NAME_ED25519;
|
||||||
opt_sign_name = "ed25519";
|
|
||||||
|
|
||||||
sign = ostree_sign_get_by_name (opt_sign_name, error);
|
sign = ostree_sign_get_by_name (opt_sign_name, error);
|
||||||
if (sign == NULL)
|
if (sign == NULL)
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,7 @@ ostree_builtin_sign (int argc, char **argv, OstreeCommandInvocation *invocation,
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* Initialize crypto system */
|
/* Initialize crypto system */
|
||||||
if (!opt_sign_name)
|
opt_sign_name = opt_sign_name ?: OSTREE_SIGN_NAME_ED25519;
|
||||||
opt_sign_name = "ed25519";
|
|
||||||
|
|
||||||
sign = ostree_sign_get_by_name (opt_sign_name, error);
|
sign = ostree_sign_get_by_name (opt_sign_name, error);
|
||||||
if (sign == NULL)
|
if (sign == NULL)
|
||||||
|
|
|
||||||
|
|
@ -103,8 +103,7 @@ ostree_builtin_summary (int argc, char **argv, OstreeCommandInvocation *invocati
|
||||||
/* Initialize crypto system */
|
/* Initialize crypto system */
|
||||||
if (opt_key_ids)
|
if (opt_key_ids)
|
||||||
{
|
{
|
||||||
if (!opt_sign_name)
|
opt_sign_name = opt_sign_name ?: OSTREE_SIGN_NAME_ED25519;
|
||||||
opt_sign_name = "ed25519";
|
|
||||||
|
|
||||||
sign = ostree_sign_get_by_name (opt_sign_name, error);
|
sign = ostree_sign_get_by_name (opt_sign_name, error);
|
||||||
if (sign == NULL)
|
if (sign == NULL)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue