summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-11-09 19:28:44 +0000
committermiod <miod@openbsd.org>2014-11-09 19:28:44 +0000
commiteed99a880f7be0c01e6ba8fffa38b9e5752bf8e7 (patch)
tree24e36f2e5b8445e7847dd33dfcb580cb1556a987 /lib/libssl/src
parentRename internal yet public key_{un,}wrap_crypto_pro symbols by prepending a (diff)
downloadwireguard-openbsd-eed99a880f7be0c01e6ba8fffa38b9e5752bf8e7.tar.xz
wireguard-openbsd-eed99a880f7be0c01e6ba8fffa38b9e5752bf8e7.zip
Remove DEBUG_SIGN code. Make sure gost_key_unwrap_crypto_pro() returns failure
instead of a printf and a success return, when the operation fails.
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/gost/gost89_keywrap.c7
-rw-r--r--lib/libssl/src/crypto/gost/gostr341001_pmeth.c16
2 files changed, 4 insertions, 19 deletions
diff --git a/lib/libssl/src/crypto/gost/gost89_keywrap.c b/lib/libssl/src/crypto/gost/gost89_keywrap.c
index fa7698d3f76..a754c4d56ea 100644
--- a/lib/libssl/src/crypto/gost/gost89_keywrap.c
+++ b/lib/libssl/src/crypto/gost/gost89_keywrap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gost89_keywrap.c,v 1.2 2014/11/09 19:27:29 miod Exp $ */
+/* $OpenBSD: gost89_keywrap.c,v 1.3 2014/11/09 19:28:44 miod Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
@@ -129,10 +129,9 @@ gost_key_unwrap_crypto_pro(int nid, const unsigned char *keyExchangeKey,
Gost2814789_decrypt(wrappedKey + 8 + 24, sessionKey + 24, &ctx);
GOST2814789IMIT(sessionKey, 32, cek_mac, nid, kek_ukm, wrappedKey);
- if (memcmp(cek_mac, wrappedKey + 40, 4)) {
- printf("IMIT Missmatch!\n");
+ if (memcmp(cek_mac, wrappedKey + 40, 4))
return 0;
- }
+
return 1;
}
diff --git a/lib/libssl/src/crypto/gost/gostr341001_pmeth.c b/lib/libssl/src/crypto/gost/gostr341001_pmeth.c
index c7001fc1fa0..77a84a36572 100644
--- a/lib/libssl/src/crypto/gost/gostr341001_pmeth.c
+++ b/lib/libssl/src/crypto/gost/gostr341001_pmeth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gostr341001_pmeth.c,v 1.3 2014/11/09 19:27:29 miod Exp $ */
+/* $OpenBSD: gostr341001_pmeth.c,v 1.4 2014/11/09 19:28:44 miod Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
@@ -235,13 +235,6 @@ static int pkey_gost01_sign(EVP_PKEY_CTX * ctx, unsigned char *sig,
OPENSSL_assert(tbs_len == 32 || tbs_len == 64);
md = GOST_le2bn(tbs, tbs_len, NULL);
unpacked_sig = gost2001_do_sign(md, pkey->pkey.gost);
-#ifdef DEBUG_SIGN
- fprintf(stderr, "S.R=");
- BN_print_fp(stderr, unpacked_sig->r);
- fprintf(stderr, "\nS.S=");
- BN_print_fp(stderr, unpacked_sig->s);
- fprintf(stderr, "\n");
-#endif
if (!unpacked_sig) {
return 0;
}
@@ -281,13 +274,6 @@ static int pkey_gost01_verify(EVP_PKEY_CTX * ctx, const unsigned char *sig,
md = GOST_le2bn(tbs, tbs_len, NULL);
if (!md)
goto err;
-#ifdef DEBUG_SIGN
- fprintf(stderr, "V.R=");
- BN_print_fp(stderr, s->r);
- fprintf(stderr, "\nV.S=");
- BN_print_fp(stderr, s->s);
- fprintf(stderr, "\n");
-#endif
ok = gost2001_do_verify(md, s, pub_key->pkey.gost);
err: