From: doug Date: Wed, 29 Apr 2015 01:31:39 +0000 (+0000) Subject: Call CBS_mem_equal() rather than reimplementing it. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e9bb426a54ed3b2af34878baa98ed2294fc1e56f;p=openbsd Call CBS_mem_equal() rather than reimplementing it. ok jsing@ --- diff --git a/lib/libssl/bs_ber.c b/lib/libssl/bs_ber.c index cfc9475f9a2..1dde38264e3 100644 --- a/lib/libssl/bs_ber.c +++ b/lib/libssl/bs_ber.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs_ber.c,v 1.2 2015/02/06 22:22:33 doug Exp $ */ +/* $OpenBSD: bs_ber.c,v 1.3 2015/04/29 01:31:39 doug Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -89,8 +89,7 @@ is_primitive_type(unsigned tag) static char is_eoc(size_t header_len, CBS *contents) { - return header_len == 2 && CBS_len(contents) == 2 && - memcmp(CBS_data(contents), "\x00\x00", 2) == 0; + return header_len == 2 && CBS_mem_equal(contents, "\x00\x00", 2); } /* diff --git a/lib/libssl/src/ssl/bs_ber.c b/lib/libssl/src/ssl/bs_ber.c index cfc9475f9a2..1dde38264e3 100644 --- a/lib/libssl/src/ssl/bs_ber.c +++ b/lib/libssl/src/ssl/bs_ber.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs_ber.c,v 1.2 2015/02/06 22:22:33 doug Exp $ */ +/* $OpenBSD: bs_ber.c,v 1.3 2015/04/29 01:31:39 doug Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -89,8 +89,7 @@ is_primitive_type(unsigned tag) static char is_eoc(size_t header_len, CBS *contents) { - return header_len == 2 && CBS_len(contents) == 2 && - memcmp(CBS_data(contents), "\x00\x00", 2) == 0; + return header_len == 2 && CBS_mem_equal(contents, "\x00\x00", 2); } /*