mirror of
https://github.com/chris2511/xca.git
synced 2026-09-14 11:06:19 +05:00
add support for statically and dynamically linked libraries
remove 2 memleaks
This commit is contained in:
parent
542d2981ab
commit
dc15434e09
8
Makefile
8
Makefile
@ -18,9 +18,11 @@ bindir=bin
|
||||
all: headers xca doc
|
||||
re: clean all
|
||||
|
||||
xca: $(OBJECTS)
|
||||
$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o xca
|
||||
#$(CC) $(CPPFLAGS) ../mingw/qt/lib/qt-mt230nc.lib ../mingw/qt/lib/qtmain.lib main.cpp -o main
|
||||
xca.o: $(OBJECTS)
|
||||
$(LD) $(LDFLAGS) $(OBJECTS) $(SLIBS) -r -o $@
|
||||
|
||||
xca: xca.o
|
||||
$(CC) $(LDFLAGS) $< $(LIBS) -o $@
|
||||
@echo -e "\n\n\nOk, compilation was successfull. \nNow do as root: 'make install'\n"
|
||||
|
||||
headers:
|
||||
|
||||
15
configure
vendored
15
configure
vendored
@ -52,7 +52,11 @@ add_include() {
|
||||
}
|
||||
|
||||
add_lib() {
|
||||
LIBS="$LIBS -l$2"
|
||||
if test "$3" = "a"; then
|
||||
SLIBS="$SLIBS -l$2"
|
||||
else
|
||||
LIBS="$LIBS -l$2"
|
||||
fi
|
||||
for _libs in -L/usr/lib ${LDIRS}; do
|
||||
if test "-L$1" = "${_libs}"; then
|
||||
return 0
|
||||
@ -80,9 +84,9 @@ search_includes() {
|
||||
search_lib() {
|
||||
for dir in ${DIRS}; do
|
||||
for dbn in $@; do
|
||||
for suffix in so dylib obj; do
|
||||
for suffix in so dylib obj a; do
|
||||
if test -r ${dir}/lib/lib${dbn}.${suffix}; then
|
||||
add_lib ${dir}/lib ${dbn};
|
||||
add_lib ${dir}/lib ${dbn} ${suffix};
|
||||
echo Found: lib${dbn}.${suffix} at ${dir}/lib
|
||||
return 0
|
||||
fi
|
||||
@ -165,6 +169,11 @@ CPPFLAGS=$CF
|
||||
CFLAGS=${CFLAGS}
|
||||
|
||||
LDFLAGS=$LDIRS
|
||||
|
||||
# List of all libs to be compiled statically
|
||||
SLIBS=$SLIBS
|
||||
|
||||
# list of dynamic libraries
|
||||
LIBS=$LIBS
|
||||
|
||||
MOC=$MOC
|
||||
|
||||
11
doc/Makefile
11
doc/Makefile
@ -6,15 +6,16 @@ all: doc
|
||||
mandir=man
|
||||
doc: xca.1.gz xca.html
|
||||
|
||||
xca.1.gz:
|
||||
gzip -9 <xca.1 >$@
|
||||
xca.1.gz: xca.1
|
||||
gzip -9 <$^ >$@
|
||||
|
||||
xca.1:
|
||||
cat xca.man |sed s/MY_VERSION/$(VERSION)/g >doc/xca.1
|
||||
xca.1: xca.man
|
||||
cat $^ | sed s/MY_VERSION/$(VERSION)/g > $@
|
||||
|
||||
xca.html: xca.sgml
|
||||
linuxdoc -B html $< || true
|
||||
|
||||
install: xca.1.gz
|
||||
install: xca.1.gz xca.html
|
||||
install -m 755 -d $(destdir)$(prefix)/share/xca \
|
||||
$(destdir)$(prefix)/$(mandir)/man1
|
||||
install -m 644 xca*.html $(destdir)$(prefix)/share/xca
|
||||
|
||||
@ -195,7 +195,7 @@ unsigned char *pki_x509req::toData(int *size)
|
||||
}
|
||||
void pki_x509req::writeDefault(const QString fname)
|
||||
{
|
||||
writeReq(fname + QDir::separator() + getIntName() + ".req", true);
|
||||
writeReq(fname + QDir::separator() + getIntName() + ".csr", true);
|
||||
}
|
||||
|
||||
void pki_x509req::writeReq(const QString fname, bool PEM)
|
||||
|
||||
@ -104,13 +104,12 @@ QString x509name::getEntryByNid(int nid) const
|
||||
|
||||
QString x509name::getEntry(int i) const
|
||||
{
|
||||
QString s;
|
||||
QString s, ret;
|
||||
ASN1_STRING *d;
|
||||
|
||||
if ( i<0 || i>entryCount() ) return s;
|
||||
d = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(xn,i));
|
||||
|
||||
QString ret;
|
||||
|
||||
if (d->type == V_ASN1_BMPSTRING) {
|
||||
for (int i=0;i<d->length;i+=2)
|
||||
ret+=QChar((unsigned short)d->data[i]*256+
|
||||
@ -120,6 +119,8 @@ QString x509name::getEntry(int i) const
|
||||
ret=QString::fromUtf8((const char *)d->data,d->length);
|
||||
else
|
||||
ret=QString::fromLatin1((const char *)d->data,d->length);
|
||||
|
||||
ASN1_STRING_free(d);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -142,8 +143,12 @@ QStringList x509name::entryList(int i) const
|
||||
int x509name::nid(int i) const
|
||||
{
|
||||
X509_NAME_ENTRY *ne;
|
||||
int nid;
|
||||
|
||||
ne = sk_X509_NAME_ENTRY_value(xn->entries, i);
|
||||
return OBJ_obj2nid(ne->object);
|
||||
nid = OBJ_obj2nid(ne->object);
|
||||
X509_NAME_ENTRY_free(ne);
|
||||
return nid;
|
||||
}
|
||||
|
||||
unsigned char *x509name::d2i(const unsigned char *p, int size)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user