Browse Source

z/OS support: Fix errors

* Fixing freeing the buffers
* Fixing the parameters
master
David Lanzendörfer 11 months ago
parent
commit
e9d3811771
1 changed files with 27 additions and 26 deletions
  1. +27
    -26
      src/packet-parse.c

+ 27
- 26
src/packet-parse.c View File

@ -1079,7 +1079,7 @@ pgp_free_sig_info(pgp_sig_info_t *info)
#if defined(HAVE_OPENSSL)
BN_free(info->sig.rsa.sig);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&info->sig.rsa.sig);
gsk_free_buffer(info->sig.rsa.sig);
#endif
info->sig.rsa.sig=NULL;
break;
@ -1089,8 +1089,8 @@ pgp_free_sig_info(pgp_sig_info_t *info)
BN_free(info->sig.dsa.r);
BN_free(info->sig.dsa.s);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&info->sig.dsa.r);
gsk_free_buffer(&info->sig.dsa.s);
gsk_free_buffer(info->sig.dsa.r);
gsk_free_buffer(info->sig.dsa.s);
#endif
info->sig.dsa.r=NULL;
info->sig.dsa.s=NULL;
@ -1101,8 +1101,8 @@ pgp_free_sig_info(pgp_sig_info_t *info)
BN_free(info->sig.elgamal.r);
BN_free(info->sig.elgamal.s);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&info->sig.elgamal.r);
gsk_free_buffer(&info->sig.elgamal.s);
gsk_free_buffer(info->sig.elgamal.r);
gsk_free_buffer(info->sig.elgamal.s);
#endif
info->sig.elgamal.r=NULL;
info->sig.elgamal.s=NULL;
@ -1334,7 +1334,7 @@ pgp_pk_sesskey_free(pgp_pk_sesskey_t *sk)
#if defined(HAVE_OPENSSL)
BN_free(sk->params.rsa.encrypted_m);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&sk->params.rsa.encrypted_m);
gsk_free_buffer(sk->params.rsa.encrypted_m);
#endif
sk->params.rsa.encrypted_m=NULL;
break;
@ -1344,8 +1344,8 @@ pgp_pk_sesskey_free(pgp_pk_sesskey_t *sk)
BN_free(sk->params.elgamal.g_to_k);
BN_free(sk->params.elgamal.encrypted_m);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&sk->params.elgamal.g_to_k);
gsk_free_buffer(&sk->params.elgamal.encrypted_m);
gsk_free_buffer(sk->params.elgamal.g_to_k);
gsk_free_buffer(sk->params.elgamal.encrypted_m);
#endif
sk->params.elgamal.g_to_k=NULL;
sk->params.elgamal.encrypted_m=NULL;
@ -1373,8 +1373,8 @@ pgp_pubkey_free(pgp_pubkey_t *p)
BN_free(p->key.rsa.n);
BN_free(p->key.rsa.e);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&p->key.rsa.n);
gsk_free_buffer(&p->key.rsa.e);
gsk_free_buffer(p->key.rsa.n);
gsk_free_buffer(p->key.rsa.e);
#endif
p->key.rsa.n=NULL;
p->key.rsa.e=NULL;
@ -1387,10 +1387,10 @@ pgp_pubkey_free(pgp_pubkey_t *p)
BN_free(p->key.dsa.g);
BN_free(p->key.dsa.y);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&p->key.dsa.p);
gsk_free_buffer(&p->key.dsa.q);
gsk_free_buffer(&p->key.dsa.g);
gsk_free_buffer(&p->key.dsa.y);
gsk_free_buffer(p->key.dsa.p);
gsk_free_buffer(p->key.dsa.q);
gsk_free_buffer(p->key.dsa.g);
gsk_free_buffer(p->key.dsa.y);
#endif
p->key.dsa.p=NULL;
p->key.dsa.q=NULL;
@ -1405,9 +1405,9 @@ pgp_pubkey_free(pgp_pubkey_t *p)
BN_free(p->key.elgamal.g);
BN_free(p->key.elgamal.y);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&p->key.elgamal.p);
gsk_free_buffer(&p->key.elgamal.g);
gsk_free_buffer(&p->key.elgamal.y);
gsk_free_buffer(p->key.elgamal.p);
gsk_free_buffer(p->key.elgamal.g);
gsk_free_buffer(p->key.elgamal.y);
#endif
p->key.elgamal.p=NULL;
p->key.elgamal.g=NULL;
@ -1419,7 +1419,7 @@ pgp_pubkey_free(pgp_pubkey_t *p)
#if defined(HAVE_OPENSSL)
BN_free(p->key.ecdh.x);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&p->key.ecdh.x);
gsk_free_buffer(p->key.ecdh.x);
#endif
p->key.ecdh.x=NULL;
break;
@ -1880,6 +1880,8 @@ parse_one_sig_subpacket(pgp_sig_t *sig,
unsigned doread = 1;
unsigned t8;
unsigned t7;
uint8_t issuer_vers;
pgp_init_subregion(&subregion, region);
if (!limited_read_new_length(&subregion.length, region, stream))
return 0;
@ -1962,7 +1964,6 @@ parse_one_sig_subpacket(pgp_sig_t *sig,
break;
case PGP_PTAG_SS_ISSUER_FPR:
uint8_t issuer_vers;
if (!limread(&issuer_vers, 1, &subregion, stream)) {
return 0;
}
@ -2659,10 +2660,10 @@ pgp_seckey_free(pgp_seckey_t *key)
BN_free(key->key.rsa.q);
BN_free(key->key.rsa.u);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&key->key.rsa.d);
gsk_free_buffer(&key->key.rsa.p);
gsk_free_buffer(&key->key.rsa.q);
gsk_free_buffer(&key->key.rsa.u);
gsk_free_buffer(key->key.rsa.d);
gsk_free_buffer(key->key.rsa.p);
gsk_free_buffer(key->key.rsa.q);
gsk_free_buffer(key->key.rsa.u);
#endif
key->key.rsa.d=NULL;
key->key.rsa.p=NULL;
@ -2674,7 +2675,7 @@ pgp_seckey_free(pgp_seckey_t *key)
#if defined(HAVE_OPENSSL)
BN_free(key->key.dsa.x);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&key->key.dsa.x);
gsk_free_buffer(key->key.dsa.x);
#endif
key->key.dsa.x=NULL;
break;
@ -3020,14 +3021,14 @@ parse_seckey(pgp_content_enum tag, pgp_region_t *region, pgp_stream_t *stream)
case PGP_PKA_DSA:
if (!limread_mpi(&pkt.u.seckey.key.dsa.x, region, stream) ||
!pgp_dsa_private_check(&pkt.u.seckey)) {
!pgp_dsa_private_check(&pkt.u.seckey.key.dsa)) {
ret = 0;
}
break;
case PGP_PKA_ELGAMAL:
if (!limread_mpi(&pkt.u.seckey.key.elgamal.x, region, stream) ||
!pgp_elgamal_private_check(&pkt.u.seckey)) {
!pgp_elgamal_private_check(&pkt.u.seckey.key.elgamal)) {
ret = 0;
}
break;


Loading…
Cancel
Save