projects
/
shibboleth
/
cpp-xmltooling.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1829607
)
Optimize return values of DER encoding functions.
author
Scott Cantor
<cantor.2@osu.edu>
Fri, 17 Apr 2009 03:30:18 +0000
(
03:30
+0000)
committer
Scott Cantor
<cantor.2@osu.edu>
Fri, 17 Apr 2009 03:30:18 +0000
(
03:30
+0000)
xmltoolingtest/SecurityHelperTest.h
patch
|
blob
|
history
diff --git
a/xmltoolingtest/SecurityHelperTest.h
b/xmltoolingtest/SecurityHelperTest.h
index
7056012
..
01d1b4e
100644
(file)
--- a/
xmltoolingtest/SecurityHelperTest.h
+++ b/
xmltoolingtest/SecurityHelperTest.h
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 2001-200
7
Internet2
+ * Copyright 2001-200
9
Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-82,9
+82,11
@@
public:
TSM_ASSERT("PEM/DER keys did not match", SecurityHelper::matches(key1.get(), key2.get()));
TSM_ASSERT("DER/PKCS12 keys did not match", SecurityHelper::matches(key2.get(), key3.get()));
TSM_ASSERT("PEM/DER keys did not match", SecurityHelper::matches(key1.get(), key2.get()));
TSM_ASSERT("DER/PKCS12 keys did not match", SecurityHelper::matches(key2.get(), key3.get()));
- TSM_ASSERT_EQUALS("Certificate and its key produced different DER encodings",
- SecurityHelper::getDEREncoding(certs[2]), SecurityHelper::getDEREncoding(key1.get())
- );
+ char* enc1 = SecurityHelper::getDEREncoding(*certs[2]);
+ char* enc2 = SecurityHelper::getDEREncoding(*key1.get());
+ TSM_ASSERT("Certificate and its key produced different DER encodings", !strcmp(enc1, enc2));
+ if (enc1) free(enc1);
+ if (enc2) free(enc2);
for_each(certs.begin(), certs.end(), xmltooling::cleanup<XSECCryptoX509>());
certs.clear();
for_each(certs.begin(), certs.end(), xmltooling::cleanup<XSECCryptoX509>());
certs.clear();