Definition at line 1116 of file mlogger.cxx.
◆ WriterSHA256()
Definition at line 1119 of file mlogger.cxx.
1120 {
1122 printf(
"WriterSHA256: path [%s], level %d\n", log_chn->
path.c_str(), level);
1123
1124 assert(wr != NULL);
1125
1128
1130 }
mbedtls_sha256_context fCtx
void mbedtls_sha256_init(mbedtls_sha256_context *ctx)
Initialize SHA-256 context.
◆ ~WriterSHA256()
| WriterSHA256::~WriterSHA256 |
( |
| ) |
|
|
inline |
Definition at line 1132 of file mlogger.cxx.
1133 {
1135 printf("WriterSHA256: destructor\n");
1137
1139 }
void mbedtls_sha256_free(mbedtls_sha256_context *ctx)
Clear SHA-256 context.
◆ toHex()
| std::string WriterSHA256::toHex |
( |
unsigned char |
c | ) |
|
|
inline |
Definition at line 1183 of file mlogger.cxx.
1184 {
1185 char s[3];
1186 sprintf(s,
"%02x",
c);
1187 return s;
1188 }
◆ toString()
| std::string WriterSHA256::toString |
( |
const unsigned char |
sha256sum[32] | ) |
|
|
inline |
Definition at line 1190 of file mlogger.cxx.
1191 {
1192 std::string s;
1193 for (
int i=0;
i<32;
i++)
1194 s +=
toHex(sha256sum[
i]);
1195 return s;
1196 }
std::string toHex(unsigned char c)
◆ wr_close()
| int WriterSHA256::wr_close |
( |
LOG_CHN * |
log_chn, |
|
|
int |
run_number |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 1198 of file mlogger.cxx.
1199 {
1201 std::string f = x + ".sha256";
1202
1204 printf(
"WriterSHA256: close path [%s], level %d, file [%s]\n", log_chn->
path.c_str(),
fLevel, f.c_str());
1205
1207
1208 unsigned char sha256sum[32];
1210
1211
1212
1213
1215
1218 cm_msg(
MERROR,
"WriterSHA256::wr_close",
"Cannot write SHA-256 checksum to file \'%s\', fopen() errno %d (%s)", f.c_str(), errno, strerror(errno));
1219 } else {
1222 }
1223
1224
1225
1227
1230
1233 }
1234
1236 }
virtual int wr_close(LOG_CHN *log_chn, int run_number)=0
std::string toString(const unsigned char sha256sum[32])
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
static FILE * fopen_wx(const char *filename)
static std::string xpathname(const char *xpath, int level)
void mbedtls_sha256_finish(mbedtls_sha256_context *ctx, unsigned char output[32])
SHA-256 final digest.
◆ wr_get_chain()
| std::string WriterSHA256::wr_get_chain |
( |
| ) |
|
|
inlinevirtual |
◆ wr_get_file_ext()
| std::string WriterSHA256::wr_get_file_ext |
( |
| ) |
|
|
inlinevirtual |
◆ wr_open()
| int WriterSHA256::wr_open |
( |
LOG_CHN * |
log_chn, |
|
|
int |
run_number |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 1141 of file mlogger.cxx.
1142 {
1144
1146 printf(
"WriterSHA256: open path [%s], level %d\n", log_chn->
path.c_str(),
fLevel);
1147
1149
1152
1155 }
1156
1158
1160
1162 }
virtual int wr_open(LOG_CHN *log_chn, int run_number)=0
void mbedtls_sha256_starts(mbedtls_sha256_context *ctx, int is224)
SHA-256 context setup.
◆ wr_write()
| int WriterSHA256::wr_write |
( |
LOG_CHN * |
log_chn, |
|
|
const void * |
data, |
|
|
const int |
size |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 1164 of file mlogger.cxx.
1165 {
1167 printf(
"WriterSHA256: write path [%s], size %d\n", log_chn->
path.c_str(), size);
1168
1170
1172
1175
1178 }
1179
1181 }
virtual int wr_write(LOG_CHN *log_chn, const void *data, const int size)=0
void mbedtls_sha256_update(mbedtls_sha256_context *ctx, const unsigned char *input, size_t ilen)
SHA-256 process buffer.
◆ fCtx
◆ fLevel
◆ fWr
The documentation for this class was generated from the following file: