Skip to content

Commit

Permalink
Fix test compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
JackOfMostTrades committed Nov 11, 2023
1 parent 8468099 commit e3a88dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ test: aws_kms_pkcs11_test certificates_test
AWS_KMS_PKCS11_DEBUG=1 ./aws_kms_pkcs11_test

certificates_test: certificates.cpp certificates_test.cpp
g++ -g -Wall certificates.cpp certificates_test.cpp -o certificates_test -lcrypto
g++ -g -fPIC -Wall -I$(AWS_SDK_PATH)/include $(PKCS11_INC) $(JSON_C_INC) -fno-exceptions -std=c++17 \
debug.cpp certificates.cpp certificates_test.cpp -o certificates_test $(STATIC_LIBS) $(LIBS) -lcrypto -ljson-c -lcurl

aws_kms_pkcs11_test: aws_kms_pkcs11_test.c aws_kms_pkcs11.so
gcc -g -Wall $(PKCS11_INC) aws_kms_pkcs11_test.c -o aws_kms_pkcs11_test -ldl
g++ -g -fPIC -Wall -I$(AWS_SDK_PATH)/include $(PKCS11_INC) $(JSON_C_INC) -fno-exceptions -std=c++17 \
aws_kms_pkcs11_test.c -o aws_kms_pkcs11_test -ldl

aws_kms_pkcs11.so: aws_kms_pkcs11.cpp unsupported.cpp aws_kms_slot.cpp debug.cpp attributes.cpp certificates.cpp
g++ -shared -fPIC -Wall -I$(AWS_SDK_PATH)/include $(PKCS11_INC) $(JSON_C_INC) -fno-exceptions -std=c++17 $(SRC) \
Expand Down
2 changes: 1 addition & 1 deletion aws_kms_pkcs11_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ int main(int argc, char** argv) {
return 1;
}

pSlotList = malloc(slotCount * sizeof(CK_SLOT_ID));
pSlotList = (CK_SLOT_ID_PTR) malloc(slotCount * sizeof(CK_SLOT_ID));
if (pSlotList == NULL) {
printf("Failed to allocate memory to store slot IDs.");
return 1;
Expand Down
3 changes: 2 additions & 1 deletion certificates.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <string>
#include <openssl/x509.h>

X509* parseCertificateFromFile(const char* filename);
X509* parseCertificateFromB64Der(const char* b64Der);
X509* parseCertificateFromARN(const string &ca_arn, const string &arn, const std::string &region);
X509* parseCertificateFromARN(const std::string &ca_arn, const std::string &arn, const std::string &region);

0 comments on commit e3a88dd

Please sign in to comment.