From 454b754f7f9697c59643d7bd6ff07d6d38b50533 Mon Sep 17 00:00:00 2001 From: Pinga Date: Mon, 28 Apr 2025 16:59:04 +0300 Subject: [PATCH] More RST fixes --- automation/escrow.php | 26 ++++++++++++++++---------- automation/helpers.php | 10 ++++++++++ epp/start_epp.php | 2 +- rdap/rdap_limited.php | 1 + rdap/start_rdap.php | 1 + 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/automation/escrow.php b/automation/escrow.php index b096299..0e4178d 100644 --- a/automation/escrow.php +++ b/automation/escrow.php @@ -191,7 +191,10 @@ try { $stmt->bindParam(':domain_id', $domain['id']); $stmt->execute(); $status = $stmt->fetch(); - $xml->writeElement('rdeDomain:status', $status['status'] ?? 'okk'); + $xml->startElement('rdeDomain:status'); + $xml->writeAttribute('s', $status['status'] ?? 'ok'); + $xml->text($status['status'] ?? 'ok'); + $xml->endElement(); // Close rdeDomain:status $xml->writeElement('rdeDomain:registrant', $domain['registrant']); @@ -218,8 +221,8 @@ try { } $xml->endElement(); // Closing rdeDomain:ns - $xml->writeElement('rdeDomain:clID', $domain['clid']); - $xml->writeElement('rdeDomain:crRr', $domain['crid']); + $xml->writeElement('rdeDomain:clID', getClid($dbh, $domain['clid'])); + $xml->writeElement('rdeDomain:crRr', getClid($dbh, $domain['crid'])); $crDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $domain['crdate']); $xml->writeElement('rdeDomain:crDate', $crDate->format("Y-m-d\\TH:i:s.v\\Z")); $exDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $domain['exdate']); @@ -244,8 +247,8 @@ try { $xml->text('ok'); $xml->endElement(); // Closing rdeHost:status - $xml->writeElement('rdeHost:clID', $host['clid']); - $xml->writeElement('rdeHost:crRr', $host['crid']); + $xml->writeElement('rdeHost:clID', getClid($dbh, $host['clid'])); + $xml->writeElement('rdeHost:crRr', getClid($dbh, $host['crid'])); $crDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $host['crdate']); $xml->writeElement('rdeHost:crDate', $crDate->format("Y-m-d\\TH:i:s.v\\Z")); $xml->endElement(); // Closing rdeHost:host @@ -289,8 +292,8 @@ try { $xml->writeElement('rdeContact:voice', $contact['voice']); $xml->writeElement('rdeContact:fax', $contact['fax']); $xml->writeElement('rdeContact:email', $contact['email']); - $xml->writeElement('rdeContact:clID', $contact['clid']); - $xml->writeElement('rdeContact:crRr', $contact['crid']); + $xml->writeElement('rdeContact:clID', getClid($dbh, $contact['clid'])); + $xml->writeElement('rdeContact:crRr', getClid($dbh, $contact['crid'])); $crDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $contact['crdate']); $xml->writeElement('rdeContact:crDate', $crDate->format("Y-m-d\\TH:i:s.v\\Z")); if (!empty($contact['upid'])) { @@ -736,7 +739,10 @@ try { $stmt->bindParam(':domain_id', $domain['id']); $stmt->execute(); $status = $stmt->fetch(); - $xml->writeElement('rdeDomain:status', $status['status'] ?? 'okk'); + $xml->startElement('rdeDomain:status'); + $xml->writeAttribute('s', $status['status'] ?? 'ok'); + $xml->text($status['status'] ?? 'ok'); + $xml->endElement(); // Close rdeDomain:status $xml->writeElement('rdeDomain:registrant', $domain['registrant']); @@ -763,8 +769,8 @@ try { } $xml->endElement(); // Closing rdeDomain:ns - $xml->writeElement('rdeDomain:clID', $domain['clid']); - $xml->writeElement('rdeDomain:crRr', $domain['crid']); + $xml->writeElement('rdeDomain:clID', getClid($dbh, $domain['clid'])); + $xml->writeElement('rdeDomain:crRr', getClid($dbh, $domain['crid'])); $crDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $domain['crdate']); $xml->writeElement('rdeDomain:crDate', $crDate->format("Y-m-d\\TH:i:s.v\\Z")); $exDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $domain['exdate']); diff --git a/automation/helpers.php b/automation/helpers.php index 5e26e87..a798b54 100644 --- a/automation/helpers.php +++ b/automation/helpers.php @@ -524,4 +524,14 @@ function generateSerial($soa_type = null) { default: return time(); } +} + +function getClid(PDO $db, int $registrar_id): ?string { + $stmt = $db->prepare("SELECT clid FROM registrar WHERE id = :id LIMIT 1"); + $stmt->bindParam(':id', $registrar_id, PDO::PARAM_INT); + $stmt->execute(); + + $result = $stmt->fetch(PDO::FETCH_ASSOC); + + return $result ? (string)$result['clid'] : null; } \ No newline at end of file diff --git a/epp/start_epp.php b/epp/start_epp.php index 0958a93..61af31c 100644 --- a/epp/start_epp.php +++ b/epp/start_epp.php @@ -75,7 +75,7 @@ $server->set([ 'ssl_verify_peer' => false, 'ssl_allow_self_signed' => false, 'ssl_protocols' => SWOOLE_SSL_TLSv1_2 | SWOOLE_SSL_TLSv1_3, - 'ssl_ciphers' => 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES256-GCM-SHA384', + 'ssl_ciphers' => 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:DHE+AES256:DHE+AES128:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK', ]); $rateLimiter = new Rately(); diff --git a/rdap/rdap_limited.php b/rdap/rdap_limited.php index ec1d95b..e211823 100644 --- a/rdap/rdap_limited.php +++ b/rdap/rdap_limited.php @@ -197,6 +197,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) { // Extract and validate the domain name from the request $domain = urldecode($domainName); $domain = trim($domain); + $domain = strtolower($domain); // Empty domain check if (!$domain) { diff --git a/rdap/start_rdap.php b/rdap/start_rdap.php index a392f17..b699a44 100644 --- a/rdap/start_rdap.php +++ b/rdap/start_rdap.php @@ -197,6 +197,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) { // Extract and validate the domain name from the request $domain = urldecode($domainName); $domain = trim($domain); + $domain = strtolower($domain); // Empty domain check if (!$domain) {