]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Populate add key return
authorChristopher Hoffman <choffman@redhat.com>
Thu, 18 Jan 2024 15:40:53 +0000 (15:40 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Wed, 5 Nov 2025 13:59:33 +0000 (13:59 +0000)
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/client/FSCrypt.cc
src/client/fuse_ll.cc

index 1bff1bae4dee670d189909839481f600b4fca5e4..870b16970615a8204cddf70670f0705f0a367845 100644 (file)
@@ -256,6 +256,7 @@ int fscrypt_calc_hkdf(char hkdf_context,
 
   int extract_len = r;
 
+//#define FSCRYPT_INFO_STR "fscrypt\x00\x01"
 #define FSCRYPT_INFO_STR "fscrypt\x00?"
 
   char info_str[sizeof(FSCRYPT_INFO_STR) + nonce_len];
index dfd9796f8562da87d74c756e973da17e6c8a1890..bea60ecdfc46c4e89b57e6cbf05095b1257e2e88 100644 (file)
@@ -1013,14 +1013,16 @@ static void fuse_ll_ioctl(fuse_req_t req, fuse_ino_t ino,
         break;
       }
 
-      int r = cfuse->client->add_fscrypt_key((const char *)arg->raw, arg->raw_size, nullptr, ctx->uid);
+      ceph_fscrypt_key_identifier kid;
+      int r = cfuse->client->add_fscrypt_key((const char *)arg->raw, arg->raw_size, &kid, ctx->uid);
       if (r < 0) {
         generic_dout(0) << __FILE__ << ":" << __LINE__ << ": failed to create a new key: r=" << r << dendl;
         fuse_reply_err(req, -r);
         break;
       }
 
-      fuse_reply_ioctl(req, 0, nullptr, 0);
+      memcpy(&arg->key_spec.u.identifier, &kid.raw, 16);
+      fuse_reply_ioctl(req, 0, arg, sizeof(*arg));
       break;
     }
     break;