Skip to content

Commit 5507b0c

Browse files
committed
Remove isAuthorityKeyIdDifferent function
1 parent 85cb540 commit 5507b0c

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/utility/SElementArduinoCloudCertificate.cpp

-19
Original file line numberDiff line numberDiff line change
@@ -145,25 +145,6 @@ int SElementArduinoCloudCertificate::signatureCompare(const byte * signatureA, c
145145
return 1;
146146
}
147147

148-
int SElementArduinoCloudCertificate::isAuthorityKeyIdDifferent(const ECP256Certificate & cert, const String & authorityKeyIdentifier)
149-
{
150-
byte authorityKeyIdentifierBytes[ECP256_CERT_AUTHORITY_KEY_ID_LENGTH];
151-
152-
if (authorityKeyIdentifier.length() == 0 || cert.authorityKeyId() == nullptr) {
153-
DEBUG_ERROR("SEACC::%s input params error.", __FUNCTION__);
154-
return -1;
155-
}
156-
157-
hexStringToBytes(authorityKeyIdentifier, authorityKeyIdentifierBytes, sizeof(authorityKeyIdentifierBytes));
158-
159-
/* If authorityKeyId are matching there is no need to rebuild*/
160-
if (memcmp(authorityKeyIdentifierBytes, cert.authorityKeyId() , ECP256_CERT_AUTHORITY_KEY_ID_LENGTH) == 0) {
161-
DEBUG_VERBOSE("SEACC::%s authorityKeyIdentifierBytes are equal", __FUNCTION__);
162-
return 0;
163-
}
164-
return 1;
165-
}
166-
167148
int SElementArduinoCloudCertificate::rebuild(SecureElement & se, ECP256Certificate & cert, const String & deviceId, const String & notBefore, const String & notAfter, const String & serialNumber, const String & authorityKeyIdentifier, const String & signature, const SElementArduinoCloudSlot keySlot)
168149
{
169150
byte serialNumberBytes[ECP256_CERT_SERIAL_NUMBER_LENGTH];

src/utility/SElementArduinoCloudCertificate.h

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class SElementArduinoCloudCertificate : public SElementCertificate
2828

2929
static int write(SecureElement & se, ECP256Certificate & cert, const SElementArduinoCloudSlot certSlot);
3030
static int read(SecureElement & se, ECP256Certificate & cert, const SElementArduinoCloudSlot certSlot, const SElementArduinoCloudSlot keySlot = SElementArduinoCloudSlot::Key);
31-
static int isAuthorityKeyIdDifferent(const ECP256Certificate & cert, const String & authorityKeyIdentifier);
3231
static int signatureCompare(const byte * signatureA, const String & signatureB);
3332
static int rebuild(SecureElement & se, ECP256Certificate & cert, const String & deviceId,
3433
const String & notBefore, const String & notAfter, const String & serialNumber,

0 commit comments

Comments
 (0)