Bug in libssl-dev package, pem.h

Bug #692589 reported by Alexander Kabakow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openssl (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: openssl

Error when tring to compile that code:

#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/pem.h>

SSL *p_ssl

BIO *p_mem_bio;
SSL_SESSION *p_session;

PEM_write_bio_SSL_SESSION(p_mem_bio, p_session);

We have complie error

error: invalid conversion from ‘void*’ to ‘char*’
error: initializing argument 4 of ‘int PEM_ASN1_write_bio(int (*)(void*, unsigned char**), const char*, BIO*, char*, const EVP_CIPHER*, unsigned char*, int, int (*)(char*, int, int, void*), void*)’

Revision history for this message
Alexander Kabakow (alexzak) wrote :

Here is declaration of PEM_ASN1_write_bio function:

int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp,char *x,
      const EVP_CIPHER *enc,unsigned char *kstr,int klen,
      pem_password_cb *cb, void *u);

And argument 4 type is char*, but

macro CHECKED_PTR_OF produces void*, and produces compile error

Revision history for this message
Alexander Kabakow (alexzak) wrote :

I think declaration of macro PEM_ASN1_write_bio_of in pem.h:595 should be

#define PEM_ASN1_write_bio_of(type,i2d,name,bp,x,enc,kstr,klen,cb,u) \
    (PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d), \
   name, bp, \
   (char*)CHECKED_PTR_OF(type, x), \
   enc, kstr, klen, cb, u))

Revision history for this message
Adrien Nader (adrien) wrote :

I've tried to reproduce the issue (thanks for the reproducer!) and didn't manage to. I'm not sure the API is still there and in the same form but also, pem.h is vastly different and much much simpler. I think there's nothing to do and this bug should be WONTFIX.

Nick Rosbrook (enr0n)
Changed in openssl (Ubuntu):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.