diff options
author | marijus <mario@localhost.localdomain> | 2013-12-16 12:51:35 +0100 |
---|---|---|
committer | marijus <mario@localhost.localdomain> | 2013-12-16 12:51:35 +0100 |
commit | 5512d6aa1df61e0cdab31a2758d3a865ddfbc280 (patch) | |
tree | 1f2d763c495ad5192456d54036eb3dcc8fafb595 /include/crypto.php | |
parent | c3c7a068332ae08aea5eeb8eaf820e34c9cf210b (diff) | |
parent | a7a775a718ef92c9bd623849baab1e386071d70b (diff) | |
download | volse-hubzilla-5512d6aa1df61e0cdab31a2758d3a865ddfbc280.tar.gz volse-hubzilla-5512d6aa1df61e0cdab31a2758d3a865ddfbc280.tar.bz2 volse-hubzilla-5512d6aa1df61e0cdab31a2758d3a865ddfbc280.zip |
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'include/crypto.php')
-rw-r--r-- | include/crypto.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/crypto.php b/include/crypto.php index e9372fbb4..33cdc10c0 100644 --- a/include/crypto.php +++ b/include/crypto.php @@ -4,6 +4,8 @@ function rsa_sign($data,$key,$alg = 'sha256') { if(! $key) return 'no key'; $sig = ''; + if(intval(OPENSSL_ALGO_SHA256) && $alg === 'sha256') + $alg = OPENSSL_ALGO_SHA256; openssl_sign($data,$sig,$key,$alg); return $sig; } @@ -13,6 +15,8 @@ function rsa_verify($data,$sig,$key,$alg = 'sha256') { if(! $key) return false; + if(intval(OPENSSL_ALGO_SHA256) && $alg === 'sha256') + $alg = OPENSSL_ALGO_SHA256; $verify = openssl_verify($data,$sig,$key,$alg); return $verify; } |