2 * Copyright (C) 2010 Red Hat, Inc. All rights reserved.
4 * This file is part of LVM2.
6 * This copyrighted material is made available to anyone wishing to use,
7 * modify, copy, or redistribute it subject to the terms and conditions
8 * of the GNU Lesser General Public License v.2.1.
10 * You should have received a copy of the GNU Lesser General Public License
11 * along with this program; if not, write to the Free Software Foundation,
12 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #define LUKS_SIGNATURE "LUKS\xba\xbe"
19 #define LUKS_SIGNATURE_SIZE 6
21 int dev_is_luks(struct device *dev, uint64_t *signature)
23 char buf[LUKS_SIGNATURE_SIZE];
33 if (!dev_read(dev, 0, LUKS_SIGNATURE_SIZE, buf))
36 ret = memcmp(buf, LUKS_SIGNATURE, LUKS_SIGNATURE_SIZE) ? 0 : 1;