summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/gost/gostr341001_pmeth.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/gost/gostr341001_pmeth.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/lib/libcrypto/gost/gostr341001_pmeth.c b/src/lib/libcrypto/gost/gostr341001_pmeth.c
index 0f82e88a9d..910c0b9c45 100644
--- a/src/lib/libcrypto/gost/gostr341001_pmeth.c
+++ b/src/lib/libcrypto/gost/gostr341001_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gostr341001_pmeth.c,v 1.1 2014/11/09 19:17:13 miod Exp $ */ 1/* $OpenBSD: gostr341001_pmeth.c,v 1.2 2014/11/09 19:24:30 miod Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
4 * Copyright (c) 2005-2006 Cryptocom LTD 4 * Copyright (c) 2005-2006 Cryptocom LTD
@@ -60,7 +60,6 @@
60#include <openssl/ec.h> 60#include <openssl/ec.h>
61#include <openssl/ecdsa.h> 61#include <openssl/ecdsa.h>
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63#include <openssl/rand.h> /* for RAND_bytes */
64 63
65#include "evp_locl.h" 64#include "evp_locl.h"
66#include "gost_locl.h" 65#include "gost_locl.h"
@@ -454,11 +453,7 @@ int pkey_gost01_encrypt(EVP_PKEY_CTX * pctx, unsigned char *out,
454 if (data->shared_ukm) { 453 if (data->shared_ukm) {
455 memcpy(ukm, data->shared_ukm, 8); 454 memcpy(ukm, data->shared_ukm, 8);
456 } else if (out) { 455 } else if (out) {
457 if (RAND_bytes(ukm, 8) <= 0) { 456 arc4random_buf(ukm, 8);
458 GOSTerr(GOST_F_PKEY_GOST01_ENCRYPT,
459 GOST_R_RANDOM_GENERATOR_FAILURE);
460 return 0;
461 }
462 } 457 }
463 /* Check for private key in the peer_key of context */ 458 /* Check for private key in the peer_key of context */
464 if (sec_key) { 459 if (sec_key) {