-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdiet.patch
More file actions
50 lines (42 loc) · 1.29 KB
/
Copy pathdiet.patch
File metadata and controls
50 lines (42 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--- cryptsetup-1.2.0/lib/luks1/pbkdf.c~ 2009-09-11 16:11:50.000000000 +0200
+++ cryptsetup-1.2.0/lib/luks1/pbkdf.c 2010-06-21 11:16:57.353421474 +0200
@@ -174,7 +174,7 @@
if (gcry_md_setkey(prf, P, Plen))
goto out;
- for (i = 1; (uint) i <= l; i++) {
+ for (i = 1; (unsigned int) i <= l; i++) {
memset(T, 0, hLen);
for (u = 1; u <= c ; u++) {
@@ -198,7 +198,7 @@
memcpy(U, p, hLen);
- for (k = 0; (uint) k < hLen; k++)
+ for (k = 0; (unsigned int) k < hLen; k++)
T[k] ^= U[k];
if (perfcheck && __PBKDF2_performance) {
@@ -210,7 +210,7 @@
__PBKDF2_global_j++;
}
- memcpy(DK + (i - 1) * hLen, T, (uint) i == l ? r : hLen);
+ memcpy(DK + (i - 1) * hLen, T, (unsigned int) i == l ? r : hLen);
}
rc = 0;
out:
--- cryptsetup-1.5.1/lib/luks1/keymanage.c.orig 2012-09-19 13:55:25.000000000 +0200
+++ cryptsetup-1.5.1/lib/luks1/keymanage.c 2012-10-27 10:40:19.872153257 +0200
@@ -20,6 +20,7 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <limits.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <errno.h>
@@ -36,6 +37,10 @@
#include "pbkdf.h"
#include "internal.h"
+#ifndef UINT32_MAX
+#define UINT32_MAX UINT_MAX
+#endif
+
/* Get size of struct luks_phdr with all keyslots material space */
static size_t LUKS_device_sectors(size_t keyLen)
{