mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
Be more consistent about decoding IP addresses in PSM.
This commit is contained in:
parent
647d6033e0
commit
d12d260c6a
2 changed files with 7 additions and 2 deletions
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include "PSMRunnable.h"
|
#include "PSMRunnable.h"
|
||||||
#include "mozilla/Casting.h"
|
#include "mozilla/Casting.h"
|
||||||
|
#include "mozilla/net/DNS.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsIArray.h"
|
#include "nsIArray.h"
|
||||||
#include "nsICertOverrideService.h"
|
#include "nsICertOverrideService.h"
|
||||||
|
|
@ -681,8 +682,10 @@ GetSubjectAltNames(CERTCertificate* nssCert, nsString& allNames)
|
||||||
|
|
||||||
case certIPAddress:
|
case certIPAddress:
|
||||||
{
|
{
|
||||||
char buf[INET6_ADDRSTRLEN];
|
// According to DNS.h, this includes space for the null-terminator
|
||||||
|
char buf[net::kNetAddrMaxCStrBufSize] = {0};
|
||||||
PRNetAddr addr;
|
PRNetAddr addr;
|
||||||
|
memset(&addr, 0, sizeof(addr));
|
||||||
if (current->name.other.len == 4) {
|
if (current->name.other.len == 4) {
|
||||||
addr.inet.family = PR_AF_INET;
|
addr.inet.family = PR_AF_INET;
|
||||||
memcpy(&addr.inet.ip, current->name.other.data, current->name.other.len);
|
memcpy(&addr.inet.ip, current->name.other.data, current->name.other.len);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include "mozilla/NotNull.h"
|
#include "mozilla/NotNull.h"
|
||||||
#include "mozilla/Sprintf.h"
|
#include "mozilla/Sprintf.h"
|
||||||
#include "mozilla/UniquePtr.h"
|
#include "mozilla/UniquePtr.h"
|
||||||
|
#include "mozilla/net/DNS.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsDateTimeFormatCID.h"
|
#include "nsDateTimeFormatCID.h"
|
||||||
|
|
@ -1006,8 +1007,9 @@ ProcessGeneralName(const UniquePLArenaPool& arena, CERTGeneralName* current,
|
||||||
break;
|
break;
|
||||||
case certIPAddress:
|
case certIPAddress:
|
||||||
{
|
{
|
||||||
char buf[INET6_ADDRSTRLEN];
|
|
||||||
PRStatus status = PR_FAILURE;
|
PRStatus status = PR_FAILURE;
|
||||||
|
// According to DNS.h, this includes space for the null-terminator
|
||||||
|
char buf[net::kNetAddrMaxCStrBufSize] = {0};
|
||||||
PRNetAddr addr;
|
PRNetAddr addr;
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
nssComponent->GetPIPNSSBundleString("CertDumpIPAddress", key);
|
nssComponent->GetPIPNSSBundleString("CertDumpIPAddress", key);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue