summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-11-09 19:28:45 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-11-09 19:28:45 +0000
commitdf8300e3cb1490b00adf5f29568ceb024c778864 (patch)
treee9ff8c0ae1bd50c16b7960f2256a68f3cd626a39
parentc38d721255c0219e78c885aca72fd25005cd90e9 (diff)
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.
-rw-r--r--lib/libcrypto/gost/gost89_keywrap.c7
-rw-r--r--lib/libcrypto/gost/gostr341001_pmeth.c16
2 files changed, 4 insertions, 19 deletions
diff --git a/lib/libcrypto/gost/gost89_keywrap.c b/lib/libcrypto/gost/gost89_keywrap.c
index fa7698d3f76..a754c4d56ea 100644
--- a/lib/libcrypto/gost/gost89_keywrap.c
+++ b/lib/libcrypto/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/libcrypto/gost/gostr341001_pmeth.c b/lib/libcrypto/gost/gostr341001_pmeth.c
index c7001fc1fa0..77a84a36572 100644
--- a/lib/libcrypto/gost/gostr341001_pmeth.c
+++ b/lib/libcrypto/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: