- fingerprint.length = MAX_FINGERPRINT_LEN;
- for (i = 0; i < MAX_FINGERPRINT_LEN; i++) {
- fingerprint.fp[i] = (hex2bin(
- search[2 + i * 2])
+ /* v4 fingerprint */
+ fingerprint.length = 20;
+ for (j = 0; j < 20; j++) {
+ fingerprint.fp[j] = (hex2bin(
+ search[2 + j * 2])
+ << 4) +
+ hex2bin(search[3 + j * 2]);
+ }
+ isfp = true;
+ } else if (search != NULL && strlen(search) == 66 &&
+ search[0] == '0' && search[1] == 'x') {
+ /* v5 fingerprint */
+ fingerprint.length = 32;
+ for (j = 0; j < 32; j++) {
+ fingerprint.fp[j] = (hex2bin(
+ search[2 + j * 2])