Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secDNS causing trouble on CentralNIC EPP #55

Closed
tmuncks opened this issue Oct 6, 2023 · 4 comments · Fixed by #58
Closed

secDNS causing trouble on CentralNIC EPP #55

tmuncks opened this issue Oct 6, 2023 · 4 comments · Fixed by #58
Assignees
Labels
bug Something isn't working

Comments

@tmuncks
Copy link

tmuncks commented Oct 6, 2023

Describe the bug
In some situations, getting domain info for a DNSSEC enabled domain in CentralNIC causes problems:

Traceback (most recent call last):
  File "/home/thms/projects/epp/test.py", line 35, in <module>
    domain_check = domain.info('solutions.gl')
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thms/projects/epp/venv/lib64/python3.11/site-packages/pyepp/domain.py", line 182, in info
    'flag': raw_response.find('flag').text,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The reason appears to be CentralNIC using unexpected names under the dns_key sections.

If I change the names in both dns_key sections in domain.py function definition for info(), changing:

flag -> flags
algorithm -> alg
public_key -> pubKey

Like this:

'dns_key': {
        #'flag': raw_response.find('flag').text,
        'flag': raw_response.find('flags').text,
        'protocol': raw_response.find('protocol').text,
        #algorithm': raw_response.find('algorithm').text,
        'algorithm': raw_response.find('alg').text,
        #'public_key': raw_response.find('public_key').text,
        'public_key': raw_response.find('pubKey').text,
}

...it starts working for me. This is obviously not a solution, as it would most likely break something else.

To Reproduce
This is a real life raw_response from CentralNIC, of a response that causes the problem.

<?xml version="1.0" encoding="utf-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
    <response>
        <result code="1000">
            <msg>Command completed successfully.</msg>
        </result>
        <resData>
            <domain:infData xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
                <domain:name>solutions.gl</domain:name>
                <domain:roid>D400779210-CNIC</domain:roid>
                <domain:status s="serverTransferProhibited"/>
                <domain:status s="clientTransferProhibited"/>
                <domain:status s="clientDeleteProhibited"/>
                <domain:registrant>REDACTED</domain:registrant>
                <domain:contact type="tech">REDACTED</domain:contact>
                <domain:contact type="admin">REDACTED</domain:contact>
                <domain:contact type="billing">REDACTED</domain:contact>
                <domain:ns>
                    <domain:hostObj>ns1.modulo.gl</domain:hostObj>
                    <domain:hostObj>ns2.modulo.gl</domain:hostObj>
                    <domain:hostObj>ns3.modulo.gl</domain:hostObj>
                </domain:ns>
                <domain:clID>REDACTED</domain:clID>
                <domain:crID>REDACTED</domain:crID>
                <domain:crDate>2023-10-02T17:05:17.0Z</domain:crDate>
                <domain:upDate>2023-10-02T17:46:31.0Z</domain:upDate>
                <domain:exDate>2024-10-02T23:59:59.0Z</domain:exDate>
            </domain:infData>
        </resData>
        <extension>
            <secDNS:infData xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
                <secDNS:dsData>
                    <secDNS:keyTag>17600</secDNS:keyTag>
                    <secDNS:alg>13</secDNS:alg>
                    <secDNS:digestType>1</secDNS:digestType>
                    <secDNS:digest>4ffb0f3f0fb5edbaa0067d1cd94bb545249cfea2</secDNS:digest>
                    <secDNS:keyData>
                        <secDNS:flags>257</secDNS:flags>
                        <secDNS:protocol>3</secDNS:protocol>
                        <secDNS:alg>14</secDNS:alg>
                        <secDNS:pubKey>fHiagyGUIxsDmeYaaKOWceffQn7QTaCwM1y6Oy1zYRpndxu/6WAHM99p/X/dM7t+RcGahZ8+GlX5JHkbyaMllg==</secDNS:pubKey>
                    </secDNS:keyData>
                </secDNS:dsData>
                <secDNS:dsData>
                    <secDNS:keyTag>17600</secDNS:keyTag>
                    <secDNS:alg>13</secDNS:alg>
                    <secDNS:digestType>2</secDNS:digestType>
                    <secDNS:digest>024c96b094aaad3892babb303e02587f7d6f8f749fef9ff642e3bb8bfc2e0dcf</secDNS:digest>
                    <secDNS:keyData>
                        <secDNS:flags>257</secDNS:flags>
                        <secDNS:protocol>3</secDNS:protocol>
                        <secDNS:alg>13</secDNS:alg>
                        <secDNS:pubKey>fHiagyGUIxsDmeYaaKOWceffQn7QTaCwM1y6Oy1zYRpndxu/6WAHM99p/X/dM7t+RcGahZ8+GlX5JHkbyaMllg==</secDNS:pubKey>
                    </secDNS:keyData>
                </secDNS:dsData>
                <secDNS:dsData>
                    <secDNS:keyTag>17600</secDNS:keyTag>
                    <secDNS:alg>13</secDNS:alg>
                    <secDNS:digestType>4</secDNS:digestType>
                    <secDNS:digest>14d92f9f1e82c0906e2003b9e3401de4024f705724ef14d848fc2708d5714d5572db040faa3e317753e6577c7e70cbb8</secDNS:digest>
                    <secDNS:keyData>
                        <secDNS:flags>257</secDNS:flags>
                        <secDNS:protocol>3</secDNS:protocol>
                        <secDNS:alg>13</secDNS:alg>
                        <secDNS:pubKey>fHiagyGUIxsDmeYaaKOWceffQn7QTaCwM1y6Oy1zYRpndxu/6WAHM99p/X/dM7t+RcGahZ8+GlX5JHkbyaMllg==</secDNS:pubKey>
                    </secDNS:keyData>
                </secDNS:dsData>
            </secDNS:infData>
            <rgp:infData xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0">
                <rgp:rgpStatus s="addPeriod"/>
            </rgp:infData>
            <regtype:infData xmlns:regtype="urn:ietf:params:xml:ns:regtype-0.1">
                <regtype:type>standard</regtype:type>
            </regtype:infData>
        </extension>
        <trID>
            <clTRID>ff3e31b0-ae6d-423a-8f3f-357450fcfc13</clTRID>
            <svTRID>CNIC-4DE6209B97F6572B4C7A90B13ED17B3F0235778891E0043EA15BB78111A</svTRID>
        </trID>
    </response>
</epp>

Expected behaviour
Everything should work and return the info present in the domain

Desktop (please complete the following information):

  • OS: Fedora Linux
  • Version 38

Python version

  • Python 3.11.5

Additional context
Running out of a venv with nothing but pyepp installed.

I have

@ehsan-fj ehsan-fj added the bug Something isn't working label Oct 6, 2023
@ehsan-fj
Copy link
Member

ehsan-fj commented Oct 6, 2023

Thanks for submitting the issue. That's definitely a typo in the code and a bug. It will be fixed soon.

@tmuncks
Copy link
Author

tmuncks commented Oct 6, 2023

Cool, thanks

@ehsan-fj ehsan-fj linked a pull request Oct 8, 2023 that will close this issue
@ehsan-fj
Copy link
Member

ehsan-fj commented Oct 8, 2023

Fixed in version 0.0.5

@ehsan-fj ehsan-fj closed this as completed Oct 8, 2023
@tmuncks
Copy link
Author

tmuncks commented Oct 9, 2023

Awesome - Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants