[AWARE] Passphrase limit check used incorrect limit

Passphrase has a lower and upper limit. The uppper limit check
was using the incorrect (lower) limit value.

Bug: 38164425
Test: builds & CtsVerifier test passes
Change-Id: I8a58f46a9558f828f8ccfda07935fcf62285f8c3
This commit is contained in:
Etan Cohen 2017-05-09 11:44:38 -07:00
parent 74247f83da
commit fed081c7a5

View file

@ -1125,7 +1125,7 @@ bool convertHidlNanPublishRequestToLegacy(
return false;
}
if (legacy_request->key_info.body.passphrase_info.passphrase_len
> NAN_SECURITY_MIN_PASSPHRASE_LEN) {
> NAN_SECURITY_MAX_PASSPHRASE_LEN) {
LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: passphrase_len too large";
return false;
}
@ -1241,7 +1241,7 @@ bool convertHidlNanSubscribeRequestToLegacy(
return false;
}
if (legacy_request->key_info.body.passphrase_info.passphrase_len
> NAN_SECURITY_MIN_PASSPHRASE_LEN) {
> NAN_SECURITY_MAX_PASSPHRASE_LEN) {
LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: passphrase_len too large";
return false;
}
@ -1465,7 +1465,7 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy(
return false;
}
if (legacy_request->key_info.body.passphrase_info.passphrase_len
> NAN_SECURITY_MIN_PASSPHRASE_LEN) {
> NAN_SECURITY_MAX_PASSPHRASE_LEN) {
LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: passphrase_len too large";
return false;
}
@ -1529,7 +1529,7 @@ bool convertHidlNanDataPathIndicationResponseToLegacy(
return false;
}
if (legacy_request->key_info.body.passphrase_info.passphrase_len
> NAN_SECURITY_MIN_PASSPHRASE_LEN) {
> NAN_SECURITY_MAX_PASSPHRASE_LEN) {
LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: passphrase_len too large";
return false;
}