Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-crypto
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-crypto
Commits
2884156b
Commit
2884156b
authored
Sep 13, 2019
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libcrypto backwards compatibility
parent
5afe33cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
configure.ac
configure.ac
+4
-0
vmod_crypto.c
src/vmod_crypto.c
+32
-1
No files found.
configure.ac
View file @
2884156b
...
...
@@ -26,6 +26,10 @@ AC_CHECK_LIB([crypto],
[EVP_MD_CTX_free],
[AC_DEFINE([HAVE_EVP_MD_CTX_FREE], [],
[Libcrypto has EVP_MD_CTX_free])])
AC_CHECK_LIB([crypto],
[RSA_set0_key],
[AC_DEFINE([HAVE_RSA_SET0_KEY], [],
[Libcrypto has RSA_set0_key])])
AC_CHECK_PROGS(BASE64, [base64], [no])
test "$BASE64" == "no" && AC_MSG_ERROR([Required program 'base64' not found.])
...
...
src/vmod_crypto.c
View file @
2884156b
...
...
@@ -124,7 +124,7 @@ fini(void)
/*
* ------------------------------------------------------------
* libcryto
housekeeping
* libcryto
compat
*/
#ifndef HAVE_EVP_MD_CTX_FREE
...
...
@@ -132,6 +132,37 @@ fini(void)
#define EVP_MD_CTX_new() EVP_MD_CTX_create()
#endif
#ifndef HAVE_RSA_SET0_KEY
/* from openssl crypto/rsa/rsa_lib.c */
static
int
RSA_set0_key
(
RSA
*
r
,
BIGNUM
*
n
,
BIGNUM
*
e
,
BIGNUM
*
d
)
{
/* If the fields n and e in r are NULL, the corresponding input
* parameters MUST be non-NULL for n and e. d may be
* left NULL (in case only the public key is used).
*/
if
((
r
->
n
==
NULL
&&
n
==
NULL
)
||
(
r
->
e
==
NULL
&&
e
==
NULL
))
return
0
;
if
(
n
!=
NULL
)
{
BN_free
(
r
->
n
);
r
->
n
=
n
;
}
if
(
e
!=
NULL
)
{
BN_free
(
r
->
e
);
r
->
e
=
e
;
}
if
(
d
!=
NULL
)
{
BN_clear_free
(
r
->
d
);
r
->
d
=
d
;
BN_set_flags
(
r
->
d
,
BN_FLG_CONSTTIME
);
}
return
1
;
}
#endif
/*
* ------------------------------------------------------------
* $Object key()
...
...
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