summaryrefslogtreecommitdiff
path: root/usr/src/lib/libresolv2/common/dnssafe/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libresolv2/common/dnssafe/random.c')
-rw-r--r--usr/src/lib/libresolv2/common/dnssafe/random.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/usr/src/lib/libresolv2/common/dnssafe/random.c b/usr/src/lib/libresolv2/common/dnssafe/random.c
new file mode 100644
index 0000000000..8126b76926
--- /dev/null
+++ b/usr/src/lib/libresolv2/common/dnssafe/random.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 1999 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/* Copyright (C) RSA Data Security, Inc. created 1990, 1996. This is an
+ unpublished work protected as such under copyright law. This work
+ contains proprietary, confidential, and trade secret information of
+ RSA Data Security, Inc. Use, disclosure or reproduction without the
+ express written authorization of RSA Data Security, Inc. is
+ prohibited.
+ */
+
+#include "port_before.h"
+#include "global.h"
+#include "bsafe2.h"
+#include "bkey.h"
+#include "balg.h"
+#include "ainfotyp.h"
+#include "algobj.h"
+#include "port_after.h"
+
+int B_RandomInit
+ (algorithmObject, algorithmChooser, surrenderContext)
+B_ALGORITHM_OBJ algorithmObject;
+B_ALGORITHM_CHOOSER algorithmChooser;
+A_SURRENDER_CTX *surrenderContext;
+{
+ if (AlgorithmWrapCheck (THE_ALG_WRAP) != 0)
+ /* Assume error is B_ALGORITHM_OBJ */
+ return (BE_RANDOM_OBJ);
+
+ return (B_AlgorithmRandomInit
+ (&THE_ALG_WRAP->algorithm, algorithmChooser, surrenderContext));
+}
+
+int B_RandomUpdate (algorithmObject, input, inputLen, surrenderContext)
+B_ALGORITHM_OBJ algorithmObject;
+unsigned char *input;
+unsigned int inputLen;
+A_SURRENDER_CTX *surrenderContext;
+{
+ if (AlgorithmWrapCheck (THE_ALG_WRAP) != 0)
+ /* Assume error is B_ALGORITHM_OBJ */
+ return (BE_RANDOM_OBJ);
+
+ return (B_AlgorithmRandomUpdate
+ (&THE_ALG_WRAP->algorithm, input, inputLen, surrenderContext));
+}
+
+int B_GenerateRandomBytes
+ (algorithmObject, output, outputLen, surrenderContext)
+B_ALGORITHM_OBJ algorithmObject;
+unsigned char *output;
+unsigned int outputLen;
+A_SURRENDER_CTX *surrenderContext;
+{
+ if (AlgorithmWrapCheck (THE_ALG_WRAP) != 0)
+ /* Assume error is B_ALGORITHM_OBJ */
+ return (BE_RANDOM_OBJ);
+
+ return (B_AlgorithmGenerateRandomBytes
+ (&THE_ALG_WRAP->algorithm, output, outputLen, surrenderContext));
+}
+