Index: conf/options
===================================================================
--- conf/options        (revision 225448)
+++ conf/options        (working copy)
@@ -81,6 +81,8 @@
 DIRECTIO
 FULL_PREEMPTION        opt_sched.h
 IPI_PREEMPTION opt_sched.h
+GELI_PROVIDER  opt_geom.h
+GELI_KEY_SIZE  opt_geom.h
 GEOM_AES       opt_geom.h
 GEOM_BDE       opt_geom.h
 GEOM_BSD       opt_geom.h
Index: fs/msdosfs/msdosfs_vnops.c
===================================================================
--- fs/msdosfs/msdosfs_vnops.c  (revision 225448)
+++ fs/msdosfs/msdosfs_vnops.c  (working copy)
@@ -480,7 +480,8 @@
                if (error)
                        return error;
        }
-       if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
+       if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL 
+           || vap->va_birthtime.tv_sec != VNOVAL) {
                if (vp->v_mount->mnt_flag & MNT_RDONLY)
                        return (EROFS);
                if (vap->va_vaflags & VA_UTIMES_NULL) {
@@ -501,6 +502,11 @@
                                timespec2fattime(&vap->va_mtime, 0,
                                    &dep->de_MDate, &dep->de_MTime, NULL);
                        }
+                       if (vap->va_birthtime.tv_sec !=  VNOVAL) {
+                               dep->de_flag &= ~DE_CREATE;
+                               timespec2fattime(&vap->va_birthtime, 0,
+                                   &dep->de_CDate, &dep->de_CTime, NULL);
+                       }
                        dep->de_Attributes |= ATTR_ARCHIVE;
                        dep->de_flag |= DE_MODIFIED;
                }
Index: geom/eli/g_eli.c
===================================================================
--- geom/eli/g_eli.c    (revision 225448)
+++ geom/eli/g_eli.c    (working copy)
@@ -955,6 +955,10 @@
        return (g_eli_destroy(sc, FALSE));
 }
 
+#ifdef GELI_KEY_SIZE
+char _geli_key[GELI_KEY_SIZE] = "GELI_KEY_HERE";
+#endif
+
 static int
 g_eli_keyfiles_load(struct hmac_ctx *ctx, const char *provider)
 {
@@ -962,12 +966,22 @@
        char *file, name[64];
        size_t size;
        int i;
+       int did_it = 0;
 
+#if defined(GELI_KEY_SIZE) && defined(GELI_PROVIDER)
+       if (!strcmp(provider, GELI_PROVIDER)) {
+               did_it++;
+               g_eli_crypto_hmac_update(ctx, _geli_key, GELI_KEY_SIZE);
+       }
+#endif
+
+       snprintf(name, sizeof(name), "%s:geli_keyfile0", GELI_PROVIDER);
+
        for (i = 0; ; i++) {
                snprintf(name, sizeof(name), "%s:geli_keyfile%d", provider, i);
                keyfile = preload_search_by_type(name);
                if (keyfile == NULL)
-                       return (i);     /* Return number of loaded keyfiles. */
+                       return (i + did_it);    /* Return number of loaded keyfiles. */
                data = preload_fetch_addr(keyfile);
                if (data == NULL) {
                        G_ELI_DEBUG(0, "Cannot find key file data for %s.",

MichaelSchöne/hardcode_geli_key.diff (last edited 2011-09-13 14:19:33 by MichaelSchöne)