~xnox/debian/sid/cryptsetup/ubuntu

« back to all changes in this revision

Viewing changes to src/cryptsetup.h

  • Committer: Package Import Robot
  • Author(s): Jonas Meurer, Milan Broz, Steve Langasek, Jonas Meurer
  • Date: 2013-06-28 12:10:41 UTC
  • mfrom: (0.2.11)
  • Revision ID: package-import@ubuntu.com-20130628121041-ek9rtel19yehj31t
Tags: 2:1.6.1-1
[ Milan Broz ]
* new upstream version. (closes: #704827, 707997)
  - default LUKS encryption mode is XTS (aes-xts-plain64) (closes: #714331)
  - adds native support for Truecrypt and compatible on-disk format
  - adds benchmark command
  - adds cryptsetup-reencrypt, a tool to offline reencrypt LUKS device
  - adds veritysetup, a tool for dm-verity block device verification module
* install docs/examples into docs at cryptsetup-dev package.
* fix compilation warnings in askpass.c.

[ Steve Langasek ]
* fix upstart jobs to not cause boot hangs when actually used in
  conjunction with startpar.  (closes: #694499, #677712).
* in connection with the above, make the cryptdisks-early job explicitly
  wait for 'umountfs' on shutdown just like cryptdisks does; otherwise,
  the teardown of the cryptdisks upstart job may cause the cryptdisks-early
  init script run before we're done unmounting filesystems.

[ Jonas Meurer ]
* minor wording fixes to README.initramfs, suggested by intrigeri and Adam
  D. Barrett.
* add bash-completion script for cryptdisks_{start,stop}. Thanks to Claudius
  Hubig for providing a patch. (closes: #700777)
* support specifying key-slot in crypttab. Thanks to Kevin Locke for the
  patch. (closes: #704470)
* remove evms support code from cryptroot initramfs script. (closes: #713918)
* fix location of keyscripts in initramfs documentation. (closes: #697446)
* fix a typo in decrypt_ssl script that prevented stdout from beeing
  redirected to /dev/null. (closes: #700285)
* give full path to blkid in crytproot initramfs script. (closes: #697155)
* export number of previous tries from cryptroot and cryptdisks to
  keyscript. Thanks to Laurens Blankers for the idea. Opens the possibility
  to fallback after a given number of tries for keyscripts. (closes: #438481,
  #471729, #697455)
* improve check for cpu hardware encryption support in initramfs cryptroot
  hook. (closes: #714326)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * Copyright (C) 2004, Christophe Saout <christophe@saout.de>
5
5
 * Copyright (C) 2004-2007, Clemens Fruhwirth <clemens@endorphin.org>
6
6
 * Copyright (C) 2009-2012, Red Hat, Inc. All rights reserved.
 
7
 * Copyright (C) 2009-2013, Milan Broz
7
8
 *
8
9
 * This program is free software; you can redistribute it and/or
9
10
 * modify it under the terms of the GNU General Public License
10
 
 * version 2 as published by the Free Software Foundation.
 
11
 * as published by the Free Software Foundation; either version 2
 
12
 * of the License, or (at your option) any later version.
11
13
 *
12
14
 * This program is distributed in the hope that it will be useful,
13
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
24
#ifndef CRYPTSETUP_H
23
25
#define CRYPTSETUP_H
24
26
 
 
27
#define _LARGEFILE64_SOURCE
 
28
#define _FILE_OFFSET_BITS 64
 
29
 
25
30
#include <config.h>
26
31
 
 
32
#include <string.h>
 
33
#include <stdlib.h>
 
34
#include <stdarg.h>
 
35
#include <stdio.h>
 
36
#include <stdint.h>
 
37
#include <errno.h>
 
38
#include <unistd.h>
 
39
#include <inttypes.h>
 
40
#include <limits.h>
 
41
#include <ctype.h>
 
42
#include <fcntl.h>
 
43
#include <popt.h>
 
44
#include <sys/stat.h>
 
45
 
27
46
#include "lib/nls.h"
28
47
#include "lib/utils_crypt.h"
29
48
#include "lib/utils_loop.h"
30
49
#include "lib/utils_fips.h"
31
50
 
 
51
#include "libcryptsetup.h"
 
52
 
 
53
#define CONST_CAST(x) (x)(uintptr_t)
32
54
#define DEFAULT_CIPHER(type)    (DEFAULT_##type##_CIPHER "-" DEFAULT_##type##_MODE)
33
 
 
 
55
#define SECTOR_SIZE 512
 
56
#define ROUND_SECTOR(x) (((x) + SECTOR_SIZE - 1) / SECTOR_SIZE)
 
57
 
 
58
extern int opt_debug;
 
59
extern int opt_verbose;
 
60
extern int opt_batch_mode;
 
61
extern int opt_force_password;
 
62
 
 
63
/* Common tools */
 
64
void clogger(struct crypt_device *cd, int level, const char *file, int line,
 
65
             const char *format, ...);
 
66
void tool_log(int level, const char *msg, void *usrptr __attribute__((unused)));
 
67
void quiet_log(int level, const char *msg, void *usrptr);
 
68
 
 
69
int yesDialog(const char *msg, void *usrptr __attribute__((unused)));
 
70
void show_status(int errcode);
 
71
const char *uuid_or_device(const char *spec);
 
72
__attribute__ ((noreturn)) \
 
73
void usage(poptContext popt_context, int exitcode, const char *error, const char *more);
 
74
void dbg_version_and_cmd(int argc, const char **argv);
 
75
int translate_errno(int r);
 
76
 
 
77
extern volatile int quit;
 
78
void set_int_block(int block);
 
79
void set_int_handler(int block);
 
80
void check_signal(int *r);
 
81
int tools_signals_blocked(void);
 
82
 
 
83
int tools_get_key(const char *prompt,
 
84
                  char **key, size_t *key_size,
 
85
                  size_t keyfile_offset, size_t keyfile_size_max,
 
86
                  const char *key_file,
 
87
                  int timeout, int verify, int pwquality,
 
88
                  struct crypt_device *cd);
 
89
 
 
90
/* Log */
34
91
#define log_dbg(x...) clogger(NULL, CRYPT_LOG_DEBUG, __FILE__, __LINE__, x)
35
92
#define log_std(x...) clogger(NULL, CRYPT_LOG_NORMAL, __FILE__, __LINE__, x)
36
93
#define log_verbose(x...) clogger(NULL, CRYPT_LOG_VERBOSE, __FILE__, __LINE__, x)