upgrade: Refuse chronologically older commits unless --allow-downgrade

We don't want to allow MITM attackers to intercept upgrade requests
and provide clients with older OS versions vulnerable to security
flaws.

Only "ostree admin upgrade" gets this behavior for now - whether we
want to do it for "ostree admin switch" is another question.
This commit is contained in:
Colin Walters committed 2014-02-20 18:25:56 -05:00
1 parent 9fc9008af8
commit f2e0162846
6 files changed
+118

No files matched your search

+8
View File
@@ -1755,3 +1755,11 @@ ostree_commit_get_parent (GVariant *commit_variant)
return NULL;
return ostree_checksum_from_bytes_v (bytes);
}
guint64
ostree_commit_get_timestamp (GVariant *commit_variant)
{
guint64 ret;
g_variant_get_child (commit_variant, 5, "t", &ret);
return GUINT64_FROM_BE (ret);
}
+1
View File
@@ -250,5 +250,6 @@ gboolean ostree_validate_structureof_dirmeta (GVariant *dirmeta,
GError **error);
gchar * ostree_commit_get_parent (GVariant *commit_variant);
guint64 ostree_commit_get_timestamp (GVariant *commit_variant);
G_END_DECLS