Skip to content

Commit

Permalink
Merge pull request #66 from scanoss/5.4.1
Browse files Browse the repository at this point in the history
Add encoder lib version log
  • Loading branch information
mscasso-scanoss authored Apr 14, 2024
2 parents 8f90eb2 + 6baa857 commit 06e85f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions inc/decrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

extern char * (*decrypt_data) (uint8_t *data, uint32_t size, struct ldb_table table, uint8_t *key, uint8_t *subkey);
extern void (*decrypt_mz) (uint8_t *data, uint32_t len);
extern void (*encoder_version) (char * version);

char * standalone_decrypt_data(uint8_t *data, uint32_t size,struct ldb_table table, uint8_t *key, uint8_t *subkey);

Expand Down
1 change: 1 addition & 0 deletions src/decrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

char * (*decrypt_data) (uint8_t *data, uint32_t size, struct ldb_table table, uint8_t *key, uint8_t *subkey);
void (*decrypt_mz) (uint8_t *data, uint32_t len);
void (*encoder_version) (char * version);
/**
* @brief Decrypt data function pointer. Will be executed for the ldb_fetch_recordset function in each iteration. See LDB documentation for more details.
* @param data //TODO
Expand Down
9 changes: 7 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,10 @@ bool lib_encoder_load()
scanlog("Lib scanoss-enocder present\n");
decrypt_data = dlsym(lib_encoder_handle, "scanoss_decode_table");
decrypt_mz = dlsym(lib_encoder_handle, "scanoss_decode_mz");
encoder_version = dlsym(lib_encoder_handle, "scanoss_encoder_version");
if ((err = dlerror()))
{
printf("%s\n", err);
printf("%s - You may need to update libscanoss_encoder.so\n", err);
exit(EXIT_FAILURE);
}
return true;
Expand Down Expand Up @@ -377,7 +378,11 @@ int main(int argc, char **argv)
quiet = true;
scanlog("Quiet mode enabled. Displaying only debugging info via STDERR.\n");
if (lib_encoder_present)
scanlog("Lib encoder present.\n");
{
char version[32] = "\0";
encoder_version(version);
scanlog("Lib encoder present - version %s\n", version);
}
break;

case 'd':
Expand Down

0 comments on commit 06e85f9

Please sign in to comment.