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
bf20d772
Commit
bf20d772
authored
Aug 10, 2015
by
Herbert Xu
Browse files
Options
Browse Files
Download
Plain Diff
Merge
git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Merge the crypto tree to pull in the authencesn fix.
parents
e94c6a7a
443c0d7e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
32 deletions
+12
-32
crypto/authencesn.c
crypto/authencesn.c
+12
-32
No files found.
crypto/authencesn.c
View file @
bf20d772
...
...
@@ -393,8 +393,6 @@ static int crypto_authenc_esn_genicv(struct aead_request *req, u8 *iv,
struct
scatterlist
*
cipher
=
areq_ctx
->
cipher
;
struct
scatterlist
*
hsg
=
areq_ctx
->
hsg
;
struct
scatterlist
*
tsg
=
areq_ctx
->
tsg
;
struct
scatterlist
*
assoc1
;
struct
scatterlist
*
assoc2
;
unsigned
int
ivsize
=
crypto_aead_ivsize
(
authenc_esn
);
unsigned
int
cryptlen
=
req
->
cryptlen
;
struct
page
*
dstp
;
...
...
@@ -412,27 +410,19 @@ static int crypto_authenc_esn_genicv(struct aead_request *req, u8 *iv,
cryptlen
+=
ivsize
;
}
if
(
sg_is_last
(
assoc
))
return
-
EINVAL
;
assoc1
=
assoc
+
1
;
if
(
sg_is_last
(
assoc1
))
return
-
EINVAL
;
assoc2
=
assoc
+
2
;
if
(
!
sg_is_last
(
assoc2
))
if
(
assoc
->
length
<
12
)
return
-
EINVAL
;
sg_init_table
(
hsg
,
2
);
sg_set_page
(
hsg
,
sg_page
(
assoc
),
assoc
->
length
,
assoc
->
offset
);
sg_set_page
(
hsg
+
1
,
sg_page
(
assoc
2
),
assoc2
->
length
,
assoc2
->
offset
);
sg_set_page
(
hsg
,
sg_page
(
assoc
),
4
,
assoc
->
offset
);
sg_set_page
(
hsg
+
1
,
sg_page
(
assoc
),
4
,
assoc
->
offset
+
8
);
sg_init_table
(
tsg
,
1
);
sg_set_page
(
tsg
,
sg_page
(
assoc
1
),
assoc1
->
length
,
assoc1
->
offset
);
sg_set_page
(
tsg
,
sg_page
(
assoc
),
4
,
assoc
->
offset
+
4
);
areq_ctx
->
cryptlen
=
cryptlen
;
areq_ctx
->
headlen
=
assoc
->
length
+
assoc2
->
length
;
areq_ctx
->
trailen
=
assoc1
->
length
;
areq_ctx
->
headlen
=
8
;
areq_ctx
->
trailen
=
4
;
areq_ctx
->
sg
=
dst
;
areq_ctx
->
complete
=
authenc_esn_geniv_ahash_done
;
...
...
@@ -563,8 +553,6 @@ static int crypto_authenc_esn_iverify(struct aead_request *req, u8 *iv,
struct
scatterlist
*
cipher
=
areq_ctx
->
cipher
;
struct
scatterlist
*
hsg
=
areq_ctx
->
hsg
;
struct
scatterlist
*
tsg
=
areq_ctx
->
tsg
;
struct
scatterlist
*
assoc1
;
struct
scatterlist
*
assoc2
;
unsigned
int
ivsize
=
crypto_aead_ivsize
(
authenc_esn
);
struct
page
*
srcp
;
u8
*
vsrc
;
...
...
@@ -580,27 +568,19 @@ static int crypto_authenc_esn_iverify(struct aead_request *req, u8 *iv,
cryptlen
+=
ivsize
;
}
if
(
sg_is_last
(
assoc
))
return
-
EINVAL
;
assoc1
=
assoc
+
1
;
if
(
sg_is_last
(
assoc1
))
return
-
EINVAL
;
assoc2
=
assoc
+
2
;
if
(
!
sg_is_last
(
assoc2
))
if
(
assoc
->
length
<
12
)
return
-
EINVAL
;
sg_init_table
(
hsg
,
2
);
sg_set_page
(
hsg
,
sg_page
(
assoc
),
assoc
->
length
,
assoc
->
offset
);
sg_set_page
(
hsg
+
1
,
sg_page
(
assoc
2
),
assoc2
->
length
,
assoc2
->
offset
);
sg_set_page
(
hsg
,
sg_page
(
assoc
),
4
,
assoc
->
offset
);
sg_set_page
(
hsg
+
1
,
sg_page
(
assoc
),
4
,
assoc
->
offset
+
8
);
sg_init_table
(
tsg
,
1
);
sg_set_page
(
tsg
,
sg_page
(
assoc
1
),
assoc1
->
length
,
assoc1
->
offset
);
sg_set_page
(
tsg
,
sg_page
(
assoc
),
4
,
assoc
->
offset
+
4
);
areq_ctx
->
cryptlen
=
cryptlen
;
areq_ctx
->
headlen
=
assoc
->
length
+
assoc2
->
length
;
areq_ctx
->
trailen
=
assoc1
->
length
;
areq_ctx
->
headlen
=
8
;
areq_ctx
->
trailen
=
4
;
areq_ctx
->
sg
=
src
;
areq_ctx
->
complete
=
authenc_esn_verify_ahash_done
;
...
...
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