diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2018-02-15 16:55:01 +0200 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2018-02-18 23:11:26 +0200 |
commit | 8cc6697ffd1c872ddffc5cfd9ba6caaa9e1ccd77 (patch) | |
tree | a2449d9ddc64d81d010d5d07026d605036774bea /nhrp-events | |
parent | b4942b772369dde1e6602923d2d12250c711cd67 (diff) | |
download | dmvpn-tools-8cc6697ffd1c872ddffc5cfd9ba6caaa9e1ccd77.tar.bz2 dmvpn-tools-8cc6697ffd1c872ddffc5cfd9ba6caaa9e1ccd77.tar.xz |
nhrp-events: use hub extension
Diffstat (limited to 'nhrp-events')
-rwxr-xr-x | nhrp-events | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nhrp-events b/nhrp-events index 2f55657..f87463b 100755 --- a/nhrp-events +++ b/nhrp-events @@ -6,6 +6,7 @@ address against certificate subjectAltName IP, and auto-creates BGP pairings and filters based on S-BGP extensions. Copyright (c) 2015-2017 Timo Teräs +Copyright (c) 2017-2018 Kaarle Ritvanen See LICENSE file for license details ]]-- @@ -16,7 +17,9 @@ local cq = require 'cqueues' local cqs = require 'cqueues.socket' local x509 = require 'openssl.x509' local x509an = require 'openssl.x509.altname' +local asn1 = require 'asn1' local rfc3779 = require 'asn1.rfc3779' +local dmvpn = require 'dmvpn' local SOCK = "/var/run/nhrp-events.sock" posix.unlink(SOCK) @@ -81,8 +84,7 @@ local function parse_cert(certhex) } local cert = x509.new(certhex:hex2bin(), 'der') out.cn = tostring(cert:getSubject()) - -- Recognize hubs by certificate's CN to have OU=Hubs - out.hub = out.cn:match("/OU=Hubs/") and true or nil + out.hub = decode_ext(cert, dmvpn.OID_IS_HUB, asn1.boolean) do_parse_cert(cert, out) return out end |