Added bug fixes and new functions to openssl.py

It seems that PyBitmessage has also added some new functions and fixed some bugs within the file openssl.py. I've tried to quickly commit most of these over, although I might have missed some. 

A (potential) security issue has been discovered in your implementation of the OpenSSL random function, so I strongly recommend that even if you do not merge this pull request, you add a fix for the security issue. See line #397 of PyBitmessage's modified source code for a full explanation of the security issue: https://github.com/Bitmessage/PyBitmessage/blob/master/src/pyelliptic/openssl.py

    int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);

It should takes 6 args and not 5.