Lines Matching +full:mac +full:- +full:s

45  * overhead in time-critical paths.  ntpsec also caches the algorithms
47 * This is not thread-safe, but that is
64 msyslog(LOG_ERR, "%s init failed", OBJ_nid2sn(nid));
96 void const * keyptr = key->buf;
100 if (AES_128_KEY_SIZE > key->len) {
101 memcpy(keybuf, keyptr, key->len);
102 zero_mem((keybuf + key->len),
103 (AES_128_KEY_SIZE - key->len));
108 msyslog(LOG_ERR, "MAC encrypt: CMAC %s CTX new failed.", CMAC);
112 msyslog(LOG_ERR, "MAC encrypt: CMAC %s Init failed.", CMAC);
115 if (cmac_ctx_size(ctx) > digest->len) {
116 msyslog(LOG_ERR, "MAC encrypt: CMAC %s buf too small.", CMAC);
119 if (!CMAC_Update(ctx, msg->buf, msg->len)) {
120 msyslog(LOG_ERR, "MAC encrypt: CMAC %s Update failed.", CMAC);
123 if (!CMAC_Final(ctx, digest->buf, &retlen)) {
124 msyslog(LOG_ERR, "MAC encrypt: CMAC %s Final failed.", CMAC);
133 { /* generic MAC handling */
141 if ((size_t)EVP_MD_CTX_size(ctx) > digest->len) {
142 msyslog(LOG_ERR, "MAC encrypt: MAC %s buf too small.",
146 if (!EVP_DigestUpdate(ctx, key->buf, (u_int)key->len)) {
147 msyslog(LOG_ERR, "MAC encrypt: MAC %s Digest Update key failed.",
151 if (!EVP_DigestUpdate(ctx, msg->buf, (u_int)msg->len)) {
152 msyslog(LOG_ERR, "MAC encrypt: MAC %s Digest Update data failed.",
156 if (!EVP_DigestFinal(ctx, digest->buf, &uilen)) {
157 msyslog(LOG_ERR, "MAC encrypt: MAC %s Digest Final failed.",
171 if (digest->len < MD5_LENGTH) {
172 msyslog(LOG_ERR, "%s", "MAC encrypt: MAC md5 buf too small.");
175 MD5Update(ctx, (const void *)key->buf, key->len);
176 MD5Update(ctx, (const void *)msg->buf, msg->len);
177 MD5Final(digest->buf, ctx);
181 msyslog(LOG_ERR, "MAC encrypt: invalid key type %d", ktype);
191 * MD5authencrypt - generate message digest
193 * Returns 0 on failure or length of MAC including key ID.
221 * MD5authdecrypt - verify MD5 message authenticator
232 size_t size, /* MAC size */
245 "MAC decrypt: MAC length error: %u not %u for key %u",
258 * IPv6, ntpd long differed in the hash calculated on big-endian
259 * vs. little-endian because the first four bytes of the MD5 hash
261 * the refid-based loop detection between mixed-endian systems.
262 * In order to preserve behavior on the more-common little-endian
263 * systems, the hash is now byte-swapped on big-endian systems to
264 * match the little-endian hash. This is ugly but it seems better
265 * than changing the IPv6 refid calculation on the more-common