Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
69698f9b
Commit
69698f9b
authored
Feb 09, 2006
by
Juan Lang
Committed by
Alexandre Julliard
Feb 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Fix up decoding.
- don't use the no copy flag when decoding, the lifetime of the buffer to decode isn't guaranteed - remove some extraneous ternary comparisons - fix a comment
parent
02c49561
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
cert.c
dlls/crypt32/cert.c
+5
-7
No files found.
dlls/crypt32/cert.c
View file @
69698f9b
...
...
@@ -552,7 +552,7 @@ static void CRYPT_MemEmptyStore(PWINE_MEMSTORE store)
PWINE_CERT_LIST_ENTRY
cert
,
next
;
EnterCriticalSection
(
&
store
->
cs
);
/* Note that CertFreeCertificateContext calls
Heap
Free on the passed-in
/* Note that CertFreeCertificateContext calls
CryptMem
Free on the passed-in
* pointer if its ref-count reaches zero. That's okay here because there
* aren't any allocated data outside of the WINE_CERT_CONTEXT_REF portion
* of the CertListEntry.
...
...
@@ -1939,15 +1939,13 @@ static PWINE_CERT_CONTEXT CRYPT_CreateCertificateContext(
/* First try to decode it as a signed cert. */
ret
=
CryptDecodeObjectEx
(
X509_ASN_ENCODING
,
X509_CERT
,
pbCertEncoded
,
cbCertEncoded
,
CRYPT_DECODE_ALLOC_FLAG
|
CRYPT_DECODE_NOCOPY_FLAG
,
NULL
,
(
BYTE
*
)
&
signedCert
,
&
size
);
cbCertEncoded
,
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
BYTE
*
)
&
signedCert
,
&
size
);
if
(
ret
)
{
size
=
0
;
ret
=
CryptDecodeObjectEx
(
X509_ASN_ENCODING
,
X509_CERT_TO_BE_SIGNED
,
signedCert
->
ToBeSigned
.
pbData
,
signedCert
->
ToBeSigned
.
cbData
,
CRYPT_DECODE_ALLOC_FLAG
|
CRYPT_DECODE_NOCOPY_FLAG
,
NULL
,
(
BYTE
*
)
&
certInfo
,
&
size
);
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
BYTE
*
)
&
certInfo
,
&
size
);
LocalFree
(
signedCert
);
}
/* Failing that, try it as an unsigned cert */
...
...
@@ -2241,7 +2239,7 @@ static BOOL CRYPT_SaveCertificateContextProperty(PWINE_CERT_CONTEXT context,
{
CryptMemFree
(
prop
->
pbData
);
prop
->
hdr
.
cb
=
cbData
;
prop
->
pbData
=
cbData
?
data
:
NULL
;
prop
->
pbData
=
data
;
ret
=
TRUE
;
}
else
...
...
@@ -2253,7 +2251,7 @@ static BOOL CRYPT_SaveCertificateContextProperty(PWINE_CERT_CONTEXT context,
prop
->
hdr
.
unknown
=
1
;
prop
->
hdr
.
cb
=
cbData
;
list_init
(
&
prop
->
entry
);
prop
->
pbData
=
cbData
?
data
:
NULL
;
prop
->
pbData
=
data
;
list_add_tail
(
&
context
->
extendedProperties
,
&
prop
->
entry
);
ret
=
TRUE
;
}
...
...
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