Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
519478e0
Commit
519478e0
authored
Dec 19, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Dec 20, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Fix encoding OIDs with only two components.
parent
fa65c3f6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
encode.c
dlls/crypt32/encode.c
+6
-1
encode.c
dlls/crypt32/tests/encode.c
+5
-0
No files found.
dlls/crypt32/encode.c
View file @
519478e0
...
@@ -796,7 +796,7 @@ BOOL WINAPI CRYPT_AsnEncodeOid(DWORD dwCertEncodingType,
...
@@ -796,7 +796,7 @@ BOOL WINAPI CRYPT_AsnEncodeOid(DWORD dwCertEncodingType,
const
char
*
ptr
;
const
char
*
ptr
;
int
val1
,
val2
;
int
val1
,
val2
;
if
(
sscanf
(
pszObjId
,
"%d.%d
.
%n"
,
&
val1
,
&
val2
,
&
firstPos
)
!=
2
)
if
(
sscanf
(
pszObjId
,
"%d.%d%n"
,
&
val1
,
&
val2
,
&
firstPos
)
!=
2
)
{
{
SetLastError
(
CRYPT_E_ASN1_ERROR
);
SetLastError
(
CRYPT_E_ASN1_ERROR
);
return
FALSE
;
return
FALSE
;
...
@@ -804,6 +804,11 @@ BOOL WINAPI CRYPT_AsnEncodeOid(DWORD dwCertEncodingType,
...
@@ -804,6 +804,11 @@ BOOL WINAPI CRYPT_AsnEncodeOid(DWORD dwCertEncodingType,
bytesNeeded
++
;
bytesNeeded
++
;
firstByte
=
val1
*
40
+
val2
;
firstByte
=
val1
*
40
+
val2
;
ptr
=
pszObjId
+
firstPos
;
ptr
=
pszObjId
+
firstPos
;
if
(
*
ptr
==
'.'
)
{
ptr
++
;
firstPos
++
;
}
while
(
ret
&&
*
ptr
)
while
(
ret
&&
*
ptr
)
{
{
int
pos
;
int
pos
;
...
...
dlls/crypt32/tests/encode.c
View file @
519478e0
...
@@ -2536,17 +2536,22 @@ static CERT_EXTENSION criticalExt =
...
@@ -2536,17 +2536,22 @@ static CERT_EXTENSION criticalExt =
{
oid_basic_constraints2
,
TRUE
,
{
8
,
crit_ext_data
}
};
{
oid_basic_constraints2
,
TRUE
,
{
8
,
crit_ext_data
}
};
static
CERT_EXTENSION
nonCriticalExt
=
static
CERT_EXTENSION
nonCriticalExt
=
{
oid_basic_constraints2
,
FALSE
,
{
8
,
noncrit_ext_data
}
};
{
oid_basic_constraints2
,
FALSE
,
{
8
,
noncrit_ext_data
}
};
static
CHAR
oid_short
[]
=
"1.1"
;
static
CERT_EXTENSION
extWithShortOid
=
{
oid_short
,
FALSE
,
{
0
,
NULL
}
};
static
const
BYTE
ext0
[]
=
{
0x30
,
0x00
};
static
const
BYTE
ext0
[]
=
{
0x30
,
0x00
};
static
const
BYTE
ext1
[]
=
{
0x30
,
0x14
,
0x30
,
0x12
,
0x06
,
0x03
,
0x55
,
0x1d
,
0x13
,
0x01
,
0x01
,
static
const
BYTE
ext1
[]
=
{
0x30
,
0x14
,
0x30
,
0x12
,
0x06
,
0x03
,
0x55
,
0x1d
,
0x13
,
0x01
,
0x01
,
0xff
,
0x04
,
0x08
,
0x30
,
0x06
,
0x01
,
0x01
,
0xff
,
0x02
,
0x01
,
0x01
};
0xff
,
0x04
,
0x08
,
0x30
,
0x06
,
0x01
,
0x01
,
0xff
,
0x02
,
0x01
,
0x01
};
static
const
BYTE
ext2
[]
=
{
0x30
,
0x11
,
0x30
,
0x0f
,
0x06
,
0x03
,
0x55
,
0x1d
,
0x13
,
0x04
,
static
const
BYTE
ext2
[]
=
{
0x30
,
0x11
,
0x30
,
0x0f
,
0x06
,
0x03
,
0x55
,
0x1d
,
0x13
,
0x04
,
0x08
,
0x30
,
0x06
,
0x01
,
0x01
,
0xff
,
0x02
,
0x01
,
0x01
};
0x08
,
0x30
,
0x06
,
0x01
,
0x01
,
0xff
,
0x02
,
0x01
,
0x01
};
static
const
BYTE
ext3
[]
=
{
0x30
,
0x07
,
0x30
,
0x05
,
0x06
,
0x01
,
0x29
,
0x04
,
0x00
};
static
const
struct
encodedExtensions
exts
[]
=
{
static
const
struct
encodedExtensions
exts
[]
=
{
{
{
0
,
NULL
},
ext0
},
{
{
0
,
NULL
},
ext0
},
{
{
1
,
&
criticalExt
},
ext1
},
{
{
1
,
&
criticalExt
},
ext1
},
{
{
1
,
&
nonCriticalExt
},
ext2
},
{
{
1
,
&
nonCriticalExt
},
ext2
},
{
{
1
,
&
extWithShortOid
},
ext3
}
};
};
static
void
test_encodeExtensions
(
DWORD
dwEncoding
)
static
void
test_encodeExtensions
(
DWORD
dwEncoding
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment