From: jsing Date: Sun, 9 Jan 2022 15:53:52 +0000 (+0000) Subject: Swap arguments to ssl_check_srvr_ecc_cert_and_alg() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2675be24afeeaf8e102694d6c16127bfdbf2bd50;p=openbsd Swap arguments to ssl_check_srvr_ecc_cert_and_alg() If a libssl function takes an SSL *, it should normally be the first argument. --- diff --git a/lib/libssl/ssl_clnt.c b/lib/libssl/ssl_clnt.c index ca54515a329..c031b70c0ac 100644 --- a/lib/libssl/ssl_clnt.c +++ b/lib/libssl/ssl_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_clnt.c,v 1.132 2022/01/09 15:40:13 jsing Exp $ */ +/* $OpenBSD: ssl_clnt.c,v 1.133 2022/01/09 15:53:52 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -2456,8 +2456,8 @@ ssl3_check_cert_and_algorithm(SSL *s) idx = s->session->peer_cert_type; if (idx == SSL_PKEY_ECC) { - if (ssl_check_srvr_ecc_cert_and_alg( - s->session->peer_pkeys[idx].x509, s) == 0) { + if (ssl_check_srvr_ecc_cert_and_alg(s, + s->session->peer_pkeys[idx].x509) == 0) { /* check failed */ SSLerror(s, SSL_R_BAD_ECC_CERT); goto fatal_err; diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c index fb0920cdf2d..bfa312207db 100644 --- a/lib/libssl/ssl_lib.c +++ b/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.283 2022/01/08 12:59:58 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.284 2022/01/09 15:53:52 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -2235,10 +2235,10 @@ ssl_using_ecc_cipher(SSL *s) } int -ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL *s) +ssl_check_srvr_ecc_cert_and_alg(SSL *s, X509 *x) { - const SSL_CIPHER *cs = S3I(s)->hs.cipher; - unsigned long alg_a; + const SSL_CIPHER *cs = S3I(s)->hs.cipher; + unsigned long alg_a; alg_a = cs->algorithm_auth; diff --git a/lib/libssl/ssl_locl.h b/lib/libssl/ssl_locl.h index d559e7148a3..fcb369405c9 100644 --- a/lib/libssl/ssl_locl.h +++ b/lib/libssl/ssl_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_locl.h,v 1.379 2022/01/08 12:59:59 jsing Exp $ */ +/* $OpenBSD: ssl_locl.h,v 1.380 2022/01/09 15:53:52 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1479,7 +1479,7 @@ int tls12_derive_master_secret(SSL *s, uint8_t *premaster_secret, size_t premaster_secret_len); int ssl_using_ecc_cipher(SSL *s); -int ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL *s); +int ssl_check_srvr_ecc_cert_and_alg(SSL *s, X509 *x); void tls1_get_formatlist(SSL *s, int client_formats, const uint8_t **pformats, size_t *pformatslen);