X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aaf%2Fauthz.git;a=blobdiff_plain;f=auth%2Fauth-cass%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fdao%2Fcached%2FFileGetter.java;h=10136272e1e6608b4fb9116e6340189d1062ce0f;hp=31e5069b206708beaf8e2c4eaf619d4ce6383224;hb=9b858def712cff7bf0aa16a4d69de1a5d9846af1;hpb=ea095eb9cdbb451f2310a262f3877c79f527cc8f diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java index 31e5069b..10136272 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java @@ -71,12 +71,19 @@ public class FileGetter { if(CredDAO.CERT_SHA256_RSA == type) { return; } + byte ba[]; CredDAO.Data cdd = new CredDAO.Data(); cdd.id=row.get(0); cdd.type = type; try { cdd.expires = sdf.parse(row.get(2)); - cdd.cred = ByteBuffer.wrap(Hash.fromHex(row.get(3))); + // Note: Note sure this can be null, but throwing was + // part of original "fromHex" method. Remove if you can + // prove ba will never be null J - May 19,2020 + if((ba=Hash.fromHex(row.get(3)))==null) { + throw new CadiException("Invalid Cred"); + } + cdd.cred = ByteBuffer.wrap(ba); cdd.notes= row.get(4); cdd.ns = row.get(5); cdd.other = Integer.parseInt(row.get(6));