summaryrefslogtreecommitdiff
path: root/certs/app/models
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-03-06 01:34:16 -0800
committerelijah <elijah@riseup.net>2013-03-06 01:34:16 -0800
commit886585a0f673e0ea70abb99504ff9c70180361d5 (patch)
tree38ba46eb1eb277410a96a1cb3da70715fdfe8d6c /certs/app/models
parentf0ffc65aa38473ef280ed80526691d588f14c8de (diff)
certs - changed the logic of free/paid certs to be limited/unlimited.
Diffstat (limited to 'certs/app/models')
-rw-r--r--certs/app/models/client_certificate.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/certs/app/models/client_certificate.rb b/certs/app/models/client_certificate.rb
index 13e0318..76b07a2 100644
--- a/certs/app/models/client_certificate.rb
+++ b/certs/app/models/client_certificate.rb
@@ -21,7 +21,7 @@ class ClientCertificate
cert = CertificateAuthority::Certificate.new
# set subject
- cert.subject.common_name = common_name(options[:free])
+ cert.subject.common_name = common_name(options[:prefix])
# set expiration
cert.not_before = yesterday
@@ -65,8 +65,8 @@ class ClientCertificate
Digest::MD5.hexdigest("#{rand(10**10)} -- #{Time.now}").to_i(16)
end
- def common_name(for_free_cert = false)
- (for_free_cert ? APP_CONFIG[:free_cert_prefix] : '') + random_common_name
+ def common_name(prefix = nil)
+ [prefix, random_common_name].join
end
#