Keep disclaiming 16-bit platform support. For now remove WIN16 references
[oweals/openssl.git] / crypto / x509 / x509_r2x.c
index ec92d2f8a89329ad8321be54c59aec5b7c9d3145..fb8a78dabebf963fef3b61af9b391b03036320de 100644 (file)
@@ -80,9 +80,9 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
        /* duplicate the request */
        xi=ret->cert_info;
 
-       if (sk_num(r->req_info->attributes) != 0)
+       if (sk_X509_ATTRIBUTE_num(r->req_info->attributes) != 0)
                {
-               if ((xi->version=ASN1_INTEGER_new()) == NULL) goto err;
+               if ((xi->version=M_ASN1_INTEGER_new()) == NULL) goto err;
                if (!ASN1_INTEGER_set(xi->version,2)) goto err;
 /*             xi->extensions=ri->attributes; <- bad, should not ever be done
                ri->attributes=NULL; */
@@ -92,8 +92,10 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
        X509_set_subject_name(ret,X509_NAME_dup(xn));
        X509_set_issuer_name(ret,X509_NAME_dup(xn));
 
-       X509_gmtime_adj(xi->validity->notBefore,0);
-       X509_gmtime_adj(xi->validity->notAfter,(long)60*60*24*days);
+       if (X509_gmtime_adj(xi->validity->notBefore,0) == NULL)
+               goto err;
+       if (X509_gmtime_adj(xi->validity->notAfter,(long)60*60*24*days) == NULL)
+               goto err;
 
        X509_set_pubkey(ret,X509_REQ_get_pubkey(r));