Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use botan.cert.x509.x509self #63

Open
Dadoum opened this issue May 22, 2023 · 7 comments
Open

Cannot use botan.cert.x509.x509self #63

Dadoum opened this issue May 22, 2023 · 7 comments

Comments

@Dadoum
Copy link
Contributor

Dadoum commented May 22, 2023

Hey, thanks for your work!

However, I can't get botan.cert.x509.x509self to work. When imported, the D compiler is complaining:

../../.dub/packages/botan-1.13.4/botan/source/botan/cert/x509/crl_ent.d(27,18): Error: template instance `RefCounted!CRLEntryImpl` template `RefCounted` is not defined
../../.dub/packages/memutils-1.0.9/memutils/source/memutils/allocators.d(138,29): Error: class `X509CRLImpl` is forward referenced
../../.dub/packages/memutils-1.0.9/memutils/source/memutils/allocators.d(139,20): Error: class `X509CRLImpl` is forward referenced
../../.dub/packages/memutils-1.0.9/memutils/source/memutils/utils.d(38,18): Error: template instance `memutils.allocators.AllocSize!(X509CRLImpl)` error instantiating
../../.dub/packages/memutils-1.0.9/memutils/source/memutils/refcounted.d(31,20):        instantiated from here: `ObjectAllocator!(X509CRLImpl, ThreadMem)`
../../.dub/packages/memutils-1.0.9/memutils/source/memutils/refcounted.d(199,29):        instantiated from here: `opCall!()`
../../.dub/packages/botan-1.13.4/botan/source/botan/cert/x509/x509_crl.d(30,17):        instantiated from here: `RefCounted!(X509CRLImpl, ThreadMem)`
../../.dub/packages/memutils-1.0.9/memutils/source/memutils/refcounted.d(15,2): Error: mixin `memutils.refcounted.RefCounted!(X509CRLImpl, ThreadMem).RefCounted.Embed!(m_object, false)` error instantiating
../../.dub/packages/botan-1.13.4/botan/source/botan/cert/x509/certstor.d(85,28): Error: function `botan.cert.x509.certstor.CertificateStoreInMemory.allSubjects` does not override any function
../../.dub/packages/botan-1.13.4/botan/source/botan/cert/x509/certstor.d(95,30): Error: function `botan.cert.x509.certstor.CertificateStoreInMemory.findCertRef` does not override any function
../../.dub/packages/botan-1.13.4/botan/source/botan/cert/x509/certstor.d(159,28): Error: function `botan.cert.x509.certstor.CertificateStoreOverlay.allSubjects` does not override any function
../../.dub/packages/botan-1.13.4/botan/source/botan/cert/x509/certstor.d(167,30): Error: function `botan.cert.x509.certstor.CertificateStoreOverlay.findCertRef` does not override any function
@etcimon
Copy link
Owner

etcimon commented May 22, 2023

Have you tried latest version of LDC? Which compiler did you use?

@Dadoum
Copy link
Contributor Author

Dadoum commented May 22, 2023

I tried with DMD v2.102.1 and ldc2-f397130d ("LDC 1.32.0-git-f397130 based on DMD v2.102.2 and LLVM 15.0.7"). GDC doesn't work either but that's related to SIMD.

@etcimon
Copy link
Owner

etcimon commented May 22, 2023

Have you tried building the selfsigned example? It seems to work on my end, what does your code look like?

@Dadoum
Copy link
Contributor Author

Dadoum commented May 22, 2023

The self-signed example works.

This code doesn't:

#!/usr/bin/env dub
/+ dub.sdl:
        name "botan_test"
        dependency "botan" version="~>1.13.4"
+/

    import botan.cert.x509.x509self;
    import botan.pubkey.algo.rsa;
    import botan.pubkey.pkcs8: BER_encode;
    import botan.rng.rng;

void main() {
        import std.stdio : writeln;
        writeln("Hello, World!");
}

@Dadoum
Copy link
Contributor Author

Dadoum commented May 22, 2023

Okay, adding the other imports in the example made it work, thanks. I keep the issue open if you want to add a static assert with a better error message, otherwise you can close it.

@etcimon
Copy link
Owner

etcimon commented May 22, 2023

I was thinking it might be a compiler bug related to the imports, I'll try and isolate it later.

@bagomot
Copy link

bagomot commented Nov 4, 2024

The protected access modifier on the X509Object constructor prevents it from being used from another module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants