[Botan-devel] Having problem with VC .NET 2003
Jack Lloyd
lloyd at randombit.net
Sun Apr 22 23:07:38 EDT 2007
Yeah, It's a bug in VC 2003 (fixed in 2005, by all reports and by my
own testing).
A patch is attached, which I did blindly (as I don't have 2003) but
which at least one user confirmed worked for them. It was against
1.6.1 IIRC, but should apply clean to 1.6.2 or 1.7.0.
-Jack
On Mon, Apr 23, 2007 at 11:55:29AM +0900, Eunsoo Roh wrote:
>
> I'm using Visual Studio .NET 2003 Professional version 7.1.6030 and MS Program Maintenance Utility version 7.10.3077. First, I tried configuring and building Botan 1.6.2. Configuration just went fine, but I got errors when I tried to compile with nmake.
>
> src\x509stat.cpp(53) : error C2326: 'Botan::Certificate_Extension *Botan::X509_GlobalState::__ctor::Key_Usage_Prototype::make(const Botan::OID &)' : function cannot access 'Botan::OIDS'
> src\x509stat.cpp(53) : error C2326: 'Botan::Certificate_Extension *Botan::X509_GlobalState::__ctor::Key_Usage_Prototype::make(const Botan::OID &)' : function cannot access 'Botan::Cert_Extension'
> .
> .
> src\x509stat.cpp(61) : error C2326: 'Botan::Certificate_Extension *Botan::X509_GlobalState::__ctor::Certificate_Policies_Prototype::make(const Botan::OID &)' : function cannot access 'Botan::Cert_Extension'
> NMAKE : fatal error U1077: 'cl' : return code '0x2'
> Stop.
>
> There were eighteen errors before termination. All of them are error C2326 and they say it is unable to access Botan::OIDS or Botan::Cert_Extension. Building Botan 1.7.0 resulted same. The only stable version worked for me is Botan 1.4.12. I have no idea at all about why this happens. Please help.
> _________________________________________________________________
> Connect to the next generation of MSN Messenger?
> http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://www.randombit.net/mailman/listinfo/botan-devel
-------------- next part --------------
#
# old_revision [d540710c8bfd8b2619439c5a315b7a91648279f7]
#
# patch "src/x509stat.cpp"
# from [b130151797ab920e8508203fd382c49100d8d86e]
# to [2f2f18595df37bf2580e6744241e737bf92db2a8]
#
============================================================
--- src/x509stat.cpp b130151797ab920e8508203fd382c49100d8d86e
+++ src/x509stat.cpp 2f2f18595df37bf2580e6744241e737bf92db2a8
@@ -29,38 +29,47 @@ Certificate_Extension* X509_GlobalState:
return extension;
}
+namespace {
+
+#define CREATE_PROTOTYPE(NAME, TYPE) \
+ struct TYPE ## _Prototype : public Extension_Prototype \
+ { \
+ Certificate_Extension* make(const OID& oid) \
+ { \
+ if(OIDS::name_of(oid, NAME)) \
+ return new Cert_Extension::TYPE(); \
+ return 0; \
+ } \
+ };
+
+CREATE_PROTOTYPE("X509v3.KeyUsage", Key_Usage);
+CREATE_PROTOTYPE("X509v3.BasicConstraints", Basic_Constraints);
+CREATE_PROTOTYPE("X509v3.SubjectKeyIdentifier", Subject_Key_ID);
+CREATE_PROTOTYPE("X509v3.AuthorityKeyIdentifier", Authority_Key_ID);
+CREATE_PROTOTYPE("X509v3.ExtendedKeyUsage", Extended_Key_Usage);
+CREATE_PROTOTYPE("X509v3.IssuerAlternativeName", Issuer_Alternative_Name);
+CREATE_PROTOTYPE("X509v3.SubjectAlternativeName", Subject_Alternative_Name);
+CREATE_PROTOTYPE("X509v3.CRLNumber", CRL_Number);
+CREATE_PROTOTYPE("X509v3.CertificatePolicies", Certificate_Policies);
+
+#undef CREATE_PROTOTYPE
+
+}
+
/*************************************************
* Set up a new global state for X.509 *
*************************************************/
X509_GlobalState::X509_GlobalState()
{
-
-#define CREATE_PROTOTYPE(NAME, TYPE) \
- do { \
- struct TYPE ## _Prototype : public Extension_Prototype \
- { \
- Certificate_Extension* make(const OID& oid) \
- { \
- if(OIDS::name_of(oid, NAME)) \
- return new Cert_Extension::TYPE(); \
- return 0; \
- } \
- }; \
- \
- add(new TYPE ## _Prototype); \
- } while(0);
-
- CREATE_PROTOTYPE("X509v3.KeyUsage", Key_Usage);
- CREATE_PROTOTYPE("X509v3.BasicConstraints", Basic_Constraints);
- CREATE_PROTOTYPE("X509v3.SubjectKeyIdentifier", Subject_Key_ID);
- CREATE_PROTOTYPE("X509v3.AuthorityKeyIdentifier", Authority_Key_ID);
- CREATE_PROTOTYPE("X509v3.ExtendedKeyUsage", Extended_Key_Usage);
- CREATE_PROTOTYPE("X509v3.IssuerAlternativeName", Issuer_Alternative_Name);
- CREATE_PROTOTYPE("X509v3.SubjectAlternativeName", Subject_Alternative_Name);
- CREATE_PROTOTYPE("X509v3.CRLNumber", CRL_Number);
- CREATE_PROTOTYPE("X509v3.CertificatePolicies", Certificate_Policies);
-
-#undef CREATE_PROTOTYPE
+ add(new Key_Usage_Prototype);
+ add(new Basic_Constraints_Prototype);
+ add(new Subject_Key_ID_Prototype);
+ add(new Authority_Key_ID_Prototype);
+ add(new Extended_Key_Usage_Prototype);
+ add(new Issuer_Alternative_Name_Prototype);
+ add(new Subject_Alternative_Name_Prototype);
+ add(new CRL_Number_Prototype);
+ add(new Certificate_Policies_Prototype);
}
/*************************************************
More information about the botan-devel
mailing list