diff options
author | lloyd <[email protected]> | 2006-08-22 23:08:22 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-08-22 23:08:22 +0000 |
commit | d22706440b51b15df905f03396efc6bf7a42e809 (patch) | |
tree | 3e8ac0496edf1d196f5614749bef395f17a591a8 /src | |
parent | 51e7c90fa717be4e08ef00496fa0bd6a84c1b641 (diff) |
Have OIDS::lookup do the right thing when given an OID that isn't
registered in the name database, or asked to lookup an OID with a bare
OID string representation.
Diffstat (limited to 'src')
-rw-r--r-- | src/oids.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/oids.cpp b/src/oids.cpp index 4c56ff558..6b96b3656 100644 --- a/src/oids.cpp +++ b/src/oids.cpp @@ -28,7 +28,10 @@ void add_oid(const OID& oid, const std::string& name) *************************************************/ std::string lookup(const OID& oid) { - return global_config().get("oid2str", oid.as_string()); + std::string name = global_config().get("oid2str", oid.as_string()); + if(name == "") + return oid.as_string(); + return name; } /************************************************* @@ -36,7 +39,10 @@ std::string lookup(const OID& oid) *************************************************/ OID lookup(const std::string& name) { - return OID(global_config().get("str2oid", name)); + std::string value = global_config().get("str2oid", name); + if(value == "") + return OID(name); + return OID(value); } /************************************************* |