Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
b9eecee8
Commit
b9eecee8
authored
8 years ago
by
Jaime Pérez
Browse files
Options
Downloads
Patches
Plain Diff
Minor formatting and phpdoc fixes.
parent
c7ea9f8e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/SimpleSAML/Utils/Crypto.php
+10
-8
10 additions, 8 deletions
lib/SimpleSAML/Utils/Crypto.php
with
10 additions
and
8 deletions
lib/SimpleSAML/Utils/Crypto.php
+
10
−
8
View file @
b9eecee8
<?php
namespace
SimpleSAML\Utils
;
namespace
SimpleSAML\Utils
;
/**
* A class for cryptography-related functions
* A class for cryptography-related functions
.
*
* @package SimpleSAMLphp
*/
...
...
@@ -17,7 +17,7 @@ class Crypto
* @param string $secret The secret to use to decrypt the data.
*
* @return string The decrypted data.
* @
htor
ws \InvalidArgumentException If $ciphertext is not a string.
* @
thro
ws \InvalidArgumentException If $ciphertext is not a string.
* @throws \SimpleSAML_Error_Exception If the openssl module is not loaded.
*
* @see \SimpleSAML\Utils\Crypto::aesDecrypt()
...
...
@@ -48,7 +48,7 @@ class Crypto
* @param string $ciphertext The IV used and the encrypted data, concatenated.
*
* @return string The decrypted data.
* @
htor
ws \InvalidArgumentException If $ciphertext is not a string.
* @
thro
ws \InvalidArgumentException If $ciphertext is not a string.
* @throws \SimpleSAML_Error_Exception If the openssl module is not loaded.
*
* @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no>
...
...
@@ -183,7 +183,8 @@ class Crypto
* This function will return an array with these elements:
* - 'PEM': The public key/certificate in PEM-encoding.
* - 'certData': The certificate data, base64 encoded, on a single line. (Only present if this is a certificate.)
* - 'certFingerprint': Array of valid certificate fingerprints. (Deprecated. Only present if this is a certificate.)
* - 'certFingerprint': Array of valid certificate fingerprints. (Deprecated. Only present if this is a
* certificate.)
*
* @param \SimpleSAML_Configuration $metadata The metadata.
* @param bool $required Whether the private key is required. If this is TRUE, a missing key
...
...
@@ -239,8 +240,10 @@ class Crypto
$fp
=
strtolower
(
str_replace
(
':'
,
''
,
$fp
));
}
// We can't build a full certificate from a fingerprint, and may as well return an array with only the
//fingerprint(s) immediately.
/*
* We can't build a full certificate from a fingerprint, and may as well return an array with only the
* fingerprint(s) immediately.
*/
return
array
(
'certFingerprint'
=>
$fps
);
}
...
...
@@ -321,7 +324,6 @@ class Crypto
// match algorithm string (e.g. '{SSHA256}', '{MD5}')
if
(
preg_match
(
'/^{(.*?)}(.*)$/'
,
$hash
,
$matches
))
{
// LDAP compatibility
$alg
=
preg_replace
(
'/^(S?SHA)$/'
,
'${1}1'
,
$matches
[
1
]);
...
...
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