diff options
author | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-02-13 13:09:26 +0000 |
---|---|---|
committer | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-02-13 13:09:26 +0000 |
commit | 5e2a679a46e2164f8b38b71132787c3327862957 (patch) | |
tree | 4ab99602f4f8adec2a96194abd4a39c48e0fab00 /ossl_x509attr.c | |
parent | 1ad093352e953cabd70c851989ce06edc233d5f4 (diff) | |
download | ruby-openssl-history-5e2a679a46e2164f8b38b71132787c3327862957.tar.gz |
* transition from rb_raise to OSSL_Raise (where possible)
* some mem checks
* preliminary DH key support
Diffstat (limited to 'ossl_x509attr.c')
-rw-r--r-- | ossl_x509attr.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/ossl_x509attr.c b/ossl_x509attr.c index ba98045..8446afe 100644 --- a/ossl_x509attr.c +++ b/ossl_x509attr.c @@ -47,32 +47,21 @@ ossl_x509attr_free(ossl_x509attr *attrp) * public */ VALUE -ossl_x509attr_new_null(void) -{ - ossl_x509attr *attrp = NULL; - VALUE obj; - - MakeX509Attr(obj, attrp); - - if (!(attrp->attribute = X509_ATTRIBUTE_new())) - OSSL_Raise(eX509AttributeError, ""); - - return obj; -} - -VALUE ossl_x509attr_new(X509_ATTRIBUTE *attr) { ossl_x509attr *attrp = NULL; + X509_ATTRIBUTE *new = NULL; VALUE obj; if (!attr) - return ossl_x509attr_new_null(); - - MakeX509Attr(obj, attrp); + new = X509_ATTRIBUTE_new(); + else new = X509_ATTRIBUTE_dup(attr); - if (!(attrp->attribute = X509_ATTRIBUTE_dup(attr))) + if (!new) OSSL_Raise(eX509AttributeError, ""); + + MakeX509Attr(obj, attrp); + attrp->attribute = new; return obj; } |