Skip to content

Commit

Permalink
fixed bug from last commit
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Ventura <[email protected]>
  • Loading branch information
eve authored and feventura committed Mar 17, 2024
1 parent 613f310 commit 47b069c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions oqsprov/oqs_encode_key2any.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,11 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder)
buflen = oqsxkey->privkeylen_cmp[i] + oqsxkey->pubkeylen_cmp[i];

buf = OPENSSL_malloc(buflen);

if(get_oqsname_fromtls(name) != 0)//include pubkey in privkey for PQC
memcpy(buf, oqsxkey->comp_privkey[i], buflen);
if(get_oqsname_fromtls(name) != 0){//include pubkey in privkey for PQC
memcpy(buf, oqsxkey->comp_privkey[i], oqsxkey->privkeylen_cmp[i]);
memcpy(buf + oqsxkey->privkeylen_cmp[i], oqsxkey->comp_pubkey[i], oqsxkey->pubkeylen_cmp[i]);
else
}else
memcpy(buf, oqsxkey->comp_privkey[i], buflen);

ASN1_STRING_set0(tempOct, buf, buflen);
Expand Down

0 comments on commit 47b069c

Please sign in to comment.