-/* $OpenBSD: rand_key.c,v 1.6 2014/06/12 15:49:28 deraadt Exp $ */
+/* $OpenBSD: rand_key.c,v 1.7 2014/07/22 18:09:20 miod Exp $ */
/* ====================================================================
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
*
#include <openssl/des.h>
#include <openssl/rand.h>
-int DES_random_key(DES_cblock *ret)
- {
- do
- {
+int
+DES_random_key(DES_cblock *ret)
+{
+ do {
if (RAND_bytes((unsigned char *)ret, sizeof(DES_cblock)) != 1)
return (0);
- } while (DES_is_weak_key(ret));
- DES_set_odd_parity(ret);
+ DES_set_odd_parity(ret);
+ } while (DES_is_weak_key(ret));
return (1);
- }
+}
-/* $OpenBSD: rand_key.c,v 1.6 2014/06/12 15:49:28 deraadt Exp $ */
+/* $OpenBSD: rand_key.c,v 1.7 2014/07/22 18:09:20 miod Exp $ */
/* ====================================================================
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
*
#include <openssl/des.h>
#include <openssl/rand.h>
-int DES_random_key(DES_cblock *ret)
- {
- do
- {
+int
+DES_random_key(DES_cblock *ret)
+{
+ do {
if (RAND_bytes((unsigned char *)ret, sizeof(DES_cblock)) != 1)
return (0);
- } while (DES_is_weak_key(ret));
- DES_set_odd_parity(ret);
+ DES_set_odd_parity(ret);
+ } while (DES_is_weak_key(ret));
return (1);
- }
+}