summaryrefslogtreecommitdiff
path: root/umac.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2007-09-17 16:11:01 +1000
committerDamien Miller <djm@mindrot.org>2007-09-17 16:11:01 +1000
commit83e04f2023cb80366cf4f06a43f4df6ad2b5f08b (patch)
tree482cac77c11d376b8e81297f9d6f24d619de52c1 /umac.c
parent1235cd387e0fee0595129f0fa55216ab0d040c94 (diff)
- stevesk@cvs.openbsd.org 2007/09/12 19:39:19
[umac.c] use xmalloc() and xfree(); ok markus@ pvalchev@
Diffstat (limited to 'umac.c')
-rw-r--r--umac.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/umac.c b/umac.c
index c2fdcf448..ca5e08b3e 100644
--- a/umac.c
+++ b/umac.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: umac.c,v 1.1 2007/06/07 19:37:34 pvalchev Exp $ */ 1/* $OpenBSD: umac.c,v 1.2 2007/09/12 19:39:19 stevesk Exp $ */
2/* ----------------------------------------------------------------------- 2/* -----------------------------------------------------------------------
3 * 3 *
4 * umac.c -- C Implementation UMAC Message Authentication 4 * umac.c -- C Implementation UMAC Message Authentication
@@ -66,6 +66,7 @@
66#include "includes.h" 66#include "includes.h"
67#include <sys/types.h> 67#include <sys/types.h>
68 68
69#include "xmalloc.h"
69#include "umac.h" 70#include "umac.h"
70#include <string.h> 71#include <string.h>
71#include <stdlib.h> 72#include <stdlib.h>
@@ -1196,7 +1197,7 @@ int umac_delete(struct umac_ctx *ctx)
1196 if (ctx) { 1197 if (ctx) {
1197 if (ALLOC_BOUNDARY) 1198 if (ALLOC_BOUNDARY)
1198 ctx = (struct umac_ctx *)ctx->free_ptr; 1199 ctx = (struct umac_ctx *)ctx->free_ptr;
1199 free(ctx); 1200 xfree(ctx);
1200 } 1201 }
1201 return (1); 1202 return (1);
1202} 1203}
@@ -1212,7 +1213,7 @@ struct umac_ctx *umac_new(u_char key[])
1212 size_t bytes_to_add; 1213 size_t bytes_to_add;
1213 aes_int_key prf_key; 1214 aes_int_key prf_key;
1214 1215
1215 octx = ctx = malloc(sizeof(*ctx) + ALLOC_BOUNDARY); 1216 octx = ctx = xmalloc(sizeof(*ctx) + ALLOC_BOUNDARY);
1216 if (ctx) { 1217 if (ctx) {
1217 if (ALLOC_BOUNDARY) { 1218 if (ALLOC_BOUNDARY) {
1218 bytes_to_add = ALLOC_BOUNDARY - 1219 bytes_to_add = ALLOC_BOUNDARY -