Allow hex-strings to be separated by space characters:
opensc-tool -s "00 A4 00 00 02 3F 00 00" git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5187 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
1008062844
commit
c209e3a757
|
@ -56,7 +56,7 @@ int sc_hex_to_bin(const char *in, u8 *out, size_t *outlen)
|
|||
while (*in != '\0') {
|
||||
int byte = 0, nybbles = 2;
|
||||
|
||||
while (nybbles-- && *in && *in != ':') {
|
||||
while (nybbles-- && *in && *in != ':' && *in != ' ') {
|
||||
char c;
|
||||
byte <<= 4;
|
||||
c = *in++;
|
||||
|
@ -74,7 +74,7 @@ int sc_hex_to_bin(const char *in, u8 *out, size_t *outlen)
|
|||
}
|
||||
byte |= c;
|
||||
}
|
||||
if (*in == ':')
|
||||
if (*in == ':' || *in == ' ')
|
||||
in++;
|
||||
if (left <= 0) {
|
||||
err = SC_ERROR_BUFFER_TOO_SMALL;
|
||||
|
|
Loading…
Reference in New Issue