From 811be0dc52e1a06f6f3add77779e06406100f339 Mon Sep 17 00:00:00 2001 From: tedu <> Date: Tue, 17 Jun 2014 01:41:01 +0000 Subject: ssl_session_cmp is not a sort function, can use CRYPTO_memcmp here too. --- src/lib/libssl/src/ssl/ssl_lib.c | 6 ++++-- src/lib/libssl/ssl_lib.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/libssl/src/ssl/ssl_lib.c b/src/lib/libssl/src/ssl/ssl_lib.c index 297c80124d..04c3393053 100644 --- a/src/lib/libssl/src/ssl/ssl_lib.c +++ b/src/lib/libssl/src/ssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.67 2014/06/13 10:52:24 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.68 2014/06/17 01:41:01 tedu Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1678,7 +1678,9 @@ ssl_session_cmp(const SSL_SESSION *a, const SSL_SESSION *b) return (1); if (a->session_id_length != b->session_id_length) return (1); - return (memcmp(a->session_id, b->session_id, a->session_id_length)); + if (CRYPTO_memcmp(a->session_id, b->session_id, a->session_id_length) != 0) + return (1); + return (0); } /* diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 297c80124d..04c3393053 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.67 2014/06/13 10:52:24 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.68 2014/06/17 01:41:01 tedu Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1678,7 +1678,9 @@ ssl_session_cmp(const SSL_SESSION *a, const SSL_SESSION *b) return (1); if (a->session_id_length != b->session_id_length) return (1); - return (memcmp(a->session_id, b->session_id, a->session_id_length)); + if (CRYPTO_memcmp(a->session_id, b->session_id, a->session_id_length) != 0) + return (1); + return (0); } /* -- cgit v1.2.3-55-g6feb