summaryrefslogtreecommitdiff
path: root/wrappers/php/src
diff options
context:
space:
mode:
authorStevenWdV <stevenwdv@gmail.com>2022-01-24 14:59:25 +0100
committerStevenWdV <stevenwdv@gmail.com>2022-01-24 16:24:57 +0100
commite544c6fa9e15e7277da79e2464243e90b2706b8c (patch)
treede6613747e0e34a799089d4677f9833a85748712 /wrappers/php/src
parentaab2e4b966c82b67eb0e204060e5ea6cd4ea15cf (diff)
Cleanup
Added variables to Makefiles to specify custom exports/ directory; Split exception classes in Java & C#; Added more comments; Renamed library and Go package; Removed real (pure) tests; Added generate_lib.ps1 to generate import .lib for Windows (Swift); Moved built Go libraries to exports/lib/; Switch to hopefully faster Swift GitHub Action.
Diffstat (limited to 'wrappers/php/src')
-rw-r--r--wrappers/php/src/Discovery.php10
-rw-r--r--wrappers/php/src/SignatureTooOldException.php2
2 files changed, 7 insertions, 5 deletions
diff --git a/wrappers/php/src/Discovery.php b/wrappers/php/src/Discovery.php
index 3ae7010..322d621 100644
--- a/wrappers/php/src/Discovery.php
+++ b/wrappers/php/src/Discovery.php
@@ -11,13 +11,15 @@ final class Discovery
{
public function __construct() { }
+ const LIB_NAME = "eduvpn_common";
+
private static ?FFI $ffi = null;
private static function ffi(): FFI
{
if (!self::$ffi) {
- if (!(self::$ffi = FFI::load(__DIR__ . '/headers/eduvpn_verify_php.h')))
- throw new Error('failed to load eduvpn_verify');
+ if (!(self::$ffi = FFI::load(__DIR__ . '/headers/' . self::LIB_NAME . '_php.h')))
+ throw new Error('failed to load ' . self::LIB_NAME);
}
return self::$ffi;
}
@@ -30,8 +32,8 @@ final class Discovery
* @param string $signedJson Signed .json file contents.
* @param string $expectedFileName The file type to be verified, one of "server_list.json" or
* "organization_list.json".
- * @param int $minSignTime Minimum time for signature. Should be set to at least the time in a previously
- * retrieved file.
+ * @param int $minSignTime Minimum time for signature. Should be set to at least the time of the previous
+ * signature.
* @return void
* @throws InvalidArgumentException If expectedFileName is not one of the allowed values.
* @throws VerifyException If signature verification fails.
diff --git a/wrappers/php/src/SignatureTooOldException.php b/wrappers/php/src/SignatureTooOldException.php
index bbae949..4b7e341 100644
--- a/wrappers/php/src/SignatureTooOldException.php
+++ b/wrappers/php/src/SignatureTooOldException.php
@@ -2,7 +2,7 @@
namespace EduVpn\Common;
-/** Signature has a timestamp lower than the specified minimum signing time. */
+/** Signature timestamp smaller than specified minimum signing time (rollback). */
final class SignatureTooOldException extends VerifyException
{
public function __construct()