Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
25f5d74c
Commit
25f5d74c
authored
May 15, 2003
by
Andrew Morton
Committed by
David S. Miller
May 15, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CRYPTO]: Fix memcpy/memset args.
parent
4e4d6a6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
crypto/deflate.c
crypto/deflate.c
+2
-2
crypto/md4.c
crypto/md4.c
+1
-1
crypto/md5.c
crypto/md5.c
+1
-1
crypto/tcrypt.c
crypto/tcrypt.c
+6
-6
No files found.
crypto/deflate.c
View file @
25f5d74c
...
@@ -81,7 +81,7 @@ static int deflate_comp_init(struct deflate_ctx *ctx)
...
@@ -81,7 +81,7 @@ static int deflate_comp_init(struct deflate_ctx *ctx)
ret
=
-
ENOMEM
;
ret
=
-
ENOMEM
;
goto
out
;
goto
out
;
}
}
memset
(
stream
->
workspace
,
0
,
sizeof
(
stream
->
workspace
));
memset
(
stream
->
workspace
,
0
,
zlib_deflate_workspacesize
(
));
ret
=
zlib_deflateInit2
(
stream
,
DEFLATE_DEF_LEVEL
,
Z_DEFLATED
,
ret
=
zlib_deflateInit2
(
stream
,
DEFLATE_DEF_LEVEL
,
Z_DEFLATED
,
-
DEFLATE_DEF_WINBITS
,
DEFLATE_DEF_MEMLEVEL
,
-
DEFLATE_DEF_WINBITS
,
DEFLATE_DEF_MEMLEVEL
,
Z_DEFAULT_STRATEGY
);
Z_DEFAULT_STRATEGY
);
...
@@ -108,7 +108,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
...
@@ -108,7 +108,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
ret
=
-
ENOMEM
;
ret
=
-
ENOMEM
;
goto
out
;
goto
out
;
}
}
memset
(
stream
->
workspace
,
0
,
sizeof
(
stream
->
workspace
));
memset
(
stream
->
workspace
,
0
,
zlib_inflate_workspacesize
(
));
ret
=
zlib_inflateInit2
(
stream
,
-
DEFLATE_DEF_WINBITS
);
ret
=
zlib_inflateInit2
(
stream
,
-
DEFLATE_DEF_WINBITS
);
if
(
ret
!=
Z_OK
)
{
if
(
ret
!=
Z_OK
)
{
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
...
...
crypto/md4.c
View file @
25f5d74c
...
@@ -215,7 +215,7 @@ static void md4_final(void *ctx, u8 *out)
...
@@ -215,7 +215,7 @@ static void md4_final(void *ctx, u8 *out)
md4_transform
(
mctx
->
hash
,
mctx
->
block
);
md4_transform
(
mctx
->
hash
,
mctx
->
block
);
cpu_to_le32_array
(
mctx
->
hash
,
sizeof
(
mctx
->
hash
)
/
sizeof
(
u32
));
cpu_to_le32_array
(
mctx
->
hash
,
sizeof
(
mctx
->
hash
)
/
sizeof
(
u32
));
memcpy
(
out
,
mctx
->
hash
,
sizeof
(
mctx
->
hash
));
memcpy
(
out
,
mctx
->
hash
,
sizeof
(
mctx
->
hash
));
memset
(
mctx
,
0
,
sizeof
(
mctx
));
memset
(
mctx
,
0
,
sizeof
(
*
mctx
));
}
}
static
struct
crypto_alg
alg
=
{
static
struct
crypto_alg
alg
=
{
...
...
crypto/md5.c
View file @
25f5d74c
...
@@ -210,7 +210,7 @@ static void md5_final(void *ctx, u8 *out)
...
@@ -210,7 +210,7 @@ static void md5_final(void *ctx, u8 *out)
md5_transform
(
mctx
->
hash
,
mctx
->
block
);
md5_transform
(
mctx
->
hash
,
mctx
->
block
);
cpu_to_le32_array
(
mctx
->
hash
,
sizeof
(
mctx
->
hash
)
/
sizeof
(
u32
));
cpu_to_le32_array
(
mctx
->
hash
,
sizeof
(
mctx
->
hash
)
/
sizeof
(
u32
));
memcpy
(
out
,
mctx
->
hash
,
sizeof
(
mctx
->
hash
));
memcpy
(
out
,
mctx
->
hash
,
sizeof
(
mctx
->
hash
));
memset
(
mctx
,
0
,
sizeof
(
mctx
));
memset
(
mctx
,
0
,
sizeof
(
*
mctx
));
}
}
static
struct
crypto_alg
alg
=
{
static
struct
crypto_alg
alg
=
{
...
...
crypto/tcrypt.c
View file @
25f5d74c
...
@@ -113,7 +113,7 @@ test_md5(void)
...
@@ -113,7 +113,7 @@ test_md5(void)
printk
(
"
\n
testing md5 across pages
\n
"
);
printk
(
"
\n
testing md5 across pages
\n
"
);
/* setup the dummy buffer first */
/* setup the dummy buffer first */
memset
(
xbuf
,
0
,
sizeof
(
xbuf
)
);
memset
(
xbuf
,
0
,
XBUFSIZE
);
memcpy
(
&
xbuf
[
IDX1
],
"abcdefghijklm"
,
13
);
memcpy
(
&
xbuf
[
IDX1
],
"abcdefghijklm"
,
13
);
memcpy
(
&
xbuf
[
IDX2
],
"nopqrstuvwxyz"
,
13
);
memcpy
(
&
xbuf
[
IDX2
],
"nopqrstuvwxyz"
,
13
);
...
@@ -188,7 +188,7 @@ test_hmac_md5(void)
...
@@ -188,7 +188,7 @@ test_hmac_md5(void)
printk
(
"
\n
testing hmac_md5 across pages
\n
"
);
printk
(
"
\n
testing hmac_md5 across pages
\n
"
);
memset
(
xbuf
,
0
,
sizeof
(
xbuf
)
);
memset
(
xbuf
,
0
,
XBUFSIZE
);
memcpy
(
&
xbuf
[
IDX1
],
"what do ya want "
,
16
);
memcpy
(
&
xbuf
[
IDX1
],
"what do ya want "
,
16
);
memcpy
(
&
xbuf
[
IDX2
],
"for nothing?"
,
12
);
memcpy
(
&
xbuf
[
IDX2
],
"for nothing?"
,
12
);
...
@@ -267,7 +267,7 @@ test_hmac_sha1(void)
...
@@ -267,7 +267,7 @@ test_hmac_sha1(void)
printk
(
"
\n
testing hmac_sha1 across pages
\n
"
);
printk
(
"
\n
testing hmac_sha1 across pages
\n
"
);
/* setup the dummy buffer first */
/* setup the dummy buffer first */
memset
(
xbuf
,
0
,
sizeof
(
xbuf
)
);
memset
(
xbuf
,
0
,
XBUFSIZE
);
memcpy
(
&
xbuf
[
IDX1
],
"what do ya want "
,
16
);
memcpy
(
&
xbuf
[
IDX1
],
"what do ya want "
,
16
);
memcpy
(
&
xbuf
[
IDX2
],
"for nothing?"
,
12
);
memcpy
(
&
xbuf
[
IDX2
],
"for nothing?"
,
12
);
...
@@ -450,7 +450,7 @@ test_sha1(void)
...
@@ -450,7 +450,7 @@ test_sha1(void)
printk
(
"
\n
testing sha1 across pages
\n
"
);
printk
(
"
\n
testing sha1 across pages
\n
"
);
/* setup the dummy buffer first */
/* setup the dummy buffer first */
memset
(
xbuf
,
0
,
sizeof
(
xbuf
)
);
memset
(
xbuf
,
0
,
XBUFSIZE
);
memcpy
(
&
xbuf
[
IDX1
],
"abcdbcdecdefdefgefghfghighij"
,
28
);
memcpy
(
&
xbuf
[
IDX1
],
"abcdbcdecdefdefgefghfghighij"
,
28
);
memcpy
(
&
xbuf
[
IDX2
],
"hijkijkljklmklmnlmnomnopnopq"
,
28
);
memcpy
(
&
xbuf
[
IDX2
],
"hijkijkljklmklmnlmnomnopnopq"
,
28
);
...
@@ -525,7 +525,7 @@ test_sha256(void)
...
@@ -525,7 +525,7 @@ test_sha256(void)
printk
(
"
\n
testing sha256 across pages
\n
"
);
printk
(
"
\n
testing sha256 across pages
\n
"
);
/* setup the dummy buffer first */
/* setup the dummy buffer first */
memset
(
xbuf
,
0
,
sizeof
(
xbuf
)
);
memset
(
xbuf
,
0
,
XBUFSIZE
);
memcpy
(
&
xbuf
[
IDX1
],
"abcdbcdecdefdefgefghfghighij"
,
28
);
memcpy
(
&
xbuf
[
IDX1
],
"abcdbcdecdefdefgefghfghighij"
,
28
);
memcpy
(
&
xbuf
[
IDX2
],
"hijkijkljklmklmnlmnomnopnopq"
,
28
);
memcpy
(
&
xbuf
[
IDX2
],
"hijkijkljklmklmnlmnomnopnopq"
,
28
);
...
@@ -1027,7 +1027,7 @@ test_des(void)
...
@@ -1027,7 +1027,7 @@ test_des(void)
}
}
/* setup the dummy buffer first */
/* setup the dummy buffer first */
memset
(
xbuf
,
0
,
sizeof
(
xbuf
)
);
memset
(
xbuf
,
0
,
XBUFSIZE
);
xbuf
[
IDX1
]
=
des_tv
[
i
].
plaintext
[
0
];
xbuf
[
IDX1
]
=
des_tv
[
i
].
plaintext
[
0
];
xbuf
[
IDX2
]
=
des_tv
[
i
].
plaintext
[
1
];
xbuf
[
IDX2
]
=
des_tv
[
i
].
plaintext
[
1
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment