\chapter{Eet data cipher/decipher example}
\hypertarget{Example_Eet_Data_Cipher_Decipher}{}\label{Example_Eet_Data_Cipher_Decipher}\index{Eet data cipher/decipher example@{Eet data cipher/decipher example}}
In this example, we exemplify the usage of \doxylink{group__Eet__File__Cipher__Group_ga0c08a5881d6fd3474a8cbe03a445aff3}{eet\+\_\+write\+\_\+cipher()} and \doxylink{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}{eet\+\_\+read\+\_\+cipher()}.

For it to work, {\bfseries{make sure}} to have your Eet installation with a ciphering backend enabled.

We start by defining the information to record in an Eet file ({\ttfamily buffer}), the key to cipher that ({\ttfamily key}) and a dummy wrong key to try to access that information, later ({\ttfamily key\+\_\+bad}).  
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *buffer\ =\ \textcolor{stringliteral}{"{}Here\ is\ a\ string\ of\ data\ to\ save\ !"{}};}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *key\ =\ \textcolor{stringliteral}{"{}This\ is\ a\ crypto\ key"{}};}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *key\_bad\ =\ \textcolor{stringliteral}{"{}This\ is\ another\ crypto\ key"{}};}

\end{DoxyCodeInclude}
 After opening our file, we simply use the first cited function to write our string ciphered\+:  
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\ \ \ ef\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\_open}}(tmpf,\ \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}{EET\_FILE\_MODE\_WRITE}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!ef)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ not\ access\ file\ (\%s).\(\backslash\)n"{}},\ tmpf);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{group__Eet__File__Cipher__Group_ga0c08a5881d6fd3474a8cbe03a445aff3}{eet\_write\_cipher}}(ef,\ \textcolor{stringliteral}{"{}keys/tests"{}},\ buffer,\ strlen(buffer)\ +\ 1,\ 0,\ key))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ not\ access\ file\ (\%s).\(\backslash\)n"{}},\ tmpf);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef);}

\end{DoxyCodeInclude}
 Then, after closing it on purpose, we open it again, to retrieve the encrypted information back, in a readable format\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\ \ \ ef\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\_open}}(tmpf,\ \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\_FILE\_MODE\_READ}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!ef)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ not\ access\ file\ (\%s).\(\backslash\)n"{}},\ tmpf);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ test\ =\ \mbox{\hyperlink{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}{eet\_read\_cipher}}(ef,\ \textcolor{stringliteral}{"{}keys/tests"{}},\ \&size,\ key);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!test)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ decript\ contents\ on\ file\ \%s,\ with\ key\ \%s.\(\backslash\)n"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ tmpf,\ key);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (size\ !=\ (\textcolor{keywordtype}{int})strlen(buffer)\ +\ 1)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ something\ is\ wrong\ with\ the\ decripted\ data\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (memcmp(test,\ buffer,\ strlen(buffer)\ +\ 1)\ !=\ 0)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ something\ is\ wrong\ with\ the\ decripted\ data\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{/*\ Decrypt\ an\ eet\ file,\ now\ using\ our\ BAD\ key!!\ */}}
\DoxyCodeLine{\ \ \ ef\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\_open}}(tmpf,\ \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\_FILE\_MODE\_READ}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!ef)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ not\ access\ file\ (\%s).\(\backslash\)n"{}},\ tmpf);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ test\ =\ \mbox{\hyperlink{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}{eet\_read\_cipher}}(ef,\ \textcolor{stringliteral}{"{}keys/tests"{}},\ \&size,\ key\_bad);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (size\ ==\ (\textcolor{keywordtype}{int})strlen(buffer)\ +\ 1)}
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordflow}{if}\ (memcmp(test,\ buffer,\ strlen(buffer)\ +\ 1)\ ==\ 0)}
\DoxyCodeLine{\ \ \ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ something\ is\ wrong\ with\ the\ contents\ of\ \%s,\ as"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\ we\ accessed\ it\ with\ a\ different\ key\ and\ it\ decripted\ our"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\ information\ right.\(\backslash\)n"{}},\ tmpf);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{\ \ \ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef);}

\end{DoxyCodeInclude}
 Note that we do it twice, being the last time with the wrong key. In this last case, if the information is read back and matches the original {\ttfamily buffer}, something wrong is going on (we made it to fail on purpose). The former access is OK, and must work.

What we do in sequence is just to delete the file. The complete code of the example follows.


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//Compile\ with:}}
\DoxyCodeLine{00002\ \textcolor{comment}{//\ gcc\ -\/o\ eet-\/data-\/cipher\_decipher\ eet-\/data-\/cipher\_decipher.c\ \`{}pkg-\/config\ -\/-\/cflags\ -\/-\/libs\ eet\ eina`}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <\mbox{\hyperlink{Eet_8h}{Eet.h}}>}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ <limits.h>}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ <sys/types.h>}}
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <sys/stat.h>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <unistd.h>}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <string.h>}}
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00013\ \textcolor{keywordtype}{int}}
\DoxyCodeLine{00014\ main(\textcolor{keywordtype}{void})}
\DoxyCodeLine{00015\ \{}
\DoxyCodeLine{00016\ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *buffer\ =\ \textcolor{stringliteral}{"{}Here\ is\ a\ string\ of\ data\ to\ save\ !"{}};}
\DoxyCodeLine{00017\ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *key\ =\ \textcolor{stringliteral}{"{}This\ is\ a\ crypto\ key"{}};}
\DoxyCodeLine{00018\ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *key\_bad\ =\ \textcolor{stringliteral}{"{}This\ is\ another\ crypto\ key"{}};}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\_File}}\ *ef;}
\DoxyCodeLine{00021\ \ \ \ \textcolor{keywordtype}{char}\ *test;}
\DoxyCodeLine{00022\ \ \ \ \textcolor{keywordtype}{int}\ size;}
\DoxyCodeLine{00023\ \ \ \ \textcolor{keywordtype}{int}\ tmpfd;}
\DoxyCodeLine{00024\ \ \ \ \mbox{\hyperlink{group__Eina__Stringshare__Group_gae8d53f367d5da5acfd19af6c235831d5}{Eina\_Tmpstr}}\ *tmpf\ =\ NULL;}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ \ \ \ \mbox{\hyperlink{group__Eet__Group_ga9903687bfa20fe9a9e59d4c1d213e89a}{eet\_init}}();}
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00028\ \ \ \ \textcolor{keywordflow}{if}\ (-\/1\ ==\ (tmpfd\ =\ \mbox{\hyperlink{group__Eina__File__Group_gac77efa39c12ba6880a5bbdca004080fb}{eina\_file\_mkstemp}}(\textcolor{stringliteral}{"{}eet\_cipher\_example\_XXXXXX"{}},\ \&tmpf))\ ||\ !!close(tmpfd))}
\DoxyCodeLine{00029\ \ \ \ \ \ \{}
\DoxyCodeLine{00030\ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{00031\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ not\ create\ temporary\ file\ (\%s)\ :\ \%s\(\backslash\)n"{}},}
\DoxyCodeLine{00032\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ tmpf,\ strerror(errno));}
\DoxyCodeLine{00033\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ panic;}
\DoxyCodeLine{00034\ \ \ \ \ \ \}}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00036\ \ \ \ \textcolor{comment}{/*\ Crypt\ an\ eet\ file.\ */}}
\DoxyCodeLine{00037\ \ \ \ ef\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\_open}}(tmpf,\ \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}{EET\_FILE\_MODE\_WRITE}});}
\DoxyCodeLine{00038\ \ \ \ \textcolor{keywordflow}{if}\ (!ef)}
\DoxyCodeLine{00039\ \ \ \ \ \ \{}
\DoxyCodeLine{00040\ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{00041\ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ not\ access\ file\ (\%s).\(\backslash\)n"{}},\ tmpf);}
\DoxyCodeLine{00042\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{00043\ \ \ \ \ \ \}}
\DoxyCodeLine{00044\ }
\DoxyCodeLine{00045\ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{group__Eet__File__Cipher__Group_ga0c08a5881d6fd3474a8cbe03a445aff3}{eet\_write\_cipher}}(ef,\ \textcolor{stringliteral}{"{}keys/tests"{}},\ buffer,\ strlen(buffer)\ +\ 1,\ 0,\ key))}
\DoxyCodeLine{00046\ \ \ \ \ \ \{}
\DoxyCodeLine{00047\ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{00048\ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ not\ access\ file\ (\%s).\(\backslash\)n"{}},\ tmpf);}
\DoxyCodeLine{00049\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{00050\ \ \ \ \ \ \}}
\DoxyCodeLine{00051\ }
\DoxyCodeLine{00052\ \ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef);}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00054\ \ \ \ \textcolor{comment}{/*\ Decrypt\ an\ eet\ file.\ */}}
\DoxyCodeLine{00055\ \ \ \ ef\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\_open}}(tmpf,\ \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\_FILE\_MODE\_READ}});}
\DoxyCodeLine{00056\ \ \ \ \textcolor{keywordflow}{if}\ (!ef)}
\DoxyCodeLine{00057\ \ \ \ \ \ \{}
\DoxyCodeLine{00058\ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{00059\ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ not\ access\ file\ (\%s).\(\backslash\)n"{}},\ tmpf);}
\DoxyCodeLine{00060\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{00061\ \ \ \ \ \ \}}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00063\ \ \ \ test\ =\ \mbox{\hyperlink{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}{eet\_read\_cipher}}(ef,\ \textcolor{stringliteral}{"{}keys/tests"{}},\ \&size,\ key);}
\DoxyCodeLine{00064\ \ \ \ \textcolor{keywordflow}{if}\ (!test)}
\DoxyCodeLine{00065\ \ \ \ \ \ \{}
\DoxyCodeLine{00066\ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{00067\ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ decript\ contents\ on\ file\ \%s,\ with\ key\ \%s.\(\backslash\)n"{}},}
\DoxyCodeLine{00068\ \ \ \ \ \ \ \ \ \ \ tmpf,\ key);}
\DoxyCodeLine{00069\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{00070\ \ \ \ \ \ \}}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ \ \ \ \textcolor{keywordflow}{if}\ (size\ !=\ (\textcolor{keywordtype}{int})strlen(buffer)\ +\ 1)}
\DoxyCodeLine{00073\ \ \ \ \ \ \{}
\DoxyCodeLine{00074\ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{00075\ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ something\ is\ wrong\ with\ the\ decripted\ data\(\backslash\)n"{}});}
\DoxyCodeLine{00076\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{00077\ \ \ \ \ \ \}}
\DoxyCodeLine{00078\ }
\DoxyCodeLine{00079\ \ \ \ \textcolor{keywordflow}{if}\ (memcmp(test,\ buffer,\ strlen(buffer)\ +\ 1)\ !=\ 0)}
\DoxyCodeLine{00080\ \ \ \ \ \ \{}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ something\ is\ wrong\ with\ the\ decripted\ data\(\backslash\)n"{}});}
\DoxyCodeLine{00083\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{00084\ \ \ \ \ \ \}}
\DoxyCodeLine{00085\ }
\DoxyCodeLine{00086\ \ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef);}
\DoxyCodeLine{00087\ }
\DoxyCodeLine{00088\ \ \ \ \textcolor{comment}{/*\ Decrypt\ an\ eet\ file,\ now\ using\ our\ BAD\ key!!\ */}}
\DoxyCodeLine{00089\ \ \ \ ef\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\_open}}(tmpf,\ \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\_FILE\_MODE\_READ}});}
\DoxyCodeLine{00090\ \ \ \ \textcolor{keywordflow}{if}\ (!ef)}
\DoxyCodeLine{00091\ \ \ \ \ \ \{}
\DoxyCodeLine{00092\ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{00093\ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ not\ access\ file\ (\%s).\(\backslash\)n"{}},\ tmpf);}
\DoxyCodeLine{00094\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{00095\ \ \ \ \ \ \}}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00097\ \ \ \ test\ =\ \mbox{\hyperlink{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}{eet\_read\_cipher}}(ef,\ \textcolor{stringliteral}{"{}keys/tests"{}},\ \&size,\ key\_bad);}
\DoxyCodeLine{00098\ }
\DoxyCodeLine{00099\ \ \ \ \textcolor{keywordflow}{if}\ (size\ ==\ (\textcolor{keywordtype}{int})strlen(buffer)\ +\ 1)}
\DoxyCodeLine{00100\ \ \ \ \ \ \textcolor{keywordflow}{if}\ (memcmp(test,\ buffer,\ strlen(buffer)\ +\ 1)\ ==\ 0)}
\DoxyCodeLine{00101\ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00102\ \ \ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{00103\ \ \ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ something\ is\ wrong\ with\ the\ contents\ of\ \%s,\ as"{}}}
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\ we\ accessed\ it\ with\ a\ different\ key\ and\ it\ decripted\ our"{}}}
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\ information\ right.\(\backslash\)n"{}},\ tmpf);}
\DoxyCodeLine{00106\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{goto}\ error;}
\DoxyCodeLine{00107\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00108\ }
\DoxyCodeLine{00109\ \ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef);}
\DoxyCodeLine{00110\ }
\DoxyCodeLine{00111\ error:}
\DoxyCodeLine{00112\ \ \ \ \textcolor{keywordflow}{if}\ (unlink(tmpf)\ !=\ 0)}
\DoxyCodeLine{00113\ \ \ \ \ \ \{}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ fprintf(}
\DoxyCodeLine{00115\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ stderr,\ \textcolor{stringliteral}{"{}ERROR:\ could\ not\ unlink\ file\ (\%s)\%d.\(\backslash\)n"{}},\ tmpf,\ errno);}
\DoxyCodeLine{00116\ \ \ \ \ \ \}}
\DoxyCodeLine{00117\ \ \ \ \mbox{\hyperlink{group__Eina__Stringshare__Group_ga0c32cf7aadbc1fcd60500d5bb9c03c93}{eina\_tmpstr\_del}}(tmpf);}
\DoxyCodeLine{00118\ }
\DoxyCodeLine{00119\ panic:}
\DoxyCodeLine{00120\ \ \ \ \mbox{\hyperlink{group__Eet__Group_gacbc7583179399d3b3e7b003e911f866f}{eet\_shutdown}}();}
\DoxyCodeLine{00121\ \}}
\DoxyCodeLine{00122\ }

\end{DoxyCodeInclude}
 