Skip to content

Commit

Permalink
Merge pull request #56 from dvucich/key_check
Browse files Browse the repository at this point in the history
Fix the master key check in osdp_cp_setup()
  • Loading branch information
sidcha committed Jun 11, 2021
2 parents 557298e + b35cabb commit 7a1f6db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/osdp_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,9 +1130,11 @@ osdp_t *osdp_cp_setup(int num_pd, osdp_pd_info_t *info, uint8_t *master_key)
}
}

if (master_key == NULL && scbk_count != num_pd) {
LOG_WRN("Master key / SCBK not passed; SC Disabled.");
SET_FLAG(ctx, FLAG_SC_DISABLED);
if (master_key == NULL) {
if (scbk_count != num_pd) {
LOG_WRN("Master key / SCBK not passed; SC Disabled.");
SET_FLAG(ctx, FLAG_SC_DISABLED);
}
} else {
LOG_WRN("Master Key based key derivation is discouraged! "
"Consider passing individual SCBKs");
Expand Down

0 comments on commit 7a1f6db

Please sign in to comment.