mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zkey: Fix EP11 host library version checking
Extract the minor version and modification level separately. Previously only the modification level has been extracted, and was reported as minor version. Currently no one is checking the minor version or modification level, so it does not hurt. But maybe in the future one will check, so report it correctly. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
f7c048d0eb
commit
12f7dbbb3d
@@ -63,7 +63,8 @@ static int get_ep11_version(struct ep11_lib *ep11, bool verbose)
|
||||
pr_verbose(verbose, "host_version: 0x%08x", host_version);
|
||||
|
||||
ep11->version.major = (host_version & 0x00FF0000) >> 16;
|
||||
ep11->version.minor = host_version & 0x000000FF;
|
||||
ep11->version.minor = (host_version & 0x0000FF00) >> 8;
|
||||
ep11->version.modification = host_version & 0x000000FF;
|
||||
/*
|
||||
* EP11 host library < v2.0 returns an invalid version (i.e. 0x100).
|
||||
* This can safely be treated as version 1.0
|
||||
@@ -73,8 +74,9 @@ static int get_ep11_version(struct ep11_lib *ep11, bool verbose)
|
||||
ep11->version.minor = 0;
|
||||
}
|
||||
|
||||
pr_verbose(verbose, "EP11 library version: %u.%u",
|
||||
ep11->version.major, ep11->version.minor);
|
||||
pr_verbose(verbose, "EP11 library version: %u.%u.%u",
|
||||
ep11->version.major, ep11->version.minor,
|
||||
ep11->version.modification);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -140,8 +140,9 @@ typedef long (*xcpa_internal_rv_t)(const unsigned char *rsp, size_t rlen,
|
||||
struct XCPadmresp *rspblk, CK_RV *rv);
|
||||
|
||||
struct ep11_version {
|
||||
unsigned int minor;
|
||||
unsigned int major;
|
||||
unsigned int minor;
|
||||
unsigned int modification;
|
||||
};
|
||||
|
||||
struct ep11_lib {
|
||||
|
||||
Reference in New Issue
Block a user