| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Add a push_back that takes a single argument ala std::vector
For appending, provide some namespace level += operators - we can use
this technique with either MemoryRegion or a std::vector.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the initial/default length of the array, update all users to instead
pass the value to the constructor.
This is a old vestigal thing from a class (SecureBuffer) that used
this compile-time constant in order to store the values in an
array. However this was changed way back in 2002 to use the same
allocator hooks as the rest of the containers, so the only advantage
to using the length field was that the initial length was set and
didn't have to be set in the constructor which was midly convenient.
However this directly conflicts with the desire to be able to
(eventually) use std::vector with a custom allocator, since of course
vector doesn't support this.
Fortunately almost all of the uses are in classes which have only a
single constructor, so there is little to no duplication by instead
initializing the size in the constructor.
|
| |
|
|
|
|
|
|
| |
Avoid using using directives in MemoryVector and SecureVector to bring
things into scope; it brings them into public scope even if they are
protected which is not desirable. Instead disambiguate using this->func()
|
| |
|
|
|
|
| |
MemoryRegions and concatenated them.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Add RandomNumberGenerator::random_vec, which takes an length n and
returns a new SecureVector with randomized contents of that size. This
nicely covers most of the cases where randomize was being called on a
vector, and is a little cleaner in the code as well, instead of
vec.resize(length);
rng.randomize(&vec[0], vec.size());
we just write
vec = rng.random_vec(length);
|
| |
|
|
|
|
|
| |
representation (rather than in an interator context), instead use &buf[0],
which works for both MemoryRegion and std::vector
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
destructor function which would delete the engine; this was to handle
the case that the heaps were not shared between the application and
the library. However in this case we have bigger problems, because we
want to be able to pass std::strings into the engine, and additionally
be able to return objects from the library which are later deleted by
the algorithm factory. So without a major restructuring we can't
support this style of operation anyway; the DLL and application must
share the same heap. This can be done on Windows using the /MD linking
scheme for both the library and the DLL. The library already uses this
model by default on Windows.
|
| |
|
|
|
|
|
|
| |
pointer to a nonce struct; presumably for slightly better typechecking.
In case we're compiling under such a mode, case the first argument to
FreeLibrary and GetProcAddress to a HMODULE.
|
|
|
|
| |
the directory when building a DLL
|
|
|
|
|
| |
Use a slightly cleaner invocation that doesn't require duplicating so much
code between the binary and non-binary cases.
|
|
|
|
| |
Tested against a GnuTLS server.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
harmonising MemoryRegion with std::vector:
The MemoryRegion::clear() function would zeroise the buffer, but keep
the memory allocated and the size unchanged. This is very different
from STL's clear(), which is basically the equivalent to what is
called destroy() in MemoryRegion. So to be able to replace MemoryRegion
with a std::vector, we have to rename destroy() to clear() and we have
to expose the current functionality of clear() in some other way, since
vector doesn't support this operation. Do so by adding a global function
named zeroise() which takes a MemoryRegion which is zeroed. Remove clear()
to ensure all callers are updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
container like vector, truncate is simply resize, but what
MemoryRegion called resize will zap the entire contents, and then what
was resize was called grow_to. This is really problematic in terms of
the goal of replacing MemoryRegion with a vector with a custom
allocator.
In this checkin:
- Remove MemoryRegion::grow_to and MemoryRegion::truncate
- Change the semantics of MemoryRegion::resize to change the size
while keeping any current contents intact (up to the new size),
zero initializing any new values.
Unrelated, just noticed the lack while I was in there, add a version
of CryptoBox::decrypt taking a std::string for the input.
|
| |
|
|
|
|
|
| |
amount of value. Add a note that -library=stlport4 may be needed on
Linux (seems to depend on glibc version).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Also use -xO5 instead of -xO2; everything seems to work under -xO5 on
x86-32 and x86-64 with my version of Sun Studio. Curiously, several things
are miscompiled with -xO2! Definitely doesn't give me positive feelings
about this optimizer.
|
| |
|
|
|
|
|
| |
to fix compilation on Solaris. Everybody else, including POSIX.1, uses
void* here, but as usual Solaris likes to be special.
|
| |
|
|
|
|
|
| |
way to create a static library using Sun Studio is to invoke the
compiler with the -xar flag.
|
|
|
|
|
|
| |
priorities slightly, pushing netstat -s and netstat -an higher since
they change freqently and don't have a huge amount of output. Use the
-n flag with lsof, which inhibits name lookups which we don't need.
|
| |
|
| |
|
|
|
|
| |
to avoid a Sun Studio bug.
|
|
|
|
|
| |
various compilers/platforms, and likely doesn't contribute much of
anything. Also only grab real uid and gid, ignoring effective ids.
|
|
|
|
| |
checkin.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
really didn't need to.
The ones in symkey and big_code were actually calling accessor
functions to do the encoding themselves without a Pipe (should have
definitely recognized that as a code smell). These versions have
changed semantically with this checkin - previously they would completely
ignore bad inputs, but now invalid inputs are rejected. For instance, you
cannot say
SymmetricKey key("Only some of this is hex, most of it isn't");
And expect to get a valid key formed by filtering out the non-hex
characters and then decoding it. This is almost certainly a good thing.
Also fix include in Botan.xs
|
|
|
|
| |
Required by the hex decoder.
|
|
|
|
|
|
|
|
| |
in terms of these calls.
The header for the hex filter is renamed hex_filt.h. This probably
won't affect people because filters.h (included by botan.h) already
included hex.h, and now just includes hex_filt.h instead.
|
|
|
|
|
|
|
| |
allowed by the standard, however specializing it is. Fix this for
BigInt; it appears the Flexsecure guys knew this since the CurveGFp
and PointGFp classes already uses the template specialization rather
than an overload.
|
|
|
|
|
| |
IA-64 (and, hypothetically, any other 64 bit CPU Visual C++ might
target in the future).
|
|
|
|
| |
yet tested.
|