Permalink
Browse files

Import openssl version 1.0.0

  • Loading branch information...
1 parent 7db09ce commit b1e914a25755cad382bd071a4683bda298e4658b Jenkins CI committed May 8, 2012
@@ -0,0 +1,37 @@
+Description
+====
+
+Provide a library method to generate secure random passwords in recipes.
+
+Requirements
+====
+
+Works on any platform with OpenSSL Ruby bindings installed, which are a requirement for Chef anyway.
+
+Usage
+====
+
+Most often this will be used to generate a secure password for an attribute.
+
+ include Opscode::OpenSSL::Password
+
+ set_unless[:my_password] = secure_password
+
+License and Author
+====
+
+Author:: Joshua Timberman (<joshua@opscode.com>)
+
+Copyright:: 2009-2011, Opscode, Inc
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
@@ -0,0 +1,37 @@
+#
+# Cookbook Name:: openssl
+# Library:: secure_password
+# Author:: Joshua Timberman <joshua@opscode.com>
+#
+# Copyright 2009, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'openssl'
+
+module Opscode
+ module OpenSSL
+ module Password
+ def secure_password
+ pw = String.new
+
+ while pw.length < 20
+ pw << ::OpenSSL::Random.random_bytes(1).gsub(/\W/, '')
+ end
+
+ pw
+ end
+ end
+ end
+end
@@ -0,0 +1,30 @@
+{
+ "name": "openssl",
+ "description": "Provides a library with a method for generating secure random passwords.",
+ "long_description": "Description\n====\n\nProvide a library method to generate secure random passwords in recipes.\n\nRequirements\n====\n\nWorks on any platform with OpenSSL Ruby bindings installed, which are a requirement for Chef anyway.\n\nUsage\n====\n\nMost often this will be used to generate a secure password for an attribute.\n\n include Opscode::OpenSSL::Password\n\n set_unless[:my_password] = secure_password\n\nLicense and Author\n====\n\nAuthor:: Joshua Timberman (<joshua@opscode.com>)\n\nCopyright:: 2009-2011, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
+ "maintainer": "Opscode, Inc.",
+ "maintainer_email": "cookbooks@opscode.com",
+ "license": "Apache 2.0",
+ "platforms": {
+ },
+ "dependencies": {
+ },
+ "recommendations": {
+ },
+ "suggestions": {
+ },
+ "conflicting": {
+ },
+ "providing": {
+ },
+ "replacing": {
+ },
+ "attributes": {
+ },
+ "groupings": {
+ },
+ "recipes": {
+ "openssl": "Empty, this cookbook provides a library, see README.md"
+ },
+ "version": "1.0.0"
+}
@@ -0,0 +1,8 @@
+maintainer "Opscode, Inc."
+maintainer_email "cookbooks@opscode.com"
+license "Apache 2.0"
+description "Provides a library with a method for generating secure random passwords."
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version "1.0.0"
+
+recipe "openssl", "Empty, this cookbook provides a library, see README.md"
@@ -0,0 +1,19 @@
+#
+# Cookbook Name:: openssl
+# Recipe:: default
+#
+# Copyright 2009, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+

0 comments on commit b1e914a

Please sign in to comment.