summaryrefslogtreecommitdiffstats
path: root/ncr.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncr.c')
-rw-r--r--ncr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ncr.c b/ncr.c
index c7f5494..352e0ed 100644
--- a/ncr.c
+++ b/ncr.c
@@ -91,10 +91,17 @@ struct ncr_master_key_st st;
return -EINVAL;
}
+ if (st.key_size != 16 && st.key_size != 24 && st.key_size != 32) {
+ dprintk(0, KERN_DEBUG, "Master key size must be 16,24 or 32.\n");
+ return -EINVAL;
+ }
+
if (master_key.type != NCR_KEY_TYPE_INVALID) {
dprintk(0, KERN_DEBUG, "Master key was previously initialized.\n");
}
+ dprintk(0, KERN_INFO, "Intializing master key.\n");
+
master_key.type = NCR_KEY_TYPE_SECRET;
memcpy(master_key.key.secret.data, st.key, st.key_size);