diff options
author | James Prestwood <james.prestwood@linux.intel.com> | 2017-10-20 10:40:52 -0700 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2017-10-20 14:08:57 -0500 |
commit | 2bc262b3af1894e218a281b379fd1f9218e38281 (patch) | |
tree | 74a6871c427bb788a671a5b4d63ca98fed75d499 /src/simutil.c | |
parent | 35636752adc2fae57531e2fb2f8cad99adafa2be (diff) | |
download | ofono-2bc262b3af1894e218a281b379fd1f9218e38281.tar.gz |
simauth: Fixed incorrect AUTS length
The initial SimAuth implementation incorrectly parsed
the AUTS value as 16 bytes, not 14.
Diffstat (limited to 'src/simutil.c')
-rw-r--r-- | src/simutil.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/simutil.c b/src/simutil.c index 8fbde157..6e7051ed 100644 --- a/src/simutil.c +++ b/src/simutil.c @@ -1657,7 +1657,7 @@ gboolean sim_parse_umts_authenticate(const unsigned char *buffer, const unsigned char **ik, const unsigned char **auts, const unsigned char **kc) { - if (len < 18 || !buffer) + if (len < 16 || !buffer) return FALSE; switch (buffer[0]) { @@ -1695,12 +1695,12 @@ gboolean sim_parse_umts_authenticate(const unsigned char *buffer, break; case 0xdc: - /* 'DB' + '10' + AUTS(16) = 18 */ - if (len < 18) + /* 'DC' + '0E' + AUTS(14) = 16 */ + if (len < 16) goto umts_end; /* sync error */ - if (buffer[1] != 0x10) + if (buffer[1] != 0x0e) goto umts_end; *auts = buffer + 2; |