Skip to content

A free open source IT asset/license management system

Pass private_key_bits to openssl_pkey_new in tests

Marcus Moore75a06521541d
diff --git a/tests/Feature/SyncAdapters/AppleBusinessManager/ActivationLockEnrichmentTest.php b/tests/Feature/SyncAdapters/AppleBusinessManager/ActivationLockEnrichmentTest.php
index b30573ac15..71c778cedc 100644
--- a/tests/Feature/SyncAdapters/AppleBusinessManager/ActivationLockEnrichmentTest.php
+++ b/tests/Feature/SyncAdapters/AppleBusinessManager/ActivationLockEnrichmentTest.php
@@ -11,7 +11,6 @@ use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
-
class ActivationLockEnrichmentTest extends TestCase
{
private string $privateKeyPem;
@@ -24,6 +23,7 @@ class ActivationLockEnrichmentTest extends TestCase
$key = openssl_pkey_new([
'private_key_type' => OPENSSL_KEYTYPE_EC,
'curve_name' => 'prime256v1',
+ 'private_key_bits' => 2048,
]);
$pem = '';
openssl_pkey_export($key, $pem);
diff --git a/tests/Feature/SyncAdapters/AppleBusinessManager/AppleBusinessManagerAdapterTest.php b/tests/Feature/SyncAdapters/AppleBusinessManager/AppleBusinessManagerAdapterTest.php
index c526d3c959..789d2f7d89 100644
--- a/tests/Feature/SyncAdapters/AppleBusinessManager/AppleBusinessManagerAdapterTest.php
+++ b/tests/Feature/SyncAdapters/AppleBusinessManager/AppleBusinessManagerAdapterTest.php
@@ -29,6 +29,7 @@ class AppleBusinessManagerAdapterTest extends TestCase
$key = openssl_pkey_new([
'private_key_type' => OPENSSL_KEYTYPE_EC,
'curve_name' => 'prime256v1',
+ 'private_key_bits' => 2048,
]);
$pem = '';
openssl_pkey_export($key, $pem);
diff --git a/tests/Feature/SyncAdapters/AppleBusinessManager/AppleCareEnrichmentTest.php b/tests/Feature/SyncAdapters/AppleBusinessManager/AppleCareEnrichmentTest.php
index 873bcf8316..3aaeaa4bd4 100644
--- a/tests/Feature/SyncAdapters/AppleBusinessManager/AppleCareEnrichmentTest.php
+++ b/tests/Feature/SyncAdapters/AppleBusinessManager/AppleCareEnrichmentTest.php
@@ -31,6 +31,7 @@ class AppleCareEnrichmentTest extends TestCase
$key = openssl_pkey_new([
'private_key_type' => OPENSSL_KEYTYPE_EC,
'curve_name' => 'prime256v1',
+ 'private_key_bits' => 2048,
]);
$pem = '';
openssl_pkey_export($key, $pem);
diff --git a/tests/Feature/SyncAdapters/AppleBusinessManager/MdmDeviceEnrichmentTest.php b/tests/Feature/SyncAdapters/AppleBusinessManager/MdmDeviceEnrichmentTest.php
index 9129360639..89c5e38b79 100644
--- a/tests/Feature/SyncAdapters/AppleBusinessManager/MdmDeviceEnrichmentTest.php
+++ b/tests/Feature/SyncAdapters/AppleBusinessManager/MdmDeviceEnrichmentTest.php
@@ -23,6 +23,7 @@ class MdmDeviceEnrichmentTest extends TestCase
$key = openssl_pkey_new([
'private_key_type' => OPENSSL_KEYTYPE_EC,
'curve_name' => 'prime256v1',
+ 'private_key_bits' => 2048,
]);
$pem = '';
openssl_pkey_export($key, $pem);
diff --git a/tests/Feature/SyncAdapters/AppleBusinessManager/ModelImageEnrichmentTest.php b/tests/Feature/SyncAdapters/AppleBusinessManager/ModelImageEnrichmentTest.php
index 0948e63d6f..10c9d731cd 100644
--- a/tests/Feature/SyncAdapters/AppleBusinessManager/ModelImageEnrichmentTest.php
+++ b/tests/Feature/SyncAdapters/AppleBusinessManager/ModelImageEnrichmentTest.php
@@ -31,6 +31,7 @@ class ModelImageEnrichmentTest extends TestCase
$key = openssl_pkey_new([
'private_key_type' => OPENSSL_KEYTYPE_EC,
'curve_name' => 'prime256v1',
+ 'private_key_bits' => 2048,
]);
$pem = '';
openssl_pkey_export($key, $pem);
diff --git a/tests/Feature/SyncAdapters/AppleBusinessManager/PerFamilyCategoryRoutingTest.php b/tests/Feature/SyncAdapters/AppleBusinessManager/PerFamilyCategoryRoutingTest.php
index e8286e88d0..8f832c8170 100644
--- a/tests/Feature/SyncAdapters/AppleBusinessManager/PerFamilyCategoryRoutingTest.php
+++ b/tests/Feature/SyncAdapters/AppleBusinessManager/PerFamilyCategoryRoutingTest.php
@@ -32,6 +32,7 @@ class PerFamilyCategoryRoutingTest extends TestCase
$key = openssl_pkey_new([
'private_key_type' => OPENSSL_KEYTYPE_EC,
'curve_name' => 'prime256v1',
+ 'private_key_bits' => 2048,
]);
$pem = '';
openssl_pkey_export($key, $pem);
diff --git a/tests/Feature/SyncAdapters/AppleBusinessManager/PrivateKeyValidationTest.php b/tests/Feature/SyncAdapters/AppleBusinessManager/PrivateKeyValidationTest.php
index 763b2ecdb0..e824818292 100644
--- a/tests/Feature/SyncAdapters/AppleBusinessManager/PrivateKeyValidationTest.php
+++ b/tests/Feature/SyncAdapters/AppleBusinessManager/PrivateKeyValidationTest.php
@@ -7,7 +7,6 @@ use App\SyncAdapters\AppleBusinessManager\AppleBusinessManagerAdapter;
use Illuminate\Support\Facades\Validator;
use Tests\TestCase;
-
class PrivateKeyValidationTest extends TestCase
{
private AppleBusinessManagerAdapter $adapter;
@@ -79,6 +78,7 @@ class PrivateKeyValidationTest extends TestCase
$key = openssl_pkey_new([
'private_key_type' => OPENSSL_KEYTYPE_EC,
'curve_name' => $curve,
+ 'private_key_bits' => 2048,
]);
$pem = '';
openssl_pkey_export($key, $pem);