Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102778175
D30447.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D30447.diff
View Options
diff --git a/sys/crypto/openssl/ossl_chacha20.c b/sys/crypto/openssl/ossl_chacha20.c
--- a/sys/crypto/openssl/ossl_chacha20.c
+++ b/sys/crypto/openssl/ossl_chacha20.c
@@ -65,15 +65,13 @@
resid = crp->crp_payload_length;
crypto_cursor_init(&cc_in, &crp->crp_buf);
crypto_cursor_advance(&cc_in, crp->crp_payload_start);
- inseg = crypto_cursor_segbase(&cc_in);
- inlen = crypto_cursor_seglen(&cc_in);
+ inseg = crypto_cursor_segment(&cc_in, &inlen);
if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) {
crypto_cursor_init(&cc_out, &crp->crp_obuf);
crypto_cursor_advance(&cc_out, crp->crp_payload_output_start);
} else
cc_out = cc_in;
- outseg = crypto_cursor_segbase(&cc_out);
- outlen = crypto_cursor_seglen(&cc_out);
+ outseg = crypto_cursor_segment(&cc_out, &outlen);
while (resid >= CHACHA_BLK_SIZE) {
if (inlen < CHACHA_BLK_SIZE) {
crypto_cursor_copydata(&cc_in, CHACHA_BLK_SIZE, block);
@@ -111,16 +109,14 @@
if (out == block) {
crypto_cursor_copyback(&cc_out, CHACHA_BLK_SIZE, block);
- outseg = crypto_cursor_segbase(&cc_out);
- outlen = crypto_cursor_seglen(&cc_out);
+ outseg = crypto_cursor_segment(&cc_out, &outlen);
} else {
crypto_cursor_advance(&cc_out, todo);
outseg += todo;
outlen -= todo;
}
if (in == block) {
- inseg = crypto_cursor_segbase(&cc_in);
- inlen = crypto_cursor_seglen(&cc_in);
+ inseg = crypto_cursor_segment(&cc_in, &inlen);
} else {
crypto_cursor_advance(&cc_in, todo);
inseg += todo;
@@ -196,15 +192,13 @@
resid = crp->crp_payload_length;
crypto_cursor_init(&cc_in, &crp->crp_buf);
crypto_cursor_advance(&cc_in, crp->crp_payload_start);
- inseg = crypto_cursor_segbase(&cc_in);
- inlen = crypto_cursor_seglen(&cc_in);
+ inseg = crypto_cursor_segment(&cc_in, &inlen);
if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) {
crypto_cursor_init(&cc_out, &crp->crp_obuf);
crypto_cursor_advance(&cc_out, crp->crp_payload_output_start);
} else
cc_out = cc_in;
- outseg = crypto_cursor_segbase(&cc_out);
- outlen = crypto_cursor_seglen(&cc_out);
+ outseg = crypto_cursor_segment(&cc_out, &outlen);
while (resid >= CHACHA_BLK_SIZE) {
if (inlen < CHACHA_BLK_SIZE) {
crypto_cursor_copydata(&cc_in, CHACHA_BLK_SIZE, block);
@@ -243,16 +237,14 @@
if (out == block) {
crypto_cursor_copyback(&cc_out, CHACHA_BLK_SIZE, block);
- outseg = crypto_cursor_segbase(&cc_out);
- outlen = crypto_cursor_seglen(&cc_out);
+ outseg = crypto_cursor_segment(&cc_out, &outlen);
} else {
crypto_cursor_advance(&cc_out, todo);
outseg += todo;
outlen -= todo;
}
if (in == block) {
- inseg = crypto_cursor_segbase(&cc_in);
- inlen = crypto_cursor_seglen(&cc_in);
+ inseg = crypto_cursor_segment(&cc_in, &inlen);
} else {
crypto_cursor_advance(&cc_in, todo);
inseg += todo;
@@ -368,15 +360,13 @@
resid = crp->crp_payload_length;
crypto_cursor_init(&cc_in, &crp->crp_buf);
crypto_cursor_advance(&cc_in, crp->crp_payload_start);
- inseg = crypto_cursor_segbase(&cc_in);
- inlen = crypto_cursor_seglen(&cc_in);
+ inseg = crypto_cursor_segment(&cc_in, &inlen);
if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) {
crypto_cursor_init(&cc_out, &crp->crp_obuf);
crypto_cursor_advance(&cc_out, crp->crp_payload_output_start);
} else
cc_out = cc_in;
- outseg = crypto_cursor_segbase(&cc_out);
- outlen = crypto_cursor_seglen(&cc_out);
+ outseg = crypto_cursor_segment(&cc_out, &outlen);
while (resid >= CHACHA_BLK_SIZE) {
if (inlen < CHACHA_BLK_SIZE) {
crypto_cursor_copydata(&cc_in, CHACHA_BLK_SIZE, block);
@@ -414,16 +404,14 @@
if (out == block) {
crypto_cursor_copyback(&cc_out, CHACHA_BLK_SIZE, block);
- outseg = crypto_cursor_segbase(&cc_out);
- outlen = crypto_cursor_seglen(&cc_out);
+ outseg = crypto_cursor_segment(&cc_out, &outlen);
} else {
crypto_cursor_advance(&cc_out, todo);
outseg += todo;
outlen -= todo;
}
if (in == block) {
- inseg = crypto_cursor_segbase(&cc_in);
- inlen = crypto_cursor_seglen(&cc_in);
+ inseg = crypto_cursor_segment(&cc_in, &inlen);
} else {
crypto_cursor_advance(&cc_in, todo);
inseg += todo;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 1:34 AM (20 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14688072
Default Alt Text
D30447.diff (4 KB)
Attached To
Mode
D30447: ossl: Use crypto_cursor_segment().
Attached
Detach File
Event Timeline
Log In to Comment