Skip to content

Commit

Permalink
fix crypto sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavrax committed Oct 9, 2023
1 parent 6f1b49a commit f597b27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions core/samples/pubnub_crypto_module_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ int main()
struct pubnub_crypto_provider_t *legacy_crypto_module = pubnub_crypto_legacy_module_init((uint8_t*) cipher_key);
pubnub_bymebl_t legacy_encrypt_result = legacy_crypto_module->encrypt(legacy_crypto_module, block);

pubnub_bymebl_t kekw = legacy_crypto_module->decrypt(legacy_crypto_module, (pubnub_bymebl_t){.ptr = "½Àî–îˆùE߇E®6uPÂ", .size = 30});

if (NULL == legacy_encrypt_result.ptr) {
printf("encrypt with legacy AES-CBC failed\n");
return -1;
Expand Down Expand Up @@ -145,7 +143,7 @@ int main()

generate_user_id(pbp);

pubnub_set_cipher_key(pbp, cipher_key);
pubnub_set_crypto_module(pbp, pubnub_crypto_aes_cbc_module_init((uint8_t*)cipher_key));

enum pubnub_res result;

Expand Down
6 changes: 5 additions & 1 deletion openssl/posix.mk
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ endif
INCLUDES=-I .. -I . -I ../lib/base64/


all: pubnub_sync_sample pubnub_sync_grant_token_sample pubnub_sync_revoke_token_sample pubnub_objects_secretkey_sample metadata cancel_subscribe_sync_sample pubnub_sync_subloop_sample pubnub_publish_via_post_sample pubnub_publish_via_post_secretkey_sample pubnub_advanced_history_sample pubnub_fetch_history_sample pubnub_callback_sample subscribe_publish_callback_sample pubnub_callback_subloop_sample pubnub_fntest pubnub_console_sync pubnub_console_callback pubnub_crypto_sync_sample subscribe_publish_from_callback publish_callback_subloop_sample publish_queue_callback_subloop
all: pubnub_sync_sample pubnub_sync_grant_token_sample pubnub_sync_revoke_token_sample pubnub_objects_secretkey_sample metadata cancel_subscribe_sync_sample pubnub_sync_subloop_sample pubnub_publish_via_post_sample pubnub_publish_via_post_secretkey_sample pubnub_advanced_history_sample pubnub_fetch_history_sample pubnub_callback_sample subscribe_publish_callback_sample pubnub_callback_subloop_sample pubnub_fntest pubnub_console_sync pubnub_console_callback pubnub_crypto_sync_sample subscribe_publish_from_callback publish_callback_subloop_sample publish_queue_callback_subloop pubnub_crypto_module_sample

SYNC_INTF_SOURCEFILES=../core/pubnub_ntf_sync.c ../core/pubnub_sync_subscribe_loop.c ../core/srand_from_pubnub_time.c
SYNC_INTF_OBJFILES=pubnub_ntf_sync.o pubnub_sync_subscribe_loop.o srand_from_pubnub_time.o
Expand Down Expand Up @@ -236,6 +236,10 @@ publish_callback_subloop_sample: ../core/samples/publish_callback_subloop_sample
publish_queue_callback_subloop: ../core/samples/publish_queue_callback_subloop.c pubnub_callback.a
$(CC) -o $@ -D PUBNUB_CALLBACK_API $(CFLAGS) $(CFLAGS_CALLBACK) $(INCLUDES) ../core/samples/publish_queue_callback_subloop.c pubnub_callback.a $(LDLIBS)

pubnub_crypto_module_sample: ../core/samples/pubnub_crypto_module_sample.c pubnub_sync.a
$(CC) -o $@ -D PUBNUB_CRYPTO_API $(CFLAGS) $(INCLUDES) -I ../core/ ../core/samples/pubnub_crypto_module_sample.c pubnub_sync.a $(LDLIBS)


pubnub_fntest: ../core/fntest/pubnub_fntest.c ../core/fntest/pubnub_fntest_basic.c ../core/fntest/pubnub_fntest_medium.c ../posix/fntest/pubnub_fntest_posix.c ../posix/fntest/pubnub_fntest_runner.c pubnub_sync.a
$(CC) -o $@ $(CFLAGS) $(INCLUDES) ../core/fntest/pubnub_fntest.c ../core/fntest/pubnub_fntest_basic.c ../core/fntest/pubnub_fntest_medium.c ../posix/fntest/pubnub_fntest_posix.c ../posix/fntest/pubnub_fntest_runner.c pubnub_sync.a $(LDLIBS) -lpthread

Expand Down

0 comments on commit f597b27

Please sign in to comment.