Remove hints for old kernels.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@616 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
Milan Broz
2011-10-08 16:23:54 +00:00
parent d2fbc963ca
commit 19bde65f5b
2 changed files with 1 additions and 21 deletions

View File

@@ -68,7 +68,6 @@ int device_check_and_adjust(struct crypt_device *cd,
uint64_t *size,
uint64_t *offset,
uint32_t *flags);
int wipe_device_header(const char *device, int sectors);
void logger(struct crypt_device *cd, int class, const char *file, int line, const char *format, ...);
#define log_dbg(x...) logger(NULL, CRYPT_LOG_DEBUG, __FILE__, __LINE__, x)

View File

@@ -97,29 +97,10 @@ static void sigint_handler(int sig __attribute__((unused)))
static const char *_error_hint(char *cipherMode, size_t keyLength)
{
const char *hint= "";
#ifdef __linux__
char c, tmp[4] = {0};
struct utsname uts;
int i = 0, kernel_minor;
/* Nothing to suggest here */
if (uname(&uts) || strncmp(uts.release, "2.6.", 4))
return hint;
/* Get kernel minor without suffixes */
while (i < 3 && (c = uts.release[i + 4]))
tmp[i++] = isdigit(c) ? c : '\0';
kernel_minor = atoi(tmp);
if (!strncmp(cipherMode, "xts", 3) && (keyLength != 256 && keyLength != 512))
hint = _("Key size in XTS mode must be 256 or 512 bits.\n");
else if (!strncmp(cipherMode, "xts", 3) && kernel_minor < 24)
hint = _("Block mode XTS is available since kernel 2.6.24.\n");
if (!strncmp(cipherMode, "lrw", 3) && (keyLength != 256 && keyLength != 512))
hint = _("Key size in LRW mode must be 256 or 512 bits.\n");
else if (!strncmp(cipherMode, "lrw", 3) && kernel_minor < 20)
hint = _("Block mode LRW is available since kernel 2.6.20.\n");
#endif
return hint;
}