\hypertarget{ef10__image_8c_source}{}\doxysection{ef10\+\_\+image.\+c}
\label{ef10__image_8c_source}\index{dev/sfxge/common/ef10\_image.c@{dev/sfxge/common/ef10\_image.c}}
\mbox{\hyperlink{ef10__image_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2017-\/2018 Solarflare Communications Inc.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions are met:}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright notice,}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00011}00011 \textcolor{comment}{ *    this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright notice,}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00013}00013 \textcolor{comment}{ *    this list of conditions and the following disclaimer in the documentation}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00014}00014 \textcolor{comment}{ *    and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "{}AS IS"{}}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00017}00017 \textcolor{comment}{ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00018}00018 \textcolor{comment}{ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00019}00019 \textcolor{comment}{ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00020}00020 \textcolor{comment}{ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00021}00021 \textcolor{comment}{ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00022}00022 \textcolor{comment}{ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00023}00023 \textcolor{comment}{ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00024}00024 \textcolor{comment}{ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00025}00025 \textcolor{comment}{ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00026}00026 \textcolor{comment}{ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00027}00027 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00028}00028 \textcolor{comment}{ * The views and conclusions contained in the software and documentation are}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00029}00029 \textcolor{comment}{ * those of the authors and should not be interpreted as representing official}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00030}00030 \textcolor{comment}{ * policies, either expressed or implied, of the FreeBSD Project.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00031}00031 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00034}\mbox{\hyperlink{ef10__image_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00034}} \mbox{\hyperlink{ef10__image_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00036}00036 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{efx_8h}{efx.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00037}00037 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{efx__impl_8h}{efx\_impl.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00039}00039 \textcolor{preprocessor}{\#if EFSYS\_OPT\_MEDFORD || EFSYS\_OPT\_MEDFORD2}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00041}00041 \textcolor{preprocessor}{\#if EFSYS\_OPT\_IMAGE\_LAYOUT}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00043}00043 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00044}00044 \textcolor{comment}{ * Utility routines to support limited parsing of ASN.1 tags. This is not a}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00045}00045 \textcolor{comment}{ * general purpose ASN.1 parser, but is sufficient to locate the required}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00046}00046 \textcolor{comment}{ * objects in a signed image with CMS headers.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00047}00047 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00049}00049 \textcolor{comment}{/* DER encodings for ASN.1 tags (see ITU-\/T X.690) */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00050}00050 \textcolor{preprocessor}{\#define ASN1\_TAG\_INTEGER            (0x02)}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00051}00051 \textcolor{preprocessor}{\#define ASN1\_TAG\_OCTET\_STRING       (0x04)}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00052}00052 \textcolor{preprocessor}{\#define ASN1\_TAG\_OBJ\_ID             (0x06)}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00053}00053 \textcolor{preprocessor}{\#define ASN1\_TAG\_SEQUENCE           (0x30)}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00054}00054 \textcolor{preprocessor}{\#define ASN1\_TAG\_SET                (0x31)}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00056}00056 \textcolor{preprocessor}{\#define ASN1\_TAG\_IS\_PRIM(tag)       ((tag \& 0x20) == 0)}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00058}00058 \textcolor{preprocessor}{\#define ASN1\_TAG\_PRIM\_CONTEXT(n)    (0x80 + (n))}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00059}00059 \textcolor{preprocessor}{\#define ASN1\_TAG\_CONS\_CONTEXT(n)    (0xA0 + (n))}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00061}00061 \textcolor{keyword}{typedef} \textcolor{keyword}{struct }efx\_asn1\_cursor\_s \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00062}00062         uint8\_t         *buffer;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00063}00063         uint32\_t        length;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00065}00065         uint8\_t         tag;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00066}00066         uint32\_t        hdr\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00067}00067         uint32\_t        val\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00068}00068 \} efx\_asn1\_cursor\_t;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00070}00070 \textcolor{comment}{/* Parse header of DER encoded ASN.1 TLV and match tag */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00071}00071 \textcolor{keyword}{static}  \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00072}00072 efx\_asn1\_parse\_header\_match\_tag(}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00073}00073         \mbox{\hyperlink{efx__annote_8h_a9a66acb8f87800f41a837406c837cb32}{\_\_inout}}          efx\_asn1\_cursor\_t       *cursor,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00074}00074         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                uint8\_t                 tag)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00075}00075 \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00076}00076         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00077}00077 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00078}00078         \textcolor{keywordflow}{if} (cursor == NULL || cursor-\/>buffer == NULL || cursor-\/>length < 2) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00079}00079                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00080}00080                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00081}00081         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00083}00083         cursor-\/>tag = cursor-\/>buffer[0];}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00084}00084         \textcolor{keywordflow}{if} (cursor-\/>tag != tag) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00085}00085                 \textcolor{comment}{/* Tag not matched */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00086}00086                 rc = ENOENT;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00087}00087                 \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00088}00088         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00090}00090         \textcolor{keywordflow}{if} ((cursor-\/>tag \& 0x1F) == 0x1F) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00091}00091                 \textcolor{comment}{/* Long tag format not used in CMS syntax */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00092}00092                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00093}00093                 \textcolor{keywordflow}{goto} fail3;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00094}00094         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00096}00096         \textcolor{keywordflow}{if} ((cursor-\/>buffer[1] \& 0x80) == 0) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00097}00097                 \textcolor{comment}{/* Short form: length is 0..127 */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00098}00098                 cursor-\/>hdr\_size = 2;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00099}00099                 cursor-\/>val\_size = cursor-\/>buffer[1];}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00100}00100         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00101}00101                 \textcolor{comment}{/* Long form: length encoded as [0x80+nbytes][length bytes] */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00102}00102                 uint32\_t nbytes = cursor-\/>buffer[1] \& 0x7F;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00103}00103                 uint32\_t \mbox{\hyperlink{sfxge__rx_8c_aadb6d6eb83e646653a1402032e45dcab}{offset}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00104}00104 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00105}00105                 \textcolor{keywordflow}{if} (nbytes == 0) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00106}00106                         \textcolor{comment}{/* Indefinite length not allowed in DER encoding */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00107}00107                         rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00108}00108                         \textcolor{keywordflow}{goto} fail4;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00109}00109                 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00110}00110                 \textcolor{keywordflow}{if} (2 + nbytes > cursor-\/>length) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00111}00111                         \textcolor{comment}{/* Header length overflows image buffer */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00112}00112                         rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00113}00113                         \textcolor{keywordflow}{goto} fail6;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00114}00114                 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00115}00115                 \textcolor{keywordflow}{if} (nbytes > \textcolor{keyword}{sizeof} (uint32\_t)) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00116}00116                         \textcolor{comment}{/* Length encoding too big */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00117}00117                         rc = E2BIG;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00118}00118                         \textcolor{keywordflow}{goto} fail5;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00119}00119                 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00120}00120                 cursor-\/>hdr\_size = 2 + nbytes;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00121}00121                 cursor-\/>val\_size = 0;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00122}00122                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{sfxge__rx_8c_aadb6d6eb83e646653a1402032e45dcab}{offset}} = 2; \mbox{\hyperlink{sfxge__rx_8c_aadb6d6eb83e646653a1402032e45dcab}{offset}} < cursor-\/>hdr\_size; \mbox{\hyperlink{sfxge__rx_8c_aadb6d6eb83e646653a1402032e45dcab}{offset}}++) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00123}00123                         cursor-\/>val\_size =}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00124}00124                             (cursor-\/>val\_size << 8) | cursor-\/>buffer[\mbox{\hyperlink{sfxge__rx_8c_aadb6d6eb83e646653a1402032e45dcab}{offset}}];}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00125}00125                 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00126}00126         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00128}00128         \textcolor{keywordflow}{if} ((cursor-\/>hdr\_size + cursor-\/>val\_size) > cursor-\/>length) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00129}00129                 \textcolor{comment}{/* Length overflows image buffer */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00130}00130                 rc = E2BIG;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00131}00131                 \textcolor{keywordflow}{goto} fail7;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00132}00132         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00134}00134         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00136}00136 fail7:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00137}00137         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail7);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00138}00138 fail6:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00139}00139         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail6);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00140}00140 fail5:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00141}00141         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail5);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00142}00142 fail4:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00143}00143         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail4);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00144}00144 fail3:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00145}00145         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail3);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00146}00146 fail2:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00147}00147         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail2);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00148}00148 fail1:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00149}00149         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00151}00151         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00152}00152 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00154}00154 \textcolor{comment}{/* Enter nested ASN.1 TLV (contained in value of current TLV) */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00155}00155 \textcolor{keyword}{static}  \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00156}00156 efx\_asn1\_enter\_tag(}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00157}00157         \mbox{\hyperlink{efx__annote_8h_a9a66acb8f87800f41a837406c837cb32}{\_\_inout}}          efx\_asn1\_cursor\_t       *cursor,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00158}00158         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                uint8\_t                 tag)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00159}00159 \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00160}00160         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00162}00162         \textcolor{keywordflow}{if} (cursor == NULL) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00163}00163                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00164}00164                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00165}00165         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00167}00167         \textcolor{keywordflow}{if} (ASN1\_TAG\_IS\_PRIM(tag)) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00168}00168                 \textcolor{comment}{/* Cannot enter a primitive tag */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00169}00169                 rc = ENOTSUP;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00170}00170                 \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00171}00171         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00172}00172         rc = efx\_asn1\_parse\_header\_match\_tag(cursor, tag);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00173}00173         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00174}00174                 \textcolor{comment}{/* Invalid TLV or wrong tag */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00175}00175                 \textcolor{keywordflow}{goto} fail3;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00176}00176         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00178}00178         \textcolor{comment}{/* Limit cursor range to nested TLV */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00179}00179         cursor-\/>buffer += cursor-\/>hdr\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00180}00180         cursor-\/>length = cursor-\/>val\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00182}00182         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00184}00184 fail3:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00185}00185         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail3);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00186}00186 fail2:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00187}00187         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail2);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00188}00188 fail1:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00189}00189         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00191}00191         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00192}00192 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00194}00194 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00195}00195 \textcolor{comment}{ * Check that the current ASN.1 TLV matches the given tag and value.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00196}00196 \textcolor{comment}{ * Advance cursor to next TLV on a successful match.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00197}00197 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00198}00198 \textcolor{keyword}{static}  \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00199}00199 efx\_asn1\_match\_tag\_value(}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00200}00200         \mbox{\hyperlink{efx__annote_8h_a9a66acb8f87800f41a837406c837cb32}{\_\_inout}}          efx\_asn1\_cursor\_t       *cursor,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00201}00201         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                uint8\_t                 tag,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00202}00202         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                \textcolor{keyword}{const} \textcolor{keywordtype}{void}              *valp,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00203}00203         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                uint32\_t                val\_size)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00204}00204 \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00205}00205         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00207}00207         \textcolor{keywordflow}{if} (cursor == NULL) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00208}00208                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00209}00209                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00210}00210         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00211}00211         rc = efx\_asn1\_parse\_header\_match\_tag(cursor, tag);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00212}00212         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00213}00213                 \textcolor{comment}{/* Invalid TLV or wrong tag */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00214}00214                 \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00215}00215         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00216}00216         \textcolor{keywordflow}{if} (cursor-\/>val\_size != val\_size) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00217}00217                 \textcolor{comment}{/* Value size is different */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00218}00218                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00219}00219                 \textcolor{keywordflow}{goto} fail3;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00220}00220         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00221}00221         \textcolor{keywordflow}{if} (memcmp(cursor-\/>buffer + cursor-\/>hdr\_size, valp, val\_size) != 0) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00222}00222                 \textcolor{comment}{/* Value content is different */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00223}00223                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00224}00224                 \textcolor{keywordflow}{goto} fail4;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00225}00225         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00226}00226         cursor-\/>buffer += cursor-\/>hdr\_size + cursor-\/>val\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00227}00227         cursor-\/>length -\/= cursor-\/>hdr\_size + cursor-\/>val\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00229}00229         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00231}00231 fail4:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00232}00232         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail4);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00233}00233 fail3:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00234}00234         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail3);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00235}00235 fail2:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00236}00236         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail2);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00237}00237 fail1:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00238}00238         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00239}00239 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00240}00240         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00241}00241 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00242}00242 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00243}00243 \textcolor{comment}{/* Advance cursor to next TLV */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00244}00244 \textcolor{keyword}{static}  \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00245}00245 efx\_asn1\_skip\_tag(}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00246}00246         \mbox{\hyperlink{efx__annote_8h_a9a66acb8f87800f41a837406c837cb32}{\_\_inout}}          efx\_asn1\_cursor\_t       *cursor,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00247}00247         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                uint8\_t                 tag)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00248}00248 \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00249}00249         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00251}00251         \textcolor{keywordflow}{if} (cursor == NULL) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00252}00252                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00253}00253                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00254}00254         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00256}00256         rc = efx\_asn1\_parse\_header\_match\_tag(cursor, tag);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00257}00257         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00258}00258                 \textcolor{comment}{/* Invalid TLV or wrong tag */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00259}00259                 \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00260}00260         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00261}00261         cursor-\/>buffer += cursor-\/>hdr\_size + cursor-\/>val\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00262}00262         cursor-\/>length -\/= cursor-\/>hdr\_size + cursor-\/>val\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00263}00263 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00264}00264         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00265}00265 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00266}00266 fail2:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00267}00267         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail2);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00268}00268 fail1:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00269}00269         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00270}00270 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00271}00271         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00272}00272 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00273}00273 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00274}00274 \textcolor{comment}{/* Return pointer to value octets and value size from current TLV */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00275}00275 \textcolor{keyword}{static}  \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00276}00276 efx\_asn1\_get\_tag\_value(}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00277}00277         \mbox{\hyperlink{efx__annote_8h_a9a66acb8f87800f41a837406c837cb32}{\_\_inout}}          efx\_asn1\_cursor\_t       *cursor,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00278}00278         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                uint8\_t                 tag,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00279}00279         \mbox{\hyperlink{efx__annote_8h_abb4c3c1135aab6c47cff22e7c16efb74}{\_\_out}}              uint8\_t                 **valp,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00280}00280         \mbox{\hyperlink{efx__annote_8h_abb4c3c1135aab6c47cff22e7c16efb74}{\_\_out}}              uint32\_t                *val\_sizep)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00281}00281 \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00282}00282         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00284}00284         \textcolor{keywordflow}{if} (cursor == NULL || valp == NULL || val\_sizep == NULL) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00285}00285                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00286}00286                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00287}00287         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00288}00288 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00289}00289         rc = efx\_asn1\_parse\_header\_match\_tag(cursor, tag);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00290}00290         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00291}00291                 \textcolor{comment}{/* Invalid TLV or wrong tag */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00292}00292                 \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00293}00293         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00294}00294         *valp = cursor-\/>buffer + cursor-\/>hdr\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00295}00295         *val\_sizep = cursor-\/>val\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00296}00296 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00297}00297         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00298}00298 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00299}00299 fail2:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00300}00300         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail2);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00301}00301 fail1:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00302}00302         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00303}00303 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00304}00304         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00305}00305 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00307}00307 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00308}00308 \textcolor{comment}{ * Utility routines for parsing CMS headers (see RFC2315, PKCS\#7)}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00309}00309 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00310}00310 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00311}00311 \textcolor{comment}{/* OID 1.2.840.113549.1.7.2 */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00312}00312 \textcolor{keyword}{static} \textcolor{keyword}{const} uint8\_t PKCS7\_SignedData[] =}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00313}00313 \{ 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x02 \};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00315}00315 \textcolor{comment}{/* OID 1.2.840.113549.1.7.1 */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00316}00316 \textcolor{keyword}{static} \textcolor{keyword}{const} uint8\_t PKCS7\_Data[] =}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00317}00317 \{ 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01 \};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00318}00318 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00319}00319 \textcolor{comment}{/* SignedData structure version */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00320}00320 \textcolor{keyword}{static} \textcolor{keyword}{const} uint8\_t SignedData\_Version[] =}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00321}00321 \{ 0x03 \};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00323}00323 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00324}00324 \textcolor{comment}{ * Check for a valid image in signed image format. This uses CMS syntax}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00325}00325 \textcolor{comment}{ * (see RFC2315, PKCS\#7) to provide signatures, and certificates required}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00326}00326 \textcolor{comment}{ * to validate the signatures. The encapsulated content is in unsigned image}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00327}00327 \textcolor{comment}{ * format (reflash header, image code, trailer checksum).}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00328}00328 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00329}00329 \textcolor{keyword}{static}  \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00330}00330 efx\_check\_signed\_image\_header(}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00331}00331         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                \textcolor{keywordtype}{void}            *bufferp,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00332}00332         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                uint32\_t        buffer\_size,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00333}00333         \mbox{\hyperlink{efx__annote_8h_abb4c3c1135aab6c47cff22e7c16efb74}{\_\_out}}              uint32\_t        *content\_offsetp,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00334}00334         \mbox{\hyperlink{efx__annote_8h_abb4c3c1135aab6c47cff22e7c16efb74}{\_\_out}}              uint32\_t        *content\_lengthp)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00335}00335 \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00336}00336         efx\_asn1\_cursor\_t cursor;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00337}00337         uint8\_t *valp;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00338}00338         uint32\_t val\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00339}00339         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00340}00340 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00341}00341         \textcolor{keywordflow}{if} (content\_offsetp == NULL || content\_lengthp == NULL) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00342}00342                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00343}00343                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00344}00344         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00345}00345         cursor.buffer = (uint8\_t *)bufferp;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00346}00346         cursor.length = buffer\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00347}00347 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00348}00348         \textcolor{comment}{/* ContextInfo */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00349}00349         rc = efx\_asn1\_enter\_tag(\&cursor, ASN1\_TAG\_SEQUENCE);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00350}00350         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00351}00351                 \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00353}00353         \textcolor{comment}{/* ContextInfo.contentType */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00354}00354         rc = efx\_asn1\_match\_tag\_value(\&cursor, ASN1\_TAG\_OBJ\_ID,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00355}00355             PKCS7\_SignedData, \textcolor{keyword}{sizeof} (PKCS7\_SignedData));}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00356}00356         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00357}00357                 \textcolor{keywordflow}{goto} fail3;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00358}00358 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00359}00359         \textcolor{comment}{/* ContextInfo.content */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00360}00360         rc = efx\_asn1\_enter\_tag(\&cursor, ASN1\_TAG\_CONS\_CONTEXT(0));}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00361}00361         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00362}00362                 \textcolor{keywordflow}{goto} fail4;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00363}00363 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00364}00364         \textcolor{comment}{/* SignedData */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00365}00365         rc = efx\_asn1\_enter\_tag(\&cursor, ASN1\_TAG\_SEQUENCE);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00366}00366         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00367}00367                 \textcolor{keywordflow}{goto} fail5;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00369}00369         \textcolor{comment}{/* SignedData.version */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00370}00370         rc = efx\_asn1\_match\_tag\_value(\&cursor, ASN1\_TAG\_INTEGER,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00371}00371             SignedData\_Version, \textcolor{keyword}{sizeof} (SignedData\_Version));}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00372}00372         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00373}00373                 \textcolor{keywordflow}{goto} fail6;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00374}00374 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00375}00375         \textcolor{comment}{/* SignedData.digestAlgorithms */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00376}00376         rc = efx\_asn1\_skip\_tag(\&cursor, ASN1\_TAG\_SET);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00377}00377         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00378}00378                 \textcolor{keywordflow}{goto} fail7;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00380}00380         \textcolor{comment}{/* SignedData.encapContentInfo */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00381}00381         rc = efx\_asn1\_enter\_tag(\&cursor, ASN1\_TAG\_SEQUENCE);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00382}00382         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00383}00383                 \textcolor{keywordflow}{goto} fail8;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00384}00384 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00385}00385         \textcolor{comment}{/* SignedData.encapContentInfo.econtentType */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00386}00386         rc = efx\_asn1\_match\_tag\_value(\&cursor, ASN1\_TAG\_OBJ\_ID,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00387}00387             PKCS7\_Data, \textcolor{keyword}{sizeof} (PKCS7\_Data));}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00388}00388         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00389}00389                 \textcolor{keywordflow}{goto} fail9;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00390}00390 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00391}00391         \textcolor{comment}{/* SignedData.encapContentInfo.econtent */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00392}00392         rc = efx\_asn1\_enter\_tag(\&cursor, ASN1\_TAG\_CONS\_CONTEXT(0));}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00393}00393         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00394}00394                 \textcolor{keywordflow}{goto} fail10;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00395}00395 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00396}00396         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00397}00397 \textcolor{comment}{         * The octet string contains the image header, image code bytes and}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00398}00398 \textcolor{comment}{         * image trailer CRC (same as unsigned image layout).}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00399}00399 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00400}00400         valp = NULL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00401}00401         val\_size = 0;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00402}00402         rc = efx\_asn1\_get\_tag\_value(\&cursor, ASN1\_TAG\_OCTET\_STRING,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00403}00403             \&valp, \&val\_size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00404}00404         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00405}00405                 \textcolor{keywordflow}{goto} fail11;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00406}00406 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00407}00407         \textcolor{keywordflow}{if} ((valp == NULL) || (val\_size == 0)) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00408}00408                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00409}00409                 \textcolor{keywordflow}{goto} fail12;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00410}00410         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00411}00411         \textcolor{keywordflow}{if} (valp < (uint8\_t *)bufferp) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00412}00412                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00413}00413                 \textcolor{keywordflow}{goto} fail13;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00414}00414         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00415}00415         \textcolor{keywordflow}{if} ((valp + val\_size) > ((uint8\_t *)bufferp + buffer\_size)) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00416}00416                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00417}00417                 \textcolor{keywordflow}{goto} fail14;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00418}00418         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00420}00420         *content\_offsetp = (uint32\_t)(valp -\/ (uint8\_t *)bufferp);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00421}00421         *content\_lengthp = val\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00422}00422 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00423}00423         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00424}00424 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00425}00425 fail14:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00426}00426         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail14);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00427}00427 fail13:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00428}00428         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail13);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00429}00429 fail12:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00430}00430         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail12);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00431}00431 fail11:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00432}00432         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail11);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00433}00433 fail10:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00434}00434         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail10);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00435}00435 fail9:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00436}00436         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail9);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00437}00437 fail8:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00438}00438         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail8);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00439}00439 fail7:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00440}00440         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail7);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00441}00441 fail6:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00442}00442         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail6);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00443}00443 fail5:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00444}00444         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail5);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00445}00445 fail4:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00446}00446         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail4);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00447}00447 fail3:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00448}00448         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail3);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00449}00449 fail2:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00450}00450         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail2);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00451}00451 fail1:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00452}00452         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00453}00453 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00454}00454         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00455}00455 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00456}00456 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00457}00457 \textcolor{keyword}{static}  \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00458}00458 efx\_check\_unsigned\_image(}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00459}00459         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                \textcolor{keywordtype}{void}            *bufferp,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00460}00460         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                uint32\_t        buffer\_size)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00461}00461 \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00462}00462         efx\_image\_header\_t *header;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00463}00463         efx\_image\_trailer\_t *trailer;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00464}00464         uint32\_t crc;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00465}00465         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00466}00466 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00467}00467         \mbox{\hyperlink{efx_8h_a9b48a380217f137d36b7187c271e4121}{EFX\_STATIC\_ASSERT}}(\textcolor{keyword}{sizeof} (*header) == EFX\_IMAGE\_HEADER\_SIZE);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00468}00468         \mbox{\hyperlink{efx_8h_a9b48a380217f137d36b7187c271e4121}{EFX\_STATIC\_ASSERT}}(\textcolor{keyword}{sizeof} (*trailer) == EFX\_IMAGE\_TRAILER\_SIZE);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00470}00470         \textcolor{comment}{/* Must have at least enough space for required image header fields */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00471}00471         \textcolor{keywordflow}{if} (buffer\_size < (\mbox{\hyperlink{efx_8h_afa2160fb577faef23bedda72e69a52db}{EFX\_FIELD\_OFFSET}}(efx\_image\_header\_t, eih\_size) +}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00472}00472                 \textcolor{keyword}{sizeof} (header-\/>eih\_size))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00473}00473                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00474}00474                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00475}00475         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00476}00476         header = (efx\_image\_header\_t *)bufferp;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00477}00477 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00478}00478         \textcolor{keywordflow}{if} (header-\/>eih\_magic != EFX\_IMAGE\_HEADER\_MAGIC) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00479}00479                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00480}00480                 \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00481}00481         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00482}00482 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00483}00483         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00484}00484 \textcolor{comment}{         * Check image header version is same or higher than lowest required}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00485}00485 \textcolor{comment}{         * version.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00486}00486 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00487}00487         \textcolor{keywordflow}{if} (header-\/>eih\_version < EFX\_IMAGE\_HEADER\_VERSION) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00488}00488                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00489}00489                 \textcolor{keywordflow}{goto} fail3;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00490}00490         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00491}00491 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00492}00492         \textcolor{comment}{/* Buffer must have space for image header, code and image trailer. */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00493}00493         \textcolor{keywordflow}{if} (buffer\_size < (header-\/>eih\_size + header-\/>eih\_code\_size +}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00494}00494                 EFX\_IMAGE\_TRAILER\_SIZE)) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00495}00495                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00496}00496                 \textcolor{keywordflow}{goto} fail4;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00497}00497         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00498}00498 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00499}00499         \textcolor{comment}{/* Check CRC from image buffer matches computed CRC. */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00500}00500         trailer = (efx\_image\_trailer\_t *)((uint8\_t *)header +}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00501}00501             header-\/>eih\_size + header-\/>eih\_code\_size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00502}00502 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00503}00503         crc = \mbox{\hyperlink{efx_8h_a5e282a65665e53ee65c8ecbe76509242}{efx\_crc32\_calculate}}(0, (uint8\_t *)header,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00504}00504             (header-\/>eih\_size + header-\/>eih\_code\_size));}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00505}00505 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00506}00506         \textcolor{keywordflow}{if} (trailer-\/>eit\_crc != crc) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00507}00507                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00508}00508                 \textcolor{keywordflow}{goto} fail5;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00509}00509         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00510}00510 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00511}00511         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00512}00512 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00513}00513 fail5:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00514}00514         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail5);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00515}00515 fail4:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00516}00516         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail4);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00517}00517 fail3:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00518}00518         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail3);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00519}00519 fail2:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00520}00520         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail2);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00521}00521 fail1:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00522}00522         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00523}00523 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00524}00524         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00525}00525 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00526}00526 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00527}00527         \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00528}00528 efx\_check\_reflash\_image(}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00529}00529         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                \textcolor{keywordtype}{void}                    *bufferp,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00530}00530         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                uint32\_t                buffer\_size,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00531}00531         \mbox{\hyperlink{efx__annote_8h_abb4c3c1135aab6c47cff22e7c16efb74}{\_\_out}}              efx\_image\_info\_t        *infop)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00532}00532 \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00533}00533         efx\_image\_format\_t format = EFX\_IMAGE\_FORMAT\_NO\_IMAGE;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00534}00534         uint32\_t image\_offset;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00535}00535         uint32\_t image\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00536}00536         \textcolor{keywordtype}{void} *imagep;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00537}00537         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00538}00538 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00539}00539         \mbox{\hyperlink{efsys_8h_ac29b6d01c2cee5333e4feb4da0441b14}{EFSYS\_ASSERT}}(infop != NULL);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00540}00540         \textcolor{keywordflow}{if} (infop == NULL) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00541}00541                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00542}00542                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00543}00543         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00544}00544         memset(infop, 0, \textcolor{keyword}{sizeof} (*infop));}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00545}00545 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00546}00546         \textcolor{keywordflow}{if} (bufferp == NULL || buffer\_size == 0) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00547}00547                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00548}00548                 \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00549}00549         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00550}00550 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00551}00551         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00552}00552 \textcolor{comment}{         * Check if the buffer contains an image in signed format, and if so,}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00553}00553 \textcolor{comment}{         * locate the image header.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00554}00554 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00555}00555         rc = efx\_check\_signed\_image\_header(bufferp, buffer\_size,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00556}00556             \&image\_offset, \&image\_size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00557}00557         \textcolor{keywordflow}{if} (rc == 0) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00558}00558                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00559}00559 \textcolor{comment}{                 * Buffer holds signed image format. Check that the encapsulated}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00560}00560 \textcolor{comment}{                 * content is in unsigned image format.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00561}00561 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00562}00562                 format = EFX\_IMAGE\_FORMAT\_SIGNED;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00563}00563         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00564}00564                 \textcolor{comment}{/* Check if the buffer holds image in unsigned image format */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00565}00565                 format = EFX\_IMAGE\_FORMAT\_UNSIGNED;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00566}00566                 image\_offset = 0;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00567}00567                 image\_size = buffer\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00568}00568         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00569}00569         \textcolor{keywordflow}{if} (image\_offset + image\_size > buffer\_size) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00570}00570                 rc = E2BIG;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00571}00571                 \textcolor{keywordflow}{goto} fail3;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00572}00572         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00573}00573         imagep = (uint8\_t *)bufferp + image\_offset;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00574}00574 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00575}00575         \textcolor{comment}{/* Check unsigned image layout (image header, code, image trailer) */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00576}00576         rc = efx\_check\_unsigned\_image(imagep, image\_size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00577}00577         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00578}00578                 \textcolor{keywordflow}{goto} fail4;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00579}00579 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00580}00580         \textcolor{comment}{/* Return image details */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00581}00581         infop-\/>eii\_format = format;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00582}00582         infop-\/>eii\_imagep = bufferp;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00583}00583         infop-\/>eii\_image\_size = buffer\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00584}00584         infop-\/>eii\_headerp = (efx\_image\_header\_t *)imagep;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00585}00585 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00586}00586         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00588}00588 fail4:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00589}00589         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail4);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00590}00590 fail3:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00591}00591         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail3);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00592}00592 fail2:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00593}00593         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail2);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00594}00594         infop-\/>eii\_format = EFX\_IMAGE\_FORMAT\_INVALID;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00595}00595         infop-\/>eii\_imagep = NULL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00596}00596         infop-\/>eii\_image\_size = 0;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00597}00597 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00598}00598 fail1:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00599}00599         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00600}00600 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00601}00601         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00602}00602 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00603}00603 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00604}00604         \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00605}00605 efx\_build\_signed\_image\_write\_buffer(}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00606}00606         \mbox{\hyperlink{efx__annote_8h_a55ab3cd39125dea7e22296eea4e15808}{\_\_out\_bcount}}(buffer\_size)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00607}00607                         uint8\_t                 *bufferp,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00608}00608         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                uint32\_t                buffer\_size,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00609}00609         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                efx\_image\_info\_t        *infop,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00610}00610         \mbox{\hyperlink{efx__annote_8h_abb4c3c1135aab6c47cff22e7c16efb74}{\_\_out}}              efx\_image\_header\_t      **headerpp)}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00611}00611 \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00612}00612         \mbox{\hyperlink{structsigned__image__chunk__hdr__e}{signed\_image\_chunk\_hdr\_t}} chunk\_hdr;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00613}00613         uint32\_t hdr\_offset;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00614}00614         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00615}00615                 uint32\_t \mbox{\hyperlink{sfxge__rx_8c_aadb6d6eb83e646653a1402032e45dcab}{offset}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00616}00616                 uint32\_t size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00617}00617         \} cms\_header, image\_header, code, image\_trailer, signature;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00618}00618         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00619}00619 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00620}00620         \mbox{\hyperlink{efsys_8h_ac29b6d01c2cee5333e4feb4da0441b14}{EFSYS\_ASSERT}}((infop != NULL) \&\& (headerpp != NULL));}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00621}00621 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00622}00622         \textcolor{keywordflow}{if} ((bufferp == NULL) || (buffer\_size == 0) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00623}00623             (infop == NULL) || (headerpp == NULL)) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00624}00624                 \textcolor{comment}{/* Invalid arguments */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00625}00625                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00626}00626                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00627}00627         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00628}00628         \textcolor{keywordflow}{if} ((infop-\/>eii\_format != EFX\_IMAGE\_FORMAT\_SIGNED) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00629}00629             (infop-\/>eii\_imagep == NULL) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00630}00630             (infop-\/>eii\_headerp == NULL) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00631}00631             ((uint8\_t *)infop-\/>eii\_headerp < (uint8\_t *)infop-\/>eii\_imagep) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00632}00632             (infop-\/>eii\_image\_size < EFX\_IMAGE\_HEADER\_SIZE) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00633}00633             ((\textcolor{keywordtype}{size\_t})((uint8\_t *)infop-\/>eii\_headerp -\/ infop-\/>eii\_imagep) >}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00634}00634             (infop-\/>eii\_image\_size -\/ EFX\_IMAGE\_HEADER\_SIZE))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00635}00635                 \textcolor{comment}{/* Invalid image info */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00636}00636                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00637}00637                 \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00638}00638         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00639}00639 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00640}00640         \textcolor{comment}{/* Locate image chunks in original signed image */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00641}00641         cms\_header.offset = 0;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00642}00642         cms\_header.size =}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00643}00643             (uint32\_t)((uint8\_t *)infop-\/>eii\_headerp -\/ infop-\/>eii\_imagep);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00644}00644         \textcolor{keywordflow}{if} ((cms\_header.size > buffer\_size) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00645}00645             (cms\_header.offset > (buffer\_size -\/ cms\_header.size))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00646}00646                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00647}00647                 \textcolor{keywordflow}{goto} fail3;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00648}00648         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00650}00650         image\_header.offset = cms\_header.offset + cms\_header.size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00651}00651         image\_header.size = infop-\/>eii\_headerp-\/>eih\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00652}00652         \textcolor{keywordflow}{if} ((image\_header.size > buffer\_size) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00653}00653             (image\_header.offset > (buffer\_size -\/ image\_header.size))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00654}00654                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00655}00655                 \textcolor{keywordflow}{goto} fail4;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00656}00656         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00657}00657 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00658}00658         code.offset = image\_header.offset + image\_header.size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00659}00659         code.size = infop-\/>eii\_headerp-\/>eih\_code\_size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00660}00660         \textcolor{keywordflow}{if} ((code.size > buffer\_size) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00661}00661             (code.offset > (buffer\_size -\/ code.size))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00662}00662                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00663}00663                 \textcolor{keywordflow}{goto} fail5;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00664}00664         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00665}00665 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00666}00666         image\_trailer.offset = code.offset + code.size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00667}00667         image\_trailer.size = EFX\_IMAGE\_TRAILER\_SIZE;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00668}00668         \textcolor{keywordflow}{if} ((image\_trailer.size > buffer\_size) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00669}00669             (image\_trailer.offset > (buffer\_size -\/ image\_trailer.size))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00670}00670                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00671}00671                 \textcolor{keywordflow}{goto} fail6;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00672}00672         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00673}00673 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00674}00674         signature.offset = image\_trailer.offset + image\_trailer.size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00675}00675         signature.size = (uint32\_t)(infop-\/>eii\_image\_size -\/ signature.offset);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00676}00676         \textcolor{keywordflow}{if} ((signature.size > buffer\_size) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00677}00677             (signature.offset > (buffer\_size -\/ signature.size))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00678}00678                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00679}00679                 \textcolor{keywordflow}{goto} fail7;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00680}00680         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00681}00681 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00682}00682         \mbox{\hyperlink{efsys_8h_aeaff23ca745974626dbd91943931a6bf}{EFSYS\_ASSERT3U}}(infop-\/>eii\_image\_size, ==, cms\_header.size +}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00683}00683             image\_header.size + code.size + image\_trailer.size +}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00684}00684             signature.size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00685}00685 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00686}00686         \textcolor{comment}{/* BEGIN CSTYLED */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00687}00687         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00688}00688 \textcolor{comment}{         * Build signed image partition, inserting chunk headers.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00689}00689 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00690}00690 \textcolor{comment}{         *  Signed Image:                  Image in NVRAM partition:}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00691}00691 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00692}00692 \textcolor{comment}{         *  +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+            +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00693}00693 \textcolor{comment}{         *  | CMS header      |            |  mcfw.update    |<-\/-\/-\/-\/+}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00694}00694 \textcolor{comment}{         *  +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+            |                 |     |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00695}00695 \textcolor{comment}{         *  | reflash header  |            +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+     |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00696}00696 \textcolor{comment}{         *  +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+            | chunk header:   |-\/-\/>-\/-\/|-\/+}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00697}00697 \textcolor{comment}{         *  | mcfw.update     |            | REFLASH\_TRAILER |     | |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00698}00698 \textcolor{comment}{         *  |                 |            +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+     | |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00699}00699 \textcolor{comment}{         *  +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+        +-\/-\/>| CMS header      |     | |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00700}00700 \textcolor{comment}{         *  | reflash trailer |        |   +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+     | |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00701}00701 \textcolor{comment}{         *  +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+        |   | chunk header:   |-\/>-\/+ | |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00702}00702 \textcolor{comment}{         *  | signature       |        |   | REFLASH\_HEADER  |   | | |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00703}00703 \textcolor{comment}{         *  +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+        |   +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+   | | |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00704}00704 \textcolor{comment}{         *                             |   | reflash header  |<-\/-\/+ | |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00705}00705 \textcolor{comment}{         *                             |   +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+     | |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00706}00706 \textcolor{comment}{         *                             |   | chunk header:   |-\/-\/>-\/-\/+ |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00707}00707 \textcolor{comment}{         *                             |   | IMAGE           |       |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00708}00708 \textcolor{comment}{         *                             |   +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+       |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00709}00709 \textcolor{comment}{         *                             |   | reflash trailer |<-\/-\/-\/-\/-\/-\/+}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00710}00710 \textcolor{comment}{         *                             |   +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00711}00711 \textcolor{comment}{         *                             |   | chunk header:   |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00712}00712 \textcolor{comment}{         *                             |   | SIGNATURE       |-\/>-\/+}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00713}00713 \textcolor{comment}{         *                             |   +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+   |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00714}00714 \textcolor{comment}{         *                             |   | signature       |<-\/-\/+}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00715}00715 \textcolor{comment}{         *                             |   +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00716}00716 \textcolor{comment}{         *                             |   | ...unused...    |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00717}00717 \textcolor{comment}{         *                             |   +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00718}00718 \textcolor{comment}{         *                             +-\/<-\/| chunk header:   |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00719}00719 \textcolor{comment}{         *                             >-\/-\/>| CMS\_HEADER      |}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00720}00720 \textcolor{comment}{         *                                 +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00721}00721 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00722}00722 \textcolor{comment}{         * Each chunk header gives the partition offset and length of the image}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00723}00723 \textcolor{comment}{         * chunk's data. The image chunk data is immediately followed by the}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00724}00724 \textcolor{comment}{         * chunk header for the next chunk.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00725}00725 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00726}00726 \textcolor{comment}{         * The data chunk for the firmware code must be at the start of the}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00727}00727 \textcolor{comment}{         * partition (needed for the bootloader). The first chunk header in the}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00728}00728 \textcolor{comment}{         * chain (for the CMS header) is stored at the end of the partition. The}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00729}00729 \textcolor{comment}{         * chain of chunk headers maintains the same logical order of image}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00730}00730 \textcolor{comment}{         * chunks as the original signed image file. This set of constraints}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00731}00731 \textcolor{comment}{         * results in the layout used for the data chunks and chunk headers.}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00732}00732 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00733}00733         \textcolor{comment}{/* END CSTYLED */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00734}00734         memset(bufferp, 0xFF, buffer\_size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00735}00735 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00736}00736         \mbox{\hyperlink{efx_8h_a9b48a380217f137d36b7187c271e4121}{EFX\_STATIC\_ASSERT}}(\textcolor{keyword}{sizeof} (chunk\_hdr) == \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00737}00737         memset(\&chunk\_hdr, 0, \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00738}00738 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00739}00739         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00740}00740 \textcolor{comment}{         * CMS header}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00741}00741 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00742}00742         \textcolor{keywordflow}{if} (buffer\_size < \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}}) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00743}00743                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00744}00744                 \textcolor{keywordflow}{goto} fail8;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00745}00745         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00746}00746         hdr\_offset = buffer\_size -\/ \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00747}00747 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00748}00748         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_aab544295bc257d139f5d1bcf644f37d3}{magic}}            = \mbox{\hyperlink{ef10__signed__image__layout_8h_a5a4f785a2b92b1e25ae67bd4fab79ee3}{SIGNED\_IMAGE\_CHUNK\_HDR\_MAGIC}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00749}00749         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_af3622a91323ee7259bac0d412d8cc734}{version}}        = \mbox{\hyperlink{ef10__signed__image__layout_8h_afd0d57ede6ad0b3b0bbf1f112f87eb4d}{SIGNED\_IMAGE\_CHUNK\_HDR\_VERSION}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00750}00750         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a1c8378704ec40a55cb59d66d588ee801}{id}}          = \mbox{\hyperlink{ef10__signed__image__layout_8h_a06fc87d81c62e9abb8790b6e5713c55ba68dbbc5fde3057733a270565bca292b8}{SIGNED\_IMAGE\_CHUNK\_CMS\_HEADER}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00751}00751         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}}  = code.size + \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00752}00752         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}}                = cms\_header.size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00753}00753 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00754}00754         memcpy(bufferp + hdr\_offset, \&chunk\_hdr, \textcolor{keyword}{sizeof} (chunk\_hdr));}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00755}00755 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00756}00756         \textcolor{keywordflow}{if} ((chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}} > buffer\_size) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00757}00757             (chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}} > (buffer\_size -\/ chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}}))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00758}00758                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00759}00759                 \textcolor{keywordflow}{goto} fail9;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00760}00760         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00761}00761         memcpy(bufferp + chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}},}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00762}00762             infop-\/>eii\_imagep + cms\_header.offset,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00763}00763             cms\_header.size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00764}00764 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00765}00765         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00766}00766 \textcolor{comment}{         * Image header}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00767}00767 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00768}00768         hdr\_offset = chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}} + chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00769}00769         \textcolor{keywordflow}{if} (hdr\_offset > (buffer\_size -\/ \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}})) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00770}00770                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00771}00771                 \textcolor{keywordflow}{goto} fail10;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00772}00772         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00773}00773         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_aab544295bc257d139f5d1bcf644f37d3}{magic}}            = \mbox{\hyperlink{ef10__signed__image__layout_8h_a5a4f785a2b92b1e25ae67bd4fab79ee3}{SIGNED\_IMAGE\_CHUNK\_HDR\_MAGIC}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00774}00774         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_af3622a91323ee7259bac0d412d8cc734}{version}}        = \mbox{\hyperlink{ef10__signed__image__layout_8h_afd0d57ede6ad0b3b0bbf1f112f87eb4d}{SIGNED\_IMAGE\_CHUNK\_HDR\_VERSION}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00775}00775         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a1c8378704ec40a55cb59d66d588ee801}{id}}          = \mbox{\hyperlink{ef10__signed__image__layout_8h_a06fc87d81c62e9abb8790b6e5713c55ba5245bba3fdce54990290729e0bb36b21}{SIGNED\_IMAGE\_CHUNK\_REFLASH\_HEADER}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00776}00776         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}}  = hdr\_offset + \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00777}00777         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}}                = image\_header.size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00778}00778 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00779}00779         memcpy(bufferp + hdr\_offset, \&chunk\_hdr, \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00780}00780 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00781}00781         \textcolor{keywordflow}{if} ((chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}} > buffer\_size) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00782}00782             (chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}} > (buffer\_size -\/ chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}}))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00783}00783                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00784}00784                 \textcolor{keywordflow}{goto} fail11;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00785}00785         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00786}00786         memcpy(bufferp + chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}},}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00787}00787             infop-\/>eii\_imagep + image\_header.offset,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00788}00788             image\_header.size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00789}00789 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00790}00790         *headerpp = (efx\_image\_header\_t *)(bufferp + chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}});}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00791}00791 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00792}00792         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00793}00793 \textcolor{comment}{         * Firmware code}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00794}00794 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00795}00795         hdr\_offset = chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}} + chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00796}00796         \textcolor{keywordflow}{if} (hdr\_offset > (buffer\_size -\/ \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}})) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00797}00797                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00798}00798                 \textcolor{keywordflow}{goto} fail12;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00799}00799         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00800}00800         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_aab544295bc257d139f5d1bcf644f37d3}{magic}}            = \mbox{\hyperlink{ef10__signed__image__layout_8h_a5a4f785a2b92b1e25ae67bd4fab79ee3}{SIGNED\_IMAGE\_CHUNK\_HDR\_MAGIC}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00801}00801         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_af3622a91323ee7259bac0d412d8cc734}{version}}        = \mbox{\hyperlink{ef10__signed__image__layout_8h_afd0d57ede6ad0b3b0bbf1f112f87eb4d}{SIGNED\_IMAGE\_CHUNK\_HDR\_VERSION}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00802}00802         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a1c8378704ec40a55cb59d66d588ee801}{id}}          = \mbox{\hyperlink{ef10__signed__image__layout_8h_a06fc87d81c62e9abb8790b6e5713c55ba24312a1826a830d8032c7bd65fe51267}{SIGNED\_IMAGE\_CHUNK\_IMAGE}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00803}00803         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}}  = 0;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00804}00804         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}}                = code.size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00805}00805 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00806}00806         memcpy(bufferp + hdr\_offset, \&chunk\_hdr, \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00807}00807 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00808}00808         \textcolor{keywordflow}{if} ((chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}} > buffer\_size) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00809}00809             (chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}} > (buffer\_size -\/ chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}}))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00810}00810                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00811}00811                 \textcolor{keywordflow}{goto} fail13;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00812}00812         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00813}00813         memcpy(bufferp + chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}},}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00814}00814             infop-\/>eii\_imagep + code.offset,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00815}00815             code.size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00816}00816 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00817}00817         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00818}00818 \textcolor{comment}{         * Image trailer (CRC)}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00819}00819 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00820}00820         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_aab544295bc257d139f5d1bcf644f37d3}{magic}}            = \mbox{\hyperlink{ef10__signed__image__layout_8h_a5a4f785a2b92b1e25ae67bd4fab79ee3}{SIGNED\_IMAGE\_CHUNK\_HDR\_MAGIC}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00821}00821         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_af3622a91323ee7259bac0d412d8cc734}{version}}        = \mbox{\hyperlink{ef10__signed__image__layout_8h_afd0d57ede6ad0b3b0bbf1f112f87eb4d}{SIGNED\_IMAGE\_CHUNK\_HDR\_VERSION}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00822}00822         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a1c8378704ec40a55cb59d66d588ee801}{id}}          = \mbox{\hyperlink{ef10__signed__image__layout_8h_a06fc87d81c62e9abb8790b6e5713c55bae5ca42724ea71fd33122d6d81fb6f2fd}{SIGNED\_IMAGE\_CHUNK\_REFLASH\_TRAILER}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00823}00823         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}}  = hdr\_offset + \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00824}00824         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}}                = image\_trailer.size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00825}00825 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00826}00826         hdr\_offset = code.size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00827}00827         \textcolor{keywordflow}{if} (hdr\_offset > (buffer\_size -\/ \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}})) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00828}00828                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00829}00829                 \textcolor{keywordflow}{goto} fail14;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00830}00830         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00831}00831 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00832}00832         memcpy(bufferp + hdr\_offset, \&chunk\_hdr, \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00833}00833 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00834}00834         \textcolor{keywordflow}{if} ((chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}} > buffer\_size) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00835}00835             (chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}} > (buffer\_size -\/ chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}}))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00836}00836                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00837}00837                 \textcolor{keywordflow}{goto} fail15;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00838}00838         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00839}00839         memcpy((uint8\_t *)bufferp + chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}},}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00840}00840             infop-\/>eii\_imagep + image\_trailer.offset,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00841}00841             image\_trailer.size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00842}00842 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00843}00843         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00844}00844 \textcolor{comment}{         * Signature}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00845}00845 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00846}00846         hdr\_offset = chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}} + chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00847}00847         \textcolor{keywordflow}{if} (hdr\_offset > (buffer\_size -\/ \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}})) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00848}00848                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00849}00849                 \textcolor{keywordflow}{goto} fail16;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00850}00850         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00851}00851         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_aab544295bc257d139f5d1bcf644f37d3}{magic}}            = \mbox{\hyperlink{ef10__signed__image__layout_8h_a5a4f785a2b92b1e25ae67bd4fab79ee3}{SIGNED\_IMAGE\_CHUNK\_HDR\_MAGIC}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00852}00852         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_af3622a91323ee7259bac0d412d8cc734}{version}}        = \mbox{\hyperlink{ef10__signed__image__layout_8h_afd0d57ede6ad0b3b0bbf1f112f87eb4d}{SIGNED\_IMAGE\_CHUNK\_HDR\_VERSION}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00853}00853         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a1c8378704ec40a55cb59d66d588ee801}{id}}          = \mbox{\hyperlink{ef10__signed__image__layout_8h_a06fc87d81c62e9abb8790b6e5713c55badc6c0251bff8835fb1828ac0b7603b3f}{SIGNED\_IMAGE\_CHUNK\_SIGNATURE}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00854}00854         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}}  = chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}} + \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}};}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00855}00855         chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}}                = signature.size;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00856}00856 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00857}00857         memcpy(bufferp + hdr\_offset, \&chunk\_hdr, \mbox{\hyperlink{ef10__signed__image__layout_8h_a0a7b618fc8a4f0829d53f32611659721}{SIGNED\_IMAGE\_CHUNK\_HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00858}00858 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00859}00859         \textcolor{keywordflow}{if} ((chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}} > buffer\_size) ||}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00860}00860             (chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}} > (buffer\_size -\/ chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_a08dd390644c726f85724a379779ed33c}{len}}))) \{}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00861}00861                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00862}00862                 \textcolor{keywordflow}{goto} fail17;}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00863}00863         \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00864}00864         memcpy(bufferp + chunk\_hdr.\mbox{\hyperlink{structsigned__image__chunk__hdr__e_ab7268d5aaa9b9a23d98b6de76d1ecf23}{offset}},}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00865}00865             infop-\/>eii\_imagep + signature.offset,}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00866}00866             signature.size);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00867}00867 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00868}00868         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00869}00869 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00870}00870 fail17:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00871}00871         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail17);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00872}00872 fail16:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00873}00873         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail16);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00874}00874 fail15:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00875}00875         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail15);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00876}00876 fail14:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00877}00877         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail14);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00878}00878 fail13:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00879}00879         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail13);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00880}00880 fail12:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00881}00881         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail12);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00882}00882 fail11:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00883}00883         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail11);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00884}00884 fail10:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00885}00885         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail10);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00886}00886 fail9:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00887}00887         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail9);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00888}00888 fail8:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00889}00889         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail8);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00890}00890 fail7:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00891}00891         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail7);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00892}00892 fail6:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00893}00893         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail6);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00894}00894 fail5:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00895}00895         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail5);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00896}00896 fail4:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00897}00897         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail4);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00898}00898 fail3:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00899}00899         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail3);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00900}00900 fail2:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00901}00901         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail2);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00902}00902 fail1:}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00903}00903         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00904}00904 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00905}00905         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00906}00906 \}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00907}00907 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00908}00908 \textcolor{preprocessor}{\#endif  }\textcolor{comment}{/* EFSYS\_OPT\_IMAGE\_LAYOUT */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00909}00909 }
\DoxyCodeLine{\Hypertarget{ef10__image_8c_source_l00910}00910 \textcolor{preprocessor}{\#endif  }\textcolor{comment}{/* EFSYS\_OPT\_MEDFORD || EFSYS\_OPT\_MEDFORD2 */}\textcolor{preprocessor}{}}

\end{DoxyCode}
