lib/r509/oid_mapper.rb in r509-1.0 vs lib/r509/oid_mapper.rb in r509-1.0.1
- old
+ new
@@ -10,10 +10,15 @@
# @return [Boolean] success/failure
def self.register(oid, short_name, long_name = nil)
if long_name.nil?
long_name = short_name
end
- OpenSSL::ASN1::ObjectId.register(oid, short_name, long_name)
+
+ begin
+ OpenSSL::ASN1::ObjectId.register(oid, short_name, long_name)
+ rescue OpenSSL::ASN1::ASN1Error
+ false
+ end
end
# Register a batch of OIDs so we have friendly short names
# @param [Array] oids An array of hashes
# @example