Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hiro
Tor
Commits
f42739e7
Commit
f42739e7
authored
6 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'maint-0.3.3'
parents
7fb941e9
0ef432d4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changes/bug26116
+7
-0
7 additions, 0 deletions
changes/bug26116
src/common/crypto_rsa.c
+1
-1
1 addition, 1 deletion
src/common/crypto_rsa.c
src/test/test_crypto.c
+41
-0
41 additions, 0 deletions
src/test/test_crypto.c
with
49 additions
and
1 deletion
changes/bug26116
0 → 100644
+
7
−
0
View file @
f42739e7
o Minor bugfixes (compatibility, openssl):
- Work around a change in OpenSSL 1.1.1 where
return values that would previously indicate "no password" now
indicate an empty password. Without this workaround, Tor instances
running with OpenSSL 1.1.1 would accept descriptors that other Tor
instances would reject. Fixes bug 26116; bugfix on 0.2.5.16.
This diff is collapsed.
Click to expand it.
src/common/crypto_rsa.c
+
1
−
1
View file @
f42739e7
...
...
@@ -239,7 +239,7 @@ pem_no_password_cb(char *buf, int size, int rwflag, void *u)
(
void
)
size
;
(
void
)
rwflag
;
(
void
)
u
;
return
0
;
return
-
1
;
}
/** Read a PEM-encoded private key from the <b>len</b>-byte string <b>s</b>
...
...
This diff is collapsed.
Click to expand it.
src/test/test_crypto.c
+
41
−
0
View file @
f42739e7
...
...
@@ -1363,6 +1363,46 @@ test_crypto_pk_base64(void *arg)
tor_free
(
encoded
);
}
static
void
test_crypto_pk_pem_encrypted
(
void
*
arg
)
{
crypto_pk_t
*
pk
=
NULL
;
(
void
)
arg
;
pk
=
crypto_pk_new
();
/* we need to make sure that we won't stall if somebody gives us a key
that's encrypted with a password. */
{
const
char
*
s
=
"-----BEGIN RSA PRIVATE KEY-----
\n
"
"Proc-Type: 4,ENCRYPTED
\n
"
"DEK-Info: AES-128-CBC,EFA86BB9D2AB11E80B4E3DCD97782B16
\n
"
"
\n
"
"Z2Je4m0cFepc6coQkVbGcvNCHxTf941N2XYEVE6kn0CqWqoUH4tlwV6for5D91np
\n
"
"5NiEFTkWj31EhrvrYcuiJtQ/iEbABxZULFWFeJ058rb+1izBz5rScqnEacIS/3Go
\n
"
"YntnROBDwiKmUnue6PJVYg==
\n
"
"-----END RSA PRIVATE KEY-----
\n
"
;
tt_int_op
(
-
1
,
OP_EQ
,
crypto_pk_read_private_key_from_string
(
pk
,
s
,
strlen
(
s
)));
}
/* For fun, make sure we aren't hit by OpenSSL issue
https://github.com/openssl/openssl/issues/6347 , where we get in trouble
if a cipher doesn't use an IV.
*/
{
const
char
*
s
=
"-----BEGIN RSA PUBLIC KEY-----
\n
"
"Proc-Type:4,ENCRYPTED
\n
"
"DEK-Info:des-ede -
\n
"
"
\n
"
"iRqK
\n
"
"-----END RSA PUBLIC KEY-----
\n
"
;
tt_int_op
(
-
1
,
OP_EQ
,
crypto_pk_read_public_key_from_string
(
pk
,
s
,
strlen
(
s
)));
}
done:
crypto_pk_free
(
pk
);
}
#ifdef HAVE_TRUNCATE
#define do_truncate truncate
#else
...
...
@@ -2991,6 +3031,7 @@ struct testcase_t crypto_tests[] = {
CRYPTO_LEGACY
(
pk
),
{
"pk_fingerprints"
,
test_crypto_pk_fingerprints
,
TT_FORK
,
NULL
,
NULL
},
{
"pk_base64"
,
test_crypto_pk_base64
,
TT_FORK
,
NULL
,
NULL
},
{
"pk_pem_encrypted"
,
test_crypto_pk_pem_encrypted
,
TT_FORK
,
NULL
,
NULL
},
CRYPTO_LEGACY
(
digests
),
{
"digest_names"
,
test_crypto_digest_names
,
0
,
NULL
,
NULL
},
{
"sha3"
,
test_crypto_sha3
,
TT_FORK
,
NULL
,
NULL
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment