MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / readHexKey

Function readHexKey

examples/extauth/TcWrapper.cpp:65–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65unsigned readHexKey(ThrowStatusWrapper* status, const char* hex, unsigned char* key, unsigned bufSize)
66{
67 unsigned char* k = key;
68 const char* const end = hex + strlen(hex) - 1;
69 for (const char* s = hex; s < end; s += 2)
70 {
71 if (k - key >= bufSize)
72 break;
73
74 // FF
75 char ss[3];
76 ss[0] = s[0];
77 ss[1] = s[1];
78 ss[2] = 0;
79 unsigned c = strtoul(ss, NULL, 16);
80 if (c > 255)
81 error(status, "Key format error");
82 *k++ = static_cast<unsigned char>(c);
83 }
84 return k - key;
85}
86
87void PseudoRandom::init(ThrowStatusWrapper* status)
88{

Callers 1

PluginDataMethod · 0.85

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected