FreeCalypso > hg > fc-am-toolkit
annotate bootutil/do_match.c @ 14:09c18549921b
add install of bootutil
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 10 Jun 2023 05:09:38 +0000 |
parents | fe5f7ba7f154 |
children |
rev | line source |
---|---|
12
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * The function implemented in this module performs a single match-check |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * between the boot image being analyzed and one of the reference versions |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * from ../bootmatch directory. |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 */ |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <sys/types.h> |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <string.h> |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <strings.h> |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include "../bootmatch/bootmatch.h" |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 check_for_match(image, bm) |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 u_char *image; |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 struct bootmatch *bm; |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 { |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 for (; bm->nbytes; bm++) { |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 if (bcmp(image + bm->offset, bm->refbytes, bm->nbytes)) |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 return(0); |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 } |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 return(1); |
fe5f7ba7f154
c139-analyze-boot utility put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 } |